@realsee/five 6.3.0-alpha.12 → 6.3.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/classes/five.Five.html +18 -18
- package/five/index.js +36 -36
- package/five/index.mjs +6 -6
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/index.js +2 -2
- package/plugins/index.mjs +2 -2
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +2 -2
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +2 -2
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +4 -4
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
package/five/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 11/29
|
|
5
|
-
* Version: 6.3.0-alpha.
|
|
4
|
+
* Generated: 2024/11/29
|
|
5
|
+
* Version: 6.3.0-alpha.13
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -339,12 +339,12 @@
|
|
|
339
339
|
*
|
|
340
340
|
* https://code.google.com/p/crypto-js/wiki/License
|
|
341
341
|
* PART: ext/cryptojs
|
|
342
|
-
*/var ne={},Ee=Ee||function(n,t){var e={},r=e.lib={},i=r.Base=function(){function m(){}return{extend:function(A){m.prototype=this;var h=new m;return A&&h.mixIn(A),h.hasOwnProperty("init")||(h.init=function(){h.$super.init.apply(this,arguments)}),h.init.prototype=h,h.$super=this,h},create:function(){var A=this.extend();return A.init.apply(A,arguments),A},init:function(){},mixIn:function(A){for(var h in A)A.hasOwnProperty(h)&&(this[h]=A[h]);A.hasOwnProperty("toString")&&(this.toString=A.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=r.WordArray=i.extend({init:function(m,A){m=this.words=m||[],A!=t?this.sigBytes=A:this.sigBytes=m.length*4},toString:function(m){return(m||s).stringify(this)},concat:function(m){var A=this.words,h=m.words,p=this.sigBytes,g=m.sigBytes;if(this.clamp(),p%4)for(var v=0;v<g;v++){var y=h[v>>>2]>>>24-v%4*8&255;A[p+v>>>2]|=y<<24-(p+v)%4*8}else for(var v=0;v<g;v+=4)A[p+v>>>2]=h[v>>>2];return this.sigBytes+=g,this},clamp:function(){var m=this.words,A=this.sigBytes;m[A>>>2]&=4294967295<<32-A%4*8,m.length=n.ceil(A/4)},clone:function(){var m=i.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var A=[],h=0;h<m;h+=4)A.push(n.random()*4294967296|0);return new a.init(A,m)}}),o=e.enc={},s=o.Hex={stringify:function(m){for(var A=m.words,h=m.sigBytes,p=[],g=0;g<h;g++){var v=A[g>>>2]>>>24-g%4*8&255;p.push((v>>>4).toString(16)),p.push((v&15).toString(16))}return p.join("")},parse:function(m){for(var A=m.length,h=[],p=0;p<A;p+=2)h[p>>>3]|=parseInt(m.substr(p,2),16)<<24-p%8*4;return new a.init(h,A/2)}},l=o.Latin1={stringify:function(m){for(var A=m.words,h=m.sigBytes,p=[],g=0;g<h;g++){var v=A[g>>>2]>>>24-g%4*8&255;p.push(String.fromCharCode(v))}return p.join("")},parse:function(m){for(var A=m.length,h=[],p=0;p<A;p++)h[p>>>2]|=(m.charCodeAt(p)&255)<<24-p%4*8;return new a.init(h,A)}},u=o.Utf8={stringify:function(m){try{return decodeURIComponent(escape(l.stringify(m)))}catch(A){throw new Error("Malformed UTF-8 data")}},parse:function(m){return l.parse(unescape(encodeURIComponent(m)))}},c=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(m){typeof m=="string"&&(m=u.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes},_process:function(m){var A=this._data,h=A.words,p=A.sigBytes,g=this.blockSize,v=g*4,y=p/v;m?y=n.ceil(y):y=n.max((y|0)-this._minBufferSize,0);var b=y*g,x=n.min(b*4,p);if(b){for(var w=0;w<b;w+=g)this._doProcessBlock(h,w);var E=h.splice(0,b);A.sigBytes-=x}return new a.init(E,x)},clone:function(){var m=i.clone.call(this);return m._data=this._data.clone(),m},_minBufferSize:0});r.Hasher=c.extend({cfg:i.extend(),init:function(m){this.cfg=this.cfg.extend(m),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(m){return this._append(m),this._process(),this},finalize:function(m){m&&this._append(m);var A=this._doFinalize();return A},blockSize:512/32,_createHelper:function(m){return function(A,h){return new m.init(h).finalize(A)}},_createHmacHelper:function(m){return function(A,h){return new f.HMAC.init(m,h).finalize(A)}}});var f=e.algo={};return e}(Math);(function(n){for(var t=Ee,A=t.lib,e=A.WordArray,r=A.Hasher,A=t.algo,i=[],a=[],o=function(p){return 4294967296*(p-(p|0))|0},s=2,l=0;64>l;){var u;e:{u=s;for(var c=n.sqrt(u),f=2;f<=c;f++)if(!(u%f)){u=!1;break e}u=!0}u&&(8>l&&(i[l]=o(n.pow(s,.5))),a[l]=o(n.pow(s,1/3)),l++),s++}var m=[],A=A.SHA256=r.extend({_doReset:function(){this._hash=new e.init(i.slice(0))},_doProcessBlock:function(h,p){for(var g=this._hash.words,v=g[0],y=g[1],b=g[2],x=g[3],w=g[4],E=g[5],C=g[6],M=g[7],R=0;64>R;R++){if(16>R)m[R]=h[p+R]|0;else{var L=m[R-15],S=m[R-2];m[R]=((L<<25|L>>>7)^(L<<14|L>>>18)^L>>>3)+m[R-7]+((S<<15|S>>>17)^(S<<13|S>>>19)^S>>>10)+m[R-16]}L=M+((w<<26|w>>>6)^(w<<21|w>>>11)^(w<<7|w>>>25))+(w&E^~w&C)+a[R]+m[R],S=((v<<30|v>>>2)^(v<<19|v>>>13)^(v<<10|v>>>22))+(v&y^v&b^y&b),M=C,C=E,E=w,w=x+L|0,x=b,b=y,y=v,v=L+S|0}g[0]=g[0]+v|0,g[1]=g[1]+y|0,g[2]=g[2]+b|0,g[3]=g[3]+x|0,g[4]=g[4]+w|0,g[5]=g[5]+E|0,g[6]=g[6]+C|0,g[7]=g[7]+M|0},_doFinalize:function(){var h=this._data,p=h.words,g=8*this._nDataBytes,v=8*h.sigBytes;return p[v>>>5]|=128<<24-v%32,p[(v+64>>>9<<4)+14]=n.floor(g/4294967296),p[(v+64>>>9<<4)+15]=g,h.sigBytes=4*p.length,this._process(),this._hash},clone:function(){var h=r.clone.call(this);return h._hash=this._hash.clone(),h}});t.SHA256=r._createHelper(A),t.HmacSHA256=r._createHmacHelper(A)})(Math);Ee.lib.Cipher||function(n){var A=Ee,t=A.lib,e=t.Base,r=t.WordArray,i=t.BufferedBlockAlgorithm,a=A.enc.Base64,o=A.algo.EvpKDF,s=t.Cipher=i.extend({cfg:e.extend(),createEncryptor:function(p,g){return this.create(this._ENC_XFORM_MODE,p,g)},createDecryptor:function(p,g){return this.create(this._DEC_XFORM_MODE,p,g)},init:function(p,g,v){this.cfg=this.cfg.extend(v),this._xformMode=p,this._key=g,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(p){return this._append(p),this._process()},finalize:function(p){return p&&this._append(p),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(p){return{encrypt:function(g,v,y){return(typeof v=="string"?h:m).encrypt(p,g,v,y)},decrypt:function(g,v,y){return(typeof v=="string"?h:m).decrypt(p,g,v,y)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var f=A.mode={},l=function(p,g,v){var y=this._iv;y?this._iv=n:y=this._prevBlock;for(var b=0;b<v;b++)p[g+b]^=y[b]},u=(t.BlockCipherMode=e.extend({createEncryptor:function(p,g){return this.Encryptor.create(p,g)},createDecryptor:function(p,g){return this.Decryptor.create(p,g)},init:function(p,g){this._cipher=p,this._iv=g}})).extend();u.Encryptor=u.extend({processBlock:function(p,g){var v=this._cipher,y=v.blockSize;l.call(this,p,g,y),v.encryptBlock(p,g),this._prevBlock=p.slice(g,g+y)}}),u.Decryptor=u.extend({processBlock:function(p,g){var v=this._cipher,y=v.blockSize,b=p.slice(g,g+y);v.decryptBlock(p,g),l.call(this,p,g,y),this._prevBlock=b}}),f=f.CBC=u,u=(A.pad={}).Pkcs7={pad:function(p,g){for(var v=4*g,v=v-p.sigBytes%v,y=v<<24|v<<16|v<<8|v,b=[],x=0;x<v;x+=4)b.push(y);v=r.create(b,v),p.concat(v)},unpad:function(p){p.sigBytes-=p.words[p.sigBytes-1>>>2]&255}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:f,padding:u}),reset:function(){s.reset.call(this);var g=this.cfg,p=g.iv,g=g.mode;if(this._xformMode==this._ENC_XFORM_MODE)var v=g.createEncryptor;else v=g.createDecryptor,this._minBufferSize=1;this._mode=v.call(g,this,p&&p.words)},_doProcessBlock:function(p,g){this._mode.processBlock(p,g)},_doFinalize:function(){var p=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){p.pad(this._data,this.blockSize);var g=this._process(!0)}else g=this._process(!0),p.unpad(g);return g},blockSize:4});var c=t.CipherParams=e.extend({init:function(p){this.mixIn(p)},toString:function(p){return(p||this.formatter).stringify(this)}}),f=(A.format={}).OpenSSL={stringify:function(p){var g=p.ciphertext;return p=p.salt,(p?r.create([1398893684,1701076831]).concat(p).concat(g):g).toString(a)},parse:function(p){p=a.parse(p);var g=p.words;if(g[0]==1398893684&&g[1]==1701076831){var v=r.create(g.slice(2,4));g.splice(0,4),p.sigBytes-=16}return c.create({ciphertext:p,salt:v})}},m=t.SerializableCipher=e.extend({cfg:e.extend({format:f}),encrypt:function(p,g,v,y){y=this.cfg.extend(y);var b=p.createEncryptor(v,y);return g=b.finalize(g),b=b.cfg,c.create({ciphertext:g,key:v,iv:b.iv,algorithm:p,mode:b.mode,padding:b.padding,blockSize:p.blockSize,formatter:y.format})},decrypt:function(p,g,v,y){return y=this.cfg.extend(y),g=this._parse(g,y.format),p.createDecryptor(v,y).finalize(g.ciphertext)},_parse:function(p,g){return typeof p=="string"?g.parse(p,this):p}}),A=(A.kdf={}).OpenSSL={execute:function(p,g,v,y){return y||(y=r.random(8)),p=o.create({keySize:g+v}).compute(p,y),v=r.create(p.words.slice(g),4*v),p.sigBytes=4*g,c.create({key:p,iv:v,salt:y})}},h=t.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:A}),encrypt:function(p,g,v,y){return y=this.cfg.extend(y),v=y.kdf.execute(v,p.keySize,p.ivSize),y.iv=v.iv,p=m.encrypt.call(this,p,g,v.key,y),p.mixIn(v),p},decrypt:function(p,g,v,y){return y=this.cfg.extend(y),g=this._parse(g,y.format),v=y.kdf.execute(v,p.keySize,p.ivSize,g.salt),y.iv=v.iv,m.decrypt.call(this,p,g,v.key,y)}})}();(function(){for(var n=Ee,t=n.lib.BlockCipher,E=n.algo,e=[],r=[],i=[],a=[],o=[],s=[],l=[],u=[],c=[],f=[],m=[],A=0;256>A;A++)m[A]=128>A?A<<1:A<<1^283;for(var h=0,p=0,A=0;256>A;A++){var g=p^p<<1^p<<2^p<<3^p<<4,g=g>>>8^g&255^99;e[h]=g,r[g]=h;var v=m[h],y=m[v],b=m[y],x=257*m[g]^16843008*g;i[h]=x<<24|x>>>8,a[h]=x<<16|x>>>16,o[h]=x<<8|x>>>24,s[h]=x,x=16843009*b^65537*y^257*v^16843008*h,l[g]=x<<24|x>>>8,u[g]=x<<16|x>>>16,c[g]=x<<8|x>>>24,f[g]=x,h?(h=v^m[m[m[b^v]]],p^=m[m[p]]):h=p=1}var w=[0,1,2,4,8,16,32,64,128,27,54],E=E.AES=t.extend({_doReset:function(){for(var R=this._key,C=R.words,M=R.sigBytes/4,R=4*((this._nRounds=M+6)+1),L=this._keySchedule=[],S=0;S<R;S++)if(S<M)L[S]=C[S];else{var I=L[S-1];S%M?6<M&&S%M==4&&(I=e[I>>>24]<<24|e[I>>>16&255]<<16|e[I>>>8&255]<<8|e[I&255]):(I=I<<8|I>>>24,I=e[I>>>24]<<24|e[I>>>16&255]<<16|e[I>>>8&255]<<8|e[I&255],I^=w[S/M|0]<<24),L[S]=L[S-M]^I}for(C=this._invKeySchedule=[],M=0;M<R;M++)S=R-M,I=M%4?L[S]:L[S-4],C[M]=4>M||4>=S?I:l[e[I>>>24]]^u[e[I>>>16&255]]^c[e[I>>>8&255]]^f[e[I&255]]},encryptBlock:function(C,M){this._doCryptBlock(C,M,this._keySchedule,i,a,o,s,e)},decryptBlock:function(C,M){var R=C[M+1];C[M+1]=C[M+3],C[M+3]=R,this._doCryptBlock(C,M,this._invKeySchedule,l,u,c,f,r),R=C[M+1],C[M+1]=C[M+3],C[M+3]=R},_doCryptBlock:function(C,M,R,L,S,I,O,P){for(var F=this._nRounds,j=C[M]^R[0],J=C[M+1]^R[1],X=C[M+2]^R[2],K=C[M+3]^R[3],V=4,D=1;D<F;D++)var z=L[j>>>24]^S[J>>>16&255]^I[X>>>8&255]^O[K&255]^R[V++],U=L[J>>>24]^S[X>>>16&255]^I[K>>>8&255]^O[j&255]^R[V++],q=L[X>>>24]^S[K>>>16&255]^I[j>>>8&255]^O[J&255]^R[V++],K=L[K>>>24]^S[j>>>16&255]^I[J>>>8&255]^O[X&255]^R[V++],j=z,J=U,X=q;z=(P[j>>>24]<<24|P[J>>>16&255]<<16|P[X>>>8&255]<<8|P[K&255])^R[V++],U=(P[J>>>24]<<24|P[X>>>16&255]<<16|P[K>>>8&255]<<8|P[j&255])^R[V++],q=(P[X>>>24]<<24|P[K>>>16&255]<<16|P[j>>>8&255]<<8|P[J&255])^R[V++],K=(P[K>>>24]<<24|P[j>>>16&255]<<16|P[J>>>8&255]<<8|P[X&255])^R[V++],C[M]=z,C[M+1]=U,C[M+2]=q,C[M+3]=K},keySize:8});n.AES=t._createHelper(E)})();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
343
|
-
*/var Hr;function de(n,t,e){n!=null&&(typeof n=="number"?this.fromNumber(n,t,e):t==null&&typeof n!="string"?this.fromString(n,256):this.fromString(n,t))}function Qt(){return new de(null)}function vl(n,t,e,r,i,a){for(;--a>=0;){var o=t*this[n++]+e[r]+i;i=Math.floor(o/67108864),e[r++]=o&67108863}return i}function ml(n,t,e,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var l=this[n]&32767,u=this[n++]>>15,c=s*l+u*o;l=o*l+((c&32767)<<15)+e[r]+(i&1073741823),i=(l>>>30)+(c>>>15)+s*u+(i>>>30),e[r++]=l&1073741823}return i}function Al(n,t,e,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var l=this[n]&16383,u=this[n++]>>14,c=s*l+u*o;l=o*l+((c&16383)<<14)+e[r]+i,i=(l>>28)+(c>>14)+s*u,e[r++]=l&268435455}return i}typeof navigator!="undefined"&&navigator.appName=="Microsoft Internet Explorer"?(de.prototype.am=ml,Hr=30):typeof navigator!="undefined"&&navigator.appName!="Netscape"?(de.prototype.am=vl,Hr=26):(de.prototype.am=Al,Hr=28);de.prototype.DB=Hr;de.prototype.DM=(1<<Hr)-1;de.prototype.DV=1<<Hr;var ao=52;de.prototype.FV=Math.pow(2,ao);de.prototype.F1=ao-Hr;de.prototype.F2=2*Hr-ao;var gl="0123456789abcdefghijklmnopqrstuvwxyz",Di=new Array,In,Vt;In=48;for(Vt=0;Vt<=9;++Vt)Di[In++]=Vt;In=97;for(Vt=10;Vt<36;++Vt)Di[In++]=Vt;In=65;for(Vt=10;Vt<36;++Vt)Di[In++]=Vt;function wr(n){return gl.charAt(n)}function yl(n,t){var e=Di[n.charCodeAt(t)];return e==null?-1:e}function bl(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function xl(n){this.t=1,this.s=n<0?-1:0,n>0?this[0]=n:n<-1?this[0]=n+this.DV:this.t=0}function oo(n){var t=Qt();return t.fromInt(n),t}function wl(n,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(n,t);return}this.t=0,this.s=0;for(var r=n.length,i=!1,a=0;--r>=0;){var o=e==8?n[r]&255:yl(n,r);if(o<0){n.charAt(r)=="-"&&(i=!0);continue}i=!1,a==0?this[this.t++]=o:a+e>this.DB?(this[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this[this.t++]=o>>this.DB-a):this[this.t-1]|=o<<a,a+=e,a>=this.DB&&(a-=this.DB)}e==8&&n[0]&128&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&de.ZERO.subTo(this,this)}function El(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function Sl(n){if(this.s<0)return"-"+this.negate().toString(n);var t;if(n==16)t=4;else if(n==8)t=3;else if(n==2)t=1;else if(n==32)t=5;else if(n==4)t=2;else return this.toRadix(n);var e=(1<<t)-1,r,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this[o]>>s)>0&&(i=!0,a=wr(r));o>=0;)s<t?(r=(this[o]&(1<<s)-1)<<t-s,r|=this[--o]>>(s+=this.DB-t)):(r=this[o]>>(s-=t)&e,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=wr(r));return i?a:"0"}function Cl(){var n=Qt();return de.ZERO.subTo(this,n),n}function Ml(){return this.s<0?this.negate():this}function Il(n){var t=this.s-n.s;if(t!=0)return t;var e=this.t;if(t=e-n.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-n[e])!=0)return t;return 0}function so(n){var t=1,e;return(e=n>>>16)!=0&&(n=e,t+=16),(e=n>>8)!=0&&(n=e,t+=8),(e=n>>4)!=0&&(n=e,t+=4),(e=n>>2)!=0&&(n=e,t+=2),(e=n>>1)!=0&&(n=e,t+=1),t}function Tl(){return this.t<=0?0:this.DB*(this.t-1)+so(this[this.t-1]^this.s&this.DM)}function Pl(n,t){var e;for(e=this.t-1;e>=0;--e)t[e+n]=this[e];for(e=n-1;e>=0;--e)t[e]=0;t.t=this.t+n,t.s=this.s}function Bl(n,t){for(var e=n;e<this.t;++e)t[e-n]=this[e];t.t=Math.max(this.t-n,0),t.s=this.s}function Rl(n,t){var e=n%this.DB,r=this.DB-e,i=(1<<r)-1,a=Math.floor(n/this.DB),o=this.s<<e&this.DM,s;for(s=this.t-1;s>=0;--s)t[s+a+1]=this[s]>>r|o,o=(this[s]&i)<<e;for(s=a-1;s>=0;--s)t[s]=0;t[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function Fl(n,t){t.s=this.s;var e=Math.floor(n/this.DB);if(e>=this.t){t.t=0;return}var r=n%this.DB,i=this.DB-r,a=(1<<r)-1;t[0]=this[e]>>r;for(var o=e+1;o<this.t;++o)t[o-e-1]|=(this[o]&a)<<i,t[o-e]=this[o]>>r;r>0&&(t[this.t-e-1]|=(this.s&a)<<i),t.t=this.t-e,t.clamp()}function kl(n,t){for(var e=0,r=0,i=Math.min(n.t,this.t);e<i;)r+=this[e]-n[e],t[e++]=r&this.DM,r>>=this.DB;if(n.t<this.t){for(r-=n.s;e<this.t;)r+=this[e],t[e++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;e<n.t;)r-=n[e],t[e++]=r&this.DM,r>>=this.DB;r-=n.s}t.s=r<0?-1:0,r<-1?t[e++]=this.DV+r:r>0&&(t[e++]=r),t.t=e,t.clamp()}function Ll(n,t){var e=this.abs(),r=n.abs(),i=e.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+e.t]=e.am(0,r[i],t,i,0,e.t);t.s=0,t.clamp(),this.s!=n.s&&de.ZERO.subTo(t,t)}function Ol(n){for(var t=this.abs(),e=n.t=2*t.t;--e>=0;)n[e]=0;for(e=0;e<t.t-1;++e){var r=t.am(e,t[e],n,2*e,0,1);(n[e+t.t]+=t.am(e+1,2*t[e],n,2*e+1,r,t.t-e-1))>=t.DV&&(n[e+t.t]-=t.DV,n[e+t.t+1]=1)}n.t>0&&(n[n.t-1]+=t.am(e,t[e],n,2*e,0,1)),n.s=0,n.clamp()}function Vl(n,t,e){var r=n.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=Qt());var a=Qt(),o=this.s,s=n.s,l=this.DB-so(r[r.t-1]);l>0?(r.lShiftTo(l,a),i.lShiftTo(l,e)):(r.copyTo(a),i.copyTo(e));var u=a.t,c=a[u-1];if(c!=0){var f=c*(1<<this.F1)+(u>1?a[u-2]>>this.F2:0),m=this.FV/f,A=(1<<this.F1)/f,h=1<<this.F2,p=e.t,g=p-u,v=t==null?Qt():t;for(a.dlShiftTo(g,v),e.compareTo(v)>=0&&(e[e.t++]=1,e.subTo(v,e)),de.ONE.dlShiftTo(u,v),v.subTo(a,a);a.t<u;)a[a.t++]=0;for(;--g>=0;){var y=e[--p]==c?this.DM:Math.floor(e[p]*m+(e[p-1]+h)*A);if((e[p]+=a.am(0,y,e,g,0,u))<y)for(a.dlShiftTo(g,v),e.subTo(v,e);e[p]<--y;)e.subTo(v,e)}t!=null&&(e.drShiftTo(u,t),o!=s&&de.ZERO.subTo(t,t)),e.t=u,e.clamp(),l>0&&e.rShiftTo(l,e),o<0&&de.ZERO.subTo(e,e)}}}function Nl(n){var t=Qt();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(de.ZERO)>0&&n.subTo(t,t),t}function Tn(n){this.m=n}function Dl(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function zl(n){return n}function Ql(n){n.divRemTo(this.m,null,n)}function Ul(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function ql(n,t){n.squareTo(t),this.reduce(t)}Tn.prototype.convert=Dl;Tn.prototype.revert=zl;Tn.prototype.reduce=Ql;Tn.prototype.mulTo=Ul;Tn.prototype.sqrTo=ql;function Hl(){if(this.t<1)return 0;var n=this[0];if(!(n&1))return 0;var t=n&3;return t=t*(2-(n&15)*t)&15,t=t*(2-(n&255)*t)&255,t=t*(2-((n&65535)*t&65535))&65535,t=t*(2-n*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Pn(n){this.m=n,this.mp=n.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<n.DB-15)-1,this.mt2=2*n.t}function Gl(n){var t=Qt();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(de.ZERO)>0&&this.m.subTo(t,t),t}function Kl(n){var t=Qt();return n.copyTo(t),this.reduce(t),t}function jl(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var t=0;t<this.m.t;++t){var e=n[t]&32767,r=e*this.mpl+((e*this.mph+(n[t]>>15)*this.mpl&this.um)<<15)&n.DM;for(e=t+this.m.t,n[e]+=this.m.am(0,r,n,t,0,this.m.t);n[e]>=n.DV;)n[e]-=n.DV,n[++e]++}n.clamp(),n.drShiftTo(this.m.t,n),n.compareTo(this.m)>=0&&n.subTo(this.m,n)}function _l(n,t){n.squareTo(t),this.reduce(t)}function Jl(n,t,e){n.multiplyTo(t,e),this.reduce(e)}Pn.prototype.convert=Gl;Pn.prototype.revert=Kl;Pn.prototype.reduce=jl;Pn.prototype.mulTo=Jl;Pn.prototype.sqrTo=_l;function Xl(){return(this.t>0?this[0]&1:this.s)==0}function Wl(n,t){if(n>4294967295||n<1)return de.ONE;var e=Qt(),r=Qt(),i=t.convert(this),a=so(n)-1;for(i.copyTo(e);--a>=0;)if(t.sqrTo(e,r),(n&1<<a)>0)t.mulTo(r,i,e);else{var o=e;e=r,r=o}return t.revert(e)}function Zl(n,t){var e;return n<256||t.isEven()?e=new Tn(t):e=new Pn(t),this.exp(n,e)}de.prototype.copyTo=bl;de.prototype.fromInt=xl;de.prototype.fromString=wl;de.prototype.clamp=El;de.prototype.dlShiftTo=Pl;de.prototype.drShiftTo=Bl;de.prototype.lShiftTo=Rl;de.prototype.rShiftTo=Fl;de.prototype.subTo=kl;de.prototype.multiplyTo=Ll;de.prototype.squareTo=Ol;de.prototype.divRemTo=Vl;de.prototype.invDigit=Hl;de.prototype.isEven=Xl;de.prototype.exp=Wl;de.prototype.toString=Sl;de.prototype.negate=Cl;de.prototype.abs=Ml;de.prototype.compareTo=Il;de.prototype.bitLength=Tl;de.prototype.mod=Nl;de.prototype.modPowInt=Zl;de.ZERO=oo(0);de.ONE=oo(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Yl(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function $l(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function ec(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function tc(n){if(n==null&&(n=10),this.signum()==0||n<2||n>36)return"0";var t=this.chunkSize(n),e=Math.pow(n,t),r=oo(e),i=Qt(),a=Qt(),o="";for(this.divRemTo(r,i,a);i.signum()>0;)o=(e+a.intValue()).toString(n).substr(1)+o,i.divRemTo(r,i,a);return a.intValue().toString(n)+o}de.prototype.chunkSize=$l;de.prototype.toRadix=tc;de.prototype.intValue=Yl;de.prototype.signum=ec;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var xn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S0="=";function rc(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=xn.charAt(e>>6)+xn.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=xn.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=xn.charAt(e>>2)+xn.charAt((e&3)<<4));(r.length&3)>0;)r+=S0;return r}function uo(n){var t="",e,r=0,i,a;for(e=0;e<n.length&&n.charAt(e)!=S0;++e)a=xn.indexOf(n.charAt(e)),!(a<0)&&(r==0?(t+=wr(a>>2),i=a&3,r=1):r==1?(t+=wr(i<<2|a>>4),i=a&15,r=2):r==2?(t+=wr(i),t+=wr(a>>2),i=a&3,r=3):(t+=wr(i<<2|a>>4),t+=wr(a&15),r=0));return r==1&&(t+=wr(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function wt(n,t){return new de(n,t)}function nc(n,t){if(t<n.length+11)throw"Message too long for RSA";for(var e=new Array,r=n.length-1;r>=0&&t>0;){var i=n.charCodeAt(r--);i<128?e[--t]=i:i>127&&i<2048?(e[--t]=i&63|128,e[--t]=i>>6|192):(e[--t]=i&63|128,e[--t]=i>>6&63|128,e[--t]=i>>12|224)}e[--t]=0;for(var a=new SecureRandom,o=new Array;t>2;){for(o[0]=0;o[0]==0;)a.nextBytes(o);e[--t]=o[0]}return e[--t]=2,e[--t]=0,new de(e)}function Go(n,t,e){for(var r="",i=0;r.length<t;)r+=e(String.fromCharCode.apply(String,n.concat([(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255]))),i+=1;return r}function ic(n,t,e,r){var i=ne.crypto.MessageDigest,a=ne.crypto.Util,o=null;if(e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(p){return Sr(a.hashHex(zi(p),o))}),n.length+2*r+2>t)throw"Message too long for RSA";var s="",l;for(l=0;l<t-n.length-2*r-2;l+=1)s+="\0";var u=e("")+s+""+n,c=new Array(r);new SecureRandom().nextBytes(c);var f=Go(c,u.length,e),m=[];for(l=0;l<u.length;l+=1)m[l]=u.charCodeAt(l)^f.charCodeAt(l);var A=Go(m,c.length,e),h=[0];for(l=0;l<c.length;l+=1)h[l+1]=c[l]^A.charCodeAt(l);return new de(h.concat(m))}function Be(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function ac(n,t){if(this.isPublic=!0,this.isPrivate=!1,typeof n!="string")this.n=n,this.e=t;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=wt(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function oc(n){return n.modPowInt(this.e,this.n)}function sc(n){var t=nc(n,this.n.bitLength()+7>>3);if(t==null)return null;var e=this.doPublic(t);if(e==null)return null;var r=e.toString(16);return r.length&1?"0"+r:r}function uc(n,t,e){var r=ic(n,this.n.bitLength()+7>>3,t,e);if(r==null)return null;var i=this.doPublic(r);if(i==null)return null;var a=i.toString(16);return a.length&1?"0"+a:a}Be.prototype.doPublic=oc;Be.prototype.setPublic=ac;Be.prototype.encrypt=sc;Be.prototype.encryptOAEP=uc;Be.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function lc(n,t){for(var e=n.toByteArray(),r=0;r<e.length&&e[r]==0;)++r;if(e.length-r!=t-1||e[r]!=2)return null;for(++r;e[r]!=0;)if(++r>=e.length)return null;for(var i="";++r<e.length;){var a=e[r]&255;a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((a&31)<<6|e[r+1]&63),++r):(i+=String.fromCharCode((a&15)<<12|(e[r+1]&63)<<6|e[r+2]&63),r+=2)}return i}function Ko(n,t,e){for(var r="",i=0;r.length<t;)r+=e(n+String.fromCharCode.apply(String,[(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255])),i+=1;return r}function cc(n,t,e,r){var i=ne.crypto.MessageDigest,a=ne.crypto.Util,o=null;e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(g){return Sr(a.hashHex(zi(g),o))}),n=n.toByteArray();var f;for(f=0;f<n.length;f+=1)n[f]&=255;for(;n.length<t;)n.unshift(0);if(n=String.fromCharCode.apply(String,n),n.length<2*r+2)throw"Cipher too short";var s=n.substr(1,r),l=n.substr(r+1),u=Ko(l,r,e),c=[],f;for(f=0;f<s.length;f+=1)c[f]=s.charCodeAt(f)^u.charCodeAt(f);var m=Ko(String.fromCharCode.apply(String,c),n.length-r,e),A=[];for(f=0;f<l.length;f+=1)A[f]=l.charCodeAt(f)^m.charCodeAt(f);if(A=String.fromCharCode.apply(String,A),A.substr(0,r)!==e(""))throw"Hash mismatch";A=A.substr(r);var h=A.indexOf(""),p=h!=-1?A.substr(0,h).lastIndexOf("\0"):-1;if(p+1!=h)throw"Malformed data";return A.substr(h+1)}function dc(n,t,e){if(this.isPrivate=!0,typeof n!="string")this.n=n,this.e=t,this.d=e;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=wt(n,16),this.e=parseInt(t,16),this.d=wt(e,16);else throw"Invalid RSA private key"}function fc(n,t,e,r,i,a,o,s){if(this.isPrivate=!0,this.isPublic=!1,n==null)throw"RSASetPrivateEx N == null";if(t==null)throw"RSASetPrivateEx E == null";if(n.length==0)throw"RSASetPrivateEx N.length == 0";if(t.length==0)throw"RSASetPrivateEx E.length == 0";if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=wt(n,16),this.e=parseInt(t,16),this.d=wt(e,16),this.p=wt(r,16),this.q=wt(i,16),this.dmp1=wt(a,16),this.dmq1=wt(o,16),this.coeff=wt(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function hc(n){if(this.p==null||this.q==null)return n.modPow(this.d,this.n);for(var t=n.mod(this.p).modPow(this.dmp1,this.p),e=n.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(e)<0;)t=t.add(this.p);return t.subtract(e).multiply(this.coeff).mod(this.p).multiply(this.q).add(e)}function pc(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=wt(n,16),e=this.doPrivate(t);return e==null?null:lc(e,this.n.bitLength()+7>>3)}function vc(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=wt(n,16),i=this.doPrivate(r);return i==null?null:cc(i,this.n.bitLength()+7>>3,t,e)}Be.prototype.doPrivate=hc;Be.prototype.setPrivate=dc;Be.prototype.setPrivateEx=fc;Be.prototype.decrypt=pc;Be.prototype.decryptOAEP=vc;(typeof ne.lang=="undefined"||!ne.lang)&&(ne.lang={});ne.lang.String=function(){};function mc(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function et(n){return uo(mc(n))}function lr(n){return decodeURIComponent(xc(n))}function Sr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function zi(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function Ac(n){return rc(n)}function gc(n){var t=Ac(n),e=t.replace(/(.{64})/g,`$1\r
|
|
342
|
+
*/var ne={},Ee=Ee||function(n,t){var e={},r=e.lib={},i=r.Base=function(){function m(){}return{extend:function(A){m.prototype=this;var h=new m;return A&&h.mixIn(A),h.hasOwnProperty("init")||(h.init=function(){h.$super.init.apply(this,arguments)}),h.init.prototype=h,h.$super=this,h},create:function(){var A=this.extend();return A.init.apply(A,arguments),A},init:function(){},mixIn:function(A){for(var h in A)A.hasOwnProperty(h)&&(this[h]=A[h]);A.hasOwnProperty("toString")&&(this.toString=A.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=r.WordArray=i.extend({init:function(m,A){m=this.words=m||[],A!=t?this.sigBytes=A:this.sigBytes=m.length*4},toString:function(m){return(m||s).stringify(this)},concat:function(m){var A=this.words,h=m.words,p=this.sigBytes,g=m.sigBytes;if(this.clamp(),p%4)for(var v=0;v<g;v++){var y=h[v>>>2]>>>24-v%4*8&255;A[p+v>>>2]|=y<<24-(p+v)%4*8}else for(var v=0;v<g;v+=4)A[p+v>>>2]=h[v>>>2];return this.sigBytes+=g,this},clamp:function(){var m=this.words,A=this.sigBytes;m[A>>>2]&=4294967295<<32-A%4*8,m.length=n.ceil(A/4)},clone:function(){var m=i.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var A=[],h=0;h<m;h+=4)A.push(n.random()*4294967296|0);return new a.init(A,m)}}),o=e.enc={},s=o.Hex={stringify:function(m){for(var A=m.words,h=m.sigBytes,p=[],g=0;g<h;g++){var v=A[g>>>2]>>>24-g%4*8&255;p.push((v>>>4).toString(16)),p.push((v&15).toString(16))}return p.join("")},parse:function(m){for(var A=m.length,h=[],p=0;p<A;p+=2)h[p>>>3]|=parseInt(m.substr(p,2),16)<<24-p%8*4;return new a.init(h,A/2)}},l=o.Latin1={stringify:function(m){for(var A=m.words,h=m.sigBytes,p=[],g=0;g<h;g++){var v=A[g>>>2]>>>24-g%4*8&255;p.push(String.fromCharCode(v))}return p.join("")},parse:function(m){for(var A=m.length,h=[],p=0;p<A;p++)h[p>>>2]|=(m.charCodeAt(p)&255)<<24-p%4*8;return new a.init(h,A)}},u=o.Utf8={stringify:function(m){try{return decodeURIComponent(escape(l.stringify(m)))}catch(A){throw new Error("Malformed UTF-8 data")}},parse:function(m){return l.parse(unescape(encodeURIComponent(m)))}},c=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(m){typeof m=="string"&&(m=u.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes},_process:function(m){var A=this._data,h=A.words,p=A.sigBytes,g=this.blockSize,v=g*4,y=p/v;m?y=n.ceil(y):y=n.max((y|0)-this._minBufferSize,0);var b=y*g,x=n.min(b*4,p);if(b){for(var w=0;w<b;w+=g)this._doProcessBlock(h,w);var E=h.splice(0,b);A.sigBytes-=x}return new a.init(E,x)},clone:function(){var m=i.clone.call(this);return m._data=this._data.clone(),m},_minBufferSize:0});r.Hasher=c.extend({cfg:i.extend(),init:function(m){this.cfg=this.cfg.extend(m),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(m){return this._append(m),this._process(),this},finalize:function(m){m&&this._append(m);var A=this._doFinalize();return A},blockSize:512/32,_createHelper:function(m){return function(A,h){return new m.init(h).finalize(A)}},_createHmacHelper:function(m){return function(A,h){return new f.HMAC.init(m,h).finalize(A)}}});var f=e.algo={};return e}(Math);(function(n){for(var t=Ee,A=t.lib,e=A.WordArray,r=A.Hasher,A=t.algo,i=[],a=[],o=function(p){return 4294967296*(p-(p|0))|0},s=2,l=0;64>l;){var u;e:{u=s;for(var c=n.sqrt(u),f=2;f<=c;f++)if(!(u%f)){u=!1;break e}u=!0}u&&(8>l&&(i[l]=o(n.pow(s,.5))),a[l]=o(n.pow(s,1/3)),l++),s++}var m=[],A=A.SHA256=r.extend({_doReset:function(){this._hash=new e.init(i.slice(0))},_doProcessBlock:function(h,p){for(var g=this._hash.words,v=g[0],y=g[1],b=g[2],x=g[3],w=g[4],E=g[5],M=g[6],C=g[7],R=0;64>R;R++){if(16>R)m[R]=h[p+R]|0;else{var L=m[R-15],S=m[R-2];m[R]=((L<<25|L>>>7)^(L<<14|L>>>18)^L>>>3)+m[R-7]+((S<<15|S>>>17)^(S<<13|S>>>19)^S>>>10)+m[R-16]}L=C+((w<<26|w>>>6)^(w<<21|w>>>11)^(w<<7|w>>>25))+(w&E^~w&M)+a[R]+m[R],S=((v<<30|v>>>2)^(v<<19|v>>>13)^(v<<10|v>>>22))+(v&y^v&b^y&b),C=M,M=E,E=w,w=x+L|0,x=b,b=y,y=v,v=L+S|0}g[0]=g[0]+v|0,g[1]=g[1]+y|0,g[2]=g[2]+b|0,g[3]=g[3]+x|0,g[4]=g[4]+w|0,g[5]=g[5]+E|0,g[6]=g[6]+M|0,g[7]=g[7]+C|0},_doFinalize:function(){var h=this._data,p=h.words,g=8*this._nDataBytes,v=8*h.sigBytes;return p[v>>>5]|=128<<24-v%32,p[(v+64>>>9<<4)+14]=n.floor(g/4294967296),p[(v+64>>>9<<4)+15]=g,h.sigBytes=4*p.length,this._process(),this._hash},clone:function(){var h=r.clone.call(this);return h._hash=this._hash.clone(),h}});t.SHA256=r._createHelper(A),t.HmacSHA256=r._createHmacHelper(A)})(Math);Ee.lib.Cipher||function(n){var A=Ee,t=A.lib,e=t.Base,r=t.WordArray,i=t.BufferedBlockAlgorithm,a=A.enc.Base64,o=A.algo.EvpKDF,s=t.Cipher=i.extend({cfg:e.extend(),createEncryptor:function(p,g){return this.create(this._ENC_XFORM_MODE,p,g)},createDecryptor:function(p,g){return this.create(this._DEC_XFORM_MODE,p,g)},init:function(p,g,v){this.cfg=this.cfg.extend(v),this._xformMode=p,this._key=g,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(p){return this._append(p),this._process()},finalize:function(p){return p&&this._append(p),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(p){return{encrypt:function(g,v,y){return(typeof v=="string"?h:m).encrypt(p,g,v,y)},decrypt:function(g,v,y){return(typeof v=="string"?h:m).decrypt(p,g,v,y)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var f=A.mode={},l=function(p,g,v){var y=this._iv;y?this._iv=n:y=this._prevBlock;for(var b=0;b<v;b++)p[g+b]^=y[b]},u=(t.BlockCipherMode=e.extend({createEncryptor:function(p,g){return this.Encryptor.create(p,g)},createDecryptor:function(p,g){return this.Decryptor.create(p,g)},init:function(p,g){this._cipher=p,this._iv=g}})).extend();u.Encryptor=u.extend({processBlock:function(p,g){var v=this._cipher,y=v.blockSize;l.call(this,p,g,y),v.encryptBlock(p,g),this._prevBlock=p.slice(g,g+y)}}),u.Decryptor=u.extend({processBlock:function(p,g){var v=this._cipher,y=v.blockSize,b=p.slice(g,g+y);v.decryptBlock(p,g),l.call(this,p,g,y),this._prevBlock=b}}),f=f.CBC=u,u=(A.pad={}).Pkcs7={pad:function(p,g){for(var v=4*g,v=v-p.sigBytes%v,y=v<<24|v<<16|v<<8|v,b=[],x=0;x<v;x+=4)b.push(y);v=r.create(b,v),p.concat(v)},unpad:function(p){p.sigBytes-=p.words[p.sigBytes-1>>>2]&255}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:f,padding:u}),reset:function(){s.reset.call(this);var g=this.cfg,p=g.iv,g=g.mode;if(this._xformMode==this._ENC_XFORM_MODE)var v=g.createEncryptor;else v=g.createDecryptor,this._minBufferSize=1;this._mode=v.call(g,this,p&&p.words)},_doProcessBlock:function(p,g){this._mode.processBlock(p,g)},_doFinalize:function(){var p=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){p.pad(this._data,this.blockSize);var g=this._process(!0)}else g=this._process(!0),p.unpad(g);return g},blockSize:4});var c=t.CipherParams=e.extend({init:function(p){this.mixIn(p)},toString:function(p){return(p||this.formatter).stringify(this)}}),f=(A.format={}).OpenSSL={stringify:function(p){var g=p.ciphertext;return p=p.salt,(p?r.create([1398893684,1701076831]).concat(p).concat(g):g).toString(a)},parse:function(p){p=a.parse(p);var g=p.words;if(g[0]==1398893684&&g[1]==1701076831){var v=r.create(g.slice(2,4));g.splice(0,4),p.sigBytes-=16}return c.create({ciphertext:p,salt:v})}},m=t.SerializableCipher=e.extend({cfg:e.extend({format:f}),encrypt:function(p,g,v,y){y=this.cfg.extend(y);var b=p.createEncryptor(v,y);return g=b.finalize(g),b=b.cfg,c.create({ciphertext:g,key:v,iv:b.iv,algorithm:p,mode:b.mode,padding:b.padding,blockSize:p.blockSize,formatter:y.format})},decrypt:function(p,g,v,y){return y=this.cfg.extend(y),g=this._parse(g,y.format),p.createDecryptor(v,y).finalize(g.ciphertext)},_parse:function(p,g){return typeof p=="string"?g.parse(p,this):p}}),A=(A.kdf={}).OpenSSL={execute:function(p,g,v,y){return y||(y=r.random(8)),p=o.create({keySize:g+v}).compute(p,y),v=r.create(p.words.slice(g),4*v),p.sigBytes=4*g,c.create({key:p,iv:v,salt:y})}},h=t.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:A}),encrypt:function(p,g,v,y){return y=this.cfg.extend(y),v=y.kdf.execute(v,p.keySize,p.ivSize),y.iv=v.iv,p=m.encrypt.call(this,p,g,v.key,y),p.mixIn(v),p},decrypt:function(p,g,v,y){return y=this.cfg.extend(y),g=this._parse(g,y.format),v=y.kdf.execute(v,p.keySize,p.ivSize,g.salt),y.iv=v.iv,m.decrypt.call(this,p,g,v.key,y)}})}();(function(){for(var n=Ee,t=n.lib.BlockCipher,E=n.algo,e=[],r=[],i=[],a=[],o=[],s=[],l=[],u=[],c=[],f=[],m=[],A=0;256>A;A++)m[A]=128>A?A<<1:A<<1^283;for(var h=0,p=0,A=0;256>A;A++){var g=p^p<<1^p<<2^p<<3^p<<4,g=g>>>8^g&255^99;e[h]=g,r[g]=h;var v=m[h],y=m[v],b=m[y],x=257*m[g]^16843008*g;i[h]=x<<24|x>>>8,a[h]=x<<16|x>>>16,o[h]=x<<8|x>>>24,s[h]=x,x=16843009*b^65537*y^257*v^16843008*h,l[g]=x<<24|x>>>8,u[g]=x<<16|x>>>16,c[g]=x<<8|x>>>24,f[g]=x,h?(h=v^m[m[m[b^v]]],p^=m[m[p]]):h=p=1}var w=[0,1,2,4,8,16,32,64,128,27,54],E=E.AES=t.extend({_doReset:function(){for(var R=this._key,M=R.words,C=R.sigBytes/4,R=4*((this._nRounds=C+6)+1),L=this._keySchedule=[],S=0;S<R;S++)if(S<C)L[S]=M[S];else{var I=L[S-1];S%C?6<C&&S%C==4&&(I=e[I>>>24]<<24|e[I>>>16&255]<<16|e[I>>>8&255]<<8|e[I&255]):(I=I<<8|I>>>24,I=e[I>>>24]<<24|e[I>>>16&255]<<16|e[I>>>8&255]<<8|e[I&255],I^=w[S/C|0]<<24),L[S]=L[S-C]^I}for(M=this._invKeySchedule=[],C=0;C<R;C++)S=R-C,I=C%4?L[S]:L[S-4],M[C]=4>C||4>=S?I:l[e[I>>>24]]^u[e[I>>>16&255]]^c[e[I>>>8&255]]^f[e[I&255]]},encryptBlock:function(M,C){this._doCryptBlock(M,C,this._keySchedule,i,a,o,s,e)},decryptBlock:function(M,C){var R=M[C+1];M[C+1]=M[C+3],M[C+3]=R,this._doCryptBlock(M,C,this._invKeySchedule,l,u,c,f,r),R=M[C+1],M[C+1]=M[C+3],M[C+3]=R},_doCryptBlock:function(M,C,R,L,S,I,O,P){for(var F=this._nRounds,j=M[C]^R[0],J=M[C+1]^R[1],X=M[C+2]^R[2],K=M[C+3]^R[3],V=4,D=1;D<F;D++)var z=L[j>>>24]^S[J>>>16&255]^I[X>>>8&255]^O[K&255]^R[V++],U=L[J>>>24]^S[X>>>16&255]^I[K>>>8&255]^O[j&255]^R[V++],q=L[X>>>24]^S[K>>>16&255]^I[j>>>8&255]^O[J&255]^R[V++],K=L[K>>>24]^S[j>>>16&255]^I[J>>>8&255]^O[X&255]^R[V++],j=z,J=U,X=q;z=(P[j>>>24]<<24|P[J>>>16&255]<<16|P[X>>>8&255]<<8|P[K&255])^R[V++],U=(P[J>>>24]<<24|P[X>>>16&255]<<16|P[K>>>8&255]<<8|P[j&255])^R[V++],q=(P[X>>>24]<<24|P[K>>>16&255]<<16|P[j>>>8&255]<<8|P[J&255])^R[V++],K=(P[K>>>24]<<24|P[j>>>16&255]<<16|P[J>>>8&255]<<8|P[X&255])^R[V++],M[C]=z,M[C+1]=U,M[C+2]=q,M[C+3]=K},keySize:8});n.AES=t._createHelper(E)})();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
343
|
+
*/var Hr;function de(n,t,e){n!=null&&(typeof n=="number"?this.fromNumber(n,t,e):t==null&&typeof n!="string"?this.fromString(n,256):this.fromString(n,t))}function Qt(){return new de(null)}function vl(n,t,e,r,i,a){for(;--a>=0;){var o=t*this[n++]+e[r]+i;i=Math.floor(o/67108864),e[r++]=o&67108863}return i}function ml(n,t,e,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var l=this[n]&32767,u=this[n++]>>15,c=s*l+u*o;l=o*l+((c&32767)<<15)+e[r]+(i&1073741823),i=(l>>>30)+(c>>>15)+s*u+(i>>>30),e[r++]=l&1073741823}return i}function Al(n,t,e,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var l=this[n]&16383,u=this[n++]>>14,c=s*l+u*o;l=o*l+((c&16383)<<14)+e[r]+i,i=(l>>28)+(c>>14)+s*u,e[r++]=l&268435455}return i}typeof navigator!="undefined"&&navigator.appName=="Microsoft Internet Explorer"?(de.prototype.am=ml,Hr=30):typeof navigator!="undefined"&&navigator.appName!="Netscape"?(de.prototype.am=vl,Hr=26):(de.prototype.am=Al,Hr=28);de.prototype.DB=Hr;de.prototype.DM=(1<<Hr)-1;de.prototype.DV=1<<Hr;var ao=52;de.prototype.FV=Math.pow(2,ao);de.prototype.F1=ao-Hr;de.prototype.F2=2*Hr-ao;var gl="0123456789abcdefghijklmnopqrstuvwxyz",Di=new Array,In,Vt;In=48;for(Vt=0;Vt<=9;++Vt)Di[In++]=Vt;In=97;for(Vt=10;Vt<36;++Vt)Di[In++]=Vt;In=65;for(Vt=10;Vt<36;++Vt)Di[In++]=Vt;function wr(n){return gl.charAt(n)}function yl(n,t){var e=Di[n.charCodeAt(t)];return e==null?-1:e}function bl(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function xl(n){this.t=1,this.s=n<0?-1:0,n>0?this[0]=n:n<-1?this[0]=n+this.DV:this.t=0}function oo(n){var t=Qt();return t.fromInt(n),t}function wl(n,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(n,t);return}this.t=0,this.s=0;for(var r=n.length,i=!1,a=0;--r>=0;){var o=e==8?n[r]&255:yl(n,r);if(o<0){n.charAt(r)=="-"&&(i=!0);continue}i=!1,a==0?this[this.t++]=o:a+e>this.DB?(this[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this[this.t++]=o>>this.DB-a):this[this.t-1]|=o<<a,a+=e,a>=this.DB&&(a-=this.DB)}e==8&&n[0]&128&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&de.ZERO.subTo(this,this)}function El(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function Sl(n){if(this.s<0)return"-"+this.negate().toString(n);var t;if(n==16)t=4;else if(n==8)t=3;else if(n==2)t=1;else if(n==32)t=5;else if(n==4)t=2;else return this.toRadix(n);var e=(1<<t)-1,r,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this[o]>>s)>0&&(i=!0,a=wr(r));o>=0;)s<t?(r=(this[o]&(1<<s)-1)<<t-s,r|=this[--o]>>(s+=this.DB-t)):(r=this[o]>>(s-=t)&e,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=wr(r));return i?a:"0"}function Ml(){var n=Qt();return de.ZERO.subTo(this,n),n}function Cl(){return this.s<0?this.negate():this}function Il(n){var t=this.s-n.s;if(t!=0)return t;var e=this.t;if(t=e-n.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-n[e])!=0)return t;return 0}function so(n){var t=1,e;return(e=n>>>16)!=0&&(n=e,t+=16),(e=n>>8)!=0&&(n=e,t+=8),(e=n>>4)!=0&&(n=e,t+=4),(e=n>>2)!=0&&(n=e,t+=2),(e=n>>1)!=0&&(n=e,t+=1),t}function Tl(){return this.t<=0?0:this.DB*(this.t-1)+so(this[this.t-1]^this.s&this.DM)}function Pl(n,t){var e;for(e=this.t-1;e>=0;--e)t[e+n]=this[e];for(e=n-1;e>=0;--e)t[e]=0;t.t=this.t+n,t.s=this.s}function Bl(n,t){for(var e=n;e<this.t;++e)t[e-n]=this[e];t.t=Math.max(this.t-n,0),t.s=this.s}function Rl(n,t){var e=n%this.DB,r=this.DB-e,i=(1<<r)-1,a=Math.floor(n/this.DB),o=this.s<<e&this.DM,s;for(s=this.t-1;s>=0;--s)t[s+a+1]=this[s]>>r|o,o=(this[s]&i)<<e;for(s=a-1;s>=0;--s)t[s]=0;t[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function Fl(n,t){t.s=this.s;var e=Math.floor(n/this.DB);if(e>=this.t){t.t=0;return}var r=n%this.DB,i=this.DB-r,a=(1<<r)-1;t[0]=this[e]>>r;for(var o=e+1;o<this.t;++o)t[o-e-1]|=(this[o]&a)<<i,t[o-e]=this[o]>>r;r>0&&(t[this.t-e-1]|=(this.s&a)<<i),t.t=this.t-e,t.clamp()}function kl(n,t){for(var e=0,r=0,i=Math.min(n.t,this.t);e<i;)r+=this[e]-n[e],t[e++]=r&this.DM,r>>=this.DB;if(n.t<this.t){for(r-=n.s;e<this.t;)r+=this[e],t[e++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;e<n.t;)r-=n[e],t[e++]=r&this.DM,r>>=this.DB;r-=n.s}t.s=r<0?-1:0,r<-1?t[e++]=this.DV+r:r>0&&(t[e++]=r),t.t=e,t.clamp()}function Ll(n,t){var e=this.abs(),r=n.abs(),i=e.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+e.t]=e.am(0,r[i],t,i,0,e.t);t.s=0,t.clamp(),this.s!=n.s&&de.ZERO.subTo(t,t)}function Ol(n){for(var t=this.abs(),e=n.t=2*t.t;--e>=0;)n[e]=0;for(e=0;e<t.t-1;++e){var r=t.am(e,t[e],n,2*e,0,1);(n[e+t.t]+=t.am(e+1,2*t[e],n,2*e+1,r,t.t-e-1))>=t.DV&&(n[e+t.t]-=t.DV,n[e+t.t+1]=1)}n.t>0&&(n[n.t-1]+=t.am(e,t[e],n,2*e,0,1)),n.s=0,n.clamp()}function Vl(n,t,e){var r=n.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=Qt());var a=Qt(),o=this.s,s=n.s,l=this.DB-so(r[r.t-1]);l>0?(r.lShiftTo(l,a),i.lShiftTo(l,e)):(r.copyTo(a),i.copyTo(e));var u=a.t,c=a[u-1];if(c!=0){var f=c*(1<<this.F1)+(u>1?a[u-2]>>this.F2:0),m=this.FV/f,A=(1<<this.F1)/f,h=1<<this.F2,p=e.t,g=p-u,v=t==null?Qt():t;for(a.dlShiftTo(g,v),e.compareTo(v)>=0&&(e[e.t++]=1,e.subTo(v,e)),de.ONE.dlShiftTo(u,v),v.subTo(a,a);a.t<u;)a[a.t++]=0;for(;--g>=0;){var y=e[--p]==c?this.DM:Math.floor(e[p]*m+(e[p-1]+h)*A);if((e[p]+=a.am(0,y,e,g,0,u))<y)for(a.dlShiftTo(g,v),e.subTo(v,e);e[p]<--y;)e.subTo(v,e)}t!=null&&(e.drShiftTo(u,t),o!=s&&de.ZERO.subTo(t,t)),e.t=u,e.clamp(),l>0&&e.rShiftTo(l,e),o<0&&de.ZERO.subTo(e,e)}}}function Nl(n){var t=Qt();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(de.ZERO)>0&&n.subTo(t,t),t}function Tn(n){this.m=n}function Dl(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function zl(n){return n}function Ql(n){n.divRemTo(this.m,null,n)}function Ul(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function ql(n,t){n.squareTo(t),this.reduce(t)}Tn.prototype.convert=Dl;Tn.prototype.revert=zl;Tn.prototype.reduce=Ql;Tn.prototype.mulTo=Ul;Tn.prototype.sqrTo=ql;function Hl(){if(this.t<1)return 0;var n=this[0];if(!(n&1))return 0;var t=n&3;return t=t*(2-(n&15)*t)&15,t=t*(2-(n&255)*t)&255,t=t*(2-((n&65535)*t&65535))&65535,t=t*(2-n*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Pn(n){this.m=n,this.mp=n.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<n.DB-15)-1,this.mt2=2*n.t}function Gl(n){var t=Qt();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(de.ZERO)>0&&this.m.subTo(t,t),t}function Kl(n){var t=Qt();return n.copyTo(t),this.reduce(t),t}function jl(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var t=0;t<this.m.t;++t){var e=n[t]&32767,r=e*this.mpl+((e*this.mph+(n[t]>>15)*this.mpl&this.um)<<15)&n.DM;for(e=t+this.m.t,n[e]+=this.m.am(0,r,n,t,0,this.m.t);n[e]>=n.DV;)n[e]-=n.DV,n[++e]++}n.clamp(),n.drShiftTo(this.m.t,n),n.compareTo(this.m)>=0&&n.subTo(this.m,n)}function _l(n,t){n.squareTo(t),this.reduce(t)}function Jl(n,t,e){n.multiplyTo(t,e),this.reduce(e)}Pn.prototype.convert=Gl;Pn.prototype.revert=Kl;Pn.prototype.reduce=jl;Pn.prototype.mulTo=Jl;Pn.prototype.sqrTo=_l;function Xl(){return(this.t>0?this[0]&1:this.s)==0}function Wl(n,t){if(n>4294967295||n<1)return de.ONE;var e=Qt(),r=Qt(),i=t.convert(this),a=so(n)-1;for(i.copyTo(e);--a>=0;)if(t.sqrTo(e,r),(n&1<<a)>0)t.mulTo(r,i,e);else{var o=e;e=r,r=o}return t.revert(e)}function Zl(n,t){var e;return n<256||t.isEven()?e=new Tn(t):e=new Pn(t),this.exp(n,e)}de.prototype.copyTo=bl;de.prototype.fromInt=xl;de.prototype.fromString=wl;de.prototype.clamp=El;de.prototype.dlShiftTo=Pl;de.prototype.drShiftTo=Bl;de.prototype.lShiftTo=Rl;de.prototype.rShiftTo=Fl;de.prototype.subTo=kl;de.prototype.multiplyTo=Ll;de.prototype.squareTo=Ol;de.prototype.divRemTo=Vl;de.prototype.invDigit=Hl;de.prototype.isEven=Xl;de.prototype.exp=Wl;de.prototype.toString=Sl;de.prototype.negate=Ml;de.prototype.abs=Cl;de.prototype.compareTo=Il;de.prototype.bitLength=Tl;de.prototype.mod=Nl;de.prototype.modPowInt=Zl;de.ZERO=oo(0);de.ONE=oo(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Yl(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function $l(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function ec(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function tc(n){if(n==null&&(n=10),this.signum()==0||n<2||n>36)return"0";var t=this.chunkSize(n),e=Math.pow(n,t),r=oo(e),i=Qt(),a=Qt(),o="";for(this.divRemTo(r,i,a);i.signum()>0;)o=(e+a.intValue()).toString(n).substr(1)+o,i.divRemTo(r,i,a);return a.intValue().toString(n)+o}de.prototype.chunkSize=$l;de.prototype.toRadix=tc;de.prototype.intValue=Yl;de.prototype.signum=ec;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var xn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S0="=";function rc(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=xn.charAt(e>>6)+xn.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=xn.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=xn.charAt(e>>2)+xn.charAt((e&3)<<4));(r.length&3)>0;)r+=S0;return r}function uo(n){var t="",e,r=0,i,a;for(e=0;e<n.length&&n.charAt(e)!=S0;++e)a=xn.indexOf(n.charAt(e)),!(a<0)&&(r==0?(t+=wr(a>>2),i=a&3,r=1):r==1?(t+=wr(i<<2|a>>4),i=a&15,r=2):r==2?(t+=wr(i),t+=wr(a>>2),i=a&3,r=3):(t+=wr(i<<2|a>>4),t+=wr(a&15),r=0));return r==1&&(t+=wr(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function wt(n,t){return new de(n,t)}function nc(n,t){if(t<n.length+11)throw"Message too long for RSA";for(var e=new Array,r=n.length-1;r>=0&&t>0;){var i=n.charCodeAt(r--);i<128?e[--t]=i:i>127&&i<2048?(e[--t]=i&63|128,e[--t]=i>>6|192):(e[--t]=i&63|128,e[--t]=i>>6&63|128,e[--t]=i>>12|224)}e[--t]=0;for(var a=new SecureRandom,o=new Array;t>2;){for(o[0]=0;o[0]==0;)a.nextBytes(o);e[--t]=o[0]}return e[--t]=2,e[--t]=0,new de(e)}function Go(n,t,e){for(var r="",i=0;r.length<t;)r+=e(String.fromCharCode.apply(String,n.concat([(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255]))),i+=1;return r}function ic(n,t,e,r){var i=ne.crypto.MessageDigest,a=ne.crypto.Util,o=null;if(e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(p){return Sr(a.hashHex(zi(p),o))}),n.length+2*r+2>t)throw"Message too long for RSA";var s="",l;for(l=0;l<t-n.length-2*r-2;l+=1)s+="\0";var u=e("")+s+""+n,c=new Array(r);new SecureRandom().nextBytes(c);var f=Go(c,u.length,e),m=[];for(l=0;l<u.length;l+=1)m[l]=u.charCodeAt(l)^f.charCodeAt(l);var A=Go(m,c.length,e),h=[0];for(l=0;l<c.length;l+=1)h[l+1]=c[l]^A.charCodeAt(l);return new de(h.concat(m))}function Be(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function ac(n,t){if(this.isPublic=!0,this.isPrivate=!1,typeof n!="string")this.n=n,this.e=t;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=wt(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function oc(n){return n.modPowInt(this.e,this.n)}function sc(n){var t=nc(n,this.n.bitLength()+7>>3);if(t==null)return null;var e=this.doPublic(t);if(e==null)return null;var r=e.toString(16);return r.length&1?"0"+r:r}function uc(n,t,e){var r=ic(n,this.n.bitLength()+7>>3,t,e);if(r==null)return null;var i=this.doPublic(r);if(i==null)return null;var a=i.toString(16);return a.length&1?"0"+a:a}Be.prototype.doPublic=oc;Be.prototype.setPublic=ac;Be.prototype.encrypt=sc;Be.prototype.encryptOAEP=uc;Be.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function lc(n,t){for(var e=n.toByteArray(),r=0;r<e.length&&e[r]==0;)++r;if(e.length-r!=t-1||e[r]!=2)return null;for(++r;e[r]!=0;)if(++r>=e.length)return null;for(var i="";++r<e.length;){var a=e[r]&255;a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((a&31)<<6|e[r+1]&63),++r):(i+=String.fromCharCode((a&15)<<12|(e[r+1]&63)<<6|e[r+2]&63),r+=2)}return i}function Ko(n,t,e){for(var r="",i=0;r.length<t;)r+=e(n+String.fromCharCode.apply(String,[(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255])),i+=1;return r}function cc(n,t,e,r){var i=ne.crypto.MessageDigest,a=ne.crypto.Util,o=null;e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(g){return Sr(a.hashHex(zi(g),o))}),n=n.toByteArray();var f;for(f=0;f<n.length;f+=1)n[f]&=255;for(;n.length<t;)n.unshift(0);if(n=String.fromCharCode.apply(String,n),n.length<2*r+2)throw"Cipher too short";var s=n.substr(1,r),l=n.substr(r+1),u=Ko(l,r,e),c=[],f;for(f=0;f<s.length;f+=1)c[f]=s.charCodeAt(f)^u.charCodeAt(f);var m=Ko(String.fromCharCode.apply(String,c),n.length-r,e),A=[];for(f=0;f<l.length;f+=1)A[f]=l.charCodeAt(f)^m.charCodeAt(f);if(A=String.fromCharCode.apply(String,A),A.substr(0,r)!==e(""))throw"Hash mismatch";A=A.substr(r);var h=A.indexOf(""),p=h!=-1?A.substr(0,h).lastIndexOf("\0"):-1;if(p+1!=h)throw"Malformed data";return A.substr(h+1)}function dc(n,t,e){if(this.isPrivate=!0,typeof n!="string")this.n=n,this.e=t,this.d=e;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=wt(n,16),this.e=parseInt(t,16),this.d=wt(e,16);else throw"Invalid RSA private key"}function fc(n,t,e,r,i,a,o,s){if(this.isPrivate=!0,this.isPublic=!1,n==null)throw"RSASetPrivateEx N == null";if(t==null)throw"RSASetPrivateEx E == null";if(n.length==0)throw"RSASetPrivateEx N.length == 0";if(t.length==0)throw"RSASetPrivateEx E.length == 0";if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=wt(n,16),this.e=parseInt(t,16),this.d=wt(e,16),this.p=wt(r,16),this.q=wt(i,16),this.dmp1=wt(a,16),this.dmq1=wt(o,16),this.coeff=wt(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function hc(n){if(this.p==null||this.q==null)return n.modPow(this.d,this.n);for(var t=n.mod(this.p).modPow(this.dmp1,this.p),e=n.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(e)<0;)t=t.add(this.p);return t.subtract(e).multiply(this.coeff).mod(this.p).multiply(this.q).add(e)}function pc(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=wt(n,16),e=this.doPrivate(t);return e==null?null:lc(e,this.n.bitLength()+7>>3)}function vc(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=wt(n,16),i=this.doPrivate(r);return i==null?null:cc(i,this.n.bitLength()+7>>3,t,e)}Be.prototype.doPrivate=hc;Be.prototype.setPrivate=dc;Be.prototype.setPrivateEx=fc;Be.prototype.decrypt=pc;Be.prototype.decryptOAEP=vc;(typeof ne.lang=="undefined"||!ne.lang)&&(ne.lang={});ne.lang.String=function(){};function mc(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function et(n){return uo(mc(n))}function lr(n){return decodeURIComponent(xc(n))}function Sr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function zi(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function Ac(n){return rc(n)}function gc(n){var t=Ac(n),e=t.replace(/(.{64})/g,`$1\r
|
|
344
344
|
`);return e=e.replace(/\r\n$/,""),e}function yc(n){var t=n.replace(/[^0-9A-Za-z\/+=]*/g,""),e=uo(t);return e}function bc(n,t){var e=gc(n);return"-----BEGIN "+t+`-----\r
|
|
345
345
|
`+e+`\r
|
|
346
346
|
-----END `+t+`-----\r
|
|
347
|
-
`}function ln(n,t){if(n.indexOf("-----BEGIN ")==-1)throw"can't find PEM header: "+t;return t!==void 0?(n=n.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),""),n=n.replace(new RegExp("-----END "+t+"-----[^]*$"),"")):(n=n.replace(/^[^]*-----BEGIN [^-]+-----/,""),n=n.replace(/-----END [^-]+-----[^]*$/,"")),yc(n)}function xc(n){return n.replace(/(..)/g,"%$1")}function wc(n){if(!n.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";n=n.toLowerCase();for(var t=n.match(/.{1,4}/g),e=0;e<8;e++)t[e]=t[e].replace(/^0+/,""),t[e]==""&&(t[e]="0");n=":"+t.join(":")+":";var r=n.match(/:(0:){2,}/g);if(r===null)return n.slice(1,-1);for(var i="",e=0;e<r.length;e++)r[e].length>i.length&&(i=r[e]);return n=n.replace(i,"::"),n.slice(1,-1)}function jo(n){var t="malformed hex value";if(!n.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(n.length==8){var e;try{return e=parseInt(n.substr(0,2),16)+"."+parseInt(n.substr(2,2),16)+"."+parseInt(n.substr(4,2),16)+"."+parseInt(n.substr(6,2),16),e}catch(r){throw t}}else return n.length==32?wc(n):n}function Ec(n){function t(i){var a=parseInt(i.substr(0,2),16),o=parseInt(i.substr(2),16);if(a==0&o<128)return String.fromCharCode(o);if(a<8){var s=192|(a&7)<<3|(o&192)>>6,l=128|o&63;return lr(s.toString(16)+l.toString(16))}var s=224|(a&240)>>4,l=128|(a&15)<<2|(o&192)>>6,u=128|o&63;return lr(s.toString(16)+l.toString(16)+u.toString(16))}var e=n.match(/.{4}/g),r=e.map(t);return r.join("")}ne.lang.String.isHex=function(n){return C0(n)};function C0(n){return!!(n.length%2==0&&(n.match(/^[0-9a-f]+$/)||n.match(/^[0-9A-F]+$/)))}ne.lang.String.isMail=function(n){return n.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)!==null};function _o(n){return n.length%2==1?"0"+n:n.substr(0,1)>"7"?"00"+n:n}function Sc(n){if(!C0(n))return null;try{var t=[],e=n.substr(0,2),r=parseInt(e,16);t[0]=new String(Math.floor(r/40)),t[1]=new String(r%40);for(var i=n.substr(2),a=[],o=0;o<i.length/2;o++)a.push(parseInt(i.substr(o*2,2),16));for(var s=[],l="",o=0;o<a.length;o++)a[o]&128?l=l+Jo((a[o]&127).toString(2),7):(l=l+Jo((a[o]&127).toString(2),7),s.push(new String(parseInt(l,2))),l="");var u=t.join(".");return s.length>0&&(u=u+"."+s.join(".")),u}catch(c){return null}}var Jo=function(n,t,e){return e==null&&(e="0"),n.length>=t?n:new Array(t-n.length+1).join(e)+n};function Cc(n){try{var t=n.substr(0,2);if(t=="00")return parseInt(n.substr(2),16);var e=parseInt(t,16),r=n.substr(2),i=parseInt(r,16).toString(2);return i=="0"&&(i="00000000"),i=i.slice(0,0-e),parseInt(i,2)}catch(a){return-1}}(typeof ne.crypto=="undefined"||!ne.crypto)&&(ne.crypto={});ne.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:Ee.algo.MD5,sha1:Ee.algo.SHA1,sha224:Ee.algo.SHA224,sha256:Ee.algo.SHA256,sha384:Ee.algo.SHA384,sha512:Ee.algo.SHA512,ripemd160:Ee.algo.RIPEMD160},this.hashString=function(n,t){var e=new ne.crypto.MessageDigest({alg:t});return e.digestString(n)},this.hashHex=function(n,t){var e=new ne.crypto.MessageDigest({alg:t});return e.digestHex(n)},this.sha1=function(n){return this.hashString(n,"sha1")},this.sha256=function(n){return this.hashString(n,"sha256")},this.sha256Hex=function(n){return this.hashHex(n,"sha256")},this.sha512=function(n){return this.hashString(n,"sha512")},this.sha512Hex=function(n){return this.hashHex(n,"sha512")}};ne.crypto.MessageDigest=function(n){this.setAlgAndProvider=function(t,e){if(t=ne.crypto.MessageDigest.getCanonicalAlgName(t),t!==null&&e===void 0&&(e=ne.crypto.Util.DEFAULTPROVIDER[t]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)!=-1&&e=="cryptojs"){try{this.md=ne.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(r){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+r}this.updateString=function(r){this.md.update(r)},this.updateHex=function(r){var i=Ee.enc.Hex.parse(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return r.toString(Ee.enc.Hex)},this.digestString=function(r){return this.updateString(r),this.digest()},this.digestHex=function(r){return this.updateHex(r),this.digest()}}if(":sha256:".indexOf(t)!=-1&&e=="sjcl"){try{this.md=new sjcl.hash.sha256}catch(r){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+r}this.updateString=function(r){this.md.update(r)},this.updateHex=function(r){var i=sjcl.codec.hex.toBits(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return sjcl.codec.hex.fromBits(r)},this.digestString=function(r){return this.updateString(r),this.digest()},this.digestHex=function(r){return this.updateHex(r),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},n!==void 0&&n.alg!==void 0&&(this.algName=n.alg,n.prov===void 0&&(this.provName=ne.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))};ne.crypto.MessageDigest.getCanonicalAlgName=function(n){return typeof n=="string"&&(n=n.toLowerCase(),n=n.replace(/-/,"")),n};ne.crypto.MessageDigest.getHashLength=function(n){var t=ne.crypto.MessageDigest,e=t.getCanonicalAlgName(n);if(t.HASHLENGTH[e]===void 0)throw"not supported algorithm: "+n;return t.HASHLENGTH[e]};ne.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20};ne.crypto.Signature=function(n){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),this.pubkeyAlgName=="rsaandmgf1"&&this.mdAlgName=="sha"&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,r){for(var i="",a=r/4-e.length,o=0;o<a;o++)i=i+"0";return i+e},this.setAlgAndProvider=function(e,r){if(this._setAlgNames(),r!="cryptojs/jsrsa")throw new Error("provider not supported: "+r);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)!=-1){try{this.md=new ne.crypto.MessageDigest({alg:this.mdAlgName})}catch(i){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+i)}this.init=function(i,a){var o=null;try{a===void 0?o=on.getKey(i):o=on.getKey(i,a)}catch(s){throw"init failed:"+s}if(o.isPrivate===!0)this.prvKey=o,this.state="SIGN";else if(o.isPublic===!0)this.pubKey=o,this.state="VERIFY";else throw"init failed.:"+o},this.updateString=function(i){this.md.updateString(i)},this.updateHex=function(i){this.md.updateHex(i)},this.verify=function(i){if(this.sHashHex=this.md.digest(),this.pubKey instanceof Be&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,i,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof Be&&this.pubkeyAlgName==="rsa")return this.pubKey.verifyWithMessageHash(this.sHashHex,i);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,r){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(e){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(e){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=n,n!==void 0&&(n.alg!==void 0&&(this.algName=n.alg,n.prov===void 0?this.provName=ne.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=n.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),n.psssaltlen!==void 0&&(this.pssSaltLen=n.psssaltlen),n.prvkeypem!==void 0)){if(n.prvkeypas!==void 0)throw"both prvkeypem and prvkeypas parameters not supported";try{var t=on.getKey(n.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}};ne.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}};var on=function(){var n=function(h,p,g){return r(Ee.AES,h,p,g)},t=function(h,p,g){return r(Ee.TripleDES,h,p,g)},e=function(h,p,g){return r(Ee.DES,h,p,g)},r=function(h,p,g,v){var y=Ee.enc.Hex.parse(p),b=Ee.enc.Hex.parse(g),x=Ee.enc.Hex.parse(v),w={};w.key=b,w.iv=x,w.ciphertext=y;var E=h.decrypt(w,b,{iv:x});return Ee.enc.Hex.stringify(E)},i=function(h,p,g){return s(Ee.AES,h,p,g)},a=function(h,p,g){return s(Ee.TripleDES,h,p,g)},o=function(h,p,g){return s(Ee.DES,h,p,g)},s=function(h,p,g,v){var y=Ee.enc.Hex.parse(p),b=Ee.enc.Hex.parse(g),x=Ee.enc.Hex.parse(v),w=h.encrypt(y,b,{iv:x}),E=Ee.enc.Hex.parse(w.toString()),C=Ee.enc.Base64.stringify(E);return C},l={"AES-256-CBC":{proc:n,eproc:i,keylen:32,ivlen:16},"AES-192-CBC":{proc:n,eproc:i,keylen:24,ivlen:16},"AES-128-CBC":{proc:n,eproc:i,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:t,eproc:a,keylen:24,ivlen:8},"DES-CBC":{proc:e,eproc:o,keylen:8,ivlen:8}},u=function(h){var p=Ee.lib.WordArray.random(h),g=Ee.enc.Hex.stringify(p);return g},c=function(h){var p={},g=h.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));g&&(p.cipher=g[1],p.ivsalt=g[2]);var v=h.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));v&&(p.type=v[1]);var y=-1,b=0;h.indexOf(`\r
|
|
347
|
+
`}function ln(n,t){if(n.indexOf("-----BEGIN ")==-1)throw"can't find PEM header: "+t;return t!==void 0?(n=n.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),""),n=n.replace(new RegExp("-----END "+t+"-----[^]*$"),"")):(n=n.replace(/^[^]*-----BEGIN [^-]+-----/,""),n=n.replace(/-----END [^-]+-----[^]*$/,"")),yc(n)}function xc(n){return n.replace(/(..)/g,"%$1")}function wc(n){if(!n.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";n=n.toLowerCase();for(var t=n.match(/.{1,4}/g),e=0;e<8;e++)t[e]=t[e].replace(/^0+/,""),t[e]==""&&(t[e]="0");n=":"+t.join(":")+":";var r=n.match(/:(0:){2,}/g);if(r===null)return n.slice(1,-1);for(var i="",e=0;e<r.length;e++)r[e].length>i.length&&(i=r[e]);return n=n.replace(i,"::"),n.slice(1,-1)}function jo(n){var t="malformed hex value";if(!n.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(n.length==8){var e;try{return e=parseInt(n.substr(0,2),16)+"."+parseInt(n.substr(2,2),16)+"."+parseInt(n.substr(4,2),16)+"."+parseInt(n.substr(6,2),16),e}catch(r){throw t}}else return n.length==32?wc(n):n}function Ec(n){function t(i){var a=parseInt(i.substr(0,2),16),o=parseInt(i.substr(2),16);if(a==0&o<128)return String.fromCharCode(o);if(a<8){var s=192|(a&7)<<3|(o&192)>>6,l=128|o&63;return lr(s.toString(16)+l.toString(16))}var s=224|(a&240)>>4,l=128|(a&15)<<2|(o&192)>>6,u=128|o&63;return lr(s.toString(16)+l.toString(16)+u.toString(16))}var e=n.match(/.{4}/g),r=e.map(t);return r.join("")}ne.lang.String.isHex=function(n){return M0(n)};function M0(n){return!!(n.length%2==0&&(n.match(/^[0-9a-f]+$/)||n.match(/^[0-9A-F]+$/)))}ne.lang.String.isMail=function(n){return n.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)!==null};function _o(n){return n.length%2==1?"0"+n:n.substr(0,1)>"7"?"00"+n:n}function Sc(n){if(!M0(n))return null;try{var t=[],e=n.substr(0,2),r=parseInt(e,16);t[0]=new String(Math.floor(r/40)),t[1]=new String(r%40);for(var i=n.substr(2),a=[],o=0;o<i.length/2;o++)a.push(parseInt(i.substr(o*2,2),16));for(var s=[],l="",o=0;o<a.length;o++)a[o]&128?l=l+Jo((a[o]&127).toString(2),7):(l=l+Jo((a[o]&127).toString(2),7),s.push(new String(parseInt(l,2))),l="");var u=t.join(".");return s.length>0&&(u=u+"."+s.join(".")),u}catch(c){return null}}var Jo=function(n,t,e){return e==null&&(e="0"),n.length>=t?n:new Array(t-n.length+1).join(e)+n};function Mc(n){try{var t=n.substr(0,2);if(t=="00")return parseInt(n.substr(2),16);var e=parseInt(t,16),r=n.substr(2),i=parseInt(r,16).toString(2);return i=="0"&&(i="00000000"),i=i.slice(0,0-e),parseInt(i,2)}catch(a){return-1}}(typeof ne.crypto=="undefined"||!ne.crypto)&&(ne.crypto={});ne.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:Ee.algo.MD5,sha1:Ee.algo.SHA1,sha224:Ee.algo.SHA224,sha256:Ee.algo.SHA256,sha384:Ee.algo.SHA384,sha512:Ee.algo.SHA512,ripemd160:Ee.algo.RIPEMD160},this.hashString=function(n,t){var e=new ne.crypto.MessageDigest({alg:t});return e.digestString(n)},this.hashHex=function(n,t){var e=new ne.crypto.MessageDigest({alg:t});return e.digestHex(n)},this.sha1=function(n){return this.hashString(n,"sha1")},this.sha256=function(n){return this.hashString(n,"sha256")},this.sha256Hex=function(n){return this.hashHex(n,"sha256")},this.sha512=function(n){return this.hashString(n,"sha512")},this.sha512Hex=function(n){return this.hashHex(n,"sha512")}};ne.crypto.MessageDigest=function(n){this.setAlgAndProvider=function(t,e){if(t=ne.crypto.MessageDigest.getCanonicalAlgName(t),t!==null&&e===void 0&&(e=ne.crypto.Util.DEFAULTPROVIDER[t]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)!=-1&&e=="cryptojs"){try{this.md=ne.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(r){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+r}this.updateString=function(r){this.md.update(r)},this.updateHex=function(r){var i=Ee.enc.Hex.parse(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return r.toString(Ee.enc.Hex)},this.digestString=function(r){return this.updateString(r),this.digest()},this.digestHex=function(r){return this.updateHex(r),this.digest()}}if(":sha256:".indexOf(t)!=-1&&e=="sjcl"){try{this.md=new sjcl.hash.sha256}catch(r){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+r}this.updateString=function(r){this.md.update(r)},this.updateHex=function(r){var i=sjcl.codec.hex.toBits(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return sjcl.codec.hex.fromBits(r)},this.digestString=function(r){return this.updateString(r),this.digest()},this.digestHex=function(r){return this.updateHex(r),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},n!==void 0&&n.alg!==void 0&&(this.algName=n.alg,n.prov===void 0&&(this.provName=ne.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))};ne.crypto.MessageDigest.getCanonicalAlgName=function(n){return typeof n=="string"&&(n=n.toLowerCase(),n=n.replace(/-/,"")),n};ne.crypto.MessageDigest.getHashLength=function(n){var t=ne.crypto.MessageDigest,e=t.getCanonicalAlgName(n);if(t.HASHLENGTH[e]===void 0)throw"not supported algorithm: "+n;return t.HASHLENGTH[e]};ne.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20};ne.crypto.Signature=function(n){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),this.pubkeyAlgName=="rsaandmgf1"&&this.mdAlgName=="sha"&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,r){for(var i="",a=r/4-e.length,o=0;o<a;o++)i=i+"0";return i+e},this.setAlgAndProvider=function(e,r){if(this._setAlgNames(),r!="cryptojs/jsrsa")throw new Error("provider not supported: "+r);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)!=-1){try{this.md=new ne.crypto.MessageDigest({alg:this.mdAlgName})}catch(i){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+i)}this.init=function(i,a){var o=null;try{a===void 0?o=on.getKey(i):o=on.getKey(i,a)}catch(s){throw"init failed:"+s}if(o.isPrivate===!0)this.prvKey=o,this.state="SIGN";else if(o.isPublic===!0)this.pubKey=o,this.state="VERIFY";else throw"init failed.:"+o},this.updateString=function(i){this.md.updateString(i)},this.updateHex=function(i){this.md.updateHex(i)},this.verify=function(i){if(this.sHashHex=this.md.digest(),this.pubKey instanceof Be&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,i,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof Be&&this.pubkeyAlgName==="rsa")return this.pubKey.verifyWithMessageHash(this.sHashHex,i);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,r){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(e){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(e){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=n,n!==void 0&&(n.alg!==void 0&&(this.algName=n.alg,n.prov===void 0?this.provName=ne.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=n.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),n.psssaltlen!==void 0&&(this.pssSaltLen=n.psssaltlen),n.prvkeypem!==void 0)){if(n.prvkeypas!==void 0)throw"both prvkeypem and prvkeypas parameters not supported";try{var t=on.getKey(n.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}};ne.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}};var on=function(){var n=function(h,p,g){return r(Ee.AES,h,p,g)},t=function(h,p,g){return r(Ee.TripleDES,h,p,g)},e=function(h,p,g){return r(Ee.DES,h,p,g)},r=function(h,p,g,v){var y=Ee.enc.Hex.parse(p),b=Ee.enc.Hex.parse(g),x=Ee.enc.Hex.parse(v),w={};w.key=b,w.iv=x,w.ciphertext=y;var E=h.decrypt(w,b,{iv:x});return Ee.enc.Hex.stringify(E)},i=function(h,p,g){return s(Ee.AES,h,p,g)},a=function(h,p,g){return s(Ee.TripleDES,h,p,g)},o=function(h,p,g){return s(Ee.DES,h,p,g)},s=function(h,p,g,v){var y=Ee.enc.Hex.parse(p),b=Ee.enc.Hex.parse(g),x=Ee.enc.Hex.parse(v),w=h.encrypt(y,b,{iv:x}),E=Ee.enc.Hex.parse(w.toString()),M=Ee.enc.Base64.stringify(E);return M},l={"AES-256-CBC":{proc:n,eproc:i,keylen:32,ivlen:16},"AES-192-CBC":{proc:n,eproc:i,keylen:24,ivlen:16},"AES-128-CBC":{proc:n,eproc:i,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:t,eproc:a,keylen:24,ivlen:8},"DES-CBC":{proc:e,eproc:o,keylen:8,ivlen:8}},u=function(h){var p=Ee.lib.WordArray.random(h),g=Ee.enc.Hex.stringify(p);return g},c=function(h){var p={},g=h.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));g&&(p.cipher=g[1],p.ivsalt=g[2]);var v=h.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));v&&(p.type=v[1]);var y=-1,b=0;h.indexOf(`\r
|
|
348
348
|
\r
|
|
349
349
|
`)!=-1&&(y=h.indexOf(`\r
|
|
350
350
|
\r
|
|
@@ -352,20 +352,20 @@
|
|
|
352
352
|
|
|
353
353
|
`)!=-1&&(y=h.indexOf(`
|
|
354
354
|
|
|
355
|
-
`),b=1);var x=h.indexOf("-----END");if(y!=-1&&x!=-1){var w=h.substring(y+b*2,x-b);w=w.replace(/\s+/g,""),p.data=w}return p},f=function(h,p,g){for(var v=g.substring(0,16),y=Ee.enc.Hex.parse(v),b=Ee.enc.Utf8.parse(p),x=l[h].keylen+l[h].ivlen,w="",E=null;;){var
|
|
355
|
+
`),b=1);var x=h.indexOf("-----END");if(y!=-1&&x!=-1){var w=h.substring(y+b*2,x-b);w=w.replace(/\s+/g,""),p.data=w}return p},f=function(h,p,g){for(var v=g.substring(0,16),y=Ee.enc.Hex.parse(v),b=Ee.enc.Utf8.parse(p),x=l[h].keylen+l[h].ivlen,w="",E=null;;){var M=Ee.algo.MD5.create();if(E!=null&&M.update(E),M.update(b),M.update(y),E=M.finalize(),w=w+Ee.enc.Hex.stringify(E),w.length>=x*2)break}var C={};return C.keyhex=w.substr(0,l[h].keylen*2),C.ivhex=w.substr(l[h].keylen*2,l[h].ivlen*2),C},m=function(h,p,g,v){var y=Ee.enc.Base64.parse(h),b=Ee.enc.Hex.stringify(y),x=l[p].proc,w=x(b,g,v);return w},A=function(h,p,g,v){var y=l[p].eproc,b=y(h,g,v);return b};return{version:"1.0.0",parsePKCS5PEM:function(h){return c(h)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(h,p,g){return f(h,p,g)},decryptKeyB64:function(h,p,g,v){return m(h,p,g,v)},getDecryptedKeyHex:function(h,p){var g=c(h),v=g.cipher,y=g.ivsalt,b=g.data,x=f(v,p,y),w=x.keyhex,E=m(b,v,w,y);return E},getEncryptedPKCS5PEMFromPrvKeyHex:function(h,p,g,v,y){var R="";if((typeof v=="undefined"||v==null)&&(v="AES-256-CBC"),typeof l[v]=="undefined")throw"KEYUTIL unsupported algorithm: "+v;if(typeof y=="undefined"||y==null){var b=l[v].ivlen,x=u(b);y=x.toUpperCase()}var w=f(v,g,y),E=w.keyhex,M=A(p,v,E,y),C=M.replace(/(.{64})/g,`$1\r
|
|
356
356
|
`),R="-----BEGIN "+h+` PRIVATE KEY-----\r
|
|
357
357
|
`;return R+=`Proc-Type: 4,ENCRYPTED\r
|
|
358
358
|
`,R+="DEK-Info: "+v+","+y+`\r
|
|
359
359
|
`,R+=`\r
|
|
360
|
-
`,R+=
|
|
360
|
+
`,R+=C,R+=`\r
|
|
361
361
|
-----END `+h+` PRIVATE KEY-----\r
|
|
362
|
-
`,R},parseHexOfEncryptedPKCS8:function(h){var p=ue,g=p.getChildIdx,v=p.getV,y={},b=g(h,0);if(b.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+b.length;y.ciphertext=v(h,b[1]);var x=g(h,b[0]);if(x.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+x.length;if(v(h,x[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var w=g(h,x[1]);if(x.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+w.length;var E=g(h,w[1]);if(E.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+E.length;if(v(h,E[0])!="2a864886f70d0307")throw"this only supports TripleDES";y.encryptionSchemeAlg="TripleDES",y.encryptionSchemeIV=v(h,E[1]);var C=g(h,w[0]);if(C.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+C.length;if(v(h,C[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var M=g(h,C[1]);if(M.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+M.length;y.pbkdf2Salt=v(h,M[0]);var R=v(h,M[1]);try{y.pbkdf2Iter=parseInt(R,16)}catch(L){throw"malformed format pbkdf2Iter: "+R}return y},getPBKDF2KeyHexFromParam:function(h,p){var g=Ee.enc.Hex.parse(h.pbkdf2Salt),v=h.pbkdf2Iter,y=Ee.PBKDF2(p,g,{keySize:192/32,iterations:v}),b=Ee.enc.Hex.stringify(y);return b},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(h,p){var g=ln(h,"ENCRYPTED PRIVATE KEY"),v=this.parseHexOfEncryptedPKCS8(g),y=on.getPBKDF2KeyHexFromParam(v,p),b={};b.ciphertext=Ee.enc.Hex.parse(v.ciphertext);var x=Ee.enc.Hex.parse(y),w=Ee.enc.Hex.parse(v.encryptionSchemeIV),E=Ee.TripleDES.decrypt(b,x,{iv:w}),C=Ee.enc.Hex.stringify(E);return C},getKeyFromEncryptedPKCS8PEM:function(h,p){var g=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(h,p),v=this.getKeyFromPlainPrivatePKCS8Hex(g);return v},parsePlainPrivatePKCS8Hex:function(h){var p=ue,g=p.getChildIdx,v=p.getV,y={};if(y.algparam=null,h.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var b=g(h,0);if(b.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(h.substr(b[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var x=g(h,b[1]);if(x.length!=2)throw new Error("malformed PKCS8 private key(code:004)");if(h.substr(x[0],2)!="06")throw new Error("malformed PKCS8 private key(code:005)");if(y.algoid=v(h,x[0]),h.substr(x[1],2)=="06"&&(y.algparam=v(h,x[1])),h.substr(b[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return y.keyidx=p.getVidx(h,b[2]),y},getKeyFromPlainPrivatePKCS8PEM:function(h){var p=ln(h,"PRIVATE KEY"),g=this.getKeyFromPlainPrivatePKCS8Hex(p);return g},getKeyFromPlainPrivatePKCS8Hex:function(h){var p=this.parsePlainPrivatePKCS8Hex(h),g;if(p.algoid=="2a864886f70d010101")g=new Be;else if(ne.crypto.DSA&&p.algoid=="2a8648ce380401")g=new ne.crypto.DSA;else if(ne.crypto.ECDSA&&p.algoid=="2a8648ce3d0201")g=new ne.crypto.ECDSA;else throw"unsupported private key algorithm";return g.readPKCS8PrvKeyHex(h),g},_getKeyFromPublicPKCS8Hex:function(h){var p,g=ue.getVbyList(h,0,[0,0],"06");if(g==="2a864886f70d010101")p=new Be;else if(ne.crypto.DSA&&g==="2a8648ce380401")p=new ne.crypto.DSA;else if(ne.crypto.ECDSA&&g==="2a8648ce3d0201")p=new ne.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return p.readPKCS8PubKeyHex(h),p},parsePublicRawRSAKeyHex:function(h){var p=ue,g=p.getChildIdx,v=p.getV,y={};if(h.substr(0,2)!="30")throw"malformed RSA key(code:001)";var b=g(h,0);if(b.length!=2)throw"malformed RSA key(code:002)";if(h.substr(b[0],2)!="02")throw"malformed RSA key(code:003)";if(y.n=v(h,b[0]),h.substr(b[1],2)!="02")throw"malformed RSA key(code:004)";return y.e=v(h,b[1]),y},parsePublicPKCS8Hex:function(h){var p=ue,g=p.getChildIdx,v=p.getV,y={};y.algparam=null;var b=g(h,0);if(b.length!=2)throw"outer DERSequence shall have 2 elements: "+b.length;var x=b[0];if(h.substr(x,2)!="30")throw"malformed PKCS8 public key(code:001)";var w=g(h,x);if(w.length!=2)throw"malformed PKCS8 public key(code:002)";if(h.substr(w[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(y.algoid=v(h,w[0]),h.substr(w[1],2)=="06"?y.algparam=v(h,w[1]):h.substr(w[1],2)=="30"&&(y.algparam={},y.algparam.p=p.getVbyList(h,w[1],[0],"02"),y.algparam.q=p.getVbyList(h,w[1],[1],"02"),y.algparam.g=p.getVbyList(h,w[1],[2],"02")),h.substr(b[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return y.key=v(h,b[1]).substr(2),y}}}();on.getKey=function(n,t,e){var r=ue,i=r.getChildIdx;r.getV;var a=r.getVbyList,o=ne.crypto,s=o.ECDSA,l=o.DSA,u=Be,c=ln,f=on;if(typeof u!="undefined"&&n instanceof u||typeof s!="undefined"&&n instanceof s||typeof l!="undefined"&&n instanceof l)return n;if(n.curve!==void 0&&n.xy!==void 0&&n.d===void 0)return new s({pub:n.xy,curve:n.curve});if(n.curve!==void 0&&n.d!==void 0)return new s({prv:n.d,curve:n.curve});if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var m=new u;return m.setPublic(n.n,n.e),m}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p!==void 0&&n.q!==void 0&&n.dp!==void 0&&n.dq!==void 0&&n.co!==void 0&&n.qi===void 0){var m=new u;return m.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),m}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var m=new u;return m.setPrivate(n.n,n.e,n.d),m}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var m=new l;return m.setPublic(n.p,n.q,n.g,n.y),m}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var m=new l;return m.setPrivate(n.p,n.q,n.g,n.y,n.x),m}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var m=new u;return m.setPublic(et(n.n),et(n.e)),m}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p!==void 0&&n.q!==void 0&&n.dp!==void 0&&n.dq!==void 0&&n.qi!==void 0){var m=new u;return m.setPrivateEx(et(n.n),et(n.e),et(n.d),et(n.p),et(n.q),et(n.dp),et(n.dq),et(n.qi)),m}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var m=new u;return m.setPrivate(et(n.n),et(n.e),et(n.d)),m}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d===void 0){var A=new s({curve:n.crv}),h=A.ecparams.keylen/4,p=("0000000000"+et(n.x)).slice(-h),g=("0000000000"+et(n.y)).slice(-h),v="04"+p+g;return A.setPublicKeyHex(v),A}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d!==void 0){var A=new s({curve:n.crv}),h=A.ecparams.keylen/4,p=("0000000000"+et(n.x)).slice(-h),g=("0000000000"+et(n.y)).slice(-h),v="04"+p+g,y=("0000000000"+et(n.d)).slice(-h);return A.setPublicKeyHex(v),A.setPrivateKeyHex(y),A}if(e==="pkcs5prv"){var b=n,r=ue,x,m;if(x=i(b,0),x.length===9)m=new u,m.readPKCS5PrvKeyHex(b);else if(x.length===6)m=new l,m.readPKCS5PrvKeyHex(b);else if(x.length>2&&b.substr(x[1],2)==="04")m=new s,m.readPKCS5PrvKeyHex(b);else throw"unsupported PKCS#1/5 hexadecimal key";return m}if(e==="pkcs8prv"){var m=f.getKeyFromPlainPrivatePKCS8Hex(n);return m}if(e==="pkcs8pub")return f._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return He.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return He.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var w=ln(n,"PUBLIC KEY");return f._getKeyFromPublicPKCS8Hex(w)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=c(n,"RSA PRIVATE KEY");return f.getKey(E,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var C=c(n,"DSA PRIVATE KEY"),M=a(C,0,[1],"02"),R=a(C,0,[2],"02"),L=a(C,0,[3],"02"),S=a(C,0,[4],"02"),I=a(C,0,[5],"02"),m=new l;return m.setPrivate(new de(M,16),new de(R,16),new de(L,16),new de(S,16),new de(I,16)),m}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=c(n,"EC PRIVATE KEY");return f.getKey(E,null,"pkcs5prv")}if(n.indexOf("-END PRIVATE KEY-")!=-1)return f.getKeyFromPlainPrivatePKCS8PEM(n);if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var O=f.getDecryptedKeyHex(n,t),P=new Be;return P.readPKCS5PrvKeyHex(O),P}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var C=f.getDecryptedKeyHex(n,t),m=a(C,0,[1],"04"),F=a(C,0,[2,0],"06"),V=a(C,0,[3,0],"03").substr(2),D="";if(ne.crypto.OID.oidhex2name[F]!==void 0)D=ne.crypto.OID.oidhex2name[F];else throw"undefined OID(hex) in KJUR.crypto.OID: "+F;var A=new s({curve:D});return A.setPublicKeyHex(V),A.setPrivateKeyHex(m),A.isPublic=!1,A}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var C=f.getDecryptedKeyHex(n,t),M=a(C,0,[1],"02"),R=a(C,0,[2],"02"),L=a(C,0,[3],"02"),S=a(C,0,[4],"02"),I=a(C,0,[5],"02"),m=new l;return m.setPrivate(new de(M,16),new de(R,16),new de(L,16),new de(S,16),new de(I,16)),m}if(n.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return f.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument")};(typeof ne.asn1=="undefined"||!ne.asn1)&&(ne.asn1={});ne.asn1.ASN1Util={};ne.asn1.ASN1Util.oidHexToInt=function(n){for(var i="",t=parseInt(n.substr(0,2),16),e=Math.floor(t/40),r=t%40,i=e+"."+r,a="",o=2;o<n.length;o+=2){var s=parseInt(n.substr(o,2),16),l=("00000000"+s.toString(2)).slice(-8);if(a=a+l.substr(1,7),l.substr(0,1)=="0"){var u=new de(a,2);i=i+"."+u.toString(10),a=""}}return i};var ue=new function(){};ue.getLblen=function(n,t){if(n.substr(t+2,1)!="8")return 1;var e=parseInt(n.substr(t+3,1));return e==0?-1:0<e&&e<10?e+1:-2};ue.getL=function(n,t){var e=ue.getLblen(n,t);return e<1?"":n.substr(t+2,e*2)};ue.getVblen=function(n,t){var e,r;return e=ue.getL(n,t),e==""?-1:(e.substr(0,1)==="8"?r=new de(e.substr(2),16):r=new de(e,16),r.intValue())};ue.getVidx=function(n,t){var e=ue.getLblen(n,t);return e<0?e:t+(e+1)*2};ue.getV=function(n,t){var e=ue.getVidx(n,t),r=ue.getVblen(n,t);return n.substr(e,r*2)};ue.getTLV=function(n,t){return n.substr(t,2)+ue.getL(n,t)+ue.getV(n,t)};ue.getTLVblen=function(n,t){return 2+ue.getLblen(n,t)*2+ue.getVblen(n,t)*2};ue.getNextSiblingIdx=function(n,t){var e=ue.getVidx(n,t),r=ue.getVblen(n,t);return e+r*2};ue.getChildIdx=function(n,t){var e=ue,r=[],i,a,o;i=e.getVidx(n,t),a=e.getVblen(n,t)*2,n.substr(t,2)=="03"&&(i+=2,a-=2),o=0;for(var s=i;o<=a;){var l=e.getTLVblen(n,s);if(o+=l,o<=a&&r.push(s),s+=l,o>=a)break}return r};ue.getNthChildIdx=function(n,t,e){var r=ue.getChildIdx(n,t);return r[e]};ue.getIdxbyList=function(n,t,e,r){var i=ue,a,o;return e.length==0?r!==void 0&&n.substr(t,2)!==r?-1:t:(a=e.shift(),o=i.getChildIdx(n,t),a>=o.length?-1:i.getIdxbyList(n,o[a],e,r))};ue.getIdxbyListEx=function(n,t,e,r){var i=ue,a,o;if(e.length==0)return r!==void 0&&n.substr(t,2)!==r?-1:t;a=e.shift(),o=i.getChildIdx(n,t);for(var s=0,l=0;l<o.length;l++){var u=n.substr(o[l],2);if(typeof a=="number"&&!i.isContextTag(u)&&s==a||typeof a=="string"&&i.isContextTag(u,a))return i.getIdxbyListEx(n,o[l],e,r);i.isContextTag(u)||s++}return-1};ue.getTLVbyList=function(n,t,e,r){var i=ue,a=i.getIdxbyList(n,t,e,r);return a==-1||a>=n.length?null:i.getTLV(n,a)};ue.getTLVbyListEx=function(n,t,e,r){var i=ue,a=i.getIdxbyListEx(n,t,e,r);return a==-1?null:i.getTLV(n,a)};ue.getVbyList=function(n,t,e,r,i){var a=ue,o,s;return o=a.getIdxbyList(n,t,e,r),o==-1||o>=n.length?null:(s=a.getV(n,o),i===!0&&(s=s.substr(2)),s)};ue.getVbyListEx=function(n,t,e,r,i){var a=ue,o,s;return o=a.getIdxbyListEx(n,t,e,r),o==-1?null:(s=a.getV(n,o),n.substr(o,2)=="03"&&i!==!1&&(s=s.substr(2)),s)};ue.getInt=function(n,t,e){e==null&&(e=-1);try{var r=n.substr(t,2);if(r!="02"&&r!="03")return e;var i=ue.getV(n,t);return r=="02"?parseInt(i,16):Cc(i)}catch(a){return e}};ue.getOID=function(n,t,e){e==null&&(e=null);try{if(n.substr(t,2)!="06")return e;var r=ue.getV(n,t);return Sc(r)}catch(i){return e}};ue.getOIDName=function(n,t,e){e==null&&(e=null);try{var r=ue.getOID(n,t,e);if(r==e)return e;var i=ne.asn1.x509.OID.oid2name(r);return i==""?r:i}catch(a){return e}};ue.getString=function(n,t,e){e==null&&(e=null);try{var r=ue.getV(n,t);return Sr(r)}catch(i){return e}};ue.hextooidstr=function(n){var t=function(f,m){return f.length>=m?f:new Array(m-f.length+1).join("0")+f},e=[],r=n.substr(0,2),i=parseInt(r,16);e[0]=new String(Math.floor(i/40)),e[1]=new String(i%40);for(var a=n.substr(2),o=[],s=0;s<a.length/2;s++)o.push(parseInt(a.substr(s*2,2),16));for(var l=[],u="",s=0;s<o.length;s++)o[s]&128?u=u+t((o[s]&127).toString(2),7):(u=u+t((o[s]&127).toString(2),7),l.push(new String(parseInt(u,2))),u="");var c=e.join(".");return l.length>0&&(c=c+"."+l.join(".")),c};ue.isContextTag=function(n,t){n=n.toLowerCase();var e,r;try{e=parseInt(n,16)}catch(a){return-1}if(t===void 0)return(e&192)==128;try{var i=t.match(/^\[[0-9]+\]$/);return i==null||(r=parseInt(t.substr(1,t.length-1),10),r>31)?!1:(e&192)==128&&(e&31)==r}catch(a){return!1}};ue.isASN1HEX=function(n){var t=ue;if(n.length%2==1)return!1;var e=t.getVblen(n,0),r=n.substr(0,2),i=t.getL(n,0),a=n.length-r.length-i.length;return a==e*2};ue.checkStrictDER=function(n,t,e,r,i){var a=ue;if(e===void 0){if(typeof n!="string")throw new Error("not hex string");if(n=n.toLowerCase(),!ne.lang.String.isHex(n))throw new Error("not hex string");e=n.length,r=n.length/2,r<128?i=1:i=Math.ceil(r.toString(16))+1}var o=a.getL(n,t);if(o.length>i*2)throw new Error("L of TLV too long: idx="+t);var s=a.getVblen(n,t);if(s>r)throw new Error("value of L too long than hex: idx="+t);var l=a.getTLV(n,t),u=l.length-2-a.getL(n,t).length;if(u!==s*2)throw new Error("V string length and L's value not the same:"+u+"/"+s*2);if(t===0&&n.length!=l.length)throw new Error("total length and TLV length unmatch:"+n.length+"!="+l.length);var c=n.substr(t,2);if(c==="02"){var f=a.getVidx(n,t);if(n.substr(f,2)=="00"&&n.charCodeAt(f+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(c,16)&32){for(var m=a.getVblen(n,t),A=0,h=a.getChildIdx(n,t),p=0;p<h.length;p++){var g=a.getTLV(n,h[p]);A+=g.length,a.checkStrictDER(n,h[p],e,r,i)}if(m*2!=A)throw new Error("sum of children's TLV length and L unmatch: "+m*2+"!="+A)}};ue.oidname=function(n){var t=ne.asn1;ne.lang.String.isHex(n)&&(n=t.ASN1Util.oidHexToInt(n));var e=t.x509.OID.oid2name(n);return e===""&&(e=n),e};(typeof ne.asn1=="undefined"||!ne.asn1)&&(ne.asn1={});(typeof ne.asn1.x509=="undefined"||!ne.asn1.x509)&&(ne.asn1.x509={});ne.asn1.x509.AlgorithmIdentifier={};ne.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};ne.asn1.x509.OID=new function(n){this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1"},this.objCache={},this.name2obj=function(t){if(typeof this.objCache[t]!="undefined")return this.objCache[t];if(typeof this.name2oidList[t]=="undefined")throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],r=new ne.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r},this.atype2obj=function(t){if(this.objCache[t]!==void 0)return this.objCache[t];var e;if(t.match(/^\d+\.\d+\.[0-9.]+$/))e=t;else if(this.atype2oidList[t]!==void 0)e=this.atype2oidList[t];else if(this.name2oidList[t]!==void 0)e=this.name2oidList[t];else throw"AttributeType name undefined: "+t;var r=new ne.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r}};ne.asn1.x509.OID.oid2name=function(n){var t=ne.asn1.x509.OID.name2oidList;for(var e in t)if(t[e]==n)return e;return""};ne.asn1.x509.OID.oid2atype=function(n){var t=ne.asn1.x509.OID.atype2oidList;for(var e in t)if(t[e]==n)return e;return n};ne.asn1.x509.OID.name2oid=function(n){if(n.match(/^[0-9.]+$/))return n;var t=ne.asn1.x509.OID.name2oidList;return t[n]===void 0?"":t[n]};Be.getPosArrayOfChildrenFromHex=function(n){return ue.getChildIdx(n,0)};Be.getHexValueArrayOfChildrenFromHex=function(n){var t=ue,e=t.getV,m=Be.getPosArrayOfChildrenFromHex(n),r=e(n,m[0]),i=e(n,m[1]),a=e(n,m[2]),o=e(n,m[3]),s=e(n,m[4]),l=e(n,m[5]),u=e(n,m[6]),c=e(n,m[7]),f=e(n,m[8]),m=new Array;return m.push(r,i,a,o,s,l,u,c,f),m};Be.prototype.readPrivateKeyFromPEMString=function(n){var t=ln(n),e=Be.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Be.prototype.readPKCS5PrvKeyHex=function(n){var t=Be.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};Be.prototype.readPKCS8PrvKeyHex=function(n){var t,e,r,i,a,o,s,l,u=ue,c=u.getVbyListEx;if(u.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");try{t=c(n,0,[2,0,1],"02"),e=c(n,0,[2,0,2],"02"),r=c(n,0,[2,0,3],"02"),i=c(n,0,[2,0,4],"02"),a=c(n,0,[2,0,5],"02"),o=c(n,0,[2,0,6],"02"),s=c(n,0,[2,0,7],"02"),l=c(n,0,[2,0,8],"02")}catch(f){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,e,r,i,a,o,s,l)};Be.prototype.readPKCS5PubKeyHex=function(n){var t=ue,e=t.getV;if(t.isASN1HEX(n)===!1)throw new Error("keyHex is not ASN.1 hex string");var r=t.getChildIdx(n,0);if(r.length!==2||n.substr(r[0],2)!=="02"||n.substr(r[1],2)!=="02")throw new Error("wrong hex for PKCS#5 public key");var i=e(n,r[0]),a=e(n,r[1]);this.setPublic(i,a)};Be.prototype.readPKCS8PubKeyHex=function(n){var t=ue;if(t.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");if(t.getTLVbyListEx(n,0,[0,0])!=="06092a864886f70d010101")throw new Error("not PKCS8 RSA public key");var e=t.getTLVbyListEx(n,0,[1,0]);this.readPKCS5PubKeyHex(e)};Be.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new He,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function M0(n){for(var t in ne.crypto.Util.DIGESTINFOHEAD){var e=ne.crypto.Util.DIGESTINFOHEAD[t],r=e.length;if(n.substring(0,r)==e){var i=[t,n.substring(r)];return i}}return[]}Be.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=wt(t,16),r=this.n.bitLength();if(e.bitLength()>r)return!1;var i=this.doPublic(e),a=i.toString(16);if(a.length+3!=r/4)return!1;var o=a.replace(/^1f+00/,""),s=M0(o);if(s.length==0)return!1;var l=s[0],u=s[1],c=function(m){return ne.crypto.Util.hashString(m,l)},f=c(n);return u==f};Be.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=wt(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),a=M0(i);if(a.length==0)return!1;a[0];var o=a[1];return o==n};Be.prototype.verifyPSS=function(n,t,e,r){var i=function(o){return ne.crypto.Util.hashHex(o,e)},a=i(zi(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(a,t,e,r)};Be.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new de(t,16),a=function(y){return ne.crypto.Util.hashHex(y,e)},o=Sr(n),s=o.length,l=this.n.bitLength()-1,u=Math.ceil(l/8),c;if(r===-1||r===void 0)r=s;else if(r===-2)r=u-s-2;else if(r<-2)throw new Error("invalid salt length");if(u<s+r+2)throw new Error("data too long");var f=this.doPublic(i).toByteArray();for(c=0;c<f.length;c+=1)f[c]&=255;for(;f.length<u;)f.unshift(0);if(f[u-1]!==188)throw new Error("encoded message does not end in 0xbc");f=String.fromCharCode.apply(String,f);var m=f.substr(0,u-s-1),A=f.substr(m.length,s),h=65280>>8*u-l&255;if(m.charCodeAt(0)&h)throw new Error("bits beyond keysize not zero");var p=pss_mgf1_str(A,m.length,a),g=[];for(c=0;c<m.length;c+=1)g[c]=m.charCodeAt(c)^p.charCodeAt(c);g[0]&=~h;var v=u-s-r-2;for(c=0;c<v;c+=1)if(g[c]!==0)throw new Error("leftmost octets not zero");if(g[v]!==1)throw new Error("0x01 marker not found");return A===Sr(a(zi("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,g.slice(-r)))))};Be.SALT_LEN_HLEN=-1;Be.SALT_LEN_MAX=-2;Be.SALT_LEN_RECOVER=-2;function He(n){var t=ue,e=t.getChildIdx,r=t.getV,i=t.getTLV,a=t.getVbyList,o=t.getVbyListEx,s=t.getTLVbyList,l=t.getTLVbyListEx,u=t.getIdxbyList,c=t.getIdxbyListEx,f=t.getVidx,m=t.getInt,A=t.oidname,h=t.hextooidstr,p=ln,g;try{g=ne.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(v){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(this.hex===null||this.version!==0)return this.version;var v=s(this.hex,0,[0,0]);if(v.substr(0,2)=="a0"){var y=s(v,0,[0]),b=m(y,0);if(b<0||2<b)throw new Error("malformed version field");return this.version=b+1,this.version}else return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return o(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var v=l(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(v)},this.getAlgorithmIdentifierName=function(v){for(var y in g)if(v===g[y])return y;return A(o(v,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return s(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){var v=this.getIssuer();return v.str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return s(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){var v=this.getSubject();return v.str},this.getNotBefore=function(){var v=a(this.hex,0,[0,4+this.foffset,0]);return v=v.replace(/(..)/g,"%$1"),v=decodeURIComponent(v),v},this.getNotAfter=function(){var v=a(this.hex,0,[0,4+this.foffset,1]);return v=v.replace(/(..)/g,"%$1"),v=decodeURIComponent(v),v},this.getPublicKeyHex=function(){return t.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return u(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var v=this.getPublicKeyIdx();return u(this.hex,v,[1,0],"30")},this.getPublicKey=function(){return on.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var v=s(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(v)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(v){var y=this.getSignatureAlgorithmField(),b=this.getSignatureValueHex(),x=s(this.hex,0,[0],"30"),w=new ne.crypto.Signature({alg:y});return w.init(v),w.updateHex(x),w.verify(b)},this.parseExt=function(v){var y,b,x;if(v===void 0){if(x=this.hex,this.version!==3)return-1;y=u(x,0,[0,7,0],"30"),b=e(x,y)}else{x=ln(v);var w=u(x,0,[0,3,0,0],"06");if(r(x,w)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}y=u(x,0,[0,3,0,1,0],"30"),b=e(x,y),this.hex=x}this.aExtInfo=new Array;for(var E=0;E<b.length;E++){var C={};C.critical=!1;var M=e(x,b[E]),R=0;M.length===3&&(C.critical=!0,R=1),C.oid=t.hextooidstr(a(x,b[E],[0],"06"));var L=u(x,b[E],[1+R]);C.vidx=f(x,L),this.aExtInfo.push(C)}},this.getExtInfo=function(v){var y=this.aExtInfo,b=v;if(v.match(/^[0-9.]+$/)||(b=ne.asn1.x509.OID.name2oid(v)),b!==""){for(var x=0;x<y.length;x++)if(y[x].oid===b)return y[x]}},this.getExtBasicConstraints=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("basicConstraints");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"basicConstraints"};if(y&&(x.critical=!0),v==="3000")return x;if(v==="30030101ff")return x.cA=!0,x;if(v.substr(0,12)==="30060101ff02"){var w=r(v,10),E=parseInt(w,16);return x.cA=!0,x.pathLen=E,x}throw new Error("hExtV parse error: "+v)},this.getExtKeyUsage=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("keyUsage");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"keyUsage"};return y&&(x.critical=!0),x.names=this.getExtKeyUsageString(v).split(","),x},this.getExtKeyUsageBin=function(v){if(v===void 0){var y=this.getExtInfo("keyUsage");if(y===void 0)return"";v=i(this.hex,y.vidx)}if(v.length!=8&&v.length!=10)throw new Error("malformed key usage value: "+v);var b="000000000000000"+parseInt(v.substr(6),16).toString(2);return v.length==8&&(b=b.slice(-8)),v.length==10&&(b=b.slice(-16)),b=b.replace(/0+$/,""),b==""&&(b="0"),b},this.getExtKeyUsageString=function(v){for(var y=this.getExtKeyUsageBin(v),b=new Array,x=0;x<y.length;x++)y.substr(x,1)=="1"&&b.push(He.KEYUSAGE_NAME[x]);return b.join(",")},this.getExtSubjectKeyIdentifier=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("subjectKeyIdentifier");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"subjectKeyIdentifier"};y&&(x.critical=!0);var w=r(v,0);return x.kid={hex:w},x},this.getExtAuthorityKeyIdentifier=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("authorityKeyIdentifier");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"authorityKeyIdentifier"};y&&(x.critical=!0);for(var w=e(v,0),E=0;E<w.length;E++){var C=v.substr(w[E],2);if(C==="80"&&(x.kid={hex:r(v,w[E])}),C==="a1"){var M=i(v,w[E]),R=this.getGeneralNames(M);x.issuer=R[0].dn}C==="82"&&(x.sn={hex:r(v,w[E])})}return x},this.getExtExtKeyUsage=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("extKeyUsage");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"extKeyUsage",array:[]};y&&(x.critical=!0);for(var w=e(v,0),E=0;E<w.length;E++)x.array.push(A(r(v,w[E])));return x},this.getExtExtKeyUsageName=function(){var v=this.getExtInfo("extKeyUsage");if(v===void 0)return v;var y=new Array,b=i(this.hex,v.vidx);if(b==="")return y;for(var x=e(b,0),w=0;w<x.length;w++)y.push(A(r(b,x[w])));return y},this.getExtSubjectAltName=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("subjectAltName");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"subjectAltName",array:[]};return y&&(x.critical=!0),x.array=this.getGeneralNames(v),x},this.getExtIssuerAltName=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("issuerAltName");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"issuerAltName",array:[]};return y&&(x.critical=!0),x.array=this.getGeneralNames(v),x},this.getGeneralNames=function(v){for(var y=e(v,0),b=[],x=0;x<y.length;x++){var w=this.getGeneralName(i(v,y[x]));w!==void 0&&b.push(w)}return b},this.getGeneralName=function(v){var y=v.substr(0,2),b=r(v,0),x=Sr(b);if(y=="81")return{rfc822:x};if(y=="82")return{dns:x};if(y=="86")return{uri:x};if(y=="87")return{ip:jo(b)};if(y=="a4")return{dn:this.getX500Name(b)}},this.getExtSubjectAltName2=function(){var v,y,b,x=this.getExtInfo("subjectAltName");if(x===void 0)return x;for(var w=new Array,E=i(this.hex,x.vidx),C=e(E,0),M=0;M<C.length;M++)b=E.substr(C[M],2),v=r(E,C[M]),b==="81"&&(y=lr(v),w.push(["MAIL",y])),b==="82"&&(y=lr(v),w.push(["DNS",y])),b==="84"&&(y=He.hex2dn(v,0),w.push(["DN",y])),b==="86"&&(y=lr(v),w.push(["URI",y])),b==="87"&&(y=jo(v),w.push(["IP",y]));return w},this.getExtCRLDistributionPoints=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("cRLDistributionPoints");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"cRLDistributionPoints",array:[]};y&&(x.critical=!0);for(var w=e(v,0),E=0;E<w.length;E++){var C=i(v,w[E]);x.array.push(this.getDistributionPoint(C))}return x},this.getDistributionPoint=function(v){for(var y={},b=e(v,0),x=0;x<b.length;x++){var w=v.substr(b[x],2),E=i(v,b[x]);w=="a0"&&(y.dpname=this.getDistributionPointName(E))}return y},this.getDistributionPointName=function(v){for(var y={},b=e(v,0),x=0;x<b.length;x++){var w=v.substr(b[x],2),E=i(v,b[x]);w=="a0"&&(y.full=this.getGeneralNames(E))}return y},this.getExtCRLDistributionPointsURI=function(){var v=this.getExtInfo("cRLDistributionPoints");if(v===void 0)return v;for(var y=new Array,b=e(this.hex,v.vidx),x=0;x<b.length;x++)try{var w=a(this.hex,b[x],[0,0,0],"86"),E=lr(w);y.push(E)}catch(C){}return y},this.getExtAIAInfo=function(){var v=this.getExtInfo("authorityInfoAccess");if(v===void 0)return v;for(var y={ocsp:[],caissuer:[]},b=e(this.hex,v.vidx),x=0;x<b.length;x++){var w=a(this.hex,b[x],[0],"06"),E=a(this.hex,b[x],[1],"86");w==="2b06010505073001"&&y.ocsp.push(lr(E)),w==="2b06010505073002"&&y.caissuer.push(lr(E))}return y},this.getExtAuthorityInfoAccess=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("authorityInfoAccess");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"authorityInfoAccess",array:[]};y&&(x.critical=!0);for(var w=e(v,0),E=0;E<w.length;E++){var C=o(v,w[E],[0],"06"),M=a(v,w[E],[1],"86"),R=lr(M);if(C=="2b06010505073001")x.array.push({ocsp:R});else if(C=="2b06010505073002")x.array.push({caissuer:R});else throw new Error("unknown method: "+C)}return x},this.getExtCertificatePolicies=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("certificatePolicies");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"certificatePolicies",array:[]};y&&(x.critical=!0);for(var w=e(v,0),E=0;E<w.length;E++){var C=i(v,w[E]),M=this.getPolicyInformation(C);x.array.push(M)}return x},this.getPolicyInformation=function(v){var y={},b=a(v,0,[0],"06");y.policyoid=A(b);var x=c(v,0,[1],"30");if(x!=-1){y.array=[];for(var w=e(v,x),E=0;E<w.length;E++){var C=i(v,w[E]),M=this.getPolicyQualifierInfo(C);y.array.push(M)}}return y},this.getPolicyQualifierInfo=function(v){var y={},b=a(v,0,[0],"06");if(b==="2b06010505070201"){var x=o(v,0,[1],"16");y.cps=Sr(x)}else if(b==="2b06010505070202"){var w=s(v,0,[1],"30");y.unotice=this.getUserNotice(w)}return y},this.getUserNotice=function(v){for(var y={},b=e(v,0),x=0;x<b.length;x++){var w=i(v,b[x]);w.substr(0,2)!="30"&&(y.exptext=this.getDisplayText(w))}return y},this.getDisplayText=function(v){var y={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},b={};return b.type=y[v.substr(0,2)],b.str=Sr(r(v,0)),b},this.getExtCRLNumber=function(v,y){var b={extname:"cRLNumber"};if(y&&(b.critical=!0),v.substr(0,2)=="02")return b.num={hex:r(v,0)},b;throw new Error("hExtV parse error: "+v)},this.getExtCRLReason=function(v,y){var b={extname:"cRLReason"};if(y&&(b.critical=!0),v.substr(0,2)=="0a")return b.code=parseInt(r(v,0),16),b;throw new Error("hExtV parse error: "+v)},this.getExtOcspNonce=function(v,y){var b={extname:"ocspNonce"};y&&(b.critical=!0);var x=r(v,0);return b.hex=x,b},this.getExtOcspNoCheck=function(v,y){var b={extname:"ocspNoCheck"};return y&&(b.critical=!0),b},this.getExtAdobeTimeStamp=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("adobeTimeStamp");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"adobeTimeStamp"};y&&(x.critical=!0);var w=e(v,0);if(w.length>1){var E=i(v,w[1]),C=this.getGeneralName(E);C.uri!=null&&(x.uri=C.uri)}if(w.length>2){var M=i(v,w[2]);M=="0101ff"&&(x.reqauth=!0),M=="010100"&&(x.reqauth=!1)}return x},this.getX500NameRule=function(v){for(var y=null,b=[],x=0;x<v.length;x++)for(var w=v[x],E=0;E<w.length;E++)b.push(w[E]);for(var x=0;x<b.length;x++){var C=b[x],M=C.ds,R=C.value,L=C.type;if(M!="prn"&&M!="utf8"&&M!="ia5")return"mixed";if(M=="ia5"){if(L!="CN")return"mixed";if(ne.lang.String.isMail(R))continue;return"mixed"}if(L=="C"){if(M=="prn")continue;return"mixed"}if(y==null)y=M;else if(y!==M)return"mixed"}return y==null?"prn":y},this.getX500Name=function(v){var y=this.getX500NameArray(v),b=this.dnarraytostr(y);return{array:y,str:b}},this.getX500NameArray=function(v){for(var y=[],b=e(v,0),x=0;x<b.length;x++)y.push(this.getRDN(i(v,b[x])));return y},this.getRDN=function(v){for(var y=[],b=e(v,0),x=0;x<b.length;x++)y.push(this.getAttrTypeAndValue(i(v,b[x])));return y},this.getAttrTypeAndValue=function(v){var y={type:null,value:null,ds:null},b=e(v,0),x=a(v,b[0],[],"06"),w=a(v,b[1],[]),E=ne.asn1.ASN1Util.oidHexToInt(x);return y.type=ne.asn1.x509.OID.oid2atype(E),y.ds=this.HEX2STAG[v.substr(b[1],2)],y.ds!="bmp"?y.value=lr(w):y.value=Ec(w),y},this.readCertPEM=function(v){this.readCertHex(p(v))},this.readCertHex=function(v){this.hex=v,this.getVersion();try{u(this.hex,0,[0,7],"a3"),this.parseExt()}catch(y){}},this.getParam=function(){var v={};return v.version=this.getVersion(),v.serial={hex:this.getSerialNumberHex()},v.sigalg=this.getSignatureAlgorithmField(),v.issuer=this.getIssuer(),v.notbefore=this.getNotBefore(),v.notafter=this.getNotAfter(),v.subject=this.getSubject(),v.sbjpubkey=bc(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(v.ext=this.getExtParamArray()),v.sighex=this.getSignatureValueHex(),v},this.getExtParamArray=function(v){if(v==null){var y=c(this.hex,0,[0,"[3]"]);y!=-1&&(v=l(this.hex,0,[0,"[3]",0],"30"))}for(var b=[],x=e(v,0),w=0;w<x.length;w++){var E=i(v,x[w]),C=this.getExtParam(E);C!=null&&b.push(C)}return b},this.getExtParam=function(v){var y=e(v,0),b=y.length;if(b!=2&&b!=3)throw new Error("wrong number elements in Extension: "+b+" "+v);var x=h(a(v,0,[0],"06")),w=!1;b==3&&s(v,0,[1])=="0101ff"&&(w=!0);var E=s(v,0,[b-1,0]),C=void 0;if(x=="2.5.29.14"?C=this.getExtSubjectKeyIdentifier(E,w):x=="2.5.29.15"?C=this.getExtKeyUsage(E,w):x=="2.5.29.17"?C=this.getExtSubjectAltName(E,w):x=="2.5.29.18"?C=this.getExtIssuerAltName(E,w):x=="2.5.29.19"?C=this.getExtBasicConstraints(E,w):x=="2.5.29.31"?C=this.getExtCRLDistributionPoints(E,w):x=="2.5.29.32"?C=this.getExtCertificatePolicies(E,w):x=="2.5.29.35"?C=this.getExtAuthorityKeyIdentifier(E,w):x=="2.5.29.37"?C=this.getExtExtKeyUsage(E,w):x=="1.3.6.1.5.5.7.1.1"?C=this.getExtAuthorityInfoAccess(E,w):x=="2.5.29.20"?C=this.getExtCRLNumber(E,w):x=="2.5.29.21"?C=this.getExtCRLReason(E,w):x=="1.3.6.1.5.5.7.48.1.2"?C=this.getExtOcspNonce(E,w):x=="1.3.6.1.5.5.7.48.1.5"?C=this.getExtOcspNoCheck(E,w):x=="1.2.840.113583.1.1.9.1"&&(C=this.getExtAdobeTimeStamp(E,w)),C!=null)return C;var M={extname:x,extn:E};return w&&(M.critical=!0),M},this.findExt=function(v,y){for(var b=0;b<v.length;b++)if(v[b].extname==y)return v[b];return null},this.dnarraytostr=function(v){function y(x){return x.map(function(w){return b(w).replace(/\+/,"\\+")}).join("+")}function b(x){return x.type+"="+x.value}return"/"+v.map(function(x){return y(x).replace(/\//,"\\/")}).join("/")},this.getInfo=function(){var v=function(z){var U=JSON.stringify(z.array).replace(/[\[\]\{\}\"]/g,"");return U},y=function(z){for(var U="",q=z.array,K=0;K<q.length;K++){var j=q[K];if(U+=" policy oid: "+j.policyoid+`
|
|
362
|
+
`,R},parseHexOfEncryptedPKCS8:function(h){var p=ue,g=p.getChildIdx,v=p.getV,y={},b=g(h,0);if(b.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+b.length;y.ciphertext=v(h,b[1]);var x=g(h,b[0]);if(x.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+x.length;if(v(h,x[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var w=g(h,x[1]);if(x.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+w.length;var E=g(h,w[1]);if(E.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+E.length;if(v(h,E[0])!="2a864886f70d0307")throw"this only supports TripleDES";y.encryptionSchemeAlg="TripleDES",y.encryptionSchemeIV=v(h,E[1]);var M=g(h,w[0]);if(M.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+M.length;if(v(h,M[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var C=g(h,M[1]);if(C.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+C.length;y.pbkdf2Salt=v(h,C[0]);var R=v(h,C[1]);try{y.pbkdf2Iter=parseInt(R,16)}catch(L){throw"malformed format pbkdf2Iter: "+R}return y},getPBKDF2KeyHexFromParam:function(h,p){var g=Ee.enc.Hex.parse(h.pbkdf2Salt),v=h.pbkdf2Iter,y=Ee.PBKDF2(p,g,{keySize:192/32,iterations:v}),b=Ee.enc.Hex.stringify(y);return b},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(h,p){var g=ln(h,"ENCRYPTED PRIVATE KEY"),v=this.parseHexOfEncryptedPKCS8(g),y=on.getPBKDF2KeyHexFromParam(v,p),b={};b.ciphertext=Ee.enc.Hex.parse(v.ciphertext);var x=Ee.enc.Hex.parse(y),w=Ee.enc.Hex.parse(v.encryptionSchemeIV),E=Ee.TripleDES.decrypt(b,x,{iv:w}),M=Ee.enc.Hex.stringify(E);return M},getKeyFromEncryptedPKCS8PEM:function(h,p){var g=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(h,p),v=this.getKeyFromPlainPrivatePKCS8Hex(g);return v},parsePlainPrivatePKCS8Hex:function(h){var p=ue,g=p.getChildIdx,v=p.getV,y={};if(y.algparam=null,h.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var b=g(h,0);if(b.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(h.substr(b[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var x=g(h,b[1]);if(x.length!=2)throw new Error("malformed PKCS8 private key(code:004)");if(h.substr(x[0],2)!="06")throw new Error("malformed PKCS8 private key(code:005)");if(y.algoid=v(h,x[0]),h.substr(x[1],2)=="06"&&(y.algparam=v(h,x[1])),h.substr(b[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return y.keyidx=p.getVidx(h,b[2]),y},getKeyFromPlainPrivatePKCS8PEM:function(h){var p=ln(h,"PRIVATE KEY"),g=this.getKeyFromPlainPrivatePKCS8Hex(p);return g},getKeyFromPlainPrivatePKCS8Hex:function(h){var p=this.parsePlainPrivatePKCS8Hex(h),g;if(p.algoid=="2a864886f70d010101")g=new Be;else if(ne.crypto.DSA&&p.algoid=="2a8648ce380401")g=new ne.crypto.DSA;else if(ne.crypto.ECDSA&&p.algoid=="2a8648ce3d0201")g=new ne.crypto.ECDSA;else throw"unsupported private key algorithm";return g.readPKCS8PrvKeyHex(h),g},_getKeyFromPublicPKCS8Hex:function(h){var p,g=ue.getVbyList(h,0,[0,0],"06");if(g==="2a864886f70d010101")p=new Be;else if(ne.crypto.DSA&&g==="2a8648ce380401")p=new ne.crypto.DSA;else if(ne.crypto.ECDSA&&g==="2a8648ce3d0201")p=new ne.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return p.readPKCS8PubKeyHex(h),p},parsePublicRawRSAKeyHex:function(h){var p=ue,g=p.getChildIdx,v=p.getV,y={};if(h.substr(0,2)!="30")throw"malformed RSA key(code:001)";var b=g(h,0);if(b.length!=2)throw"malformed RSA key(code:002)";if(h.substr(b[0],2)!="02")throw"malformed RSA key(code:003)";if(y.n=v(h,b[0]),h.substr(b[1],2)!="02")throw"malformed RSA key(code:004)";return y.e=v(h,b[1]),y},parsePublicPKCS8Hex:function(h){var p=ue,g=p.getChildIdx,v=p.getV,y={};y.algparam=null;var b=g(h,0);if(b.length!=2)throw"outer DERSequence shall have 2 elements: "+b.length;var x=b[0];if(h.substr(x,2)!="30")throw"malformed PKCS8 public key(code:001)";var w=g(h,x);if(w.length!=2)throw"malformed PKCS8 public key(code:002)";if(h.substr(w[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(y.algoid=v(h,w[0]),h.substr(w[1],2)=="06"?y.algparam=v(h,w[1]):h.substr(w[1],2)=="30"&&(y.algparam={},y.algparam.p=p.getVbyList(h,w[1],[0],"02"),y.algparam.q=p.getVbyList(h,w[1],[1],"02"),y.algparam.g=p.getVbyList(h,w[1],[2],"02")),h.substr(b[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return y.key=v(h,b[1]).substr(2),y}}}();on.getKey=function(n,t,e){var r=ue,i=r.getChildIdx;r.getV;var a=r.getVbyList,o=ne.crypto,s=o.ECDSA,l=o.DSA,u=Be,c=ln,f=on;if(typeof u!="undefined"&&n instanceof u||typeof s!="undefined"&&n instanceof s||typeof l!="undefined"&&n instanceof l)return n;if(n.curve!==void 0&&n.xy!==void 0&&n.d===void 0)return new s({pub:n.xy,curve:n.curve});if(n.curve!==void 0&&n.d!==void 0)return new s({prv:n.d,curve:n.curve});if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var m=new u;return m.setPublic(n.n,n.e),m}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p!==void 0&&n.q!==void 0&&n.dp!==void 0&&n.dq!==void 0&&n.co!==void 0&&n.qi===void 0){var m=new u;return m.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),m}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var m=new u;return m.setPrivate(n.n,n.e,n.d),m}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var m=new l;return m.setPublic(n.p,n.q,n.g,n.y),m}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var m=new l;return m.setPrivate(n.p,n.q,n.g,n.y,n.x),m}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var m=new u;return m.setPublic(et(n.n),et(n.e)),m}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p!==void 0&&n.q!==void 0&&n.dp!==void 0&&n.dq!==void 0&&n.qi!==void 0){var m=new u;return m.setPrivateEx(et(n.n),et(n.e),et(n.d),et(n.p),et(n.q),et(n.dp),et(n.dq),et(n.qi)),m}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var m=new u;return m.setPrivate(et(n.n),et(n.e),et(n.d)),m}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d===void 0){var A=new s({curve:n.crv}),h=A.ecparams.keylen/4,p=("0000000000"+et(n.x)).slice(-h),g=("0000000000"+et(n.y)).slice(-h),v="04"+p+g;return A.setPublicKeyHex(v),A}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d!==void 0){var A=new s({curve:n.crv}),h=A.ecparams.keylen/4,p=("0000000000"+et(n.x)).slice(-h),g=("0000000000"+et(n.y)).slice(-h),v="04"+p+g,y=("0000000000"+et(n.d)).slice(-h);return A.setPublicKeyHex(v),A.setPrivateKeyHex(y),A}if(e==="pkcs5prv"){var b=n,r=ue,x,m;if(x=i(b,0),x.length===9)m=new u,m.readPKCS5PrvKeyHex(b);else if(x.length===6)m=new l,m.readPKCS5PrvKeyHex(b);else if(x.length>2&&b.substr(x[1],2)==="04")m=new s,m.readPKCS5PrvKeyHex(b);else throw"unsupported PKCS#1/5 hexadecimal key";return m}if(e==="pkcs8prv"){var m=f.getKeyFromPlainPrivatePKCS8Hex(n);return m}if(e==="pkcs8pub")return f._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return He.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return He.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var w=ln(n,"PUBLIC KEY");return f._getKeyFromPublicPKCS8Hex(w)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=c(n,"RSA PRIVATE KEY");return f.getKey(E,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var M=c(n,"DSA PRIVATE KEY"),C=a(M,0,[1],"02"),R=a(M,0,[2],"02"),L=a(M,0,[3],"02"),S=a(M,0,[4],"02"),I=a(M,0,[5],"02"),m=new l;return m.setPrivate(new de(C,16),new de(R,16),new de(L,16),new de(S,16),new de(I,16)),m}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=c(n,"EC PRIVATE KEY");return f.getKey(E,null,"pkcs5prv")}if(n.indexOf("-END PRIVATE KEY-")!=-1)return f.getKeyFromPlainPrivatePKCS8PEM(n);if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var O=f.getDecryptedKeyHex(n,t),P=new Be;return P.readPKCS5PrvKeyHex(O),P}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var M=f.getDecryptedKeyHex(n,t),m=a(M,0,[1],"04"),F=a(M,0,[2,0],"06"),V=a(M,0,[3,0],"03").substr(2),D="";if(ne.crypto.OID.oidhex2name[F]!==void 0)D=ne.crypto.OID.oidhex2name[F];else throw"undefined OID(hex) in KJUR.crypto.OID: "+F;var A=new s({curve:D});return A.setPublicKeyHex(V),A.setPrivateKeyHex(m),A.isPublic=!1,A}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var M=f.getDecryptedKeyHex(n,t),C=a(M,0,[1],"02"),R=a(M,0,[2],"02"),L=a(M,0,[3],"02"),S=a(M,0,[4],"02"),I=a(M,0,[5],"02"),m=new l;return m.setPrivate(new de(C,16),new de(R,16),new de(L,16),new de(S,16),new de(I,16)),m}if(n.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return f.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument")};(typeof ne.asn1=="undefined"||!ne.asn1)&&(ne.asn1={});ne.asn1.ASN1Util={};ne.asn1.ASN1Util.oidHexToInt=function(n){for(var i="",t=parseInt(n.substr(0,2),16),e=Math.floor(t/40),r=t%40,i=e+"."+r,a="",o=2;o<n.length;o+=2){var s=parseInt(n.substr(o,2),16),l=("00000000"+s.toString(2)).slice(-8);if(a=a+l.substr(1,7),l.substr(0,1)=="0"){var u=new de(a,2);i=i+"."+u.toString(10),a=""}}return i};var ue=new function(){};ue.getLblen=function(n,t){if(n.substr(t+2,1)!="8")return 1;var e=parseInt(n.substr(t+3,1));return e==0?-1:0<e&&e<10?e+1:-2};ue.getL=function(n,t){var e=ue.getLblen(n,t);return e<1?"":n.substr(t+2,e*2)};ue.getVblen=function(n,t){var e,r;return e=ue.getL(n,t),e==""?-1:(e.substr(0,1)==="8"?r=new de(e.substr(2),16):r=new de(e,16),r.intValue())};ue.getVidx=function(n,t){var e=ue.getLblen(n,t);return e<0?e:t+(e+1)*2};ue.getV=function(n,t){var e=ue.getVidx(n,t),r=ue.getVblen(n,t);return n.substr(e,r*2)};ue.getTLV=function(n,t){return n.substr(t,2)+ue.getL(n,t)+ue.getV(n,t)};ue.getTLVblen=function(n,t){return 2+ue.getLblen(n,t)*2+ue.getVblen(n,t)*2};ue.getNextSiblingIdx=function(n,t){var e=ue.getVidx(n,t),r=ue.getVblen(n,t);return e+r*2};ue.getChildIdx=function(n,t){var e=ue,r=[],i,a,o;i=e.getVidx(n,t),a=e.getVblen(n,t)*2,n.substr(t,2)=="03"&&(i+=2,a-=2),o=0;for(var s=i;o<=a;){var l=e.getTLVblen(n,s);if(o+=l,o<=a&&r.push(s),s+=l,o>=a)break}return r};ue.getNthChildIdx=function(n,t,e){var r=ue.getChildIdx(n,t);return r[e]};ue.getIdxbyList=function(n,t,e,r){var i=ue,a,o;return e.length==0?r!==void 0&&n.substr(t,2)!==r?-1:t:(a=e.shift(),o=i.getChildIdx(n,t),a>=o.length?-1:i.getIdxbyList(n,o[a],e,r))};ue.getIdxbyListEx=function(n,t,e,r){var i=ue,a,o;if(e.length==0)return r!==void 0&&n.substr(t,2)!==r?-1:t;a=e.shift(),o=i.getChildIdx(n,t);for(var s=0,l=0;l<o.length;l++){var u=n.substr(o[l],2);if(typeof a=="number"&&!i.isContextTag(u)&&s==a||typeof a=="string"&&i.isContextTag(u,a))return i.getIdxbyListEx(n,o[l],e,r);i.isContextTag(u)||s++}return-1};ue.getTLVbyList=function(n,t,e,r){var i=ue,a=i.getIdxbyList(n,t,e,r);return a==-1||a>=n.length?null:i.getTLV(n,a)};ue.getTLVbyListEx=function(n,t,e,r){var i=ue,a=i.getIdxbyListEx(n,t,e,r);return a==-1?null:i.getTLV(n,a)};ue.getVbyList=function(n,t,e,r,i){var a=ue,o,s;return o=a.getIdxbyList(n,t,e,r),o==-1||o>=n.length?null:(s=a.getV(n,o),i===!0&&(s=s.substr(2)),s)};ue.getVbyListEx=function(n,t,e,r,i){var a=ue,o,s;return o=a.getIdxbyListEx(n,t,e,r),o==-1?null:(s=a.getV(n,o),n.substr(o,2)=="03"&&i!==!1&&(s=s.substr(2)),s)};ue.getInt=function(n,t,e){e==null&&(e=-1);try{var r=n.substr(t,2);if(r!="02"&&r!="03")return e;var i=ue.getV(n,t);return r=="02"?parseInt(i,16):Mc(i)}catch(a){return e}};ue.getOID=function(n,t,e){e==null&&(e=null);try{if(n.substr(t,2)!="06")return e;var r=ue.getV(n,t);return Sc(r)}catch(i){return e}};ue.getOIDName=function(n,t,e){e==null&&(e=null);try{var r=ue.getOID(n,t,e);if(r==e)return e;var i=ne.asn1.x509.OID.oid2name(r);return i==""?r:i}catch(a){return e}};ue.getString=function(n,t,e){e==null&&(e=null);try{var r=ue.getV(n,t);return Sr(r)}catch(i){return e}};ue.hextooidstr=function(n){var t=function(f,m){return f.length>=m?f:new Array(m-f.length+1).join("0")+f},e=[],r=n.substr(0,2),i=parseInt(r,16);e[0]=new String(Math.floor(i/40)),e[1]=new String(i%40);for(var a=n.substr(2),o=[],s=0;s<a.length/2;s++)o.push(parseInt(a.substr(s*2,2),16));for(var l=[],u="",s=0;s<o.length;s++)o[s]&128?u=u+t((o[s]&127).toString(2),7):(u=u+t((o[s]&127).toString(2),7),l.push(new String(parseInt(u,2))),u="");var c=e.join(".");return l.length>0&&(c=c+"."+l.join(".")),c};ue.isContextTag=function(n,t){n=n.toLowerCase();var e,r;try{e=parseInt(n,16)}catch(a){return-1}if(t===void 0)return(e&192)==128;try{var i=t.match(/^\[[0-9]+\]$/);return i==null||(r=parseInt(t.substr(1,t.length-1),10),r>31)?!1:(e&192)==128&&(e&31)==r}catch(a){return!1}};ue.isASN1HEX=function(n){var t=ue;if(n.length%2==1)return!1;var e=t.getVblen(n,0),r=n.substr(0,2),i=t.getL(n,0),a=n.length-r.length-i.length;return a==e*2};ue.checkStrictDER=function(n,t,e,r,i){var a=ue;if(e===void 0){if(typeof n!="string")throw new Error("not hex string");if(n=n.toLowerCase(),!ne.lang.String.isHex(n))throw new Error("not hex string");e=n.length,r=n.length/2,r<128?i=1:i=Math.ceil(r.toString(16))+1}var o=a.getL(n,t);if(o.length>i*2)throw new Error("L of TLV too long: idx="+t);var s=a.getVblen(n,t);if(s>r)throw new Error("value of L too long than hex: idx="+t);var l=a.getTLV(n,t),u=l.length-2-a.getL(n,t).length;if(u!==s*2)throw new Error("V string length and L's value not the same:"+u+"/"+s*2);if(t===0&&n.length!=l.length)throw new Error("total length and TLV length unmatch:"+n.length+"!="+l.length);var c=n.substr(t,2);if(c==="02"){var f=a.getVidx(n,t);if(n.substr(f,2)=="00"&&n.charCodeAt(f+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(c,16)&32){for(var m=a.getVblen(n,t),A=0,h=a.getChildIdx(n,t),p=0;p<h.length;p++){var g=a.getTLV(n,h[p]);A+=g.length,a.checkStrictDER(n,h[p],e,r,i)}if(m*2!=A)throw new Error("sum of children's TLV length and L unmatch: "+m*2+"!="+A)}};ue.oidname=function(n){var t=ne.asn1;ne.lang.String.isHex(n)&&(n=t.ASN1Util.oidHexToInt(n));var e=t.x509.OID.oid2name(n);return e===""&&(e=n),e};(typeof ne.asn1=="undefined"||!ne.asn1)&&(ne.asn1={});(typeof ne.asn1.x509=="undefined"||!ne.asn1.x509)&&(ne.asn1.x509={});ne.asn1.x509.AlgorithmIdentifier={};ne.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};ne.asn1.x509.OID=new function(n){this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1"},this.objCache={},this.name2obj=function(t){if(typeof this.objCache[t]!="undefined")return this.objCache[t];if(typeof this.name2oidList[t]=="undefined")throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],r=new ne.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r},this.atype2obj=function(t){if(this.objCache[t]!==void 0)return this.objCache[t];var e;if(t.match(/^\d+\.\d+\.[0-9.]+$/))e=t;else if(this.atype2oidList[t]!==void 0)e=this.atype2oidList[t];else if(this.name2oidList[t]!==void 0)e=this.name2oidList[t];else throw"AttributeType name undefined: "+t;var r=new ne.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r}};ne.asn1.x509.OID.oid2name=function(n){var t=ne.asn1.x509.OID.name2oidList;for(var e in t)if(t[e]==n)return e;return""};ne.asn1.x509.OID.oid2atype=function(n){var t=ne.asn1.x509.OID.atype2oidList;for(var e in t)if(t[e]==n)return e;return n};ne.asn1.x509.OID.name2oid=function(n){if(n.match(/^[0-9.]+$/))return n;var t=ne.asn1.x509.OID.name2oidList;return t[n]===void 0?"":t[n]};Be.getPosArrayOfChildrenFromHex=function(n){return ue.getChildIdx(n,0)};Be.getHexValueArrayOfChildrenFromHex=function(n){var t=ue,e=t.getV,m=Be.getPosArrayOfChildrenFromHex(n),r=e(n,m[0]),i=e(n,m[1]),a=e(n,m[2]),o=e(n,m[3]),s=e(n,m[4]),l=e(n,m[5]),u=e(n,m[6]),c=e(n,m[7]),f=e(n,m[8]),m=new Array;return m.push(r,i,a,o,s,l,u,c,f),m};Be.prototype.readPrivateKeyFromPEMString=function(n){var t=ln(n),e=Be.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Be.prototype.readPKCS5PrvKeyHex=function(n){var t=Be.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};Be.prototype.readPKCS8PrvKeyHex=function(n){var t,e,r,i,a,o,s,l,u=ue,c=u.getVbyListEx;if(u.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");try{t=c(n,0,[2,0,1],"02"),e=c(n,0,[2,0,2],"02"),r=c(n,0,[2,0,3],"02"),i=c(n,0,[2,0,4],"02"),a=c(n,0,[2,0,5],"02"),o=c(n,0,[2,0,6],"02"),s=c(n,0,[2,0,7],"02"),l=c(n,0,[2,0,8],"02")}catch(f){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,e,r,i,a,o,s,l)};Be.prototype.readPKCS5PubKeyHex=function(n){var t=ue,e=t.getV;if(t.isASN1HEX(n)===!1)throw new Error("keyHex is not ASN.1 hex string");var r=t.getChildIdx(n,0);if(r.length!==2||n.substr(r[0],2)!=="02"||n.substr(r[1],2)!=="02")throw new Error("wrong hex for PKCS#5 public key");var i=e(n,r[0]),a=e(n,r[1]);this.setPublic(i,a)};Be.prototype.readPKCS8PubKeyHex=function(n){var t=ue;if(t.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");if(t.getTLVbyListEx(n,0,[0,0])!=="06092a864886f70d010101")throw new Error("not PKCS8 RSA public key");var e=t.getTLVbyListEx(n,0,[1,0]);this.readPKCS5PubKeyHex(e)};Be.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new He,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function C0(n){for(var t in ne.crypto.Util.DIGESTINFOHEAD){var e=ne.crypto.Util.DIGESTINFOHEAD[t],r=e.length;if(n.substring(0,r)==e){var i=[t,n.substring(r)];return i}}return[]}Be.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=wt(t,16),r=this.n.bitLength();if(e.bitLength()>r)return!1;var i=this.doPublic(e),a=i.toString(16);if(a.length+3!=r/4)return!1;var o=a.replace(/^1f+00/,""),s=C0(o);if(s.length==0)return!1;var l=s[0],u=s[1],c=function(m){return ne.crypto.Util.hashString(m,l)},f=c(n);return u==f};Be.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=wt(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),a=C0(i);if(a.length==0)return!1;a[0];var o=a[1];return o==n};Be.prototype.verifyPSS=function(n,t,e,r){var i=function(o){return ne.crypto.Util.hashHex(o,e)},a=i(zi(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(a,t,e,r)};Be.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new de(t,16),a=function(y){return ne.crypto.Util.hashHex(y,e)},o=Sr(n),s=o.length,l=this.n.bitLength()-1,u=Math.ceil(l/8),c;if(r===-1||r===void 0)r=s;else if(r===-2)r=u-s-2;else if(r<-2)throw new Error("invalid salt length");if(u<s+r+2)throw new Error("data too long");var f=this.doPublic(i).toByteArray();for(c=0;c<f.length;c+=1)f[c]&=255;for(;f.length<u;)f.unshift(0);if(f[u-1]!==188)throw new Error("encoded message does not end in 0xbc");f=String.fromCharCode.apply(String,f);var m=f.substr(0,u-s-1),A=f.substr(m.length,s),h=65280>>8*u-l&255;if(m.charCodeAt(0)&h)throw new Error("bits beyond keysize not zero");var p=pss_mgf1_str(A,m.length,a),g=[];for(c=0;c<m.length;c+=1)g[c]=m.charCodeAt(c)^p.charCodeAt(c);g[0]&=~h;var v=u-s-r-2;for(c=0;c<v;c+=1)if(g[c]!==0)throw new Error("leftmost octets not zero");if(g[v]!==1)throw new Error("0x01 marker not found");return A===Sr(a(zi("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,g.slice(-r)))))};Be.SALT_LEN_HLEN=-1;Be.SALT_LEN_MAX=-2;Be.SALT_LEN_RECOVER=-2;function He(n){var t=ue,e=t.getChildIdx,r=t.getV,i=t.getTLV,a=t.getVbyList,o=t.getVbyListEx,s=t.getTLVbyList,l=t.getTLVbyListEx,u=t.getIdxbyList,c=t.getIdxbyListEx,f=t.getVidx,m=t.getInt,A=t.oidname,h=t.hextooidstr,p=ln,g;try{g=ne.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(v){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(this.hex===null||this.version!==0)return this.version;var v=s(this.hex,0,[0,0]);if(v.substr(0,2)=="a0"){var y=s(v,0,[0]),b=m(y,0);if(b<0||2<b)throw new Error("malformed version field");return this.version=b+1,this.version}else return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return o(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var v=l(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(v)},this.getAlgorithmIdentifierName=function(v){for(var y in g)if(v===g[y])return y;return A(o(v,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return s(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){var v=this.getIssuer();return v.str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return s(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){var v=this.getSubject();return v.str},this.getNotBefore=function(){var v=a(this.hex,0,[0,4+this.foffset,0]);return v=v.replace(/(..)/g,"%$1"),v=decodeURIComponent(v),v},this.getNotAfter=function(){var v=a(this.hex,0,[0,4+this.foffset,1]);return v=v.replace(/(..)/g,"%$1"),v=decodeURIComponent(v),v},this.getPublicKeyHex=function(){return t.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return u(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var v=this.getPublicKeyIdx();return u(this.hex,v,[1,0],"30")},this.getPublicKey=function(){return on.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var v=s(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(v)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(v){var y=this.getSignatureAlgorithmField(),b=this.getSignatureValueHex(),x=s(this.hex,0,[0],"30"),w=new ne.crypto.Signature({alg:y});return w.init(v),w.updateHex(x),w.verify(b)},this.parseExt=function(v){var y,b,x;if(v===void 0){if(x=this.hex,this.version!==3)return-1;y=u(x,0,[0,7,0],"30"),b=e(x,y)}else{x=ln(v);var w=u(x,0,[0,3,0,0],"06");if(r(x,w)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}y=u(x,0,[0,3,0,1,0],"30"),b=e(x,y),this.hex=x}this.aExtInfo=new Array;for(var E=0;E<b.length;E++){var M={};M.critical=!1;var C=e(x,b[E]),R=0;C.length===3&&(M.critical=!0,R=1),M.oid=t.hextooidstr(a(x,b[E],[0],"06"));var L=u(x,b[E],[1+R]);M.vidx=f(x,L),this.aExtInfo.push(M)}},this.getExtInfo=function(v){var y=this.aExtInfo,b=v;if(v.match(/^[0-9.]+$/)||(b=ne.asn1.x509.OID.name2oid(v)),b!==""){for(var x=0;x<y.length;x++)if(y[x].oid===b)return y[x]}},this.getExtBasicConstraints=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("basicConstraints");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"basicConstraints"};if(y&&(x.critical=!0),v==="3000")return x;if(v==="30030101ff")return x.cA=!0,x;if(v.substr(0,12)==="30060101ff02"){var w=r(v,10),E=parseInt(w,16);return x.cA=!0,x.pathLen=E,x}throw new Error("hExtV parse error: "+v)},this.getExtKeyUsage=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("keyUsage");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"keyUsage"};return y&&(x.critical=!0),x.names=this.getExtKeyUsageString(v).split(","),x},this.getExtKeyUsageBin=function(v){if(v===void 0){var y=this.getExtInfo("keyUsage");if(y===void 0)return"";v=i(this.hex,y.vidx)}if(v.length!=8&&v.length!=10)throw new Error("malformed key usage value: "+v);var b="000000000000000"+parseInt(v.substr(6),16).toString(2);return v.length==8&&(b=b.slice(-8)),v.length==10&&(b=b.slice(-16)),b=b.replace(/0+$/,""),b==""&&(b="0"),b},this.getExtKeyUsageString=function(v){for(var y=this.getExtKeyUsageBin(v),b=new Array,x=0;x<y.length;x++)y.substr(x,1)=="1"&&b.push(He.KEYUSAGE_NAME[x]);return b.join(",")},this.getExtSubjectKeyIdentifier=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("subjectKeyIdentifier");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"subjectKeyIdentifier"};y&&(x.critical=!0);var w=r(v,0);return x.kid={hex:w},x},this.getExtAuthorityKeyIdentifier=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("authorityKeyIdentifier");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"authorityKeyIdentifier"};y&&(x.critical=!0);for(var w=e(v,0),E=0;E<w.length;E++){var M=v.substr(w[E],2);if(M==="80"&&(x.kid={hex:r(v,w[E])}),M==="a1"){var C=i(v,w[E]),R=this.getGeneralNames(C);x.issuer=R[0].dn}M==="82"&&(x.sn={hex:r(v,w[E])})}return x},this.getExtExtKeyUsage=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("extKeyUsage");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"extKeyUsage",array:[]};y&&(x.critical=!0);for(var w=e(v,0),E=0;E<w.length;E++)x.array.push(A(r(v,w[E])));return x},this.getExtExtKeyUsageName=function(){var v=this.getExtInfo("extKeyUsage");if(v===void 0)return v;var y=new Array,b=i(this.hex,v.vidx);if(b==="")return y;for(var x=e(b,0),w=0;w<x.length;w++)y.push(A(r(b,x[w])));return y},this.getExtSubjectAltName=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("subjectAltName");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"subjectAltName",array:[]};return y&&(x.critical=!0),x.array=this.getGeneralNames(v),x},this.getExtIssuerAltName=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("issuerAltName");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"issuerAltName",array:[]};return y&&(x.critical=!0),x.array=this.getGeneralNames(v),x},this.getGeneralNames=function(v){for(var y=e(v,0),b=[],x=0;x<y.length;x++){var w=this.getGeneralName(i(v,y[x]));w!==void 0&&b.push(w)}return b},this.getGeneralName=function(v){var y=v.substr(0,2),b=r(v,0),x=Sr(b);if(y=="81")return{rfc822:x};if(y=="82")return{dns:x};if(y=="86")return{uri:x};if(y=="87")return{ip:jo(b)};if(y=="a4")return{dn:this.getX500Name(b)}},this.getExtSubjectAltName2=function(){var v,y,b,x=this.getExtInfo("subjectAltName");if(x===void 0)return x;for(var w=new Array,E=i(this.hex,x.vidx),M=e(E,0),C=0;C<M.length;C++)b=E.substr(M[C],2),v=r(E,M[C]),b==="81"&&(y=lr(v),w.push(["MAIL",y])),b==="82"&&(y=lr(v),w.push(["DNS",y])),b==="84"&&(y=He.hex2dn(v,0),w.push(["DN",y])),b==="86"&&(y=lr(v),w.push(["URI",y])),b==="87"&&(y=jo(v),w.push(["IP",y]));return w},this.getExtCRLDistributionPoints=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("cRLDistributionPoints");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"cRLDistributionPoints",array:[]};y&&(x.critical=!0);for(var w=e(v,0),E=0;E<w.length;E++){var M=i(v,w[E]);x.array.push(this.getDistributionPoint(M))}return x},this.getDistributionPoint=function(v){for(var y={},b=e(v,0),x=0;x<b.length;x++){var w=v.substr(b[x],2),E=i(v,b[x]);w=="a0"&&(y.dpname=this.getDistributionPointName(E))}return y},this.getDistributionPointName=function(v){for(var y={},b=e(v,0),x=0;x<b.length;x++){var w=v.substr(b[x],2),E=i(v,b[x]);w=="a0"&&(y.full=this.getGeneralNames(E))}return y},this.getExtCRLDistributionPointsURI=function(){var v=this.getExtInfo("cRLDistributionPoints");if(v===void 0)return v;for(var y=new Array,b=e(this.hex,v.vidx),x=0;x<b.length;x++)try{var w=a(this.hex,b[x],[0,0,0],"86"),E=lr(w);y.push(E)}catch(M){}return y},this.getExtAIAInfo=function(){var v=this.getExtInfo("authorityInfoAccess");if(v===void 0)return v;for(var y={ocsp:[],caissuer:[]},b=e(this.hex,v.vidx),x=0;x<b.length;x++){var w=a(this.hex,b[x],[0],"06"),E=a(this.hex,b[x],[1],"86");w==="2b06010505073001"&&y.ocsp.push(lr(E)),w==="2b06010505073002"&&y.caissuer.push(lr(E))}return y},this.getExtAuthorityInfoAccess=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("authorityInfoAccess");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"authorityInfoAccess",array:[]};y&&(x.critical=!0);for(var w=e(v,0),E=0;E<w.length;E++){var M=o(v,w[E],[0],"06"),C=a(v,w[E],[1],"86"),R=lr(C);if(M=="2b06010505073001")x.array.push({ocsp:R});else if(M=="2b06010505073002")x.array.push({caissuer:R});else throw new Error("unknown method: "+M)}return x},this.getExtCertificatePolicies=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("certificatePolicies");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"certificatePolicies",array:[]};y&&(x.critical=!0);for(var w=e(v,0),E=0;E<w.length;E++){var M=i(v,w[E]),C=this.getPolicyInformation(M);x.array.push(C)}return x},this.getPolicyInformation=function(v){var y={},b=a(v,0,[0],"06");y.policyoid=A(b);var x=c(v,0,[1],"30");if(x!=-1){y.array=[];for(var w=e(v,x),E=0;E<w.length;E++){var M=i(v,w[E]),C=this.getPolicyQualifierInfo(M);y.array.push(C)}}return y},this.getPolicyQualifierInfo=function(v){var y={},b=a(v,0,[0],"06");if(b==="2b06010505070201"){var x=o(v,0,[1],"16");y.cps=Sr(x)}else if(b==="2b06010505070202"){var w=s(v,0,[1],"30");y.unotice=this.getUserNotice(w)}return y},this.getUserNotice=function(v){for(var y={},b=e(v,0),x=0;x<b.length;x++){var w=i(v,b[x]);w.substr(0,2)!="30"&&(y.exptext=this.getDisplayText(w))}return y},this.getDisplayText=function(v){var y={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},b={};return b.type=y[v.substr(0,2)],b.str=Sr(r(v,0)),b},this.getExtCRLNumber=function(v,y){var b={extname:"cRLNumber"};if(y&&(b.critical=!0),v.substr(0,2)=="02")return b.num={hex:r(v,0)},b;throw new Error("hExtV parse error: "+v)},this.getExtCRLReason=function(v,y){var b={extname:"cRLReason"};if(y&&(b.critical=!0),v.substr(0,2)=="0a")return b.code=parseInt(r(v,0),16),b;throw new Error("hExtV parse error: "+v)},this.getExtOcspNonce=function(v,y){var b={extname:"ocspNonce"};y&&(b.critical=!0);var x=r(v,0);return b.hex=x,b},this.getExtOcspNoCheck=function(v,y){var b={extname:"ocspNoCheck"};return y&&(b.critical=!0),b},this.getExtAdobeTimeStamp=function(v,y){if(v===void 0&&y===void 0){var b=this.getExtInfo("adobeTimeStamp");if(b===void 0)return;v=i(this.hex,b.vidx),y=b.critical}var x={extname:"adobeTimeStamp"};y&&(x.critical=!0);var w=e(v,0);if(w.length>1){var E=i(v,w[1]),M=this.getGeneralName(E);M.uri!=null&&(x.uri=M.uri)}if(w.length>2){var C=i(v,w[2]);C=="0101ff"&&(x.reqauth=!0),C=="010100"&&(x.reqauth=!1)}return x},this.getX500NameRule=function(v){for(var y=null,b=[],x=0;x<v.length;x++)for(var w=v[x],E=0;E<w.length;E++)b.push(w[E]);for(var x=0;x<b.length;x++){var M=b[x],C=M.ds,R=M.value,L=M.type;if(C!="prn"&&C!="utf8"&&C!="ia5")return"mixed";if(C=="ia5"){if(L!="CN")return"mixed";if(ne.lang.String.isMail(R))continue;return"mixed"}if(L=="C"){if(C=="prn")continue;return"mixed"}if(y==null)y=C;else if(y!==C)return"mixed"}return y==null?"prn":y},this.getX500Name=function(v){var y=this.getX500NameArray(v),b=this.dnarraytostr(y);return{array:y,str:b}},this.getX500NameArray=function(v){for(var y=[],b=e(v,0),x=0;x<b.length;x++)y.push(this.getRDN(i(v,b[x])));return y},this.getRDN=function(v){for(var y=[],b=e(v,0),x=0;x<b.length;x++)y.push(this.getAttrTypeAndValue(i(v,b[x])));return y},this.getAttrTypeAndValue=function(v){var y={type:null,value:null,ds:null},b=e(v,0),x=a(v,b[0],[],"06"),w=a(v,b[1],[]),E=ne.asn1.ASN1Util.oidHexToInt(x);return y.type=ne.asn1.x509.OID.oid2atype(E),y.ds=this.HEX2STAG[v.substr(b[1],2)],y.ds!="bmp"?y.value=lr(w):y.value=Ec(w),y},this.readCertPEM=function(v){this.readCertHex(p(v))},this.readCertHex=function(v){this.hex=v,this.getVersion();try{u(this.hex,0,[0,7],"a3"),this.parseExt()}catch(y){}},this.getParam=function(){var v={};return v.version=this.getVersion(),v.serial={hex:this.getSerialNumberHex()},v.sigalg=this.getSignatureAlgorithmField(),v.issuer=this.getIssuer(),v.notbefore=this.getNotBefore(),v.notafter=this.getNotAfter(),v.subject=this.getSubject(),v.sbjpubkey=bc(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(v.ext=this.getExtParamArray()),v.sighex=this.getSignatureValueHex(),v},this.getExtParamArray=function(v){if(v==null){var y=c(this.hex,0,[0,"[3]"]);y!=-1&&(v=l(this.hex,0,[0,"[3]",0],"30"))}for(var b=[],x=e(v,0),w=0;w<x.length;w++){var E=i(v,x[w]),M=this.getExtParam(E);M!=null&&b.push(M)}return b},this.getExtParam=function(v){var y=e(v,0),b=y.length;if(b!=2&&b!=3)throw new Error("wrong number elements in Extension: "+b+" "+v);var x=h(a(v,0,[0],"06")),w=!1;b==3&&s(v,0,[1])=="0101ff"&&(w=!0);var E=s(v,0,[b-1,0]),M=void 0;if(x=="2.5.29.14"?M=this.getExtSubjectKeyIdentifier(E,w):x=="2.5.29.15"?M=this.getExtKeyUsage(E,w):x=="2.5.29.17"?M=this.getExtSubjectAltName(E,w):x=="2.5.29.18"?M=this.getExtIssuerAltName(E,w):x=="2.5.29.19"?M=this.getExtBasicConstraints(E,w):x=="2.5.29.31"?M=this.getExtCRLDistributionPoints(E,w):x=="2.5.29.32"?M=this.getExtCertificatePolicies(E,w):x=="2.5.29.35"?M=this.getExtAuthorityKeyIdentifier(E,w):x=="2.5.29.37"?M=this.getExtExtKeyUsage(E,w):x=="1.3.6.1.5.5.7.1.1"?M=this.getExtAuthorityInfoAccess(E,w):x=="2.5.29.20"?M=this.getExtCRLNumber(E,w):x=="2.5.29.21"?M=this.getExtCRLReason(E,w):x=="1.3.6.1.5.5.7.48.1.2"?M=this.getExtOcspNonce(E,w):x=="1.3.6.1.5.5.7.48.1.5"?M=this.getExtOcspNoCheck(E,w):x=="1.2.840.113583.1.1.9.1"&&(M=this.getExtAdobeTimeStamp(E,w)),M!=null)return M;var C={extname:x,extn:E};return w&&(C.critical=!0),C},this.findExt=function(v,y){for(var b=0;b<v.length;b++)if(v[b].extname==y)return v[b];return null},this.dnarraytostr=function(v){function y(x){return x.map(function(w){return b(w).replace(/\+/,"\\+")}).join("+")}function b(x){return x.type+"="+x.value}return"/"+v.map(function(x){return y(x).replace(/\//,"\\/")}).join("/")},this.getInfo=function(){var v=function(z){var U=JSON.stringify(z.array).replace(/[\[\]\{\}\"]/g,"");return U},y=function(z){for(var U="",q=z.array,K=0;K<q.length;K++){var j=q[K];if(U+=" policy oid: "+j.policyoid+`
|
|
363
363
|
`,j.array!==void 0)for(var J=0;J<j.array.length;J++){var X=j.array[J];X.cps!==void 0&&(U+=" cps: "+X.cps+`
|
|
364
364
|
`)}}return U},b=function(z){for(var U="",q=z.array,K=0;K<q.length;K++){var j=q[K];try{j.dpname.full[0].uri!==void 0&&(U+=" "+j.dpname.full[0].uri+`
|
|
365
365
|
`)}catch(J){}try{j.dname.full[0].dn.hex!==void 0&&(U+=" "+He.hex2dn(j.dpname.full[0].dn.hex)+`
|
|
366
366
|
`)}catch(J){}}return U},x=function(z){for(var U="",q=z.array,K=0;K<q.length;K++){var j=q[K];j.caissuer!==void 0&&(U+=" caissuer: "+j.caissuer+`
|
|
367
367
|
`),j.ocsp!==void 0&&(U+=" ocsp: "+j.ocsp+`
|
|
368
|
-
`)}return U},w,E,
|
|
368
|
+
`)}return U},w,E,M;if(w=`Basic Fields
|
|
369
369
|
`,w+=" serial number: "+this.getSerialNumberHex()+`
|
|
370
370
|
`,w+=" signature algorithm: "+this.getSignatureAlgorithmField()+`
|
|
371
371
|
`,w+=" issuer: "+this.getIssuerString()+`
|
|
@@ -376,8 +376,8 @@
|
|
|
376
376
|
`,E=this.getPublicKey(),w+=" key algorithm: "+E.type+`
|
|
377
377
|
`,E.type==="RSA"&&(w+=" n="+_o(E.n.toString(16)).substr(0,16)+`...
|
|
378
378
|
`,w+=" e="+_o(E.e.toString(16))+`
|
|
379
|
-
`),
|
|
380
|
-
`;for(var
|
|
379
|
+
`),M=this.aExtInfo,M!=null){w+=`X509v3 Extensions:
|
|
380
|
+
`;for(var C=0;C<M.length;C++){var R=M[C],L=ne.asn1.x509.OID.oid2name(R.oid);L===""&&(L=R.oid);var S="";if(R.critical===!0&&(S="CRITICAL"),w+=" "+L+" "+S+`:
|
|
381
381
|
`,L==="basicConstraints"){var I=this.getExtBasicConstraints();I.cA===void 0?w+=` {}
|
|
382
382
|
`:(w+=" cA=true",I.pathLen!==void 0&&(w+=", pathLen="+I.pathLen),w+=`
|
|
383
383
|
`)}else if(L==="keyUsage")w+=" "+this.getExtKeyUsageString()+`
|
|
@@ -387,8 +387,8 @@
|
|
|
387
387
|
`}else if(L==="subjectAltName"){var F=v(this.getExtSubjectAltName());w+=" "+F+`
|
|
388
388
|
`}else if(L==="cRLDistributionPoints"){var V=this.getExtCRLDistributionPoints();w+=b(V)}else if(L==="authorityInfoAccess"){var D=this.getExtAuthorityInfoAccess();w+=x(D)}else L==="certificatePolicies"&&(w+=y(this.getExtCertificatePolicies()))}}return w+="signature algorithm: "+this.getSignatureAlgorithmName()+`
|
|
389
389
|
`,w+="signature: "+this.getSignatureValueHex().substr(0,16)+`...
|
|
390
|
-
`,w},typeof n=="string"&&(n.indexOf("-----BEGIN")!=-1?this.readCertPEM(n):ne.lang.String.isHex(n)&&this.readCertHex(n))}He.hex2dn=function(n,t){t===void 0&&(t=0);var e=new He;ue.getTLV(n,t);var r=e.getX500Name(n);return r.str};He.hex2rdn=function(n,t){if(t===void 0&&(t=0),n.substr(t,2)!=="31")throw new Error("malformed RDN");for(var e=new Array,r=ue.getChildIdx(n,t),i=0;i<r.length;i++)e.push(He.hex2attrTypeValue(n,r[i]));return e=e.map(function(a){return a.replace("+","\\+")}),e.join("+")};He.hex2attrTypeValue=function(n,t){var e=ue,r=e.getV;if(t===void 0&&(t=0),n.substr(t,2)!=="30")throw new Error("malformed attribute type and value");var i=e.getChildIdx(n,t);i.length!==2||n.substr(i[0],2);var a=r(n,i[0]),o=ne.asn1.ASN1Util.oidHexToInt(a),s=ne.asn1.x509.OID.oid2atype(o),l=r(n,i[1]),u=Sr(l);return s+"="+u};He.getPublicKeyFromCertHex=function(n){var t=new He;return t.readCertHex(n),t.getPublicKey()};He.getPublicKeyFromCertPEM=function(n){var t=new He;return t.readCertPEM(n),t.getPublicKey()};He.getPublicKeyInfoPropOfCertPEM=function(n){var t=ue,e=t.getVbyList,r={},i,a;return r.algparam=null,i=new He,i.readCertPEM(n),a=i.getPublicKeyHex(),r.keyhex=e(a,0,[1],"03").substr(2),r.algoid=e(a,0,[0,0],"06"),r.algoid==="2a8648ce3d0201"&&(r.algparam=e(a,0,[0,1],"06")),r};He.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function Xo(n){return Ee.SHA256(n).toString()}var I0=[function(){var n=new He;return n.readCertPEM(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVS@ PPNErtNVONtVWNZR}@]nU\0ZaZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg R]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\x07\\QN>Z N\\Q^B[QqnS=\b\\QN>Zwp\\Q^B[QqnZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg R]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaPPNvVQ^fWX|gVup[N^ROO^NQttV]NQPPNt|PttVONZU|C\b\\@@e^Xv{[vTtd8`nyO@\x07ebN[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b[oOVU\x07ep@pYY\0cegY{r ?\bAbq?ff8}UaXoN_D]_X_8yozYFT`N{`\\{zvu?\bDWT}=_<\x07StX Nx\x07\0\b \0aT=c@ucnWfR[vf>RFxAFV}{N`dN^\\<eawBPxx}quT=|{T_R@Fp^Y<ZevRsWaZ]V CVrRVtAAc[ Qp|d|tqoQ=T|XX =u\\N8XNCx\\aU>wz X<e@Vc?dy\\|^FEq|=p`pBdF@bs^d<]vp\\^TZ P\bZ\b\\YNNSZ_\\w^|TsD8db _ Y\\o^Cw>Z\0x\\^aN]wWf\bA} C^d_{\x07ZC@\by]gY@E BFY?OsaqbDcVgQbZeFc ovtucxnq|<TnuyXRveYFOegCpAs{YTe|>bE<OXsSqCBWD_SVepfvCCUg]z ZvQ[\0s|U>pFz\b=OwT``fNJJ:::::R[Q-PR_aVSVPNaR:::::")),n}()];function Mc(n,t){for(var e=0,r=t;e<r.length;e++){var i=r[e];if(i.getSubjectHex()===n)return i}}function T0(n,t){var e=n.getIssuerHex();if(e===n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=Mc(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:T0(r,t)}function P0(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:T0(n,I0)}function Ic(n){var t=new He;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=P0(t);return I0.push(t),e}function Tc(n,t,e){var r=new He;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),P0(r)===!1)return!1;var i=new Be;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,uo(t))}Ic(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVTU PPONrtNVONtVWNW=_SVw VE=ZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>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}WqwE=<PURZy@X8r\\]u=<pPNRNNn\\OtaO<ZOETPdPT`NTT8RVOQ^^`SuO`gdSp?cyVRg\bo?B=VR[OZO=TN>bqQt^dOO`Fy\x07WadZcAD peXybcW@}Qf\\QNsOt[cU`ZRTQNdtOaAFXw= PCVxsv?{`a\bvS8YQ[aN]Ot[cU_ZONsEROaNQN^U<ZNTN>bqQ^RNVOOwN[Otx\0uxvTF=ON^SNN\\PNtRNrx a[}tP_g8FbD\0^\0qt<f88ufuN]^}]gp\bqYudF88Fas_Ef` ?^x>X}esa{>\\r?eE]CC_cZ[vQs >gX[szONg=^pn=<e]nbSz\bZvac\b[w^nA_`vP|@8w[}nQobe=??oRYf{vpRxcC}yCd>8[NDx{Ne\\t8oou=guC\x07>>g\x07vb}ACd ``Ntq\0yC[Q{|ynpNQqSqzxF<_PFDw<]Bnnu>F<XgU_Zf\\\\A=gu\\codOwQ]oQ<f>gv_pwozwC}xX>C`c]suEdfW?cbeo\b`BbyR@eFTUwSud=t]sS\\onc XSq {\0\x07DvAVBbnTqEE[QzDyqF`bF}R=Q?VeDo<Vzb\0w}D}NZ\0t}^?OyFP\bVaVNrTNYqe?[NRYTSQby@yzWvT`wQo}y]c_WgxBYCy RNRg@\x07NZCaaq8?` ^`?ryD =obzw?E]Ou\x07]n@>bVzqAQT?@_zo@}CxWVTUsAYdNd?{APQr8{P]]AZ>aR\0[D<z?Tr@`u@X|YDwd_<p<>zWE>]\0=X`\b@uucp|^_Qb@uZouTX^o\0\\{PCq{ug\x078^f[YQAWad8FNqxFQE?ZOo }RnO\bsQc xyccn=nxvs>bDBf\b\bW\\TuTnvAO^U\0QXC>xx8FxRFf<tJ:::::R[Q-PR_aVSVPNaR:::::"));var Va=function(n,t){return Va=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},Va(n,t)};function se(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Va(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var k=function(){return k=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},k.apply(this,arguments)};function Mt(n,t,e,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(n,t,e,r);else for(var s=n.length-1;s>=0;s--)(o=n[s])&&(a=(i<3?o(a):i>3?o(t,e,a):o(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a}function It(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function Qi(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(c){try{u(r.next(c))}catch(f){o(f)}}function l(c){try{u(r.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((r=r.apply(n,t||[])).next())})}function Ui(n,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(e=0)),e;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1],a=u;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(u);break}a[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(n,e)}catch(c){u=[6,c],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Et(n,t,e){if(e||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return n.concat(a||Array.prototype.slice.call(t))}function Pc(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var qn=Pc("$$FIVE_EVENT$$");function di(n){return n[qn]||(n[qn]={}),n[qn]}function Bc(n){n[qn]&&delete n[qn]}var qi=function(){function n(){}return n.prototype.hasListener=function(t){var e=di(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,a=di(this);return a[t]||(a[t]={callbacks:[]}),a[t].callbacks.push([e,r||!1]),function(){return i.off(t,e)}},n.prototype.once=function(t,e){return this.on(t,e,!0)},n.prototype.off=function(t,e){if(t===void 0){Bc(this);return}var r=di(this);if(r[t]||(r[t]={callbacks:[]}),e===void 0){r[t].callbacks.length=0;return}for(var i=0;i<r[t].callbacks.length&&r[t].callbacks[i][0]!==e;i++);i<r[t].callbacks.length&&r[t].callbacks.splice(i,1)},n.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var i=!1,a=di(this);a[t]||(a[t]={callbacks:[]});for(var o=a[t].callbacks.slice(),s=0,l=o;s<l.length;s++){var u=l[s],c=u[0],f=u[1],m=f===void 0?!1:f,A=c.apply(void 0,e);m&&this.off(t,c),A===!1&&(i=!0)}return i},n.prototype.waitUntil=function(t,e){var r=this;return new Promise(function(i){var a=r.on(t,function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];(!e||e.apply(void 0,o)!==!1)&&(i(o),a())})})},n}();function Q(){}var Rc=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),he=typeof performance!="undefined"?function(){return Rc+performance.now()}:function(){return Date.now()};function wn(n){Object.freeze(n);var t=typeof n=="function",e=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(r){e.call(n,r)&&(!t||r!=="caller"&&r!=="callee"&&r!=="arguments")&&n[r]!==null&&(typeof n[r]=="object"||typeof n[r]=="function")&&!Object.isFrozen(n[r])&&wn(n[r])}),n}var Wo=/^([^.]+)(\.([^.]+))*$/;function Fc(n,t){if(n==="*")return!0;var e=n.split(".").reverse(),r=t.split(".").reverse();if(e.length<=1)return n===t;for(var i=0;i<e.length;i++)if(e[i]!==r[i])return!1;return!0}function cn(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function Kr(n,t){return Wo.test(n)&&Wo.test(t)&&Fc(n,t)}var kc=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],cr=wn(JSON.parse(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}("h/y|pnyu|/9/xr;p|z/9/yvn{wvn;p|z/9/rnyrr;p|z/9/rnyrr;p{/9/rnyrr;w}/9/uv;p|z/9/uv;p{/9/rnyrr;p{/9/rnyrr;p|z/9/ywpq{;p|z/9/rnyrr:pq{;p|z/9/rnyrr:pq{;p{/9/rnyrr;nv/9/;p{/9/pq{;p{/9/pnyp{|qr;vr/j"))),lo=function(n){se(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request proxy error(type: ".concat(r,", reason: ").concat(i,"): ").concat(e))||this}return t}(Error),Pi=function(n){se(t,n);function t(e,r,i){var a=n.call(this,"[NETWORK]: response error(type: ".concat(r,", status: ").concat(i,"): ").concat(e))||this;return a.httpStatus=i,a}return t}(Error);(function(n){se(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var Na=function(n){se(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request timeout(type: ".concat(r,", timeout: ").concat(i,"ms): ").concat(e))||this}return t}(Error),co=function(n){se(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request forbidden(type: ".concat(r,", reason: ").concat(i,"): ").concat(e))||this}return t}(Error);function Lc(n){if(!n)return{};for(var t={},e=n.trim().split(`
|
|
391
|
-
`),r=0;r<e.length;r++){var i=e[r],a=i.indexOf(":"),o=i.slice(0,a).trim().toLowerCase(),s=i.slice(a+1).trim();s&&(t[o]?t[o]+=", "+s:t[o]=s)}return t}function Da(n){for(var t=0,e=kc;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function Zo(n){return Da(n)!==null}function Yo(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function fo(n){if(/^blob\:/i.test(n))return"blob:";if(/^data\:/i.test(n))return"data:";var t=n.match(/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/i);return t?t[2]:location.hostname}var B0=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(qi);function Sn(n,t,e,r,i){t===void 0&&(t={}),e===void 0&&(e=Q),r===void 0&&(r=Q),i===void 0&&(i=Q);var a=he(),o=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(s){return/^https\:/.test(location.href)&&/^http\:/.test(s)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(s,"'. This request was automatically upgraded to HTTPS")),s.replace(/^http\:/,"https:")):s}).catch(function(s){var l,u=Da(n),c=u?"Script":"XMLHttpRequest",f=new lo(o,c,s&&s.message?String(s.message):String(s));return(l=t.networkSubscribe)===null||l===void 0||l.emit("network",n,c,"proxy-error",f.message),Promise.reject(f)}).then(function(s){return new Promise(function(l,u){var c,f=t.allowHosts?cr.concat(t.allowHosts):cr.slice(),m=fo(s),A=Da(s);if(location.hostname.length!==0&&!cn(location.hostname)&&cr.filter(function(O){return Kr(O,location.hostname)}).length===0&&!cn(m)&&f.filter(function(O){return Kr(O,m)}).length===0){var h=A?"Script":"XMLHttpRequest",p=new co(s,h,"request host(".concat(m,") is not allowed"));r(p),u(p),(c=t.networkSubscribe)===null||c===void 0||c.emit("network",s,h,"forbidden",p.message);return}if(A){var g=window,v=null,y=!1,b=document.createElement("script"),x=function(){var O;if(v=null,y!==!0){y=!0;var P=new Na(s,"Script",t.timeout||NaN);r(P),u(P),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"Script","timeout",P.message)}},w=function(O){var P,F,V=he(),D=V-a;if(delete g[A],b.parentNode&&b.parentNode.removeChild(b),v!==null&&(window.clearTimeout(v),v=null),y!==!0){if(O.indexOf("data:")!==0){var z=new Pi(s,"Script",500);r(z),u(z),(P=t.networkSubscribe)===null||P===void 0||P.emit("network",s,"Script","error",z.message);return}var U=O.split(","),q=(U[0].match(/:(.*?);/)||[])[1],K=U[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var j=atob(U[1]),J=j.length,X=new Uint8Array(J),Y=0;Y<J;Y++)X[Y]=j.charCodeAt(Y);t.responseType==="arraybuffer"?K=X.buffer:K=new Blob([X],{type:q})}var W={},ee={body:K,meta:{origin:o,source:s,requestTime:a,responseTime:V,costs:D,headers:W}};e(ee),l(ee),(F=t.networkSubscribe)===null||F===void 0||F.emit("network",s,"Script","ok",JSON.stringify(ee.meta)),y=!0}};g[A]=w,b.src=s,document.body.appendChild(b),typeof t.timeout=="number"&&(v=window.setTimeout(x,t.timeout))}else{var E=!1,C=new XMLHttpRequest,M=function(){C&&(C.removeEventListener("timeout",R,!1),C.removeEventListener("progress",L,!1),C.removeEventListener("load",S,!1),C.removeEventListener("error",I,!1)),C=null,M=Q},R=function(){var O;if(E!==!0){E=!0,M();var P=new Na(s,"XMLHttpRequest",t.timeout||NaN);r(P),u(P),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"XMLHttpRequest","timeout",P.message)}},L=function(O){E!==!0&&O.lengthComputable&&(O.total<=0||i(O.loaded/O.total))},S=function(O){var P;if(E!==!0){var F=this.status;if(F===0||F>=200&&F<400){E=!0,M();var V=he(),D=V-a,z=Lc(this.getAllResponseHeaders()),U=O.total,q={body:this.response,meta:{origin:o,source:s,requestTime:a,responseTime:V,costs:D,headers:z,size:U}};e(q),l(q),(P=t.networkSubscribe)===null||P===void 0||P.emit("network",s,"XMLHttpRequest","ok",JSON.stringify(q.meta))}else I.call(this)}},I=function(){var O;if(E!==!0){E=!0,M();var P=new Pi(s,"XMLHttpRequest",this.status);r(P),u(P),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"XMLHttpRequest","error",P.message)}};C.addEventListener("timeout",R,!1),C.addEventListener("progress",L,!1),C.addEventListener("load",S,!1),C.addEventListener("error",I,!1),t.responseType&&(C.responseType=t.responseType),typeof t.timeout=="number"&&(C.timeout=t.timeout),C.open("GET",s,!0),C.send(null)}})})}var $i={};function Oc(n,t){t===void 0&&(t={});var e=he(),r=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(i){return/^https\:/.test(location.href)&&/^http\:/.test(i)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(i,"'. This request was automatically upgraded to HTTPS")),i.replace(/^http\:/,"https:")):i}).catch(function(i){var a,o=new lo(r,"Link",i&&i.message?String(i.message):String(i));return(a=t.networkSubscribe)===null||a===void 0||a.emit("network",n,"Link","proxy-error",o.message),Promise.reject(o)}).then(function(i){return i in $i?$i[i]:$i[i]=new Promise(function(a,o){var s,l=t.allowHosts?cr.concat(t.allowHosts):cr.slice(),u=fo(i);if(location.hostname.length!==0&&!cn(location.hostname)&&cr.filter(function(p){return Kr(p,location.hostname)}).length===0&&!cn(u)&&l.filter(function(p){return Kr(p,u)}).length===0){var c=new co(i,"Link","request host(".concat(u,") is not allowed"));o(c),(s=t.networkSubscribe)===null||s===void 0||s.emit("network",i,"Link","forbidden",c.message);return}var f=document.createElement("link"),m=!1,A=null;f.onload=function(p){var g;if(A!==null&&(clearTimeout(A),A=null),m!==!0){m=!0,a();var v=he(),y=v-e,b={},x={origin:r,source:i,requestTime:e,responseTime:v,costs:y,headers:b};(g=t.networkSubscribe)===null||g===void 0||g.emit("network",i,"Link","preload",JSON.stringify(x))}},f.onerror=function(p){var g;if(A!==null&&(clearTimeout(A),A=null),m!==!0){m=!0;var v=new Pi(i,"Link",0);o(v),(g=t.networkSubscribe)===null||g===void 0||g.emit("network",i,"Link","error",v.message)}},typeof t.timeout=="number"&&(A=window.setTimeout(function(){var p;if(A=null,m!==!0){m=!0,a();var g=he(),v=g-e,y={},b={origin:r,source:i,requestTime:e,responseTime:g,costs:v,headers:y};(p=t.networkSubscribe)===null||p===void 0||p.emit("network",i,"Link","timeout",JSON.stringify(b))}},t.timeout)),f.rel=f.relList&&f.relList.supports("prefetch")?"prefetch":"preload",f.as="fetch",f.crossOrigin="",f.fetchPriority="high",f.href=i;var h=document.head||document.getElementsByTagName("head")[0];h&&h.appendChild(f)})})}function Vc(n,t,e,r,i,a){t===void 0&&(t={}),e===void 0&&(e=Q),r===void 0&&(r=Q),i===void 0&&(i=Q);var o=he(),s=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(l){return/^https\:/.test(location.href)&&/^http\:/.test(l)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(l,"'. This request was automatically upgraded to HTTPS")),l.replace(/^http\:/,"https:")):l}).catch(function(l){var u,c=new lo(s,"Image",l&&l.message?String(l.message):String(l));return(u=t.networkSubscribe)===null||u===void 0||u.emit("network",n,"Image","proxy-error",c.message),Promise.reject(c)}).then(function(l){return new Promise(function(u,c){var f,m=t.allowHosts?cr.concat(t.allowHosts):cr.slice(),A=fo(l);if(location.hostname.length!==0&&!cn(location.hostname)&&cr.filter(function(x){return Kr(x,location.hostname)}).length===0&&!cn(A)&&m.filter(function(x){return Kr(x,A)}).length===0){var h=new co(l,"Image","request host(".concat(A,") is not allowed"));r(h),c(h),(f=t.networkSubscribe)===null||f===void 0||f.emit("network",l,"Image","forbidden",h.message);return}var p=a!=null?a:new Image,g=!1,v=null,y=function(){var x;if(p.onload=Q,p.onerror=Q,v!==null&&(clearTimeout(v),v=null),g!==!0){var w=he(),E={headers:{},origin:s,source:l,requestTime:o,responseTime:w,costs:w-o};g=!0;var C={body:p,meta:E};i(1),e(C),u(C),(x=t.networkSubscribe)===null||x===void 0||x.emit("network",l,"Image","ok",JSON.stringify(C.meta))}},b=function(){var x;if(p.onload=Q,p.onerror=Q,v!==null&&(clearTimeout(v),v=null),g!==!0){g=!0;var w=new Pi(l,"Image",0);r(w),c(w),(x=t.networkSubscribe)===null||x===void 0||x.emit("network",l,"Image","ok",w.message)}};typeof t.timeout=="number"&&(v=window.setTimeout(function(){var x;if(p.onload=Q,p.onerror=Q,v=null,g!==!0){g=!0;var w=new Na(l,"Image",t.timeout);r(w),c(w),(x=t.networkSubscribe)===null||x===void 0||x.emit("network",l,"Image","timeout",w.message)}},t.timeout)),p.onload=y,p.onerror=b,i(0),p.src=l})})}var ho=function(){function n(t){t===void 0&&(t={}),this.options=Object.freeze(t),this.options.allowHosts&&Object.freeze(this.options.allowHosts)}return n.prototype.ajax=function(t,e,r,i,a){var o;e===void 0&&(e={}),r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var s=this.options,l={responseType:e.responseType,timeout:(o=e.timeout)!==null&&o!==void 0?o:s.timeout,get allowHosts(){var u;return(u=e.allowHosts)!==null&&u!==void 0?u:s.allowHosts},get requestProxy(){var u;return(u=e.requestProxy)!==null&&u!==void 0?u:s.requestProxy},get networkSubscribe(){var u;return(u=e.networkSubscribe)!==null&&u!==void 0?u:s.networkSubscribe}};return Sn(t,l,r,i,a)},n.prototype.loadImage=function(t,e,r,i,a,o){var s;e===void 0&&(e={}),r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var l=this.options,u={timeout:(s=e.timeout)!==null&&s!==void 0?s:l.timeout,get allowHosts(){var c;return(c=e.allowHosts)!==null&&c!==void 0?c:l.allowHosts},get requestProxy(){var c;return(c=e.requestProxy)!==null&&c!==void 0?c:l.requestProxy},get networkSubscribe(){var c;return(c=e.networkSubscribe)!==null&&c!==void 0?c:l.networkSubscribe}};return Vc(t,u,r,i,a,o)},n.prototype.preload=function(t,e){var r;e===void 0&&(e={});var i=this.options,a={timeout:(r=e.timeout)!==null&&r!==void 0?r:i.timeout,get allowHosts(){var o;return(o=e.allowHosts)!==null&&o!==void 0?o:i.allowHosts},get requestProxy(){var o;return(o=e.requestProxy)!==null&&o!==void 0?o:i.requestProxy},get networkSubscribe(){var o;return(o=e.networkSubscribe)!==null&&o!==void 0?o:i.networkSubscribe}};return Oc(t,a)},n}(),Bi=new ho;function fe(n,t,e){return n<t?t:n>e?e:n}var za=function(n){var t=he();return{requestAnimationFrame:function(e){var r=he(),i=fe(16+(r-t),16,33),a=n.setTimeout(function(){e(r+i)},i);return t=r+i,a},cancelAnimationFrame:function(e){return n.clearTimeout(e)}}}(window),$o=function(n){if(typeof n!="undefined"){if(n.requestAnimationFrame)return{requestAnimationFrame:n.requestAnimationFrame.bind(n),cancelAnimationFrame:n.cancelAnimationFrame.bind(n)};if(n.mozRequestAnimationFrame)return{requestAnimationFrame:n.mozRequestAnimationFrame.bind(n),cancelAnimationFrame:n.mozCancelAnimationFrame.bind(n)};if(n.webkitRequestAnimationFrame)return{requestAnimationFrame:n.webkitRequestAnimationFrame.bind(n),cancelAnimationFrame:n.webkitCancelAnimationFrame.bind(n)};if(n.msRequestAnimationFrame)return{requestAnimationFrame:n.msRequestAnimationFrame.bind(n),cancelAnimationFrame:n.msCancelAnimationFrame.bind(n)}}return za}(window),Nc=5,es=16,dt=function(){function n(){this.loopType="raf",this.frames=[],this.isAnimating=!1,this.context=null;var t=he();this.loop=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isAnimating!==!1){var i=he(),a=i-t;t=i,es=a;for(var o=0;o<this.frames.length;o++){var s=this.frames[o];if(s.delay>0){s.delay=s.delay-1;continue}try{s.callback.apply(s,Et([i,a],e,!1))}catch(l){console.error(l)}s.once&&(this.frames.splice(o,1),o--)}this.requestId=this.requestAnimationFrame(this.loop)}}.bind(this),this.start()}return Object.defineProperty(n,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new n),this.sharedInstance},enumerable:!1,configurable:!0}),n.getFrameTime=function(){return es},n.prototype.start=function(){this.isAnimating!==!0&&(this.isAnimating=!0,this.requestId=this.requestAnimationFrame(this.loop))},n.prototype.stop=function(){this.isAnimating=!1,this.cancelAnimationFrame(this.requestId)},n.prototype.setContext=function(t){t!==this.context&&(this.stop(),this.context=t,this.start())},n.prototype.getContext=function(){return this.context},n.prototype.setLoopType=function(t){t!==this.loopType&&(this.stop(),this.loopType=t,this.start())},n.prototype.getLoopType=function(){return this.loopType},n.prototype.requestAnimationFrame=function(t){if(this.context)return this.context.requestAnimationFrame(t);if(this.loopType==="raf")return $o.requestAnimationFrame(t);if(this.loopType==="sto")return za.requestAnimationFrame(t)},n.prototype.cancelAnimationFrame=function(t){if(this.context)this.context.cancelAnimationFrame(t);else if(this.loopType==="raf")$o.cancelAnimationFrame(t);else if(this.loopType==="sto")return za.cancelAnimationFrame(t)},n.prototype.remove=function(t){var e=this.frames.indexOf(t);e>=0&&this.frames.splice(e,1)},n.prototype.add=function(t,e,r,i){var a=this;e===void 0&&(e=!1),r===void 0&&(r=0),i===void 0&&(i=Nc);for(var o={callback:t,once:e,delay:r,order:i},s=this.frames.length;--s>=0;)if(this.frames[s].order<=i){this.frames.splice(s+1,0,o);break}return s<0&&this.frames.unshift(o),function(){return a.remove(o)}},n.prototype.clear=function(){this.frames.length=0},n}(),Dc={"vrlab-public.ljcdn.com":{type:"tencentCloud",pano:["vrlab-image1.ljcdn.com","vrlab-image2.ljcdn.com"],texture:["vrlab-image3.ljcdn.com"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vrlab-image4.ljcdn.com"]},"vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["vr-image-1.realsee-cdn.cn","vr-image-2.realsee-cdn.cn"],texture:["vr-image-3.realsee-cdn.cn"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vr-image-4.realsee-cdn.cn"]},"vr-public.rscdn.cn":{type:"tencentCloud",pano:["vr-image-1.rscdn.cn","vr-image-2.rscdn.cn"],texture:["vr-image-3.rscdn.cn"],tile:["vr-tile-1.rscdn.cn","vr-tile-2.rscdn.cn"],model:["vr-model-1.rscdn.cn","vr-model-2.rscdn.cn"],default:["vr-image-4.rscdn.cn"]},"mars-public.realsee-cdn.cn":{type:"aliyun",pano:["mars-image-1.realsee-cdn.cn","mars-image-2.realsee-cdn.cn"],texture:["mars-image-3.realsee-cdn.cn"],tile:["mars-tile-1.realsee-cdn.cn","mars-tile-2.realsee-cdn.cn"],model:["mars-model-1.realsee-cdn.cn","mars-model-2.realsee-cdn.cn"],default:["mars-image-4.realsee-cdn.cn"]},"global-public.realsee-cdn.com":{type:"tencentCloud",pano:["global-image-1.realsee-cdn.com","global-image-2.realsee-cdn.com"],texture:["global-image-3.realsee-cdn.com"],tile:["global-tile-1.realsee-cdn.com","global-tile-2.realsee-cdn.com"],model:["global-model-1.realsee-cdn.com","global-model-2.realsee-cdn.com"],default:["global-image-4.realsee-cdn.com"]},"earth-ga-public.realsee-cdn.cn":{type:"tencentCloud",pano:["earth-ga-image-1.realsee-cdn.cn","earth-ga-image-2.realsee-cdn.cn"],texture:["earth-ga-image-3.realsee-cdn.cn"],tile:["earth-ga-tile-1.realsee-cdn.cn","earth-ga-tile-2.realsee-cdn.cn"],model:["earth-ga-model-1.realsee-cdn.cn","earth-ga-model-2.realsee-cdn.cn"],default:["earth-ga-image-4.realsee-cdn.cn"]},"test-vr-public.realsee-cdn.com":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],texture:["test-vr-image.realsee-cdn.com"],tile:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],model:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],default:["test-vr-image.realsee-cdn.com"]},"test-vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],texture:["test-vr-image.realsee-cdn.cn"],tile:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],model:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],default:["test-vr-image.realsee-cdn.cn"]}},R0=/^https?\:\/\/?([^\/]+)/;function zc(n){var t=n.match(R0);return t===null?null:t[1]}function mn(n,t){return n.replace(R0,function(e,r){return e.slice(0,e.length-r.length)+t})}function Qc(n,t,e){var r=t.split("."),i=r[0],a=r.slice(1);if(i==="texture")return mn(n,e.texture[0]);if(i==="pano"||i==="pano_luminance"){a[0];var o=a[1];switch(o){case"front":case"left":case"up":return mn(n,e.pano[0]);case"down":case"right":case"back":return mn(n,e.pano[1])}}else if(i==="pano_tile"||i==="pano_tile_luminance"){a[0],a[1];var s=a[2],l=a[3],u=a[4],c=Math.pow(2,Number(s))*Number(l)+Number(u);if(!isNaN(c))return mn(n,e.tile[c%2])}else if(i==="model"){var f=a[0],c=Number(f);if(!isNaN(c))return mn(n,e.model[c%2])}return mn(n,e.default[0])}var Uc=function(n,t){var e,r=n.split("?")[0],i=r.split(".").pop();if(i==="jpeg"&&(i="jpg"),i!=="png"&&i!=="jpg")return n;var a="";if(t.format!==void 0&&t.format!==i&&(a+="/format/".concat(t.format)),t.cut!==void 0&&(a+="/cut/".concat(t.cut[2],"x").concat(t.cut[3],"x").concat(t.cut[0],"x").concat(t.cut[1])),t.quality!==void 0){var o=(e=t.format)!==null&&e!==void 0?e:i;o&&["jpg","webp","tpg","heif","avif"].indexOf(o)>=0&&(a+="/quality/".concat(t.quality))}if(t.size!==void 0){var s=n.match(/\/cube_(\d+)\//),l=s?Number(s[1]):NaN;l!==Number(t.size)&&(a+="/thumbnail/".concat(t.size,"x"))}return t.sharpen!==void 0&&(a+="/sharpen/".concat(t.sharpen)),a.length&&(a="?imageMogr2"+a),r+a},qc=function(n,t){var e,r=n.split("?")[0],i=r.split(".").pop();if(i==="jpeg"&&(i="jpg"),i!=="png"&&i!=="jpg")return n;var a="",o=[],s=t.format,l=t.quality,u=t.size;if(s!==void 0&&s!==i&&o.push("format,".concat(s==="heif"?"heic":s)),t.cut!==void 0){var c=t.cut,f=c[0],m=c[1],A=c[2],h=c[3];o.push("crop,x_".concat(f,",y_").concat(m,",w_").concat(A,",h_").concat(h,",g_nw"))}if(l!==void 0&&l!==100){var p=(e=t.format)!==null&&e!==void 0?e:i;p&&["jpg","webp"].indexOf(p)>=0&&o.push("quality,Q_".concat(l))}return u&&u!==2048&&o.push("resize,w_".concat(u)),t.sharpen!==void 0&&o.push("sharpen,".concat(t.sharpen)),o.length&&(a="?x-oss-process=image/"+o.join("/")),r+a},An=9007199254740991;function $r(n){var t=Math.round(n);return Math.abs(t-n)<.001?t:Math.floor(n)}function Hc(n){return n=Object.assign({},n),n.size!==void 0&&(n.size=$r(fe(n.size,0,An))),n.quality!==void 0&&(n.quality=$r(fe(n.quality,0,100))),n.cut!==void 0&&(n.cut=[$r(fe(n.cut[0],0,An)),$r(fe(n.cut[1],0,An)),$r(fe(n.cut[2],0,An)),$r(fe(n.cut[3],0,An))]),n.sharpen!==void 0&&(n.sharpen=$r(fe(n.sharpen,0,An))),n}function lt(n,t){var e=k(k({},Dc),t.mappings),r=zc(n);if(r===null)return n;t=Hc(t);var i=e[r];return i?(n=Qc(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?Uc(n,t):i.type==="aliyun"?qc(n,t):n):n}function sn(n,t,e){t===void 0&&(t=lt);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var F0=/\/cube_(\d+)\//;function Jn(n){var t=n.match(F0);return t?Number(t[1]):null}function Ot(n,t){return n.replace(F0,"/cube_".concat(t,"/"))}var Gc="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",Kc="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",jc="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function ea(n){return new Promise(function(t){var e=new Image,r=setTimeout(function(){e.onload=e.onerror=function(){},clearTimeout(r),t(!1)},100);e.onload=e.onerror=function(){e.onload=e.onerror=function(){},clearTimeout(r),t(e.height===2)},e.src=n})}var ta=null;function k0(){return ta||(ta=Promise.all([ea(Gc),ea(Kc),ea(jc)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var L0=/^(.*)\[(\d+)\]$/;function De(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function At(n){var t=n.match(L0);if(t){t[0];var e=t[1],r=t[2],i=Math.floor(Number(r));if(!isNaN(i)&&isFinite(i))return{workCode:e,panoIndex:i}}throw new Error("Invalid PanoId")}function Yt(n,t){return De(n)===De(t)}function O0(n){return typeof n=="string"&&L0.test(n)}var _c=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(d.Group),Tt=function(n){se(t,n);function t(e,r){return n.call(this,e,r)||this}return t.prototype.update=function(e,r,i,a){for(var o=0,s=this.material;o<s.length;o++){var l=s[o];l.update(e,r,i)}},t}(d.Mesh);function On(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=On(n[a],!1)+",";return i>-1&&(r+=On(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return On(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var l=o[a],u=On(n[l],!0);u!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+u),a++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function Hi(n){return"hash::".concat(On(n,!1))}var Jc=function(){function n(t){var e,r,i,a,o,s,l,u,c,f,m,A,h,p,g,v;this.uniforms=(e=t.uniforms)!==null&&e!==void 0?e:{},this.defines=(r=t.defines)!==null&&r!==void 0?r:{},this.type=t.type,this.vertex={mainBefore:(a=(i=t.vertex)===null||i===void 0?void 0:i.mainBefore)!==null&&a!==void 0?a:"",mainStart:(s=(o=t.vertex)===null||o===void 0?void 0:o.mainStart)!==null&&s!==void 0?s:"",mainEnd:(u=(l=t.vertex)===null||l===void 0?void 0:l.mainEnd)!==null&&u!==void 0?u:""},this.fragment={mainBefore:(f=(c=t.fragment)===null||c===void 0?void 0:c.mainBefore)!==null&&f!==void 0?f:"",mainStart:(A=(m=t.fragment)===null||m===void 0?void 0:m.mainStart)!==null&&A!==void 0?A:"",mainModelColor:(p=(h=t.fragment)===null||h===void 0?void 0:h.mainModelColor)!==null&&p!==void 0?p:"",mainEnd:(v=(g=t.fragment)===null||g===void 0?void 0:g.mainEnd)!==null&&v!==void 0?v:""}}return n.prototype.getHash=function(){return Hi({vertex:this.vertex,fragment:this.fragment,defines:this.defines})},n.prototype.onBeforeCompile=function(t,e){},n}(),Wn=function(){return typeof document!="undefined"?new d.TextureLoader().load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAABCAYAAACouxZ2AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAAQAAAAB7UD0+AAACA0lEQVRIDXWUW3YjIQxEwdnV/GT/q8kO3FO3pAJst3PSAaR6Cbszf//9XeMxxpjXmI+pVXudp2s6PC4dqHff9e6D7/PZLy46xQvG+sZvrfK8xgXUeq85yINe9bdmtOK1+kun5vjgq58a+eZPna9jvmjiserqG/+Whathvo3L3WhV89L9sXI/m18z2uene9ap/ftsuT9WZxoHXzW56/fpj8l7+tTw7P011NdpqnY19sRsfuHMA9u8oZWfDz4+fra/dfG1V60ydZ7qba1g7UNAeK0JP7ydD7/OqH6wO2f7HTq+B/lbL9qsB3/N1/UzR81XfPzw4tp5OPvRneacteq8Xo0xR3vuv/kPz0KtX0Nhg0eHuaNXdWI3X/ld427h++vzyp99V6VPrzWFhbv4ayay4oFecm198MmUXN/mL+x7npq/uJXBGb/MTw4+t+SvbLoTZnUW5uHhz7nWcTxT73OwXV7cxT9wbBf/0LnDBgcnHmtPLYba32Hp808sMy1u88yhr58n70/v4xX92GSN19l/2UsqGmiH94Hpxjcs+DO/ccpIVNVp62PUWXu//ur1GQy1Cf+GZ13rtNYN1po3/NI79fGXibHkq4z25xvV2pW3szpneXsW8SsreTe/NIPrtXMnH7wPf+LEN6tqhUVHj3XKD/72p9eafCeYB3zuonnbv7yqP8d/o4K6gRb1wbYAAAAASUVORK5CYII="):new d.Texture}();Wn.minFilter=d.NearestFilter;Wn.magFilter=d.NearestFilter;Wn.wrapS=d.RepeatWrapping;Wn.wrapT=d.RepeatWrapping;var Ae={customShaders:[],pano0:null,pano1:null,floorStyle:"OPACITY",shownFloorIndex:-1,modelAlpha:1,opacity:1,progress:0,transition:"FADE",clippers:null,brightness:1,constantColor:null,useEDL:!1,useHQWeight:!1,useHQDepth:!1,pointColor:"RGB",pointSize:"ATTENUATION",pointBack:"DARK",pointShape:"CIRCLE",pointScale:.03,pointMaxPixel:40,pointMinPixel:1,gradientTexture:Wn,colorSaturation:0,colorBrightness:0};function Xc(n,t){var e=n!=null?n:[],r=t!=null?t:[];if(r.length!==e.length)return!1;for(var i=0;i<r.length;i++)if(!e[i].clippingBoxMatrix.equals(r[i].clippingBoxMatrix)||e[i].floorIndex!==r[i].floorIndex)return!1;return!0}function Wc(n,t){return n&&t?n.luminanceMap===t.luminanceMap&&n.map===t.map&&n.zoom===t.zoom&&n.matrix.equals(t.matrix):!n&&!t}function V0(n,t){var e=!1;for(var r in t)switch(r){case"clippers":Xc(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":Wc(n[r],t[r])||(n[r]=t[r],e=!0);break;default:n[r]!==t[r]&&(n[r]=t[r],e=!0);break}return e}function bi(n,t,e){return n+(t-n)*e}function Zc(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),a=-(2*t*e+3*n)/Math.pow(e,2),o=t,s=n;return i*Math.pow(r,3)+a*Math.pow(r,2)+o*r+s}function Yc(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),a=-(2*t*e+3*n)/Math.pow(e,2),o=t;return 3*i*Math.pow(r,2)+2*a*r+o}function $c(n,t,e,r){var i=r[1]-r[0];return n=Ri(n,r),t=Ri(t,r),t-n>i/2?bi(n+i,t,e):n-t>i/2?bi(n-i,t,e):bi(n,t,e)}function Ri(n,t){var e=t[1]-t[0];return n<t[0]?Ri(n+e,t):n>=t[1]?Ri(n-e,t):n}function ed(n,t,e,r){return r?$c(n,t,e,r):bi(n,t,e)}function ts(n){var t=Number(n);return isNaN(t)||!isFinite(t)?0:t}var Ce=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=he(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var e in t){var r=t[e];typeof r=="object"?(this.value[e]=ts(r.value),this.config[e]={circle:r.circle}):(this.value[e]=ts(r),this.config[e]={circle:!1})}this.keyframes=[{progress:0,value:k({},this.value)},{progress:1,value:k({},this.value)}]}return n.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-Zc(1,this.startVelocity,this.duration,e)},n.prototype.getValue=function(t){for(var e=1;e<this.keyframes.length;e++)if(this.keyframes[e].progress>t){var r=this.keyframes[e-1],i=this.keyframes[e],a={};for(var o in this.config){var s=(t-r.progress)/(i.progress-r.progress);a[o]=ed(r.value[o],i.value[o],s,this.config[o].circle)}return a}return k({},this.keyframes[this.keyframes.length-1].value)},n.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:Yc(1,this.startVelocity,this.duration,e)},n.prototype.update=function(t){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(t))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},n.prototype.getKeyFrameSegment=function(t){for(var e=this.getProgress(t),r=1;r<this.keyframes.length;r++)if(this.keyframes[r].progress>e)return[this.keyframes[r-1],this.keyframes[r]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},n.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},n.prototype.set=function(t,e,r,i){var a;r===void 0&&(r=0),isNaN(e)&&(e=0),isNaN(r)&&(r=0),i=i!=null?i:he();var o=this.getProgress(i),s=this.getValue(o),l={};for(var u in this.config)l[u]=(a=t[u])!==null&&a!==void 0?a:s[u];var c=[{progress:0,value:s},{progress:1,value:l}];return this.setKeyframes(c,e,r,i)},n.prototype.setKeyframes=function(t,e,r,i){var a=this;if(r===void 0&&(r=0),t.length<2)throw new Error("keyframes invalid.");return isNaN(e)&&(e=0),isNaN(r)&&(r=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise(function(o,s){i=i!=null?i:he(),a.progress=0,a.ended=!1,a.startTime=i,a.startVelocity=r,a.keyframes=t,a.duration=e,e===0?(a.progress=1,a.value=k({},t[t.length-1].value)):a.value=k({},t[0].value),a.callbacks=[o,s]})},n.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},n}(),td=500;function rd(n){return-(Math.cos(Math.PI*n)-1)/2}var er=function(n){se(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.appearMotion=new Ce({appear:0}),i}return t.prototype.update=function(e,r,i,a){var o,s;if(this.material.update(e,r,i),a&&a.refine==="ADD"&&a.tileset.rootMeta.pntsOrder==="RANDOM"){var l=this.geometry,u=this.appearMotion,c=i.visible&&a.state.selectedFrameNumber===a.tileset.frameNumber,f=a.tileset.maxScreenSpaceError,m=a.state.screenSpaceError,A=(s=(o=a.parent)===null||o===void 0?void 0:o.state.screenSpaceError)!==null&&s!==void 0?s:m,h=1;if(a.levelOfContent>a.tileset.minLevelOfDetail&&A!==m&&(h=(A-f)/(A-m)),h=fe(h,0,1),h=rd(h),c){var p=1;u.getTargetKeyframe().value.appear!==p&&u.set({appear:p},td).catch(Q)}else{var p=0;u.getTargetKeyframe().value.appear!==p&&u.set({appear:p},0).catch(Q)}u.ended!==!0&&u.update(r.time);var g=l.index?l.index.count:l.attributes.position?l.attributes.position.count:1/0,v=Math.floor(g*h*u.value.appear);l.drawRange.count!==v&&(this.geometry.setDrawRange(0,v),i.needsRender=!0)}},t}(d.Points),gn=new Set,nd=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=k({},Ae),e}return t.prototype.getMaterial=function(){return k({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),gn.clear(),this.traverse(function(i){if(i instanceof Tt)for(var a=0,o=i.material;a<o.length;a++){var s=o[a];gn.has(s)||(Object.assign(s,r.materialParameters),gn.add(s))}i instanceof er&&(gn.has(i.material)||(Object.assign(i.material,r.materialParameters),gn.add(i.material)))}),gn.clear(),this.needsRender=!0},t}(d.Group),id=["right","left","up","down","front","back"];function N0(n,t,e,r){var i=new d.Box3;switch(n){case"up":i.min.y=.5,i.max.y=.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.z=-e+.5-r,i.max.z=-e+.5;break;case"down":i.min.y=-.5,i.max.y=-.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.z=+e-.5,i.max.z=+e-.5+r;break;case"left":i.min.x=-.5,i.max.x=-.5,i.min.z=-t+.5-r,i.max.z=-t+.5,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"right":i.min.x=.5,i.max.x=.5,i.min.z=+t-.5,i.max.z=+t-.5+r,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"front":i.min.z=-.5,i.max.z=-.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"back":i.min.z=.5,i.max.z=.5,i.min.x=-t+.5-r,i.max.x=-t+.5,i.min.y=-e+.5-r,i.max.y=-e+.5;break}return i.applyMatrix4(new d.Matrix4().makeRotationY(Math.PI))}var D0=function(n,t){if(!(n.level>=t))for(var e=n.level+1,r=n.size/2,i=[new d.Vector2(n.position.x,n.position.y),new d.Vector2(n.position.x+r,n.position.y),new d.Vector2(n.position.x,n.position.y+r),new d.Vector2(n.position.x+r,n.position.y+r)],a=0,o=i;a<o.length;a++){var s=o[a],l={face:n.face,level:e,size:r,position:s,box:N0(n.face,s.x,s.y,r),parent:n,children:[]};n.children.push(l),D0(l,t)}};function ad(n,t){var e={level:0,face:n,position:new d.Vector2(0,0),size:1,box:N0(n,0,0,1),parent:null,children:[]};return D0(e,t),e}function Qa(n){var t=id.map(function(e){return ad(e,n)});return{children:t}}function po(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],a=t(i);a!==!1&&po(i,t)}}var Zn=new d.BoxBufferGeometry(1,1,1,1,1);Zn.deleteAttribute("uv");Zn.deleteAttribute("normal");Zn.groups=[];Zn.scale(-1,1,1);var od=`
|
|
390
|
+
`,w},typeof n=="string"&&(n.indexOf("-----BEGIN")!=-1?this.readCertPEM(n):ne.lang.String.isHex(n)&&this.readCertHex(n))}He.hex2dn=function(n,t){t===void 0&&(t=0);var e=new He;ue.getTLV(n,t);var r=e.getX500Name(n);return r.str};He.hex2rdn=function(n,t){if(t===void 0&&(t=0),n.substr(t,2)!=="31")throw new Error("malformed RDN");for(var e=new Array,r=ue.getChildIdx(n,t),i=0;i<r.length;i++)e.push(He.hex2attrTypeValue(n,r[i]));return e=e.map(function(a){return a.replace("+","\\+")}),e.join("+")};He.hex2attrTypeValue=function(n,t){var e=ue,r=e.getV;if(t===void 0&&(t=0),n.substr(t,2)!=="30")throw new Error("malformed attribute type and value");var i=e.getChildIdx(n,t);i.length!==2||n.substr(i[0],2);var a=r(n,i[0]),o=ne.asn1.ASN1Util.oidHexToInt(a),s=ne.asn1.x509.OID.oid2atype(o),l=r(n,i[1]),u=Sr(l);return s+"="+u};He.getPublicKeyFromCertHex=function(n){var t=new He;return t.readCertHex(n),t.getPublicKey()};He.getPublicKeyFromCertPEM=function(n){var t=new He;return t.readCertPEM(n),t.getPublicKey()};He.getPublicKeyInfoPropOfCertPEM=function(n){var t=ue,e=t.getVbyList,r={},i,a;return r.algparam=null,i=new He,i.readCertPEM(n),a=i.getPublicKeyHex(),r.keyhex=e(a,0,[1],"03").substr(2),r.algoid=e(a,0,[0,0],"06"),r.algoid==="2a8648ce3d0201"&&(r.algparam=e(a,0,[0,1],"06")),r};He.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function Xo(n){return Ee.SHA256(n).toString()}var I0=[function(){var n=new He;return n.readCertPEM(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(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n,t){for(var e=0,r=t;e<r.length;e++){var i=r[e];if(i.getSubjectHex()===n)return i}}function T0(n,t){var e=n.getIssuerHex();if(e===n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=Cc(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:T0(r,t)}function P0(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:T0(n,I0)}function Ic(n){var t=new He;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=P0(t);return I0.push(t),e}function Tc(n,t,e){var r=new He;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),P0(r)===!1)return!1;var i=new Be;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,uo(t))}Ic(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVTU PPONrtNVONtVWNW=_SVw VE=ZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg R]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\bZQNAZaN\\aZ [QSnS=\b[aNBZQZ\\aZ [QSnZVTaZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg RbZOVTN>bRPtYoTyuoz}}f`Bwo?=\x07RQN\\Ot[cONZO>Wyfd\x07 gdb\x07RaN]Ot[cONZZPRuupz_@feWyZ`bVfWX|gVup[N^xOSugnec|fdy\x07ndB{^T\x07}fdB\0ndRf?FZVVPVwN[Otx\0uxvTF=ON^RSNN\\PNtENZVVPPtXPNtRN?=?]q[VD|{\\oyo`oOu}F SA\x07e`tn[t u\b8^a]qx\bE_^\x07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_Zf\\\\A=gu\\codOwQ]oQ<f>gv_pwozwC}xX>C`c]suEdfW?cbeo\b`BbyR@eFTUwSud=t]sS\\onc XSq {\0\x07DvAVBbnTqEE[QzDyqF`bF}R=Q?VeDo<Vzb\0w}D}NZ\0t}^?OyFP\bVaVNrTNYqe?[NRYTSQby@yzWvT`wQo}y]c_WgxBYCy RNRg@\x07NZCaaq8?` ^`?ryD =obzw?E]Ou\x07]n@>bVzqAQT?@_zo@}CxWVTUsAYdNd?{APQr8{P]]AZ>aR\0[D<z?Tr@`u@X|YDwd_<p<>zWE>]\0=X`\b@uucp|^_Qb@uZouTX^o\0\\{PCq{ug\x078^f[YQAWad8FNqxFQE?ZOo }RnO\bsQc xyccn=nxvs>bDBf\b\bW\\TuTnvAO^U\0QXC>xx8FxRFf<tJ:::::R[Q-PR_aVSVPNaR:::::"));var Va=function(n,t){return Va=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},Va(n,t)};function se(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Va(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var k=function(){return k=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},k.apply(this,arguments)};function Ct(n,t,e,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(n,t,e,r);else for(var s=n.length-1;s>=0;s--)(o=n[s])&&(a=(i<3?o(a):i>3?o(t,e,a):o(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a}function It(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function Qi(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(c){try{u(r.next(c))}catch(f){o(f)}}function l(c){try{u(r.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((r=r.apply(n,t||[])).next())})}function Ui(n,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(e=0)),e;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1],a=u;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(u);break}a[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(n,e)}catch(c){u=[6,c],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Et(n,t,e){if(e||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return n.concat(a||Array.prototype.slice.call(t))}function Pc(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var qn=Pc("$$FIVE_EVENT$$");function di(n){return n[qn]||(n[qn]={}),n[qn]}function Bc(n){n[qn]&&delete n[qn]}var qi=function(){function n(){}return n.prototype.hasListener=function(t){var e=di(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,a=di(this);return a[t]||(a[t]={callbacks:[]}),a[t].callbacks.push([e,r||!1]),function(){return i.off(t,e)}},n.prototype.once=function(t,e){return this.on(t,e,!0)},n.prototype.off=function(t,e){if(t===void 0){Bc(this);return}var r=di(this);if(r[t]||(r[t]={callbacks:[]}),e===void 0){r[t].callbacks.length=0;return}for(var i=0;i<r[t].callbacks.length&&r[t].callbacks[i][0]!==e;i++);i<r[t].callbacks.length&&r[t].callbacks.splice(i,1)},n.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var i=!1,a=di(this);a[t]||(a[t]={callbacks:[]});for(var o=a[t].callbacks.slice(),s=0,l=o;s<l.length;s++){var u=l[s],c=u[0],f=u[1],m=f===void 0?!1:f,A=c.apply(void 0,e);m&&this.off(t,c),A===!1&&(i=!0)}return i},n.prototype.waitUntil=function(t,e){var r=this;return new Promise(function(i){var a=r.on(t,function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];(!e||e.apply(void 0,o)!==!1)&&(i(o),a())})})},n}();function Q(){}var Rc=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),he=typeof performance!="undefined"?function(){return Rc+performance.now()}:function(){return Date.now()};function wn(n){Object.freeze(n);var t=typeof n=="function",e=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(r){e.call(n,r)&&(!t||r!=="caller"&&r!=="callee"&&r!=="arguments")&&n[r]!==null&&(typeof n[r]=="object"||typeof n[r]=="function")&&!Object.isFrozen(n[r])&&wn(n[r])}),n}var Wo=/^([^.]+)(\.([^.]+))*$/;function Fc(n,t){if(n==="*")return!0;var e=n.split(".").reverse(),r=t.split(".").reverse();if(e.length<=1)return n===t;for(var i=0;i<e.length;i++)if(e[i]!==r[i])return!1;return!0}function cn(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function Kr(n,t){return Wo.test(n)&&Wo.test(t)&&Fc(n,t)}var kc=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],cr=wn(JSON.parse(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}("h/y|pnyu|/9/xr;p|z/9/yvn{wvn;p|z/9/rnyrr;p|z/9/rnyrr;p{/9/rnyrr;w}/9/uv;p|z/9/uv;p{/9/rnyrr;p{/9/rnyrr;p|z/9/ywpq{;p|z/9/rnyrr:pq{;p|z/9/rnyrr:pq{;p{/9/rnyrr;nv/9/;p{/9/pq{;p{/9/pnyp{|qr;vr/j"))),lo=function(n){se(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request proxy error(type: ".concat(r,", reason: ").concat(i,"): ").concat(e))||this}return t}(Error),Pi=function(n){se(t,n);function t(e,r,i){var a=n.call(this,"[NETWORK]: response error(type: ".concat(r,", status: ").concat(i,"): ").concat(e))||this;return a.httpStatus=i,a}return t}(Error);(function(n){se(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var Na=function(n){se(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request timeout(type: ".concat(r,", timeout: ").concat(i,"ms): ").concat(e))||this}return t}(Error),co=function(n){se(t,n);function t(e,r,i){return n.call(this,"[NETWORK]: request forbidden(type: ".concat(r,", reason: ").concat(i,"): ").concat(e))||this}return t}(Error);function Lc(n){if(!n)return{};for(var t={},e=n.trim().split(`
|
|
391
|
+
`),r=0;r<e.length;r++){var i=e[r],a=i.indexOf(":"),o=i.slice(0,a).trim().toLowerCase(),s=i.slice(a+1).trim();s&&(t[o]?t[o]+=", "+s:t[o]=s)}return t}function Da(n){for(var t=0,e=kc;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function Zo(n){return Da(n)!==null}function Yo(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function fo(n){if(/^blob\:/i.test(n))return"blob:";if(/^data\:/i.test(n))return"data:";var t=n.match(/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/i);return t?t[2]:location.hostname}var B0=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(qi);function Sn(n,t,e,r,i){t===void 0&&(t={}),e===void 0&&(e=Q),r===void 0&&(r=Q),i===void 0&&(i=Q);var a=he(),o=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(s){return/^https\:/.test(location.href)&&/^http\:/.test(s)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(s,"'. This request was automatically upgraded to HTTPS")),s.replace(/^http\:/,"https:")):s}).catch(function(s){var l,u=Da(n),c=u?"Script":"XMLHttpRequest",f=new lo(o,c,s&&s.message?String(s.message):String(s));return(l=t.networkSubscribe)===null||l===void 0||l.emit("network",n,c,"proxy-error",f.message),Promise.reject(f)}).then(function(s){return new Promise(function(l,u){var c,f=t.allowHosts?cr.concat(t.allowHosts):cr.slice(),m=fo(s),A=Da(s);if(location.hostname.length!==0&&!cn(location.hostname)&&cr.filter(function(O){return Kr(O,location.hostname)}).length===0&&!cn(m)&&f.filter(function(O){return Kr(O,m)}).length===0){var h=A?"Script":"XMLHttpRequest",p=new co(s,h,"request host(".concat(m,") is not allowed"));r(p),u(p),(c=t.networkSubscribe)===null||c===void 0||c.emit("network",s,h,"forbidden",p.message);return}if(A){var g=window,v=null,y=!1,b=document.createElement("script"),x=function(){var O;if(v=null,y!==!0){y=!0;var P=new Na(s,"Script",t.timeout||NaN);r(P),u(P),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"Script","timeout",P.message)}},w=function(O){var P,F,V=he(),D=V-a;if(delete g[A],b.parentNode&&b.parentNode.removeChild(b),v!==null&&(window.clearTimeout(v),v=null),y!==!0){if(O.indexOf("data:")!==0){var z=new Pi(s,"Script",500);r(z),u(z),(P=t.networkSubscribe)===null||P===void 0||P.emit("network",s,"Script","error",z.message);return}var U=O.split(","),q=(U[0].match(/:(.*?);/)||[])[1],K=U[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var j=atob(U[1]),J=j.length,X=new Uint8Array(J),Y=0;Y<J;Y++)X[Y]=j.charCodeAt(Y);t.responseType==="arraybuffer"?K=X.buffer:K=new Blob([X],{type:q})}var W={},ee={body:K,meta:{origin:o,source:s,requestTime:a,responseTime:V,costs:D,headers:W}};e(ee),l(ee),(F=t.networkSubscribe)===null||F===void 0||F.emit("network",s,"Script","ok",JSON.stringify(ee.meta)),y=!0}};g[A]=w,b.src=s,document.body.appendChild(b),typeof t.timeout=="number"&&(v=window.setTimeout(x,t.timeout))}else{var E=!1,M=new XMLHttpRequest,C=function(){M&&(M.removeEventListener("timeout",R,!1),M.removeEventListener("progress",L,!1),M.removeEventListener("load",S,!1),M.removeEventListener("error",I,!1)),M=null,C=Q},R=function(){var O;if(E!==!0){E=!0,C();var P=new Na(s,"XMLHttpRequest",t.timeout||NaN);r(P),u(P),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"XMLHttpRequest","timeout",P.message)}},L=function(O){E!==!0&&O.lengthComputable&&(O.total<=0||i(O.loaded/O.total))},S=function(O){var P;if(E!==!0){var F=this.status;if(F===0||F>=200&&F<400){E=!0,C();var V=he(),D=V-a,z=Lc(this.getAllResponseHeaders()),U=O.total,q={body:this.response,meta:{origin:o,source:s,requestTime:a,responseTime:V,costs:D,headers:z,size:U}};e(q),l(q),(P=t.networkSubscribe)===null||P===void 0||P.emit("network",s,"XMLHttpRequest","ok",JSON.stringify(q.meta))}else I.call(this)}},I=function(){var O;if(E!==!0){E=!0,C();var P=new Pi(s,"XMLHttpRequest",this.status);r(P),u(P),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"XMLHttpRequest","error",P.message)}};M.addEventListener("timeout",R,!1),M.addEventListener("progress",L,!1),M.addEventListener("load",S,!1),M.addEventListener("error",I,!1),t.responseType&&(M.responseType=t.responseType),typeof t.timeout=="number"&&(M.timeout=t.timeout),M.open("GET",s,!0),M.send(null)}})})}var $i={};function Oc(n,t){t===void 0&&(t={});var e=he(),r=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(i){return/^https\:/.test(location.href)&&/^http\:/.test(i)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(i,"'. This request was automatically upgraded to HTTPS")),i.replace(/^http\:/,"https:")):i}).catch(function(i){var a,o=new lo(r,"Link",i&&i.message?String(i.message):String(i));return(a=t.networkSubscribe)===null||a===void 0||a.emit("network",n,"Link","proxy-error",o.message),Promise.reject(o)}).then(function(i){return i in $i?$i[i]:$i[i]=new Promise(function(a,o){var s,l=t.allowHosts?cr.concat(t.allowHosts):cr.slice(),u=fo(i);if(location.hostname.length!==0&&!cn(location.hostname)&&cr.filter(function(p){return Kr(p,location.hostname)}).length===0&&!cn(u)&&l.filter(function(p){return Kr(p,u)}).length===0){var c=new co(i,"Link","request host(".concat(u,") is not allowed"));o(c),(s=t.networkSubscribe)===null||s===void 0||s.emit("network",i,"Link","forbidden",c.message);return}var f=document.createElement("link"),m=!1,A=null;f.onload=function(p){var g;if(A!==null&&(clearTimeout(A),A=null),m!==!0){m=!0,a();var v=he(),y=v-e,b={},x={origin:r,source:i,requestTime:e,responseTime:v,costs:y,headers:b};(g=t.networkSubscribe)===null||g===void 0||g.emit("network",i,"Link","preload",JSON.stringify(x))}},f.onerror=function(p){var g;if(A!==null&&(clearTimeout(A),A=null),m!==!0){m=!0;var v=new Pi(i,"Link",0);o(v),(g=t.networkSubscribe)===null||g===void 0||g.emit("network",i,"Link","error",v.message)}},typeof t.timeout=="number"&&(A=window.setTimeout(function(){var p;if(A=null,m!==!0){m=!0,a();var g=he(),v=g-e,y={},b={origin:r,source:i,requestTime:e,responseTime:g,costs:v,headers:y};(p=t.networkSubscribe)===null||p===void 0||p.emit("network",i,"Link","timeout",JSON.stringify(b))}},t.timeout)),f.rel=f.relList&&f.relList.supports("prefetch")?"prefetch":"preload",f.as="fetch",f.crossOrigin="",f.fetchPriority="high",f.href=i;var h=document.head||document.getElementsByTagName("head")[0];h&&h.appendChild(f)})})}function Vc(n,t,e,r,i,a){t===void 0&&(t={}),e===void 0&&(e=Q),r===void 0&&(r=Q),i===void 0&&(i=Q);var o=he(),s=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(l){return/^https\:/.test(location.href)&&/^http\:/.test(l)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(l,"'. This request was automatically upgraded to HTTPS")),l.replace(/^http\:/,"https:")):l}).catch(function(l){var u,c=new lo(s,"Image",l&&l.message?String(l.message):String(l));return(u=t.networkSubscribe)===null||u===void 0||u.emit("network",n,"Image","proxy-error",c.message),Promise.reject(c)}).then(function(l){return new Promise(function(u,c){var f,m=t.allowHosts?cr.concat(t.allowHosts):cr.slice(),A=fo(l);if(location.hostname.length!==0&&!cn(location.hostname)&&cr.filter(function(x){return Kr(x,location.hostname)}).length===0&&!cn(A)&&m.filter(function(x){return Kr(x,A)}).length===0){var h=new co(l,"Image","request host(".concat(A,") is not allowed"));r(h),c(h),(f=t.networkSubscribe)===null||f===void 0||f.emit("network",l,"Image","forbidden",h.message);return}var p=a!=null?a:new Image,g=!1,v=null,y=function(){var x;if(p.onload=Q,p.onerror=Q,v!==null&&(clearTimeout(v),v=null),g!==!0){var w=he(),E={headers:{},origin:s,source:l,requestTime:o,responseTime:w,costs:w-o};g=!0;var M={body:p,meta:E};i(1),e(M),u(M),(x=t.networkSubscribe)===null||x===void 0||x.emit("network",l,"Image","ok",JSON.stringify(M.meta))}},b=function(){var x;if(p.onload=Q,p.onerror=Q,v!==null&&(clearTimeout(v),v=null),g!==!0){g=!0;var w=new Pi(l,"Image",0);r(w),c(w),(x=t.networkSubscribe)===null||x===void 0||x.emit("network",l,"Image","ok",w.message)}};typeof t.timeout=="number"&&(v=window.setTimeout(function(){var x;if(p.onload=Q,p.onerror=Q,v=null,g!==!0){g=!0;var w=new Na(l,"Image",t.timeout);r(w),c(w),(x=t.networkSubscribe)===null||x===void 0||x.emit("network",l,"Image","timeout",w.message)}},t.timeout)),p.onload=y,p.onerror=b,i(0),p.src=l})})}var ho=function(){function n(t){t===void 0&&(t={}),this.options=Object.freeze(t),this.options.allowHosts&&Object.freeze(this.options.allowHosts)}return n.prototype.ajax=function(t,e,r,i,a){var o;e===void 0&&(e={}),r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var s=this.options,l={responseType:e.responseType,timeout:(o=e.timeout)!==null&&o!==void 0?o:s.timeout,get allowHosts(){var u;return(u=e.allowHosts)!==null&&u!==void 0?u:s.allowHosts},get requestProxy(){var u;return(u=e.requestProxy)!==null&&u!==void 0?u:s.requestProxy},get networkSubscribe(){var u;return(u=e.networkSubscribe)!==null&&u!==void 0?u:s.networkSubscribe}};return Sn(t,l,r,i,a)},n.prototype.loadImage=function(t,e,r,i,a,o){var s;e===void 0&&(e={}),r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var l=this.options,u={timeout:(s=e.timeout)!==null&&s!==void 0?s:l.timeout,get allowHosts(){var c;return(c=e.allowHosts)!==null&&c!==void 0?c:l.allowHosts},get requestProxy(){var c;return(c=e.requestProxy)!==null&&c!==void 0?c:l.requestProxy},get networkSubscribe(){var c;return(c=e.networkSubscribe)!==null&&c!==void 0?c:l.networkSubscribe}};return Vc(t,u,r,i,a,o)},n.prototype.preload=function(t,e){var r;e===void 0&&(e={});var i=this.options,a={timeout:(r=e.timeout)!==null&&r!==void 0?r:i.timeout,get allowHosts(){var o;return(o=e.allowHosts)!==null&&o!==void 0?o:i.allowHosts},get requestProxy(){var o;return(o=e.requestProxy)!==null&&o!==void 0?o:i.requestProxy},get networkSubscribe(){var o;return(o=e.networkSubscribe)!==null&&o!==void 0?o:i.networkSubscribe}};return Oc(t,a)},n}(),Bi=new ho;function fe(n,t,e){return n<t?t:n>e?e:n}var za=function(n){var t=he();return{requestAnimationFrame:function(e){var r=he(),i=fe(16+(r-t),16,33),a=n.setTimeout(function(){e(r+i)},i);return t=r+i,a},cancelAnimationFrame:function(e){return n.clearTimeout(e)}}}(window),$o=function(n){if(typeof n!="undefined"){if(n.requestAnimationFrame)return{requestAnimationFrame:n.requestAnimationFrame.bind(n),cancelAnimationFrame:n.cancelAnimationFrame.bind(n)};if(n.mozRequestAnimationFrame)return{requestAnimationFrame:n.mozRequestAnimationFrame.bind(n),cancelAnimationFrame:n.mozCancelAnimationFrame.bind(n)};if(n.webkitRequestAnimationFrame)return{requestAnimationFrame:n.webkitRequestAnimationFrame.bind(n),cancelAnimationFrame:n.webkitCancelAnimationFrame.bind(n)};if(n.msRequestAnimationFrame)return{requestAnimationFrame:n.msRequestAnimationFrame.bind(n),cancelAnimationFrame:n.msCancelAnimationFrame.bind(n)}}return za}(window),Nc=5,es=16,dt=function(){function n(){this.loopType="raf",this.frames=[],this.isAnimating=!1,this.context=null;var t=he();this.loop=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isAnimating!==!1){var i=he(),a=i-t;t=i,es=a;for(var o=0;o<this.frames.length;o++){var s=this.frames[o];if(s.delay>0){s.delay=s.delay-1;continue}try{s.callback.apply(s,Et([i,a],e,!1))}catch(l){console.error(l)}s.once&&(this.frames.splice(o,1),o--)}this.requestId=this.requestAnimationFrame(this.loop)}}.bind(this),this.start()}return Object.defineProperty(n,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new n),this.sharedInstance},enumerable:!1,configurable:!0}),n.getFrameTime=function(){return es},n.prototype.start=function(){this.isAnimating!==!0&&(this.isAnimating=!0,this.requestId=this.requestAnimationFrame(this.loop))},n.prototype.stop=function(){this.isAnimating=!1,this.cancelAnimationFrame(this.requestId)},n.prototype.setContext=function(t){t!==this.context&&(this.stop(),this.context=t,this.start())},n.prototype.getContext=function(){return this.context},n.prototype.setLoopType=function(t){t!==this.loopType&&(this.stop(),this.loopType=t,this.start())},n.prototype.getLoopType=function(){return this.loopType},n.prototype.requestAnimationFrame=function(t){if(this.context)return this.context.requestAnimationFrame(t);if(this.loopType==="raf")return $o.requestAnimationFrame(t);if(this.loopType==="sto")return za.requestAnimationFrame(t)},n.prototype.cancelAnimationFrame=function(t){if(this.context)this.context.cancelAnimationFrame(t);else if(this.loopType==="raf")$o.cancelAnimationFrame(t);else if(this.loopType==="sto")return za.cancelAnimationFrame(t)},n.prototype.remove=function(t){var e=this.frames.indexOf(t);e>=0&&this.frames.splice(e,1)},n.prototype.add=function(t,e,r,i){var a=this;e===void 0&&(e=!1),r===void 0&&(r=0),i===void 0&&(i=Nc);for(var o={callback:t,once:e,delay:r,order:i},s=this.frames.length;--s>=0;)if(this.frames[s].order<=i){this.frames.splice(s+1,0,o);break}return s<0&&this.frames.unshift(o),function(){return a.remove(o)}},n.prototype.clear=function(){this.frames.length=0},n}(),Dc={"vrlab-public.ljcdn.com":{type:"tencentCloud",pano:["vrlab-image1.ljcdn.com","vrlab-image2.ljcdn.com"],texture:["vrlab-image3.ljcdn.com"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vrlab-image4.ljcdn.com"]},"vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["vr-image-1.realsee-cdn.cn","vr-image-2.realsee-cdn.cn"],texture:["vr-image-3.realsee-cdn.cn"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vr-image-4.realsee-cdn.cn"]},"vr-public.rscdn.cn":{type:"tencentCloud",pano:["vr-image-1.rscdn.cn","vr-image-2.rscdn.cn"],texture:["vr-image-3.rscdn.cn"],tile:["vr-tile-1.rscdn.cn","vr-tile-2.rscdn.cn"],model:["vr-model-1.rscdn.cn","vr-model-2.rscdn.cn"],default:["vr-image-4.rscdn.cn"]},"mars-public.realsee-cdn.cn":{type:"aliyun",pano:["mars-image-1.realsee-cdn.cn","mars-image-2.realsee-cdn.cn"],texture:["mars-image-3.realsee-cdn.cn"],tile:["mars-tile-1.realsee-cdn.cn","mars-tile-2.realsee-cdn.cn"],model:["mars-model-1.realsee-cdn.cn","mars-model-2.realsee-cdn.cn"],default:["mars-image-4.realsee-cdn.cn"]},"global-public.realsee-cdn.com":{type:"tencentCloud",pano:["global-image-1.realsee-cdn.com","global-image-2.realsee-cdn.com"],texture:["global-image-3.realsee-cdn.com"],tile:["global-tile-1.realsee-cdn.com","global-tile-2.realsee-cdn.com"],model:["global-model-1.realsee-cdn.com","global-model-2.realsee-cdn.com"],default:["global-image-4.realsee-cdn.com"]},"earth-ga-public.realsee-cdn.cn":{type:"tencentCloud",pano:["earth-ga-image-1.realsee-cdn.cn","earth-ga-image-2.realsee-cdn.cn"],texture:["earth-ga-image-3.realsee-cdn.cn"],tile:["earth-ga-tile-1.realsee-cdn.cn","earth-ga-tile-2.realsee-cdn.cn"],model:["earth-ga-model-1.realsee-cdn.cn","earth-ga-model-2.realsee-cdn.cn"],default:["earth-ga-image-4.realsee-cdn.cn"]},"test-vr-public.realsee-cdn.com":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],texture:["test-vr-image.realsee-cdn.com"],tile:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],model:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],default:["test-vr-image.realsee-cdn.com"]},"test-vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],texture:["test-vr-image.realsee-cdn.cn"],tile:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],model:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],default:["test-vr-image.realsee-cdn.cn"]}},R0=/^https?\:\/\/?([^\/]+)/;function zc(n){var t=n.match(R0);return t===null?null:t[1]}function mn(n,t){return n.replace(R0,function(e,r){return e.slice(0,e.length-r.length)+t})}function Qc(n,t,e){var r=t.split("."),i=r[0],a=r.slice(1);if(i==="texture")return mn(n,e.texture[0]);if(i==="pano"||i==="pano_luminance"){a[0];var o=a[1];switch(o){case"front":case"left":case"up":return mn(n,e.pano[0]);case"down":case"right":case"back":return mn(n,e.pano[1])}}else if(i==="pano_tile"||i==="pano_tile_luminance"){a[0],a[1];var s=a[2],l=a[3],u=a[4],c=Math.pow(2,Number(s))*Number(l)+Number(u);if(!isNaN(c))return mn(n,e.tile[c%2])}else if(i==="model"){var f=a[0],c=Number(f);if(!isNaN(c))return mn(n,e.model[c%2])}return mn(n,e.default[0])}var Uc=function(n,t){var e,r=n.split("?")[0],i=r.split(".").pop();if(i==="jpeg"&&(i="jpg"),i!=="png"&&i!=="jpg")return n;var a="";if(t.format!==void 0&&t.format!==i&&(a+="/format/".concat(t.format)),t.cut!==void 0&&(a+="/cut/".concat(t.cut[2],"x").concat(t.cut[3],"x").concat(t.cut[0],"x").concat(t.cut[1])),t.quality!==void 0){var o=(e=t.format)!==null&&e!==void 0?e:i;o&&["jpg","webp","tpg","heif","avif"].indexOf(o)>=0&&(a+="/quality/".concat(t.quality))}if(t.size!==void 0){var s=n.match(/\/cube_(\d+)\//),l=s?Number(s[1]):NaN;l!==Number(t.size)&&(a+="/thumbnail/".concat(t.size,"x"))}return t.sharpen!==void 0&&(a+="/sharpen/".concat(t.sharpen)),a.length&&(a="?imageMogr2"+a),r+a},qc=function(n,t){var e,r=n.split("?")[0],i=r.split(".").pop();if(i==="jpeg"&&(i="jpg"),i!=="png"&&i!=="jpg")return n;var a="",o=[],s=t.format,l=t.quality,u=t.size;if(s!==void 0&&s!==i&&o.push("format,".concat(s==="heif"?"heic":s)),t.cut!==void 0){var c=t.cut,f=c[0],m=c[1],A=c[2],h=c[3];o.push("crop,x_".concat(f,",y_").concat(m,",w_").concat(A,",h_").concat(h,",g_nw"))}if(l!==void 0&&l!==100){var p=(e=t.format)!==null&&e!==void 0?e:i;p&&["jpg","webp"].indexOf(p)>=0&&o.push("quality,Q_".concat(l))}return u&&u!==2048&&o.push("resize,w_".concat(u)),t.sharpen!==void 0&&o.push("sharpen,".concat(t.sharpen)),o.length&&(a="?x-oss-process=image/"+o.join("/")),r+a},An=9007199254740991;function $r(n){var t=Math.round(n);return Math.abs(t-n)<.001?t:Math.floor(n)}function Hc(n){return n=Object.assign({},n),n.size!==void 0&&(n.size=$r(fe(n.size,0,An))),n.quality!==void 0&&(n.quality=$r(fe(n.quality,0,100))),n.cut!==void 0&&(n.cut=[$r(fe(n.cut[0],0,An)),$r(fe(n.cut[1],0,An)),$r(fe(n.cut[2],0,An)),$r(fe(n.cut[3],0,An))]),n.sharpen!==void 0&&(n.sharpen=$r(fe(n.sharpen,0,An))),n}function lt(n,t){var e=k(k({},Dc),t.mappings),r=zc(n);if(r===null)return n;t=Hc(t);var i=e[r];return i?(n=Qc(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?Uc(n,t):i.type==="aliyun"?qc(n,t):n):n}function sn(n,t,e){t===void 0&&(t=lt);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var F0=/\/cube_(\d+)\//;function Jn(n){var t=n.match(F0);return t?Number(t[1]):null}function Ot(n,t){return n.replace(F0,"/cube_".concat(t,"/"))}var Gc="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",Kc="data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AAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function ea(n){return new Promise(function(t){var e=new Image,r=setTimeout(function(){e.onload=e.onerror=function(){},clearTimeout(r),t(!1)},100);e.onload=e.onerror=function(){e.onload=e.onerror=function(){},clearTimeout(r),t(e.height===2)},e.src=n})}var ta=null;function k0(){return ta||(ta=Promise.all([ea(Gc),ea(Kc),ea(jc)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var L0=/^(.*)\[(\d+)\]$/;function De(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function At(n){var t=n.match(L0);if(t){t[0];var e=t[1],r=t[2],i=Math.floor(Number(r));if(!isNaN(i)&&isFinite(i))return{workCode:e,panoIndex:i}}throw new Error("Invalid PanoId")}function Yt(n,t){return De(n)===De(t)}function O0(n){return typeof n=="string"&&L0.test(n)}var _c=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(d.Group),Tt=function(n){se(t,n);function t(e,r){return n.call(this,e,r)||this}return t.prototype.update=function(e,r,i,a){for(var o=0,s=this.material;o<s.length;o++){var l=s[o];l.update(e,r,i)}},t}(d.Mesh);function On(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=On(n[a],!1)+",";return i>-1&&(r+=On(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return On(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var l=o[a],u=On(n[l],!0);u!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+u),a++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function Hi(n){return"hash::".concat(On(n,!1))}var Jc=function(){function n(t){var e,r,i,a,o,s,l,u,c,f,m,A,h,p,g,v;this.uniforms=(e=t.uniforms)!==null&&e!==void 0?e:{},this.defines=(r=t.defines)!==null&&r!==void 0?r:{},this.type=t.type,this.vertex={mainBefore:(a=(i=t.vertex)===null||i===void 0?void 0:i.mainBefore)!==null&&a!==void 0?a:"",mainStart:(s=(o=t.vertex)===null||o===void 0?void 0:o.mainStart)!==null&&s!==void 0?s:"",mainEnd:(u=(l=t.vertex)===null||l===void 0?void 0:l.mainEnd)!==null&&u!==void 0?u:""},this.fragment={mainBefore:(f=(c=t.fragment)===null||c===void 0?void 0:c.mainBefore)!==null&&f!==void 0?f:"",mainStart:(A=(m=t.fragment)===null||m===void 0?void 0:m.mainStart)!==null&&A!==void 0?A:"",mainModelColor:(p=(h=t.fragment)===null||h===void 0?void 0:h.mainModelColor)!==null&&p!==void 0?p:"",mainEnd:(v=(g=t.fragment)===null||g===void 0?void 0:g.mainEnd)!==null&&v!==void 0?v:""}}return n.prototype.getHash=function(){return Hi({vertex:this.vertex,fragment:this.fragment,defines:this.defines})},n.prototype.onBeforeCompile=function(t,e){},n}(),Wn=function(){return typeof document!="undefined"?new d.TextureLoader().load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAABCAYAAACouxZ2AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAAQAAAAB7UD0+AAACA0lEQVRIDXWUW3YjIQxEwdnV/GT/q8kO3FO3pAJst3PSAaR6Cbszf//9XeMxxpjXmI+pVXudp2s6PC4dqHff9e6D7/PZLy46xQvG+sZvrfK8xgXUeq85yINe9bdmtOK1+kun5vjgq58a+eZPna9jvmjiserqG/+Whathvo3L3WhV89L9sXI/m18z2uene9ap/ftsuT9WZxoHXzW56/fpj8l7+tTw7P011NdpqnY19sRsfuHMA9u8oZWfDz4+fra/dfG1V60ydZ7qba1g7UNAeK0JP7ydD7/OqH6wO2f7HTq+B/lbL9qsB3/N1/UzR81XfPzw4tp5OPvRneacteq8Xo0xR3vuv/kPz0KtX0Nhg0eHuaNXdWI3X/ld427h++vzyp99V6VPrzWFhbv4ayay4oFecm198MmUXN/mL+x7npq/uJXBGb/MTw4+t+SvbLoTZnUW5uHhz7nWcTxT73OwXV7cxT9wbBf/0LnDBgcnHmtPLYba32Hp808sMy1u88yhr58n70/v4xX92GSN19l/2UsqGmiH94Hpxjcs+DO/ccpIVNVp62PUWXu//ur1GQy1Cf+GZ13rtNYN1po3/NI79fGXibHkq4z25xvV2pW3szpneXsW8SsreTe/NIPrtXMnH7wPf+LEN6tqhUVHj3XKD/72p9eafCeYB3zuonnbv7yqP8d/o4K6gRb1wbYAAAAASUVORK5CYII="):new d.Texture}();Wn.minFilter=d.NearestFilter;Wn.magFilter=d.NearestFilter;Wn.wrapS=d.RepeatWrapping;Wn.wrapT=d.RepeatWrapping;var Ae={customShaders:[],pano0:null,pano1:null,floorStyle:"OPACITY",shownFloorIndex:-1,modelAlpha:1,opacity:1,progress:0,transition:"FADE",clippers:null,brightness:1,constantColor:null,useEDL:!1,useHQWeight:!1,useHQDepth:!1,pointColor:"RGB",pointSize:"ATTENUATION",pointBack:"DARK",pointShape:"CIRCLE",pointScale:.03,pointMaxPixel:40,pointMinPixel:1,gradientTexture:Wn,colorSaturation:0,colorBrightness:0};function Xc(n,t){var e=n!=null?n:[],r=t!=null?t:[];if(r.length!==e.length)return!1;for(var i=0;i<r.length;i++)if(!e[i].clippingBoxMatrix.equals(r[i].clippingBoxMatrix)||e[i].floorIndex!==r[i].floorIndex)return!1;return!0}function Wc(n,t){return n&&t?n.luminanceMap===t.luminanceMap&&n.map===t.map&&n.zoom===t.zoom&&n.matrix.equals(t.matrix):!n&&!t}function V0(n,t){var e=!1;for(var r in t)switch(r){case"clippers":Xc(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":Wc(n[r],t[r])||(n[r]=t[r],e=!0);break;default:n[r]!==t[r]&&(n[r]=t[r],e=!0);break}return e}function bi(n,t,e){return n+(t-n)*e}function Zc(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),a=-(2*t*e+3*n)/Math.pow(e,2),o=t,s=n;return i*Math.pow(r,3)+a*Math.pow(r,2)+o*r+s}function Yc(n,t,e,r){var i=(t*e+2*n)/Math.pow(e,3),a=-(2*t*e+3*n)/Math.pow(e,2),o=t;return 3*i*Math.pow(r,2)+2*a*r+o}function $c(n,t,e,r){var i=r[1]-r[0];return n=Ri(n,r),t=Ri(t,r),t-n>i/2?bi(n+i,t,e):n-t>i/2?bi(n-i,t,e):bi(n,t,e)}function Ri(n,t){var e=t[1]-t[0];return n<t[0]?Ri(n+e,t):n>=t[1]?Ri(n-e,t):n}function ed(n,t,e,r){return r?$c(n,t,e,r):bi(n,t,e)}function ts(n){var t=Number(n);return isNaN(t)||!isFinite(t)?0:t}var Me=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=he(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var e in t){var r=t[e];typeof r=="object"?(this.value[e]=ts(r.value),this.config[e]={circle:r.circle}):(this.value[e]=ts(r),this.config[e]={circle:!1})}this.keyframes=[{progress:0,value:k({},this.value)},{progress:1,value:k({},this.value)}]}return n.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-Zc(1,this.startVelocity,this.duration,e)},n.prototype.getValue=function(t){for(var e=1;e<this.keyframes.length;e++)if(this.keyframes[e].progress>t){var r=this.keyframes[e-1],i=this.keyframes[e],a={};for(var o in this.config){var s=(t-r.progress)/(i.progress-r.progress);a[o]=ed(r.value[o],i.value[o],s,this.config[o].circle)}return a}return k({},this.keyframes[this.keyframes.length-1].value)},n.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:Yc(1,this.startVelocity,this.duration,e)},n.prototype.update=function(t){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(t))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},n.prototype.getKeyFrameSegment=function(t){for(var e=this.getProgress(t),r=1;r<this.keyframes.length;r++)if(this.keyframes[r].progress>e)return[this.keyframes[r-1],this.keyframes[r]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},n.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},n.prototype.set=function(t,e,r,i){var a;r===void 0&&(r=0),isNaN(e)&&(e=0),isNaN(r)&&(r=0),i=i!=null?i:he();var o=this.getProgress(i),s=this.getValue(o),l={};for(var u in this.config)l[u]=(a=t[u])!==null&&a!==void 0?a:s[u];var c=[{progress:0,value:s},{progress:1,value:l}];return this.setKeyframes(c,e,r,i)},n.prototype.setKeyframes=function(t,e,r,i){var a=this;if(r===void 0&&(r=0),t.length<2)throw new Error("keyframes invalid.");return isNaN(e)&&(e=0),isNaN(r)&&(r=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise(function(o,s){i=i!=null?i:he(),a.progress=0,a.ended=!1,a.startTime=i,a.startVelocity=r,a.keyframes=t,a.duration=e,e===0?(a.progress=1,a.value=k({},t[t.length-1].value)):a.value=k({},t[0].value),a.callbacks=[o,s]})},n.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},n}(),td=500;function rd(n){return-(Math.cos(Math.PI*n)-1)/2}var er=function(n){se(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.appearMotion=new Me({appear:0}),i}return t.prototype.update=function(e,r,i,a){var o,s;if(this.material.update(e,r,i),a&&a.refine==="ADD"&&a.tileset.rootMeta.pntsOrder==="RANDOM"){var l=this.geometry,u=this.appearMotion,c=i.visible&&a.state.selectedFrameNumber===a.tileset.frameNumber,f=a.tileset.maxScreenSpaceError,m=a.state.screenSpaceError,A=(s=(o=a.parent)===null||o===void 0?void 0:o.state.screenSpaceError)!==null&&s!==void 0?s:m,h=1;if(a.levelOfContent>a.tileset.minLevelOfDetail&&A!==m&&(h=(A-f)/(A-m)),h=fe(h,0,1),h=rd(h),c){var p=1;u.getTargetKeyframe().value.appear!==p&&u.set({appear:p},td).catch(Q)}else{var p=0;u.getTargetKeyframe().value.appear!==p&&u.set({appear:p},0).catch(Q)}u.ended!==!0&&u.update(r.time);var g=l.index?l.index.count:l.attributes.position?l.attributes.position.count:1/0,v=Math.floor(g*h*u.value.appear);l.drawRange.count!==v&&(this.geometry.setDrawRange(0,v),i.needsRender=!0)}},t}(d.Points),gn=new Set,nd=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=k({},Ae),e}return t.prototype.getMaterial=function(){return k({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),gn.clear(),this.traverse(function(i){if(i instanceof Tt)for(var a=0,o=i.material;a<o.length;a++){var s=o[a];gn.has(s)||(Object.assign(s,r.materialParameters),gn.add(s))}i instanceof er&&(gn.has(i.material)||(Object.assign(i.material,r.materialParameters),gn.add(i.material)))}),gn.clear(),this.needsRender=!0},t}(d.Group),id=["right","left","up","down","front","back"];function N0(n,t,e,r){var i=new d.Box3;switch(n){case"up":i.min.y=.5,i.max.y=.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.z=-e+.5-r,i.max.z=-e+.5;break;case"down":i.min.y=-.5,i.max.y=-.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.z=+e-.5,i.max.z=+e-.5+r;break;case"left":i.min.x=-.5,i.max.x=-.5,i.min.z=-t+.5-r,i.max.z=-t+.5,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"right":i.min.x=.5,i.max.x=.5,i.min.z=+t-.5,i.max.z=+t-.5+r,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"front":i.min.z=-.5,i.max.z=-.5,i.min.x=+t-.5,i.max.x=+t-.5+r,i.min.y=-e+.5-r,i.max.y=-e+.5;break;case"back":i.min.z=.5,i.max.z=.5,i.min.x=-t+.5-r,i.max.x=-t+.5,i.min.y=-e+.5-r,i.max.y=-e+.5;break}return i.applyMatrix4(new d.Matrix4().makeRotationY(Math.PI))}var D0=function(n,t){if(!(n.level>=t))for(var e=n.level+1,r=n.size/2,i=[new d.Vector2(n.position.x,n.position.y),new d.Vector2(n.position.x+r,n.position.y),new d.Vector2(n.position.x,n.position.y+r),new d.Vector2(n.position.x+r,n.position.y+r)],a=0,o=i;a<o.length;a++){var s=o[a],l={face:n.face,level:e,size:r,position:s,box:N0(n.face,s.x,s.y,r),parent:n,children:[]};n.children.push(l),D0(l,t)}};function ad(n,t){var e={level:0,face:n,position:new d.Vector2(0,0),size:1,box:N0(n,0,0,1),parent:null,children:[]};return D0(e,t),e}function Qa(n){var t=id.map(function(e){return ad(e,n)});return{children:t}}function po(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],a=t(i);a!==!1&&po(i,t)}}var Zn=new d.BoxBufferGeometry(1,1,1,1,1);Zn.deleteAttribute("uv");Zn.deleteAttribute("normal");Zn.groups=[];Zn.scale(-1,1,1);var od=`
|
|
392
392
|
varying vec3 worldPosition;
|
|
393
393
|
void main() {
|
|
394
394
|
vec4 transform = vec4(position, 1.0);
|
|
@@ -414,7 +414,7 @@ varying vec2 vUv;
|
|
|
414
414
|
void main() {
|
|
415
415
|
gl_FragColor = texture2D(map, vUv);
|
|
416
416
|
}
|
|
417
|
-
`,Q0=[],Yn=new d.PerspectiveCamera(90,1,.1,2);Yn.up.set(0,-1,0);Yn.lookAt(new d.Vector3(1,0,0));Yn.updateMatrix();Yn.matrixAutoUpdate=!1;var $n=new d.PerspectiveCamera(90,1,.1,2);$n.up.set(0,-1,0);$n.lookAt(new d.Vector3(-1,0,0));$n.updateMatrix();$n.matrixAutoUpdate=!1;var ei=new d.PerspectiveCamera(90,1,.1,2);ei.up.set(0,0,1);ei.lookAt(new d.Vector3(0,1,0));ei.updateMatrix();ei.matrixAutoUpdate=!1;var ti=new d.PerspectiveCamera(90,1,.1,2);ti.up.set(0,0,-1);ti.lookAt(new d.Vector3(0,-1,0));ti.updateMatrix();ti.matrixAutoUpdate=!1;var ri=new d.PerspectiveCamera(90,1,.1,2);ri.up.set(0,-1,0);ri.lookAt(new d.Vector3(0,0,1));ri.updateMatrix();ri.matrixAutoUpdate=!1;var ni=new d.PerspectiveCamera(90,1,.1,2);ni.up.set(0,-1,0);ni.lookAt(new d.Vector3(0,0,-1));ni.updateMatrix();ni.matrixAutoUpdate=!1;var rs={front:{camera:ri,index:4},back:{camera:ni,index:5},up:{camera:ei,index:2},down:{camera:ti,index:3},left:{camera:$n,index:1},right:{camera:Yn,index:0}};function fd(){var n=Q0.pop();return n||new d.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:cd,fragmentShader:dd,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function hd(n){n.uniforms.map.value=null,Q0.push(n)}function pd(n,t,e){var r=new d.Scene;r.matrixAutoUpdate=!1;var i=new d.Group;i.scale.set(1,1,-1),r.add(i);for(var a=[],o=new Set,s=0,l=n;s<l.length;s++){var u=l[s];o.add(u.face);var c=fd();a.push(c),c.uniforms.map.value=u.texture,c.uniforms.flipY.value=u.flipY?1:0;var f=new d.Group,m=new d.Mesh(ld,c);m.position.set(u.position.x+u.size.x/2-.5,1-(u.position.y+u.size.y/2)-.5,-.5),m.scale.set(u.size.x,u.size.y,1),f.quaternion.copy(ud[u.face]),f.add(m),i.add(f)}var A=e.autoClear,h=e.sortObjects,p=e.xr.enabled,g=t.texture.generateMipmaps;e.autoClear=!1,e.sortObjects=!1,e.xr.enabled=!1,t.texture.generateMipmaps=!1;var v=e.getRenderTarget(),y=0;o.forEach(function(w){++y===o.size&&(t.texture.generateMipmaps=g),e.setRenderTarget(t,rs[w].index),e.render(r,rs[w].camera)}),e.setRenderTarget(v),e.autoClear=A,e.sortObjects=h,e.xr.enabled=p;for(var b=0,x=a;b<x.length;b++){var c=x[b];hd(c)}}var vd=function(){return!1}();function Fi(n){n===void 0&&(n={});var t=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onClose&&n.onClose.call(this),this.onerror=this.onload=this.close=Q,this.removeAttribute("src")}});return t}function Ha(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),i=Fi({onClose:function(){this.src===r&&URL.revokeObjectURL(r)}});i.onload=function(){i.src===r&&URL.revokeObjectURL(r),i.onload=i.onerror=Q,setTimeout(function(){t(i)},10)},i.onerror=function(){var a=i.src;i.onload=i.onerror=Q,i.close(),e(new Error("image load error: ".concat(a)))},i.decoding="async",i.src=r})}var ns=[];function md(n,t){var e=ns.shift();if(e)return e.width=n,e.height=t,e;var r=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),{close:function(){r.close=Q,ns.push(r)}});return r}function is(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=md(Math.min(n.width,t.width),Math.min(n.height,t.height)),r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.drawImage(n,0,0,e.width,e.height),n.close();var i=new d.Texture(e);i.needsUpdate=!0,i.flipY=!0;var a=i.dispose;return i.dispose=function(){e.close(),a.call(i),i.dispose=a},i}else{var o=new d.Texture(n);o.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?o.flipY=!1:o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}}function Ad(n){var t=new d.CubeTexture(n);t.needsUpdate=!0,t.flipY=!1;var e=t.dispose;return t.dispose=function(){for(var r=0,i=n;r<i.length;r++){var a=i[r];a.close()}e.call(t),t.dispose=e},t}var as=new d.Vector3,en=["right","left","up","down","front","back"],Ne=function(){function n(t,e,r,i,a){this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=a,this.name="",this.needsRender=!1,this.maxRequest=n.DEFAULT_MAX_REQUEST,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.drawedCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.prepareToRender=[],this.baseCubeTexture=t}return Object.defineProperty(n.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(t){var e,r,i,a,o,s;if(t===null)throw new Error("cannot set cubeRenderTarget to null.");t.width!==this.options.textureSize&&t.setSize(this.options.textureSize,this.options.textureSize),t.texture.format=(e=this.options.format)!==null&&e!==void 0?e:d.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:d.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:d.LinearFilter,t.texture.wrapS=(a=this.options.wrapS)!==null&&a!==void 0?a:d.ClampToEdgeWrapping,t.texture.wrapT=(o=this.options.wrapT)!==null&&o!==void 0?o:d.ClampToEdgeWrapping,t.texture.generateMipmaps=(s=this.options.generateMipmaps)!==null&&s!==void 0?s:!0,this.baseCubeTexture&&(qa(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&qa(this._cubeRenderTarget.texture,t,this.renderer),this._cubeRenderTarget=t},enumerable:!1,configurable:!0}),n.prototype.requestTile=function(t){var e=this,r,i,a,o,s,l,u=this.tileSources.filter(function(p){return p.level===t.level})[0];if(!u)return this.loadedCubeNodes.add(t),this.prepareToRender.push({node:t,texture:null}),!1;var c=u.size,f=Math.pow(2,t.level)*t.position.y,m=Math.pow(2,t.level)*t.position.x,A="".concat(((a=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(f,".").concat(m),h=k(k({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:A,size:u.scale>=1?void 0:c*t.size*u.scale,quality:void 0,cut:[c*t.position.x,c*t.position.y,c*t.size,c*t.size]});return this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(u[t.face],{imageURL:{transform:(l=this.options.imageURL)===null||l===void 0?void 0:l.transform,options:k({},h)},format:d.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(p){if(e.disposed){p.body.dispose();return}e.prepareToRender.push({node:t,texture:p.body}),e.loadedCubeNodes.add(t)}).catch(Q).then(function(){e.disposed||e.loadingCubeNodes.delete(t)}),!0},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=t.planes[5].normal,a=Math.max(this.maxRequest-this.loadingCubeNodes.size,0),o=[];po(this.tileTree,function(p){if(p.level>e||!t.intersectsBox(p.box))return!1;!r.loadedCubeNodes.has(p)&&!r.loadingCubeNodes.has(p)&&o.push(p)}),o.sort(function(p,g){return p.level!==g.level?p.level-g.level:p.box.getCenter(as).angleTo(i)-g.box.getCenter(as).angleTo(i)});for(var s=0,l=o;s<l.length;s++){var u=l[s];if(a<=0)break;var c=this.requestTile(u);c&&a--}if(this.cubeRenderTarget&&this.prepareToRender.length){this.prepareToRender.sort(function(p,g){return p.node.level-g.node.level});for(var f=[],m=0;m<this.prepareToRender.length;m++){var A=this.prepareToRender[m],u=A.node,h=A.texture;(u.parent===null||this.drawedCubeNodes.has(u.parent))&&(this.drawedCubeNodes.add(u),h&&f.push({face:u.face,position:u.position,size:new d.Vector2(u.size,u.size),texture:h,flipY:!h.flipY}),this.prepareToRender.splice(m,1),m--)}f.length&&(pd(f,this.cubeRenderTarget,this.renderer),this.needsRender=!0)}}},Object.defineProperty(n.prototype,"tilePending",{get:function(){return this.loadingCubeNodes.size},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){if(!this._cubeRenderTarget)throw new Error("cubeRenderTarget never set.");return this._cubeRenderTarget.texture},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){if(!this.disposed){this.disposed=!0,this.baseCubeTexture&&(this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this.loadingCubeNodes.clear(),this.loadedCubeNodes.clear();for(var t=0,e=this.prepareToRender;t<e.length;t++){var r=e[t];r.texture&&r.texture.dispose()}this.prepareToRender.length=0}},n.DEFAULT_MAX_REQUEST=3,n}(),Bn=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,l,u,c,f,m,A;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.flipY!="undefined"&&(h.flipY=e.flipY),typeof e.format!="undefined"&&(h.format=e.format),typeof e.encoding!="undefined"&&(h.encoding=e.encoding),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(l=e.minFilter)!==null&&l!==void 0?l:d.LinearFilter,h.magFilter=(u=e.magFilter)!==null&&u!==void 0?u:d.LinearFilter;var p=(f=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&f!==void 0?f:{key:"unknown"};t=sn(t,(m=e.imageURL)===null||m===void 0?void 0:m.transform,p);var g=Yo(t),v=(A=e.viaAjax)!==null&&A!==void 0?A:vd,y=Zo(t),b=/^https?:/.test(g);if(y?v=!0:b||(v=!1),v){var x=null,w="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:w},void 0,void 0,a).then(function(M){return Ha(M.body)}).then(function(M){return is(M,e.maxSize)}).then(function(M){return Object.assign(M,h),M}).then(function(M){var R={meta:x,body:M};return r(R),R}).catch(function(M){return i(M),Promise.reject(M)})}else{var E=null,C;return Promise.resolve().then(function(){return Fi()}).then(function(M){return C=M,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,M)}).then(function(M){return E=M.meta,is(M.body,e.maxSize)}).then(function(M){return Object.assign(M,h),M}).then(function(M){var R={meta:E,body:M};return r(R),R}).catch(function(M){return C&&C.close(),i(M),Promise.reject(M)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,l,u,c,f,m,A;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.format!="undefined"&&(h.format=e.format),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(l=e.minFilter)!==null&&l!==void 0?l:d.LinearFilter,h.magFilter=(u=e.magFilter)!==null&&u!==void 0?u:d.LinearFilter;for(var p=[t[en[0]],t[en[1]],t[en[2]],t[en[3]],t[en[4]],t[en[5]]],g=[],v=[0,0,0,0,0,0],y=[],b=function(w){var E=(f=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&f!==void 0?f:{key:"unknown"},C=sn(p[w],(m=e.imageURL)===null||m===void 0?void 0:m.transform,k(k({},E),{key:E.key+"."+en[w]})),M=Yo(C),R=function(V){v[w]=V,a(v.reduce(function(D,z){return D+z},0)/6)},L=(A=e.viaAjax)!==null&&A!==void 0?A:!1,S=/^https?:$/.test(M),I=Zo(C);if(I?L=!0:S||(L=!1),L){var O="blob",P=e.fetcher.ajax(C,{timeout:e.timeout,responseType:O},void 0,void 0,R).then(function(V){return y[w]=V.meta,Ha(V.body)});g.push(P)}else{var F,P=Promise.resolve().then(function(){return Fi()}).then(function(D){return F=D,e.fetcher.loadImage(C,{timeout:e.timeout},void 0,void 0,R,D)}).then(function(D){return y[w]=D.meta,D.body}).catch(function(D){return F&&F.close(),Promise.reject(D)});g.push(P)}},x=0;x<6;x++)b(x);return Promise.all(g).then(function(w){return Ad(w)}).then(function(w){return Object.assign(w,k({encoding:d.sRGBEncoding},h)),w}).then(function(w){var E={body:w,meta:y};return r(E),E}).catch(function(w){for(var E=0,C=g;E<C.length;E++){var M=C[E];M.then(function(R){return R.close()}).catch(Q)}return i(w),Promise.reject(w)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var l=this;return i===void 0&&(i=Q),a===void 0&&(a=Q),o===void 0&&(o=Q),new Promise(function(u,c){var f,m;l.loadCubeTexture(t,{imageURL:{transform:(f=r.imageURL)===null||f===void 0?void 0:f.transform,options:(m=r.imageURL)===null||m===void 0?void 0:m.options},format:d.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(A){var h,p=A.meta,g=A.body,v=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,y=Math.max(1024*v,512),b=Qa(v),x=new Ne(g,b,e,{textureSize:y,textureLoader:l,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},s),w={meta:p,body:x};i(w),u(w)},function(A){a(A),c(A)},o,s).catch(Q)})},n}();const gd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("n\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),yd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H{vs|z-sy|n-u|{Sy||V{qr\x07H{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H0vs{qrs-SYNal`UNQRQ--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{pyqr-Iqvurv{tl}nlsntzr{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-I}rpynzn}l}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@- ||zcrp|5rp@-qvrpv|{9-rp@-rp|9-sy|n- ||z6-\n--sy|n-urn-J-q|5qvrpv|{9-rp|6H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J--qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-rpA5}n{|P|y|;to9-=;=69-pynz}5z|qryNy}un-7-@=;=9-=;=9->;=66H--<<-JJJJJJJJJJJJJJJJ--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--ZNV[lR[Q\f"),bd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-cvr]|vv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlr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r}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),xd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-sy|n-sy||H{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-sy|n-V_||sZnxH{vs|z-sy|n-u|{Sy||V{qr\x07H{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H{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q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--<<-nppzynv|{-5onxrq-v{qvrp-yvtuv{t-|{y\b6--0vsqrs-b`RlYVTUaZN]----rpA-yvtuZn}ar\x07ryJ-r\x07r?Q5-yvtuZn}9-b?-6H----rsyrprqYvtu;v{qvrpQvssr-8J-yvtuZn}ar\x07rya|Yv{rn5-yvtuZn}ar\x07ry-6;to-7-yvtuZn}V{r{v\bH--0ryr----rsyrprqYvtu;v{qvrpQvssr-8J-rp@5->;=-6H--0r{qvs--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rsyrprqYvtu;v{qvrpQvssr-7J-qvssrP|y|;toH--rp@-|t|v{tYvtu-J-rsyrprqYvtu;v{qvrpQvssrH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;?-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--<<-颜色增益调整,在色调映射前--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H---ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--ZNV[lR[Q\f"),wd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-cvr]|vv|{H0vs{qrs-SYNal`UNQRQ--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{py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rZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Iunq|zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),Ed=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-sy|n-sy||H{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-py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-sy|n- ||z6-\n--sy|n-urn-J-q|5qvrpv|{9-rp|6H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--0v{pyqr-I{|znylsntzr{lortv{K--0v{pyqr-I{|znylsntzr{lzn}K--0v{pyqr-Irzvvrzn}lsntzr{K--<<-nppzynv|{--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--0v{pyqr-Iyvtulsntzr{lzn}K--0v{pyqr-Iyvtulsntzr{lr{qK--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rp@-|t|v{tYvtu-J-rsyrprqYvtu;qvrpQvssr-8-rsyrprqYvtu;v{qvrpQvssr-8-rsyrprqYvtu;qvrp`}rpyn-8-rsyrprqYvtu;v{qvrp`}rpyn-8-|nyRzvvr_nqvn{prH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;?-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--<<-颜色增益调整,在色调映射前--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H---ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--ZNV[lR[Q\f");new d.Vector4;var na={modelAlpha:new d.Uniform(0),progress:new d.Uniform(0),pano0_map:new d.Uniform(null),pano0_luminanceMap:new d.Uniform(null),pano0_matrix:new d.Uniform(new d.Matrix4),pano0_zoom:new d.Uniform(1),pano1_map:new d.Uniform(null),pano1_luminanceMap:new d.Uniform(null),pano1_matrix:new d.Uniform(new d.Matrix4),pano1_zoom:new d.Uniform(1),clippers:new d.Uniform([]),shownFloorIndex:new d.Uniform(-1),constantColor:new d.Uniform(null),geometricError:new d.Uniform(0),pixelRatio:new d.Uniform(1),resolution:new d.Uniform(new d.Vector2(512,512)),floor:new d.Uniform(0),brightness:new d.Uniform(1),modelBoundingMin:new d.Uniform(new d.Vector3),modelBoundingMax:new d.Uniform(new d.Vector3),colorSaturation:new d.Uniform(0),colorBrightness:new d.Uniform(0)},Sd={none:{vertexShader:gd,fragmentShader:yd,uniforms:d.UniformsUtils.merge([na,{opacity:{value:1}},d.UniformsLib.fog]),lights:!1,clipping:!1},basic:{vertexShader:bd,fragmentShader:xd,uniforms:d.UniformsUtils.merge([na,d.ShaderLib.basic.uniforms]),lights:!1,clipping:!0},phong:{vertexShader:wd,fragmentShader:Ed,uniforms:d.UniformsUtils.merge([na,d.ShaderLib.phong.uniforms]),lights:!0,clipping:!0}},Jr=function(n){se(t,n);function t(e,r){e===void 0&&(e="basic"),r===void 0&&(r={});var i=this,a,o,s,l,u,c,f,m,A,h,p,g,v,y,b,x,w,E,C,M,R,L,S,I,O,P=Sd[e];i=n.call(this,{vertexShader:P.vertexShader,fragmentShader:P.fragmentShader,uniforms:d.UniformsUtils.clone(P.uniforms),lights:P.lights,clipping:P.clipping,defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_MARK:!1,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_SPREAD_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_CIRCLE:!1,USE_POINT_ADAPTIVE_SIZE:!1,USE_POINT_COLOR_ALTITUDE:!1}})||this,i.shaderType=e,i.color=new d.Color(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.specular=new d.Color(1118481),i.alphaMap=null,i.envMap=null,i.reflectivity=1,i.refractionRatio=.98,i.emissiveMap=null,i.emissive=new d.Color(0),i.emissiveIntensity=1,i.bumpMap=null,i.bumpScale=1,i.normalMap=null,i.normalMapType=d.TangentSpaceNormalMap,i.normalScale=new d.Vector2(1,1),i.displacementMap=null,i.displacementScale=1,i.displacementBias=0,i.shininess=30;var F,V=null,D=null;return Object.defineProperties(i,{pano0:{get:function(){return V},set:function(z){if(V!==z){V=z,z===null?(this.uniforms.pano0_map.value=null,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity(),this.uniforms.pano0_zoom.value=1):(this.uniforms.pano0_map.value=z.map instanceof Ne?z.map.texture:z.map,this.uniforms.pano0_luminanceMap.value=z.luminanceMap instanceof Ne?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano0_matrix.value.copy(z.matrix),this.uniforms.pano0_zoom.value=z.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,q=this.defines.USE_LUMINANCE;q!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},pano1:{get:function(){return D},set:function(z){if(D!==z){D=z,z===null?(this.uniforms.pano1_map.value=null,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity(),this.uniforms.pano1_zoom.value=1):(this.uniforms.pano1_map.value=z.map instanceof Ne?z.map.texture:z.map,this.uniforms.pano1_luminanceMap.value=z.luminanceMap instanceof Ne?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano1_matrix.value.copy(z.matrix),this.uniforms.pano1_zoom.value=z.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,q=this.defines.USE_LUMINANCE;q!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(z){this.uniforms.modelAlpha.value=z}},progress:{get:function(){return this.uniforms.progress.value},set:function(z){this.uniforms.progress.value=z}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(z){var U=this.defines.USE_BLACK_TRANSITION,q=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(z,"_TRANSITION")]=!0;var K=!1;U!==this.defines.USE_BLACK_TRANSITION&&(K=!0),q!==this.defines.USE_SPREAD_TRANSITION&&(K=!0),K&&(this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(z){this.uniforms.constantColor.value=z;var U=this.defines.USE_CONSTANT_COLOR,q=z!==null;U!==q&&(this.defines.USE_CONSTANT_COLOR=q,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(z){this.uniforms.opacity.value=z}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(z){this.uniforms.shownFloorIndex.value=z}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(z){this.uniforms.brightness.value=z}},clippers:{get:function(){return F},set:function(z){F!==z&&(F=z,this.uniforms.clippers.value=(F||[]).map(function(U){var q=typeof U.floorIndex=="number"?U.floorIndex:-1,K=new d.Matrix4().getInverse(U.clippingBoxMatrix);return{matrixInverse:K,floorIndex:q}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(z){z!==this.defines.USE_EDL&&(this.defines.USE_EDL=z,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(z){z!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=z,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(z){z!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=z,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(z){this.uniforms.floor.value=z}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(z){this.uniforms.colorSaturation.value=z}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(z){this.uniforms.colorBrightness.value=z}}}),i.pano0=(a=r.pano0)!==null&&a!==void 0?a:Ae.pano0,i.pano1=(o=r.pano1)!==null&&o!==void 0?o:Ae.pano1,i.modelAlpha=(s=r.modelAlpha)!==null&&s!==void 0?s:Ae.modelAlpha,i.progress=(l=r.progress)!==null&&l!==void 0?l:Ae.progress,i.transition=(u=r.transition)!==null&&u!==void 0?u:Ae.transition,i.constantColor=(c=r.constantColor)!==null&&c!==void 0?c:Ae.constantColor,i.opacity=(f=r.opacity)!==null&&f!==void 0?f:Ae.opacity,i.floorStyle=(m=r.floorStyle)!==null&&m!==void 0?m:Ae.floorStyle,i.shownFloorIndex=(A=r.shownFloorIndex)!==null&&A!==void 0?A:Ae.shownFloorIndex,i.clippers=(h=r.clippers)!==null&&h!==void 0?h:Ae.clippers,i.useEDL=(p=r.useEDL)!==null&&p!==void 0?p:Ae.useEDL,i.useHQWeight=(g=r.useHQWeight)!==null&&g!==void 0?g:Ae.useHQWeight,i.useHQDepth=(v=r.useHQDepth)!==null&&v!==void 0?v:Ae.useHQDepth,i.pointSize=(y=r.pointSize)!==null&&y!==void 0?y:Ae.pointSize,i.pointColor=(b=r.pointColor)!==null&&b!==void 0?b:Ae.pointColor,i.pointShape=(x=r.pointShape)!==null&&x!==void 0?x:Ae.pointShape,i.pointScale=(w=r.pointScale)!==null&&w!==void 0?w:Ae.pointScale,i.pointBack=(E=r.pointBack)!==null&&E!==void 0?E:Ae.pointBack,i.pointMinPixel=(C=r.pointMinPixel)!==null&&C!==void 0?C:Ae.pointMinPixel,i.pointMaxPixel=(M=r.pointMaxPixel)!==null&&M!==void 0?M:Ae.pointMaxPixel,i.gradientTexture=(R=r.gradientTexture)!==null&&R!==void 0?R:Ae.gradientTexture,i.brightness=(L=r.brightness)!==null&&L!==void 0?L:Ae.brightness,i.colorSaturation=(S=r.colorSaturation)!==null&&S!==void 0?S:Ae.colorSaturation,i.colorBrightness=(I=r.colorBrightness)!==null&&I!==void 0?I:Ae.colorBrightness,i.customShaders=(O=r.customShaders)!==null&&O!==void 0?O:Ae.customShaders,i.customShaderHash="",i.customShaderUniforms={},i.customShaderDefines={},i.floor=0,i.transparent=!0,i}return t.prototype.onBeforeCompile=function(e,r){var i=this,a,o,s=this.customShaders.filter(function(g){return g.type.includes(i.shaderType)}),l=s.reduce(function(g,v){return g+v.vertex.mainBefore},""),u=s.reduce(function(g,v){return g+v.vertex.mainStart},""),c=s.reduce(function(g,v){return g+v.vertex.mainEnd},""),f=s.reduce(function(g,v){return g+v.fragment.mainBefore},""),m=s.reduce(function(g,v){return g+v.fragment.mainStart},""),A=s.reduce(function(g,v){return g+v.fragment.mainModelColor},""),h=s.reduce(function(g,v){return g+v.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,f),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,m),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,c),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,h),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,A);var p=String((o=(a=this.clippers)===null||a===void 0?void 0:a.length)!==null&&o!==void 0?o:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,p),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,p),s.forEach(function(g){g.onBeforeCompile(e,r)})},t.prototype.refreshUniforms=function(e){var r,i,a=this.uniforms;a.diffuse&&a.diffuse.value.copy(this.color),a.opacity&&(a.opacity.value=this.opacity),a.color&&a.diffuse.value.copy(this.color),a.emissive&&a.emissive.value.copy(this.emissive).multiplyScalar(this.emissiveIntensity),a.map&&(a.map.value=this.map),a.alphaMap&&(a.alphaMap.value=this.alphaMap),a.specularMap&&(a.specularMap.value=this.specularMap),a.envMap&&(a.envMap.value=this.envMap,a.flipEnvMap.value=!((r=this.envMap)===null||r===void 0)&&r.isCubeTexture?-1:1,a.reflectivity.value=this.reflectivity,a.refractionRatio.value=this.refractionRatio,a.maxMipLevel.value=this.envMap&&(i=e==null?void 0:e.properties.get(this.envMap).__maxMipLevel)!==null&&i!==void 0?i:0),a.lightMap&&(a.lightMap.value=this.lightMap,a.lightMapIntensity.value=this.lightMapIntensity),a.aoMap&&(a.aoMap.value=this.aoMap,a.aoMapIntensity.value=this.aoMapIntensity),a.specular&&a.specular.value.copy(this.specular),a.shininess&&(a.shininess.value=Math.max(this.shininess,1e-4)),a.emissiveMap&&(a.emissiveMap.value=this.emissiveMap),a.bumpMap&&(a.bumpMap.value=this.bumpMap,a.bumpScale.value=this.bumpScale,this.side===d.BackSide&&(a.bumpScale.value*=-1)),a.normalMap&&(a.normalMap.value=this.normalMap,a.normalScale.value.copy(this.normalScale),this.side===d.BackSide&&a.normalScale.value.negate()),a.displacementMap&&(a.displacementMap.value=this.displacementMap,a.displacementScale.value=this.displacementScale,a.displacementBias.value=this.displacementBias);var o;this.map?o=this.map:this.specularMap?o=this.specularMap:this.displacementMap?o=this.displacementMap:this.normalMap?o=this.normalMap:this.bumpMap?o=this.bumpMap:this.alphaMap?o=this.alphaMap:this.emissiveMap&&(o=this.emissiveMap),o!==void 0&&(o.matrixAutoUpdate===!0&&o.updateMatrix(),a.uvTransform.value.copy(o.matrix));var s;this.aoMap?s=this.aoMap:this.lightMap&&(s=this.lightMap),s!==void 0&&(s.matrixAutoUpdate===!0&&s.updateMatrix(),a.uv2Transform.value.copy(s.matrix))},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(v){return v.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(v,y){return Object.assign(v,y.defines)},{}),l=Object.keys(this.customShaderDefines),u=0,c=l;u<c.length;u++){var f=c[u];delete this.defines[f]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var m=this.customShaders.reduce(function(v,y){return Object.assign(v,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,p=A;h<p.length;h++){var g=p[h];delete this.uniforms[g]}this.customShaderUniforms=m,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.refreshUniforms(e),this.shaderType==="none"?(this.depthWrite=!1,this.transparent=!0):(this.transparent=!1,this.depthWrite=!0,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.opacity<1&&(this.transparent=!0),this.alphaMap&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.transparent&&(this.depthWrite=!1),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1)),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.specular.copy(e.specular),this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.emissiveMap=e.emissiveMap,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.shininess=e.shininess,this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.modelAlpha=e.modelAlpha,this.progress=e.progress,this.transition=e.transition,this.opacity=e.opacity,this.constantColor=e.constantColor,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointColor=e.pointColor,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.floor=e.floor,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this},t}(d.ShaderMaterial);const Cd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("{vs|z-sy|n-sy||H0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-]|v{`v rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-u|{Sy||V{qr\x07H<<u调整{vs|z-sy|n-p|y|`nnv|{H{vs|z-sy|n-p|y|Ovtu{rH0v{pyqr-Ip|zz|{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@-nqwP|y|arz}rnr5rp@-p|y|9-sy|n-rz}rnr6\n----<<-将色温范围从-:>;=-到->;=-映射到实际的色温范围----sy|n-rz}-J-5rz}rnr-8->;=6-7-B===;=H-<<-范围从-=-到->====----<<-计算色温系数----sy|n-lsnp|9-tlsnp|9-olsnp|H----vs-5rz}-IJ-CC==;=6-\n--------lsnp|-J->;=H--------tlsnp|-J-=;@F==E>BDEDCF=>FC=DEA-7-y|t5rz}-<->==;=6-:-=;C@>EA>AA@DEEC?DAB=FEH--------olsnp|-J-rz}-IJ->F==;=-L-=;=-G-=;BA@?=CDEF>>=>FC=DEA@-7-y|t5rz}-<->==;=-:->=;=6-:->;>FC?BA=EF>AH----\f-ryr-\n--------lsnp|-J->;?F?F@C>EC=C?DAB=FE=A-7-}|5rz}-<->==;=-:-C=;=9-:=;>@@?=ADBF?6H--------tlsnp|-J->;>?FEF=EC=EFB?FA>>DCB-7-}|5rz}-<->==;=-:-C=;=9-:=;=DBB>AEAF?6H--------olsnp|-J->;=H----\f----<<-调整颜色----rp@-nqwrqP|y|H----nqwrqP|y|;-J-pynz}5p|y|;-7-lsnp|9-=;=9->;=6H----nqwrqP|y|;t-J-pynz}5p|y|;t-7-tlsnp|9-=;=9->;=6H----nqwrqP|y|;o-J-pynz}5p|y|;o-7-olsnp|9-=;=9->;=6H----r{-nqwrqP|y|H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-点大小剔除-JJJ--vs-5]|v{`v r-I-=;==>6-\n----qvpnqH--\f--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--<<-JJJ-形状裁切-JJJ--0vs-qrsv{rq5b`Rl]\\V[al`UN]RlPV_PYR6----sy|n--J-?;=-7-tyl]|v{P||q;\x07-:->;=H----sy|n--J-?;=-7-tyl]|v{P||q;\b-:->;=H----sy|n-pp-J-7-8-7H----vs-5]|v{`v r-K-@;=-33-pp-K->;=6-\n------qvpnqH----\f--0r{qvs--<<-JJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--0v{pyqr-Iy|tqr}uoslsntzr{K--<<-JJJ-颜色-JJJ--rpA-sv{nyP|y|-J-_TOa|Yv{rn5rpA5P|y|9-|}npv\b66H--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----0vs-qrsv{rq5b`Rl]\\V[alONPXlUVQQR[6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------qvpnqH------\f----0ryvs-qrsv{rq5b`Rl]\\V[alONPXlQN_X6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------sv{nyP|y|;\x07\b -J-sv{nyP|y|;\x07\b -7-=;EH------\f----0r{qvs--0r{qvs--tylSntP|y|-J-sv{nyP|y|H--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;>-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\bH--<<-JJJJJJJJJJJJJJ--tylSntP|y|;n-J-tylSntP|y|;n-7-z|qryNy}unH--<<提取亮度--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--0vs-qrsv{rq5b`RlU^ldRVTUa6----sy|n-qvn{pr-J-?;=-7-yr{tu5tyl]|v{P||q;\x07\b-:-=;B6H----sy|n-rvtu-J-zn\x075=;=9->;=-:-qvn{pr6H----rvtu-J-}|5rvtu9->;B6H----tylSntP|y|;n-J-rvtuH----tylSntP|y|;\x07\b -J-tylSntP|y|;\x07\b -7-rvtuH--0r{qvs--ZNV[lR[Q\f"),Md=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H{vs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nv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--<<传递nvor的p|y|到s里使用--<<动态调整}|v{`v r--sy|n-rny]|v{`v r-J-}|v{`pnyr-7-}v\x07ry_nv|H--0vs-qrsv{rq5b`Rl]\\V[al`VgRlTR\\ZRa_VP6----rny]|v{`v r-7J-tr|zrvpR|H----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0ryvs-qrsv{rq5b`Rl]\\V[al`VgRlNaaR[bNaV\\[6----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0r{qvs--tyl]|v{`v r-J-pynz}5rny]|v{`v r9-}|v{Zv{]v\x07ry-7-}v\x07ry_nv|9-}|v{Zn\x07]v\x07ry-7-}v\x07ry_nv|6H--]|v{`v r-J-tyl]|v{`v rH--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0ryr----P|y|-J-p|y|H--0r{qvs--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----[|zny-J-{|znyv r5zn@5z|qryZnv\x076-7-{|zny6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--0vs-qrsv{rq5b`RlU^lQR]aU6----<<-sy|n-}|wSnp|-J-:=;B-7-r|yv|{;\b-<-5n{5s|-<-?;=6-7-z]|vv|{; 6H----<<-sy|n-_nqv-J-rny]|v{`v r-<-}|wSnp|H----sy|n-|vtv{nyQr}u-J-tyl]|vv|{;H----sy|n-nqwrqQr}u-J-|vtv{nyQr}u-8-=;>H----sy|n-nqw-J-nqwrqQr}u-<-|vtv{nyQr}uH----z]|vv|{;\x07\b -J-z]|vv|{;\x07\b -7-nqwH----tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f");var Id=Object.assign({pointScale:new d.Uniform(1),pointMinPixel:new d.Uniform(1),pointMaxPixel:new d.Uniform(1),opacity:new d.Uniform(1),gradientTexture:new d.Uniform(null),modelAlpha:new d.Uniform(0),clippers:new d.Uniform([]),shownFloorIndex:new d.Uniform(-1),constantColor:new d.Uniform(null),geometricError:new d.Uniform(0),pixelRatio:new d.Uniform(1),resolution:new d.Uniform(new d.Vector2(512,512)),floor:new d.Uniform(0),brightness:new d.Uniform(1),modelBoundingMin:new d.Uniform(new d.Vector3),modelBoundingMax:new d.Uniform(new d.Vector3),colorSaturation:new d.Uniform(0),colorBrightness:new d.Uniform(0)},d.UniformsUtils.clone(d.UniformsLib.fog)),ii=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c,f,m,A,h,p,g,v,y,b,x,w,E,C,M,R,L,S,I=n.call(this,{vertexShader:Md,fragmentShader:Cd,uniforms:d.UniformsUtils.clone(Id),lights:!1,clipping:!0,defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_MARK:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_SHAPE_CIRCLE:!1,USE_POINT_SIZE_ATTENUATION:!1,USE_POINT_SIZE_GEOMETRIC:!1,USE_POINT_BACK_HIDDEN:!1,USE_POINT_BACK_DARK:!1}})||this,O;return I.customShaderHash="",I.customShaderUniforms={},I.customShaderDefines={},Object.defineProperties(I,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(P){this.uniforms.constantColor.value=P;var F=this.defines.USE_CONSTANT_COLOR,V=P!==null;F!==V&&(this.defines.USE_CONSTANT_COLOR=V,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(P){this.uniforms.opacity.value=P}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(P){this.uniforms.modelAlpha.value=P}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(P){this.uniforms.shownFloorIndex.value=P}},clippers:{get:function(){return O},set:function(P){O!==P&&(O=P,this.uniforms.clippers.value=(O||[]).map(function(F){var V=typeof F.floorIndex=="number"?F.floorIndex:-1,D=new d.Matrix4().getInverse(F.clippingBoxMatrix);return{matrixInverse:D,floorIndex:V}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(P){var F=P==="ALTITUDE";this.defines.USE_POINT_COLOR_ALTITUDE!==F&&(this.defines.USE_POINT_COLOR_ALTITUDE=F,this.needsUpdate=!0)}},pointSize:{get:function(){return this.defines.USE_POINT_SIZE_GEOMETRIC===!0?"GEOMETRIC":this.defines.USE_POINT_SIZE_ATTENUATION===!0?"ATTENUATION":"FIXED"},set:function(P){var F=P==="ATTENUATION",V=P==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==V&&(this.defines.USE_POINT_SIZE_GEOMETRIC=V,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==F&&(this.defines.USE_POINT_SIZE_ATTENUATION=F,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(P){var F=P==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==F&&(this.defines.USE_POINT_SHAPE_CIRCLE=F,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(P){this.uniforms.pointScale.value=P}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(P){var F=P==="HIDDEN",V=P==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==F&&(this.defines.USE_POINT_BACK_HIDDEN=F,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==V&&(this.defines.USE_POINT_BACK_DARK=V,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(P){this.uniforms.pointMinPixel.value=P}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(P){this.uniforms.pointMaxPixel.value=P}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(P){P!==this.defines.USE_EDL&&(this.defines.USE_EDL=P,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(P){P!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=P,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(P){P!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=P,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(P){this.uniforms.gradientTexture.value=P}},floor:{get:function(){return this.uniforms.floor.value},set:function(P){this.uniforms.floor.value=P}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(P){this.uniforms.brightness.value=P}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(P){this.uniforms.colorSaturation.value=P}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(P){this.uniforms.colorBrightness.value=P}}}),I.pano0=(r=e.pano0)!==null&&r!==void 0?r:Ae.pano0,I.pano1=(i=e.pano1)!==null&&i!==void 0?i:Ae.pano1,I.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:Ae.modelAlpha,I.progress=(o=e.progress)!==null&&o!==void 0?o:Ae.progress,I.transition=(s=e.transition)!==null&&s!==void 0?s:Ae.transition,I.constantColor=(l=e.constantColor)!==null&&l!==void 0?l:Ae.constantColor,I.opacity=(u=e.opacity)!==null&&u!==void 0?u:Ae.opacity,I.floorStyle=(c=e.floorStyle)!==null&&c!==void 0?c:Ae.floorStyle,I.shownFloorIndex=(f=e.shownFloorIndex)!==null&&f!==void 0?f:Ae.shownFloorIndex,I.clippers=(m=e.clippers)!==null&&m!==void 0?m:Ae.clippers,I.useEDL=(A=e.useEDL)!==null&&A!==void 0?A:Ae.useEDL,I.useHQWeight=(h=e.useHQWeight)!==null&&h!==void 0?h:Ae.useHQWeight,I.useHQDepth=(p=e.useHQDepth)!==null&&p!==void 0?p:Ae.useHQDepth,I.pointColor=(g=e.pointColor)!==null&&g!==void 0?g:Ae.pointColor,I.pointShape=(v=e.pointShape)!==null&&v!==void 0?v:Ae.pointShape,I.pointSize=(y=e.pointSize)!==null&&y!==void 0?y:Ae.pointSize,I.pointScale=(b=e.pointScale)!==null&&b!==void 0?b:Ae.pointScale,I.pointBack=(x=e.pointBack)!==null&&x!==void 0?x:Ae.pointBack,I.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:Ae.pointMinPixel,I.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:Ae.pointMaxPixel,I.gradientTexture=(C=e.gradientTexture)!==null&&C!==void 0?C:Ae.gradientTexture,I.brightness=(M=e.brightness)!==null&&M!==void 0?M:Ae.brightness,I.colorSaturation=(R=e.colorSaturation)!==null&&R!==void 0?R:Ae.colorSaturation,I.colorBrightness=(L=e.colorBrightness)!==null&&L!==void 0?L:Ae.colorBrightness,I.customShaders=(S=e.customShaders)!==null&&S!==void 0?S:Ae.customShaders,I.customShaderHash="",I.floor=0,I.transparent=!0,I}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=this.customShaders.filter(function(p){return p.type.includes("pointcloud")}),s=o.reduce(function(p,g){return p+g.vertex.mainBefore},""),l=o.reduce(function(p,g){return p+g.vertex.mainStart},""),u=o.reduce(function(p,g){return p+g.vertex.mainEnd},""),c=o.reduce(function(p,g){return p+g.fragment.mainBefore},""),f=o.reduce(function(p,g){return p+g.fragment.mainStart},""),m=o.reduce(function(p,g){return p+g.fragment.mainModelColor},""),A=o.reduce(function(p,g){return p+g.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,s),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,c),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,f),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,A),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,m);var h=String((a=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,h),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,h),o.forEach(function(p){p.onBeforeCompile(e,r)})},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(v){return v.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(v,y){return Object.assign(v,y.defines)},{}),l=Object.keys(this.customShaderDefines),u=0,c=l;u<c.length;u++){var f=c[u];delete this.defines[f]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var m=this.customShaders.reduce(function(v,y){return Object.assign(v,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,p=A;h<p.length;h++){var g=p[h];delete this.uniforms[g]}this.customShaderUniforms=m,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.transparent=!1,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.modelAlpha<1&&(this.transparent=!0),this.opacity<1&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.depthWrite=!0,this.depthTest=!0,this.useEDL&&(this.transparent=!1),this.useHQWeight?(this.depthWrite=!1,this.blending=d.CustomBlending,this.blendSrc=d.SrcAlphaFactor,this.blendSrcAlpha=d.SrcAlphaFactor,this.blendDst=d.OneFactor,this.blendDstAlpha=d.OneFactor):(this.blending=d.NormalBlending,this.blendDst=d.OneMinusSrcAlphaFactor,this.blendEquation=d.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,this),this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.progress=e.progress,this.transition=e.transition,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.constantColor=e.constantColor,this.modelAlpha=e.modelAlpha,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointColor=e.pointColor,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this},t}(d.ShaderMaterial),nn=function(n){se(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.premultipliedAlpha,o=a===void 0?!0:a,s=e.stencil,l=s===void 0?!0:s,u=e.backgroundColor,c=u===void 0?1579548:u,f=e.backgroundAlpha,m=f===void 0?1:f,A=e.pixelRatio,h=A===void 0?1:A,p=e.antialias,g=p===void 0?!1:p,v=e.webgl2,y=e.logarithmicDepthBuffer,b=e.precision,x=this,w={antialias:g,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:l,premultipliedAlpha:o,powerPreference:"high-performance"},E={logarithmicDepthBuffer:y,precision:b};if(v){var C=document.createElement("canvas"),M=C.getContext("webgl2",w);M?x=n.call(this,k(k(k({},w),E),{antialias:!0,canvas:C,context:M}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),x=n.call(this,k(k({},w),E))||this)}else x=n.call(this,k(k({},w),E))||this;return x.setPixelRatio(h),x.setClearColor(c,m),x.outputEncoding=d.sRGBEncoding,x.autoClear=!0,x}return t}(d.WebGLRenderer),U0=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.add.apply(this,e)},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.remove.apply(this,e)},t}(d.Scene);function Nt(n,t){var e=Math.abs(Math.cos(n.latitude)),r=-Math.sin(n.longitude)*e,i=-Math.sin(n.latitude),a=-Math.cos(n.longitude)*e;return t?t.set(r,i,a):new d.Vector3(r,i,a)}var Td=1,Pd=.1,Bd=2e3,fi=Math.PI*2,os=Math.PI/2;function ia(n){return n>0&&n<=fi?n:(n%fi+fi)%fi}function Rd(n,t,e,r){e=Math.pow(e,4);for(var i=0;i<16;i++)r.elements[i]=n.elements[i]+(t.elements[i]-n.elements[i])*e;return r}var q0=function(n){se(t,n);function t(e,r,i,a,o,s,l){r===void 0&&(r=Td),i===void 0&&(i=Pd),a===void 0&&(a=Bd),o===void 0&&(o=new d.Vector2),s===void 0&&(s=new d.Vector2(512,512)),l===void 0&&(l=1);var u=n.call(this)||this;u.fov=e,u.aspect=r,u.near=i,u.far=a,u.perspToOrtho=o,u.resolution=s,u.pixelRatio=l,u.time=0,u.needsRender=!0,u.refineModel=!0,u.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new d.Vector3},u.computePose(),u.perspectiveCamera=new d.PerspectiveCamera(u.fov,u.aspect,.001,u.far);var c=Math.max(u.orthoDistance,.01)*Math.tan(.5*u.fov/180*Math.PI),f=-.5*u.aspect*2*c;return u.orthographicCamera=new d.OrthographicCamera(f,-f,c,-c,.001,u.far),u.computeProjectionMatrix(),u.lastValues={position:u.position.clone(),quaternion:u.quaternion.clone(),scale:u.scale.clone(),fov:u.fov,aspect:u.aspect,near:u.near,far:u.far,orthoDistance:u.orthoDistance,perspToOrtho:u.perspToOrtho.clone()},u.type=u.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",u}return Object.defineProperty(t.prototype,"orthoDistance",{get:function(){return this.pose.distance>1?this.pose.distance:1+(this.pose.distance-1)*this.perspToOrtho.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.zoom:this.type==="PerspectiveCamera"?this.perspectiveCamera.zoom:1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.top:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.bottom:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.left:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.right:0},enumerable:!1,configurable:!0}),t.prototype.getDirection=function(e){return Nt(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0),this.updateMatrix();var r=this.matrix.elements;return this.pose.latitude=Math.asin(fe(r[9],-1,1)),Math.abs(r[9])<.9999999?this.pose.longitude=ia(Math.atan2(r[8],r[10])):this.pose.longitude=ia(Math.atan2(-r[2],r[0])),this.pose.fov=this.fov,this.pose.distance=e,this.pose.offset=new d.Vector3(-r[8],-r[9],-r[10]).setLength(this.pose.distance).add(this.position),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,l=ia((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),u=Math.max(-os+1e-4,Math.min(os-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),c=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,f=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,m=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,A=Nt({longitude:l,latitude:u}).normalize();return this.position.set(0,0,0),this.lookAt(A),this.position.add(m).sub(A.clone().setLength(f)),this.fov!==c&&(this.fov=c,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=l,this.pose.latitude=u,this.pose.fov=c,this.pose.distance=f,this.pose.offset.copy(m),this.needsRender=!0,this},t.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,distance:this.pose.distance,offset:this.pose.offset.clone()}},t.prototype.computeProjectionMatrix=function(){Rd(this.orthographicCamera.projectionMatrix,this.perspectiveCamera.projectionMatrix,1-this.perspToOrtho.x,this.projectionMatrix),this.projectionMatrixInverse.getInverse(this.projectionMatrix),this.needsRender=!0},t.prototype.setViewOffset=function(e,r,i,a,o,s){this.perspectiveCamera.setViewOffset(e,r,i,a,o,s),this.orthographicCamera.setViewOffset(e,r,i,a,o,s),this.computeProjectionMatrix()},t.prototype.clearViewOffset=function(){this.perspectiveCamera.clearViewOffset(),this.orthographicCamera.clearViewOffset(),this.computeProjectionMatrix()},t.prototype.updateProjectionMatrix=function(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix(),this.computeProjectionMatrix()},Object.defineProperty(t.prototype,"perspectiveProjectionMatrix",{get:function(){return this.perspectiveCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveProjectionMatrixInverse",{get:function(){return this.perspectiveCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrix",{get:function(){return this.orthographicCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrixInverse",{get:function(){return this.orthographicCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),t.prototype.updateTime=function(e,r){this.time=e;var i=!1;if((this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.aspect!==this.aspect)&&(this.perspectiveCamera.fov=this.fov,this.perspectiveCamera.near=this.near,this.perspectiveCamera.far=this.far,this.perspectiveCamera.aspect=this.aspect,this.perspectiveCamera.updateProjectionMatrix(),i=!0),!this.lastValues.position.equals(this.position)||!this.lastValues.quaternion.equals(this.quaternion)||!this.lastValues.scale.equals(this.scale)||!this.lastValues.perspToOrtho.equals(this.perspToOrtho)||this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.orthoDistance!==this.orthoDistance||this.lastValues.aspect!==this.aspect){var a=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),o=-.5*this.aspect*2*a;this.orthographicCamera.left=o,this.orthographicCamera.right=-o,this.orthographicCamera.top=a,this.orthographicCamera.bottom=-a,this.orthographicCamera.near=this.near,this.orthographicCamera.far=this.far,this.orthographicCamera.updateProjectionMatrix(),i=!0}i&&this.computeProjectionMatrix(),this.lastValues.position.copy(this.position),this.lastValues.quaternion.copy(this.quaternion),this.lastValues.scale.copy(this.scale),this.lastValues.fov=this.fov,this.lastValues.aspect=this.aspect,this.lastValues.near=this.near,this.lastValues.far=this.far,this.lastValues.orthoDistance=this.orthoDistance,this.lastValues.perspToOrtho.copy(this.perspToOrtho),this.type=this.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera"},Object.defineProperty(t.prototype,"isPerspectiveCamera",{get:function(){return this.perspToOrtho.x<1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOrthographicCamera",{get:function(){return this.perspToOrtho.x>=1},enumerable:!1,configurable:!0}),t.prototype.copy=function(e,r){return n.prototype.copy.call(this,e,r),this.fov=e.fov,this.aspect=e.aspect,this.near=e.near,this.far=e.far,this.perspToOrtho.copy(e.perspToOrtho),this.updateTime(he(),0),this},t}(d.Camera),mt;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(mt||(mt={}));var H0=1e-6,ze=new d.Vector3,Ur=new d.Matrix4,Rr=new d.Vector3,Fr=new d.Vector3,kr=new d.Vector3,Ga=new d.Vector3,aa=new d.Box3,oa=new d.Sphere,ss=new d.Matrix4,sa=new d.Ray,pt=new d.Object3D,us=new d.Frustum;function G0(n,t){var e=n.elements;return t.setFromRotationMatrix(Ur.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1)),t}var Hn=function(){function n(t){t===void 0&&(t=[]),this.planes=t}return Object.defineProperty(n,"MASK_OUTSIDE",{get:function(){return 4294967295},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INSIDE",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INDETERMINATE",{get:function(){return 2147483647},enumerable:!1,configurable:!0}),n.prototype.setFromFrustum=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.setFromCamera=function(t){return Ur.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),us.setFromProjectionMatrix(Ur),this.setFromFrustum(us),this},n.prototype.applyMatrix4=function(t){for(var e=0,r=this.planes;e<r.length;e++){var i=r[e];i.applyMatrix4(t)}},n.prototype.copy=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.computeVisibility=function(t){for(var e=mt.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case mt.Outside:return mt.Outside;case mt.Intersecting:e=mt.Intersecting;break}}return e},n.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===n.MASK_OUTSIDE||e===n.MASK_INSIDE)return e;for(var r=n.MASK_INSIDE,i=Math.min(32,this.planes.length),a=0;a<i;++a){var o=1<<a;if(e&o){var s=this.planes[a],l=t.intersectPlane(s);if(l===mt.Outside)return n.MASK_OUTSIDE;l===mt.Intersecting&&(r|=o)}}return r},n}(),K0=function(){function n(){this.type="box",this.center=new d.Vector3,this.halfSize=new d.Vector3,this.rotation=new d.Matrix3}return n.prototype.fromJson=function(t){var e=t.box;this.center.set(e[0],e[1],e[2]);var r=e[3],i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],u=e[9],c=e[10],f=e[11],m=Math.sqrt(r*r+i*i+a*a),A=Math.sqrt(o*o+s*s+l*l),h=Math.sqrt(u*u+c*c+f*f);this.halfSize.set(m,A,h);var p=this.halfSize.toArray().reduce(function(g,v){return g+v},0);return(isNaN(p)||p<=0)&&this.halfSize.setScalar(H0),this.rotation.fromArray([r/m,i/m,a/m,o/A,s/A,l/A,u/h,c/h,f/h]),isNaN(this.rotation.toArray().reduce(function(g,v){return g+v},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(Rr,Fr,kr),{box:Et(Et(Et(Et([],this.center.toArray(),!0),Rr.multiplyScalar(this.halfSize.x).toArray(),!0),Fr.multiplyScalar(this.halfSize.y).toArray(),!0),kr.multiplyScalar(this.halfSize.z).toArray(),!0)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.halfSize.copy(t.halfSize),this.rotation.copy(t.rotation),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.applyMatrix4=function(t){return pt.position.copy(this.center),G0(this.rotation,pt.quaternion),pt.scale.copy(this.halfSize),pt.matrix.compose(pt.position,pt.quaternion,pt.scale),pt.matrix.premultiply(t),pt.matrix.decompose(pt.position,pt.quaternion,pt.scale),this.center.copy(pt.position),this.rotation.setFromMatrix4(Ur.makeRotationFromQuaternion(pt.quaternion)),this.halfSize.copy(pt.scale),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.rotation.elements,r=t.x-this.center.x,i=t.y-this.center.y,a=t.z-this.center.z,o=0,s;return s=r*e[0]+i*e[1]+a*e[2],s<0&&(s=-s),s-=this.halfSize.x,s>0&&(o+=s*s),s=r*e[3]+i*e[4]+a*e[5],s<0&&(s=-s),s-=this.halfSize.y,s>0&&(o+=s*s),s=r*e[6]+i*e[7]+a*e[8],s<0&&(s=-s),s-=this.halfSize.z,s>0&&(o+=s*s),o},n.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSquaredToPoint(t))},n.prototype.distanceToPlane=function(t){var e=t.projectPoint(this.center,new d.Vector3);return this.distanceToPoint(e)},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(Rr,Fr,kr),Rr.setLength(this.halfSize.x),Fr.setLength(this.halfSize.y),kr.setLength(this.halfSize.z),t.expandByPoint(ze.copy(this.center).add(Rr)),t.expandByPoint(ze.copy(this.center).sub(Rr)),t.expandByPoint(ze.copy(this.center).add(Fr)),t.expandByPoint(ze.copy(this.center).sub(Fr)),t.expandByPoint(ze.copy(this.center).add(kr)),t.expandByPoint(ze.copy(this.center).sub(kr)),t},n.prototype.toGeometry=function(){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),e=new Float32Array(8*3);ze.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),ze.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),ze.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),ze.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),ze.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),ze.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),ze.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),ze.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,21);var r=new d.BufferGeometry;return r.setIndex(new d.BufferAttribute(t,1)),r.setAttribute("position",new d.BufferAttribute(e,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},n.prototype.intersectPlane=function(t){var e=this.center,r=t.normal,i=this.rotation.elements,a=this.halfSize,o=r.x,s=r.y,l=r.z,u=Math.abs(o*i[0]*a.x+s*i[1]*a.x+l*i[2]*a.x)+Math.abs(o*i[3]*a.y+s*i[4]*a.y+l*i[5]*a.y)+Math.abs(o*i[6]*a.z+s*i[7]*a.z+l*i[8]*a.z),c=r.dot(e)+t.constant;return c<=-u?mt.Outside:c>=u?mt.Inside:mt.Intersecting},n.prototype.intersectRay=function(t,e){if(Ga.copy(this.halfSize).multiplyScalar(2),aa.setFromCenterAndSize(ze.set(0,0,0),Ga),this.rotation.extractBasis(Rr,Fr,kr),Ur.makeBasis(Rr,Fr,kr),Ur.setPosition(this.center),ss.getInverse(Ur),sa.copy(t).applyMatrix4(ss),aa.containsPoint(sa.origin))return!0;var r=sa.intersectBox(aa,ze);return r?e!==void 0?r.applyMatrix4(Ur).distanceTo(t.origin)<e:!0:!1},n}(),j0=function(){function n(){this.type="sphere",this.center=new d.Vector3,this.radius=-1}return n.prototype.fromJson=function(t){var e=t.sphere;return this.center.set(e[0],e[1],e[2]),this.radius=Math.max(e[3],H0),this},n.prototype.toJson=function(){return{sphere:Et(Et([],this.center.toArray(),!0),[this.radius],!1)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.radius=t.radius,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){return t.setFromCenterAndSize(this.center,Ga.set(1,1,1).multiplyScalar(this.radius*2)),t},n.prototype.toGeometry=function(){for(var t=32,e=new Float32Array(t*3*2*2),r=0;r<=t;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+Math.sin(i)*this.radius,e[r*6+2]=this.center.z+0,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+Math.sin(i)*this.radius,e[r*6+5]=this.center.z+0}for(var r=t;r<=t*2;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+0,e[r*6+2]=this.center.z+Math.sin(i)*this.radius,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+0,e[r*6+5]=this.center.z+Math.sin(i)*this.radius}var a=new d.BufferGeometry;return a.setAttribute("position",new d.BufferAttribute(e,3)),a.computeBoundingBox(),a.computeBoundingSphere(),a},n.prototype.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.distanceToPoint(t);return e*e},n.prototype.distanceToPoint=function(t){var e=this.center.distanceTo(t)-this.radius;return e<=0?0:e},n.prototype.distanceToPlane=function(t){var e=Math.abs(t.distanceToPoint(this.center));return Math.max(0,e-this.radius)},n.prototype.intersectPlane=function(t){var e=this.center,r=this.radius,i=t.normal,a=i.dot(e)+t.constant;return a<-r?mt.Outside:a<r?mt.Intersecting:mt.Inside},n.prototype.intersectRay=function(t,e){if(oa.set(this.center,this.radius),oa.containsPoint(t.origin))return!0;var r=t.intersectSphere(oa,ze);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),Fd=function(){function n(){throw this.type="regin",this.west=0,this.south=0,this.east=0,this.north=0,this.minHeight=0,this.maxHeight=0,new Error("Region bounding volume not supported.")}return n.prototype.fromJson=function(t){var e=t.region;return this.west=e[0],this.south=e[1],this.east=e[2],this.north=e[3],this.minHeight=e[4],this.maxHeight=e[5],this},n.prototype.toJson=function(){return{region:[this.west,this.south,this.east,this.north,this.minHeight,this.maxHeight]}},n.prototype.copy=function(t){return this.west=t.west,this.south=t.south,this.east=t.east,this.north=t.north,this.minHeight=t.minHeight,this.maxHeight=t.maxHeight,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){throw new Error("not implemented")},n.prototype.toGeometry=function(){throw new Error("not implemented")},n.prototype.applyMatrix4=function(t){throw new Error("not implemented")},n.prototype.getCenter=function(t){throw new Error("not implemented")},n.prototype.distanceToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceSquaredToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceToPlane=function(t){throw new Error("not implemented")},n.prototype.intersectPlane=function(t){throw new Error("not implemented")},n.prototype.intersectRay=function(t){throw new Error("not implemented")},n}();function xi(n){if("box"in n)return new K0().fromJson(n);if("sphere"in n)return new j0().fromJson(n);if("region"in n)return new Fd().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var hi=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new d.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),kd=function(){var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),t=new Float32Array(8*3);ze.set(1,1,1).toArray(t,0),ze.set(-1,1,1).toArray(t,3),ze.set(-1,-1,1).toArray(t,6),ze.set(1,-1,1).toArray(t,9),ze.set(1,1,-1).toArray(t,12),ze.set(-1,1,-1).toArray(t,15),ze.set(-1,-1,-1).toArray(t,18),ze.set(1,-1,-1).toArray(t,21);var e=new d.BufferGeometry;return e.setIndex(new d.BufferAttribute(n,1)),e.setAttribute("position",new d.BufferAttribute(t,3)),e.computeBoundingBox(),e.computeBoundingSphere(),e}(),Ld=function(){for(var n=32,t=new Float32Array(n*3*2*2),e=0;e<=n;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=Math.sin(r),t[e*6+2]=0,r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=Math.sin(r),t[e*6+5]=0}for(var e=n;e<=n*2;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=0,t[e*6+2]=Math.sin(r),r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=0,t[e*6+5]=Math.sin(r)}var i=new d.BufferGeometry;return i.setAttribute("position",new d.BufferAttribute(t,3)),i.computeBoundingBox(),i.computeBoundingSphere(),i}();function Od(n,t){if(n instanceof K0){var e=new d.LineSegments(kd,hi[Math.min(t,hi.length-1)]);return e.position.copy(n.center),G0(n.rotation,e.quaternion),e.scale.set(n.halfSize.x,n.halfSize.y,n.halfSize.z),e.matrix.compose(e.position,e.quaternion,e.scale),e}else if(n instanceof j0){var e=new d.LineSegments(Ld,hi[Math.min(t,hi.length-1)]);return e.position.copy(n.center),e.scale.set(n.radius,n.radius,n.radius),e.matrix.compose(e.position,e.quaternion,e.scale),e}throw new Error("never")}var Vd=new d.Vector3,mo=function(){function n(t,e,r,i){var a=this,o,s,l,u;this.parent=null,this.floor=0,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,distanceToCamera:0,centerZDepth:0,centerScreenY:0,screenSpaceError:0,visibilityPlaneMask:0,inRequestVolume:!1,shouldRefine:!1,stackLength:0,finalResolution:!0,selectionDepth:0,shouldSelect:!1,lastSelect:!1,ancestorWithContent:null,ancestorWithContentAvailable:null},this.parent=i!=null?i:null,this.level=this.parent?this.parent.level+1:0,this.tileset=r,this.refine=(o=e.refine)!==null&&o!==void 0?o:this.parent?this.parent.refine:"REPLACE",this.transform=new d.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.parent&&this.transform.premultiply(this.parent.transform),typeof e.geometricError=="number"?this.geometricError=e.geometricError*this.transform.getMaxScaleOnAxis():this.geometricError=(l=(s=this.parent)===null||s===void 0?void 0:s.geometricError)!==null&&l!==void 0?l:0,e.content&&e.content.uri?(this.content={uri:e.content.uri,loadState:"UNLOADED",loadStateUpdateTime:he(),loadfailRetryDelay:0,byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=xi(e.content.boundingVolume).applyMatrix4(this.transform)),/\.json$/.test(this.content.uri)?this.type="TILESET":this.type="SCENEGRAPH"):(this.content=null,this.type="EMPTY"),this.levelOfContent=this.parent?this.parent.levelOfContent:-1,this.type==="SCENEGRAPH"&&(this.levelOfContent=this.levelOfContent+1),e.boundingVolume&&(this.boundingVolume=xi(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=xi(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=(u=e.extras)!==null&&u!==void 0?u:{},typeof this.extras.floor!="number"&&i&&typeof i.extras.floor=="number"&&(this.extras.floor=i.extras.floor),typeof this.extras.floor=="number"&&(this.floor=this.extras.floor,this.tileset.floorLength=Math.max(this.tileset.floorLength,this.floor+1)),this.boundingVolume&&(this.boundingVolumeDebugObject=Od(this.boundingVolume,this.levelOfContent)),e.children?this.children=e.children.map(function(c,f){return new n("".concat(a.id,".").concat(f),c,r,a)}):this.children=[]}return n.prototype.traverse=function(t){t(this);for(var e=0,r=this.children;e<r.length;e++){var i=r[e];i.traverse(t)}},n.prototype.updateState=function(t){this.state.frameNumber=t.frameNumber;var e=this.tileset.transformIsIdentity?null:this.tileset.transform;if(this.boundingVolume){var r=e?this.boundingVolume.clone().applyMatrix4(e):this.boundingVolume;if(t.camera.type==="OrthographicCamera"){var i=new d.Plane().setFromNormalAndCoplanarPoint(t.camera.direction,t.camera.position);this.state.distanceToCamera=r.distanceToPlane(i)}else this.state.distanceToCamera=r.distanceToPoint(t.camera.position);var a=r.getCenter(Vd).sub(t.camera.position);this.state.centerZDepth=t.camera.direction.dot(a),this.state.centerScreenY=t.camera.up.dot(a);var o=this.parent?this.parent.state.visibilityPlaneMask:Hn.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,o),this.state.visible=this.state.visibilityPlaneMask!==Hn.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=Hn.MASK_INDETERMINATE,this.state.visible=!0;if(this.levelOfContent<=t.minLevelOfDetail&&(this.state.visible=!0),this.viewerRequestVolume){var s=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=s.distanceSquaredToPoint(t.camera.position)<=0}else this.state.inRequestVolume=!0;this.state.screenSpaceError=this.getScreenSpaceError(t,this.state.distanceToCamera,!1)},Object.defineProperty(n.prototype,"selected",{get:function(){return this.state.selectedFrameNumber===this.tileset.frameNumber},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"siblingIndex",{get:function(){var t,e;return(e=(t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))!==null&&e!==void 0?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasTilesetContent",{get:function(){return this.children.length>0&&this.type==="TILESET"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRenderContent",{get:function(){return this.type==="SCENEGRAPH"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentAvailable",{get:function(){var t;return this.hasRenderContent&&((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasUnloadedContent",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="UNLOADED"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasEmptyContent",{get:function(){return this.type==="EMPTY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentReady",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"||this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentByteLength",{get:function(){return this.content?this.content.byteLength:0},enumerable:!1,configurable:!0}),n.prototype.getScreenSpaceError=function(t,e,r){var i=this.tileset.transformIsIdentity?1:this.tileset.transform.getMaxScaleOnAxis(),a=this.parent?this.parent.geometricError:this.tileset.geometricError,o=i*(r?a:this.geometricError);if(o===0)return 0;var s=Math.max(e,.001),l=o*t.height/(s*t.sseDenominator);return l},n.prototype.getPriority=function(){var t=this.refine==="ADD"||this.tileset.skipLevelOfDetail;if(t&&!this.state.visible||this.tileset.frameNumber-this.state.touchedFrameNumber>=1)return-1;var e=this.parent,r=e&&(!t||this.state.screenSpaceError===0),i=r?e.state.screenSpaceError:this.state.screenSpaceError,a=this.tileset.root?this.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o},n}();function ls(n){var t=n.refine==="ADD"||n.tileset.skipLevelOfDetail,e=n.parent,r=e&&(!t||n.state.screenSpaceError===0),i=r?e.state.screenSpaceError:n.state.screenSpaceError,a=n.tileset.root?n.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o}var _0=function(){function n(t,e){this.tileset=t,this.options=e,this.activeRequests=0,this.requestQueue=[]}return n.prototype.reset=function(){for(var t=0,e=this.requestQueue;t<e.length;t++){var r=e[t];this.options.onTileSkip&&this.options.onTileSkip(r.tile)}this.requestQueue.length=0},n.prototype.update=function(t,e,r){for(var i=this,a=r.time,o=this.requestQueue,s=new Set(t),l=0;l<o.length;l++){var u=o[l];if(s.has(u.tile)){s.delete(u.tile);continue}u.status==="WAITING"&&(o.splice(l,1),l--,this.options.onTileSkip&&this.options.onTileSkip(u.tile))}s.size>0&&(s.forEach(function(h){o.push({tile:h,status:"WAITING",time:a,error:null})}),s.clear());for(var c=this.tileset.maxRequests,l=0;l<o.length&&c>0;l++){var u=o[l];if(u.status==="DONE")u.error!==null?this.options.onTileError&&this.options.onTileError(u.tile,u.error):(c--,u.tile.content&&(u.tile.content.loadState="READY"),this.options.onTileLoad&&this.options.onTileLoad(u.tile)),o.splice(l,1),l--;else if(u.status==="PENDING"&&a-u.time<1e3)break}switch(e){case"SCREEN_SPACE_ERROR":{var f=new Map;o.sort(function(h,p){if(h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber)return p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber;if(h.tile.state.requestedFrameNumber===r.frameNumber){var g=f.get(h.tile.id);g===void 0&&(g=ls(h.tile),f.set(h.tile.id,g));var v=f.get(p.tile.id);return v===void 0&&(v=ls(p.tile),f.set(p.tile.id,v)),g-v}else return h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}case"SCREEN_VERTICAL":{o.sort(function(h,p){return h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber?p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber:h.tile.state.requestedFrameNumber===r.frameNumber?h.tile.state.centerScreenY!==p.tile.state.centerScreenY?h.tile.state.centerScreenY-p.tile.state.centerScreenY:h.tile.state.centerZDepth!==p.tile.state.centerZDepth?h.tile.state.centerZDepth-p.tile.state.centerZDepth:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}case"SCREEN_LEVEL_VERTICAL":{o.sort(function(h,p){return h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber?p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber:h.tile.state.requestedFrameNumber===r.frameNumber?h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.centerScreenY!==p.tile.state.centerScreenY?h.tile.state.centerScreenY-p.tile.state.centerScreenY:h.tile.state.centerZDepth!==p.tile.state.centerZDepth?h.tile.state.centerZDepth-p.tile.state.centerZDepth:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}}c=Math.max(this.tileset.maxRequests-this.activeRequests,0);for(var m=function(h){var p=o[h];p.status==="WAITING"&&(c--,p.status="PENDING",p.time=a,A.activeRequests++,A.tileset.options.tileLoader(p.tile).catch(function(g){p.error=g}).then(function(){p.status="DONE",p.tile.content&&p.tile.content.loadState==="READY"&&(p.tile.content.loadState="LOADING"),i.activeRequests--}))},A=this,l=0;l<o.length&&c>0;l++)m(l)},n}(),Nd=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Dd=function(){function n(){this.head=null,this.tail=null,this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.add=function(t){var e=new Nd(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this._length++,e},n.prototype.remove=function(t){t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,this._length--},n.prototype.splice=function(t,e){t!==e&&(this.remove(e),this.insert(t,e))},n.prototype.insert=function(t,e){var r=t.next;t.next=e,this.tail===t?this.tail=e:r.previous=e,e.next=r,e.previous=t,this._length++},n.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},n}(),J0=function(){function n(t){t===void 0&&(t={}),this.options=t,this.cacheNodeMap=new Map,this.list=new Dd,this.sentinel=this.list.add("sentinel")}return n.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},n.prototype.touchTile=function(t){var e=this.cacheNodeMap.get(t);e&&this.list.splice(this.sentinel,e)},n.prototype.loadTile=function(t){if(!this.cacheNodeMap.has(t)){var e=this.list.add(t);this.cacheNodeMap.set(t,e),this.options.onTileLoad&&this.options.onTileLoad(t)}},n.prototype.unloadTile=function(t){var e=this.cacheNodeMap.get(t);e&&(this.list.remove(e),this.cacheNodeMap.delete(t),this.options.onTileUnload&&this.options.onTileUnload(t))},n.prototype.unloadTiles=function(t){for(var e=this.list.head;e!==this.sentinel&&t();){var r=e.item;e=e.next,this.unloadTile(r)}},n.prototype.toArray=function(){for(var t=[],e=0,r=this.list.toArray();e<r.length;e++){var i=r[e];i.item!=="sentinel"&&t.push(i.item)}return t},n}(),qr=function(){function n(){this.map=new Map,this.array=[],this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return this.array[t]},n.prototype.set=function(t,e){t>=this.length&&(this._length=t+1),this.map.has(this.array[t])&&this.map.delete(this.array[t]),this.array[t]=e,this.map.set(e,t)},n.prototype.delete=function(t){var e=this.map.get(t);e!==void 0&&e>=0&&(this.array.splice(e,1),this.map.delete(t),this._length--)},n.prototype.push=function(t){if(!this.map.has(t)){var e=this._length++;this.array[e]=t,this.map.set(t,e)}},n.prototype.pop=function(){var t=this.array[--this._length];return this.map.delete(t),this.array[this._length]=void 0,t},n.prototype.reset=function(){this.array=[],this.map=new Map,this._length=0},n.prototype.find=function(t){return this.map.has(t)},n.prototype.peek=function(){return this.array[this._length-1]},n}(),Ao=function(){function n(t){this.tileset=t,this._canSelectTile=!0,this._loadAllTilesTraversalStack=new qr,this.root=null}return n.prototype.traverse=function(t,e,r){this.root=t,this.reset()},n.prototype.reset=function(){this._loadAllTilesTraversalStack.reset(),this.tileset.hasMixedContent=!1,this.tileset.needsRefinedTiles.clear(),this.tileset.requestedTiles.length=0,this.tileset.selectedTiles.length=0},n.prototype.updateTile=function(t,e){this.updateTileVisibility(t,e),t.state.shouldSelect=!1,t.state.finalResolution=!0},n.prototype.selectTile=function(t,e){var r=t.contentAvailable&&this._canSelectTile;r&&t.state.selectedFrameNumber<e.frameNumber&&(t.state.selectedFrameNumber=e.frameNumber,this.tileset.selectedTiles.push(t),this.tileset.needsRefinedTiles.add(t))},n.prototype.loadTile=function(t,e){t.state.requestedFrameNumber<e.frameNumber&&(t.state.requestedFrameNumber=e.frameNumber,t.content&&(t.content.loadState==="FAILED"&&e.time-t.content.loadStateUpdateTime>t.content.loadfailRetryDelay&&(t.content.loadState="UNLOADED",t.content.loadStateUpdateTime=e.time),t.content.loadState==="UNLOADED"&&this.tileset.requestedTiles.push(t))),this.tileset.needsRefinedTiles.add(t)},n.prototype.touchTile=function(t,e){this.tileset.cache.touchTile(t),t.state.touchedFrameNumber=e.frameNumber},n.prototype.canTraverse=function(t,e){return t.levelOfContent>=e.maxLevelOfDetail||t.children.length===0?!1:t.levelOfContent<=e.minLevelOfDetail||t.hasTilesetContent?!0:t.state.screenSpaceError>this.tileset.maxScreenSpaceError},n.prototype.updateTileVisibility=function(t,e){if(t.updateState(e),!(!t.state.visible||!t.state.inRequestVolume)){var r=t.children.length>0;if(t.hasTilesetContent&&r){var i=t.children[0];this.updateTileVisibility(i,e),t.state.visible=i.state.visible;return}if(this.meetsScreenSpaceErrorEarly(t,e)){t.state.visible=!1;return}var a=t.refine==="REPLACE";if(a&&r&&!this.anyChildrenVisible(t,e)){t.state.visible=!1;return}}},n.prototype.anyChildrenVisible=function(t,e){for(var r=!1,i=t.children,a=0,o=i;a<o.length;a++){var s=o[a];s.updateState(e),r=r||s.state.visible}return r},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"||r.levelOfContent<e.minLevelOfDetail?!1:r.levelOfContent>e.maxLevelOfDetail?!0:t.getScreenSpaceError(e,t.state.distanceToCamera,!0)<this.tileset.maxScreenSpaceError},n.prototype.sortTilesByDistanceToCamera=function(t){t.sort(function(e,r){return r.state.distanceToCamera===0&&e.state.distanceToCamera===0?r.state.centerZDepth-e.state.centerZDepth:r.state.distanceToCamera-e.state.distanceToCamera})},n.prototype.loadAllTiles=function(t,e){var r=this._loadAllTilesTraversalStack;for(r.push(t);r.length>0;){var i=r.pop();i.content&&i.content.loadState==="UNLOADED"&&i.state.requestedFrameNumber<e.frameNumber&&this.tileset.requestedTiles.push(i),this.touchTile(i,e);for(var a=0,o=i.children;a<o.length;a++){var s=o[a];r.push(s)}}},n}(),zd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new qr,r._emptyTraversalStack=new qr,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),this._emptyTraversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s))}this._traversalStack.reset(),this._emptyTraversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._emptyTraversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop(),o=a.parent,s=!o||o.state.shouldRefine,l=!1;this.canTraverse(a,r)&&(l=this.updateAndPushChildren(a,r,i)&&s);var u=!l&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)):(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var l=s[o];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(a);for(var u=e.refine==="REPLACE"&&e.hasRenderContent,c=!1,f=!0,m=0,A=a;m<A.length;m++){var l=A[m];if(l.levelOfContent<=r.minLevelOfDetail||l.state.visible&&l.state.inRequestVolume?(i.find(l)&&i.delete(l),i.push(l),c===!1&&(c=!0)):(u||this.tileset.loadSiblings)&&(this.loadTile(l,r),this.touchTile(l,r)),u){var h=void 0;l.state.inRequestVolume?l.hasRenderContent?h=l.contentAvailable:h=this.executeEmptyTraversal(l,r):h=!1,f=f&&h}}return c||(f=!1),f},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t.prototype.executeEmptyTraversal=function(e,r){var i=!0,a=this._emptyTraversalStack;for(a.push(e);a.length>0&&i;){var o=a.pop(),s=!o.hasRenderContent&&this.canTraverse(o,r);if(!s&&!o.contentAvailable&&(i=!1),this.updateTile(o,r),o.state.visible||(this.loadTile(o,r),this.touchTile(o,r)),s)for(var l=o.children,u=0,c=l;u<c.length;u++){var f=c[u];a.find(f)&&a.delete(f),a.push(f)}}return i},t}(Ao),Qd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r.baseScreenSpaceError=1024,r.skipScreenSpaceErrorFactor=16,r.skipLevels=1,r._traversalStack=new qr,r._descendantTraversalStack=new qr,r._selectionTraversalStack=new qr,r._selectionTraversalancestorStack=new qr,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s),this.traverseAndSelect(e,s))}this.tileset.hasMixedContent=!1,this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r),this.traverseAndSelect(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop();this.updateTileAncestorContentLinks(a,r);var o=a.parent,s=!o||o.state.shouldRefine,l=!1;this.canTraverse(a,r)&&(l=this.updateAndPushChildren(a,r,i)&&s);var u=!l&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.inBaseTraversal(a,this.baseScreenSpaceError)?(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)):u?(this.loadTile(a,r),this.selectDesiredTile(a,r)):this.reachedSkippingThreshold(a)&&this.loadTile(a,r)):(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var l=s[o];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(a);for(var u=!1,c=0,f=a;c<f.length;c++){var l=f[c];l.levelOfContent<=r.minLevelOfDetail||l.state.visible&&l.state.inRequestVolume?(i.push(l),u===!1&&(u=!0)):this.tileset.loadSiblings&&(this.loadTile(l,r),this.touchTile(l,r))}return u},t.prototype.selectDesiredTile=function(e,r){var i=e.contentAvailable?e:e.state.ancestorWithContentAvailable;i&&(i.state.shouldSelect=!0),e.contentAvailable||this.selectDescendants(e,r)},t.prototype.selectDescendants=function(e,r){var i=this._descendantTraversalStack;for(i.push(e);i.length>0;)for(var a=i.pop(),o=a.children,s=0,l=o;s<l.length;s++){var u=l[s];u.state.visible&&(u.contentAvailable?(this.updateTile(u,r),this.touchTile(u,r),this.selectTile(u,r)):i.push(u))}},t.prototype.reachedSkippingThreshold=function(e){var r=e.state.ancestorWithContent,i=r!==null&&e.state.screenSpaceError<r.state.screenSpaceError/this.skipScreenSpaceErrorFactor&&e.levelOfContent>r.levelOfContent+this.skipLevels;return i},t.prototype.updateTileAncestorContentLinks=function(e,r){e.state.ancestorWithContent=null,e.state.ancestorWithContentAvailable=null;var i=e.parent;if(i){var a=!(i.hasRenderContent&&i.hasUnloadedContent)||i.state.requestedFrameNumber===r.frameNumber;e.state.ancestorWithContent=a?i:i.state.ancestorWithContent,e.state.ancestorWithContentAvailable=i.contentAvailable?i:i.state.ancestorWithContentAvailable}},t.prototype.inBaseTraversal=function(e,r){return e.state.ancestorWithContent?e.parent&&e.state.screenSpaceError===0?e.parent.state.screenSpaceError>r:e.state.screenSpaceError>r:!0},t.prototype.traverseAndSelect=function(e,r){var i=this._selectionTraversalStack,a=this._selectionTraversalancestorStack,o;for(i.push(e);i.length>0||a.length>0;){if(a.length>0){var s=a.peek();if(s.state.stackLength===i.length){a.pop(),s!==o&&(s.state.finalResolution=!1),this.selectTile(s,r);continue}}var l=i.pop();if(l){var u=this.canTraverse(l,r);if(l.state.shouldSelect)if(l.refine==="ADD")this.selectTile(l,r);else{if(l.state.selectionDepth=a.length,l.state.selectionDepth>0&&(l.tileset.hasMixedContent=!0),o=l,!u){this.selectTile(l,r);continue}a.push(l),l.state.stackLength=i.length}if(u)for(var c=0,f=l.children;c<f.length;c++){var m=f[c];m.state.visible&&i.push(m)}}}},t}(Ao),Ud=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new qr,r}return t.prototype.canTraverse=function(e,r){return!(e.levelOfContent>=r.maxLevelOfDetail||e.children.length===0)},t.prototype.traverse=function(e,r,i){n.prototype.traverse.call(this,e,r,[]),this._traversalStack.reset(),e.updateState(r);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,e.updateState(s),this.executeTraversal(e,s))}this._traversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,e.updateState(r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(i.push(e);i.length>0;){var a=i.pop(),o=a.refine==="ADD",s=a.refine==="REPLACE",l=this.canTraverse(a,r);l&&this.updateAndPushChildren(a,r,i),(o||s&&!l)&&(this.loadTile(a,r),this.touchTile(a,r),this.selectDesiredTile(a,r))}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0;o<a.length;++o){var s=a[o];s.updateState(r),s.state.visible&&i.push(s)}},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t}(Ao),cs=[5635925,5592575,16733525],X0=function(){function n(t,e,r){var i;this.index=t,this.name=e.name,this.visible=!1,this.tileset=r,this.transform=new d.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.transform.premultiply(this.tileset.root.transform),this.content={uri:e.file,color:new d.Color((i=e.color)!==null&&i!==void 0?i:cs[t%cs.length]),byteLength:0,loadState:"UNLOADED",loadStateUpdateTime:he(),loadfailRetryDelay:0,data:void 0}}return n}(),qd=new d.Matrix4,br=function(){function n(t,e,r){var i=this,a,o,s,l,u,c,f,m,A;if(this.id=t,this.transform=new d.Matrix4,this.transformIsIdentity=!0,this.hasMixedContent=!1,this.url=(a=r.url)!==null&&a!==void 0?a:"",this.referer=(o=r.referer)!==null&&o!==void 0?o:"",this.asset={version:e.asset.version,tilesetVersion:e.asset.tilesetVersion||"",gltfUpAxis:(s=e.asset.gltfUpAxis)!==null&&s!==void 0?s:"Y",overview:e.asset.overview,trajectories:(u=(l=e.asset.trajectories)===null||l===void 0?void 0:l.list)!==null&&u!==void 0?u:[]},this.rootMeta=(c=e.rootMeta)!==null&&c!==void 0?c:{},this.pointLength=(f=this.rootMeta.numTotalPoints)!==null&&f!==void 0?f:1/0,this.floorLength=(m=this.rootMeta.numFloors)!==null&&m!==void 0?m:1,this.properties=(A=e.properties)!==null&&A!==void 0?A:{},this.options=r,this.maxMemoryUsage=n.DEFAULT_MAX_MEMORY_USAGE,this.maxScreenSpaceError=n.DEFAULT_MAX_SCREEN_SPACE_ERROR,this.skipLevelOfDetail=n.DEFAULT_SKIP_LEVEL_OF_DETAIL,this.mostDetail=n.DEFAULT_MOST_DETAIL,this.loadSiblings=n.DEFAULT_LOAD_SIBLINGS,this.loadAll=n.DEFAULT_LOAD_ALL,this.maxRequests=n.DEFAULT_MAX_REQUESTS,this.tileRequestOrder=n.DEFAULT_REQUEST_ORDER,this.requestedTiles=[],this.selectedTiles=[],this.unloadTiles=[],this.needsRefinedTiles=new Set,this.selectedTrajectories=[],this.normalTraverser=new zd(this),this.skipTraverser=new Qd(this),this.mostDetailTraverser=new Ud(this),this.cache=new J0({onTileLoad:function(g){i.memoryUsageInBytes+=g.contentByteLength},onTileUnload:function(g){i.memoryUsageInBytes-=g.contentByteLength,i.unloadTiles.push(g)}}),this.requestScheduler=new _0(this,{onTileSkip:function(g){},onTileLoad:function(g){var v;!((v=g.content)===null||v===void 0)&&v.data&&(i.loadedTiles.add(g),i.cache.loadTile(g)),i.options.onTileLoad(g)},onTileError:function(g,v){i.options.onTileError(g,v)}}),this.frameNumber=0,this.maxLevelOfDetail=0,this.minLevelOfDetail=0,this.loadedTiles=new Set,this.memoryUsageInBytes=0,this.root=new mo("".concat(this.id,".0"),e.root,this),this.geometricError=e.geometricError,this.trajectories=[],this.asset.trajectories)for(var h=0;h<this.asset.trajectories.length;h++){var p=new X0(h,this.asset.trajectories[h],this);this.trajectories.push(p)}}return Object.defineProperty(n.prototype,"traverser",{get:function(){return this.mostDetail?this.mostDetailTraverser:this.skipLevelOfDetail?this.skipTraverser:this.normalTraverser},enumerable:!1,configurable:!0}),n.prototype.reset=function(){for(var t=this,e=[this.root],r;r=e.pop();){for(var i=0,a=r.children.length;i<a;i++)e.push(r.children[i]);this.cache.unloadTile(r)}for(var o=function(){var c=s.unloadTiles.pop();c&&(s.loadedTiles.delete(c),s.memoryUsageInBytes-=c.contentByteLength,s.options.tileUnloader(c).catch(function(){}).then(function(){t.options.onTileUnload&&t.options.onTileUnload(c)}))},s=this;this.unloadTiles.length;)o();this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.loadedTiles.clear();for(var l=function(){var c=u.trajectories.pop();c&&u.options.trajectoryUnloader(c).catch(function(){}).then(function(){t.options.onTrajectoryUnload&&t.options.onTrajectoryUnload(c)})},u=this;this.trajectories.length;)l()},n.prototype.update=function(t,e){var r=this,i;e===void 0&&(e=[]),this.frameNumber=t.frameNumber,this.minLevelOfDetail=t.minLevelOfDetail,this.maxLevelOfDetail=t.maxLevelOfDetail,this.transformIsIdentity=this.transform.equals(qd),this.traverser.traverse(this.root,t,e),this.cache.unloadTiles(function(){var m=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return m}),this.requestScheduler.update(this.requestedTiles,this.tileRequestOrder,t);for(var a=function(){var m=o.unloadTiles.pop();m&&(o.loadedTiles.delete(m),o.options.tileUnloader(m).catch(function(){}).then(function(){r.options.onTileUnload&&r.options.onTileUnload(m)}))},o=this;this.unloadTiles.length;)a();this.selectedTrajectories.length=0;for(var s=function(m){m.visible===!0&&m.content.loadState==="READY"&&(!((i=m.content.data)===null||i===void 0)&&i.object)?l.selectedTrajectories.push(m):m.visible===!0&&(m.content.loadState==="FAILED"&&t.time-m.content.loadStateUpdateTime>m.content.loadfailRetryDelay&&(m.content.loadState="UNLOADED",m.content.loadStateUpdateTime=t.time),m.content.loadState==="UNLOADED"&&l.options.trajectoryLoader(m).then(function(){r.options.onTrajectoryLoad(m)}).catch(function(A){r.options.onTrajectoryError(m,A)}))},l=this,u=0,c=this.trajectories;u<c.length;u++){var f=c[u];s(f)}},n.DEFAULT_MAX_MEMORY_USAGE=16,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=4,n.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,n.DEFAULT_MOST_DETAIL=!1,n.DEFAULT_LOAD_SIBLINGS=!1,n.DEFAULT_LOAD_ALL=!1,n.DEFAULT_MAX_REQUESTS=6,n.DEFAULT_REQUEST_ORDER="SCREEN_SPACE_ERROR",n}(),W0=function(){function n(t,e){this.position=t,this.indices=e}return n.prototype.getPositionCount=function(){var t,e,r=this.indices,i=this.position;return r?r.array.length/((t=r.stride)!==null&&t!==void 0?t:1):i.array.length/((e=i.stride)!==null&&e!==void 0?e:3)},n.prototype.getPositionByIndex=function(t,e){var r,i,a,o,s=this.indices,l=this.position,u=t;if(s){var c=s.array,f=(r=s.stride)!==null&&r!==void 0?r:1,m=(i=s.offset)!==null&&i!==void 0?i:0;u=c[t*f+m]}var A=l.array,h=(a=l.stride)!==null&&a!==void 0?a:3,p=(o=l.offset)!==null&&o!==void 0?o:0;return u=u*h+p,e.x=A[u],e.y=A[u+1],e.z=A[u+2],e},n.prototype.createTree=function(t,e,r){throw new Error("not implemented")},n.prototype.trianglesInSphere=function(t,e){throw new Error("not implemented")},n.prototype.intersectRay=function(t,e,r,i){throw new Error("not implemented")},n}(),Cn=function(){function n(t,e,r,i,a){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=a}return n}(),Er=6*4+4+4+2+2;function Z0(n,t){for(var e=new ArrayBuffer(t*Er),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,l;s=o.pop();)l=s.id*Er/4,r[l]=s.extents[0],r[l+1]=s.extents[1],r[l+2]=s.extents[2],r[l+3]=s.extents[3],r[l+4]=s.extents[4],r[l+5]=s.extents[5],i[l+6]=s.startIndex,i[l+7]=s.endIndex,l=s.id*Er/2,s.node0&&(a[l+16]=s.node0.id,o.push(s.node0)),s.node1&&(a[l+17]=s.node1.id,o.push(s.node1));return e}function Y0(n,t,e,r,i,a,o,s,l){l===void 0&&(l=0),e=e-l,r=r-l,i=i-l,a=a+l,o=o+l,s=s+l;var u=0,c=0,f=0,m=0,A=0,h=0;return t.x>=0?(u=(e-n.x)*t.x,c=(a-n.x)*t.x):(u=(a-n.x)*t.x,c=(e-n.x)*t.x),t.y>=0?(f=(r-n.y)*t.y,m=(o-n.y)*t.y):(f=(o-n.y)*t.y,m=(r-n.y)*t.y),!(u>m||f>c||(f>u&&(u=f),m<c&&(c=m),t.z>=0?(A=(i-n.z)*t.z,h=(s-n.z)*t.z):(A=(s-n.z)*t.z,h=(i-n.z)*t.z),u>h||A>c)||(A>u&&(u=A),h<c&&(c=h),c<0))}var dn=function(){function n(t,e,r){this.x=t,this.y=e,this.z=r}return n.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.prototype.set=function(t,e,r){return this.x=t,this.y=e,this.z=r,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},n.prototype.toArray=function(t,e){return t===void 0&&(t=[]),e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},n.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},n.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},n.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.prototype.cross=function(t){var e=this.x,r=this.y,i=this.z;return this.x=r*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-r*t.x,this},n.prototype.crossVectors=function(t,e){var r=t.x,i=t.y,a=t.z,o=e.x,s=e.y,l=e.z;return this.x=i*l-a*s,this.y=a*o-r*l,this.z=r*s-i*o,this},n.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.prototype.distanceToSquared=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i},n.prototype.clone=function(){return new n(this.x,this.y,this.z)},n}(),$0=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),ds=1e-6,Ue=new dn(0,0,0),Lr=new dn(0,0,0),Or=new dn(0,0,0),Vr=new dn(0,0,0),eu=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionCount()/3,o=a>65535?new Uint32Array(a):new Uint16Array(a),s=new Float32Array(a*6),l=[],u=0,c=-1;if(i)for(var f=0,m=0,A=0,h=void 0,p=void 0,g=void 0,v=void 0,y=void 0,b=void 0,x=void 0;f<a;f+=1,m+=3,A+=6)o[f]=f,this.getPositionByIndex(m,Lr),this.getPositionByIndex(m+1,Or),this.getPositionByIndex(m+2,Vr),h=v=Lr.x,x=Or.x,x<h&&(h=x),x>v&&(v=x),x=Vr.x,x<h&&(h=x),x>v&&(v=x),p=y=Lr.y,x=Or.y,x<p&&(p=x),x>y&&(y=x),x=Vr.y,x<p&&(p=x),x>y&&(y=x),g=b=Lr.z,x=Or.z,x<g&&(g=x),x>b&&(b=x),x=Vr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=p,s[A+2]=g,s[A+3]=v,s[A+4]=y,s[A+5]=b;else{for(var w=1/0,E=1/0,C=1/0,M=-1/0,R=-1/0,L=-1/0,f=0,m=0,A=0,h=void 0,p=void 0,g=void 0,v=void 0,y=void 0,b=void 0,x=void 0;f<a;f+=1,m+=3,A+=6)o[f]=f,this.getPositionByIndex(m,Lr),this.getPositionByIndex(m+1,Or),this.getPositionByIndex(m+2,Vr),h=v=Lr.x,x=Or.x,x<h&&(h=x),x>v&&(v=x),x=Vr.x,x<h&&(h=x),x>v&&(v=x),p=y=Lr.y,x=Or.y,x<p&&(p=x),x>y&&(y=x),x=Vr.y,x<p&&(p=x),x>y&&(y=x),g=b=Lr.z,x=Or.z,x<g&&(g=x),x>b&&(b=x),x=Vr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=p,s[A+2]=g,s[A+3]=v,s[A+4]=y,s[A+5]=b,h<w&&(w=h),v>M&&(M=v),p<E&&(E=p),y>R&&(R=y),g<C&&(C=g),b>L&&(L=b);i=[w,E,C,M,R,L]}var S=new Cn(++c,i,0,a,0);l[u++]=S;var I=[],O=[0,1,2],P=function(V,D){return I[D]-I[V]};function F(V){var D=V.startIndex,z=V.endIndex,U=V.extents;I[0]=U[3]-U[0],I[1]=U[4]-U[1],I[2]=U[5]-U[2],O.sort(P);for(var q=0;q<3;q++){for(var K=O[q],j=U[K]+U[K+3],J=D,X=z-1,Y=-1,W=void 0;J<=X;)Y===-1?(W=o[J],s[W*6+K]+s[W*6+K+3]<j?J++:Y=W):(W=o[X],s[W*6+K]+s[W*6+K+3]>=j||(o[J]=W,o[X]=Y,Y=-1,J++),X--);if(J>D&&J<z){var ee=new Cn(++c,fs(o,s,D,J,ds),D,J,V.deepth+1);ee.deepth<r&&ee.endIndex-ee.startIndex>e&&(l[u++]=ee);var Z=new Cn(++c,fs(o,s,J,z,ds),J,z,V.deepth+1);Z.deepth<r&&Z.endIndex-Z.startIndex>e&&(l[u++]=Z),V.node0=ee,V.node1=Z,V.startIndex=0,V.endIndex=0;break}}}for(;u;)F(l[--u]);return this.offsetArray=o,this.rootNodePacked=Z0(S,c+1),l.length=0,this},t.prototype.trianglesInSphere=function(e,r){for(var i=this.offsetArray,a=this.rootNodePacked,o=new Float32Array(a),s=new Uint32Array(a),l=new Uint16Array(a),u=[0],c=[],f,m,A,h;(f=u.pop())!==void 0;){h=f*Er/4;var p=ua(e.x,o[h],o[h+3])-e.x,g=ua(e.y,o[h+1],o[h+4])-e.y,v=ua(e.z,o[h+2],o[h+5])-e.z;if(p*p+g*g+v*v<=r*r){for(var y=s[h+6];y<s[h+7];y++)c.push(i[y]);h=f*Er/2,m=l[h+16],A=l[h+17],m&&u.push(m),A&&u.push(A)}}for(var b=c.length,x=new Float32Array(b*9),y=0;y<b;y++){var w=c[y];this.getPositionByIndex(w,Ue),x[y*9]=Ue.x,x[y*9+1]=Ue.y,x[y*9+2]=Ue.z,this.getPositionByIndex(w+1,Ue),x[y*9+3]=Ue.x,x[y*9+4]=Ue.y,x[y*9+5]=Ue.z,this.getPositionByIndex(w+2,Ue),x[y*9+6]=Ue.x,x[y*9+7]=Ue.y,x[y*9+8]=Ue.z}return x},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,l=new Float32Array(s),u=new Uint32Array(s),c=new Uint16Array(s),f=new dn(1/r.x,1/r.y,1/r.z),m=[0],A,h,p,g;(A=m.pop())!==void 0;)if(g=A*Er/4,Y0(e,f,l[g],l[g+1],l[g+2],l[g+3],l[g+4],l[g+5])){for(var v=u[g+6],y=u[g+7],b=void 0,x=void 0,w=void 0,E=e.x,C=e.y,M=e.z,R=r.x,L=r.y,S=r.z,I=void 0,O=void 0,P=void 0,F=void 0,V=void 0,D=void 0,z=void 0,U=void 0,q=void 0,K=void 0,j=void 0,J=void 0,X=void 0,Y=void 0,W=void 0,ee=void 0,Z=void 0,ie=void 0,te=void 0,le=void 0,oe=void 0,we=void 0,pe=void 0,ge=void 0,Re=void 0,Se=void 0,Te=void 0;v<y;v++){if(b=o[v],x=b*3,this.getPositionByIndex(x,Ue),I=Ue.x,O=Ue.y,P=Ue.z,this.getPositionByIndex(x+1,Ue),F=Ue.x,V=Ue.y,D=Ue.z,this.getPositionByIndex(x+2,Ue),z=Ue.x,U=Ue.y,q=Ue.z,K=F-I,j=V-O,J=D-P,X=z-I,Y=U-O,W=q-P,ee=j*W-J*Y,Z=J*X-K*W,ie=K*Y-j*X,pe=R*ee+L*Z+S*ie,pe>0)we=1;else if(pe<0)we=-1,pe=-pe;else continue;te=E-I,le=C-O,oe=M-P,ge=we*(R*(le*W-oe*Y)+L*(oe*X-te*W)+S*(te*Y-le*X)),!(ge<0)&&(Re=we*(R*(j*oe-J*le)+L*(J*te-K*oe)+S*(K*le-j*te)),!(Re<0)&&(ge+Re>pe||(Se=-we*(te*ee+le*Z+oe*ie),!(Se<0)&&(Te=Se/pe,a.push(new $0([I,O,P,F,V,D,z,U,q],[E+R*Te,C+L*Te,M+S*Te],b))))))}g=A*Er/2,h=c[g+16],p=c[g+17],h&&m.push(h),p&&m.push(p)}return a},t}(W0);function ua(n,t,e){return n<t?t:n>e?e:n}function fs(n,t,e,r,i){if(e>=r)return[0,0,0,0,0,0];for(var a=1/0,o=1/0,s=1/0,l=-1/0,u=-1/0,c=-1/0,f=e,m=void 0,A=void 0;f<r;f++)m=n[f]*6,A=t[m],A<a&&(a=A),A=t[m+1],A<o&&(o=A),A=t[m+2],A<s&&(s=A),A=t[m+3],A>l&&(l=A),A=t[m+4],A>u&&(u=A),A=t[m+5],A>c&&(c=A);return[a-i,o-i,s-i,l+i,u+i,c+i]}var hs=1e-6,Hd=["x","y","z"],ut=new dn(0,0,0),tu=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionByIndex.bind(this),o=this.getPositionCount(),s=o>65535?new Uint32Array(o):new Uint16Array(o),l=[],u=0,c=-1;if(i)for(var f=0;f<o;f+=1)s[f]=f;else{a(0,ut);for(var m=ut.x,A=ut.y,h=ut.z,p=m,g=A,v=h,f=0,y=void 0,b=void 0,x=void 0;f<o;f+=1)s[f]=f,a(f,ut),y=ut.x,b=ut.y,x=ut.z,y<m?m=y:y>p&&(p=y),b<A?A=b:b>g&&(g=b),x<h?h=x:x>v&&(v=x);i=[m,A,h,p,g,v]}var w=new Cn(++c,i,0,o,0);l[u++]=w;var E=[],C=[0,1,2],M=function(L,S){return E[S]-E[L]};function R(L){var S=L.startIndex,I=L.endIndex,O=L.extents;E[0]=O[3]-O[0],E[1]=O[4]-O[1],E[2]=O[5]-O[2];for(var P=C.sort(M)[0],F=Hd[P],V=(O[P]+O[P+3])/2,D=S,z=I-1,U=-1,q;D<=z;)U===-1?(q=s[D],a(q,ut),ut[F]<V?D++:U=q):(q=s[z],a(q,ut),ut[F]>=V||(s[D]=q,s[z]=U,U=-1,D++),z--);if(D>S){var K=O.slice();K[P+3]=V+hs;var j=new Cn(++c,K,S,D,L.deepth+1);j.deepth<r&&j.endIndex-j.startIndex>e&&(l[u++]=j),L.node0=j}if(I>D){var J=O.slice();J[P]=V-hs;var X=new Cn(++c,J,D,I,L.deepth+1);X.deepth<r&&X.endIndex-X.startIndex>e&&(l[u++]=X),L.node1=X}L.startIndex=0,L.endIndex=0}for(;u;)R(l[--u]);return this.offsetArray=s,this.rootNodePacked=Z0(w,c+1),l.length=0,this},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,l=new Float32Array(s),u=new Uint32Array(s),c=new Uint16Array(s),f=i*i,m=new dn(1/r.x,1/r.y,1/r.z),A=[0],h,p,g,v;(h=A.pop())!==void 0;)if(v=h*Er/4,Y0(e,m,l[v],l[v+1],l[v+2],l[v+3],l[v+4],l[v+5],i)){for(var y=u[v+6],b=u[v+7],x=void 0,w=void 0,E=void 0,C=void 0,M=void 0,R=void 0,L=void 0,S=void 0,I=void 0,O=void 0,P=void 0,F=void 0;y<b;y++)x=o[y],this.getPositionByIndex(x,ut),w=ut.x,E=ut.y,C=ut.z,M=e.x,R=e.y,L=e.z,S=r.x,I=r.y,O=r.z,P=S*(w-M)+I*(E-R)+O*(C-L),P>0&&(M+=S*P,R+=I*P,L+=O*P),S=w-M,I=E-R,O=C-L,P=S*S+I*I+O*O,P<=f&&a.push(new $0([w,E,C,w,E,C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1dGVzLnBvc2l0aW9uLHYuaW5kaWNlcyk7ZWxzZSB0aHJvdyBuZXcgRXJyb3IoIkludmFsaWQgVHlwZSIpO24uY3JlYXRlVHJlZSh2Lm1heEl0ZW1QZXJOb2RlLHYubWF4VHJlZURlcHRoLHYuZXh0ZW50cyk7dmFyIHM9e3R5cGU6di50eXBlLGF0dHJpYnV0ZXM6di5hdHRyaWJ1dGVzLGluZGljZXM6di5pbmRpY2VzLG9mZnNldEFycmF5Om4ub2Zmc2V0QXJyYXkscm9vdE5vZGVQYWNrZWQ6bi5yb290Tm9kZVBhY2tlZH07dC5wdXNoKHMpO3ZhciB1PXZvaWQgMDtmb3IodmFyIHcgaW4gcy5hdHRyaWJ1dGVzKXt2YXIgeT1zLmF0dHJpYnV0ZXNbd107eSYmeS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQoeS5idWZmZXIpfXU9cy5pbmRpY2VzLHUmJnUuYnVmZmVyIGluc3RhbmNlb2YgQXJyYXlCdWZmZXImJm8uYWRkKHUuYnVmZmVyKSx1PXMub2Zmc2V0QXJyYXksdSYmdS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmby5hZGQodS5idWZmZXIpLG8uYWRkKHMucm9vdE5vZGVQYWNrZWQpfXJldHVybntvdXRwdXQ6dCx0cmFuc2ZlcjpBcnJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",Gd=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),ps=typeof self!="undefined"&&self.Blob&&new Blob([Gd(ru)],{type:"text/javascript;charset=utf-8"});function Kd(n){let t;try{if(t=ps&&(self.URL||self.webkitURL).createObjectURL(ps),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+ru,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var nu=function(){function n(t,e){this.pool=e,this.workerCreator=t,this.queue=[],this.workers=[],this.workersResolver=[],this.workerStatus=0}return n.prototype.initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this.onMessage.bind(this,t)),this.workers[t]=e}},n.prototype.getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype.onMessage=function(t,e){var r=this.workersResolver[t],i=r.resolve,a=r.reject;if(e.data&&"$$error"in e.data?a(e.data.$$error):i(e.data),this.queue.length){var o=this.queue.shift(),s=o.resolve,l=o.reject,u=o.input,c=o.transfer;this.workersResolver[t]={resolve:s,reject:l},this.workers[t].postMessage(u,c)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,a){var o=r.getIdleWorker();o!==-1?(r.initWorker(o),r.workerStatus|=1<<o,r.workersResolver[o]={resolve:i,reject:a},r.workers[o].postMessage(t,e)):r.queue.push({resolve:i,reject:a,input:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolver.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),jd=new nu(function(){return new Kd},4),_d=new Map,Mn=new d.Ray,vs=new d.Matrix3,Gn=new d.Matrix4,iu=new d.Vector3,Jd=new d.Vector3,Xd=new d.Vector3,Wd=new d.Triangle;function Zd(n,t,e,r){var i,a=n.matrixWorld;Gn.getInverse(a),Mn.copy(e.ray).applyMatrix4(Gn);for(var o=t.intersectRay(Mn.origin,Mn.direction,0,[]),s=n.geometry,l=n.material,u=s.groups,c=s.index,f=0,m=o.length;f<m;f++){var A=o[f],h=A.triangle,p=A.index,g=A.intersectionPoint,v=new d.Vector3(g[0],g[1],g[2]).applyMatrix4(a),y=e.ray.origin.distanceTo(v);if(!(y<e.near||y>e.far)){var b=void 0;if(Array.isArray(l)){if(u)for(var x=p*3,w=0,E=u;w<E.length;w++){var C=E[w];if(x>=C.start&&x-C.start<C.count){b=l[(i=C.materialIndex)!==null&&i!==void 0?i:0];break}}}else b=l;if(b){var M=Wd.set(iu.set(h[0],h[1],h[2]).applyMatrix4(a),Jd.set(h[3],h[4],h[5]).applyMatrix4(a),Xd.set(h[6],h[7],h[8]).applyMatrix4(a)).getNormal(new d.Vector3),R=p*3,L=new d.Face3(c?c.array[R]:R,c?c.array[R+1]:R+1,c?c.array[R+2]:R+2,M),S=e.ray.direction.dot(M);b.side===d.FrontSide&&S>=0||b.side===d.BackSide&&S<=0||r.push({distance:y,object:n,face:L,point:v,distanceToRay:0,faceIndex:p})}}}}function Yd(n,t,e,r){var i,a,o=n.matrixWorld;vs.getNormalMatrix(o),Gn.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*Gn.getMaxScaleOnAxis();Mn.copy(e.ray).applyMatrix4(Gn);for(var l=t.intersectRay(Mn.origin,Mn.direction,s,[]),u=n.geometry,c=u.index,f=u.getAttribute("normal"),m=0,A=l.length;m<A;m++){var h=l[m],p=h.triangle,g=h.index,v=h.intersectionPoint,y=new d.Vector3(v[0],v[1],v[2]).applyMatrix4(o),b=e.ray.origin.distanceTo(y);if(!(b<e.near||b>e.far)){var x=iu.set(p[0],p[1],p[2]).applyMatrix4(o),w=c?c.array[g]:g,E=void 0;if(f instanceof d.BufferAttribute){var C=new d.Vector3().fromBufferAttribute(f,w).applyNormalMatrix(vs);E=new d.Face3(w,w,w,C)}r.push({distance:b,object:n,face:E,point:y,distanceToRay:y.distanceTo(x),index:g})}}}var au="__bvh_mesh__",$d=d.Mesh.prototype.raycast;function ef(n,t){var e=tf(this);e?Zd(this,e,n,t):$d.call(this,n,t)}function tf(n){var t=n[au];return t instanceof eu,t}function rf(n,t){var e;Object.assign(n,(e={},e[au]=t,e.raycast=ef,e))}var ou="__bvh_points__",nf=d.Points.prototype.raycast;function af(n,t){var e=of(this);e?Yd(this,e,n,t):nf.call(this,n,t)}function of(n){var t=n[ou];return t instanceof tu,t}function sf(n,t){var e;Object.assign(n,(e={},e[ou]=t,e.raycast=af,e))}function uf(n,t,e,r){var i=[];return n.traverse(function(a){(a instanceof d.Mesh||a instanceof d.Points)&&a.geometry instanceof d.BufferGeometry&&i.push(a)}),Promise.resolve().then(function(){for(var a=[],o=new Set,s=null,l=0;l<i.length;l++){var u=i[l],c=u.geometry;if(c instanceof d.BufferGeometry){var f=void 0;if(u instanceof d.Mesh?f="mesh":u instanceof d.Points&&(f="points"),!!f){var m=c.boundingBox,A=m?[m.min.x,m.min.y,m.min.z,m.max.x,m.max.y,m.max.z]:void 0,h={};for(var p in c.attributes){var g=c.attributes[p];g instanceof d.InterleavedBufferAttribute?(h[p]={array:g.data.array,stride:g.data.stride,offset:g.offset},s=g.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(h[p]={array:g.array},s=g.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer))}var v=void 0,y=c.getIndex();y&&(y instanceof d.InterleavedBufferAttribute?(v={array:y.data.array,stride:y.data.stride,offset:y.offset},s=y.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(v={array:y.array},s=y.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)));var b={type:f,attributes:h,indices:v,maxItemPerNode:e,maxTreeDepth:r,extents:A};a.push(b)}}}return jd.postMessage(a,Array.from(o))}).then(function(a){for(var o=0;o<i.length;o++){var s=i[o],l=s.geometry,u=a[o];if(l instanceof d.BufferGeometry){for(var c in u.attributes){var f=u.attributes[c].array,m=l.attributes[c];m instanceof d.InterleavedBufferAttribute?m.data.array=f:m.array=f}var A=l.getIndex();if(A&&u.indices){var f=u.indices.array;A instanceof d.InterleavedBufferAttribute?A.data.array=f:A.array=f}if(s instanceof d.Mesh){var h=new eu(u.attributes.position,u.indices);h.offsetArray=u.offsetArray,h.rootNodePacked=u.rootNodePacked,rf(s,h)}else if(s instanceof d.Points){var h=new tu(u.attributes.position,u.indices);h.offsetArray=u.offsetArray,h.rootNodePacked=u.rootNodePacked,sf(s,h)}}}return n})}var su=function(n){se(t,n);function t(e,r,i){i===void 0&&(i=Q);var a=n.call(this)||this;return a.contentObject=r,a.disposer=i,a.name=e,a.materials=[],a.pbmObjects=[],a.disposers=[i],a.add(r),r.traverse(function(o){var s;if(o instanceof d.Mesh||o instanceof d.Points){var l=o.material;Array.isArray(l)?(s=a.materials).push.apply(s,l):a.materials.push(l)}(o instanceof Tt||o instanceof er)&&a.pbmObjects.push(o)}),a}return t.prototype.generateBvhTree=function(){return uf(this,!0,200,10)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var a=this.children.slice(),o,s=[];o=a.pop();)if(o.visible){o.raycast(e,s);for(var l=0,u=o.children.length;l<u;l++)a.push(o.children[l])}return s.forEach(function(c){var f=0;if((c.object instanceof Tt||c.object instanceof er)&&c.face){var m=Array.isArray(c.object.material)?c.object.material[c.face.materialIndex]:c.object.material;m&&(f=m.floor)}c.floor=f}),r&&s.sort(function(c,f){return c.distance-f.distance}),i.push.apply(i,s),i},t.prototype.update=function(e,r,i,a){for(var o=0,s=this.pbmObjects;o<s.length;o++){var l=s[o];l.update(e,r,i,a)}},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0,this.pbmObjects.length=0},t.prototype.clone=function(){return new t(this.name,this.contentObject,this.disposer)},t}(d.Object3D);function at(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(s!=null?s:"").trim()}).filter(function(s){return s.length>0&&!/^\/+$/.test(s)});for(var r=0;r<n.length;r++){var i=r===0,a=r===n.length-1,o=n[r];i||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),a||(o=o.replace(/\/+$/,"")),e.push(o)}return e.join("/")}function wi(n){var t,e=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);if(!e)return n;var r=e[1]||"",i=n.slice(r.length+2),a=i.indexOf("#");a>=0&&(n.slice(a),i=n.slice(0,a));var o=i.indexOf("?");o>=0&&(n.slice(o),i=n.slice(0,o));for(var s=i.split("/"),l=s.shift(),u=(t=s.pop())!==null&&t!==void 0?t:"",c=[],f=0,m=s;f<m.length;f++){var A=m[f];if(!(A===""||A===".")){if(A===".."){c.pop();continue}c.push(A)}}return r+"//"+l+"/"+c.join("/")+"/"+u}function Cr(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function uu(n,t,e){if(n.content&&n.content.uri&&(Cr(n.content.uri)||(n.content.uri=wi(at(t,n.content.uri)))),n.transform){for(var r=!1,i=0;i<16;i++){var a=n.transform[i];if(typeof a!="number"||isNaN(a)||!isFinite(a)){r=!0;break}}if(n.transform[15]===0&&(r=!0),r)throw new Error("Invalid Tile Transform: "+JSON.stringify(n.transform))}if(n.children)for(var o=0,s=n.children;o<s.length;o++){var l=s[o];uu(l,t)}return n}function Ei(n,t){if(n.asset||(n.asset={}),n.rootMeta||(n.rootMeta={}),n.asset.overview){var e=n.asset.overview;Cr(e.imageFile)||(e.imageFile=wi(at(t,e.imageFile))),Cr(e.worldFile)||(e.worldFile=wi(at(t,e.worldFile)))}if(n.asset.trajectories)for(var r=0;r<n.asset.trajectories.list.length;r++){var i=n.asset.trajectories.list[r];i.file=wi(at(t,i.file))}return uu(n.root,t),n}function lf(n,t,e){for(var r,i,a=Promise.resolve(),o=n.slice(),s=function(){for(var l=[],u=0,c=void 0;c=o.shift();){l.push(c);var f=((r=c.image)===null||r===void 0?void 0:r.width)*((i=c.image)===null||i===void 0?void 0:i.height);if(!isNaN(f)&&isFinite(f)&&(u+=f),u>=e)break}a=a.then(function(){return new Promise(function(m){dt.shared.add(function(){for(var A=0,h=l;A<h.length;A++){var p=h[A];t.initTexture(p)}m()},!0)})}).catch(function(){})};o.length>0;)s();return a}function go(n,t){if(t===void 0&&(t=""),(t[0]==="?"||t[0]==="&")&&(t=t.slice(1)),!t)return n;var e=n.indexOf("#"),r="";return e>=0&&(r=n.slice(e),n=n.slice(0,e)),(n[n.length-1]==="?"||n[n.length-1]==="&")&&(n=n.slice(0,-1)),n.indexOf("?")>=0?"".concat(n,"&").concat(t).concat(r):"".concat(n,"?").concat(t).concat(r)}var la=4;function lu(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=la,n.version=r.getUint32(e,!0),e+=la,n.byteLength=r.getUint32(e,!0),e+=la,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var sr,We;(function(n){n[n.BYTE=5120]="BYTE",n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.SHORT=5122]="SHORT",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.INT=5124]="INT",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.FLOAT=5126]="FLOAT",n[n.DOUBLE=5130]="DOUBLE"})(We||(We={}));var cf=(sr={},sr[We.DOUBLE]=Float64Array,sr[We.FLOAT]=Float32Array,sr[We.UNSIGNED_SHORT]=Uint16Array,sr[We.UNSIGNED_INT]=Uint32Array,sr[We.UNSIGNED_BYTE]=Uint8Array,sr[We.BYTE]=Int8Array,sr[We.SHORT]=Int16Array,sr[We.INT]=Int32Array,sr),df={DOUBLE:We.DOUBLE,FLOAT:We.FLOAT,UNSIGNED_SHORT:We.UNSIGNED_SHORT,UNSIGNED_INT:We.UNSIGNED_INT,UNSIGNED_BYTE:We.UNSIGNED_BYTE,BYTE:We.BYTE,SHORT:We.SHORT,INT:We.INT};function ki(n){var t=cf[n];if(!t)throw new Error("Failed to convert GL type");return t}function ca(n){var t=ki(n);return t.BYTES_PER_ELEMENT}function ms(n,t,e,r){e===void 0&&(e=0);var i=ki(n);if(e%ca(n)!==0){var a=r?t.slice(e,e+r*ca(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/ca(n))}function ff(n){var t=df[n];if(!t)throw new Error("Failed to convert GL type");return t}var cu=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",We.UNSIGNED_INT,1);r&&r.length&&(this.featuresLength=r[0])}return n.prototype.getExtension=function(t){return this.json.extensions&&this.json.extensions[t]},n.prototype.hasProperty=function(t){return!!this.json[t]},n.prototype.getGlobalProperty=function(t,e,r){var i=this.json[t];if(typeof i=="number"){var a=ki(e);return new a([i])}else if(Array.isArray(i)){var a=ki(e);return new a(i)}else if(i&&Number.isFinite(i.byteOffset))return this.getTypedArrayFromBinary(t,e,r,1,i.byteOffset);return null},n.prototype.getPropertyArray=function(t,e,r){var i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(e=ff(i.componentType)),this.getTypedArrayFromBinary(t,e,r,this.featuresLength,i.byteOffset)):this.getTypedArrayFromArray(t,e,i)},n.prototype.getProperty=function(t,e,r,i,a){var o=this.json[t];if(!o)return null;var s=this.getPropertyArray(t,e,r);if(r===1)return a[0]=s[i],a;for(var l=0;l<r;++l)a[l]=s[r*i+l];return a},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,a){var o=this.cachedTypedArrays,s=o[t];return s||(s=ms(e,this.buffer.buffer,this.buffer.byteOffset+a,i*r),o[t]=s),s},n.prototype.getTypedArrayFromArray=function(t,e,r){var i=this.cachedTypedArrays,a=i[t];return a||(a=ms(e,r),i[t]=a),a},n}(),yn=4,As="b3dm tile in legacy format.";function du(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function fu(n,t,e){return e=hf(n,t,e),e=pf(n,t,e),e=vf(n,t,e),e}function hf(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=yn;var o=r.getUint32(e,!0);e+=yn;var s=r.getUint32(e,!0);e+=yn;var l=r.getUint32(e,!0);return e+=yn,s>=570425344?(e-=yn*2,i=a,s=o,l=0,a=0,o=0,console.warn(As)):l>=570425344&&(e-=yn,i=s,s=a,l=o,a=0,o=0,console.warn(As)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=l,n.header.batchLength=i,e}function pf(n,t,e){var r=n.header||{},i=r.featureTableJsonByteLength,a=r.featureTableBinaryByteLength,o=r.batchLength;if(n.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){var s=du(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=[0,0,0];var l=new cu(n.featureTableJson,n.featureTableBinary);if(Array.isArray(l.json.RTC_CENTER)){var u=l.json.RTC_CENTER;n.rtcCenter[0]=u[0],n.rtcCenter[1]=u[1],n.rtcCenter[2]=u[2]}else{var u=l.getGlobalProperty("RTC_CENTER",We.FLOAT,3);u&&(n.rtcCenter[0]=u[0],n.rtcCenter[1]=u[1],n.rtcCenter[2]=u[2])}return e}function vf(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=du(t,e,i);n.batchTableJson=JSON.parse(o),e+=i,a&&a>0&&(n.batchTableBinary=new Uint8Array(t,e,a),n.batchTableBinary=new Uint8Array(n.batchTableBinary),e+=a)}return e}function mf(n,t,e){var r=e!==void 0?new Uint8Array(n).subarray(t,t+e):new Uint8Array(n).subarray(t),i=new Uint8Array(r);return i.buffer}function Af(n,t,e){var r=n.byteLength-e;if(r===0)throw new Error("glTF byte length must be greater than 0.");return e%4!==0&&console.warn("".concat(n.type,": embedded glb is not aligned to a 4-byte boundary.")),n.gltfArrayBuffer=mf(t,e,r),n.byteLength}function Ka(n){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(n);for(var t="",e=0,r=n.length;e<r;e++)t+=String.fromCharCode(n[e]);try{return decodeURIComponent(escape(t))}catch(i){return t}}var Oe={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Vn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Li={9728:d.NearestFilter,9729:d.LinearFilter,9984:d.NearestMipmapNearestFilter,9985:d.LinearMipmapNearestFilter,9986:d.NearestMipmapLinearFilter,9987:d.LinearMipmapLinearFilter},Oi={33071:d.ClampToEdgeWrapping,33648:d.MirroredRepeatWrapping,10497:d.RepeatWrapping},gs={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},kt={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Nr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},gf={CUBICSPLINE:void 0,LINEAR:d.InterpolateLinear,STEP:d.InterpolateDiscrete},yr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function vt(n){var t=[];for(var e in n)t.push(n[e]);return t}function yf(n){var t=Array.from(n);return function(){for(var e=0,r=t;e<r.length;e++){var i=r[e];typeof i.dispose=="function"&&i.dispose(),typeof i.close=="function"&&i.close()}}}var bf=function(){function n(t,e,r){this.json=t,this.extensions=e,this.options=r,this.cache=new Map,this.disposeSet=new Set,this.textureSet=new Set,this.nodeNamesUsed={}}return n.prototype.dispose=function(){this.cache.clear(),this.disposeSet.forEach(function(t){typeof t.dispose=="function"&&t.dispose(),typeof t.close=="function"&&t.close()}),this.disposeSet.clear(),this.textureSet.clear(),this.extensions={},this.json={asset:{version:"unknown"}}},n.prototype.markDefs=function(){for(var t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[],i=0,a=e.length;i<a;i++)for(var o=e[i].joints,s=0,l=o.length;s<l;s++)t[o[s]].isBone=!0;for(var u=0,c=t.length;u<c;u++){var f=t[u];f.mesh!==void 0&&f.skin!==void 0&&(r[f.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.markDefs();for(var i=0,a=vt(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(vt(r).map(function(s){return s.prepare(t)})).then(function(){var s,l,u;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(c,f){return t.loadScene(f)})),Promise.all(((l=e.animations)!==null&&l!==void 0?l:[]).map(function(c,f){return t.loadAnimation(f)})),Promise.all(((u=e.cameras)!==null&&u!==void 0?u:[]).map(function(c,f){return t.loadCamera(f)}))])}).then(function(s){var l=s[0],u=s[1],c=s[2],f={json:e,scene:l[e.scene||0],scenes:l,animations:u,cameras:c,textures:[],dispose:Q};return f}).then(function(s){return Promise.all(vt(r).map(function(l){return l.emitResult(s,t)})).then(function(){return s})}).then(function(s){var l=Array.from(t.textureSet),u=yf(t.disposeSet);return Object.assign(s,{textures:l,dispose:u}),t.textureSet.clear(),t.disposeSet.clear(),t.dispose(),s})},n.prototype.loadCamera=function(t){var e="camera:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=vt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var l=void 0,u=this.json.cameras[t],c=u[u.type];c?u.type==="perspective"?l=new d.PerspectiveCamera(d.MathUtils.radToDeg(c.yfov),c.aspectRatio||1,c.znear||1,c.zfar||2e6):u.type==="orthographic"?l=new d.OrthographicCamera(-c.xmag,c.xmag,c.ymag,-c.ymag,c.znear,c.zfar):(console.warn("glTF: Invalid camera type ".concat(u.type,".")),l=new d.Camera):(console.warn("glTF: Missing camera parameters."),l=new d.Camera),u.name&&(l.name=this.createUniqueName(u.name)),i=Promise.resolve(l)}return this.cache.set(e,i),i},n.prototype.loadSkin=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;var i,a=this.json.skins[t],o={joints:a.joints};return a.inverseBindMatrices===void 0?i=Promise.resolve(o):i=this.loadAccessor(a.inverseBindMatrices).then(function(s){return s&&(o.inverseBindMatrices=s),o}),this.cache.set(e,i),i},n.prototype.loadAnimation=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=vt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadAnimation(t,this),i)break}if(!i){for(var l=this.json,u=l.animations[t],c=[],f=[],m=[],A=[],h=[],p=0,g=u.channels.length;p<g;p++){var v=u.channels[p],y=u.samplers[v.sampler],b=v.target,x=b.node!==void 0?b.node:b.id,w=u.parameters!==void 0?u.parameters[y.input]:y.input,E=u.parameters!==void 0?u.parameters[y.output]:y.output;c.push(this.loadNode(x)),f.push(this.loadAccessor(w)),m.push(this.loadAccessor(E)),A.push(y),h.push(b)}i=Promise.all([Promise.all(c),Promise.all(f),Promise.all(m),Promise.all(A),Promise.all(h)]).then(function(C){for(var M=C[0],R=C[1],L=C[2],S=C[3],I=C[4],O=[],P=function(z,U){var q=M[z],K=R[z],j=L[z],J=S[z],X=I[z];if(q===void 0)return"continue";q.updateMatrix(),q.matrixAutoUpdate=!0;var Y=void 0;switch(Nr[X.path]){case Nr.weights:Y=d.NumberKeyframeTrack;break;case Nr.rotation:Y=d.QuaternionKeyframeTrack;break;case Nr.position:case Nr.scale:default:Y=d.VectorKeyframeTrack;break}var W=q.name?q.name:q.uuid,ee=J.interpolation!==void 0?gf[J.interpolation]:d.InterpolateLinear,Z=[];Nr[X.path]===Nr.weights?q.traverse(function(ge){ge.morphTargetInfluences&&Z.push(ge.name?ge.name:ge.uuid)}):Z.push(W);var ie=j.array;if(j.normalized){for(var te=da(ie.constructor),le=new Float32Array(ie.length),oe=0,we=ie.length;oe<we;oe++)le[oe]=ie[oe]*te;ie=le}for(var oe=0,we=Z.length;oe<we;oe++){var pe=new Y(Z[oe]+"."+Nr[X.path],K.array,ie,ee);O.push(pe)}},F=0,V=M.length;F<V;F++)P(F);var D=u.name?u.name:"animation_"+t;return new d.AnimationClip(D,void 0,O)})}return this.cache.set(e,i),i},n.prototype.loadBuffer=function(t){var e=this.json.buffers[t];if(e.type&&e.type!=="arraybuffer")throw new Error("glTF: "+e.type+" buffer type is not supported.");var r="buffer:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=vt(this.extensions);o<s.length;o++){var l=s[o];if(a=l.loadBuffer(t,this),a)break}if(!a){var u=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(u.uri),{responseType:"arraybuffer"}).then(function(c){return c.body})}return this.cache.set(r,a),a},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=vt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadBufferView(t,this),i)break}if(!i){var l=this.json.bufferViews[t];i=this.loadBuffer(l.buffer).then(function(u){var c=l.byteLength||0,f=l.byteOffset||0;return u.slice(f,f+c)})}return this.cache.set(e,i),i},n.prototype.loadAccessor=function(t){var e=this,r="accessor:"+t,i=this.cache.get(r);if(i)return i;var a=null;if(!a){var o=this.json.accessors[t];if(o.bufferView===void 0&&o.sparse===void 0)a=Promise.resolve(null);else{var s=[];o.bufferView!==void 0?s.push(this.loadBufferView(o.bufferView)):s.push(Promise.resolve(null)),o.sparse!==void 0&&(s.push(this.loadBufferView(o.sparse.indices.bufferView)),s.push(this.loadBufferView(o.sparse.values.bufferView))),a=Promise.all(s).then(function(l){var u=l[0],c=gs[o.type],f=Vn[o.componentType],m=f.BYTES_PER_ELEMENT,A=m*c,h=o.byteOffset||0,p=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,g=o.normalized===!0,v,y;if(p&&p!==A){var b=Math.floor(h/p),x="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,w=e.cache.get(x);w||(v=new f(u,b*p,o.count*p/m),w=new d.InterleavedBuffer(v,p/m),e.cache.set(x,w)),y=new d.InterleavedBufferAttribute(w,c,h%p/m,g)}else u===null?v=new f(o.count*c):v=new f(u,h,o.count*c),y=new d.BufferAttribute(v,c,g);if(o.sparse!==void 0){var E=gs.SCALAR,C=Vn[o.sparse.indices.componentType],M=o.sparse.indices.byteOffset||0,R=o.sparse.values.byteOffset||0,L=new C(l[1],M,o.sparse.count*E),S=new f(l[2],R,o.sparse.count*c);u!==null&&(y=new d.BufferAttribute(y.array.slice(),y.itemSize,y.normalized));for(var I=0,O=L.length;I<O;I++){var P=L[I];if(y.setX(P,S[I*c]),c>=2&&y.setY(P,S[I*c+1]),c>=3&&y.setZ(P,S[I*c+2]),c>=4&&y.setW(P,S[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}}return this.cache.set(r,a),a},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=vt(this.extensions);e<r.length;e++){var i=r[e],a=i.createPrimitiveKey(t,this);if(a)return a}for(var o="",s=Object.keys(t.attributes).sort(),l=0,u=s.length;l<u;l++)o+=s[l]+":"+t.attributes[s[l]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,a=vt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new d.BufferGeometry,t)),r=r.then(function(s){return e.disposeSet.add(s),s}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,a=vt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadImage(t,this),r)break}if(!r){var s=this.json.images[t];if(s.bufferView!==void 0){var l=this.json.bufferViews[s.bufferView];r=this.loadBuffer(l.buffer).then(function(c){var f=l.byteOffset||0,m=l.byteLength||0,A=new Uint8Array(c,f,m),h=new Blob([A],{type:s.mimeType});return Ha(h)})}else if(s.uri){var u=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(u,{},void 0,void 0,void 0,Fi()).then(function(c){return c.body})}else throw new Error("glTF: Invalid image defs.")}return r=r.then(function(c){return e.disposeSet.add(c),c}),r},n.prototype.loadMaterialAsMeshStandardMaterial=function(t){var e=this,r=[],i=new d.MeshStandardMaterial;if(i.color=new d.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(c){return kt[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return kt[c]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(c){return kt[c]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(c){c.encoding=d.sRGBEncoding,i.map=c,e.disposeSet.add(c)})),i.metalness=o.metallicFactor!==void 0?o.metallicFactor:1,i.roughness=o.roughnessFactor!==void 0?o.roughnessFactor:1,o.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(o.metallicRoughnessTexture).then(function(c){c.encoding=d.sRGBEncoding,i.metalnessMap=c,i.roughnessMap=c,e.disposeSet.add(c)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var l=a.alphaMode||yr.OPAQUE;if(l===yr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===yr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(c){i.normalMap=c,e.disposeSet.add(c)})),i.normalScale=new d.Vector2(1,1),a.normalTexture.scale!==void 0)){var u=a.normalTexture.scale;i.normalScale.set(u,u)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(c){i.aoMap=c,e.disposeSet.add(c)})),a.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&(i.emissive=new d.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(a.emissiveTexture).then(function(c){i.emissiveMap=c,e.disposeSet.add(c)}))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterialAsLineBasicMaterial=function(t){var e=[],r=new d.LineBasicMaterial;if(r.color=new d.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(l){return kt[l]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return kt[l]==="tangent"}).length===0&&(r.normalScale&&(r.normalScale.y*=-1),r.clearcoatNormalScale&&(r.clearcoatNormalScale.y*=-1)),t.material!==void 0){var i=this.json.materials[t.material];i.name&&(r.name=i.name);var a=i.pbrMetallicRoughness||{};if(Array.isArray(a.baseColorFactor)){var o=a.baseColorFactor;r.color.fromArray(o),r.opacity=o[3]}i.doubleSided===!0&&(r.side=d.DoubleSide);var s=i.alphaMode||yr.OPAQUE;s===yr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===yr.MASK&&(r.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5))}return this.disposeSet.add(r),Promise.all(e).then(function(){return r})},n.prototype.loadMaterialAsPointsMaterial=function(t){var e=this,r=[],i=new d.PointsMaterial;if(i.color=new d.Color(1,1,1),i.opacity=1,i.sizeAttenuation=!1,Object.keys(t.attributes).filter(function(u){return kt[u]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return kt[u]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(u){u.encoding=d.sRGBEncoding,i.map=u,e.disposeSet.add(u)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var l=a.alphaMode||yr.OPAQUE;l===yr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===yr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterial=function(t){var e,r=(e=t.mode)!==null&&e!==void 0?e:Oe.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,l=vt(this.extensions);s<l.length;s++){var u=l[s];if(o=u.loadMaterial(t,this),o)break}if(r===Oe.TRIANGLES||r===Oe.TRIANGLE_STRIP||r===Oe.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Oe.LINES||r===Oe.LINE_STRIP||r===Oe.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Oe.POINTS)o=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,o),o},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=vt(this.extensions);o<s.length;o++){var l=s[o];if(a=l.loadTexture(t,this),a)break}if(!a){var u=this.json.textures[t];a=this.loadImage(u.source).then(function(c){var f=new d.Texture(c);f.needsUpdate=!0,f.flipY=!1,u.name&&(f.name=u.name);var m=e.json.samplers||{},A=m[u.sampler]||{};return f.magFilter=Li[A.magFilter]||d.LinearFilter,f.minFilter=Li[A.minFilter]||d.LinearMipmapLinearFilter,f.wrapS=Oi[A.wrapS]||d.RepeatWrapping,f.wrapT=Oi[A.wrapT]||d.RepeatWrapping,f.onUpdate=function(){c.close()},f})}return a=a.then(function(c){return e.disposeSet.add(c),c}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=vt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadMesh(t,this),r)break}if(!r){var s=this.json.meshes[t],l=s.primitives,u=Promise.all(l.map(function(f){return e.loadGeometry(f)})),c=Promise.all(l.map(function(f){return e.loadMaterial(f)}));r=Promise.all([u,c]).then(function(f){for(var m=f[0],A=f[1],h=[],p=0;p<l.length;p++){var g=l[p],v=m[p],y=A[p],b=g.mode||Oe.TRIANGLES,x=void 0;if(b===Oe.TRIANGLES||b===Oe.TRIANGLE_STRIP||b===Oe.TRIANGLE_FAN)if(b===Oe.TRIANGLE_STRIP?v=e.toGeometryTrianglesDrawMode(v,d.TriangleStripDrawMode):b===Oe.TRIANGLE_FAN&&(v=e.toGeometryTrianglesDrawMode(v,d.TriangleFanDrawMode)),e.disposeSet.add(v),s.isSkinnedMesh){var w=new d.SkinnedMesh(v,y);v.attributes.skinWeight.normalized||w.normalizeSkinWeights(),x=w}else x=new d.Mesh(v,y);else if(b===Oe.POINTS)x=new d.Points(v,y);else if(b===Oe.LINES)x=new d.LineSegments(v,y);else if(b===Oe.LINE_STRIP)x=new d.Line(v,y);else if(b===Oe.LINE_LOOP)x=new d.LineLoop(v,y);else throw new Error("glTF: Primitive mode unsupported: "+b);if(Object.keys(v.morphAttributes).length>0){if(s.weights!==void 0)for(var E=0,C=s.weights.length;E<C;E++)x.morphTargetInfluences[E]=s.weights[E];if(s.extras&&Array.isArray(s.extras.targetNames)){var M=s.extras.targetNames;if(x.morphTargetInfluences.length===M.length){x.morphTargetDictionary={};for(var E=0,C=M.length;E<C;E++)x.morphTargetDictionary[M[E]]=E}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}x.name=e.createUniqueName(s.name||"mesh_"+t),h.push(x)}if(h.length===1)return h[0];for(var R=new d.Group,L=0,S=h;L<S.length;L++){var x=S[L];R.add(x)}return R})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=vt(this.extensions);r<i.length;r++){var a=i[r],o=a.loadNodeAttachments(t,this);o&&e.push(o)}return e},n.prototype.loadNode=function(t){var e="node:"+t,r=this.cache.get(e);if(r)return r;var i=this.json,a=i.nodes[t],o=a.name?this.createUniqueName(a.name):"",s=[];a.mesh!==void 0&&s.push(this.loadMesh(a.mesh).then(function(m){if(a.weights!==void 0){var A=a.weights;m.traverse(function(h){if(h instanceof d.Mesh||h instanceof d.Line||h instanceof d.Points)for(var p=0,g=A.length;p<g;p++)h.morphTargetInfluences[p]=A[p]})}return m})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var l=this.loadNodeAttachments(t),u=0,c=l;u<c.length;u++){var f=c[u];s.push(f)}return Promise.all(s).then(function(m){var A;if(a.isBone===!0?A=new d.Bone:m.length>1?A=new d.Group:m.length===1?A=m[0]:A=new d.Object3D,A!==m[0])for(var h=0,p=m.length;h<p;h++)A.add(m[h]);if(a.name&&(A.name=o),a.matrix!==void 0){var g=new d.Matrix4;g.fromArray(a.matrix),A.applyMatrix4(g)}else a.translation!==void 0&&A.position.fromArray(a.translation),a.rotation!==void 0&&A.quaternion.fromArray(a.rotation),a.scale!==void 0&&A.scale.fromArray(a.scale);return A})},n.prototype.loadScene=function(t){var e=this.json,r=e.scenes[t],i=new d.Group;r.name&&(i.name=this.createUniqueName(r.name));for(var a=r.nodes||[],o=[],s=0,l=a.length;s<l;s++)o.push(this.buildNodeHierarchy(a[s],i));return Promise.all(o).then(function(){return i})},n.prototype.createMaterialTexture=function(t){var e=this;return this.loadTexture(t.index).then(function(r){for(var i=0,a=vt(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s,e.disposeSet.add(r))}return e.textureSet.add(r),r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(w){var E=kt[w]||w.toLowerCase();if(E in t.attributes)return"continue";a.push(s.loadAccessor(i[w]).then(function(C){C&&t.setAttribute(E,C)}))},s=this;for(var l in i)o(l);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(w){w&&t.setIndex(w)}));var u=new d.Box3;if(i.POSITION!==void 0){var c=this.json.accessors[i.POSITION],f=c.min,m=c.max;if(f!==void 0&&m!==void 0){if(u.set(new d.Vector3(f[0],f[1],f[2]),new d.Vector3(m[0],m[1],m[2])),c.normalized){var A=da(Vn[c.componentType]);u.min.multiplyScalar(A),u.max.multiplyScalar(A)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var h=e.targets;if(h!==void 0){for(var p=new d.Vector3,g=new d.Vector3,v=0,y=h.length;v<y;v++){var b=h[v];if(b.POSITION!==void 0){var c=this.json.accessors[b.POSITION],f=c.min,m=c.max;if(f!==void 0&&m!==void 0){if(g.setX(Math.max(Math.abs(f[0]),Math.abs(m[0]))),g.setY(Math.max(Math.abs(f[1]),Math.abs(m[1]))),g.setZ(Math.max(Math.abs(f[2]),Math.abs(m[2]))),c.normalized){var A=da(Vn[c.componentType]);g.multiplyScalar(A)}p.max(g)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}u.expandByVector(p)}t.boundingBox=u;var x=new d.Sphere;return u.getCenter(x.center),x.radius=u.min.distanceTo(u.max)/2,t.boundingSphere=x,Promise.all(a).then(function(){if(t.attributes.uv&&!t.attributes.uv2&&r.options.copyUV2&&t.setAttribute("uv2",t.attributes.uv),e.targets){for(var w=!1,E=!1,C=0,M=e.targets.length;C<M;C++){var R=e.targets[C];if(R.POSITION!==void 0&&(w=!0),R.NORMAL!==void 0&&(E=!0),w&&E)break}if(!w&&!E)return t;var L=[];t.morphTargetsRelative=!0;for(var S=function(I,O){var P=e.targets[I];w?L.push(r.loadAccessor(P.POSITION).then(function(F){F&&(t.morphAttributes.position[I]=F)})):t.morphAttributes.position[I]=t.attributes.position,E?L.push(r.loadAccessor(P.NORMAL).then(function(F){F&&(t.morphAttributes.normal[I]=F)})):t.morphAttributes.normal[I]=t.attributes.normal},C=0,M=e.targets.length;C<M;C++)S(C,M);return Promise.all(L).then(function(){return t})}else return t})},n.prototype.buildNodeHierarchy=function(t,e){var r=this,i=this.json.nodes[t];return this.loadNode(t).then(function(a){if(i.skin===void 0)return a;var o;return r.loadSkin(i.skin).then(function(s){o=s;for(var l=[],u=0,c=o.joints.length;u<c;u++)l.push(r.loadNode(o.joints[u]));return Promise.all(l)}).then(function(s){return a.traverse(function(l){if(l instanceof d.SkinnedMesh){for(var u=[],c=[],f=0,m=s.length;f<m;f++){var A=s[f];if(A instanceof d.Bone){u.push(A);var h=new d.Matrix4;o.inverseBindMatrices!==void 0&&h.fromArray(o.inverseBindMatrices.array,f*16),c.push(h)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[f])}l.bind(new d.Skeleton(u,c),l.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,l=0,u=s.length;l<u;l++){var c=s[l];o.push(r.buildNodeHierarchy(c,a))}return Promise.all(o).then(function(){return a})})},n.prototype.createUniqueName=function(t){for(var e=d.PropertyBinding.sanitizeNodeName(t||""),r=e,i=1;this.nodeNamesUsed[r];++i)r=e+"_"+i;return this.nodeNamesUsed[r]=!0,r},n.prototype.resolveResouce=function(t){return at(this.options.resourcePath,go(t,this.options.search))},n.prototype.toGeometryTrianglesDrawMode=function(t,e){var r=t.getIndex();if(r===null){var i=[],a=t.getAttribute("position");if(a!==void 0){for(var o=0;o<a.count;o++)i.push(o);t.setIndex(i),r=t.getIndex()}}if(r===null)return console.error("glTF: Undefined position attribute. Processing not possible."),t;var s=r.count-2,l=[];if(e===d.TriangleFanDrawMode)for(var o=1;o<=s;o++)l.push(r.getX(0)),l.push(r.getX(o)),l.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2===0?(l.push(r.getX(o)),l.push(r.getX(o+1)),l.push(r.getX(o+2))):(l.push(r.getX(o+2)),l.push(r.getX(o+1)),l.push(r.getX(o)));l.length/3!==s&&console.error("glTF: Unable to generate correct amount of triangles.");var u=t.clone();return u.setIndex(l),this.disposeSet.add(u),u},n}();function da(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("glTF: Unsupported normalized accessor component type.")}}var fr=function(){function n(){}return n.prototype.markDefs=function(t){},n.prototype.prepare=function(t){},n.prototype.emitResult=function(t,e){},n.prototype.createPrimitiveKey=function(t,e){},n.prototype.extendTexture=function(t,e,r){return null},n.prototype.loadBuffer=function(t,e){return null},n.prototype.loadBufferView=function(t,e){return null},n.prototype.loadImage=function(t,e){return null},n.prototype.loadTexture=function(t,e){return null},n.prototype.loadGeometry=function(t,e){return null},n.prototype.loadMaterial=function(t,e){return null},n.prototype.loadMesh=function(t,e){return null},n.prototype.loadNodeAttachments=function(t,e){return null},n.prototype.loadCamera=function(t,e){return null},n.prototype.loadAnimation=function(t,e){return null},n}(),xf=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.header={magic:"",version:0,length:0},e.content="",e.body=null,e}return t.getMagic=function(e){return Ka(new Uint8Array(e.slice(0,4)))},t.prototype.loadGlbBinary=function(e){var r=new DataView(e,0,t.HEADER_LENGTH);if(this.header={magic:t.getMagic(e),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==t.HEADER_MAGIC)throw new Error("glTF:KHR_binary_glTF: Unsupported.");if(this.header.version<2)throw new Error("glTF:KHR_binary_glTF: Legacy binary file detected.");for(var i=new DataView(e,t.HEADER_LENGTH),a=0,o=null,s=null;a<i.byteLength;){var l=i.getUint32(a,!0);if(a+=4,l!==0){var u=i.getUint32(a,!0);if(a+=4,u===t.CHUNK_TYPES.JSON){var c=new Uint8Array(e,t.HEADER_LENGTH+a,l);o=Ka(c)}else if(u===t.CHUNK_TYPES.BIN){var f=t.HEADER_LENGTH+a;s=e.slice(f,f+l)}a+=l}}if(o===null)throw new Error("glTF:KHR_binary_glTF: JSON content not found.");this.content=o,this.body=s},t.prototype.loadBuffer=function(e,r){var i=r.json.buffers[e];return i.uri===void 0&&e===0&&this.body?Promise.resolve(this.body):null},t.prototype.clear=function(){this.body=null,this.content=""},t.HEADER_MAGIC="glTF",t.HEADER_LENGTH=12,t.CHUNK_TYPES={JSON:1313821514,BIN:5130562},t}(fr),wf="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",ys={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},bs={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},Ef=function(){function n(){this.decoderPath=wf,this.decoderConfig={},this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=""}return n.prototype.setDecoderPath=function(t){this.decoderPath=t},n.prototype.setDecoderConfig=function(t){return this.decoderConfig=t,this},n.prototype.setWorkerLimit=function(t){return this.workerLimit=t,this},n.prototype.decodeDracoFile=function(t,e,r,i){var a={attributeIDs:r||ys,attributeTypes:i||bs,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:ys,attributeTypes:bs,useUniqueIDs:!1});for(var i in e.attributeTypes){var a=e.attributeTypes[i];a.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=a.name)}var o,s=this.workerNextTaskID++,l=t.byteLength,u=this._getWorker(s,l).then(function(c){return o=c,new Promise(function(f,m){o._callbacks[s]={resolve:f,reject:m},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(c){return r._createGeometry(c.geometry)});return u.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),u},n.prototype._createGeometry=function(t){var e=new d.BufferGeometry;t.index&&e.setIndex(new d.BufferAttribute(t.index.array,1));for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r],a=i.name,o=i.array,s=i.itemSize;e.setAttribute(a,new d.BufferAttribute(o,s))}return e},n.prototype._initDecoder=function(){var t=this;if(this.decoderPending)return this.decoderPending;var e=typeof WebAssembly!="object"||this.decoderConfig.type==="js";if(e){var r=Sn(this.decoderPath+"draco_decoder.js",{responseType:"text"}).then(function(a){return a.body});this.decoderPending=r.then(function(a){var o=["/* draco decoder */",a,"","/* worker */",xs].join(`
|
|
417
|
+
`,Q0=[],Yn=new d.PerspectiveCamera(90,1,.1,2);Yn.up.set(0,-1,0);Yn.lookAt(new d.Vector3(1,0,0));Yn.updateMatrix();Yn.matrixAutoUpdate=!1;var $n=new d.PerspectiveCamera(90,1,.1,2);$n.up.set(0,-1,0);$n.lookAt(new d.Vector3(-1,0,0));$n.updateMatrix();$n.matrixAutoUpdate=!1;var ei=new d.PerspectiveCamera(90,1,.1,2);ei.up.set(0,0,1);ei.lookAt(new d.Vector3(0,1,0));ei.updateMatrix();ei.matrixAutoUpdate=!1;var ti=new d.PerspectiveCamera(90,1,.1,2);ti.up.set(0,0,-1);ti.lookAt(new d.Vector3(0,-1,0));ti.updateMatrix();ti.matrixAutoUpdate=!1;var ri=new d.PerspectiveCamera(90,1,.1,2);ri.up.set(0,-1,0);ri.lookAt(new d.Vector3(0,0,1));ri.updateMatrix();ri.matrixAutoUpdate=!1;var ni=new d.PerspectiveCamera(90,1,.1,2);ni.up.set(0,-1,0);ni.lookAt(new d.Vector3(0,0,-1));ni.updateMatrix();ni.matrixAutoUpdate=!1;var rs={front:{camera:ri,index:4},back:{camera:ni,index:5},up:{camera:ei,index:2},down:{camera:ti,index:3},left:{camera:$n,index:1},right:{camera:Yn,index:0}};function fd(){var n=Q0.pop();return n||new d.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:cd,fragmentShader:dd,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function hd(n){n.uniforms.map.value=null,Q0.push(n)}function pd(n,t,e){var r=new d.Scene;r.matrixAutoUpdate=!1;var i=new d.Group;i.scale.set(1,1,-1),r.add(i);for(var a=[],o=new Set,s=0,l=n;s<l.length;s++){var u=l[s];o.add(u.face);var c=fd();a.push(c),c.uniforms.map.value=u.texture,c.uniforms.flipY.value=u.flipY?1:0;var f=new d.Group,m=new d.Mesh(ld,c);m.position.set(u.position.x+u.size.x/2-.5,1-(u.position.y+u.size.y/2)-.5,-.5),m.scale.set(u.size.x,u.size.y,1),f.quaternion.copy(ud[u.face]),f.add(m),i.add(f)}var A=e.autoClear,h=e.sortObjects,p=e.xr.enabled,g=t.texture.generateMipmaps;e.autoClear=!1,e.sortObjects=!1,e.xr.enabled=!1,t.texture.generateMipmaps=!1;var v=e.getRenderTarget(),y=0;o.forEach(function(w){++y===o.size&&(t.texture.generateMipmaps=g),e.setRenderTarget(t,rs[w].index),e.render(r,rs[w].camera)}),e.setRenderTarget(v),e.autoClear=A,e.sortObjects=h,e.xr.enabled=p;for(var b=0,x=a;b<x.length;b++){var c=x[b];hd(c)}}var vd=function(){return!1}();function Fi(n){n===void 0&&(n={});var t=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onClose&&n.onClose.call(this),this.onerror=this.onload=this.close=Q,this.removeAttribute("src")}});return t}function Ha(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),i=Fi({onClose:function(){this.src===r&&URL.revokeObjectURL(r)}});i.onload=function(){i.src===r&&URL.revokeObjectURL(r),i.onload=i.onerror=Q,setTimeout(function(){t(i)},10)},i.onerror=function(){var a=i.src;i.onload=i.onerror=Q,i.close(),e(new Error("image load error: ".concat(a)))},i.decoding="async",i.src=r})}var ns=[];function md(n,t){var e=ns.shift();if(e)return e.width=n,e.height=t,e;var r=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),{close:function(){r.close=Q,ns.push(r)}});return r}function is(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=md(Math.min(n.width,t.width),Math.min(n.height,t.height)),r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.drawImage(n,0,0,e.width,e.height),n.close();var i=new d.Texture(e);i.needsUpdate=!0,i.flipY=!0;var a=i.dispose;return i.dispose=function(){e.close(),a.call(i),i.dispose=a},i}else{var o=new d.Texture(n);o.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?o.flipY=!1:o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}}function Ad(n){var t=new d.CubeTexture(n);t.needsUpdate=!0,t.flipY=!1;var e=t.dispose;return t.dispose=function(){for(var r=0,i=n;r<i.length;r++){var a=i[r];a.close()}e.call(t),t.dispose=e},t}var as=new d.Vector3,en=["right","left","up","down","front","back"],Ne=function(){function n(t,e,r,i,a){this.tileTree=e,this.tileSources=r,this.options=i,this.renderer=a,this.name="",this.needsRender=!1,this.maxRequest=n.DEFAULT_MAX_REQUEST,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.drawedCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.prepareToRender=[],this.baseCubeTexture=t}return Object.defineProperty(n.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(t){var e,r,i,a,o,s;if(t===null)throw new Error("cannot set cubeRenderTarget to null.");t.width!==this.options.textureSize&&t.setSize(this.options.textureSize,this.options.textureSize),t.texture.format=(e=this.options.format)!==null&&e!==void 0?e:d.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:d.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:d.LinearFilter,t.texture.wrapS=(a=this.options.wrapS)!==null&&a!==void 0?a:d.ClampToEdgeWrapping,t.texture.wrapT=(o=this.options.wrapT)!==null&&o!==void 0?o:d.ClampToEdgeWrapping,t.texture.generateMipmaps=(s=this.options.generateMipmaps)!==null&&s!==void 0?s:!0,this.baseCubeTexture&&(qa(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&qa(this._cubeRenderTarget.texture,t,this.renderer),this._cubeRenderTarget=t},enumerable:!1,configurable:!0}),n.prototype.requestTile=function(t){var e=this,r,i,a,o,s,l,u=this.tileSources.filter(function(p){return p.level===t.level})[0];if(!u)return this.loadedCubeNodes.add(t),this.prepareToRender.push({node:t,texture:null}),!1;var c=u.size,f=Math.pow(2,t.level)*t.position.y,m=Math.pow(2,t.level)*t.position.x,A="".concat(((a=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(f,".").concat(m),h=k(k({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:A,size:u.scale>=1?void 0:c*t.size*u.scale,quality:void 0,cut:[c*t.position.x,c*t.position.y,c*t.size,c*t.size]});return this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(u[t.face],{imageURL:{transform:(l=this.options.imageURL)===null||l===void 0?void 0:l.transform,options:k({},h)},format:d.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(p){if(e.disposed){p.body.dispose();return}e.prepareToRender.push({node:t,texture:p.body}),e.loadedCubeNodes.add(t)}).catch(Q).then(function(){e.disposed||e.loadingCubeNodes.delete(t)}),!0},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=t.planes[5].normal,a=Math.max(this.maxRequest-this.loadingCubeNodes.size,0),o=[];po(this.tileTree,function(p){if(p.level>e||!t.intersectsBox(p.box))return!1;!r.loadedCubeNodes.has(p)&&!r.loadingCubeNodes.has(p)&&o.push(p)}),o.sort(function(p,g){return p.level!==g.level?p.level-g.level:p.box.getCenter(as).angleTo(i)-g.box.getCenter(as).angleTo(i)});for(var s=0,l=o;s<l.length;s++){var u=l[s];if(a<=0)break;var c=this.requestTile(u);c&&a--}if(this.cubeRenderTarget&&this.prepareToRender.length){this.prepareToRender.sort(function(p,g){return p.node.level-g.node.level});for(var f=[],m=0;m<this.prepareToRender.length;m++){var A=this.prepareToRender[m],u=A.node,h=A.texture;(u.parent===null||this.drawedCubeNodes.has(u.parent))&&(this.drawedCubeNodes.add(u),h&&f.push({face:u.face,position:u.position,size:new d.Vector2(u.size,u.size),texture:h,flipY:!h.flipY}),this.prepareToRender.splice(m,1),m--)}f.length&&(pd(f,this.cubeRenderTarget,this.renderer),this.needsRender=!0)}}},Object.defineProperty(n.prototype,"tilePending",{get:function(){return this.loadingCubeNodes.size},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){if(!this._cubeRenderTarget)throw new Error("cubeRenderTarget never set.");return this._cubeRenderTarget.texture},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){if(!this.disposed){this.disposed=!0,this.baseCubeTexture&&(this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this.loadingCubeNodes.clear(),this.loadedCubeNodes.clear();for(var t=0,e=this.prepareToRender;t<e.length;t++){var r=e[t];r.texture&&r.texture.dispose()}this.prepareToRender.length=0}},n.DEFAULT_MAX_REQUEST=3,n}(),Bn=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,l,u,c,f,m,A;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.flipY!="undefined"&&(h.flipY=e.flipY),typeof e.format!="undefined"&&(h.format=e.format),typeof e.encoding!="undefined"&&(h.encoding=e.encoding),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(l=e.minFilter)!==null&&l!==void 0?l:d.LinearFilter,h.magFilter=(u=e.magFilter)!==null&&u!==void 0?u:d.LinearFilter;var p=(f=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&f!==void 0?f:{key:"unknown"};t=sn(t,(m=e.imageURL)===null||m===void 0?void 0:m.transform,p);var g=Yo(t),v=(A=e.viaAjax)!==null&&A!==void 0?A:vd,y=Zo(t),b=/^https?:/.test(g);if(y?v=!0:b||(v=!1),v){var x=null,w="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:w},void 0,void 0,a).then(function(C){return Ha(C.body)}).then(function(C){return is(C,e.maxSize)}).then(function(C){return Object.assign(C,h),C}).then(function(C){var R={meta:x,body:C};return r(R),R}).catch(function(C){return i(C),Promise.reject(C)})}else{var E=null,M;return Promise.resolve().then(function(){return Fi()}).then(function(C){return M=C,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,C)}).then(function(C){return E=C.meta,is(C.body,e.maxSize)}).then(function(C){return Object.assign(C,h),C}).then(function(C){var R={meta:E,body:C};return r(R),R}).catch(function(C){return M&&M.close(),i(C),Promise.reject(C)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,l,u,c,f,m,A;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.format!="undefined"&&(h.format=e.format),h.generateMipmaps=(s=e.generateMipmaps)!==null&&s!==void 0?s:!1,h.minFilter=(l=e.minFilter)!==null&&l!==void 0?l:d.LinearFilter,h.magFilter=(u=e.magFilter)!==null&&u!==void 0?u:d.LinearFilter;for(var p=[t[en[0]],t[en[1]],t[en[2]],t[en[3]],t[en[4]],t[en[5]]],g=[],v=[0,0,0,0,0,0],y=[],b=function(w){var E=(f=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&f!==void 0?f:{key:"unknown"},M=sn(p[w],(m=e.imageURL)===null||m===void 0?void 0:m.transform,k(k({},E),{key:E.key+"."+en[w]})),C=Yo(M),R=function(V){v[w]=V,a(v.reduce(function(D,z){return D+z},0)/6)},L=(A=e.viaAjax)!==null&&A!==void 0?A:!1,S=/^https?:$/.test(C),I=Zo(M);if(I?L=!0:S||(L=!1),L){var O="blob",P=e.fetcher.ajax(M,{timeout:e.timeout,responseType:O},void 0,void 0,R).then(function(V){return y[w]=V.meta,Ha(V.body)});g.push(P)}else{var F,P=Promise.resolve().then(function(){return Fi()}).then(function(D){return F=D,e.fetcher.loadImage(M,{timeout:e.timeout},void 0,void 0,R,D)}).then(function(D){return y[w]=D.meta,D.body}).catch(function(D){return F&&F.close(),Promise.reject(D)});g.push(P)}},x=0;x<6;x++)b(x);return Promise.all(g).then(function(w){return Ad(w)}).then(function(w){return Object.assign(w,k({encoding:d.sRGBEncoding},h)),w}).then(function(w){var E={body:w,meta:y};return r(E),E}).catch(function(w){for(var E=0,M=g;E<M.length;E++){var C=M[E];C.then(function(R){return R.close()}).catch(Q)}return i(w),Promise.reject(w)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var l=this;return i===void 0&&(i=Q),a===void 0&&(a=Q),o===void 0&&(o=Q),new Promise(function(u,c){var f,m;l.loadCubeTexture(t,{imageURL:{transform:(f=r.imageURL)===null||f===void 0?void 0:f.transform,options:(m=r.imageURL)===null||m===void 0?void 0:m.options},format:d.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(A){var h,p=A.meta,g=A.body,v=(h=r.tileMaxLevel)!==null&&h!==void 0?h:2,y=Math.max(1024*v,512),b=Qa(v),x=new Ne(g,b,e,{textureSize:y,textureLoader:l,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},s),w={meta:p,body:x};i(w),u(w)},function(A){a(A),c(A)},o,s).catch(Q)})},n}();const gd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("n\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),yd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-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a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J--qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-rpA5}n{|P|y|;to9-=;=69-pynz}5z|qryNy}un-7-@=;=9-=;=9->;=66H--<<-JJJJJJJJJJJJJJJJ--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--ZNV[lR[Q\f"),bd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-cvr]|vv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrr\x07K0v{pyqr-I?l}nlrr\x07K0v{pyqr-Ir{zn}l}nlrr\x07K0v{pyqr-Ip|y|l}nlrr\x07K0v{pyqr-Is|tl}nlrr\x07K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ilrr\x07K--0v{pyqr-I?lrr\x07K--0v{pyqr-Ip|y|lrr\x07K--0v{pyqr-Ixv{onrlrr\x07K--0vsqrs-b`RlR[cZN]--0v{pyqr-Iortv{{|znylrr\x07K--0v{pyqr-Iz|}u{|znylrr\x07K--0v{pyqr-Ixv{{|znylrr\x07K--0v{pyqr-Iqrsny{|znylrr\x07K--0r{qvs--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--cvr]|vv|{-J-:z]|vv|{;\x07\b H--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),xd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-sy|n-sy||H{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznv\x07H{vs|z-sy|n-}n{|>l ||zH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-sy|n-z|qryNy}unH{vs|z-sy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H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--<<-nppzynv|{-5onxrq-v{qvrp-yvtuv{t-|{y\b6--0vsqrs-b`RlYVTUaZN]----rpA-yvtuZn}ar\x07ryJ-r\x07r?Q5-yvtuZn}9-b?-6H----rsyrprqYvtu;v{qvrpQvssr-8J-yvtuZn}ar\x07rya|Yv{rn5-yvtuZn}ar\x07ry-6;to-7-yvtuZn}V{r{v\bH--0ryr----rsyrprqYvtu;v{qvrpQvssr-8J-rp@5->;=-6H--0r{qvs--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rsyrprqYvtu;v{qvrpQvssr-7J-qvssrP|y|;toH--rp@-|t|v{tYvtu-J-rsyrprqYvtu;v{qvrpQvssrH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;?-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--<<-颜色增益调整,在色调映射前--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H---ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--ZNV[lR[Q\f"),wd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs0vs-qrsv{rq5b`RlcR_aRelZN_X6--nvor-sy|n-znxH0r{qvsn\bv{t-sy|n-V_||sZnxHn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-cvr]|vv|{H0vs{qrs-SYNal`UNQRQ--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrr\x07K0v{pyqr-I?l}nlrr\x07K0v{pyqr-Iqv}ynprzr{zn}l}nlrr\x07K0v{pyqr-Ir{zn}l}nlrr\x07K0v{pyqr-Ip|y|l}nlrr\x07K0v{pyqr-Is|tl}nlrr\x07K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Ixv{{v{tl}nlrr\x07K0v{pyqr-Iunq|zn}l}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07KZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Ilrr\x07K--0v{pyqr-I?lrr\x07K--0v{pyqr-Ip|y|lrr\x07K--0v{pyqr-Iortv{{|znylrr\x07K--0v{pyqr-Iz|}u{|znylrr\x07K--0v{pyqr-Ixv{onrlrr\x07K--0v{pyqr-Ixv{{|znylrr\x07K--0v{pyqr-Iqrsny{|znylrr\x07K0vs{qrs-SYNal`UNQRQ-<<-[|zny-p|z}rq-vu-qrvnvr-ur{-SYNal`UNQRQ--[|zny-J-{|znyv r5-n{s|zrq[|zny-6H0r{qvs--0v{pyqr-Iortv{lrr\x07K--0v{pyqr-Iz|}untrlrr\x07K--0v{pyqr-Ixv{{v{tlrr\x07K--0v{pyqr-Iqv}ynprzr{zn}lrr\x07K--0v{pyqr-I}|wrplrr\x07K--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--cvr]|vv|{-J-:-z]|vv|{;\x07\b H--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--V_||sZnx-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelZN_X6----V_||sZnx-J-r}5no5znx-:->;=69-=;>6H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Ir{zn}lrr\x07K--0v{pyqr-Iunq|zn}lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f"),Ed=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("0qrsv{r-]U\\[T0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=6{vs|z-sy|n-sy||H{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H{vs|z-sy|n-}n{|=l ||zH0vs-qrsv{rq5b`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ir{zn}lp|zz|{l}nlsntzr{K0v{pyqr-Ir{zn}l}nlsntzr{K0v{pyqr-Iporllrsyrpv|{lsntzr{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-IoqsK0v{pyqr-Iyvtul}nlortv{K0v{pyqr-Iyvtul}u|{tl}nlsntzr{K0v{pyqr-Iunq|zn}l}nlsntzr{K0v{pyqr-Ioz}zn}l}nlsntzr{K0v{pyqr-I{|znyzn}l}nlsntzr{K0v{pyqr-I}rpynzn}l}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@- ||zcrp|5rp@-qvrpv|{9-rp@-rp|9-sy|n- ||z6-\n--sy|n-urn-J-q|5qvrpv|{9-rp|6H--rp@-q-J-qvrpv|{-7-urnH--rp@-}-J-rp|-:-qH--rp@-\0-J-}-7- ||zH--r{-{|znyv r5q-8-\x006H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-顶部裁切-JJJ--sy|n-||sP]|tr-J-}|5pynz}5:PnzrnQvrpv|{;\b9-=;=9->;=69-@;=6H--vs-5----V_||sZnx-K-=;B-33----d|yq]|vv|{;\b-K-z|qryO|{qv{tZn\x07;\b-:-||sP]|tr-7-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6--6-\n----qvpnqH--\f--<<-JJJJJJJJJJJJJJ--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--rpA-qvssrP|y|-J-rpA5-qvssr9-|}npv\b-6H--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-69-rp@5-=;=-6-6H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--0v{pyqr-Iy|tqr}uoslsntzr{K--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--0v{pyqr-I{|znylsntzr{lortv{K--0v{pyqr-I{|znylsntzr{lzn}K--0v{pyqr-Irzvvrzn}lsntzr{K--<<-nppzynv|{--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--0v{pyqr-Iyvtulsntzr{lzn}K--0v{pyqr-Iyvtulsntzr{lr{qK--<<-z|qynv|{--0v{pyqr-In|zn}lsntzr{K--rp@-|t|v{tYvtu-J-rsyrprqYvtu;qvrpQvssr-8-rsyrprqYvtu;v{qvrpQvssr-8-rsyrprqYvtu;qvrp`}rpyn-8-rsyrprqYvtu;v{qvrp`}rpyn-8-|nyRzvvr_nqvn{prH--0v{pyqr-Ir{zn}lsntzr{K--tylSntP|y|-J-rpA5-|t|v{tYvtu9-qvssrP|y|;n-6H--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;?-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\b-7-ovtu{rH--<<-JJJJJJJJJJJJJJ--<<-颜色增益调整,在色调映射前--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H---ZNV[lZ\\QRYlP\\Y\\_--<<色调映射-色彩空间转换--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--<<-JJJ-全景图-JJJ--rp@-}n{|=a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6H--}n{|=a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|=a|crr\x079-}n{|=l ||z6H--}n{|=a|crr\x07-J-}n{|=a|crr\x07-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-{|znyv r5d|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6H--}n{|>a|crr\x07-J- ||zcrp|5PnzrnQvrpv|{9-}n{|>a|crr\x079-}n{|>l ||z6H--}n{|>a|crr\x07-J-}n{|>a|crr\x07-7-zn@5}n{|>lznv\x076H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-r\x07rPor5}n{|=lzn}9-}n{|=a|crr\x076H--rpA-}n{|>P|y|-J-r\x07rPor5}n{|>lzn}9-}n{|>a|crr\x076H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-r\x07rPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr\x076;H----}n{|>P|y|;n-J->;=-:-r\x07rPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr\x076;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv\x075}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv\x075}n{|P|y|9-}n{|>P|y|9-zn\x075=;=9-oynpx]|tr-:-]V-8->;=66H--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J-qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--<<-JJJJJJJJJJJJJJ--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0v{pyqr-Iqvurv{tlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--ZNV[lR[Q\f");new d.Vector4;var na={modelAlpha:new d.Uniform(0),progress:new d.Uniform(0),pano0_map:new d.Uniform(null),pano0_luminanceMap:new d.Uniform(null),pano0_matrix:new d.Uniform(new d.Matrix4),pano0_zoom:new d.Uniform(1),pano1_map:new d.Uniform(null),pano1_luminanceMap:new d.Uniform(null),pano1_matrix:new d.Uniform(new d.Matrix4),pano1_zoom:new d.Uniform(1),clippers:new d.Uniform([]),shownFloorIndex:new d.Uniform(-1),constantColor:new d.Uniform(null),geometricError:new d.Uniform(0),pixelRatio:new d.Uniform(1),resolution:new d.Uniform(new d.Vector2(512,512)),floor:new d.Uniform(0),brightness:new d.Uniform(1),modelBoundingMin:new d.Uniform(new d.Vector3),modelBoundingMax:new d.Uniform(new d.Vector3),colorSaturation:new d.Uniform(0),colorBrightness:new d.Uniform(0)},Sd={none:{vertexShader:gd,fragmentShader:yd,uniforms:d.UniformsUtils.merge([na,{opacity:{value:1}},d.UniformsLib.fog]),lights:!1,clipping:!1},basic:{vertexShader:bd,fragmentShader:xd,uniforms:d.UniformsUtils.merge([na,d.ShaderLib.basic.uniforms]),lights:!1,clipping:!0},phong:{vertexShader:wd,fragmentShader:Ed,uniforms:d.UniformsUtils.merge([na,d.ShaderLib.phong.uniforms]),lights:!0,clipping:!0}},Jr=function(n){se(t,n);function t(e,r){e===void 0&&(e="basic"),r===void 0&&(r={});var i=this,a,o,s,l,u,c,f,m,A,h,p,g,v,y,b,x,w,E,M,C,R,L,S,I,O,P=Sd[e];i=n.call(this,{vertexShader:P.vertexShader,fragmentShader:P.fragmentShader,uniforms:d.UniformsUtils.clone(P.uniforms),lights:P.lights,clipping:P.clipping,defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_MARK:!1,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_SPREAD_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_CIRCLE:!1,USE_POINT_ADAPTIVE_SIZE:!1,USE_POINT_COLOR_ALTITUDE:!1}})||this,i.shaderType=e,i.color=new d.Color(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.specular=new d.Color(1118481),i.alphaMap=null,i.envMap=null,i.reflectivity=1,i.refractionRatio=.98,i.emissiveMap=null,i.emissive=new d.Color(0),i.emissiveIntensity=1,i.bumpMap=null,i.bumpScale=1,i.normalMap=null,i.normalMapType=d.TangentSpaceNormalMap,i.normalScale=new d.Vector2(1,1),i.displacementMap=null,i.displacementScale=1,i.displacementBias=0,i.shininess=30;var F,V=null,D=null;return Object.defineProperties(i,{pano0:{get:function(){return V},set:function(z){if(V!==z){V=z,z===null?(this.uniforms.pano0_map.value=null,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity(),this.uniforms.pano0_zoom.value=1):(this.uniforms.pano0_map.value=z.map instanceof Ne?z.map.texture:z.map,this.uniforms.pano0_luminanceMap.value=z.luminanceMap instanceof Ne?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano0_matrix.value.copy(z.matrix),this.uniforms.pano0_zoom.value=z.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,q=this.defines.USE_LUMINANCE;q!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},pano1:{get:function(){return D},set:function(z){if(D!==z){D=z,z===null?(this.uniforms.pano1_map.value=null,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity(),this.uniforms.pano1_zoom.value=1):(this.uniforms.pano1_map.value=z.map instanceof Ne?z.map.texture:z.map,this.uniforms.pano1_luminanceMap.value=z.luminanceMap instanceof Ne?z.luminanceMap.texture:z.luminanceMap,this.uniforms.pano1_matrix.value.copy(z.matrix),this.uniforms.pano1_zoom.value=z.zoom);var U=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,q=this.defines.USE_LUMINANCE;q!==U&&(this.defines.USE_LUMINANCE=U,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(z){this.uniforms.modelAlpha.value=z}},progress:{get:function(){return this.uniforms.progress.value},set:function(z){this.uniforms.progress.value=z}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(z){var U=this.defines.USE_BLACK_TRANSITION,q=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(z,"_TRANSITION")]=!0;var K=!1;U!==this.defines.USE_BLACK_TRANSITION&&(K=!0),q!==this.defines.USE_SPREAD_TRANSITION&&(K=!0),K&&(this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(z){this.uniforms.constantColor.value=z;var U=this.defines.USE_CONSTANT_COLOR,q=z!==null;U!==q&&(this.defines.USE_CONSTANT_COLOR=q,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(z){this.uniforms.opacity.value=z}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(z){this.uniforms.shownFloorIndex.value=z}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(z){this.uniforms.brightness.value=z}},clippers:{get:function(){return F},set:function(z){F!==z&&(F=z,this.uniforms.clippers.value=(F||[]).map(function(U){var q=typeof U.floorIndex=="number"?U.floorIndex:-1,K=new d.Matrix4().getInverse(U.clippingBoxMatrix);return{matrixInverse:K,floorIndex:q}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(z){z!==this.defines.USE_EDL&&(this.defines.USE_EDL=z,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(z){z!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=z,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(z){z!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=z,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(z){this.uniforms.floor.value=z}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(z){this.uniforms.colorSaturation.value=z}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(z){this.uniforms.colorBrightness.value=z}}}),i.pano0=(a=r.pano0)!==null&&a!==void 0?a:Ae.pano0,i.pano1=(o=r.pano1)!==null&&o!==void 0?o:Ae.pano1,i.modelAlpha=(s=r.modelAlpha)!==null&&s!==void 0?s:Ae.modelAlpha,i.progress=(l=r.progress)!==null&&l!==void 0?l:Ae.progress,i.transition=(u=r.transition)!==null&&u!==void 0?u:Ae.transition,i.constantColor=(c=r.constantColor)!==null&&c!==void 0?c:Ae.constantColor,i.opacity=(f=r.opacity)!==null&&f!==void 0?f:Ae.opacity,i.floorStyle=(m=r.floorStyle)!==null&&m!==void 0?m:Ae.floorStyle,i.shownFloorIndex=(A=r.shownFloorIndex)!==null&&A!==void 0?A:Ae.shownFloorIndex,i.clippers=(h=r.clippers)!==null&&h!==void 0?h:Ae.clippers,i.useEDL=(p=r.useEDL)!==null&&p!==void 0?p:Ae.useEDL,i.useHQWeight=(g=r.useHQWeight)!==null&&g!==void 0?g:Ae.useHQWeight,i.useHQDepth=(v=r.useHQDepth)!==null&&v!==void 0?v:Ae.useHQDepth,i.pointSize=(y=r.pointSize)!==null&&y!==void 0?y:Ae.pointSize,i.pointColor=(b=r.pointColor)!==null&&b!==void 0?b:Ae.pointColor,i.pointShape=(x=r.pointShape)!==null&&x!==void 0?x:Ae.pointShape,i.pointScale=(w=r.pointScale)!==null&&w!==void 0?w:Ae.pointScale,i.pointBack=(E=r.pointBack)!==null&&E!==void 0?E:Ae.pointBack,i.pointMinPixel=(M=r.pointMinPixel)!==null&&M!==void 0?M:Ae.pointMinPixel,i.pointMaxPixel=(C=r.pointMaxPixel)!==null&&C!==void 0?C:Ae.pointMaxPixel,i.gradientTexture=(R=r.gradientTexture)!==null&&R!==void 0?R:Ae.gradientTexture,i.brightness=(L=r.brightness)!==null&&L!==void 0?L:Ae.brightness,i.colorSaturation=(S=r.colorSaturation)!==null&&S!==void 0?S:Ae.colorSaturation,i.colorBrightness=(I=r.colorBrightness)!==null&&I!==void 0?I:Ae.colorBrightness,i.customShaders=(O=r.customShaders)!==null&&O!==void 0?O:Ae.customShaders,i.customShaderHash="",i.customShaderUniforms={},i.customShaderDefines={},i.floor=0,i.transparent=!0,i}return t.prototype.onBeforeCompile=function(e,r){var i=this,a,o,s=this.customShaders.filter(function(g){return g.type.includes(i.shaderType)}),l=s.reduce(function(g,v){return g+v.vertex.mainBefore},""),u=s.reduce(function(g,v){return g+v.vertex.mainStart},""),c=s.reduce(function(g,v){return g+v.vertex.mainEnd},""),f=s.reduce(function(g,v){return g+v.fragment.mainBefore},""),m=s.reduce(function(g,v){return g+v.fragment.mainStart},""),A=s.reduce(function(g,v){return g+v.fragment.mainModelColor},""),h=s.reduce(function(g,v){return g+v.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,f),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,m),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,c),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,h),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,A);var p=String((o=(a=this.clippers)===null||a===void 0?void 0:a.length)!==null&&o!==void 0?o:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,p),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,p),s.forEach(function(g){g.onBeforeCompile(e,r)})},t.prototype.refreshUniforms=function(e){var r,i,a=this.uniforms;a.diffuse&&a.diffuse.value.copy(this.color),a.opacity&&(a.opacity.value=this.opacity),a.color&&a.diffuse.value.copy(this.color),a.emissive&&a.emissive.value.copy(this.emissive).multiplyScalar(this.emissiveIntensity),a.map&&(a.map.value=this.map),a.alphaMap&&(a.alphaMap.value=this.alphaMap),a.specularMap&&(a.specularMap.value=this.specularMap),a.envMap&&(a.envMap.value=this.envMap,a.flipEnvMap.value=!((r=this.envMap)===null||r===void 0)&&r.isCubeTexture?-1:1,a.reflectivity.value=this.reflectivity,a.refractionRatio.value=this.refractionRatio,a.maxMipLevel.value=this.envMap&&(i=e==null?void 0:e.properties.get(this.envMap).__maxMipLevel)!==null&&i!==void 0?i:0),a.lightMap&&(a.lightMap.value=this.lightMap,a.lightMapIntensity.value=this.lightMapIntensity),a.aoMap&&(a.aoMap.value=this.aoMap,a.aoMapIntensity.value=this.aoMapIntensity),a.specular&&a.specular.value.copy(this.specular),a.shininess&&(a.shininess.value=Math.max(this.shininess,1e-4)),a.emissiveMap&&(a.emissiveMap.value=this.emissiveMap),a.bumpMap&&(a.bumpMap.value=this.bumpMap,a.bumpScale.value=this.bumpScale,this.side===d.BackSide&&(a.bumpScale.value*=-1)),a.normalMap&&(a.normalMap.value=this.normalMap,a.normalScale.value.copy(this.normalScale),this.side===d.BackSide&&a.normalScale.value.negate()),a.displacementMap&&(a.displacementMap.value=this.displacementMap,a.displacementScale.value=this.displacementScale,a.displacementBias.value=this.displacementBias);var o;this.map?o=this.map:this.specularMap?o=this.specularMap:this.displacementMap?o=this.displacementMap:this.normalMap?o=this.normalMap:this.bumpMap?o=this.bumpMap:this.alphaMap?o=this.alphaMap:this.emissiveMap&&(o=this.emissiveMap),o!==void 0&&(o.matrixAutoUpdate===!0&&o.updateMatrix(),a.uvTransform.value.copy(o.matrix));var s;this.aoMap?s=this.aoMap:this.lightMap&&(s=this.lightMap),s!==void 0&&(s.matrixAutoUpdate===!0&&s.updateMatrix(),a.uv2Transform.value.copy(s.matrix))},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(v){return v.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(v,y){return Object.assign(v,y.defines)},{}),l=Object.keys(this.customShaderDefines),u=0,c=l;u<c.length;u++){var f=c[u];delete this.defines[f]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var m=this.customShaders.reduce(function(v,y){return Object.assign(v,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,p=A;h<p.length;h++){var g=p[h];delete this.uniforms[g]}this.customShaderUniforms=m,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.refreshUniforms(e),this.shaderType==="none"?(this.depthWrite=!1,this.transparent=!0):(this.transparent=!1,this.depthWrite=!0,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.opacity<1&&(this.transparent=!0),this.alphaMap&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.transparent&&(this.depthWrite=!1),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1)),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.specular.copy(e.specular),this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.emissiveMap=e.emissiveMap,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.shininess=e.shininess,this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.modelAlpha=e.modelAlpha,this.progress=e.progress,this.transition=e.transition,this.opacity=e.opacity,this.constantColor=e.constantColor,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointColor=e.pointColor,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.floor=e.floor,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this},t}(d.ShaderMaterial);const Md=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("{vs|z-sy|n-sy||H0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsp-Pyv}}r-\n--znA-znv\x07V{rrH--sy|n-sy||V{qr\x07H\fH0vs-[bZlPYV]]R_`-K-=--{vs|z-Pyv}}r-pyv}}rh[bZlPYV]]R_`jH0r{qvsn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-]|v{`v rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-u|{Sy||V{qr\x07H<<u调整{vs|z-sy|n-p|y|`nnv|{H{vs|z-sy|n-p|y|Ovtu{rH0v{pyqr-Ip|zz|{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-Iy|tqr}uosl}nlsntzr{K0v{pyqr-Ipyv}}v{tl}yn{rl}nlsntzr{Krp@-nqwP|y|arz}rnr5rp@-p|y|9-sy|n-rz}rnr6\n----<<-将色温范围从-:>;=-到->;=-映射到实际的色温范围----sy|n-rz}-J-5rz}rnr-8->;=6-7-B===;=H-<<-范围从-=-到->====----<<-计算色温系数----sy|n-lsnp|9-tlsnp|9-olsnp|H----vs-5rz}-IJ-CC==;=6-\n--------lsnp|-J->;=H--------tlsnp|-J-=;@F==E>BDEDCF=>FC=DEA-7-y|t5rz}-<->==;=6-:-=;C@>EA>AA@DEEC?DAB=FEH--------olsnp|-J-rz}-IJ->F==;=-L-=;=-G-=;BA@?=CDEF>>=>FC=DEA@-7-y|t5rz}-<->==;=-:->=;=6-:->;>FC?BA=EF>AH----\f-ryr-\n--------lsnp|-J->;?F?F@C>EC=C?DAB=FE=A-7-}|5rz}-<->==;=-:-C=;=9-:=;>@@?=ADBF?6H--------tlsnp|-J->;>?FEF=EC=EFB?FA>>DCB-7-}|5rz}-<->==;=-:-C=;=9-:=;=DBB>AEAF?6H--------olsnp|-J->;=H----\f----<<-调整颜色----rp@-nqwrqP|y|H----nqwrqP|y|;-J-pynz}5p|y|;-7-lsnp|9-=;=9->;=6H----nqwrqP|y|;t-J-pynz}5p|y|;t-7-tlsnp|9-=;=9->;=6H----nqwrqP|y|;o-J-pynz}5p|y|;o-7-olsnp|9-=;=9->;=6H----r{-nqwrqP|y|H\frp@-to?u5rp@-p6-\n----rpA-X-J-rpA5=;=9-:>;=-<-@;=9-?;=-<-@;=9-:>;=6H----rpA-}-J-zv\x075rpA5p;ot9-X; 69-rpA5p;to9-X;\x07\b69-r}5p;o9-p;t66H----rpA-\0-J-zv\x075rpA5};\x07\b9-p;69-rpA5p;9-};\b \x0769-r}5};\x079-p;66H----sy|n-q-J-\0;\x07-:-zv{5\0;9-\0;\b6H----sy|n-r-J->;=r:>=H----r{-rp@5no5\0; -8-5\0;-:-\0;\b6-<-5C;=-7-q-8-r669-q-<-5\0;\x07-8-r69-\0;\x076H\frp@-u?to5rp@-p6-\n----rpA-X-J-rpA5>;=9-?;=-<-@;=9->;=-<-@;=9-@;=6H----rp@-}-J-no5snp5p;\x07\x07\x07-8-X;\x07\b 6-7-C;=-:-X;6H----r{-p; -7-zv\x075X;\x07\x07\x079-pynz}5}-:-X;\x07\x07\x079-=;=9->;=69-p;\b6H\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--<<-JJJ-点大小剔除-JJJ--vs-5]|v{`v r-I-=;==>6-\n----qvpnqH--\f--<<-JJJ-前置裁切计算-JJJ--0vs-[bZlPYV]]R_`-K-=----o||y-pyv}}rqH----rpA-pyv}}r]|vv|{H----0}ntzn-{|yyly||}ln----s|-5-v{-v-J-=H-v-I-[bZlPYV]]R_`H-v-88-6-\n------pyv}}r]|vv|{-J-pyv}}rh-v-j;znv\x07V{rr-7-d|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5sy||-:-pyv}}rh-v-j;sy||V{qr\x076-I->;=6H------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--<<-JJJJJJJJJJJJJJJJ--<<-JJJ-形状裁切-JJJ--0vs-qrsv{rq5b`Rl]\\V[al`UN]RlPV_PYR6----sy|n--J-?;=-7-tyl]|v{P||q;\x07-:->;=H----sy|n--J-?;=-7-tyl]|v{P||q;\b-:->;=H----sy|n-pp-J-7-8-7H----vs-5]|v{`v r-K-@;=-33-pp-K->;=6-\n------qvpnqH----\f--0r{qvs--<<-JJJJJJJJJJJJJ--0v{pyqr-Ipyv}}v{tl}yn{rlsntzr{K--0v{pyqr-Iy|tqr}uoslsntzr{K--<<-JJJ-颜色-JJJ--rpA-sv{nyP|y|-J-_TOa|Yv{rn5rpA5P|y|9-|}npv\b66H--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----0vs-qrsv{rq5b`Rl]\\V[alONPXlUVQQR[6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------qvpnqH------\f----0ryvs-qrsv{rq5b`Rl]\\V[alONPXlQN_X6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-d|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------sv{nyP|y|;\x07\b -J-sv{nyP|y|;\x07\b -7-=;EH------\f----0r{qvs--0r{qvs--tylSntP|y|-J-sv{nyP|y|H--<<-JJJJJJJJJJJ--<<-JJJ-纯色-JJJ--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9-|}npv\b6H--0r{qvs--<<-JJJJJJJJJJJ--<<-JJJ-楼层显示-JJJ--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-K-:=;=>-33-no5sy||-:-u|{Sy||V{qr\x076-K-=;FF6-\n----sy||\\}npv\b-J-=;>-7-zv{55>;=-8-PnzrnQvrpv|{;\b69->;=6H--\f--tylSntP|y|;n-J-tylSntP|y|;n-7-sy||\\}npv\bH--<<-JJJJJJJJJJJJJJ--tylSntP|y|;n-J-tylSntP|y|;n-7-z|qryNy}unH--<<提取亮度--rp@-toP|y|-J-tylSntP|y|;toH--rp@-uP|y|-J-to?u5toP|y|6H--rp@-sv{nyU`c-J-rp@5uP|y|;\x079-uP|y|;\b-8-p|y|`nnv|{9-uP|y|; -8-p|y|Ovtu{r6H--tylSntP|y|;to-J-u?to5sv{nyU`c6H--ZNV[lZ\\QRYlP\\Y\\_--0v{pyqr-I|{rzn}}v{tlsntzr{K--0v{pyqr-Ir{p|qv{tlsntzr{K--0v{pyqr-Is|tlsntzr{K--0v{pyqr-I}rzyv}yvrqlny}unlsntzr{K--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs--0vs-qrsv{rq5b`RlU^ldRVTUa6----sy|n-qvn{pr-J-?;=-7-yr{tu5tyl]|v{P||q;\x07\b-:-=;B6H----sy|n-rvtu-J-zn\x075=;=9->;=-:-qvn{pr6H----rvtu-J-}|5rvtu9->;B6H----tylSntP|y|;n-J-rvtuH----tylSntP|y|;\x07\b -J-tylSntP|y|;\x07\b -7-rvtuH--0r{qvs--ZNV[lR[Q\f"),Cd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvs{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H{vs|z-sy|n-}|v{`pnyrH{vs|z-sy|n-}|v{Zv{]v\x07ryH{vs|z-sy|n-}|v{Zn\x07]v\x07ryH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-tr|zrvpR|H{vs|z-rp@-z|qryO|{qv{tZn\x07H{vs|z-rp@-z|qryO|{qv{tZv{Hn\bv{t-rpA-d|yq]|vv|{Hn\bv{t-rp@-PnzrnQvrpv|{Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-]|v{`v rH0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0v{pyqr-Ip|zz|{K0v{pyqr-Is|tl}nlrr\x07K0v{pyqr-Iz|}untrl}nlrr\x07K0v{pyqr-Iy|tqr}uosl}nlrr\x07K0v{pyqr-Ipyv}}v{tl}yn{rl}nlrr\x07Krp@-trP|y|O\bUrvtu5nz}yr?Q-tnqvr{ar\x07r9-rpA-d|yq]|vv|{6-\n--<<-sy|n--J-5d|yq]|vv|{;\b-:-z|qryO|{qv{tZv{;\b6-<-5z|qryO|{qv{tZn\x07;\b-:-z|qryO|{qv{tZv{;\b6H--sy|n--J-d|yq]|vv|{;\b-<->=;=H--r{-r\x07r?Q5tnqvr{ar\x07r9-rp?59-=;B66;toH\fZNV[lORS\\_R|vq-znv{56-\n--ZNV[l`aN_a--0v{pyqr-Iortv{lrr\x07K--d|yq]|vv|{-J-rpA5n{s|zrq9->;=6H--0vsqrs-b`RlV[`aN[PV[T----d|yq]|vv|{-J-v{n{prZnv\x07-7-d|yq]|vv|{H--0r{qvs--d|yq]|vv|{-J-z|qryZnv\x07-7-d|yq]|vv|{H--rpA-z]|vv|{-J-vrZnv\x07-7-d|yq]|vv|{H--tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H--0v{pyqr-Iy|tqr}uoslrr\x07K--0v{pyqr-Ipyv}}v{tl}yn{rlrr\x07K--zn@-pnzrn_|nv|{Znv\x07-J-zn@5vrZnv\x07h=jh=j9-vrZnv\x07h>jh=j9-vrZnv\x07h?jh=j9-vrZnv\x07h=jh>j9-vrZnv\x07h>jh>j9-vrZnv\x07h?jh>j9-vrZnv\x07h=jh?j9-vrZnv\x07h>jh?j9-vrZnv\x07h?jh?j6H--PnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9-=;=9-:>;=66H--<<传递nvor的p|y|到s里使用--<<动态调整}|v{`v r--sy|n-rny]|v{`v r-J-}|v{`pnyr-7-}v\x07ry_nv|H--0vs-qrsv{rq5b`Rl]\\V[al`VgRlTR\\ZRa_VP6----rny]|v{`v r-7J-tr|zrvpR|H----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0ryvs-qrsv{rq5b`Rl]\\V[al`VgRlNaaR[bNaV\\[6----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0r{qvs--tyl]|v{`v r-J-pynz}5rny]|v{`v r9-}|v{Zv{]v\x07ry-7-}v\x07ry_nv|9-}|v{Zn\x07]v\x07ry-7-}v\x07ry_nv|6H--]|v{`v r-J-tyl]|v{`v rH--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-d|yq]|vv|{6H--0ryr----P|y|-J-p|y|H--0r{qvs--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----[|zny-J-{|znyv r5zn@5z|qryZnv\x076-7-{|zny6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--0vs-qrsv{rq5b`RlU^lQR]aU6----<<-sy|n-}|wSnp|-J-:=;B-7-r|yv|{;\b-<-5n{5s|-<-?;=6-7-z]|vv|{; 6H----<<-sy|n-_nqv-J-rny]|v{`v r-<-}|wSnp|H----sy|n-|vtv{nyQr}u-J-tyl]|vv|{;H----sy|n-nqwrqQr}u-J-|vtv{nyQr}u-8-=;>H----sy|n-nqw-J-nqwrqQr}u-<-|vtv{nyQr}uH----z]|vv|{;\x07\b -J-z]|vv|{;\x07\b -7-nqwH----tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H--0r{qvs--0v{pyqr-I|yq}|lrr\x07K--0v{pyqr-Is|tlrr\x07K--ZNV[lR[Q\f");var Id=Object.assign({pointScale:new d.Uniform(1),pointMinPixel:new d.Uniform(1),pointMaxPixel:new d.Uniform(1),opacity:new d.Uniform(1),gradientTexture:new d.Uniform(null),modelAlpha:new d.Uniform(0),clippers:new d.Uniform([]),shownFloorIndex:new d.Uniform(-1),constantColor:new d.Uniform(null),geometricError:new d.Uniform(0),pixelRatio:new d.Uniform(1),resolution:new d.Uniform(new d.Vector2(512,512)),floor:new d.Uniform(0),brightness:new d.Uniform(1),modelBoundingMin:new d.Uniform(new d.Vector3),modelBoundingMax:new d.Uniform(new d.Vector3),colorSaturation:new d.Uniform(0),colorBrightness:new d.Uniform(0)},d.UniformsUtils.clone(d.UniformsLib.fog)),ii=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c,f,m,A,h,p,g,v,y,b,x,w,E,M,C,R,L,S,I=n.call(this,{vertexShader:Cd,fragmentShader:Md,uniforms:d.UniformsUtils.clone(Id),lights:!1,clipping:!0,defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,USE_HQ_WEIGHT:!1,USE_HQ_DEPTH:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_VERTEX_MARK:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_POINT_NORMAL:!1,USE_POINT_SHAPE_CIRCLE:!1,USE_POINT_SIZE_ATTENUATION:!1,USE_POINT_SIZE_GEOMETRIC:!1,USE_POINT_BACK_HIDDEN:!1,USE_POINT_BACK_DARK:!1}})||this,O;return I.customShaderHash="",I.customShaderUniforms={},I.customShaderDefines={},Object.defineProperties(I,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(P){this.uniforms.constantColor.value=P;var F=this.defines.USE_CONSTANT_COLOR,V=P!==null;F!==V&&(this.defines.USE_CONSTANT_COLOR=V,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(P){this.uniforms.opacity.value=P}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(P){this.uniforms.modelAlpha.value=P}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(P){this.uniforms.shownFloorIndex.value=P}},clippers:{get:function(){return O},set:function(P){O!==P&&(O=P,this.uniforms.clippers.value=(O||[]).map(function(F){var V=typeof F.floorIndex=="number"?F.floorIndex:-1,D=new d.Matrix4().getInverse(F.clippingBoxMatrix);return{matrixInverse:D,floorIndex:V}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(P){var F=P==="ALTITUDE";this.defines.USE_POINT_COLOR_ALTITUDE!==F&&(this.defines.USE_POINT_COLOR_ALTITUDE=F,this.needsUpdate=!0)}},pointSize:{get:function(){return this.defines.USE_POINT_SIZE_GEOMETRIC===!0?"GEOMETRIC":this.defines.USE_POINT_SIZE_ATTENUATION===!0?"ATTENUATION":"FIXED"},set:function(P){var F=P==="ATTENUATION",V=P==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==V&&(this.defines.USE_POINT_SIZE_GEOMETRIC=V,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==F&&(this.defines.USE_POINT_SIZE_ATTENUATION=F,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(P){var F=P==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==F&&(this.defines.USE_POINT_SHAPE_CIRCLE=F,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(P){this.uniforms.pointScale.value=P}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(P){var F=P==="HIDDEN",V=P==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==F&&(this.defines.USE_POINT_BACK_HIDDEN=F,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==V&&(this.defines.USE_POINT_BACK_DARK=V,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(P){this.uniforms.pointMinPixel.value=P}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(P){this.uniforms.pointMaxPixel.value=P}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(P){P!==this.defines.USE_EDL&&(this.defines.USE_EDL=P,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(P){P!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=P,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(P){P!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=P,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(P){this.uniforms.gradientTexture.value=P}},floor:{get:function(){return this.uniforms.floor.value},set:function(P){this.uniforms.floor.value=P}},brightness:{get:function(){return this.uniforms.brightness.value},set:function(P){this.uniforms.brightness.value=P}},colorSaturation:{get:function(){return this.uniforms.colorSaturation.value},set:function(P){this.uniforms.colorSaturation.value=P}},colorBrightness:{get:function(){return this.uniforms.colorBrightness.value},set:function(P){this.uniforms.colorBrightness.value=P}}}),I.pano0=(r=e.pano0)!==null&&r!==void 0?r:Ae.pano0,I.pano1=(i=e.pano1)!==null&&i!==void 0?i:Ae.pano1,I.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:Ae.modelAlpha,I.progress=(o=e.progress)!==null&&o!==void 0?o:Ae.progress,I.transition=(s=e.transition)!==null&&s!==void 0?s:Ae.transition,I.constantColor=(l=e.constantColor)!==null&&l!==void 0?l:Ae.constantColor,I.opacity=(u=e.opacity)!==null&&u!==void 0?u:Ae.opacity,I.floorStyle=(c=e.floorStyle)!==null&&c!==void 0?c:Ae.floorStyle,I.shownFloorIndex=(f=e.shownFloorIndex)!==null&&f!==void 0?f:Ae.shownFloorIndex,I.clippers=(m=e.clippers)!==null&&m!==void 0?m:Ae.clippers,I.useEDL=(A=e.useEDL)!==null&&A!==void 0?A:Ae.useEDL,I.useHQWeight=(h=e.useHQWeight)!==null&&h!==void 0?h:Ae.useHQWeight,I.useHQDepth=(p=e.useHQDepth)!==null&&p!==void 0?p:Ae.useHQDepth,I.pointColor=(g=e.pointColor)!==null&&g!==void 0?g:Ae.pointColor,I.pointShape=(v=e.pointShape)!==null&&v!==void 0?v:Ae.pointShape,I.pointSize=(y=e.pointSize)!==null&&y!==void 0?y:Ae.pointSize,I.pointScale=(b=e.pointScale)!==null&&b!==void 0?b:Ae.pointScale,I.pointBack=(x=e.pointBack)!==null&&x!==void 0?x:Ae.pointBack,I.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:Ae.pointMinPixel,I.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:Ae.pointMaxPixel,I.gradientTexture=(M=e.gradientTexture)!==null&&M!==void 0?M:Ae.gradientTexture,I.brightness=(C=e.brightness)!==null&&C!==void 0?C:Ae.brightness,I.colorSaturation=(R=e.colorSaturation)!==null&&R!==void 0?R:Ae.colorSaturation,I.colorBrightness=(L=e.colorBrightness)!==null&&L!==void 0?L:Ae.colorBrightness,I.customShaders=(S=e.customShaders)!==null&&S!==void 0?S:Ae.customShaders,I.customShaderHash="",I.floor=0,I.transparent=!0,I}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=this.customShaders.filter(function(p){return p.type.includes("pointcloud")}),s=o.reduce(function(p,g){return p+g.vertex.mainBefore},""),l=o.reduce(function(p,g){return p+g.vertex.mainStart},""),u=o.reduce(function(p,g){return p+g.vertex.mainEnd},""),c=o.reduce(function(p,g){return p+g.fragment.mainBefore},""),f=o.reduce(function(p,g){return p+g.fragment.mainStart},""),m=o.reduce(function(p,g){return p+g.fragment.mainModelColor},""),A=o.reduce(function(p,g){return p+g.fragment.mainEnd},"");e.vertexShader=e.vertexShader.replace(/MAIN_BEFORE/g,s),e.fragmentShader=e.fragmentShader.replace(/MAIN_BEFORE/g,c),e.vertexShader=e.vertexShader.replace(/MAIN_START/g,l),e.fragmentShader=e.fragmentShader.replace(/MAIN_START/g,f),e.vertexShader=e.vertexShader.replace(/MAIN_END/g,u),e.fragmentShader=e.fragmentShader.replace(/MAIN_END/g,A),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,m);var h=String((a=(i=this.clippers)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,h),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,h),o.forEach(function(p){p.onBeforeCompile(e,r)})},t.prototype.update=function(e,r,i){var a="".concat(i.id,":").concat(i.materialVersion);a!==this.syncModelVersion&&(Object.assign(this,i.getMaterial()),this.syncModelVersion=a);var o=this.customShaders.map(function(v){return v.getHash()}).join("");this.customShaderHash!==o&&(this.customShaderHash=o,this.needsUpdate=!0);for(var s=this.customShaders.reduce(function(v,y){return Object.assign(v,y.defines)},{}),l=Object.keys(this.customShaderDefines),u=0,c=l;u<c.length;u++){var f=c[u];delete this.defines[f]}this.customShaderDefines=s,Object.assign(this.defines,this.customShaderDefines);for(var m=this.customShaders.reduce(function(v,y){return Object.assign(v,y.uniforms)},{}),A=Object.keys(this.customShaderUniforms),h=0,p=A;h<p.length;h++){var g=p[h];delete this.uniforms[g]}this.customShaderUniforms=m,Object.assign(this.uniforms,this.customShaderUniforms),this.visible=!0,this.transparent=!1,this.shownFloorIndex>-1&&(this.transparent=this.shownFloorIndex!==this.floor),this.modelAlpha<1&&(this.transparent=!0),this.opacity<1&&(this.transparent=!0),this.brightness<1&&(this.transparent=!0),this.depthWrite=!0,this.depthTest=!0,this.useEDL&&(this.transparent=!1),this.useHQWeight?(this.depthWrite=!1,this.blending=d.CustomBlending,this.blendSrc=d.SrcAlphaFactor,this.blendSrcAlpha=d.SrcAlphaFactor,this.blendDst=d.OneFactor,this.blendDstAlpha=d.OneFactor):(this.blending=d.NormalBlending,this.blendDst=d.OneMinusSrcAlphaFactor,this.blendEquation=d.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null),this.floorStyle==="VISIBILITY"&&this.shownFloorIndex!==-1&&this.floor!==this.shownFloorIndex&&(this.visible=!1),this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution),this.uniforms.modelBoundingMax.value.copy(i.bounding.max),this.uniforms.modelBoundingMin.value.copy(i.bounding.min)},t.prototype.copy=function(e){return n.prototype.copy.call(this,this),this.customShaders=e.customShaders,this.pano0=e.pano0,this.pano1=e.pano1,this.progress=e.progress,this.transition=e.transition,this.shownFloorIndex=e.shownFloorIndex,this.brightness=e.brightness,this.clippers=e.clippers,this.constantColor=e.constantColor,this.modelAlpha=e.modelAlpha,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.pointColor=e.pointColor,this.pointSize=e.pointSize,this.pointShape=e.pointShape,this.pointScale=e.pointScale,this.pointBack=e.pointBack,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.gradientTexture=e.gradientTexture,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this},t}(d.ShaderMaterial),nn=function(n){se(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.premultipliedAlpha,o=a===void 0?!0:a,s=e.stencil,l=s===void 0?!0:s,u=e.backgroundColor,c=u===void 0?1579548:u,f=e.backgroundAlpha,m=f===void 0?1:f,A=e.pixelRatio,h=A===void 0?1:A,p=e.antialias,g=p===void 0?!1:p,v=e.webgl2,y=e.logarithmicDepthBuffer,b=e.precision,x=this,w={antialias:g,alpha:!0,depth:!0,preserveDrawingBuffer:i,stencil:l,premultipliedAlpha:o,powerPreference:"high-performance"},E={logarithmicDepthBuffer:y,precision:b};if(v){var M=document.createElement("canvas"),C=M.getContext("webgl2",w);C?x=n.call(this,k(k(k({},w),E),{antialias:!0,canvas:M,context:C}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),x=n.call(this,k(k({},w),E))||this)}else x=n.call(this,k(k({},w),E))||this;return x.setPixelRatio(h),x.setClearColor(c,m),x.outputEncoding=d.sRGBEncoding,x.autoClear=!0,x}return t}(d.WebGLRenderer),U0=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.add.apply(this,e)},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.remove.apply(this,e)},t}(d.Scene);function Nt(n,t){var e=Math.abs(Math.cos(n.latitude)),r=-Math.sin(n.longitude)*e,i=-Math.sin(n.latitude),a=-Math.cos(n.longitude)*e;return t?t.set(r,i,a):new d.Vector3(r,i,a)}var Td=1,Pd=.1,Bd=2e3,fi=Math.PI*2,os=Math.PI/2;function ia(n){return n>0&&n<=fi?n:(n%fi+fi)%fi}function Rd(n,t,e,r){e=Math.pow(e,4);for(var i=0;i<16;i++)r.elements[i]=n.elements[i]+(t.elements[i]-n.elements[i])*e;return r}var q0=function(n){se(t,n);function t(e,r,i,a,o,s,l){r===void 0&&(r=Td),i===void 0&&(i=Pd),a===void 0&&(a=Bd),o===void 0&&(o=new d.Vector2),s===void 0&&(s=new d.Vector2(512,512)),l===void 0&&(l=1);var u=n.call(this)||this;u.fov=e,u.aspect=r,u.near=i,u.far=a,u.perspToOrtho=o,u.resolution=s,u.pixelRatio=l,u.time=0,u.needsRender=!0,u.refineModel=!0,u.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new d.Vector3},u.computePose(),u.perspectiveCamera=new d.PerspectiveCamera(u.fov,u.aspect,.001,u.far);var c=Math.max(u.orthoDistance,.01)*Math.tan(.5*u.fov/180*Math.PI),f=-.5*u.aspect*2*c;return u.orthographicCamera=new d.OrthographicCamera(f,-f,c,-c,.001,u.far),u.computeProjectionMatrix(),u.lastValues={position:u.position.clone(),quaternion:u.quaternion.clone(),scale:u.scale.clone(),fov:u.fov,aspect:u.aspect,near:u.near,far:u.far,orthoDistance:u.orthoDistance,perspToOrtho:u.perspToOrtho.clone()},u.type=u.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",u}return Object.defineProperty(t.prototype,"orthoDistance",{get:function(){return this.pose.distance>1?this.pose.distance:1+(this.pose.distance-1)*this.perspToOrtho.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.zoom:this.type==="PerspectiveCamera"?this.perspectiveCamera.zoom:1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.top:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.bottom:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.left:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.type==="OrthographicCamera"?this.orthographicCamera.right:0},enumerable:!1,configurable:!0}),t.prototype.getDirection=function(e){return Nt(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0),this.updateMatrix();var r=this.matrix.elements;return this.pose.latitude=Math.asin(fe(r[9],-1,1)),Math.abs(r[9])<.9999999?this.pose.longitude=ia(Math.atan2(r[8],r[10])):this.pose.longitude=ia(Math.atan2(-r[2],r[0])),this.pose.fov=this.fov,this.pose.distance=e,this.pose.offset=new d.Vector3(-r[8],-r[9],-r[10]).setLength(this.pose.distance).add(this.position),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,l=ia((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),u=Math.max(-os+1e-4,Math.min(os-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),c=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,f=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,m=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,A=Nt({longitude:l,latitude:u}).normalize();return this.position.set(0,0,0),this.lookAt(A),this.position.add(m).sub(A.clone().setLength(f)),this.fov!==c&&(this.fov=c,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=l,this.pose.latitude=u,this.pose.fov=c,this.pose.distance=f,this.pose.offset.copy(m),this.needsRender=!0,this},t.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,distance:this.pose.distance,offset:this.pose.offset.clone()}},t.prototype.computeProjectionMatrix=function(){Rd(this.orthographicCamera.projectionMatrix,this.perspectiveCamera.projectionMatrix,1-this.perspToOrtho.x,this.projectionMatrix),this.projectionMatrixInverse.getInverse(this.projectionMatrix),this.needsRender=!0},t.prototype.setViewOffset=function(e,r,i,a,o,s){this.perspectiveCamera.setViewOffset(e,r,i,a,o,s),this.orthographicCamera.setViewOffset(e,r,i,a,o,s),this.computeProjectionMatrix()},t.prototype.clearViewOffset=function(){this.perspectiveCamera.clearViewOffset(),this.orthographicCamera.clearViewOffset(),this.computeProjectionMatrix()},t.prototype.updateProjectionMatrix=function(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix(),this.computeProjectionMatrix()},Object.defineProperty(t.prototype,"perspectiveProjectionMatrix",{get:function(){return this.perspectiveCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveProjectionMatrixInverse",{get:function(){return this.perspectiveCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrix",{get:function(){return this.orthographicCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrixInverse",{get:function(){return this.orthographicCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),t.prototype.updateTime=function(e,r){this.time=e;var i=!1;if((this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.aspect!==this.aspect)&&(this.perspectiveCamera.fov=this.fov,this.perspectiveCamera.near=this.near,this.perspectiveCamera.far=this.far,this.perspectiveCamera.aspect=this.aspect,this.perspectiveCamera.updateProjectionMatrix(),i=!0),!this.lastValues.position.equals(this.position)||!this.lastValues.quaternion.equals(this.quaternion)||!this.lastValues.scale.equals(this.scale)||!this.lastValues.perspToOrtho.equals(this.perspToOrtho)||this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.orthoDistance!==this.orthoDistance||this.lastValues.aspect!==this.aspect){var a=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),o=-.5*this.aspect*2*a;this.orthographicCamera.left=o,this.orthographicCamera.right=-o,this.orthographicCamera.top=a,this.orthographicCamera.bottom=-a,this.orthographicCamera.near=this.near,this.orthographicCamera.far=this.far,this.orthographicCamera.updateProjectionMatrix(),i=!0}i&&this.computeProjectionMatrix(),this.lastValues.position.copy(this.position),this.lastValues.quaternion.copy(this.quaternion),this.lastValues.scale.copy(this.scale),this.lastValues.fov=this.fov,this.lastValues.aspect=this.aspect,this.lastValues.near=this.near,this.lastValues.far=this.far,this.lastValues.orthoDistance=this.orthoDistance,this.lastValues.perspToOrtho.copy(this.perspToOrtho),this.type=this.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera"},Object.defineProperty(t.prototype,"isPerspectiveCamera",{get:function(){return this.perspToOrtho.x<1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOrthographicCamera",{get:function(){return this.perspToOrtho.x>=1},enumerable:!1,configurable:!0}),t.prototype.copy=function(e,r){return n.prototype.copy.call(this,e,r),this.fov=e.fov,this.aspect=e.aspect,this.near=e.near,this.far=e.far,this.perspToOrtho.copy(e.perspToOrtho),this.updateTime(he(),0),this},t}(d.Camera),mt;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(mt||(mt={}));var H0=1e-6,ze=new d.Vector3,Ur=new d.Matrix4,Rr=new d.Vector3,Fr=new d.Vector3,kr=new d.Vector3,Ga=new d.Vector3,aa=new d.Box3,oa=new d.Sphere,ss=new d.Matrix4,sa=new d.Ray,pt=new d.Object3D,us=new d.Frustum;function G0(n,t){var e=n.elements;return t.setFromRotationMatrix(Ur.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1)),t}var Hn=function(){function n(t){t===void 0&&(t=[]),this.planes=t}return Object.defineProperty(n,"MASK_OUTSIDE",{get:function(){return 4294967295},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INSIDE",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"MASK_INDETERMINATE",{get:function(){return 2147483647},enumerable:!1,configurable:!0}),n.prototype.setFromFrustum=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.setFromCamera=function(t){return Ur.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),us.setFromProjectionMatrix(Ur),this.setFromFrustum(us),this},n.prototype.applyMatrix4=function(t){for(var e=0,r=this.planes;e<r.length;e++){var i=r[e];i.applyMatrix4(t)}},n.prototype.copy=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.computeVisibility=function(t){for(var e=mt.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case mt.Outside:return mt.Outside;case mt.Intersecting:e=mt.Intersecting;break}}return e},n.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===n.MASK_OUTSIDE||e===n.MASK_INSIDE)return e;for(var r=n.MASK_INSIDE,i=Math.min(32,this.planes.length),a=0;a<i;++a){var o=1<<a;if(e&o){var s=this.planes[a],l=t.intersectPlane(s);if(l===mt.Outside)return n.MASK_OUTSIDE;l===mt.Intersecting&&(r|=o)}}return r},n}(),K0=function(){function n(){this.type="box",this.center=new d.Vector3,this.halfSize=new d.Vector3,this.rotation=new d.Matrix3}return n.prototype.fromJson=function(t){var e=t.box;this.center.set(e[0],e[1],e[2]);var r=e[3],i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],u=e[9],c=e[10],f=e[11],m=Math.sqrt(r*r+i*i+a*a),A=Math.sqrt(o*o+s*s+l*l),h=Math.sqrt(u*u+c*c+f*f);this.halfSize.set(m,A,h);var p=this.halfSize.toArray().reduce(function(g,v){return g+v},0);return(isNaN(p)||p<=0)&&this.halfSize.setScalar(H0),this.rotation.fromArray([r/m,i/m,a/m,o/A,s/A,l/A,u/h,c/h,f/h]),isNaN(this.rotation.toArray().reduce(function(g,v){return g+v},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(Rr,Fr,kr),{box:Et(Et(Et(Et([],this.center.toArray(),!0),Rr.multiplyScalar(this.halfSize.x).toArray(),!0),Fr.multiplyScalar(this.halfSize.y).toArray(),!0),kr.multiplyScalar(this.halfSize.z).toArray(),!0)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.halfSize.copy(t.halfSize),this.rotation.copy(t.rotation),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.applyMatrix4=function(t){return pt.position.copy(this.center),G0(this.rotation,pt.quaternion),pt.scale.copy(this.halfSize),pt.matrix.compose(pt.position,pt.quaternion,pt.scale),pt.matrix.premultiply(t),pt.matrix.decompose(pt.position,pt.quaternion,pt.scale),this.center.copy(pt.position),this.rotation.setFromMatrix4(Ur.makeRotationFromQuaternion(pt.quaternion)),this.halfSize.copy(pt.scale),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.rotation.elements,r=t.x-this.center.x,i=t.y-this.center.y,a=t.z-this.center.z,o=0,s;return s=r*e[0]+i*e[1]+a*e[2],s<0&&(s=-s),s-=this.halfSize.x,s>0&&(o+=s*s),s=r*e[3]+i*e[4]+a*e[5],s<0&&(s=-s),s-=this.halfSize.y,s>0&&(o+=s*s),s=r*e[6]+i*e[7]+a*e[8],s<0&&(s=-s),s-=this.halfSize.z,s>0&&(o+=s*s),o},n.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSquaredToPoint(t))},n.prototype.distanceToPlane=function(t){var e=t.projectPoint(this.center,new d.Vector3);return this.distanceToPoint(e)},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(Rr,Fr,kr),Rr.setLength(this.halfSize.x),Fr.setLength(this.halfSize.y),kr.setLength(this.halfSize.z),t.expandByPoint(ze.copy(this.center).add(Rr)),t.expandByPoint(ze.copy(this.center).sub(Rr)),t.expandByPoint(ze.copy(this.center).add(Fr)),t.expandByPoint(ze.copy(this.center).sub(Fr)),t.expandByPoint(ze.copy(this.center).add(kr)),t.expandByPoint(ze.copy(this.center).sub(kr)),t},n.prototype.toGeometry=function(){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),e=new Float32Array(8*3);ze.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),ze.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),ze.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),ze.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),ze.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),ze.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),ze.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),ze.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,21);var r=new d.BufferGeometry;return r.setIndex(new d.BufferAttribute(t,1)),r.setAttribute("position",new d.BufferAttribute(e,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},n.prototype.intersectPlane=function(t){var e=this.center,r=t.normal,i=this.rotation.elements,a=this.halfSize,o=r.x,s=r.y,l=r.z,u=Math.abs(o*i[0]*a.x+s*i[1]*a.x+l*i[2]*a.x)+Math.abs(o*i[3]*a.y+s*i[4]*a.y+l*i[5]*a.y)+Math.abs(o*i[6]*a.z+s*i[7]*a.z+l*i[8]*a.z),c=r.dot(e)+t.constant;return c<=-u?mt.Outside:c>=u?mt.Inside:mt.Intersecting},n.prototype.intersectRay=function(t,e){if(Ga.copy(this.halfSize).multiplyScalar(2),aa.setFromCenterAndSize(ze.set(0,0,0),Ga),this.rotation.extractBasis(Rr,Fr,kr),Ur.makeBasis(Rr,Fr,kr),Ur.setPosition(this.center),ss.getInverse(Ur),sa.copy(t).applyMatrix4(ss),aa.containsPoint(sa.origin))return!0;var r=sa.intersectBox(aa,ze);return r?e!==void 0?r.applyMatrix4(Ur).distanceTo(t.origin)<e:!0:!1},n}(),j0=function(){function n(){this.type="sphere",this.center=new d.Vector3,this.radius=-1}return n.prototype.fromJson=function(t){var e=t.sphere;return this.center.set(e[0],e[1],e[2]),this.radius=Math.max(e[3],H0),this},n.prototype.toJson=function(){return{sphere:Et(Et([],this.center.toArray(),!0),[this.radius],!1)}},n.prototype.copy=function(t){return this.center.copy(t.center),this.radius=t.radius,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){return t.setFromCenterAndSize(this.center,Ga.set(1,1,1).multiplyScalar(this.radius*2)),t},n.prototype.toGeometry=function(){for(var t=32,e=new Float32Array(t*3*2*2),r=0;r<=t;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+Math.sin(i)*this.radius,e[r*6+2]=this.center.z+0,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+Math.sin(i)*this.radius,e[r*6+5]=this.center.z+0}for(var r=t;r<=t*2;r++){var i=0;i=r/t*Math.PI*2,e[r*6+0]=this.center.x+Math.cos(i)*this.radius,e[r*6+1]=this.center.y+0,e[r*6+2]=this.center.z+Math.sin(i)*this.radius,i=(r+1)/t*Math.PI*2,e[r*6+3]=this.center.x+Math.cos(i)*this.radius,e[r*6+4]=this.center.y+0,e[r*6+5]=this.center.z+Math.sin(i)*this.radius}var a=new d.BufferGeometry;return a.setAttribute("position",new d.BufferAttribute(e,3)),a.computeBoundingBox(),a.computeBoundingSphere(),a},n.prototype.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredToPoint=function(t){var e=this.distanceToPoint(t);return e*e},n.prototype.distanceToPoint=function(t){var e=this.center.distanceTo(t)-this.radius;return e<=0?0:e},n.prototype.distanceToPlane=function(t){var e=Math.abs(t.distanceToPoint(this.center));return Math.max(0,e-this.radius)},n.prototype.intersectPlane=function(t){var e=this.center,r=this.radius,i=t.normal,a=i.dot(e)+t.constant;return a<-r?mt.Outside:a<r?mt.Intersecting:mt.Inside},n.prototype.intersectRay=function(t,e){if(oa.set(this.center,this.radius),oa.containsPoint(t.origin))return!0;var r=t.intersectSphere(oa,ze);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),Fd=function(){function n(){throw this.type="regin",this.west=0,this.south=0,this.east=0,this.north=0,this.minHeight=0,this.maxHeight=0,new Error("Region bounding volume not supported.")}return n.prototype.fromJson=function(t){var e=t.region;return this.west=e[0],this.south=e[1],this.east=e[2],this.north=e[3],this.minHeight=e[4],this.maxHeight=e[5],this},n.prototype.toJson=function(){return{region:[this.west,this.south,this.east,this.north,this.minHeight,this.maxHeight]}},n.prototype.copy=function(t){return this.west=t.west,this.south=t.south,this.east=t.east,this.north=t.north,this.minHeight=t.minHeight,this.maxHeight=t.maxHeight,this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.getBoundingBox=function(t){throw new Error("not implemented")},n.prototype.toGeometry=function(){throw new Error("not implemented")},n.prototype.applyMatrix4=function(t){throw new Error("not implemented")},n.prototype.getCenter=function(t){throw new Error("not implemented")},n.prototype.distanceToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceSquaredToPoint=function(t){throw new Error("not implemented")},n.prototype.distanceToPlane=function(t){throw new Error("not implemented")},n.prototype.intersectPlane=function(t){throw new Error("not implemented")},n.prototype.intersectRay=function(t){throw new Error("not implemented")},n}();function xi(n){if("box"in n)return new K0().fromJson(n);if("sphere"in n)return new j0().fromJson(n);if("region"in n)return new Fd().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var hi=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new d.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),kd=function(){var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),t=new Float32Array(8*3);ze.set(1,1,1).toArray(t,0),ze.set(-1,1,1).toArray(t,3),ze.set(-1,-1,1).toArray(t,6),ze.set(1,-1,1).toArray(t,9),ze.set(1,1,-1).toArray(t,12),ze.set(-1,1,-1).toArray(t,15),ze.set(-1,-1,-1).toArray(t,18),ze.set(1,-1,-1).toArray(t,21);var e=new d.BufferGeometry;return e.setIndex(new d.BufferAttribute(n,1)),e.setAttribute("position",new d.BufferAttribute(t,3)),e.computeBoundingBox(),e.computeBoundingSphere(),e}(),Ld=function(){for(var n=32,t=new Float32Array(n*3*2*2),e=0;e<=n;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=Math.sin(r),t[e*6+2]=0,r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=Math.sin(r),t[e*6+5]=0}for(var e=n;e<=n*2;e++){var r=0;r=e/n*Math.PI*2,t[e*6+0]=Math.cos(r),t[e*6+1]=0,t[e*6+2]=Math.sin(r),r=(e+1)/n*Math.PI*2,t[e*6+3]=Math.cos(r),t[e*6+4]=0,t[e*6+5]=Math.sin(r)}var i=new d.BufferGeometry;return i.setAttribute("position",new d.BufferAttribute(t,3)),i.computeBoundingBox(),i.computeBoundingSphere(),i}();function Od(n,t){if(n instanceof K0){var e=new d.LineSegments(kd,hi[Math.min(t,hi.length-1)]);return e.position.copy(n.center),G0(n.rotation,e.quaternion),e.scale.set(n.halfSize.x,n.halfSize.y,n.halfSize.z),e.matrix.compose(e.position,e.quaternion,e.scale),e}else if(n instanceof j0){var e=new d.LineSegments(Ld,hi[Math.min(t,hi.length-1)]);return e.position.copy(n.center),e.scale.set(n.radius,n.radius,n.radius),e.matrix.compose(e.position,e.quaternion,e.scale),e}throw new Error("never")}var Vd=new d.Vector3,mo=function(){function n(t,e,r,i){var a=this,o,s,l,u;this.parent=null,this.floor=0,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,distanceToCamera:0,centerZDepth:0,centerScreenY:0,screenSpaceError:0,visibilityPlaneMask:0,inRequestVolume:!1,shouldRefine:!1,stackLength:0,finalResolution:!0,selectionDepth:0,shouldSelect:!1,lastSelect:!1,ancestorWithContent:null,ancestorWithContentAvailable:null},this.parent=i!=null?i:null,this.level=this.parent?this.parent.level+1:0,this.tileset=r,this.refine=(o=e.refine)!==null&&o!==void 0?o:this.parent?this.parent.refine:"REPLACE",this.transform=new d.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.parent&&this.transform.premultiply(this.parent.transform),typeof e.geometricError=="number"?this.geometricError=e.geometricError*this.transform.getMaxScaleOnAxis():this.geometricError=(l=(s=this.parent)===null||s===void 0?void 0:s.geometricError)!==null&&l!==void 0?l:0,e.content&&e.content.uri?(this.content={uri:e.content.uri,loadState:"UNLOADED",loadStateUpdateTime:he(),loadfailRetryDelay:0,byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=xi(e.content.boundingVolume).applyMatrix4(this.transform)),/\.json$/.test(this.content.uri)?this.type="TILESET":this.type="SCENEGRAPH"):(this.content=null,this.type="EMPTY"),this.levelOfContent=this.parent?this.parent.levelOfContent:-1,this.type==="SCENEGRAPH"&&(this.levelOfContent=this.levelOfContent+1),e.boundingVolume&&(this.boundingVolume=xi(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=xi(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=(u=e.extras)!==null&&u!==void 0?u:{},typeof this.extras.floor!="number"&&i&&typeof i.extras.floor=="number"&&(this.extras.floor=i.extras.floor),typeof this.extras.floor=="number"&&(this.floor=this.extras.floor,this.tileset.floorLength=Math.max(this.tileset.floorLength,this.floor+1)),this.boundingVolume&&(this.boundingVolumeDebugObject=Od(this.boundingVolume,this.levelOfContent)),e.children?this.children=e.children.map(function(c,f){return new n("".concat(a.id,".").concat(f),c,r,a)}):this.children=[]}return n.prototype.traverse=function(t){t(this);for(var e=0,r=this.children;e<r.length;e++){var i=r[e];i.traverse(t)}},n.prototype.updateState=function(t){this.state.frameNumber=t.frameNumber;var e=this.tileset.transformIsIdentity?null:this.tileset.transform;if(this.boundingVolume){var r=e?this.boundingVolume.clone().applyMatrix4(e):this.boundingVolume;if(t.camera.type==="OrthographicCamera"){var i=new d.Plane().setFromNormalAndCoplanarPoint(t.camera.direction,t.camera.position);this.state.distanceToCamera=r.distanceToPlane(i)}else this.state.distanceToCamera=r.distanceToPoint(t.camera.position);var a=r.getCenter(Vd).sub(t.camera.position);this.state.centerZDepth=t.camera.direction.dot(a),this.state.centerScreenY=t.camera.up.dot(a);var o=this.parent?this.parent.state.visibilityPlaneMask:Hn.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,o),this.state.visible=this.state.visibilityPlaneMask!==Hn.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=Hn.MASK_INDETERMINATE,this.state.visible=!0;if(this.levelOfContent<=t.minLevelOfDetail&&(this.state.visible=!0),this.viewerRequestVolume){var s=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=s.distanceSquaredToPoint(t.camera.position)<=0}else this.state.inRequestVolume=!0;this.state.screenSpaceError=this.getScreenSpaceError(t,this.state.distanceToCamera,!1)},Object.defineProperty(n.prototype,"selected",{get:function(){return this.state.selectedFrameNumber===this.tileset.frameNumber},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"siblingIndex",{get:function(){var t,e;return(e=(t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))!==null&&e!==void 0?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasTilesetContent",{get:function(){return this.children.length>0&&this.type==="TILESET"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRenderContent",{get:function(){return this.type==="SCENEGRAPH"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentAvailable",{get:function(){var t;return this.hasRenderContent&&((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasUnloadedContent",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="UNLOADED"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasEmptyContent",{get:function(){return this.type==="EMPTY"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentReady",{get:function(){var t;return((t=this.content)===null||t===void 0?void 0:t.loadState)==="READY"||this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"contentByteLength",{get:function(){return this.content?this.content.byteLength:0},enumerable:!1,configurable:!0}),n.prototype.getScreenSpaceError=function(t,e,r){var i=this.tileset.transformIsIdentity?1:this.tileset.transform.getMaxScaleOnAxis(),a=this.parent?this.parent.geometricError:this.tileset.geometricError,o=i*(r?a:this.geometricError);if(o===0)return 0;var s=Math.max(e,.001),l=o*t.height/(s*t.sseDenominator);return l},n.prototype.getPriority=function(){var t=this.refine==="ADD"||this.tileset.skipLevelOfDetail;if(t&&!this.state.visible||this.tileset.frameNumber-this.state.touchedFrameNumber>=1)return-1;var e=this.parent,r=e&&(!t||this.state.screenSpaceError===0),i=r?e.state.screenSpaceError:this.state.screenSpaceError,a=this.tileset.root?this.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o},n}();function ls(n){var t=n.refine==="ADD"||n.tileset.skipLevelOfDetail,e=n.parent,r=e&&(!t||n.state.screenSpaceError===0),i=r?e.state.screenSpaceError:n.state.screenSpaceError,a=n.tileset.root?n.tileset.root.state.screenSpaceError:0,o=Math.max(a-i,0);return o}var _0=function(){function n(t,e){this.tileset=t,this.options=e,this.activeRequests=0,this.requestQueue=[]}return n.prototype.reset=function(){for(var t=0,e=this.requestQueue;t<e.length;t++){var r=e[t];this.options.onTileSkip&&this.options.onTileSkip(r.tile)}this.requestQueue.length=0},n.prototype.update=function(t,e,r){for(var i=this,a=r.time,o=this.requestQueue,s=new Set(t),l=0;l<o.length;l++){var u=o[l];if(s.has(u.tile)){s.delete(u.tile);continue}u.status==="WAITING"&&(o.splice(l,1),l--,this.options.onTileSkip&&this.options.onTileSkip(u.tile))}s.size>0&&(s.forEach(function(h){o.push({tile:h,status:"WAITING",time:a,error:null})}),s.clear());for(var c=this.tileset.maxRequests,l=0;l<o.length&&c>0;l++){var u=o[l];if(u.status==="DONE")u.error!==null?this.options.onTileError&&this.options.onTileError(u.tile,u.error):(c--,u.tile.content&&(u.tile.content.loadState="READY"),this.options.onTileLoad&&this.options.onTileLoad(u.tile)),o.splice(l,1),l--;else if(u.status==="PENDING"&&a-u.time<1e3)break}switch(e){case"SCREEN_SPACE_ERROR":{var f=new Map;o.sort(function(h,p){if(h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber)return p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber;if(h.tile.state.requestedFrameNumber===r.frameNumber){var g=f.get(h.tile.id);g===void 0&&(g=ls(h.tile),f.set(h.tile.id,g));var v=f.get(p.tile.id);return v===void 0&&(v=ls(p.tile),f.set(p.tile.id,v)),g-v}else return h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}case"SCREEN_VERTICAL":{o.sort(function(h,p){return h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber?p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber:h.tile.state.requestedFrameNumber===r.frameNumber?h.tile.state.centerScreenY!==p.tile.state.centerScreenY?h.tile.state.centerScreenY-p.tile.state.centerScreenY:h.tile.state.centerZDepth!==p.tile.state.centerZDepth?h.tile.state.centerZDepth-p.tile.state.centerZDepth:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}case"SCREEN_LEVEL_VERTICAL":{o.sort(function(h,p){return h.tile.state.requestedFrameNumber!==p.tile.state.requestedFrameNumber?p.tile.state.requestedFrameNumber-h.tile.state.requestedFrameNumber:h.tile.state.requestedFrameNumber===r.frameNumber?h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.centerScreenY!==p.tile.state.centerScreenY?h.tile.state.centerScreenY-p.tile.state.centerScreenY:h.tile.state.centerZDepth!==p.tile.state.centerZDepth?h.tile.state.centerZDepth-p.tile.state.centerZDepth:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera:h.tile.level!==p.tile.level?h.tile.level-p.tile.level:h.tile.state.distanceToCamera-p.tile.state.distanceToCamera});break}}c=Math.max(this.tileset.maxRequests-this.activeRequests,0);for(var m=function(h){var p=o[h];p.status==="WAITING"&&(c--,p.status="PENDING",p.time=a,A.activeRequests++,A.tileset.options.tileLoader(p.tile).catch(function(g){p.error=g}).then(function(){p.status="DONE",p.tile.content&&p.tile.content.loadState==="READY"&&(p.tile.content.loadState="LOADING"),i.activeRequests--}))},A=this,l=0;l<o.length&&c>0;l++)m(l)},n}(),Nd=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Dd=function(){function n(){this.head=null,this.tail=null,this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.add=function(t){var e=new Nd(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this._length++,e},n.prototype.remove=function(t){t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,this._length--},n.prototype.splice=function(t,e){t!==e&&(this.remove(e),this.insert(t,e))},n.prototype.insert=function(t,e){var r=t.next;t.next=e,this.tail===t?this.tail=e:r.previous=e,e.next=r,e.previous=t,this._length++},n.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},n}(),J0=function(){function n(t){t===void 0&&(t={}),this.options=t,this.cacheNodeMap=new Map,this.list=new Dd,this.sentinel=this.list.add("sentinel")}return n.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},n.prototype.touchTile=function(t){var e=this.cacheNodeMap.get(t);e&&this.list.splice(this.sentinel,e)},n.prototype.loadTile=function(t){if(!this.cacheNodeMap.has(t)){var e=this.list.add(t);this.cacheNodeMap.set(t,e),this.options.onTileLoad&&this.options.onTileLoad(t)}},n.prototype.unloadTile=function(t){var e=this.cacheNodeMap.get(t);e&&(this.list.remove(e),this.cacheNodeMap.delete(t),this.options.onTileUnload&&this.options.onTileUnload(t))},n.prototype.unloadTiles=function(t){for(var e=this.list.head;e!==this.sentinel&&t();){var r=e.item;e=e.next,this.unloadTile(r)}},n.prototype.toArray=function(){for(var t=[],e=0,r=this.list.toArray();e<r.length;e++){var i=r[e];i.item!=="sentinel"&&t.push(i.item)}return t},n}(),qr=function(){function n(){this.map=new Map,this.array=[],this._length=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return this.array[t]},n.prototype.set=function(t,e){t>=this.length&&(this._length=t+1),this.map.has(this.array[t])&&this.map.delete(this.array[t]),this.array[t]=e,this.map.set(e,t)},n.prototype.delete=function(t){var e=this.map.get(t);e!==void 0&&e>=0&&(this.array.splice(e,1),this.map.delete(t),this._length--)},n.prototype.push=function(t){if(!this.map.has(t)){var e=this._length++;this.array[e]=t,this.map.set(t,e)}},n.prototype.pop=function(){var t=this.array[--this._length];return this.map.delete(t),this.array[this._length]=void 0,t},n.prototype.reset=function(){this.array=[],this.map=new Map,this._length=0},n.prototype.find=function(t){return this.map.has(t)},n.prototype.peek=function(){return this.array[this._length-1]},n}(),Ao=function(){function n(t){this.tileset=t,this._canSelectTile=!0,this._loadAllTilesTraversalStack=new qr,this.root=null}return n.prototype.traverse=function(t,e,r){this.root=t,this.reset()},n.prototype.reset=function(){this._loadAllTilesTraversalStack.reset(),this.tileset.hasMixedContent=!1,this.tileset.needsRefinedTiles.clear(),this.tileset.requestedTiles.length=0,this.tileset.selectedTiles.length=0},n.prototype.updateTile=function(t,e){this.updateTileVisibility(t,e),t.state.shouldSelect=!1,t.state.finalResolution=!0},n.prototype.selectTile=function(t,e){var r=t.contentAvailable&&this._canSelectTile;r&&t.state.selectedFrameNumber<e.frameNumber&&(t.state.selectedFrameNumber=e.frameNumber,this.tileset.selectedTiles.push(t),this.tileset.needsRefinedTiles.add(t))},n.prototype.loadTile=function(t,e){t.state.requestedFrameNumber<e.frameNumber&&(t.state.requestedFrameNumber=e.frameNumber,t.content&&(t.content.loadState==="FAILED"&&e.time-t.content.loadStateUpdateTime>t.content.loadfailRetryDelay&&(t.content.loadState="UNLOADED",t.content.loadStateUpdateTime=e.time),t.content.loadState==="UNLOADED"&&this.tileset.requestedTiles.push(t))),this.tileset.needsRefinedTiles.add(t)},n.prototype.touchTile=function(t,e){this.tileset.cache.touchTile(t),t.state.touchedFrameNumber=e.frameNumber},n.prototype.canTraverse=function(t,e){return t.levelOfContent>=e.maxLevelOfDetail||t.children.length===0?!1:t.levelOfContent<=e.minLevelOfDetail||t.hasTilesetContent?!0:t.state.screenSpaceError>this.tileset.maxScreenSpaceError},n.prototype.updateTileVisibility=function(t,e){if(t.updateState(e),!(!t.state.visible||!t.state.inRequestVolume)){var r=t.children.length>0;if(t.hasTilesetContent&&r){var i=t.children[0];this.updateTileVisibility(i,e),t.state.visible=i.state.visible;return}if(this.meetsScreenSpaceErrorEarly(t,e)){t.state.visible=!1;return}var a=t.refine==="REPLACE";if(a&&r&&!this.anyChildrenVisible(t,e)){t.state.visible=!1;return}}},n.prototype.anyChildrenVisible=function(t,e){for(var r=!1,i=t.children,a=0,o=i;a<o.length;a++){var s=o[a];s.updateState(e),r=r||s.state.visible}return r},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"||r.levelOfContent<e.minLevelOfDetail?!1:r.levelOfContent>e.maxLevelOfDetail?!0:t.getScreenSpaceError(e,t.state.distanceToCamera,!0)<this.tileset.maxScreenSpaceError},n.prototype.sortTilesByDistanceToCamera=function(t){t.sort(function(e,r){return r.state.distanceToCamera===0&&e.state.distanceToCamera===0?r.state.centerZDepth-e.state.centerZDepth:r.state.distanceToCamera-e.state.distanceToCamera})},n.prototype.loadAllTiles=function(t,e){var r=this._loadAllTilesTraversalStack;for(r.push(t);r.length>0;){var i=r.pop();i.content&&i.content.loadState==="UNLOADED"&&i.state.requestedFrameNumber<e.frameNumber&&this.tileset.requestedTiles.push(i),this.touchTile(i,e);for(var a=0,o=i.children;a<o.length;a++){var s=o[a];r.push(s)}}},n}(),zd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new qr,r._emptyTraversalStack=new qr,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),this._emptyTraversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s))}this._traversalStack.reset(),this._emptyTraversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._emptyTraversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop(),o=a.parent,s=!o||o.state.shouldRefine,l=!1;this.canTraverse(a,r)&&(l=this.updateAndPushChildren(a,r,i)&&s);var u=!l&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)):(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var l=s[o];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(a);for(var u=e.refine==="REPLACE"&&e.hasRenderContent,c=!1,f=!0,m=0,A=a;m<A.length;m++){var l=A[m];if(l.levelOfContent<=r.minLevelOfDetail||l.state.visible&&l.state.inRequestVolume?(i.find(l)&&i.delete(l),i.push(l),c===!1&&(c=!0)):(u||this.tileset.loadSiblings)&&(this.loadTile(l,r),this.touchTile(l,r)),u){var h=void 0;l.state.inRequestVolume?l.hasRenderContent?h=l.contentAvailable:h=this.executeEmptyTraversal(l,r):h=!1,f=f&&h}}return c||(f=!1),f},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t.prototype.executeEmptyTraversal=function(e,r){var i=!0,a=this._emptyTraversalStack;for(a.push(e);a.length>0&&i;){var o=a.pop(),s=!o.hasRenderContent&&this.canTraverse(o,r);if(!s&&!o.contentAvailable&&(i=!1),this.updateTile(o,r),o.state.visible||(this.loadTile(o,r),this.touchTile(o,r)),s)for(var l=o.children,u=0,c=l;u<c.length;u++){var f=c[u];a.find(f)&&a.delete(f),a.push(f)}}return i},t}(Ao),Qd=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r.baseScreenSpaceError=1024,r.skipScreenSpaceErrorFactor=16,r.skipLevels=1,r._traversalStack=new qr,r._descendantTraversalStack=new qr,r._selectionTraversalStack=new qr,r._selectionTraversalancestorStack=new qr,r}return t.prototype.traverse=function(e,r,i){i===void 0&&(i=[]),n.prototype.traverse.call(this,e,r,i);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,this.updateTile(e,s),this.executeTraversal(e,s),this.traverseAndSelect(e,s))}this.tileset.hasMixedContent=!1,this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,this.updateTile(e,r),this.executeTraversal(e,r),this.traverseAndSelect(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset(),this._descendantTraversalStack.reset(),this._selectionTraversalStack.reset(),this._selectionTraversalancestorStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(e.state.visible&&e.state.inRequestVolume&&i.push(e);i.length>0;){var a=i.pop();this.updateTileAncestorContentLinks(a,r);var o=a.parent,s=!o||o.state.shouldRefine,l=!1;this.canTraverse(a,r)&&(l=this.updateAndPushChildren(a,r,i)&&s);var u=!l&&s;a.hasRenderContent?a.refine==="ADD"?(this.loadTile(a,r),this.selectDesiredTile(a,r)):a.refine==="REPLACE"&&(this.inBaseTraversal(a,this.baseScreenSpaceError)?(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)):u?(this.loadTile(a,r),this.selectDesiredTile(a,r)):this.reachedSkippingThreshold(a)&&this.loadTile(a,r)):(this.loadTile(a,r),u&&this.selectDesiredTile(a,r)),this.touchTile(a,r),a.state.shouldRefine=l}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0,s=a;o<s.length;o++){var l=s[o];this.updateTile(l,r)}this.sortTilesByDistanceToCamera(a);for(var u=!1,c=0,f=a;c<f.length;c++){var l=f[c];l.levelOfContent<=r.minLevelOfDetail||l.state.visible&&l.state.inRequestVolume?(i.push(l),u===!1&&(u=!0)):this.tileset.loadSiblings&&(this.loadTile(l,r),this.touchTile(l,r))}return u},t.prototype.selectDesiredTile=function(e,r){var i=e.contentAvailable?e:e.state.ancestorWithContentAvailable;i&&(i.state.shouldSelect=!0),e.contentAvailable||this.selectDescendants(e,r)},t.prototype.selectDescendants=function(e,r){var i=this._descendantTraversalStack;for(i.push(e);i.length>0;)for(var a=i.pop(),o=a.children,s=0,l=o;s<l.length;s++){var u=l[s];u.state.visible&&(u.contentAvailable?(this.updateTile(u,r),this.touchTile(u,r),this.selectTile(u,r)):i.push(u))}},t.prototype.reachedSkippingThreshold=function(e){var r=e.state.ancestorWithContent,i=r!==null&&e.state.screenSpaceError<r.state.screenSpaceError/this.skipScreenSpaceErrorFactor&&e.levelOfContent>r.levelOfContent+this.skipLevels;return i},t.prototype.updateTileAncestorContentLinks=function(e,r){e.state.ancestorWithContent=null,e.state.ancestorWithContentAvailable=null;var i=e.parent;if(i){var a=!(i.hasRenderContent&&i.hasUnloadedContent)||i.state.requestedFrameNumber===r.frameNumber;e.state.ancestorWithContent=a?i:i.state.ancestorWithContent,e.state.ancestorWithContentAvailable=i.contentAvailable?i:i.state.ancestorWithContentAvailable}},t.prototype.inBaseTraversal=function(e,r){return e.state.ancestorWithContent?e.parent&&e.state.screenSpaceError===0?e.parent.state.screenSpaceError>r:e.state.screenSpaceError>r:!0},t.prototype.traverseAndSelect=function(e,r){var i=this._selectionTraversalStack,a=this._selectionTraversalancestorStack,o;for(i.push(e);i.length>0||a.length>0;){if(a.length>0){var s=a.peek();if(s.state.stackLength===i.length){a.pop(),s!==o&&(s.state.finalResolution=!1),this.selectTile(s,r);continue}}var l=i.pop();if(l){var u=this.canTraverse(l,r);if(l.state.shouldSelect)if(l.refine==="ADD")this.selectTile(l,r);else{if(l.state.selectionDepth=a.length,l.state.selectionDepth>0&&(l.tileset.hasMixedContent=!0),o=l,!u){this.selectTile(l,r);continue}a.push(l),l.state.stackLength=i.length}if(u)for(var c=0,f=l.children;c<f.length;c++){var m=f[c];m.state.visible&&i.push(m)}}}},t}(Ao),Ud=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;return r.tileset=e,r._traversalStack=new qr,r}return t.prototype.canTraverse=function(e,r){return!(e.levelOfContent>=r.maxLevelOfDetail||e.children.length===0)},t.prototype.traverse=function(e,r,i){n.prototype.traverse.call(this,e,r,[]),this._traversalStack.reset(),e.updateState(r);for(var a=0,o=i;a<o.length;a++){var s=o[a];this._traversalStack.reset(),s.camera.refine&&(this._canSelectTile=s.camera.visible,e.updateState(s),this.executeTraversal(e,s))}this._traversalStack.reset(),r.camera.refine&&(this._canSelectTile=r.camera.visible,e.updateState(r),this.executeTraversal(e,r)),this.tileset.loadAll&&this.loadAllTiles(e,r)},t.prototype.reset=function(){n.prototype.reset.call(this),this._traversalStack.reset()},t.prototype.executeTraversal=function(e,r){var i=this._traversalStack;for(i.push(e);i.length>0;){var a=i.pop(),o=a.refine==="ADD",s=a.refine==="REPLACE",l=this.canTraverse(a,r);l&&this.updateAndPushChildren(a,r,i),(o||s&&!l)&&(this.loadTile(a,r),this.touchTile(a,r),this.selectDesiredTile(a,r))}},t.prototype.updateAndPushChildren=function(e,r,i){for(var a=e.children,o=0;o<a.length;++o){var s=a[o];s.updateState(r),s.state.visible&&i.push(s)}},t.prototype.selectDesiredTile=function(e,r){e.contentAvailable&&n.prototype.selectTile.call(this,e,r)},t}(Ao),cs=[5635925,5592575,16733525],X0=function(){function n(t,e,r){var i;this.index=t,this.name=e.name,this.visible=!1,this.tileset=r,this.transform=new d.Matrix4,e.transform&&this.transform.fromArray(e.transform),this.transform.premultiply(this.tileset.root.transform),this.content={uri:e.file,color:new d.Color((i=e.color)!==null&&i!==void 0?i:cs[t%cs.length]),byteLength:0,loadState:"UNLOADED",loadStateUpdateTime:he(),loadfailRetryDelay:0,data:void 0}}return n}(),qd=new d.Matrix4,br=function(){function n(t,e,r){var i=this,a,o,s,l,u,c,f,m,A;if(this.id=t,this.transform=new d.Matrix4,this.transformIsIdentity=!0,this.hasMixedContent=!1,this.url=(a=r.url)!==null&&a!==void 0?a:"",this.referer=(o=r.referer)!==null&&o!==void 0?o:"",this.asset={version:e.asset.version,tilesetVersion:e.asset.tilesetVersion||"",gltfUpAxis:(s=e.asset.gltfUpAxis)!==null&&s!==void 0?s:"Y",overview:e.asset.overview,trajectories:(u=(l=e.asset.trajectories)===null||l===void 0?void 0:l.list)!==null&&u!==void 0?u:[]},this.rootMeta=(c=e.rootMeta)!==null&&c!==void 0?c:{},this.pointLength=(f=this.rootMeta.numTotalPoints)!==null&&f!==void 0?f:1/0,this.floorLength=(m=this.rootMeta.numFloors)!==null&&m!==void 0?m:1,this.properties=(A=e.properties)!==null&&A!==void 0?A:{},this.options=r,this.maxMemoryUsage=n.DEFAULT_MAX_MEMORY_USAGE,this.maxScreenSpaceError=n.DEFAULT_MAX_SCREEN_SPACE_ERROR,this.skipLevelOfDetail=n.DEFAULT_SKIP_LEVEL_OF_DETAIL,this.mostDetail=n.DEFAULT_MOST_DETAIL,this.loadSiblings=n.DEFAULT_LOAD_SIBLINGS,this.loadAll=n.DEFAULT_LOAD_ALL,this.maxRequests=n.DEFAULT_MAX_REQUESTS,this.tileRequestOrder=n.DEFAULT_REQUEST_ORDER,this.requestedTiles=[],this.selectedTiles=[],this.unloadTiles=[],this.needsRefinedTiles=new Set,this.selectedTrajectories=[],this.normalTraverser=new zd(this),this.skipTraverser=new Qd(this),this.mostDetailTraverser=new Ud(this),this.cache=new J0({onTileLoad:function(g){i.memoryUsageInBytes+=g.contentByteLength},onTileUnload:function(g){i.memoryUsageInBytes-=g.contentByteLength,i.unloadTiles.push(g)}}),this.requestScheduler=new _0(this,{onTileSkip:function(g){},onTileLoad:function(g){var v;!((v=g.content)===null||v===void 0)&&v.data&&(i.loadedTiles.add(g),i.cache.loadTile(g)),i.options.onTileLoad(g)},onTileError:function(g,v){i.options.onTileError(g,v)}}),this.frameNumber=0,this.maxLevelOfDetail=0,this.minLevelOfDetail=0,this.loadedTiles=new Set,this.memoryUsageInBytes=0,this.root=new mo("".concat(this.id,".0"),e.root,this),this.geometricError=e.geometricError,this.trajectories=[],this.asset.trajectories)for(var h=0;h<this.asset.trajectories.length;h++){var p=new X0(h,this.asset.trajectories[h],this);this.trajectories.push(p)}}return Object.defineProperty(n.prototype,"traverser",{get:function(){return this.mostDetail?this.mostDetailTraverser:this.skipLevelOfDetail?this.skipTraverser:this.normalTraverser},enumerable:!1,configurable:!0}),n.prototype.reset=function(){for(var t=this,e=[this.root],r;r=e.pop();){for(var i=0,a=r.children.length;i<a;i++)e.push(r.children[i]);this.cache.unloadTile(r)}for(var o=function(){var c=s.unloadTiles.pop();c&&(s.loadedTiles.delete(c),s.memoryUsageInBytes-=c.contentByteLength,s.options.tileUnloader(c).catch(function(){}).then(function(){t.options.onTileUnload&&t.options.onTileUnload(c)}))},s=this;this.unloadTiles.length;)o();this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.loadedTiles.clear();for(var l=function(){var c=u.trajectories.pop();c&&u.options.trajectoryUnloader(c).catch(function(){}).then(function(){t.options.onTrajectoryUnload&&t.options.onTrajectoryUnload(c)})},u=this;this.trajectories.length;)l()},n.prototype.update=function(t,e){var r=this,i;e===void 0&&(e=[]),this.frameNumber=t.frameNumber,this.minLevelOfDetail=t.minLevelOfDetail,this.maxLevelOfDetail=t.maxLevelOfDetail,this.transformIsIdentity=this.transform.equals(qd),this.traverser.traverse(this.root,t,e),this.cache.unloadTiles(function(){var m=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return m}),this.requestScheduler.update(this.requestedTiles,this.tileRequestOrder,t);for(var a=function(){var m=o.unloadTiles.pop();m&&(o.loadedTiles.delete(m),o.options.tileUnloader(m).catch(function(){}).then(function(){r.options.onTileUnload&&r.options.onTileUnload(m)}))},o=this;this.unloadTiles.length;)a();this.selectedTrajectories.length=0;for(var s=function(m){m.visible===!0&&m.content.loadState==="READY"&&(!((i=m.content.data)===null||i===void 0)&&i.object)?l.selectedTrajectories.push(m):m.visible===!0&&(m.content.loadState==="FAILED"&&t.time-m.content.loadStateUpdateTime>m.content.loadfailRetryDelay&&(m.content.loadState="UNLOADED",m.content.loadStateUpdateTime=t.time),m.content.loadState==="UNLOADED"&&l.options.trajectoryLoader(m).then(function(){r.options.onTrajectoryLoad(m)}).catch(function(A){r.options.onTrajectoryError(m,A)}))},l=this,u=0,c=this.trajectories;u<c.length;u++){var f=c[u];s(f)}},n.DEFAULT_MAX_MEMORY_USAGE=16,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=4,n.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,n.DEFAULT_MOST_DETAIL=!1,n.DEFAULT_LOAD_SIBLINGS=!1,n.DEFAULT_LOAD_ALL=!1,n.DEFAULT_MAX_REQUESTS=6,n.DEFAULT_REQUEST_ORDER="SCREEN_SPACE_ERROR",n}(),W0=function(){function n(t,e){this.position=t,this.indices=e}return n.prototype.getPositionCount=function(){var t,e,r=this.indices,i=this.position;return r?r.array.length/((t=r.stride)!==null&&t!==void 0?t:1):i.array.length/((e=i.stride)!==null&&e!==void 0?e:3)},n.prototype.getPositionByIndex=function(t,e){var r,i,a,o,s=this.indices,l=this.position,u=t;if(s){var c=s.array,f=(r=s.stride)!==null&&r!==void 0?r:1,m=(i=s.offset)!==null&&i!==void 0?i:0;u=c[t*f+m]}var A=l.array,h=(a=l.stride)!==null&&a!==void 0?a:3,p=(o=l.offset)!==null&&o!==void 0?o:0;return u=u*h+p,e.x=A[u],e.y=A[u+1],e.z=A[u+2],e},n.prototype.createTree=function(t,e,r){throw new Error("not implemented")},n.prototype.trianglesInSphere=function(t,e){throw new Error("not implemented")},n.prototype.intersectRay=function(t,e,r,i){throw new Error("not implemented")},n}(),Mn=function(){function n(t,e,r,i,a){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=a}return n}(),Er=6*4+4+4+2+2;function Z0(n,t){for(var e=new ArrayBuffer(t*Er),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,l;s=o.pop();)l=s.id*Er/4,r[l]=s.extents[0],r[l+1]=s.extents[1],r[l+2]=s.extents[2],r[l+3]=s.extents[3],r[l+4]=s.extents[4],r[l+5]=s.extents[5],i[l+6]=s.startIndex,i[l+7]=s.endIndex,l=s.id*Er/2,s.node0&&(a[l+16]=s.node0.id,o.push(s.node0)),s.node1&&(a[l+17]=s.node1.id,o.push(s.node1));return e}function Y0(n,t,e,r,i,a,o,s,l){l===void 0&&(l=0),e=e-l,r=r-l,i=i-l,a=a+l,o=o+l,s=s+l;var u=0,c=0,f=0,m=0,A=0,h=0;return t.x>=0?(u=(e-n.x)*t.x,c=(a-n.x)*t.x):(u=(a-n.x)*t.x,c=(e-n.x)*t.x),t.y>=0?(f=(r-n.y)*t.y,m=(o-n.y)*t.y):(f=(o-n.y)*t.y,m=(r-n.y)*t.y),!(u>m||f>c||(f>u&&(u=f),m<c&&(c=m),t.z>=0?(A=(i-n.z)*t.z,h=(s-n.z)*t.z):(A=(s-n.z)*t.z,h=(i-n.z)*t.z),u>h||A>c)||(A>u&&(u=A),h<c&&(c=h),c<0))}var dn=function(){function n(t,e,r){this.x=t,this.y=e,this.z=r}return n.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.prototype.set=function(t,e,r){return this.x=t,this.y=e,this.z=r,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},n.prototype.toArray=function(t,e){return t===void 0&&(t=[]),e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},n.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},n.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},n.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.prototype.cross=function(t){var e=this.x,r=this.y,i=this.z;return this.x=r*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-r*t.x,this},n.prototype.crossVectors=function(t,e){var r=t.x,i=t.y,a=t.z,o=e.x,s=e.y,l=e.z;return this.x=i*l-a*s,this.y=a*o-r*l,this.z=r*s-i*o,this},n.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.prototype.distanceToSquared=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i},n.prototype.clone=function(){return new n(this.x,this.y,this.z)},n}(),$0=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),ds=1e-6,Ue=new dn(0,0,0),Lr=new dn(0,0,0),Or=new dn(0,0,0),Vr=new dn(0,0,0),eu=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionCount()/3,o=a>65535?new Uint32Array(a):new Uint16Array(a),s=new Float32Array(a*6),l=[],u=0,c=-1;if(i)for(var f=0,m=0,A=0,h=void 0,p=void 0,g=void 0,v=void 0,y=void 0,b=void 0,x=void 0;f<a;f+=1,m+=3,A+=6)o[f]=f,this.getPositionByIndex(m,Lr),this.getPositionByIndex(m+1,Or),this.getPositionByIndex(m+2,Vr),h=v=Lr.x,x=Or.x,x<h&&(h=x),x>v&&(v=x),x=Vr.x,x<h&&(h=x),x>v&&(v=x),p=y=Lr.y,x=Or.y,x<p&&(p=x),x>y&&(y=x),x=Vr.y,x<p&&(p=x),x>y&&(y=x),g=b=Lr.z,x=Or.z,x<g&&(g=x),x>b&&(b=x),x=Vr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=p,s[A+2]=g,s[A+3]=v,s[A+4]=y,s[A+5]=b;else{for(var w=1/0,E=1/0,M=1/0,C=-1/0,R=-1/0,L=-1/0,f=0,m=0,A=0,h=void 0,p=void 0,g=void 0,v=void 0,y=void 0,b=void 0,x=void 0;f<a;f+=1,m+=3,A+=6)o[f]=f,this.getPositionByIndex(m,Lr),this.getPositionByIndex(m+1,Or),this.getPositionByIndex(m+2,Vr),h=v=Lr.x,x=Or.x,x<h&&(h=x),x>v&&(v=x),x=Vr.x,x<h&&(h=x),x>v&&(v=x),p=y=Lr.y,x=Or.y,x<p&&(p=x),x>y&&(y=x),x=Vr.y,x<p&&(p=x),x>y&&(y=x),g=b=Lr.z,x=Or.z,x<g&&(g=x),x>b&&(b=x),x=Vr.z,x<g&&(g=x),x>b&&(b=x),s[A]=h,s[A+1]=p,s[A+2]=g,s[A+3]=v,s[A+4]=y,s[A+5]=b,h<w&&(w=h),v>C&&(C=v),p<E&&(E=p),y>R&&(R=y),g<M&&(M=g),b>L&&(L=b);i=[w,E,M,C,R,L]}var S=new Mn(++c,i,0,a,0);l[u++]=S;var I=[],O=[0,1,2],P=function(V,D){return I[D]-I[V]};function F(V){var D=V.startIndex,z=V.endIndex,U=V.extents;I[0]=U[3]-U[0],I[1]=U[4]-U[1],I[2]=U[5]-U[2],O.sort(P);for(var q=0;q<3;q++){for(var K=O[q],j=U[K]+U[K+3],J=D,X=z-1,Y=-1,W=void 0;J<=X;)Y===-1?(W=o[J],s[W*6+K]+s[W*6+K+3]<j?J++:Y=W):(W=o[X],s[W*6+K]+s[W*6+K+3]>=j||(o[J]=W,o[X]=Y,Y=-1,J++),X--);if(J>D&&J<z){var ee=new Mn(++c,fs(o,s,D,J,ds),D,J,V.deepth+1);ee.deepth<r&&ee.endIndex-ee.startIndex>e&&(l[u++]=ee);var Z=new Mn(++c,fs(o,s,J,z,ds),J,z,V.deepth+1);Z.deepth<r&&Z.endIndex-Z.startIndex>e&&(l[u++]=Z),V.node0=ee,V.node1=Z,V.startIndex=0,V.endIndex=0;break}}}for(;u;)F(l[--u]);return this.offsetArray=o,this.rootNodePacked=Z0(S,c+1),l.length=0,this},t.prototype.trianglesInSphere=function(e,r){for(var i=this.offsetArray,a=this.rootNodePacked,o=new Float32Array(a),s=new Uint32Array(a),l=new Uint16Array(a),u=[0],c=[],f,m,A,h;(f=u.pop())!==void 0;){h=f*Er/4;var p=ua(e.x,o[h],o[h+3])-e.x,g=ua(e.y,o[h+1],o[h+4])-e.y,v=ua(e.z,o[h+2],o[h+5])-e.z;if(p*p+g*g+v*v<=r*r){for(var y=s[h+6];y<s[h+7];y++)c.push(i[y]);h=f*Er/2,m=l[h+16],A=l[h+17],m&&u.push(m),A&&u.push(A)}}for(var b=c.length,x=new Float32Array(b*9),y=0;y<b;y++){var w=c[y];this.getPositionByIndex(w,Ue),x[y*9]=Ue.x,x[y*9+1]=Ue.y,x[y*9+2]=Ue.z,this.getPositionByIndex(w+1,Ue),x[y*9+3]=Ue.x,x[y*9+4]=Ue.y,x[y*9+5]=Ue.z,this.getPositionByIndex(w+2,Ue),x[y*9+6]=Ue.x,x[y*9+7]=Ue.y,x[y*9+8]=Ue.z}return x},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,l=new Float32Array(s),u=new Uint32Array(s),c=new Uint16Array(s),f=new dn(1/r.x,1/r.y,1/r.z),m=[0],A,h,p,g;(A=m.pop())!==void 0;)if(g=A*Er/4,Y0(e,f,l[g],l[g+1],l[g+2],l[g+3],l[g+4],l[g+5])){for(var v=u[g+6],y=u[g+7],b=void 0,x=void 0,w=void 0,E=e.x,M=e.y,C=e.z,R=r.x,L=r.y,S=r.z,I=void 0,O=void 0,P=void 0,F=void 0,V=void 0,D=void 0,z=void 0,U=void 0,q=void 0,K=void 0,j=void 0,J=void 0,X=void 0,Y=void 0,W=void 0,ee=void 0,Z=void 0,ie=void 0,te=void 0,le=void 0,oe=void 0,we=void 0,pe=void 0,ge=void 0,Re=void 0,Se=void 0,Te=void 0;v<y;v++){if(b=o[v],x=b*3,this.getPositionByIndex(x,Ue),I=Ue.x,O=Ue.y,P=Ue.z,this.getPositionByIndex(x+1,Ue),F=Ue.x,V=Ue.y,D=Ue.z,this.getPositionByIndex(x+2,Ue),z=Ue.x,U=Ue.y,q=Ue.z,K=F-I,j=V-O,J=D-P,X=z-I,Y=U-O,W=q-P,ee=j*W-J*Y,Z=J*X-K*W,ie=K*Y-j*X,pe=R*ee+L*Z+S*ie,pe>0)we=1;else if(pe<0)we=-1,pe=-pe;else continue;te=E-I,le=M-O,oe=C-P,ge=we*(R*(le*W-oe*Y)+L*(oe*X-te*W)+S*(te*Y-le*X)),!(ge<0)&&(Re=we*(R*(j*oe-J*le)+L*(J*te-K*oe)+S*(K*le-j*te)),!(Re<0)&&(ge+Re>pe||(Se=-we*(te*ee+le*Z+oe*ie),!(Se<0)&&(Te=Se/pe,a.push(new $0([I,O,P,F,V,D,z,U,q],[E+R*Te,M+L*Te,C+S*Te],b))))))}g=A*Er/2,h=c[g+16],p=c[g+17],h&&m.push(h),p&&m.push(p)}return a},t}(W0);function ua(n,t,e){return n<t?t:n>e?e:n}function fs(n,t,e,r,i){if(e>=r)return[0,0,0,0,0,0];for(var a=1/0,o=1/0,s=1/0,l=-1/0,u=-1/0,c=-1/0,f=e,m=void 0,A=void 0;f<r;f++)m=n[f]*6,A=t[m],A<a&&(a=A),A=t[m+1],A<o&&(o=A),A=t[m+2],A<s&&(s=A),A=t[m+3],A>l&&(l=A),A=t[m+4],A>u&&(u=A),A=t[m+5],A>c&&(c=A);return[a-i,o-i,s-i,l+i,u+i,c+i]}var hs=1e-6,Hd=["x","y","z"],ut=new dn(0,0,0),tu=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.createTree=function(e,r,i){r=Math.min(r,16);var a=this.getPositionByIndex.bind(this),o=this.getPositionCount(),s=o>65535?new Uint32Array(o):new Uint16Array(o),l=[],u=0,c=-1;if(i)for(var f=0;f<o;f+=1)s[f]=f;else{a(0,ut);for(var m=ut.x,A=ut.y,h=ut.z,p=m,g=A,v=h,f=0,y=void 0,b=void 0,x=void 0;f<o;f+=1)s[f]=f,a(f,ut),y=ut.x,b=ut.y,x=ut.z,y<m?m=y:y>p&&(p=y),b<A?A=b:b>g&&(g=b),x<h?h=x:x>v&&(v=x);i=[m,A,h,p,g,v]}var w=new Mn(++c,i,0,o,0);l[u++]=w;var E=[],M=[0,1,2],C=function(L,S){return E[S]-E[L]};function R(L){var S=L.startIndex,I=L.endIndex,O=L.extents;E[0]=O[3]-O[0],E[1]=O[4]-O[1],E[2]=O[5]-O[2];for(var P=M.sort(C)[0],F=Hd[P],V=(O[P]+O[P+3])/2,D=S,z=I-1,U=-1,q;D<=z;)U===-1?(q=s[D],a(q,ut),ut[F]<V?D++:U=q):(q=s[z],a(q,ut),ut[F]>=V||(s[D]=q,s[z]=U,U=-1,D++),z--);if(D>S){var K=O.slice();K[P+3]=V+hs;var j=new Mn(++c,K,S,D,L.deepth+1);j.deepth<r&&j.endIndex-j.startIndex>e&&(l[u++]=j),L.node0=j}if(I>D){var J=O.slice();J[P]=V-hs;var X=new Mn(++c,J,D,I,L.deepth+1);X.deepth<r&&X.endIndex-X.startIndex>e&&(l[u++]=X),L.node1=X}L.startIndex=0,L.endIndex=0}for(;u;)R(l[--u]);return this.offsetArray=s,this.rootNodePacked=Z0(w,c+1),l.length=0,this},t.prototype.intersectRay=function(e,r,i,a){for(var o=this.offsetArray,s=this.rootNodePacked,l=new Float32Array(s),u=new Uint32Array(s),c=new Uint16Array(s),f=i*i,m=new dn(1/r.x,1/r.y,1/r.z),A=[0],h,p,g,v;(h=A.pop())!==void 0;)if(v=h*Er/4,Y0(e,m,l[v],l[v+1],l[v+2],l[v+3],l[v+4],l[v+5],i)){for(var y=u[v+6],b=u[v+7],x=void 0,w=void 0,E=void 0,M=void 0,C=void 0,R=void 0,L=void 0,S=void 0,I=void 0,O=void 0,P=void 0,F=void 0;y<b;y++)x=o[y],this.getPositionByIndex(x,ut),w=ut.x,E=ut.y,M=ut.z,C=e.x,R=e.y,L=e.z,S=r.x,I=r.y,O=r.z,P=S*(w-C)+I*(E-R)+O*(M-L),P>0&&(C+=S*P,R+=I*P,L+=O*P),S=w-C,I=E-R,O=M-L,P=S*S+I*I+O*O,P<=f&&a.push(new $0([w,E,M,w,E,M,w,E,M],[C,R,L],x));v=h*Er/2,p=c[v+16],g=c[v+17],p&&A.push(p),g&&A.push(g)}return a},t}(W0);const ru="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBlcj1mdW5jdGlvbihlLHIpe3JldHVybiBlcj1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxvKXt0Ll9fcHJvdG9fXz1vfXx8ZnVuY3Rpb24odCxvKXtmb3IodmFyIGYgaW4gbylPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwobyxmKSYmKHRbZl09b1tmXSl9LGVyKGUscil9O2Z1bmN0aW9uIGhyKGUscil7aWYodHlwZW9mIHIhPSJmdW5jdGlvbiImJnIhPT1udWxsKXRocm93IG5ldyBUeXBlRXJyb3IoIkNsYXNzIGV4dGVuZHMgdmFsdWUgIitTdHJpbmcocikrIiBpcyBub3QgYSBjb25zdHJ1Y3RvciBvciBudWxsIik7ZXIoZSxyKTtmdW5jdGlvbiB0KCl7dGhpcy5jb25zdHJ1Y3Rvcj1lfWUucHJvdG90eXBlPXI9PT1udWxsP09iamVjdC5jcmVhdGUocik6KHQucHJvdG90eXBlPXIucHJvdG90eXBlLG5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QpfXJldHVybntvdXRwdXQ6dCx0cmFuc2ZlcjpBcnJheS5mcm9tKG8pfX0pfSl9KSgpOwo=",Gd=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),ps=typeof self!="undefined"&&self.Blob&&new Blob([Gd(ru)],{type:"text/javascript;charset=utf-8"});function Kd(n){let t;try{if(t=ps&&(self.URL||self.webkitURL).createObjectURL(ps),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+ru,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var nu=function(){function n(t,e){this.pool=e,this.workerCreator=t,this.queue=[],this.workers=[],this.workersResolver=[],this.workerStatus=0}return n.prototype.initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this.onMessage.bind(this,t)),this.workers[t]=e}},n.prototype.getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype.onMessage=function(t,e){var r=this.workersResolver[t],i=r.resolve,a=r.reject;if(e.data&&"$$error"in e.data?a(e.data.$$error):i(e.data),this.queue.length){var o=this.queue.shift(),s=o.resolve,l=o.reject,u=o.input,c=o.transfer;this.workersResolver[t]={resolve:s,reject:l},this.workers[t].postMessage(u,c)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,a){var o=r.getIdleWorker();o!==-1?(r.initWorker(o),r.workerStatus|=1<<o,r.workersResolver[o]={resolve:i,reject:a},r.workers[o].postMessage(t,e)):r.queue.push({resolve:i,reject:a,input:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolver.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),jd=new nu(function(){return new Kd},4),_d=new Map,Cn=new d.Ray,vs=new d.Matrix3,Gn=new d.Matrix4,iu=new d.Vector3,Jd=new d.Vector3,Xd=new d.Vector3,Wd=new d.Triangle;function Zd(n,t,e,r){var i,a=n.matrixWorld;Gn.getInverse(a),Cn.copy(e.ray).applyMatrix4(Gn);for(var o=t.intersectRay(Cn.origin,Cn.direction,0,[]),s=n.geometry,l=n.material,u=s.groups,c=s.index,f=0,m=o.length;f<m;f++){var A=o[f],h=A.triangle,p=A.index,g=A.intersectionPoint,v=new d.Vector3(g[0],g[1],g[2]).applyMatrix4(a),y=e.ray.origin.distanceTo(v);if(!(y<e.near||y>e.far)){var b=void 0;if(Array.isArray(l)){if(u)for(var x=p*3,w=0,E=u;w<E.length;w++){var M=E[w];if(x>=M.start&&x-M.start<M.count){b=l[(i=M.materialIndex)!==null&&i!==void 0?i:0];break}}}else b=l;if(b){var C=Wd.set(iu.set(h[0],h[1],h[2]).applyMatrix4(a),Jd.set(h[3],h[4],h[5]).applyMatrix4(a),Xd.set(h[6],h[7],h[8]).applyMatrix4(a)).getNormal(new d.Vector3),R=p*3,L=new d.Face3(c?c.array[R]:R,c?c.array[R+1]:R+1,c?c.array[R+2]:R+2,C),S=e.ray.direction.dot(C);b.side===d.FrontSide&&S>=0||b.side===d.BackSide&&S<=0||r.push({distance:y,object:n,face:L,point:v,distanceToRay:0,faceIndex:p})}}}}function Yd(n,t,e,r){var i,a,o=n.matrixWorld;vs.getNormalMatrix(o),Gn.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*Gn.getMaxScaleOnAxis();Cn.copy(e.ray).applyMatrix4(Gn);for(var l=t.intersectRay(Cn.origin,Cn.direction,s,[]),u=n.geometry,c=u.index,f=u.getAttribute("normal"),m=0,A=l.length;m<A;m++){var h=l[m],p=h.triangle,g=h.index,v=h.intersectionPoint,y=new d.Vector3(v[0],v[1],v[2]).applyMatrix4(o),b=e.ray.origin.distanceTo(y);if(!(b<e.near||b>e.far)){var x=iu.set(p[0],p[1],p[2]).applyMatrix4(o),w=c?c.array[g]:g,E=void 0;if(f instanceof d.BufferAttribute){var M=new d.Vector3().fromBufferAttribute(f,w).applyNormalMatrix(vs);E=new d.Face3(w,w,w,M)}r.push({distance:b,object:n,face:E,point:y,distanceToRay:y.distanceTo(x),index:g})}}}var au="__bvh_mesh__",$d=d.Mesh.prototype.raycast;function ef(n,t){var e=tf(this);e?Zd(this,e,n,t):$d.call(this,n,t)}function tf(n){var t=n[au];return t instanceof eu,t}function rf(n,t){var e;Object.assign(n,(e={},e[au]=t,e.raycast=ef,e))}var ou="__bvh_points__",nf=d.Points.prototype.raycast;function af(n,t){var e=of(this);e?Yd(this,e,n,t):nf.call(this,n,t)}function of(n){var t=n[ou];return t instanceof tu,t}function sf(n,t){var e;Object.assign(n,(e={},e[ou]=t,e.raycast=af,e))}function uf(n,t,e,r){var i=[];return n.traverse(function(a){(a instanceof d.Mesh||a instanceof d.Points)&&a.geometry instanceof d.BufferGeometry&&i.push(a)}),Promise.resolve().then(function(){for(var a=[],o=new Set,s=null,l=0;l<i.length;l++){var u=i[l],c=u.geometry;if(c instanceof d.BufferGeometry){var f=void 0;if(u instanceof d.Mesh?f="mesh":u instanceof d.Points&&(f="points"),!!f){var m=c.boundingBox,A=m?[m.min.x,m.min.y,m.min.z,m.max.x,m.max.y,m.max.z]:void 0,h={};for(var p in c.attributes){var g=c.attributes[p];g instanceof d.InterleavedBufferAttribute?(h[p]={array:g.data.array,stride:g.data.stride,offset:g.offset},s=g.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(h[p]={array:g.array},s=g.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer))}var v=void 0,y=c.getIndex();y&&(y instanceof d.InterleavedBufferAttribute?(v={array:y.data.array,stride:y.data.stride,offset:y.offset},s=y.data.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)):(v={array:y.array},s=y.array,s&&s.buffer instanceof ArrayBuffer&&o.add(s.buffer)));var b={type:f,attributes:h,indices:v,maxItemPerNode:e,maxTreeDepth:r,extents:A};a.push(b)}}}return jd.postMessage(a,Array.from(o))}).then(function(a){for(var o=0;o<i.length;o++){var s=i[o],l=s.geometry,u=a[o];if(l instanceof d.BufferGeometry){for(var c in u.attributes){var f=u.attributes[c].array,m=l.attributes[c];m instanceof d.InterleavedBufferAttribute?m.data.array=f:m.array=f}var A=l.getIndex();if(A&&u.indices){var f=u.indices.array;A instanceof d.InterleavedBufferAttribute?A.data.array=f:A.array=f}if(s instanceof d.Mesh){var h=new eu(u.attributes.position,u.indices);h.offsetArray=u.offsetArray,h.rootNodePacked=u.rootNodePacked,rf(s,h)}else if(s instanceof d.Points){var h=new tu(u.attributes.position,u.indices);h.offsetArray=u.offsetArray,h.rootNodePacked=u.rootNodePacked,sf(s,h)}}}return n})}var su=function(n){se(t,n);function t(e,r,i){i===void 0&&(i=Q);var a=n.call(this)||this;return a.contentObject=r,a.disposer=i,a.name=e,a.materials=[],a.pbmObjects=[],a.disposers=[i],a.add(r),r.traverse(function(o){var s;if(o instanceof d.Mesh||o instanceof d.Points){var l=o.material;Array.isArray(l)?(s=a.materials).push.apply(s,l):a.materials.push(l)}(o instanceof Tt||o instanceof er)&&a.pbmObjects.push(o)}),a}return t.prototype.generateBvhTree=function(){return uf(this,!0,200,10)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var a=this.children.slice(),o,s=[];o=a.pop();)if(o.visible){o.raycast(e,s);for(var l=0,u=o.children.length;l<u;l++)a.push(o.children[l])}return s.forEach(function(c){var f=0;if((c.object instanceof Tt||c.object instanceof er)&&c.face){var m=Array.isArray(c.object.material)?c.object.material[c.face.materialIndex]:c.object.material;m&&(f=m.floor)}c.floor=f}),r&&s.sort(function(c,f){return c.distance-f.distance}),i.push.apply(i,s),i},t.prototype.update=function(e,r,i,a){for(var o=0,s=this.pbmObjects;o<s.length;o++){var l=s[o];l.update(e,r,i,a)}},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0,this.pbmObjects.length=0},t.prototype.clone=function(){return new t(this.name,this.contentObject,this.disposer)},t}(d.Object3D);function at(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(s!=null?s:"").trim()}).filter(function(s){return s.length>0&&!/^\/+$/.test(s)});for(var r=0;r<n.length;r++){var i=r===0,a=r===n.length-1,o=n[r];i||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),a||(o=o.replace(/\/+$/,"")),e.push(o)}return e.join("/")}function wi(n){var t,e=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);if(!e)return n;var r=e[1]||"",i=n.slice(r.length+2),a=i.indexOf("#");a>=0&&(n.slice(a),i=n.slice(0,a));var o=i.indexOf("?");o>=0&&(n.slice(o),i=n.slice(0,o));for(var s=i.split("/"),l=s.shift(),u=(t=s.pop())!==null&&t!==void 0?t:"",c=[],f=0,m=s;f<m.length;f++){var A=m[f];if(!(A===""||A===".")){if(A===".."){c.pop();continue}c.push(A)}}return r+"//"+l+"/"+c.join("/")+"/"+u}function Mr(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function uu(n,t,e){if(n.content&&n.content.uri&&(Mr(n.content.uri)||(n.content.uri=wi(at(t,n.content.uri)))),n.transform){for(var r=!1,i=0;i<16;i++){var a=n.transform[i];if(typeof a!="number"||isNaN(a)||!isFinite(a)){r=!0;break}}if(n.transform[15]===0&&(r=!0),r)throw new Error("Invalid Tile Transform: "+JSON.stringify(n.transform))}if(n.children)for(var o=0,s=n.children;o<s.length;o++){var l=s[o];uu(l,t)}return n}function Ei(n,t){if(n.asset||(n.asset={}),n.rootMeta||(n.rootMeta={}),n.asset.overview){var e=n.asset.overview;Mr(e.imageFile)||(e.imageFile=wi(at(t,e.imageFile))),Mr(e.worldFile)||(e.worldFile=wi(at(t,e.worldFile)))}if(n.asset.trajectories)for(var r=0;r<n.asset.trajectories.list.length;r++){var i=n.asset.trajectories.list[r];i.file=wi(at(t,i.file))}return uu(n.root,t),n}function lf(n,t,e){for(var r,i,a=Promise.resolve(),o=n.slice(),s=function(){for(var l=[],u=0,c=void 0;c=o.shift();){l.push(c);var f=((r=c.image)===null||r===void 0?void 0:r.width)*((i=c.image)===null||i===void 0?void 0:i.height);if(!isNaN(f)&&isFinite(f)&&(u+=f),u>=e)break}a=a.then(function(){return new Promise(function(m){dt.shared.add(function(){for(var A=0,h=l;A<h.length;A++){var p=h[A];t.initTexture(p)}m()},!0)})}).catch(function(){})};o.length>0;)s();return a}function go(n,t){if(t===void 0&&(t=""),(t[0]==="?"||t[0]==="&")&&(t=t.slice(1)),!t)return n;var e=n.indexOf("#"),r="";return e>=0&&(r=n.slice(e),n=n.slice(0,e)),(n[n.length-1]==="?"||n[n.length-1]==="&")&&(n=n.slice(0,-1)),n.indexOf("?")>=0?"".concat(n,"&").concat(t).concat(r):"".concat(n,"?").concat(t).concat(r)}var la=4;function lu(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=la,n.version=r.getUint32(e,!0),e+=la,n.byteLength=r.getUint32(e,!0),e+=la,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var sr,We;(function(n){n[n.BYTE=5120]="BYTE",n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.SHORT=5122]="SHORT",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.INT=5124]="INT",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.FLOAT=5126]="FLOAT",n[n.DOUBLE=5130]="DOUBLE"})(We||(We={}));var cf=(sr={},sr[We.DOUBLE]=Float64Array,sr[We.FLOAT]=Float32Array,sr[We.UNSIGNED_SHORT]=Uint16Array,sr[We.UNSIGNED_INT]=Uint32Array,sr[We.UNSIGNED_BYTE]=Uint8Array,sr[We.BYTE]=Int8Array,sr[We.SHORT]=Int16Array,sr[We.INT]=Int32Array,sr),df={DOUBLE:We.DOUBLE,FLOAT:We.FLOAT,UNSIGNED_SHORT:We.UNSIGNED_SHORT,UNSIGNED_INT:We.UNSIGNED_INT,UNSIGNED_BYTE:We.UNSIGNED_BYTE,BYTE:We.BYTE,SHORT:We.SHORT,INT:We.INT};function ki(n){var t=cf[n];if(!t)throw new Error("Failed to convert GL type");return t}function ca(n){var t=ki(n);return t.BYTES_PER_ELEMENT}function ms(n,t,e,r){e===void 0&&(e=0);var i=ki(n);if(e%ca(n)!==0){var a=r?t.slice(e,e+r*ca(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/ca(n))}function ff(n){var t=df[n];if(!t)throw new Error("Failed to convert GL type");return t}var cu=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",We.UNSIGNED_INT,1);r&&r.length&&(this.featuresLength=r[0])}return n.prototype.getExtension=function(t){return this.json.extensions&&this.json.extensions[t]},n.prototype.hasProperty=function(t){return!!this.json[t]},n.prototype.getGlobalProperty=function(t,e,r){var i=this.json[t];if(typeof i=="number"){var a=ki(e);return new a([i])}else if(Array.isArray(i)){var a=ki(e);return new a(i)}else if(i&&Number.isFinite(i.byteOffset))return this.getTypedArrayFromBinary(t,e,r,1,i.byteOffset);return null},n.prototype.getPropertyArray=function(t,e,r){var i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(e=ff(i.componentType)),this.getTypedArrayFromBinary(t,e,r,this.featuresLength,i.byteOffset)):this.getTypedArrayFromArray(t,e,i)},n.prototype.getProperty=function(t,e,r,i,a){var o=this.json[t];if(!o)return null;var s=this.getPropertyArray(t,e,r);if(r===1)return a[0]=s[i],a;for(var l=0;l<r;++l)a[l]=s[r*i+l];return a},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,a){var o=this.cachedTypedArrays,s=o[t];return s||(s=ms(e,this.buffer.buffer,this.buffer.byteOffset+a,i*r),o[t]=s),s},n.prototype.getTypedArrayFromArray=function(t,e,r){var i=this.cachedTypedArrays,a=i[t];return a||(a=ms(e,r),i[t]=a),a},n}(),yn=4,As="b3dm tile in legacy format.";function du(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function fu(n,t,e){return e=hf(n,t,e),e=pf(n,t,e),e=vf(n,t,e),e}function hf(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=yn;var o=r.getUint32(e,!0);e+=yn;var s=r.getUint32(e,!0);e+=yn;var l=r.getUint32(e,!0);return e+=yn,s>=570425344?(e-=yn*2,i=a,s=o,l=0,a=0,o=0,console.warn(As)):l>=570425344&&(e-=yn,i=s,s=a,l=o,a=0,o=0,console.warn(As)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=l,n.header.batchLength=i,e}function pf(n,t,e){var r=n.header||{},i=r.featureTableJsonByteLength,a=r.featureTableBinaryByteLength,o=r.batchLength;if(n.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){var s=du(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=[0,0,0];var l=new cu(n.featureTableJson,n.featureTableBinary);if(Array.isArray(l.json.RTC_CENTER)){var u=l.json.RTC_CENTER;n.rtcCenter[0]=u[0],n.rtcCenter[1]=u[1],n.rtcCenter[2]=u[2]}else{var u=l.getGlobalProperty("RTC_CENTER",We.FLOAT,3);u&&(n.rtcCenter[0]=u[0],n.rtcCenter[1]=u[1],n.rtcCenter[2]=u[2])}return e}function vf(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=du(t,e,i);n.batchTableJson=JSON.parse(o),e+=i,a&&a>0&&(n.batchTableBinary=new Uint8Array(t,e,a),n.batchTableBinary=new Uint8Array(n.batchTableBinary),e+=a)}return e}function mf(n,t,e){var r=e!==void 0?new Uint8Array(n).subarray(t,t+e):new Uint8Array(n).subarray(t),i=new Uint8Array(r);return i.buffer}function Af(n,t,e){var r=n.byteLength-e;if(r===0)throw new Error("glTF byte length must be greater than 0.");return e%4!==0&&console.warn("".concat(n.type,": embedded glb is not aligned to a 4-byte boundary.")),n.gltfArrayBuffer=mf(t,e,r),n.byteLength}function Ka(n){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(n);for(var t="",e=0,r=n.length;e<r;e++)t+=String.fromCharCode(n[e]);try{return decodeURIComponent(escape(t))}catch(i){return t}}var Oe={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Vn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Li={9728:d.NearestFilter,9729:d.LinearFilter,9984:d.NearestMipmapNearestFilter,9985:d.LinearMipmapNearestFilter,9986:d.NearestMipmapLinearFilter,9987:d.LinearMipmapLinearFilter},Oi={33071:d.ClampToEdgeWrapping,33648:d.MirroredRepeatWrapping,10497:d.RepeatWrapping},gs={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},kt={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Nr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},gf={CUBICSPLINE:void 0,LINEAR:d.InterpolateLinear,STEP:d.InterpolateDiscrete},yr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function vt(n){var t=[];for(var e in n)t.push(n[e]);return t}function yf(n){var t=Array.from(n);return function(){for(var e=0,r=t;e<r.length;e++){var i=r[e];typeof i.dispose=="function"&&i.dispose(),typeof i.close=="function"&&i.close()}}}var bf=function(){function n(t,e,r){this.json=t,this.extensions=e,this.options=r,this.cache=new Map,this.disposeSet=new Set,this.textureSet=new Set,this.nodeNamesUsed={}}return n.prototype.dispose=function(){this.cache.clear(),this.disposeSet.forEach(function(t){typeof t.dispose=="function"&&t.dispose(),typeof t.close=="function"&&t.close()}),this.disposeSet.clear(),this.textureSet.clear(),this.extensions={},this.json={asset:{version:"unknown"}}},n.prototype.markDefs=function(){for(var t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[],i=0,a=e.length;i<a;i++)for(var o=e[i].joints,s=0,l=o.length;s<l;s++)t[o[s]].isBone=!0;for(var u=0,c=t.length;u<c;u++){var f=t[u];f.mesh!==void 0&&f.skin!==void 0&&(r[f.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.markDefs();for(var i=0,a=vt(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(vt(r).map(function(s){return s.prepare(t)})).then(function(){var s,l,u;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(c,f){return t.loadScene(f)})),Promise.all(((l=e.animations)!==null&&l!==void 0?l:[]).map(function(c,f){return t.loadAnimation(f)})),Promise.all(((u=e.cameras)!==null&&u!==void 0?u:[]).map(function(c,f){return t.loadCamera(f)}))])}).then(function(s){var l=s[0],u=s[1],c=s[2],f={json:e,scene:l[e.scene||0],scenes:l,animations:u,cameras:c,textures:[],dispose:Q};return f}).then(function(s){return Promise.all(vt(r).map(function(l){return l.emitResult(s,t)})).then(function(){return s})}).then(function(s){var l=Array.from(t.textureSet),u=yf(t.disposeSet);return Object.assign(s,{textures:l,dispose:u}),t.textureSet.clear(),t.disposeSet.clear(),t.dispose(),s})},n.prototype.loadCamera=function(t){var e="camera:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=vt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var l=void 0,u=this.json.cameras[t],c=u[u.type];c?u.type==="perspective"?l=new d.PerspectiveCamera(d.MathUtils.radToDeg(c.yfov),c.aspectRatio||1,c.znear||1,c.zfar||2e6):u.type==="orthographic"?l=new d.OrthographicCamera(-c.xmag,c.xmag,c.ymag,-c.ymag,c.znear,c.zfar):(console.warn("glTF: Invalid camera type ".concat(u.type,".")),l=new d.Camera):(console.warn("glTF: Missing camera parameters."),l=new d.Camera),u.name&&(l.name=this.createUniqueName(u.name)),i=Promise.resolve(l)}return this.cache.set(e,i),i},n.prototype.loadSkin=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;var i,a=this.json.skins[t],o={joints:a.joints};return a.inverseBindMatrices===void 0?i=Promise.resolve(o):i=this.loadAccessor(a.inverseBindMatrices).then(function(s){return s&&(o.inverseBindMatrices=s),o}),this.cache.set(e,i),i},n.prototype.loadAnimation=function(t){var e="animation:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=vt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadAnimation(t,this),i)break}if(!i){for(var l=this.json,u=l.animations[t],c=[],f=[],m=[],A=[],h=[],p=0,g=u.channels.length;p<g;p++){var v=u.channels[p],y=u.samplers[v.sampler],b=v.target,x=b.node!==void 0?b.node:b.id,w=u.parameters!==void 0?u.parameters[y.input]:y.input,E=u.parameters!==void 0?u.parameters[y.output]:y.output;c.push(this.loadNode(x)),f.push(this.loadAccessor(w)),m.push(this.loadAccessor(E)),A.push(y),h.push(b)}i=Promise.all([Promise.all(c),Promise.all(f),Promise.all(m),Promise.all(A),Promise.all(h)]).then(function(M){for(var C=M[0],R=M[1],L=M[2],S=M[3],I=M[4],O=[],P=function(z,U){var q=C[z],K=R[z],j=L[z],J=S[z],X=I[z];if(q===void 0)return"continue";q.updateMatrix(),q.matrixAutoUpdate=!0;var Y=void 0;switch(Nr[X.path]){case Nr.weights:Y=d.NumberKeyframeTrack;break;case Nr.rotation:Y=d.QuaternionKeyframeTrack;break;case Nr.position:case Nr.scale:default:Y=d.VectorKeyframeTrack;break}var W=q.name?q.name:q.uuid,ee=J.interpolation!==void 0?gf[J.interpolation]:d.InterpolateLinear,Z=[];Nr[X.path]===Nr.weights?q.traverse(function(ge){ge.morphTargetInfluences&&Z.push(ge.name?ge.name:ge.uuid)}):Z.push(W);var ie=j.array;if(j.normalized){for(var te=da(ie.constructor),le=new Float32Array(ie.length),oe=0,we=ie.length;oe<we;oe++)le[oe]=ie[oe]*te;ie=le}for(var oe=0,we=Z.length;oe<we;oe++){var pe=new Y(Z[oe]+"."+Nr[X.path],K.array,ie,ee);O.push(pe)}},F=0,V=C.length;F<V;F++)P(F);var D=u.name?u.name:"animation_"+t;return new d.AnimationClip(D,void 0,O)})}return this.cache.set(e,i),i},n.prototype.loadBuffer=function(t){var e=this.json.buffers[t];if(e.type&&e.type!=="arraybuffer")throw new Error("glTF: "+e.type+" buffer type is not supported.");var r="buffer:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=vt(this.extensions);o<s.length;o++){var l=s[o];if(a=l.loadBuffer(t,this),a)break}if(!a){var u=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(u.uri),{responseType:"arraybuffer"}).then(function(c){return c.body})}return this.cache.set(r,a),a},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=vt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadBufferView(t,this),i)break}if(!i){var l=this.json.bufferViews[t];i=this.loadBuffer(l.buffer).then(function(u){var c=l.byteLength||0,f=l.byteOffset||0;return u.slice(f,f+c)})}return this.cache.set(e,i),i},n.prototype.loadAccessor=function(t){var e=this,r="accessor:"+t,i=this.cache.get(r);if(i)return i;var a=null;if(!a){var o=this.json.accessors[t];if(o.bufferView===void 0&&o.sparse===void 0)a=Promise.resolve(null);else{var s=[];o.bufferView!==void 0?s.push(this.loadBufferView(o.bufferView)):s.push(Promise.resolve(null)),o.sparse!==void 0&&(s.push(this.loadBufferView(o.sparse.indices.bufferView)),s.push(this.loadBufferView(o.sparse.values.bufferView))),a=Promise.all(s).then(function(l){var u=l[0],c=gs[o.type],f=Vn[o.componentType],m=f.BYTES_PER_ELEMENT,A=m*c,h=o.byteOffset||0,p=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,g=o.normalized===!0,v,y;if(p&&p!==A){var b=Math.floor(h/p),x="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,w=e.cache.get(x);w||(v=new f(u,b*p,o.count*p/m),w=new d.InterleavedBuffer(v,p/m),e.cache.set(x,w)),y=new d.InterleavedBufferAttribute(w,c,h%p/m,g)}else u===null?v=new f(o.count*c):v=new f(u,h,o.count*c),y=new d.BufferAttribute(v,c,g);if(o.sparse!==void 0){var E=gs.SCALAR,M=Vn[o.sparse.indices.componentType],C=o.sparse.indices.byteOffset||0,R=o.sparse.values.byteOffset||0,L=new M(l[1],C,o.sparse.count*E),S=new f(l[2],R,o.sparse.count*c);u!==null&&(y=new d.BufferAttribute(y.array.slice(),y.itemSize,y.normalized));for(var I=0,O=L.length;I<O;I++){var P=L[I];if(y.setX(P,S[I*c]),c>=2&&y.setY(P,S[I*c+1]),c>=3&&y.setZ(P,S[I*c+2]),c>=4&&y.setW(P,S[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}}return this.cache.set(r,a),a},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=vt(this.extensions);e<r.length;e++){var i=r[e],a=i.createPrimitiveKey(t,this);if(a)return a}for(var o="",s=Object.keys(t.attributes).sort(),l=0,u=s.length;l<u;l++)o+=s[l]+":"+t.attributes[s[l]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,a=vt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new d.BufferGeometry,t)),r=r.then(function(s){return e.disposeSet.add(s),s}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,a=vt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadImage(t,this),r)break}if(!r){var s=this.json.images[t];if(s.bufferView!==void 0){var l=this.json.bufferViews[s.bufferView];r=this.loadBuffer(l.buffer).then(function(c){var f=l.byteOffset||0,m=l.byteLength||0,A=new Uint8Array(c,f,m),h=new Blob([A],{type:s.mimeType});return Ha(h)})}else if(s.uri){var u=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(u,{},void 0,void 0,void 0,Fi()).then(function(c){return c.body})}else throw new Error("glTF: Invalid image defs.")}return r=r.then(function(c){return e.disposeSet.add(c),c}),r},n.prototype.loadMaterialAsMeshStandardMaterial=function(t){var e=this,r=[],i=new d.MeshStandardMaterial;if(i.color=new d.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(c){return kt[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return kt[c]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(c){return kt[c]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(c){c.encoding=d.sRGBEncoding,i.map=c,e.disposeSet.add(c)})),i.metalness=o.metallicFactor!==void 0?o.metallicFactor:1,i.roughness=o.roughnessFactor!==void 0?o.roughnessFactor:1,o.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(o.metallicRoughnessTexture).then(function(c){c.encoding=d.sRGBEncoding,i.metalnessMap=c,i.roughnessMap=c,e.disposeSet.add(c)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var l=a.alphaMode||yr.OPAQUE;if(l===yr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===yr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(c){i.normalMap=c,e.disposeSet.add(c)})),i.normalScale=new d.Vector2(1,1),a.normalTexture.scale!==void 0)){var u=a.normalTexture.scale;i.normalScale.set(u,u)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(c){i.aoMap=c,e.disposeSet.add(c)})),a.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&(i.emissive=new d.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(a.emissiveTexture).then(function(c){i.emissiveMap=c,e.disposeSet.add(c)}))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterialAsLineBasicMaterial=function(t){var e=[],r=new d.LineBasicMaterial;if(r.color=new d.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(l){return kt[l]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return kt[l]==="tangent"}).length===0&&(r.normalScale&&(r.normalScale.y*=-1),r.clearcoatNormalScale&&(r.clearcoatNormalScale.y*=-1)),t.material!==void 0){var i=this.json.materials[t.material];i.name&&(r.name=i.name);var a=i.pbrMetallicRoughness||{};if(Array.isArray(a.baseColorFactor)){var o=a.baseColorFactor;r.color.fromArray(o),r.opacity=o[3]}i.doubleSided===!0&&(r.side=d.DoubleSide);var s=i.alphaMode||yr.OPAQUE;s===yr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===yr.MASK&&(r.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5))}return this.disposeSet.add(r),Promise.all(e).then(function(){return r})},n.prototype.loadMaterialAsPointsMaterial=function(t){var e=this,r=[],i=new d.PointsMaterial;if(i.color=new d.Color(1,1,1),i.opacity=1,i.sizeAttenuation=!1,Object.keys(t.attributes).filter(function(u){return kt[u]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return kt[u]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(u){u.encoding=d.sRGBEncoding,i.map=u,e.disposeSet.add(u)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var l=a.alphaMode||yr.OPAQUE;l===yr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,l===yr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterial=function(t){var e,r=(e=t.mode)!==null&&e!==void 0?e:Oe.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,l=vt(this.extensions);s<l.length;s++){var u=l[s];if(o=u.loadMaterial(t,this),o)break}if(r===Oe.TRIANGLES||r===Oe.TRIANGLE_STRIP||r===Oe.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Oe.LINES||r===Oe.LINE_STRIP||r===Oe.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Oe.POINTS)o=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,o),o},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=vt(this.extensions);o<s.length;o++){var l=s[o];if(a=l.loadTexture(t,this),a)break}if(!a){var u=this.json.textures[t];a=this.loadImage(u.source).then(function(c){var f=new d.Texture(c);f.needsUpdate=!0,f.flipY=!1,u.name&&(f.name=u.name);var m=e.json.samplers||{},A=m[u.sampler]||{};return f.magFilter=Li[A.magFilter]||d.LinearFilter,f.minFilter=Li[A.minFilter]||d.LinearMipmapLinearFilter,f.wrapS=Oi[A.wrapS]||d.RepeatWrapping,f.wrapT=Oi[A.wrapT]||d.RepeatWrapping,f.onUpdate=function(){c.close()},f})}return a=a.then(function(c){return e.disposeSet.add(c),c}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=vt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadMesh(t,this),r)break}if(!r){var s=this.json.meshes[t],l=s.primitives,u=Promise.all(l.map(function(f){return e.loadGeometry(f)})),c=Promise.all(l.map(function(f){return e.loadMaterial(f)}));r=Promise.all([u,c]).then(function(f){for(var m=f[0],A=f[1],h=[],p=0;p<l.length;p++){var g=l[p],v=m[p],y=A[p],b=g.mode||Oe.TRIANGLES,x=void 0;if(b===Oe.TRIANGLES||b===Oe.TRIANGLE_STRIP||b===Oe.TRIANGLE_FAN)if(b===Oe.TRIANGLE_STRIP?v=e.toGeometryTrianglesDrawMode(v,d.TriangleStripDrawMode):b===Oe.TRIANGLE_FAN&&(v=e.toGeometryTrianglesDrawMode(v,d.TriangleFanDrawMode)),e.disposeSet.add(v),s.isSkinnedMesh){var w=new d.SkinnedMesh(v,y);v.attributes.skinWeight.normalized||w.normalizeSkinWeights(),x=w}else x=new d.Mesh(v,y);else if(b===Oe.POINTS)x=new d.Points(v,y);else if(b===Oe.LINES)x=new d.LineSegments(v,y);else if(b===Oe.LINE_STRIP)x=new d.Line(v,y);else if(b===Oe.LINE_LOOP)x=new d.LineLoop(v,y);else throw new Error("glTF: Primitive mode unsupported: "+b);if(Object.keys(v.morphAttributes).length>0){if(s.weights!==void 0)for(var E=0,M=s.weights.length;E<M;E++)x.morphTargetInfluences[E]=s.weights[E];if(s.extras&&Array.isArray(s.extras.targetNames)){var C=s.extras.targetNames;if(x.morphTargetInfluences.length===C.length){x.morphTargetDictionary={};for(var E=0,M=C.length;E<M;E++)x.morphTargetDictionary[C[E]]=E}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}x.name=e.createUniqueName(s.name||"mesh_"+t),h.push(x)}if(h.length===1)return h[0];for(var R=new d.Group,L=0,S=h;L<S.length;L++){var x=S[L];R.add(x)}return R})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=vt(this.extensions);r<i.length;r++){var a=i[r],o=a.loadNodeAttachments(t,this);o&&e.push(o)}return e},n.prototype.loadNode=function(t){var e="node:"+t,r=this.cache.get(e);if(r)return r;var i=this.json,a=i.nodes[t],o=a.name?this.createUniqueName(a.name):"",s=[];a.mesh!==void 0&&s.push(this.loadMesh(a.mesh).then(function(m){if(a.weights!==void 0){var A=a.weights;m.traverse(function(h){if(h instanceof d.Mesh||h instanceof d.Line||h instanceof d.Points)for(var p=0,g=A.length;p<g;p++)h.morphTargetInfluences[p]=A[p]})}return m})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var l=this.loadNodeAttachments(t),u=0,c=l;u<c.length;u++){var f=c[u];s.push(f)}return Promise.all(s).then(function(m){var A;if(a.isBone===!0?A=new d.Bone:m.length>1?A=new d.Group:m.length===1?A=m[0]:A=new d.Object3D,A!==m[0])for(var h=0,p=m.length;h<p;h++)A.add(m[h]);if(a.name&&(A.name=o),a.matrix!==void 0){var g=new d.Matrix4;g.fromArray(a.matrix),A.applyMatrix4(g)}else a.translation!==void 0&&A.position.fromArray(a.translation),a.rotation!==void 0&&A.quaternion.fromArray(a.rotation),a.scale!==void 0&&A.scale.fromArray(a.scale);return A})},n.prototype.loadScene=function(t){var e=this.json,r=e.scenes[t],i=new d.Group;r.name&&(i.name=this.createUniqueName(r.name));for(var a=r.nodes||[],o=[],s=0,l=a.length;s<l;s++)o.push(this.buildNodeHierarchy(a[s],i));return Promise.all(o).then(function(){return i})},n.prototype.createMaterialTexture=function(t){var e=this;return this.loadTexture(t.index).then(function(r){for(var i=0,a=vt(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s,e.disposeSet.add(r))}return e.textureSet.add(r),r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(w){var E=kt[w]||w.toLowerCase();if(E in t.attributes)return"continue";a.push(s.loadAccessor(i[w]).then(function(M){M&&t.setAttribute(E,M)}))},s=this;for(var l in i)o(l);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(w){w&&t.setIndex(w)}));var u=new d.Box3;if(i.POSITION!==void 0){var c=this.json.accessors[i.POSITION],f=c.min,m=c.max;if(f!==void 0&&m!==void 0){if(u.set(new d.Vector3(f[0],f[1],f[2]),new d.Vector3(m[0],m[1],m[2])),c.normalized){var A=da(Vn[c.componentType]);u.min.multiplyScalar(A),u.max.multiplyScalar(A)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var h=e.targets;if(h!==void 0){for(var p=new d.Vector3,g=new d.Vector3,v=0,y=h.length;v<y;v++){var b=h[v];if(b.POSITION!==void 0){var c=this.json.accessors[b.POSITION],f=c.min,m=c.max;if(f!==void 0&&m!==void 0){if(g.setX(Math.max(Math.abs(f[0]),Math.abs(m[0]))),g.setY(Math.max(Math.abs(f[1]),Math.abs(m[1]))),g.setZ(Math.max(Math.abs(f[2]),Math.abs(m[2]))),c.normalized){var A=da(Vn[c.componentType]);g.multiplyScalar(A)}p.max(g)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}u.expandByVector(p)}t.boundingBox=u;var x=new d.Sphere;return u.getCenter(x.center),x.radius=u.min.distanceTo(u.max)/2,t.boundingSphere=x,Promise.all(a).then(function(){if(t.attributes.uv&&!t.attributes.uv2&&r.options.copyUV2&&t.setAttribute("uv2",t.attributes.uv),e.targets){for(var w=!1,E=!1,M=0,C=e.targets.length;M<C;M++){var R=e.targets[M];if(R.POSITION!==void 0&&(w=!0),R.NORMAL!==void 0&&(E=!0),w&&E)break}if(!w&&!E)return t;var L=[];t.morphTargetsRelative=!0;for(var S=function(I,O){var P=e.targets[I];w?L.push(r.loadAccessor(P.POSITION).then(function(F){F&&(t.morphAttributes.position[I]=F)})):t.morphAttributes.position[I]=t.attributes.position,E?L.push(r.loadAccessor(P.NORMAL).then(function(F){F&&(t.morphAttributes.normal[I]=F)})):t.morphAttributes.normal[I]=t.attributes.normal},M=0,C=e.targets.length;M<C;M++)S(M,C);return Promise.all(L).then(function(){return t})}else return t})},n.prototype.buildNodeHierarchy=function(t,e){var r=this,i=this.json.nodes[t];return this.loadNode(t).then(function(a){if(i.skin===void 0)return a;var o;return r.loadSkin(i.skin).then(function(s){o=s;for(var l=[],u=0,c=o.joints.length;u<c;u++)l.push(r.loadNode(o.joints[u]));return Promise.all(l)}).then(function(s){return a.traverse(function(l){if(l instanceof d.SkinnedMesh){for(var u=[],c=[],f=0,m=s.length;f<m;f++){var A=s[f];if(A instanceof d.Bone){u.push(A);var h=new d.Matrix4;o.inverseBindMatrices!==void 0&&h.fromArray(o.inverseBindMatrices.array,f*16),c.push(h)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[f])}l.bind(new d.Skeleton(u,c),l.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,l=0,u=s.length;l<u;l++){var c=s[l];o.push(r.buildNodeHierarchy(c,a))}return Promise.all(o).then(function(){return a})})},n.prototype.createUniqueName=function(t){for(var e=d.PropertyBinding.sanitizeNodeName(t||""),r=e,i=1;this.nodeNamesUsed[r];++i)r=e+"_"+i;return this.nodeNamesUsed[r]=!0,r},n.prototype.resolveResouce=function(t){return at(this.options.resourcePath,go(t,this.options.search))},n.prototype.toGeometryTrianglesDrawMode=function(t,e){var r=t.getIndex();if(r===null){var i=[],a=t.getAttribute("position");if(a!==void 0){for(var o=0;o<a.count;o++)i.push(o);t.setIndex(i),r=t.getIndex()}}if(r===null)return console.error("glTF: Undefined position attribute. Processing not possible."),t;var s=r.count-2,l=[];if(e===d.TriangleFanDrawMode)for(var o=1;o<=s;o++)l.push(r.getX(0)),l.push(r.getX(o)),l.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2===0?(l.push(r.getX(o)),l.push(r.getX(o+1)),l.push(r.getX(o+2))):(l.push(r.getX(o+2)),l.push(r.getX(o+1)),l.push(r.getX(o)));l.length/3!==s&&console.error("glTF: Unable to generate correct amount of triangles.");var u=t.clone();return u.setIndex(l),this.disposeSet.add(u),u},n}();function da(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("glTF: Unsupported normalized accessor component type.")}}var fr=function(){function n(){}return n.prototype.markDefs=function(t){},n.prototype.prepare=function(t){},n.prototype.emitResult=function(t,e){},n.prototype.createPrimitiveKey=function(t,e){},n.prototype.extendTexture=function(t,e,r){return null},n.prototype.loadBuffer=function(t,e){return null},n.prototype.loadBufferView=function(t,e){return null},n.prototype.loadImage=function(t,e){return null},n.prototype.loadTexture=function(t,e){return null},n.prototype.loadGeometry=function(t,e){return null},n.prototype.loadMaterial=function(t,e){return null},n.prototype.loadMesh=function(t,e){return null},n.prototype.loadNodeAttachments=function(t,e){return null},n.prototype.loadCamera=function(t,e){return null},n.prototype.loadAnimation=function(t,e){return null},n}(),xf=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.header={magic:"",version:0,length:0},e.content="",e.body=null,e}return t.getMagic=function(e){return Ka(new Uint8Array(e.slice(0,4)))},t.prototype.loadGlbBinary=function(e){var r=new DataView(e,0,t.HEADER_LENGTH);if(this.header={magic:t.getMagic(e),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==t.HEADER_MAGIC)throw new Error("glTF:KHR_binary_glTF: Unsupported.");if(this.header.version<2)throw new Error("glTF:KHR_binary_glTF: Legacy binary file detected.");for(var i=new DataView(e,t.HEADER_LENGTH),a=0,o=null,s=null;a<i.byteLength;){var l=i.getUint32(a,!0);if(a+=4,l!==0){var u=i.getUint32(a,!0);if(a+=4,u===t.CHUNK_TYPES.JSON){var c=new Uint8Array(e,t.HEADER_LENGTH+a,l);o=Ka(c)}else if(u===t.CHUNK_TYPES.BIN){var f=t.HEADER_LENGTH+a;s=e.slice(f,f+l)}a+=l}}if(o===null)throw new Error("glTF:KHR_binary_glTF: JSON content not found.");this.content=o,this.body=s},t.prototype.loadBuffer=function(e,r){var i=r.json.buffers[e];return i.uri===void 0&&e===0&&this.body?Promise.resolve(this.body):null},t.prototype.clear=function(){this.body=null,this.content=""},t.HEADER_MAGIC="glTF",t.HEADER_LENGTH=12,t.CHUNK_TYPES={JSON:1313821514,BIN:5130562},t}(fr),wf="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",ys={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},bs={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},Ef=function(){function n(){this.decoderPath=wf,this.decoderConfig={},this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=""}return n.prototype.setDecoderPath=function(t){this.decoderPath=t},n.prototype.setDecoderConfig=function(t){return this.decoderConfig=t,this},n.prototype.setWorkerLimit=function(t){return this.workerLimit=t,this},n.prototype.decodeDracoFile=function(t,e,r,i){var a={attributeIDs:r||ys,attributeTypes:i||bs,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:ys,attributeTypes:bs,useUniqueIDs:!1});for(var i in e.attributeTypes){var a=e.attributeTypes[i];a.BYTES_PER_ELEMENT!==void 0&&(e.attributeTypes[i]=a.name)}var o,s=this.workerNextTaskID++,l=t.byteLength,u=this._getWorker(s,l).then(function(c){return o=c,new Promise(function(f,m){o._callbacks[s]={resolve:f,reject:m},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(c){return r._createGeometry(c.geometry)});return u.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),u},n.prototype._createGeometry=function(t){var e=new d.BufferGeometry;t.index&&e.setIndex(new d.BufferAttribute(t.index.array,1));for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r],a=i.name,o=i.array,s=i.itemSize;e.setAttribute(a,new d.BufferAttribute(o,s))}return e},n.prototype._initDecoder=function(){var t=this;if(this.decoderPending)return this.decoderPending;var e=typeof WebAssembly!="object"||this.decoderConfig.type==="js";if(e){var r=Sn(this.decoderPath+"draco_decoder.js",{responseType:"text"}).then(function(a){return a.body});this.decoderPending=r.then(function(a){var o=["/* draco decoder */",a,"","/* worker */",xs].join(`
|
|
418
418
|
`);t.workerSourceURL=URL.createObjectURL(new Blob([o]))})}else{var r=Sn(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(o){return o.body}),i=Sn(this.decoderPath+"draco_decoder.wasm",{responseType:"arraybuffer"}).then(function(o){return o.body});this.decoderPending=Promise.all([r,i]).then(function(o){var s=o[0],l=o[1];t.decoderConfig.wasmBinary=l;var u=["/* draco decoder */",s,"","/* worker */",xs].join(`
|
|
419
419
|
`);t.workerSourceURL=URL.createObjectURL(new Blob([u]))})}return this.decoderPending},n.prototype._getWorker=function(t,e){var r=this;return this._initDecoder().then(function(){if(r.workerPool.length<r.workerLimit){var i=new Worker(r.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:r.decoderConfig}),i.onmessage=function(o){var s=o.data;switch(s.type){case"decode":i._callbacks[s.id].resolve(s);break;case"error":i._callbacks[s.id].reject(s);break;default:console.error('DRACO: Unexpected message, "'+s.type+'"')}},r.workerPool.push(i)}else r.workerPool.sort(function(o,s){return o._taskLoad>s._taskLoad?-1:1});var a=r.workerPool[r.workerPool.length-1];return a._taskCosts[t]=e,a._taskLoad+=e,a})},n.prototype._releaseTask=function(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]},n.prototype.dispose=function(){for(var t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this},n}(),Vi=new Ef,xs=`
|
|
420
420
|
let decoderConfig;
|
|
@@ -611,7 +611,7 @@ void main() {
|
|
|
611
611
|
}
|
|
612
612
|
|
|
613
613
|
}
|
|
614
|
-
`,fa="KHR_draco_mesh_compression",Sf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadGeometry=function(e,r){return e.extensions&&e.extensions[fa]?this.decodePrimitive(e,r).then(function(i){return r.addGeometryPrimitiveAttributes(i,e)}):null},t.prototype.decodePrimitive=function(e,r){var i=r.json,a=e.extensions[fa].bufferView,o=e.extensions[fa].attributes,s={},l={},u={};for(var c in o){var f=kt[c]||c.toLowerCase();s[f]=o[c]}for(var c in e.attributes){var f=kt[c]||c.toLowerCase();if(o[c]!==void 0){var m=i.accessors[e.attributes[c]],A=Vn[m.componentType];u[f]=A,l[f]=m.normalized===!0}}return r.loadBufferView(a).then(function(h){return new Promise(function(p){Vi.decodeDracoFile(h,function(g){for(var v in g.attributes){var y=g.attributes[v],b=l[v];b!==void 0&&(y.normalized=b)}p(g)},s,u)})})},t}(fr),
|
|
614
|
+
`,fa="KHR_draco_mesh_compression",Sf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadGeometry=function(e,r){return e.extensions&&e.extensions[fa]?this.decodePrimitive(e,r).then(function(i){return r.addGeometryPrimitiveAttributes(i,e)}):null},t.prototype.decodePrimitive=function(e,r){var i=r.json,a=e.extensions[fa].bufferView,o=e.extensions[fa].attributes,s={},l={},u={};for(var c in o){var f=kt[c]||c.toLowerCase();s[f]=o[c]}for(var c in e.attributes){var f=kt[c]||c.toLowerCase();if(o[c]!==void 0){var m=i.accessors[e.attributes[c]],A=Vn[m.componentType];u[f]=A,l[f]=m.normalized===!0}}return r.loadBufferView(a).then(function(h){return new Promise(function(p){Vi.decodeDracoFile(h,function(g){for(var v in g.attributes){var y=g.attributes[v],b=l[v];b!==void 0&&(y.normalized=b)}p(g)},s,u)})})},t}(fr),Mf=function(){function n(t){this.pool=t,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}return n.prototype._initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this._onMessage.bind(this,t)),this.workers[t]=e}},n.prototype._getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype._onMessage=function(t,e){var r=this.workersResolve[t];if(r&&r(e),this.queue.length){var i=this.queue.shift(),a=i.resolve,o=i.msg,s=i.transfer;this.workersResolve[t]=a,this.workers[t].postMessage(o,s)}else this.workerStatus^=1<<t},n.prototype.setWorkerCreator=function(t){this.workerCreator=t},n.prototype.setWorkerLimit=function(t){this.pool=t},n.prototype.postMessage=function(t,e){var r=this;return new Promise(function(i){var a=r._getIdleWorker();a!==-1?(r._initWorker(a),r.workerStatus|=1<<a,r.workersResolve[a]=i,r.workers[a].postMessage(t,e)):r.queue.push({resolve:i,msg:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),Cf="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/basis/1.16/",If=2,Tf=1,Pf=function(){function n(){this.transcoderPath=Cf,this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new Mf(4),this.workerSourceURL="",this.workerConfig=null}return n.prototype.setTranscoderPath=function(t){this.transcoderPath=t},n.prototype.detectSupport=function(t){if(!this.workerConfig){var e=console.warn;console.warn=function(){},this.workerConfig={astcSupported:!!t.extensions.get("WEBGL_compressed_texture_astc"),etc1Supported:!!t.extensions.get("WEBGL_compressed_texture_etc1"),etc2Supported:!!t.extensions.get("WEBGL_compressed_texture_etc"),dxtSupported:!!t.extensions.get("WEBGL_compressed_texture_s3tc"),bptcSupported:!!t.extensions.get("EXT_texture_compression_bptc"),pvrtcSupported:!!t.extensions.get("WEBGL_compressed_texture_pvrtc")||!!t.extensions.get("WEBKIT_WEBGL_compressed_texture_pvrtc")},console.warn=e}return this},n.prototype.init=function(){var t=this;if(!this.transcoderPending){var e=Sn(this.transcoderPath+"basis_transcoder.js",{responseType:"text"}).then(function(i){return i.body}),r=Sn(this.transcoderPath+"basis_transcoder.wasm",{responseType:"arraybuffer"}).then(function(i){return i.body});this.transcoderPending=Promise.all([e,r]).then(function(i){var a=i[0],o=i[1],s=["/* constants */","let _EngineFormat = "+JSON.stringify(Ff),"let _TranscoderFormat = "+JSON.stringify(Rf),"let _BasisFormat = "+JSON.stringify(Bf),"/* basis_transcoder.js */",a,"/* worker */",kf].join(`
|
|
615
615
|
`);t.workerSourceURL=URL.createObjectURL(new Blob([s])),t.transcoderBinary=o,t.workerPool.setWorkerCreator(function(){var l=new Worker(t.workerSourceURL),u=t.transcoderBinary.slice(0);return l.postMessage({type:"init",config:t.workerConfig,transcoderBinary:u},[u]),l})})}return this.transcoderPending},n.prototype.parse=function(t){return this._createTexture([t])},n.prototype._createTextureFrom=function(t){var e=t.mipmaps,r=t.width,i=t.height,a=t.format,o=t.type,s=t.error,l=t.dfdTransferFn,u=t.dfdFlags;if(o==="error")return Promise.reject(s);var c=new d.CompressedTexture(e,r,i,a,d.UnsignedByteType);return c.minFilter=e.length===1?d.LinearFilter:d.LinearMipmapLinearFilter,c.magFilter=d.LinearFilter,c.generateMipmaps=!1,c.needsUpdate=!0,c.encoding=l===If?d.sRGBEncoding:d.LinearEncoding,c.premultiplyAlpha=!!(u&Tf),Promise.resolve(c)},n.prototype._createTexture=function(t){var e=this,r=this.init().then(function(){return e.workerPool.postMessage({type:"transcode",buffers:t},t)}).then(function(i){return e._createTextureFrom(i.data)});return r},n.prototype.dispose=function(){return URL.revokeObjectURL(this.workerSourceURL),this.workerPool.dispose(),this},n}(),Kn=new Pf,Bf={ETC1S:0,UASTC_4x4:1},Rf={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},Ff={RGBAFormat:d.RGBAFormat,RGBA_ASTC_4x4_Format:d.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:d.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:d.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:d.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:d.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:d.RGB_ETC1_Format,RGB_ETC2_Format:d.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:d.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:d.RGB_S3TC_DXT1_Format},kf=`
|
|
616
616
|
|
|
617
617
|
let config;
|
|
@@ -880,7 +880,7 @@ void main() {
|
|
|
880
880
|
return ( value & ( value - 1 ) ) === 0 && value !== 0;
|
|
881
881
|
|
|
882
882
|
}
|
|
883
|
-
`,ws="KHR_texture_basisu",Lf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadTexture=function(e,r){var i=r.json.textures[e];if(!i.extensions||!i.extensions[ws])return null;var a=i.extensions[ws],o=r.json.images[a.source],s=null;if(o.bufferView!==void 0)s=r.loadBufferView(o.bufferView).then(function(l){return Kn.parse(l)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(l){return Kn.parse(l.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(fr),Es="KHR_texture_transform",Of=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.extendTexture=function(e,r,i){var a=r.extensions!==void 0?r.extensions[Es]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+Es+'" extension not yet supported.'),a.offset===void 0&&a.rotation===void 0&&a.scale===void 0||(e=e.clone(),e.needsUpdate=!0,a.offset!==void 0&&e.offset.fromArray(a.offset),a.rotation!==void 0&&(e.rotation=a.rotation),a.scale!==void 0&&e.repeat.fromArray(a.scale)),e):null},t}(fr),Vf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(fr),Nf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(fr),ha=function(){var n="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1j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8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var i=WebAssembly.validate(e)?t:n,a,o=WebAssembly.instantiate(s(i),{}).then(function(v){a=v.instance,a.exports.__wasm_call_ctors()});function s(v){for(var y=new Uint8Array(v.length),b=0;b<v.length;++b){var x=v.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var w=0,b=0;b<v.length;++b)y[w++]=y[b]<60?r[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,w)}function l(v,y,b,x,w,E){var C=a.exports.sbrk,M=b+3&-4,R=C(M*x),L=C(w.length),S=new Uint8Array(a.exports.memory.buffer);S.set(w,L);var I=v(R,b,x,L,w.length);if(I==0&&E&&E(R,M,x),y.set(S.subarray(R,R+b*x)),C(R-C(0)),I!=0)throw new Error("Malformed buffer data: "+I)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],m=0;function A(v){var y={object:new Worker(v),pending:0,requests:{}};return y.object.onmessage=function(b){var x=b.data;y.pending-=x.count,y.requests[x.id][x.action](x.value),delete y.requests[x.id]},y}function h(v){for(var y="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+l.toString()+g.toString(),b=new Blob([y],{type:"text/javascript"}),x=URL.createObjectURL(b),w=0;w<v;++w)f[w]=A(x);URL.revokeObjectURL(x)}function p(v,y,b,x,w){for(var E=f[0],C=1;C<f.length;++C)f[C].pending<E.pending&&(E=f[C]);return new Promise(function(M,R){var L=new Uint8Array(b),S=m++;E.pending+=v,E.requests[S]={resolve:M,reject:R},E.object.postMessage({id:S,count:v,size:y,source:L,mode:x,filter:w},[L.buffer])})}function g(v){o.then(function(){var y=v.data;try{var b=new Uint8Array(y.count*y.size);l(a.exports[y.mode],b,y.count,y.size,y.source,a.exports[y.filter]),self.postMessage({id:y.id,count:y.count,action:"resolve",value:b},[b.buffer])}catch(x){self.postMessage({id:y.id,count:y.count,action:"reject",value:x})}})}return{ready:o,supported:!0,useWorkers:function(v){h(v)},decodeVertexBuffer:function(v,y,b,x,w){l(a.exports.meshopt_decodeVertexBuffer,v,y,b,x,a.exports[u[w]])},decodeIndexBuffer:function(v,y,b,x){l(a.exports.meshopt_decodeIndexBuffer,v,y,b,x)},decodeIndexSequence:function(v,y,b,x){l(a.exports.meshopt_decodeIndexSequence,v,y,b,x)},decodeGltfBuffer:function(v,y,b,x,w,E){l(a.exports[c[w]],v,y,b,x,a.exports[u[E]])},decodeGltfBufferAsync:function(v,y,b,x,w){return f.length>0?p(v,y,b,c[x],u[w]):o.then(function(){var E=new Uint8Array(v*y);return l(a.exports[c[x]],E,v,y,b,a.exports[u[w]]),E})}}}(),pa="EXT_meshopt_compression",Df=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadBufferView=function(e,r){var i=r.json,a=i.bufferViews[e];if(a.extensions&&a.extensions[pa]){var o=a.extensions[pa],s=r.loadBuffer(o.buffer);if(!ha.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(pa)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,ha.ready]).then(function(l){var u=l[0],c=o.byteOffset||0,f=o.byteLength||0,m=o.count,A=o.byteStride,h=new ArrayBuffer(m*A),p=new Uint8Array(u,c,f);return ha.decodeGltfBuffer(new Uint8Array(h),m,A,p,o.mode,o.filter),h})}else return null},t}(fr),Ss="EXT_texture_webp",zf=function(n){se(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.supportsWep=!1,e}return t.prototype.prepare=function(e){var r=this;return k0().then(function(i){r.supportsWep=i.webp})},t.prototype.loadTexture=function(e,r){var i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[Ss]||!this.supportsWep)return null;var o=a.extensions[Ss];return r.loadImage(o.source).then(function(s){var l=new d.Texture(s);l.needsUpdate=!0,l.flipY=!1,a.name&&(l.name=a.name);var u=r.json.samplers||{},c=u[a.sampler]||{};return l.magFilter=Li[c.magFilter]||d.LinearFilter,l.minFilter=Li[c.minFilter]||d.LinearMipmapLinearFilter,l.wrapS=Oi[c.wrapS]||d.RepeatWrapping,l.wrapT=Oi[c.wrapT]||d.RepeatWrapping,l.onUpdate=function(){s.close()},l})},t}(fr),va="CESIUM_RTC",Qf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[va]&&r.json.extensions[va].center){var i=r.json.extensions[va].center;e.CESIUM_RTC={center:new d.Vector3().fromArray(i)}}},t}(fr),Uf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadMesh=function(e,r){var i=this,a=r.json.meshes[e],o=a.primitives,s=Promise.all(o.map(function(c){return r.loadGeometry(c)})),l=Promise.all(o.map(function(c){return i.loadPBMMaterial(c,r)})),u=Promise.all([s,l]).then(function(c){for(var f=c[0],m=c[1],A=[],h=0;h<o.length;h++){var p=o[h],g=f[h],v=m[h];g.attributes.normal===void 0&&(v.flatShading=!0),g.attributes.tangent===void 0&&v.normalScale&&(v.normalScale.y*=-1);var y=p.mode||Oe.TRIANGLES,b=void 0;if(y===Oe.TRIANGLES||y===Oe.TRIANGLE_STRIP||y===Oe.TRIANGLE_FAN)y===Oe.TRIANGLE_STRIP?g=r.toGeometryTrianglesDrawMode(g,d.TriangleStripDrawMode):y===Oe.TRIANGLE_FAN&&(g=r.toGeometryTrianglesDrawMode(g,d.TriangleFanDrawMode)),g.clearGroups(),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,0),r.disposeSet.add(g),b=new Tt(g,[v]);else if(y===Oe.POINTS)b=new er(g,v);else throw new Error("glTF: Primitive mode unsupported: "+y);b.name=r.createUniqueName(a.name||"mesh_"+e),A.push(b)}if(A.length===1)return A[0];for(var x=new d.Group,w=0,E=A;w<E.length;w++){var b=E[w];x.add(b)}return x});return u},t.prototype.loadPBMMaterial=function(e,r){var i,a=(i=e.mode)!==null&&i!==void 0?i:Oe.TRIANGLES,o=null;if(a===Oe.TRIANGLES||a===Oe.TRIANGLE_STRIP||a===Oe.TRIANGLE_FAN)o=this.loadPBMMeshMaterial(e,r);else if(a===Oe.POINTS)o=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+a);return o},t.prototype.extendTexture=function(e,r,i){return e.minFilter=d.LinearFilter,e.magFilter=d.LinearFilter,e.generateMipmaps=!1,e},t.prototype.loadPBMPointCloudMaterial=function(e,r){var i=new ii;return Object.keys(e.attributes).filter(function(a){return kt[a]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),r.disposeSet.add(i),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],a=new Jr("basic");if(a.color=new d.Color(1,1,1),Object.keys(e.attributes).filter(function(c){return kt[c]==="color"}).length>0&&(a.vertexColors=!0),e.material!==void 0){var o=r.json.materials[e.material];o.name&&(a.name=o.name);var s=o.pbrMetallicRoughness||{};if(Array.isArray(s.baseColorFactor)){var l=s.baseColorFactor;a.color=new d.Color().fromArray(l)}if(s.baseColorTexture!==void 0&&i.push(r.createMaterialTexture(s.baseColorTexture).then(function(c){r.disposeSet.add(c),c.encoding=d.sRGBEncoding,a.map=c})),o.doubleSided===!0&&(a.side=d.DoubleSide),o.normalTexture!==void 0&&(i.push(r.createMaterialTexture(o.normalTexture).then(function(c){r.disposeSet.add(c),a.normalMap=c})),a.normalScale=new d.Vector2(1,1),o.normalTexture.scale!==void 0)){var u=o.normalTexture.scale;a.normalScale.set(u,u)}}return r.disposeSet.add(a),a.refreshUniforms(),Promise.all(i).then(function(){return a})},t}(fr),tn={KHR_binary_glTF:xf,KHR_draco_mesh_compression:Sf,KHR_texture_basisu:Lf,KHR_texture_transform:Of,KHR_mesh_quantization:Vf,KHR_materials_unlit:Nf,EXT_meshopt_compression:Df,EXT_texture_webp:zf,CESIUM_RTC:Qf,PBM_mesh:Uf};function yo(n,t){var e,r,i,a={};if(t.addonExtensions)for(var o=0,s=t.addonExtensions;o<s.length;o++){var l=s[o];l in tn&&(a[l]=new tn[l])}var u,c;if(typeof n=="string")c=n;else{var f=tn.KHR_binary_glTF.getMagic(n);if(f===tn.KHR_binary_glTF.HEADER_MAGIC){u=new tn.KHR_binary_glTF;try{u.loadGlbBinary(n)}catch(v){return Promise.reject(v)}a.KHR_binary_glTF=u,c=u.content}else c=Ka(new Uint8Array(n))}var m=JSON.parse(c);if(m.asset===void 0||Number(m.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(m.extensionsUsed)for(var A=m.extensionsRequired||[],h=0;h<m.extensionsUsed.length;h++){var p=m.extensionsUsed[h];a[p]||(tn[p]?a[p]=new tn[p]:A.indexOf(p)>=0&&console.warn('glTF: Unknown extension "'+p+'".'))}var g=new bf(m,a,{copyUV2:(e=t.copyUV2)!==null&&e!==void 0?e:!0,resourcePath:(r=t.resourcePath)!==null&&r!==void 0?r:"",search:(i=t.search)!==null&&i!==void 0?i:"",fetcher:t.fetcher});return g.parse().then(function(v){return u&&u.clear(),v})}var qf=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function hu(n,t){var e={uri:n,gltfUpAxis:t.upAxis};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return r.body})}).then(function(r){return Promise.resolve(0).then(function(i){return lu(e,r,i)}).then(function(i){return fu(e,r,i)}).then(function(i){return Af(e,r,i)})}).then(function(){var r;return yo(e.gltfArrayBuffer,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(r=n.split("?")[1])!==null&&r!==void 0?r:"",fetcher:t.fetcher}).then(function(i){var a=new d.Matrix4;t.upAxis!=="Z"&&a.premultiply(qf);var o=new d.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);if(a.premultiply(o),i.CESIUM_RTC){var s=new d.Matrix4().setPosition(i.CESIUM_RTC.center);a.premultiply(s)}var l=i.scene;return l.applyMatrix4(a),delete e.featureTableBinary,delete e.batchTableBinary,delete e.gltfArrayBuffer,{type:"b3dm",uri:e.uri,byteLength:e.byteLength,scene:l,textures:i.textures,dispose:function(){return i.dispose()}}})})}const pu="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKHIpe1Byb21pc2UucmVzb2x2ZShyLmRhdGEpLnRoZW4oZnVuY3Rpb24obil7cmV0dXJuIGEobil9KS50aGVuKGZ1bmN0aW9uKG4pe3ZhciBlPW4ub3V0cHV0LHQ9bi50cmFuc2ZlcjtyZXR1cm4gcG9zdE1lc3NhZ2UoZSx0KX0pLmNhdGNoKGZ1bmN0aW9uKG4pe3JldHVybiBwb3N0TWVzc2FnZSh7JCRlcnJvcjpufSl9KX19dmFyIHUseTsoZnVuY3Rpb24oYSl7YVthLkJZVEU9NTEyMF09IkJZVEUiLGFbYS5VTlNJR05FRF9CWVRFPTUxMjFdPSJVTlNJR05FRF9CWVRFIixhW2EuU0hPUlQ9NTEyMl09IlNIT1JUIixhW2EuVU5TSUdORURfU0hPUlQ9NTEyM109IlVOU0lHTkVEX1NIT1JUIixhW2EuSU5UPTUxMjRdPSJJTlQiLGFbYS5VTlNJR05FRF9JTlQ9NTEyNV09IlVOU0lHTkVEX0lOVCIsYVthLkZMT0FUPTUxMjZdPSJGTE9BVCIsYVthLkRPVUJMRT01MTMwXT0iRE9VQkxFIn0pKHl8fCh5PXt9KSk7dmFyIGM9KHU9e30sdVt5LkRPVUJMRV09RmxvYXQ2NEFycm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UCIpKXtmb3IodmFyIHI9YS5nZXRQcm9wZXJ0eUFycmF5KCJOT1JNQUxfT0NUMTZQIix5LlVOU0lHTkVEX0JZVEUsMiksbj1yLmxlbmd0aC8yLGU9bmV3IEludDhBcnJheShuKjQpLHQ9MCx2PXZvaWQgMCxBPXZvaWQgMCxOPXZvaWQgMCxFPXZvaWQgMCxTPXZvaWQgMCxzPXZvaWQgMCxUPXZvaWQgMDt0PG47dCsrKXY9dCoyLEE9clt2XSpELTEsTj1yWysrdl0qRC0xLFM9QTwwPy1BOkEscz1OPDA/LU46TixFPTEtKFMrcyksRTwwJiYoQT0oMS1zKSooQTwwPy0xOjEpLE49KDEtUykqKE48MD8tMToxKSksVD1NYXRoLnNxcnQoQSpBK04qTitFKkUpLHY9dCo0LGVbdl09QS9UKmgsZVsrK3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",Hf=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),Cs=typeof self!="undefined"&&self.Blob&&new Blob([Hf(pu)],{type:"text/javascript;charset=utf-8"});function Gf(n){let t;try{if(t=Cs&&(self.URL||self.webkitURL).createObjectURL(Cs),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+pu,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Kf=new nu(function(){return new Gf},2);function jf(n,t,e){var r=new cu(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?_f(i,r):Kf.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function _f(n,t){return Qi(this,void 0,void 0,function(){var e,r,i,a,o,s;return Ui(this,function(l){if(e=n.properties||{},r=n.byteOffset,i=n.byteLength,!e||!Number.isFinite(r)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");return a=t.buffer.slice(r,r+i),o=n.properties,s={POSITION:"Float32Array",NORMAL:"Float32Array",RGB:"Uint8Array",RGBA:"Uint8Array"},[2,Vi.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(u){var c=u.getAttribute("POSITION"),f=u.getAttribute("RGB"),m=u.getAttribute("RGBA"),A=u.getAttribute("NORMAL"),h;if(m)h=m;else if(f){for(var p=f.count,g=f.array,v=new Uint8Array(p*4),y=0,b=void 0,x=void 0;y<p;y++)x=y*4,b=y*3,v[x]=g[b],v[++x]=g[++b],v[++x]=g[++b];h=new d.BufferAttribute(v,4,f.normalized)}return{position:c?{array:c.array,itemSize:c.itemSize,normalized:c.normalized}:null,color:h?{array:h.array,itemSize:h.itemSize,normalized:h.normalized}:null,normal:A?{array:A.array,itemSize:A.itemSize,normalized:A.normalized}:null}})]})})}function vu(n,t){var e={uri:n};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return r.body})}).then(function(r){return Promise.resolve(0).then(function(i){return lu(e,r,i)}).then(function(i){return fu(e,r,i)}).then(function(i){return jf(e,r,i)})}).then(function(){var r;return Jf(e.attributes,{computeBoundingBox:(r=t.computeBoundingBox)!==null&&r!==void 0?r:!0})}).then(function(r){var i=new d.Matrix4,a=new d.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);return i.premultiply(a),r.object.applyMatrix4(i),delete e.gltfArrayBuffer,delete e.featureTableBinary,delete e.batchTableBinary,{type:"pnts",uri:e.uri,byteLength:e.byteLength,scene:r.object,textures:[],dispose:function(){return r.dispose()}}})}function Jf(n,t){var e=new Set,r=new d.BufferGeometry;e.add(r);var i=new ii;e.add(i),n.position&&r.setAttribute("position",new d.BufferAttribute(n.position.array,n.position.itemSize,n.position.normalized)),n.color&&r.setAttribute("color",new d.BufferAttribute(n.color.array,n.color.itemSize,n.color.normalized)),n.normal&&(r.setAttribute("normal",new d.BufferAttribute(n.normal.array,n.normal.itemSize,n.normal.normalized)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var a=new er(r,i);return a.matrix.compose(a.position,a.quaternion,a.scale),a.matrixAutoUpdate=!1,a.frustumCulled=!1,Promise.resolve({object:a,dispose:function(){e.forEach(function(o){o.dispose()}),e.clear()}})}function mu(){var n={};return n.OutWindow=function(){this._windowSize=0},n.OutWindow.prototype.create=function(t){(!this._buffer||this._windowSize!==t)&&(this._buffer=[]),this._windowSize=t,this._pos=0,this._streamPos=0},n.OutWindow.prototype.flush=function(){var t=this._pos-this._streamPos;if(t!==0){for(;t--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},n.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},n.OutWindow.prototype.setStream=function(t){this.releaseStream(),this._stream=t},n.OutWindow.prototype.init=function(t){t||(this._streamPos=0,this._pos=0)},n.OutWindow.prototype.copyBlock=function(t,e){var r=this._pos-t-1;for(r<0&&(r+=this._windowSize);e--;)r>=this._windowSize&&(r=0),this._buffer[this._pos++]=this._buffer[r++],this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.putByte=function(t){this._buffer[this._pos++]=t,this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.getByte=function(t){var e=this._pos-t-1;return e<0&&(e+=this._windowSize),this._buffer[e]},n.RangeDecoder=function(){},n.RangeDecoder.prototype.setStream=function(t){this._stream=t},n.RangeDecoder.prototype.releaseStream=function(){this._stream=null},n.RangeDecoder.prototype.init=function(){var t=5;for(this._code=0,this._range=-1;t--;)this._code=this._code<<8|this._stream.readByte()},n.RangeDecoder.prototype.decodeDirectBits=function(t){for(var e=0,r=t,i;r--;)this._range>>>=1,i=this._code-this._range>>>31,this._code-=this._range&i-1,e=e<<1|1-i,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return e},n.RangeDecoder.prototype.decodeBit=function(t,e){var r=t[e],i=(this._range>>>11)*r;return(this._code^2147483648)<(i^2147483648)?(this._range=i,t[e]+=2048-r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=i,this._code-=i,t[e]-=r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},n.initBitModels=function(t,e){for(;e--;)t[e]=1024},n.BitTreeDecoder=function(t){this._models=[],this._numBitLevels=t},n.BitTreeDecoder.prototype.init=function(){n.initBitModels(this._models,1<<this._numBitLevels)},n.BitTreeDecoder.prototype.decode=function(t){for(var e=1,r=this._numBitLevels;r--;)e=e<<1|t.decodeBit(this._models,e);return e-(1<<this._numBitLevels)},n.BitTreeDecoder.prototype.reverseDecode=function(t){for(var e=1,r=0,i=0,a;i<this._numBitLevels;++i)a=t.decodeBit(this._models,e),e=e<<1|a,r|=a<<i;return r},n.reverseDecode2=function(t,e,r,i){for(var a=1,o=0,s=0,l;s<i;++s)l=r.decodeBit(t,e+a),a=a<<1|l,o|=l<<s;return o},n.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new n.BitTreeDecoder(8),this._numPosStates=0},n.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new n.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new n.BitTreeDecoder(3)},n.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(n.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},n.LenDecoder.prototype.decode=function(t,e){return t.decodeBit(this._choice,0)===0?this._lowCoder[e].decode(t):t.decodeBit(this._choice,1)===0?8+this._midCoder[e].decode(t):16+this._highCoder.decode(t)},n.Decoder2=function(){this._decoders=[]},n.Decoder2.prototype.init=function(){n.initBitModels(this._decoders,768)},n.Decoder2.prototype.decodeNormal=function(t){var e=1;do e=e<<1|t.decodeBit(this._decoders,e);while(e<256);return e&255},n.Decoder2.prototype.decodeWithMatchByte=function(t,e){var r=1,i,a;do if(i=e>>7&1,e<<=1,a=t.decodeBit(this._decoders,(1+i<<8)+r),r=r<<1|a,i!==a){for(;r<256;)r=r<<1|t.decodeBit(this._decoders,r);break}while(r<256);return r&255},n.LiteralDecoder=function(){},n.LiteralDecoder.prototype.create=function(t,e){var r;if(!(this._coders&&this._numPrevBits===e&&this._numPosBits===t))for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=e,this._coders=[],r=1<<this._numPrevBits+this._numPosBits;r--;)this._coders[r]=new n.Decoder2},n.LiteralDecoder.prototype.init=function(){for(var t=1<<this._numPrevBits+this._numPosBits;t--;)this._coders[t].init()},n.LiteralDecoder.prototype.getDecoder=function(t,e){return this._coders[((t&this._posMask)<<this._numPrevBits)+((e&255)>>>8-this._numPrevBits)]},n.Decoder=function(){this._outWindow=new n.OutWindow,this._rangeDecoder=new n.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new n.BitTreeDecoder(4),this._lenDecoder=new n.LenDecoder,this._repLenDecoder=new n.LenDecoder,this._literalDecoder=new n.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new n.BitTreeDecoder(6),this._posSlotDecoder[1]=new n.BitTreeDecoder(6),this._posSlotDecoder[2]=new n.BitTreeDecoder(6),this._posSlotDecoder[3]=new n.BitTreeDecoder(6)},n.Decoder.prototype.setDictionarySize=function(t){return t<0?!1:(this._dictionarySize!==t&&(this._dictionarySize=t,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},n.Decoder.prototype.setLcLpPb=function(t,e,r){var i=1<<r;return t>8||e>4||r>4?!1:(this._literalDecoder.create(e,t),this._lenDecoder.create(i),this._repLenDecoder.create(i),this._posStateMask=i-1,!0)},n.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),n.initBitModels(this._isMatchDecoders,192),n.initBitModels(this._isRep0LongDecoders,192),n.initBitModels(this._isRepDecoders,12),n.initBitModels(this._isRepG0Decoders,12),n.initBitModels(this._isRepG1Decoders,12),n.initBitModels(this._isRepG2Decoders,12),n.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},n.Decoder.prototype.decode=function(t,e,r){var i=0,a=0,o=0,s=0,l=0,u=0,c=0,f,m,A,h,p,g;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||u<r;)if(f=u&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+f)===0)m=this._literalDecoder.getDecoder(u++,c),i>=7?c=m.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):c=m.decodeNormal(this._rangeDecoder),this._outWindow.putByte(c),i=i<4?0:i-(i<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,i)===1)A=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,i)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(i<<4)+f)===0&&(i=i<7?9:11,A=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?h=o:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?h=s:(h=l,l=s),s=o),o=a,a=h),A===0&&(A=2+this._repLenDecoder.decode(this._rangeDecoder,f),i=i<7?8:11);else if(l=s,s=o,o=a,A=2+this._lenDecoder.decode(this._rangeDecoder,f),i=i<7?7:10,p=this._posSlotDecoder[A<=5?A-2:3].decode(this._rangeDecoder),p>=4){if(g=(p>>1)-1,a=(2|p&1)<<g,p<14)a+=n.reverseDecode2(this._posDecoders,a-p-1,this._rangeDecoder,g);else if(a+=this._rangeDecoder.decodeDirectBits(g-4)<<4,a+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),a<0){if(a===-1)break;return!1}}else a=p;if(a>=u||a>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(a,A),u+=A,c=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},n.Decoder.prototype.setDecoderProperties=function(t){var e,r,i,a,o;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),i=e%5,a=~~(e/5),!this.setLcLpPb(r,i,a))?!1:(o=t.readByte(),o|=t.readByte()<<8,o|=t.readByte()<<16,o+=t.readByte()*16777216,this.setDictionarySize(o))},n.decompress=function(t,e,r,i){var a=new n.Decoder;if(!a.setDecoderProperties(t))throw"Incorrect stream properties";if(!a.decode(e,r,i))throw"Error in data stream";return!0},n.decompressFile=function(t,e){var r=new n.Decoder,i;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(i=t.readByte(),i|=t.readByte()<<8,i|=t.readByte()<<16,i+=t.readByte()*16777216,t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,e,i))throw"Error in data stream";return!0},n}var Xf=mu();function Wf(){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),a=0;a<r.length;a++)i[r.charCodeAt(a)]=a;var o=e.length*.75,s=e.length,l,u=0,c,f,m,A;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var h=new ArrayBuffer(o),p=new Uint8Array(h);for(l=0;l<s;l+=4)c=i[e.charCodeAt(l)],f=i[e.charCodeAt(l+1)],m=i[e.charCodeAt(l+2)],A=i[e.charCodeAt(l+3)],p[u++]=c<<2|f>>4,p[u++]=(f&15)<<4|m>>2,p[u++]=(m&3)<<6|A&63;return h}var t="AGFzbQEAAAABSg1gAABgAX8Bf2ACf38Bf2AEf39/fwBgA39/fwBgAX8AYAJ/fwBgA39/fwF/YAR/f39/AX9gAn9/AGABfwF/YAABf2AEf39/fwF/AhsCA2VudgVhYm9ydAADA2VudgZtZW1vcnkCAAEDJiUBAQkKAgoKCwsLCwsAAgoBAgQKAQYFCAoFBQQEBwgCBwwCAQAABAQBcAABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwc9BgZtZW1vcnkCAAV0YWJsZQEABXJlc2V0AA0KbmV3VThBcnJheQAQCnVucGFja1NpemUAFAZkZWNvZGUAIwgBJAkHAQBBAAsBJQqAViVoAQN/IABBgICAgARLBEAACyMBIgEgAEEBIABBAUsbakEHakF4cSICPwAiA0EQdEsEQCADIAIgAWtB//8DakGAgHxxQRB2IgAgAyAAShtAAEEASARAIABAAEEASARAAAsLCyACJAEgAQsbAQF/QQFBICAAQQdqZ2t0EAEiASAANgIAIAELkQMBAX8gAUUEQA8LIABBADoAACAAIAFqQQFrQQA6AAAgAUECTQRADwsgAEEBakEAOgAAIABBAmpBADoAACAAIAFqIgJBAmtBADoAACACQQNrQQA6AAAgAUEGTQRADwsgAEEDakEAOgAAIAAgAWpBBGtBADoAACABQQhNBEAPC0EAIABrQQNxIgIgAGoiAEEANgIAIAEgAmtBfHEiASAAakEEa0EANgIAIAFBCE0EQA8LIABBBGpBADYCACAAQQhqQQA2AgAgACABaiICQQxrQQA2AgAgAkEIa0EANgIAIAFBGE0EQA8LIABBDGpBADYCACAAQRBqQQA2AgAgAEEUakEANgIAIABBGGpBADYCACAAIAFqIgJBHGtBADYCACACQRhrQQA2AgAgAkEUa0EANgIAIAJBEGtBADYCACAAQQRxQRhqIgIgAGohACABIAJrIQEDQCABQSBPBEAgAEIANwMAIABBCGpCADcDACAAQRBqQgA3AwAgAEEYakIANwMAIAFBIGshASAAQSBqIQAMAQsLC1EBA38gAEH+////AEsEQEEAQSBBLUEnEAAACyAAQQJ0IgMQAiECQQgQASIBQQA2AgAgAUEANgIEIAEgAjYCACABIAA2AgQgAkEIaiADEAMgAQtmAQF/IAFB/P///wFLBEBBAEHAAEEXQSIQAAALIAFBAXQiARACIgJBCGogARADIABFBEBBDBABIQALIABBADYCACAAQQA2AgQgAEEANgIIIAAgAjYCACAAQQA2AgQgACABNgIIIAALCgBBDBABIAAQBQsuAQF/QQgQASIBQQA2AgAgAUEANgIEIAEgADYCBCABQQEgASgCBHQQBjYCACABC6EBAQR/QRAQASIBQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgxBEBAEIQIDQCAAQRBIBEBBAxAHIQMgAigCACAAQQJ0aiADNgIIIABBAWohAAwBCwsgASACNgIEQRAQBCECQQAhAANAIABBEEgEQEEDEAchAyACKAIAIABBAnRqIAM2AgggAEEBaiEADAELCyABIAI2AgggAUEIEAc2AgwgAQs0AQF/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEAOgAUIABBADYCGCAAQQA2AhwgAEEANgIgIABBADYCJCAAQQA2AiggAEEANgIsIABBADYCMCAAQQA2AjQgAEEANgI4IABBADYCPCAAQQA2AkAgAEEANgJEIABBADYCSCAAQQA2AkxBBBAEIQIDQCABQQRIBEBBBhAHIQMgAigCACABQQJ0aiADNgIIIAFBAWohAQwBCwsgACACNgIkIABBBBAHNgIoIABB8wAQBjYCLCAAQcABEAY2AjAgAEEMEAY2AjQgAEEMEAY2AjggAEEMEAY2AjwgAEEMEAY2AkAgAEHAARAGNgJEIAAQCDYCSCAAEAg2AkwgABAJNgIEIAAQCjYCCCAACx8BAX9BCBABIgBBADYCACAAQQA2AgQgABALNgIAIAALCgAjACQBEAwkAwthAQF/IAFB+P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BgAFBoQFBDBAAAAsgAigCBCACKAIAQQFqaiADQf8BcUEJcCIHOgAIIAIoAgQgAigCAGogA0H/AXFBCW4iAzoACCADQQVwIQUgAigCBCACKAIAQQJqaiADQQVuIgM6AAggAigCBCACKAIAQQNqaiAFOgAIIAQgBzYCDCAEIAM2AhAgBCAFOgAUIARBADYCHEEAIQIDQAJAIAJBBE8NACAEIAQoAhwgBigCBCAGKAIAIAJBAWpqai0ACCACQQN0dHI2AhwgAkEBaiECDAELCyAEIAQoAhw2AhggBCgCGEGAIEkEQCAEQYAgNgIYC0EAIQJBACEFQQAhAwNAAkAgA0EITg0AIAYgA0EFahARQf8BcSIEQf8BRwRAQQEhBQsgBCADQQN0dCACciECIANBAWohAwwBCwsgACgCACAFRToAACAAKAIAKAIEIAE2AgAgACgCABAWAkAgACgCACAFIAIQICIBQQFGDQAgAUEDRwRAIAFBAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function Zf(n,t,e){try{var r={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},i=r.data.length,a={data:[],offset:0,writeByte:function(l){var u=Math.floor(this.offset/i);this.data[u]||(this.data[u]=new Uint8Array(i)),this.data[u][this.offset%i]=l,this.offset++}};n.decompressFile(r,a);for(var o=new Uint8Array(a.offset),s=0;s<a.offset;s++)o[s]=a.data[Math.floor(s/i)][s%i];e(null,o)}catch(l){e(l)}}function Yf(n,t,e){var r=24;try{var i=new WebAssembly.Memory({initial:16}),a=new WebAssembly.Module(n),o=new WebAssembly.Instance(a,{env:{memory:i,abort:function(){e(new Error("webAssembly abort"))}}}),s=o.exports,l=s.newU8Array(t.length),u=new Uint8Array(i.buffer,l+r,t.length);u.set(t);var c=s.decode(l),f=new Uint32Array(i.buffer,c,4),m=f[0],A=f[2],h=f[3];m?e(null,new Uint8Array(i.buffer,h+r,A).slice(0,A)):e(new Error("lzma deocder error"))}catch(p){e(p)}}var $f=`
|
|
883
|
+
`,ws="KHR_texture_basisu",Lf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadTexture=function(e,r){var i=r.json.textures[e];if(!i.extensions||!i.extensions[ws])return null;var a=i.extensions[ws],o=r.json.images[a.source],s=null;if(o.bufferView!==void 0)s=r.loadBufferView(o.bufferView).then(function(l){return Kn.parse(l)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(l){return Kn.parse(l.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(fr),Es="KHR_texture_transform",Of=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.extendTexture=function(e,r,i){var a=r.extensions!==void 0?r.extensions[Es]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+Es+'" extension not yet supported.'),a.offset===void 0&&a.rotation===void 0&&a.scale===void 0||(e=e.clone(),e.needsUpdate=!0,a.offset!==void 0&&e.offset.fromArray(a.offset),a.rotation!==void 0&&(e.rotation=a.rotation),a.scale!==void 0&&e.repeat.fromArray(a.scale)),e):null},t}(fr),Vf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(fr),Nf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(fr),ha=function(){var n="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var i=WebAssembly.validate(e)?t:n,a,o=WebAssembly.instantiate(s(i),{}).then(function(v){a=v.instance,a.exports.__wasm_call_ctors()});function s(v){for(var y=new Uint8Array(v.length),b=0;b<v.length;++b){var x=v.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var w=0,b=0;b<v.length;++b)y[w++]=y[b]<60?r[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,w)}function l(v,y,b,x,w,E){var M=a.exports.sbrk,C=b+3&-4,R=M(C*x),L=M(w.length),S=new Uint8Array(a.exports.memory.buffer);S.set(w,L);var I=v(R,b,x,L,w.length);if(I==0&&E&&E(R,C,x),y.set(S.subarray(R,R+b*x)),M(R-M(0)),I!=0)throw new Error("Malformed buffer data: "+I)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],m=0;function A(v){var y={object:new Worker(v),pending:0,requests:{}};return y.object.onmessage=function(b){var x=b.data;y.pending-=x.count,y.requests[x.id][x.action](x.value),delete y.requests[x.id]},y}function h(v){for(var y="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+l.toString()+g.toString(),b=new Blob([y],{type:"text/javascript"}),x=URL.createObjectURL(b),w=0;w<v;++w)f[w]=A(x);URL.revokeObjectURL(x)}function p(v,y,b,x,w){for(var E=f[0],M=1;M<f.length;++M)f[M].pending<E.pending&&(E=f[M]);return new Promise(function(C,R){var L=new Uint8Array(b),S=m++;E.pending+=v,E.requests[S]={resolve:C,reject:R},E.object.postMessage({id:S,count:v,size:y,source:L,mode:x,filter:w},[L.buffer])})}function g(v){o.then(function(){var y=v.data;try{var b=new Uint8Array(y.count*y.size);l(a.exports[y.mode],b,y.count,y.size,y.source,a.exports[y.filter]),self.postMessage({id:y.id,count:y.count,action:"resolve",value:b},[b.buffer])}catch(x){self.postMessage({id:y.id,count:y.count,action:"reject",value:x})}})}return{ready:o,supported:!0,useWorkers:function(v){h(v)},decodeVertexBuffer:function(v,y,b,x,w){l(a.exports.meshopt_decodeVertexBuffer,v,y,b,x,a.exports[u[w]])},decodeIndexBuffer:function(v,y,b,x){l(a.exports.meshopt_decodeIndexBuffer,v,y,b,x)},decodeIndexSequence:function(v,y,b,x){l(a.exports.meshopt_decodeIndexSequence,v,y,b,x)},decodeGltfBuffer:function(v,y,b,x,w,E){l(a.exports[c[w]],v,y,b,x,a.exports[u[E]])},decodeGltfBufferAsync:function(v,y,b,x,w){return f.length>0?p(v,y,b,c[x],u[w]):o.then(function(){var E=new Uint8Array(v*y);return l(a.exports[c[x]],E,v,y,b,a.exports[u[w]]),E})}}}(),pa="EXT_meshopt_compression",Df=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadBufferView=function(e,r){var i=r.json,a=i.bufferViews[e];if(a.extensions&&a.extensions[pa]){var o=a.extensions[pa],s=r.loadBuffer(o.buffer);if(!ha.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(pa)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,ha.ready]).then(function(l){var u=l[0],c=o.byteOffset||0,f=o.byteLength||0,m=o.count,A=o.byteStride,h=new ArrayBuffer(m*A),p=new Uint8Array(u,c,f);return ha.decodeGltfBuffer(new Uint8Array(h),m,A,p,o.mode,o.filter),h})}else return null},t}(fr),Ss="EXT_texture_webp",zf=function(n){se(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.supportsWep=!1,e}return t.prototype.prepare=function(e){var r=this;return k0().then(function(i){r.supportsWep=i.webp})},t.prototype.loadTexture=function(e,r){var i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[Ss]||!this.supportsWep)return null;var o=a.extensions[Ss];return r.loadImage(o.source).then(function(s){var l=new d.Texture(s);l.needsUpdate=!0,l.flipY=!1,a.name&&(l.name=a.name);var u=r.json.samplers||{},c=u[a.sampler]||{};return l.magFilter=Li[c.magFilter]||d.LinearFilter,l.minFilter=Li[c.minFilter]||d.LinearMipmapLinearFilter,l.wrapS=Oi[c.wrapS]||d.RepeatWrapping,l.wrapT=Oi[c.wrapT]||d.RepeatWrapping,l.onUpdate=function(){s.close()},l})},t}(fr),va="CESIUM_RTC",Qf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[va]&&r.json.extensions[va].center){var i=r.json.extensions[va].center;e.CESIUM_RTC={center:new d.Vector3().fromArray(i)}}},t}(fr),Uf=function(n){se(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadMesh=function(e,r){var i=this,a=r.json.meshes[e],o=a.primitives,s=Promise.all(o.map(function(c){return r.loadGeometry(c)})),l=Promise.all(o.map(function(c){return i.loadPBMMaterial(c,r)})),u=Promise.all([s,l]).then(function(c){for(var f=c[0],m=c[1],A=[],h=0;h<o.length;h++){var p=o[h],g=f[h],v=m[h];g.attributes.normal===void 0&&(v.flatShading=!0),g.attributes.tangent===void 0&&v.normalScale&&(v.normalScale.y*=-1);var y=p.mode||Oe.TRIANGLES,b=void 0;if(y===Oe.TRIANGLES||y===Oe.TRIANGLE_STRIP||y===Oe.TRIANGLE_FAN)y===Oe.TRIANGLE_STRIP?g=r.toGeometryTrianglesDrawMode(g,d.TriangleStripDrawMode):y===Oe.TRIANGLE_FAN&&(g=r.toGeometryTrianglesDrawMode(g,d.TriangleFanDrawMode)),g.clearGroups(),g.addGroup(0,g.index?g.index.count:g.attributes.position.count,0),r.disposeSet.add(g),b=new Tt(g,[v]);else if(y===Oe.POINTS)b=new er(g,v);else throw new Error("glTF: Primitive mode unsupported: "+y);b.name=r.createUniqueName(a.name||"mesh_"+e),A.push(b)}if(A.length===1)return A[0];for(var x=new d.Group,w=0,E=A;w<E.length;w++){var b=E[w];x.add(b)}return x});return u},t.prototype.loadPBMMaterial=function(e,r){var i,a=(i=e.mode)!==null&&i!==void 0?i:Oe.TRIANGLES,o=null;if(a===Oe.TRIANGLES||a===Oe.TRIANGLE_STRIP||a===Oe.TRIANGLE_FAN)o=this.loadPBMMeshMaterial(e,r);else if(a===Oe.POINTS)o=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+a);return o},t.prototype.extendTexture=function(e,r,i){return e.minFilter=d.LinearFilter,e.magFilter=d.LinearFilter,e.generateMipmaps=!1,e},t.prototype.loadPBMPointCloudMaterial=function(e,r){var i=new ii;return Object.keys(e.attributes).filter(function(a){return kt[a]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),r.disposeSet.add(i),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],a=new Jr("basic");if(a.color=new d.Color(1,1,1),Object.keys(e.attributes).filter(function(c){return kt[c]==="color"}).length>0&&(a.vertexColors=!0),e.material!==void 0){var o=r.json.materials[e.material];o.name&&(a.name=o.name);var s=o.pbrMetallicRoughness||{};if(Array.isArray(s.baseColorFactor)){var l=s.baseColorFactor;a.color=new d.Color().fromArray(l)}if(s.baseColorTexture!==void 0&&i.push(r.createMaterialTexture(s.baseColorTexture).then(function(c){r.disposeSet.add(c),c.encoding=d.sRGBEncoding,a.map=c})),o.doubleSided===!0&&(a.side=d.DoubleSide),o.normalTexture!==void 0&&(i.push(r.createMaterialTexture(o.normalTexture).then(function(c){r.disposeSet.add(c),a.normalMap=c})),a.normalScale=new d.Vector2(1,1),o.normalTexture.scale!==void 0)){var u=o.normalTexture.scale;a.normalScale.set(u,u)}}return r.disposeSet.add(a),a.refreshUniforms(),Promise.all(i).then(function(){return a})},t}(fr),tn={KHR_binary_glTF:xf,KHR_draco_mesh_compression:Sf,KHR_texture_basisu:Lf,KHR_texture_transform:Of,KHR_mesh_quantization:Vf,KHR_materials_unlit:Nf,EXT_meshopt_compression:Df,EXT_texture_webp:zf,CESIUM_RTC:Qf,PBM_mesh:Uf};function yo(n,t){var e,r,i,a={};if(t.addonExtensions)for(var o=0,s=t.addonExtensions;o<s.length;o++){var l=s[o];l in tn&&(a[l]=new tn[l])}var u,c;if(typeof n=="string")c=n;else{var f=tn.KHR_binary_glTF.getMagic(n);if(f===tn.KHR_binary_glTF.HEADER_MAGIC){u=new tn.KHR_binary_glTF;try{u.loadGlbBinary(n)}catch(v){return Promise.reject(v)}a.KHR_binary_glTF=u,c=u.content}else c=Ka(new Uint8Array(n))}var m=JSON.parse(c);if(m.asset===void 0||Number(m.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(m.extensionsUsed)for(var A=m.extensionsRequired||[],h=0;h<m.extensionsUsed.length;h++){var p=m.extensionsUsed[h];a[p]||(tn[p]?a[p]=new tn[p]:A.indexOf(p)>=0&&console.warn('glTF: Unknown extension "'+p+'".'))}var g=new bf(m,a,{copyUV2:(e=t.copyUV2)!==null&&e!==void 0?e:!0,resourcePath:(r=t.resourcePath)!==null&&r!==void 0?r:"",search:(i=t.search)!==null&&i!==void 0?i:"",fetcher:t.fetcher});return g.parse().then(function(v){return u&&u.clear(),v})}var qf=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function hu(n,t){var e={uri:n,gltfUpAxis:t.upAxis};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return r.body})}).then(function(r){return Promise.resolve(0).then(function(i){return lu(e,r,i)}).then(function(i){return fu(e,r,i)}).then(function(i){return Af(e,r,i)})}).then(function(){var r;return yo(e.gltfArrayBuffer,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(r=n.split("?")[1])!==null&&r!==void 0?r:"",fetcher:t.fetcher}).then(function(i){var a=new d.Matrix4;t.upAxis!=="Z"&&a.premultiply(qf);var o=new d.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);if(a.premultiply(o),i.CESIUM_RTC){var s=new d.Matrix4().setPosition(i.CESIUM_RTC.center);a.premultiply(s)}var l=i.scene;return l.applyMatrix4(a),delete e.featureTableBinary,delete e.batchTableBinary,delete e.gltfArrayBuffer,{type:"b3dm",uri:e.uri,byteLength:e.byteLength,scene:l,textures:i.textures,dispose:function(){return i.dispose()}}})})}const pu="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKHIpe1Byb21pc2UucmVzb2x2ZShyLmRhdGEpLnRoZW4oZnVuY3Rpb24obil7cmV0dXJuIGEobil9KS50aGV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U2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",Hf=n=>Uint8Array.from(atob(n),t=>t.charCodeAt(0)),Ms=typeof self!="undefined"&&self.Blob&&new Blob([Hf(pu)],{type:"text/javascript;charset=utf-8"});function Gf(n){let t;try{if(t=Ms&&(self.URL||self.webkitURL).createObjectURL(Ms),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:text/javascript;base64,"+pu,{name:n==null?void 0:n.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Kf=new nu(function(){return new Gf},2);function jf(n,t,e){var r=new cu(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?_f(i,r):Kf.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function _f(n,t){return Qi(this,void 0,void 0,function(){var e,r,i,a,o,s;return Ui(this,function(l){if(e=n.properties||{},r=n.byteOffset,i=n.byteLength,!e||!Number.isFinite(r)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");return a=t.buffer.slice(r,r+i),o=n.properties,s={POSITION:"Float32Array",NORMAL:"Float32Array",RGB:"Uint8Array",RGBA:"Uint8Array"},[2,Vi.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(u){var c=u.getAttribute("POSITION"),f=u.getAttribute("RGB"),m=u.getAttribute("RGBA"),A=u.getAttribute("NORMAL"),h;if(m)h=m;else if(f){for(var p=f.count,g=f.array,v=new Uint8Array(p*4),y=0,b=void 0,x=void 0;y<p;y++)x=y*4,b=y*3,v[x]=g[b],v[++x]=g[++b],v[++x]=g[++b];h=new d.BufferAttribute(v,4,f.normalized)}return{position:c?{array:c.array,itemSize:c.itemSize,normalized:c.normalized}:null,color:h?{array:h.array,itemSize:h.itemSize,normalized:h.normalized}:null,normal:A?{array:A.array,itemSize:A.itemSize,normalized:A.normalized}:null}})]})})}function vu(n,t){var e={uri:n};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return r.body})}).then(function(r){return Promise.resolve(0).then(function(i){return lu(e,r,i)}).then(function(i){return fu(e,r,i)}).then(function(i){return jf(e,r,i)})}).then(function(){var r;return Jf(e.attributes,{computeBoundingBox:(r=t.computeBoundingBox)!==null&&r!==void 0?r:!0})}).then(function(r){var i=new d.Matrix4,a=new d.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);return i.premultiply(a),r.object.applyMatrix4(i),delete e.gltfArrayBuffer,delete e.featureTableBinary,delete e.batchTableBinary,{type:"pnts",uri:e.uri,byteLength:e.byteLength,scene:r.object,textures:[],dispose:function(){return r.dispose()}}})}function Jf(n,t){var e=new Set,r=new d.BufferGeometry;e.add(r);var i=new ii;e.add(i),n.position&&r.setAttribute("position",new d.BufferAttribute(n.position.array,n.position.itemSize,n.position.normalized)),n.color&&r.setAttribute("color",new d.BufferAttribute(n.color.array,n.color.itemSize,n.color.normalized)),n.normal&&(r.setAttribute("normal",new d.BufferAttribute(n.normal.array,n.normal.itemSize,n.normal.normalized)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var a=new er(r,i);return a.matrix.compose(a.position,a.quaternion,a.scale),a.matrixAutoUpdate=!1,a.frustumCulled=!1,Promise.resolve({object:a,dispose:function(){e.forEach(function(o){o.dispose()}),e.clear()}})}function mu(){var n={};return n.OutWindow=function(){this._windowSize=0},n.OutWindow.prototype.create=function(t){(!this._buffer||this._windowSize!==t)&&(this._buffer=[]),this._windowSize=t,this._pos=0,this._streamPos=0},n.OutWindow.prototype.flush=function(){var t=this._pos-this._streamPos;if(t!==0){for(;t--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},n.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},n.OutWindow.prototype.setStream=function(t){this.releaseStream(),this._stream=t},n.OutWindow.prototype.init=function(t){t||(this._streamPos=0,this._pos=0)},n.OutWindow.prototype.copyBlock=function(t,e){var r=this._pos-t-1;for(r<0&&(r+=this._windowSize);e--;)r>=this._windowSize&&(r=0),this._buffer[this._pos++]=this._buffer[r++],this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.putByte=function(t){this._buffer[this._pos++]=t,this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.getByte=function(t){var e=this._pos-t-1;return e<0&&(e+=this._windowSize),this._buffer[e]},n.RangeDecoder=function(){},n.RangeDecoder.prototype.setStream=function(t){this._stream=t},n.RangeDecoder.prototype.releaseStream=function(){this._stream=null},n.RangeDecoder.prototype.init=function(){var t=5;for(this._code=0,this._range=-1;t--;)this._code=this._code<<8|this._stream.readByte()},n.RangeDecoder.prototype.decodeDirectBits=function(t){for(var e=0,r=t,i;r--;)this._range>>>=1,i=this._code-this._range>>>31,this._code-=this._range&i-1,e=e<<1|1-i,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return e},n.RangeDecoder.prototype.decodeBit=function(t,e){var r=t[e],i=(this._range>>>11)*r;return(this._code^2147483648)<(i^2147483648)?(this._range=i,t[e]+=2048-r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=i,this._code-=i,t[e]-=r>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},n.initBitModels=function(t,e){for(;e--;)t[e]=1024},n.BitTreeDecoder=function(t){this._models=[],this._numBitLevels=t},n.BitTreeDecoder.prototype.init=function(){n.initBitModels(this._models,1<<this._numBitLevels)},n.BitTreeDecoder.prototype.decode=function(t){for(var e=1,r=this._numBitLevels;r--;)e=e<<1|t.decodeBit(this._models,e);return e-(1<<this._numBitLevels)},n.BitTreeDecoder.prototype.reverseDecode=function(t){for(var e=1,r=0,i=0,a;i<this._numBitLevels;++i)a=t.decodeBit(this._models,e),e=e<<1|a,r|=a<<i;return r},n.reverseDecode2=function(t,e,r,i){for(var a=1,o=0,s=0,l;s<i;++s)l=r.decodeBit(t,e+a),a=a<<1|l,o|=l<<s;return o},n.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new n.BitTreeDecoder(8),this._numPosStates=0},n.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new n.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new n.BitTreeDecoder(3)},n.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(n.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},n.LenDecoder.prototype.decode=function(t,e){return t.decodeBit(this._choice,0)===0?this._lowCoder[e].decode(t):t.decodeBit(this._choice,1)===0?8+this._midCoder[e].decode(t):16+this._highCoder.decode(t)},n.Decoder2=function(){this._decoders=[]},n.Decoder2.prototype.init=function(){n.initBitModels(this._decoders,768)},n.Decoder2.prototype.decodeNormal=function(t){var e=1;do e=e<<1|t.decodeBit(this._decoders,e);while(e<256);return e&255},n.Decoder2.prototype.decodeWithMatchByte=function(t,e){var r=1,i,a;do if(i=e>>7&1,e<<=1,a=t.decodeBit(this._decoders,(1+i<<8)+r),r=r<<1|a,i!==a){for(;r<256;)r=r<<1|t.decodeBit(this._decoders,r);break}while(r<256);return r&255},n.LiteralDecoder=function(){},n.LiteralDecoder.prototype.create=function(t,e){var r;if(!(this._coders&&this._numPrevBits===e&&this._numPosBits===t))for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=e,this._coders=[],r=1<<this._numPrevBits+this._numPosBits;r--;)this._coders[r]=new n.Decoder2},n.LiteralDecoder.prototype.init=function(){for(var t=1<<this._numPrevBits+this._numPosBits;t--;)this._coders[t].init()},n.LiteralDecoder.prototype.getDecoder=function(t,e){return this._coders[((t&this._posMask)<<this._numPrevBits)+((e&255)>>>8-this._numPrevBits)]},n.Decoder=function(){this._outWindow=new n.OutWindow,this._rangeDecoder=new n.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new n.BitTreeDecoder(4),this._lenDecoder=new n.LenDecoder,this._repLenDecoder=new n.LenDecoder,this._literalDecoder=new n.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new n.BitTreeDecoder(6),this._posSlotDecoder[1]=new n.BitTreeDecoder(6),this._posSlotDecoder[2]=new n.BitTreeDecoder(6),this._posSlotDecoder[3]=new n.BitTreeDecoder(6)},n.Decoder.prototype.setDictionarySize=function(t){return t<0?!1:(this._dictionarySize!==t&&(this._dictionarySize=t,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},n.Decoder.prototype.setLcLpPb=function(t,e,r){var i=1<<r;return t>8||e>4||r>4?!1:(this._literalDecoder.create(e,t),this._lenDecoder.create(i),this._repLenDecoder.create(i),this._posStateMask=i-1,!0)},n.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),n.initBitModels(this._isMatchDecoders,192),n.initBitModels(this._isRep0LongDecoders,192),n.initBitModels(this._isRepDecoders,12),n.initBitModels(this._isRepG0Decoders,12),n.initBitModels(this._isRepG1Decoders,12),n.initBitModels(this._isRepG2Decoders,12),n.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},n.Decoder.prototype.decode=function(t,e,r){var i=0,a=0,o=0,s=0,l=0,u=0,c=0,f,m,A,h,p,g;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||u<r;)if(f=u&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+f)===0)m=this._literalDecoder.getDecoder(u++,c),i>=7?c=m.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):c=m.decodeNormal(this._rangeDecoder),this._outWindow.putByte(c),i=i<4?0:i-(i<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,i)===1)A=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,i)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(i<<4)+f)===0&&(i=i<7?9:11,A=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?h=o:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?h=s:(h=l,l=s),s=o),o=a,a=h),A===0&&(A=2+this._repLenDecoder.decode(this._rangeDecoder,f),i=i<7?8:11);else if(l=s,s=o,o=a,A=2+this._lenDecoder.decode(this._rangeDecoder,f),i=i<7?7:10,p=this._posSlotDecoder[A<=5?A-2:3].decode(this._rangeDecoder),p>=4){if(g=(p>>1)-1,a=(2|p&1)<<g,p<14)a+=n.reverseDecode2(this._posDecoders,a-p-1,this._rangeDecoder,g);else if(a+=this._rangeDecoder.decodeDirectBits(g-4)<<4,a+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),a<0){if(a===-1)break;return!1}}else a=p;if(a>=u||a>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(a,A),u+=A,c=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},n.Decoder.prototype.setDecoderProperties=function(t){var e,r,i,a,o;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),i=e%5,a=~~(e/5),!this.setLcLpPb(r,i,a))?!1:(o=t.readByte(),o|=t.readByte()<<8,o|=t.readByte()<<16,o+=t.readByte()*16777216,this.setDictionarySize(o))},n.decompress=function(t,e,r,i){var a=new n.Decoder;if(!a.setDecoderProperties(t))throw"Incorrect stream properties";if(!a.decode(e,r,i))throw"Error in data stream";return!0},n.decompressFile=function(t,e){var r=new n.Decoder,i;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(i=t.readByte(),i|=t.readByte()<<8,i|=t.readByte()<<16,i+=t.readByte()*16777216,t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,e,i))throw"Error in data stream";return!0},n}var Xf=mu();function Wf(){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),a=0;a<r.length;a++)i[r.charCodeAt(a)]=a;var o=e.length*.75,s=e.length,l,u=0,c,f,m,A;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var h=new ArrayBuffer(o),p=new Uint8Array(h);for(l=0;l<s;l+=4)c=i[e.charCodeAt(l)],f=i[e.charCodeAt(l+1)],m=i[e.charCodeAt(l+2)],A=i[e.charCodeAt(l+3)],p[u++]=c<<2|f>>4,p[u++]=(f&15)<<4|m>>2,p[u++]=(m&3)<<6|A&63;return h}var t="AGFzbQEAAAABSg1gAABgAX8Bf2ACf38Bf2AEf39/fwBgA39/fwBgAX8AYAJ/fwBgA39/fwF/YAR/f39/AX9gAn9/AGABfwF/YAABf2AEf39/fwF/AhsCA2VudgVhYm9ydAADA2VudgZtZW1vcnkCAAEDJiUBAQkKAgoKCwsLCwsAAgoBAgQKAQYFCAoFBQQEBwgCBwwCAQAABAQBcAABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwc9BgZtZW1vcnkCAAV0YWJsZQEABXJlc2V0AA0KbmV3VThBcnJheQAQCnVucGFja1NpemUAFAZkZWNvZGUAIwgBJAkHAQBBAAsBJQqAViVoAQN/IABBgICAgARLBEAACyMBIgEgAEEBIABBAUsbakEHakF4cSICPwAiA0EQdEsEQCADIAIgAWtB//8DakGAgHxxQRB2IgAgAyAAShtAAEEASARAIABAAEEASARAAAsLCyACJAEgAQsbAQF/QQFBICAAQQdqZ2t0EAEiASAANgIAIAELkQMBAX8gAUUEQA8LIABBADoAACAAIAFqQQFrQQA6AAAgAUECTQRADwsgAEEBakEAOgAAIABBAmpBADoAACAAIAFqIgJBAmtBADoAACACQQNrQQA6AAAgAUEGTQRADwsgAEEDakEAOgAAIAAgAWpBBGtBADoAACABQQhNBEAPC0EAIABrQQNxIgIgAGoiAEEANgIAIAEgAmtBfHEiASAAakEEa0EANgIAIAFBCE0EQA8LIABBBGpBADYCACAAQQhqQQA2AgAgACABaiICQQxrQQA2AgAgAkEIa0EANgIAIAFBGE0EQA8LIABBDGpBADYCACAAQRBqQQA2AgAgAEEUakEANgIAIABBGGpBADYCACAAIAFqIgJBHGtBADYCACACQRhrQQA2AgAgAkEUa0EANgIAIAJBEGtBADYCACAAQQRxQRhqIgIgAGohACABIAJrIQEDQCABQSBPBEAgAEIANwMAIABBCGpCADcDACAAQRBqQgA3AwAgAEEYakIANwMAIAFBIGshASAAQSBqIQAMAQsLC1EBA38gAEH+////AEsEQEEAQSBBLUEnEAAACyAAQQJ0IgMQAiECQQgQASIBQQA2AgAgAUEANgIEIAEgAjYCACABIAA2AgQgAkEIaiADEAMgAQtmAQF/IAFB/P///wFLBEBBAEHAAEEXQSIQAAALIAFBAXQiARACIgJBCGogARADIABFBEBBDBABIQALIABBADYCACAAQQA2AgQgAEEANgIIIAAgAjYCACAAQQA2AgQgACABNgIIIAALCgBBDBABIAAQBQsuAQF/QQgQASIBQQA2AgAgAUEANgIEIAEgADYCBCABQQEgASgCBHQQBjYCACABC6EBAQR/QRAQASIBQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgxBEBAEIQIDQCAAQRBIBEBBAxAHIQMgAigCACAAQQJ0aiADNgIIIABBAWohAAwBCwsgASACNgIEQRAQBCECQQAhAANAIABBEEgEQEEDEAchAyACKAIAIABBAnRqIAM2AgggAEEBaiEADAELCyABIAI2AgggAUEIEAc2AgwgAQs0AQF/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCC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ECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function Zf(n,t,e){try{var r={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},i=r.data.length,a={data:[],offset:0,writeByte:function(l){var u=Math.floor(this.offset/i);this.data[u]||(this.data[u]=new Uint8Array(i)),this.data[u][this.offset%i]=l,this.offset++}};n.decompressFile(r,a);for(var o=new Uint8Array(a.offset),s=0;s<a.offset;s++)o[s]=a.data[Math.floor(s/i)][s%i];e(null,o)}catch(l){e(l)}}function Yf(n,t,e){var r=24;try{var i=new WebAssembly.Memory({initial:16}),a=new WebAssembly.Module(n),o=new WebAssembly.Instance(a,{env:{memory:i,abort:function(){e(new Error("webAssembly abort"))}}}),s=o.exports,l=s.newU8Array(t.length),u=new Uint8Array(i.buffer,l+r,t.length);u.set(t);var c=s.decode(l),f=new Uint32Array(i.buffer,c,4),m=f[0],A=f[2],h=f[3];m?e(null,new Uint8Array(i.buffer,h+r,A).slice(0,A)):e(new Error("lzma deocder error"))}catch(p){e(p)}}var $f=`
|
|
884
884
|
var decodeLZMA = (function() {
|
|
885
885
|
var LZMA = (`.concat(mu.toString(),`)();
|
|
886
886
|
return function(data, callback) {
|
|
@@ -925,13 +925,13 @@ self.onmessage = function(event) {
|
|
|
925
925
|
}
|
|
926
926
|
postMessage({ id: packet.id, error: "type never matched." });
|
|
927
927
|
};
|
|
928
|
-
`),ja=typeof Worker!="undefined"&&typeof Blob!="undefined",Au="";if(ja)try{var eh=new Blob([$f],{type:"text/javascript"});Au=URL.createObjectURL(eh)}catch(n){}var gu=function(){function n(){var t=this;if(!ja)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(Au);e.onmessage=function(r){var i=r.data,a=i.id,o=i.result,s=i.error,l=t.getKey(a);t.requests[l]&&(s?t.requests[l](new Error(s)):t.requests[l](null,o),delete t.requests[l])},e.onerror=function(r){return console.error(r)}}return n.prototype.getKey=function(t){return"key_"+String(t)},n.prototype.decompress=function(t,e){var r=++this.callCounter;this.requests[this.getKey(r)]=e,this.worker.postMessage({type:"decompress",id:r,data:t},[t.buffer])},n.prototype.terminate=function(){this.worker.terminate()},n.support=ja,n}();function Ms(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function th(n){for(var t=[],e=n.length,r=function(o){var s={data:n[o],offset:0,readByte:function(){return this.data[this.offset++]}},l=s.data.length,u={data:[],offset:0,writeByte:function(f){var m=Math.floor(this.offset/l);this.data[m]||(this.data[m]=new Uint8Array(l)),this.data[m][this.offset%l]=f,this.offset++}};Xf.decompressFile(s,u),i=new Uint8Array(u.offset);for(var c=0;c<u.offset;c++)i[c]=u.data[Math.floor(c/l)][c%l];t.push(i)},i,a=0;a<e;a++)r(a);return t}function rh(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var l=new gu;l.decompress(n[a],function(u,c){if(l.terminate(),u)return s(u);o(c)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function yu(n){var t=new Uint8Array(n),e=Ms(t.slice(0,4));if(e>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var r=[],i=[],a=4+e*4,o=0;o<e;o++)i[o]=Ms(t.slice(4+o*4,8+o*4)),o===e-1?r[o]=t.subarray(a,a+i[o]):r[o]=t.slice(a,a+i[o]),a+=i[o];return gu.support?rh(r):Promise.resolve(th(r))}var ma=!1,bu=[];function xu(n){if(n===void 0&&(n=!1),!(!n&&ma)){ma=!0;var t=bu.shift();if(t){try{t()}catch(e){}dt.shared.add(function(){return xu(!0)},!0,2,-100)}else ma=!1}}function Ni(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};bu.push(r),dt.shared.add(function(){return xu()},!0,2,-100)})}function Dt(n,t){for(var e={},r=0,i=t;r<i.length;r++){var a=i[r];a in n&&(e[a]=n[a])}return e}function nh(n,t){for(var e=k({},n),r=0,i=t;r<i.length;r++){var a=i[r];a in e&&delete e[a]}return e}const jr=Gr.Reader,$t=Gr.util,zt=Gr.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(Gr.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),wu=zt.Model=(()=>{function n(t){if(this.chunks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.chunks=$t.emptyArray,n.prototype.createAt=$t.Long?$t.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof jr||(e=jr.create(e));let i=r===void 0?e.len:e.pos+r,a=new zt.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(zt.Chunk.decode(e,e.uint32()));break}case 2:{a.createAt=e.uint64();break}case 3:{a.description=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();zt.Chunk=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.vertices=null,n.prototype.faces=null,n.prototype.name="",n.prototype.texture="",n.decode=function(e,r){e instanceof jr||(e=jr.create(e));let i=r===void 0?e.len:e.pos+r,a=new zt.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=zt.Vertices.decode(e,e.uint32());break}case 2:{a.faces=zt.Faces.decode(e,e.uint32());break}case 3:{a.name=e.string();break}case 4:{a.texture=e.string();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("vertices"))throw $t.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw $t.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw $t.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();zt.Vertices=(()=>{function n(t){if(this.xyz=[],this.uvs=[],this.marks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.xyz=$t.emptyArray,n.prototype.uvs=$t.emptyArray,n.prototype.marks=$t.emptyArray,n.decode=function(e,r){e instanceof jr||(e=jr.create(e));let i=r===void 0?e.len:e.pos+r,a=new zt.Vertices;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.xyz&&a.xyz.length||(a.xyz=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.xyz.push(e.float())}else a.xyz.push(e.float());break}case 2:{if(a.uvs&&a.uvs.length||(a.uvs=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.uvs.push(e.float())}else a.uvs.push(e.float());break}case 3:{if(a.marks&&a.marks.length||(a.marks=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.marks.push(e.int32())}else a.marks.push(e.int32());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})();zt.Faces=(()=>{function n(t){if(this.indices=[],this.normals=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.indices=$t.emptyArray,n.prototype.normals=$t.emptyArray,n.decode=function(e,r){e instanceof jr||(e=jr.create(e));let i=r===void 0?e.len:e.pos+r,a=new zt.Faces;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.indices&&a.indices.length||(a.indices=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.indices.push(e.uint32())}else a.indices.push(e.uint32());break}case 2:{if(a.normals&&a.normals.length||(a.normals=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.normals.push(e.float())}else a.normals.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})();zt.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function Eu(n,t){var e,r,i,a={byteLength:0},o=xo((e=t.textureOptions)!==null&&e!==void 0?e:{},(i=(r=t.textureArray)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0),s={};if(t.textureArray)for(var l=0,u=t.textureArray;l<u.length;l++){var c=u[l];s[c]=bo(c,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return a.byteLength=f.body.byteLength,Ni(function(){var m=new Uint8Array(f.body);return wu.decode(m)})}).then(function(f){return Ni(function(){var m,A;return Cu(f,(m=t.textureBaseUri)!==null&&m!==void 0?m:function(){var h=n.lastIndexOf("/");if(h>=0){var p=n.slice(0,h)+"/";return/\/model\/$/.test(p)&&(p=p.replace(/\/model\/$/,"/materials/")),p}return""}(),((A=t.textureArray)!==null&&A!==void 0?A:[]).slice(),o,s,t.fetcher)})}).then(function(f){var m=new d.Group;m.matrixAutoUpdate=!1,m.matrix.compose(m.position,m.quaternion,m.scale),m.name=n;for(var A=0,h=f.objects;A<h.length;A++){var p=h[A];m.add(p)}return{type:"pbm",uri:n,byteLength:a.byteLength,scene:m,textures:f.textures,dispose:function(){return f.dispose()}}})}function Su(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function _a(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function ih(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function Is(n){var t=Su(n.name),e=_a(n.name),r=ih(n.name);return t*1e6+e*1e3+r}function ah(n){for(var t,e,r,i=typeof n.createAt=="number"?n.createAt:0,a=(t=n.description)!==null&&t!==void 0?t:"",o=[],s=!0,l=!0,u=0,c=n.chunks;u<c.length;u++){var f=c[u];if(!f.vertices.marks||f.vertices.marks.length===0){l=!1;break}}for(var m=0,A=n.chunks;m<A.length;m++){var f=A[m];if(!f.faces.normals||f.faces.normals.length===0){s=!1;break}}for(var h=n.chunks.sort(function(pe,ge){return Is(pe)-Is(ge)}),p=[],g=0,v=h;g<v.length;g++){var f=v[g],y=Su(f.name);p[y]||(p[y]=[]),p[y].push(f)}for(var b=0;b<p.length;b++){var x=p[b];if(x)if(s){for(var w=0,E=0;E<x.length;E++){var f=x[E];w+=f.faces.indices.length}for(var C=new Float32Array(w*3),M=new Float32Array(w*2),R=new Float32Array(w*3),L=l?new Float32Array(w):void 0,S=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],O=0,P=0;P<x.length;P++){for(var F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=x[P],V=f.vertices.xyz,D=f.vertices.uvs,z=f.faces.indices,U=f.faces.normals,q=f.vertices.marks,K=z.length,E=0;E<K;E++){var j=z[E],J=C[O*3+E*3]=V[j*3],X=C[O*3+E*3+1]=V[j*3+1],Y=C[O*3+E*3+2]=V[j*3+2];L&&(L[O+E]=q[j]),M[O*2+E*2]=D[j*2],M[O*2+E*2+1]=D[j*2+1];var W=Math.floor(E/3)*3;R[O*3+E*3]=U[W],R[O*3+E*3+1]=U[W+1],R[O*3+E*3+2]=U[W+2],J<F[0]&&(F[0]=J),X<F[1]&&(F[1]=X),Y<F[2]&&(F[2]=Y),J>F[3]&&(F[3]=J),X>F[4]&&(F[4]=X),Y>F[5]&&(F[5]=Y)}F[0]<I[0]&&(I[0]=F[0]),F[1]<I[1]&&(I[1]=F[1]),F[2]<I[2]&&(I[2]=F[2]),F[3]>I[3]&&(I[3]=F[3]),F[4]>I[4]&&(I[4]=F[4]),F[5]>I[5]&&(I[5]=F[5]),S.push({materialIndex:P,name:f.name,chunkName:_a(f.name),start:O,count:f.faces.indices.length,texture:(e=f.texture)!==null&&e!==void 0?e:void 0}),O+=K}var ee={createAt:i,description:a,vertices:C,uvs:M,normals:R,masks:L,indices:null,floorIndex:b,groups:S,extents:I};o.push(ee)}else{for(var w=0,Z=0,E=0;E<x.length;E++){var f=x[E];Z+=f.vertices.xyz.length/3,w+=f.faces.indices.length}for(var C=new Float32Array(Z*3),M=new Float32Array(Z*2),R=void 0,ie=new Float32Array(Z),te=new Uint32Array(w),L=l?new Float32Array(w):void 0,S=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],le=0,O=0,P=0;P<x.length;P++){for(var F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=x[P],V=f.vertices.xyz,oe=f.vertices.marks,D=f.vertices.uvs,z=f.faces.indices,we=V.length/3,K=z.length,E=0;E<we;E++){var J=C[O*3+E*3]=V[E*3],X=C[O*3+E*3+1]=V[E*3+1],Y=C[O*3+E*3+2]=V[E*3+2];L&&(L[O+E]=oe[E]),M[O*2+E*2]=D[E*2],M[O*2+E*2+1]=D[E*2+1],ie[O+E]=b,J<F[0]&&(F[0]=J),X<F[1]&&(F[1]=X),Y<F[2]&&(F[2]=Y),J>F[3]&&(F[3]=J),X>F[4]&&(F[4]=X),Y>F[5]&&(F[5]=Y)}F[0]<I[0]&&(I[0]=F[0]),F[1]<I[1]&&(I[1]=F[1]),F[2]<I[2]&&(I[2]=F[2]),F[3]>I[3]&&(I[3]=F[3]),F[4]>I[4]&&(I[4]=F[4]),F[5]>I[5]&&(I[5]=F[5]);for(var E=0;E<K;E++)te[le+E]=O+z[E];S.push({materialIndex:P,name:f.name,chunkName:_a(f.name),start:le,count:f.faces.indices.length,texture:(r=f.texture)!==null&&r!==void 0?r:void 0}),O+=we,le+=K}var ee={createAt:i,description:a,vertices:C,uvs:M,normals:R,masks:L,indices:te,floorIndex:b,groups:S,extents:I};o.push(ee)}}return o}function bo(n,t,e){var r=k({key:"texture.pbm"},Dt(t,["format","quality","size","sharpen","mappings"])),i=new Bn,a=i.loadTexture(n,{imageURL:{transform:t.transform,options:r},encoding:d.sRGBEncoding,wrapS:d.ClampToEdgeWrapping,wrapT:d.ClampToEdgeWrapping,minFilter:d.LinearFilter,maxSize:typeof r.size=="number"?new d.Vector2(r.size,r.size):void 0,fetcher:e}).then(function(o){var s=o.body;return s.needsUpdate=!0,s});return Object.assign(a,{url:n,textureOptions:t})}function Cu(n,t,e,r,i,a){i===void 0&&(i={});for(var o=ah(n),s=0,l="",u=[],c={},f=new Set,m=0,A=o;m<A.length;m++){var h=A[m],p=h.createAt,g=h.description,v=h.vertices,y=h.masks,b=h.uvs,x=h.normals,w=h.indices,E=h.floorIndex,C=h.groups,M=h.extents,R=new d.Box3;R.min.x=M[0],R.min.y=M[1],R.min.z=M[2],R.max.x=M[3],R.max.y=M[4],R.max.z=M[5];var L=new d.BufferGeometry;L.setAttribute("position",new d.BufferAttribute(v,3)),L.setAttribute("uv",new d.BufferAttribute(b,2)),x&&L.setAttribute("normal",new d.BufferAttribute(x,3)),y&&L.setAttribute("mask",new d.BufferAttribute(y,1)),w&&L.setIndex(new d.BufferAttribute(w,1)),L.boundingBox=R,L.boundingSphere=R.getBoundingSphere(new d.Sphere);for(var S=0,I=C;S<I.length;S++){var O=I[S];L.addGroup(O.start,O.count,O.materialIndex)}f.add(L);for(var P=[],F=0,V=C;F<V.length;F++){var O=V[F],D=e[O.chunkName]||(O.texture?at(t||"",O.texture):void 0),z=new Jr("basic");z.floor=E,L.attributes.normal===void 0&&(z.flatShading=!0),L.attributes.mask&&(z.defines.USE_VERTEX_MARK=!0),P.push(z),D?c[D]?c[D].push(z):c[D]=[z]:z.color=new d.Color(16777215),f.add(z),z.refreshUniforms()}var U=new Tt(L,P);U.name="model_floor_"+E,U.userData.createAt=p,U.userData.description=g,U.matrix.compose(U.position,U.quaternion,U.scale),U.matrixAutoUpdate=!1,U.frustumCulled=!1,s=p,l=g,u.push(U)}var q=function(K){K=xo(K,e.length);for(var j=[],J=function(ee){var Z=null;ee in i&&(Z=i[ee]),Z||(Z=bo(ee,K,a)),j.push(Z.then(function(ie){for(var te=0,le=c[ee];te<le.length;te++){var oe=le[te];oe.map&&(f.delete(oe.map),oe.map.dispose()),oe.map=ie,oe.refreshUniforms(),f.add(ie)}return ie}).catch(function(){for(var ie=0,te=c[ee];ie<te.length;ie++){var le=te[ie];le.map&&(f.delete(le.map),le.map.dispose()),le.map=null,le.color=new d.Color(16777215),le.refreshUniforms()}return null}))},X=0,Y=Object.keys(c);X<Y.length;X++){var W=Y[X];J(W)}for(var W in i)delete i[W];return Promise.all(j).then(function(ee){return ee.filter(function(Z){return Z})})};return q(r).then(function(K){return{createAt:s,description:l,objects:u,textures:K,dispose:function(){f.forEach(function(j){j.dispose()}),f.clear()}}})}function xo(n,t){return n=Object.assign({},n),n.autoResize!==!1&&(t>96?n.size=Math.min(n.size||1/0,100):t>48?n.size=Math.min(n.size||1/0,200):t>24?n.size=Math.min(n.size||1/0,400):t>22?n.size=Math.min(n.size||1/0,800):t>5&&(n.size=Math.min(n.size||1/0,1024))),n}function Mu(n,t){var e,r,i,a={byteLength:0},o=xo((e=t.textureOptions)!==null&&e!==void 0?e:{},(i=(r=t.textureArray)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0),s={};if(t.textureArray)for(var l=0,u=t.textureArray;l<u.length;l++){var c=u[l];s[c]=bo(c,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return yu(f.body)}).then(function(f){return Ni(function(){for(var m,A={chunks:[],createAt:void 0,description:void 0},h=0,p=f;h<p.length;h++){var g=p[h],v=wu.decode(g);v.chunks.length&&((m=A.chunks).push.apply(m,v.chunks),A.createAt=v.createAt,A.description=v.description)}return A})}).then(function(f){return Ni(function(){var m,A,h;return Cu(f,(m=t.textureBaseUri)!==null&&m!==void 0?m:function(){var p=n.lastIndexOf("/");if(p>=0){var g=n.slice(0,p)+"/";return/\/model\/$/.test(g)&&(g=g.replace(/\/model\/$/,"/materials/")),g}return""}(),((A=t.textureArray)!==null&&A!==void 0?A:[]).slice(),(h=t.textureOptions)!==null&&h!==void 0?h:{},s,t.fetcher)})}).then(function(f){var m=new d.Group;m.name=n;for(var A=0,h=f.objects;A<h.length;A++){var p=h[A];m.add(p)}return{type:"at3d",uri:n,byteLength:a.byteLength,scene:m,textures:f.textures,dispose:function(){return f.dispose()}}})}const Xe=Gr.Reader,ot=Gr.util,Pe=Gr.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(Gr.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),oh=Pe.Model=(()=>{function n(t){if(this.meshes=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.meshes=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(Pe.Mesh.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();Pe.Mesh=(()=>{function n(t){if(this.chunks=[],this.matrix=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.name="",n.prototype.chunks=ot.emptyArray,n.prototype.matrix=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Mesh;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.name=e.string();break}case 2:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Pe.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(Pe.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw ot.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();Pe.Matrix=(()=>{function n(t){if(this.elements=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.elements=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Matrix;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.elements&&a.elements.length||(a.elements=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.elements.push(e.float())}else a.elements.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Matrix"},n})();Pe.Chunk=(()=>{function n(t){if(this.material=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.geometry=null,n.prototype.material=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=Pe.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(Pe.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw ot.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Pe.Geometry=(()=>{function n(t){if(this.groups=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.position=null,n.prototype.uv=null,n.prototype.uv2=null,n.prototype.normal=null,n.prototype.groups=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=Pe.Position.decode(e,e.uint32());break}case 2:{a.uv=Pe.UV.decode(e,e.uint32());break}case 3:{a.uv2=Pe.UV.decode(e,e.uint32());break}case 4:{a.normal=Pe.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(Pe.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw ot.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw ot.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();Pe.Position=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Position;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Position"},n})();Pe.UV=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.UV;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/UV"},n})();Pe.Normal=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Normal;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Normal"},n})();Pe.Group=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.start=0,n.prototype.count=0,n.prototype.materialIndex=0,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Group;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.start=e.uint32();break}case 2:{a.count=e.uint32();break}case 3:{a.materialIndex=e.uint32();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("start"))throw ot.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw ot.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw ot.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();Pe.Material=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.kd=null,n.prototype.ks=null,n.prototype.ke=null,n.prototype.mapkd="",n.prototype.mapks="",n.prototype.mapke="",n.prototype.norm="",n.prototype.mapbump="",n.prototype.bump="",n.prototype.mapd="",n.prototype.ns=0,n.prototype.d=0,n.prototype.tr=0,n.prototype.mapkdrepeat="",n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=Pe.Color.decode(e,e.uint32());break}case 2:{a.ks=Pe.Color.decode(e,e.uint32());break}case 3:{a.ke=Pe.Color.decode(e,e.uint32());break}case 4:{a.mapkd=e.string();break}case 5:{a.mapks=e.string();break}case 6:{a.mapke=e.string();break}case 7:{a.norm=e.string();break}case 8:{a.mapbump=e.string();break}case 9:{a.bump=e.string();break}case 10:{a.mapd=e.string();break}case 11:{a.ns=e.float();break}case 12:{a.d=e.float();break}case 13:{a.tr=e.float();break}case 14:{a.mapkdrepeat=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Material"},n})();Pe.Color=(()=>{function n(t){if(this.rgb=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.rgb=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Color;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.rgb&&a.rgb.length||(a.rgb=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.rgb.push(e.float())}else a.rgb.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Color"},n})();function Iu(n,t){var e={byteLength:0};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(r){return e.byteLength=r.body.byteLength,Tu(new Uint8Array(r.body),t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new d.Group;i.matrixAutoUpdate=!1,i.matrix.compose(i.position,i.quaternion,i.scale),i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return{type:"dome",uri:n,byteLength:e.byteLength,scene:i,textures:r.textures,dispose:function(){return r.dispose()}}})}function sh(n){for(var t=[0,0,0],e=0;e<n.attributes.normal.array.length/9;e++)t[0]=n.attributes.normal.array[e*9],t[1]=n.attributes.normal.array[e*9+1],t[2]=n.attributes.normal.array[e*9+2],n.attributes.normal.array[e*9]=n.attributes.normal.array[e*9+6],n.attributes.normal.array[e*9+1]=n.attributes.normal.array[e*9+7],n.attributes.normal.array[e*9+2]=n.attributes.normal.array[e*9+8],n.attributes.normal.array[e*9+6]=t[0],n.attributes.normal.array[e*9+7]=t[1],n.attributes.normal.array[e*9+8]=t[2];for(var e=0;e<n.attributes.position.array.length/9;e++)t[0]=n.attributes.position.array[e*9],t[1]=n.attributes.position.array[e*9+1],t[2]=n.attributes.position.array[e*9+2],n.attributes.position.array[e*9]=n.attributes.position.array[e*9+6],n.attributes.position.array[e*9+1]=n.attributes.position.array[e*9+7],n.attributes.position.array[e*9+2]=n.attributes.position.array[e*9+8],n.attributes.position.array[e*9+6]=t[0],n.attributes.position.array[e*9+7]=t[1],n.attributes.position.array[e*9+8]=t[2];for(var e=0;e<n.attributes.uv.array.length/6;e++)t[0]=n.attributes.uv.array[e*6],t[1]=n.attributes.uv.array[e*6+1],n.attributes.uv.array[e*6]=n.attributes.uv.array[e*6+4],n.attributes.uv.array[e*6+1]=n.attributes.uv.array[e*6+5],n.attributes.uv.array[e*6+4]=t[0],n.attributes.uv.array[e*6+5]=t[1];n.attributes.normal.needsUpdate=!0,n.attributes.position.needsUpdate=!0,n.attributes.uv.needsUpdate=!0}function uh(n){var t=n.position,e=n.normal,r=n.uv,i=n.uv2,a=n.groups,o=new d.BufferGeometry;o.setAttribute("position",new d.BufferAttribute(new Float32Array(t.array),3)),e&&o.setAttribute("normal",new d.BufferAttribute(new Float32Array(e.array),3)),r&&o.setAttribute("uv",new d.BufferAttribute(new Float32Array(r.array),2)),i&&o.setAttribute("uv2",new d.BufferAttribute(new Float32Array(i.array),2));for(var s=0,l=a;s<l.length;s++){var u=l[s];o.addGroup(u.start,u.count,u.materialIndex)}return o}function bn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Cr(n)||(n=at(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=k({key:"texture.dome",size:64},Dt(e,["quality","format","sharpen","mappings"])),l=o[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:s},wrapS:d.RepeatWrapping,wrapT:d.RepeatWrapping,fetcher:a}).then(function(u){var c=u.body;return r&&c.repeat.copy(r),c.needsUpdate=!0,c.updateMatrix(),c});return l}function lh(n,t,e,r,i,a,o,s){var l=[],u=new Jr("phong");if(o.add(u),n.kd&&(u.color=new d.Color().fromArray(n.kd.rgb).convertLinearToSRGB()),n.mapkd){var c=null;if(n.mapkdrepeat){var f=n.mapkdrepeat.split(/\s+/).map(function(p){return Number(p)}),m=f[0],A=f[1];c=new d.Vector2(m,A)}l.push(bn(n.mapkd,t,e,c,r,i,a).then(function(p){p.encoding=d.sRGBEncoding,u.map=p,o.add(p),s.add(p),u.needsUpdate=!0}).catch(Q))}if(n.ks&&(u.specular=new d.Color().fromArray(n.ks.rgb).convertLinearToSRGB()),n.mapks&&l.push(bn(n.mapks,t,e,null,r,i,a).then(function(p){u.specularMap=p,o.add(p),s.add(p)}).catch(Q)),n.ke&&(u.emissive=new d.Color().fromArray(n.ke.rgb).convertLinearToSRGB()),n.mapke&&l.push(bn(n.mapke,t,e,null,r,i,a).then(function(p){p.encoding=d.sRGBEncoding,u.emissiveMap=p,o.add(p),s.add(p)}).catch(Q)),n.norm&&l.push(bn(n.norm,t,e,null,r,i,a).then(function(p){u.normalMap=p,o.add(p),s.add(p)}).catch(Q)),n.mapbump&&l.push(bn(n.mapbump,t,e,null,r,i,a).then(function(p){u.bumpMap=p,o.add(p),s.add(p)}).catch(Q)),n.bump&&l.push(bn(n.bump,t,e,null,r,i,a).then(function(p){u.bumpMap=p,o.add(p),s.add(p)}).catch(Q)),typeof n.ns=="number"&&(u.shininess=n.ns),typeof n.d=="number"){var h=n.d;h>0&&h<1&&(u.opacity=h)}return u.floor=0,u.refreshUniforms(),{material:u,textureReady:Promise.all(l).then(Q)}}function ch(n){return oh.decode(n).meshes}function Tu(n,t,e,r){for(var i=[],a=[],o=new Set,s=ch(n),l=new Bn,u=new d.Matrix4,c=new d.Vector3,f=new d.Quaternion,m=new d.Vector3,A={},h=new Set,p=0,g=s;p<g.length;p++){var v=g[p],y=v.name,b=v.chunks,x=v.matrix;if(!(y==="Ceiling"||y==="CeilingDrop"))for(var w=0,E=x;w<E.length;w++){var C=E[w];u.elements=C.elements;for(var M=new d.Group,R=0;R<b.length;R++){var L=uh(b[R].geometry);L.applyMatrix4(u),u.decompose(c,f,m),m.x*m.y*m.z<0&&L.attributes.normal&&L.attributes.position&&L.attributes.uv&&sh(L),o.add(L);for(var S=[],I=0,O=b[R].material;I<O.length;I++){var P=O[I],F=lh(P,t||"",e,l,r,A,o,h),V=F.material,D=F.textureReady;a.push(D),S.push(V)}var z=new Tt(L,S);z.name="chunk_"+R,z.matrix.compose(z.position,z.quaternion,z.scale),z.matrixAutoUpdate=!1,z.frustumCulled=!1,M.add(z)}M.name=y,i.push(M)}}return Promise.all(a).catch(Q).then(function(){return{createAt:0,description:"",objects:i,textures:Array.from(h),dispose:function(){o.forEach(function(U){U.dispose()}),o.clear()}}})}function Pu(n,t){var e={byteLength:0};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(r){return e.byteLength=r.body.byteLength,yu(r.body)}).then(function(r){var i=r.reduce(function(s,l){return s+l.length},0),a=new Uint8Array(i),o=0;return r.forEach(function(s){a.set(s,o),o+=s.length}),a}).then(function(r){return Tu(r,t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new d.Group;i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return{type:"domez",uri:n,byteLength:e.byteLength,scene:i,textures:r.textures,dispose:function(){return r.dispose()}}})}var dh=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Bu(n,t){var e=0;return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return e=r.body.byteLength,r.body})}).then(function(r){var i;return yo(r,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(i=n.split("?")[1])!==null&&i!==void 0?i:"",fetcher:t.fetcher})}).then(function(r){var i=new d.Matrix4;if(t.upAxis!=="Z"&&i.premultiply(dh),r.CESIUM_RTC){var a=new d.Matrix4().setPosition(r.CESIUM_RTC.center);i.premultiply(a)}var o=r.scene;return o.applyMatrix4(i),{type:"glb",uri:n,byteLength:e,scene:o,textures:r.textures,dispose:function(){return r.dispose()}}})}var xt=new d.Color;function wo(n,t){var e=0;return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return e=r.body.byteLength,r.body})}).then(function(r){var i,a;return fh(r,{propertyNameMapping:(i=t.propertyNameMapping)!==null&&i!==void 0?i:{},customPropertyMapping:(a=t.customPropertyMapping)!==null&&a!==void 0?a:{}})}).then(function(r){var i=r.geometry;switch(t.type){case"geometry":{var a=i;return{type:"ply",uri:n,byteLength:e,scene:a,meta:{},textures:[],dispose:function(){i.dispose()}}}case"mesh":{var o="color"in i.attributes,s=new d.MeshBasicMaterial({vertexColors:o}),a=new d.Mesh(i,s);return{type:"ply",uri:n,byteLength:e,scene:a,meta:{},textures:[],dispose:function(){i.dispose(),s.dispose()}}}case"line":{var o="color"in i.attributes,l=new d.LineBasicMaterial({vertexColors:o}),a=new d.Line(i,l);return a.computeLineDistances(),{type:"ply",uri:n,byteLength:e,scene:a,meta:{},textures:[],dispose:function(){i.dispose(),l.dispose()}}}case"points":{var u=new d.PointsMaterial({}),a=new d.Points(i,u);return{type:"ply",uri:n,byteLength:e,scene:a,meta:{},textures:[],dispose:function(){i.dispose(),u.dispose()}}}case"pbmPointCloud":{var c=new ii,a=new er(i,c);return{type:"ply",uri:n,byteLength:e,scene:a,meta:{},textures:[],dispose:function(){i.dispose(),c.dispose()}}}}throw new Error("Invalid Type: ".concat(t.type))})}function fh(n,t){var e=new Uint8Array(n),r=bh(e),i=r.headerText,a=r.headerLength,o=ph(i,a,t);if(o.format==="ascii"){var s=new TextDecoder().decode(e);return{header:o,geometry:mh(s,o,t)}}else return{header:o,geometry:yh(n,o,t)}}function hh(n,t){var e={name:"",type:n[0]};return e.type==="list"?(e.name=n[3],e.countType=n[1],e.itemType=n[2]):e.name=n[1],e.name in t.propertyNameMapping&&(e.name=t.propertyNameMapping[e.name]),e}function ph(n,t,e){t===void 0&&(t=0);var r=/^ply([\s\S]*)end_header(\r\n|\r|\n)/,i="",a=r.exec(n);a!==null&&(i=a[1]);for(var o={format:"",version:"",comments:[],elements:[],headerLength:t,objInfo:""},s=i.split(/\r\n|\r|\n/),l=null,u=0;u<s.length;u++){var c=s[u];if(c=c.trim(),c!==""){var f=c.split(/\s+/),m=f.shift();switch(c=f.join(" "),m){case"format":o.format=f[0],o.version=f[1];break;case"comment":o.comments.push(c);break;case"element":l&&o.elements.push(l),l={name:f[0],count:parseInt(f[1]),properties:[]};break;case"property":l&&l.properties.push(hh(f,e));break;case"obj_info":o.objInfo=c;break;default:console.log("unhandled",m,f)}}}return l&&o.elements.push(l),o}function Aa(n,t){switch(t){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(n);case"float":case"double":case"float32":case"float64":return parseFloat(n);default:throw new Error("unspport type: "+t)}}function vh(n,t){for(var e={},r=0;r<n.length;r++){if(t.empty())return null;if(n[r].type==="list"){for(var i=[],a=Aa(t.next(),n[r].countType),o=0;o<a;o++){if(t.empty())return null;i.push(Aa(t.next(),n[r].itemType))}e[n[r].name]=i}else e[n[r].name]=Aa(t.next(),n[r].type)}return e}function Ru(n){for(var t={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[],faceVertexColors:[]},e=0,r=Object.keys(n.customPropertyMapping);e<r.length;e++){var i=r[e];t[i]=[]}return t}function Fu(n){var t=n.map(function(r){return r.name});function e(r){for(var i=0,a=r.length;i<a;i++){var o=r[i];if(t.includes(o))return o}return null}return{attrX:e(["x","px","posx"])||"x",attrY:e(["y","py","posy"])||"y",attrZ:e(["z","pz","posz"])||"z",attrNX:e(["nx","normalx"]),attrNY:e(["ny","normaly"]),attrNZ:e(["nz","normalz"]),attrS:e(["s","u","texture_u","tx"]),attrT:e(["t","v","texture_v","ty"]),attrR:e(["red","diffuse_red","r","diffuse_r"]),attrG:e(["green","diffuse_green","g","diffuse_g"]),attrB:e(["blue","diffuse_blue","b","diffuse_b"])}}function mh(n,t,e){var r=Ru(e),i=/end_header\s+(\S[\s\S]*\S|\S)\s*$/,a,o=null;(o=i.exec(n))!==null?a=o[1].split(/\s+/):a=[];var s=new xh(a);e:for(var l=0;l<t.elements.length;l++)for(var u=t.elements[l],c=Fu(u.properties),f=0;f<u.count;f++){var m=vh(u.properties,s);if(!m)break e;Lu(r,u.name,m,c,e)}return ku(r,e)}function ku(n,t){var e=new d.BufferGeometry;n.indices.length>0&&e.setIndex(n.indices),e.setAttribute("position",new d.Float32BufferAttribute(n.vertices,3)),n.normals.length>0&&e.setAttribute("normal",new d.Float32BufferAttribute(n.normals,3)),n.uvs.length>0&&e.setAttribute("uv",new d.Float32BufferAttribute(n.uvs,2)),n.colors.length>0&&e.setAttribute("color",new d.Float32BufferAttribute(n.colors,3)),(n.faceVertexUvs.length>0||n.faceVertexColors.length>0)&&(e=e.toNonIndexed(),n.faceVertexUvs.length>0&&e.setAttribute("uv",new d.Float32BufferAttribute(n.faceVertexUvs,2)),n.faceVertexColors.length>0&&e.setAttribute("color",new d.Float32BufferAttribute(n.faceVertexColors,3)));for(var r=0,i=Object.keys(t.customPropertyMapping);r<i.length;r++){var a=i[r];n[a].length>0&&e.setAttribute(a,new d.Float32BufferAttribute(n[a],t.customPropertyMapping[a].length))}return e.computeBoundingSphere(),e}function Lu(n,t,e,r,i){if(t==="vertex"){r.attrX!==null&&r.attrY!==null&&r.attrZ!==null&&n.vertices.push(e[r.attrX],e[r.attrY],e[r.attrZ]),r.attrNX!==null&&r.attrNY!==null&&r.attrNZ!==null&&n.normals.push(e[r.attrNX],e[r.attrNY],e[r.attrNZ]),r.attrS!==null&&r.attrT!==null&&n.uvs.push(e[r.attrS],e[r.attrT]),r.attrR!==null&&r.attrG!==null&&r.attrB!==null&&(xt.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.colors.push(xt.r,xt.g,xt.b));for(var a=0,o=Object.keys(i.customPropertyMapping);a<o.length;a++)for(var s=o[a],l=0,u=i.customPropertyMapping[s];l<u.length;l++){var c=u[l];n[s].push(e[c])}}else if(t==="face"){var f=e.vertex_indices||e.vertex_index,m=e.texcoord;f.length===3?(n.indices.push(f[0],f[1],f[2]),m&&m.length===6&&(n.faceVertexUvs.push(m[0],m[1]),n.faceVertexUvs.push(m[2],m[3]),n.faceVertexUvs.push(m[4],m[5]))):f.length===4&&(n.indices.push(f[0],f[1],f[3]),n.indices.push(f[1],f[2],f[3])),r.attrR!==null&&r.attrG!==null&&r.attrB!==null&&(xt.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.faceVertexColors.push(xt.r,xt.g,xt.b),n.faceVertexColors.push(xt.r,xt.g,xt.b),n.faceVertexColors.push(xt.r,xt.g,xt.b))}}function Ah(n,t){for(var e={},r=0,i=0;i<t.length;i++){var a=t[i],o=a.valueReader;if(a.type==="list"){var s=[],l=a.countReader.read(n+r);r+=a.countReader.size;for(var u=0;u<l;u++)s.push(o.read(n+r)),r+=o.size;e[a.name]=s}else e[a.name]=o.read(n+r),r+=o.size}return[e,r]}function gh(n,t,e){function r(s,l,u){switch(l){case"int8":case"char":return{read:function(c){return s.getInt8(c)},size:1};case"uint8":case"uchar":return{read:function(c){return s.getUint8(c)},size:1};case"int16":case"short":return{read:function(c){return s.getInt16(c,u)},size:2};case"uint16":case"ushort":return{read:function(c){return s.getUint16(c,u)},size:2};case"int32":case"int":return{read:function(c){return s.getInt32(c,u)},size:4};case"uint32":case"uint":return{read:function(c){return s.getUint32(c,u)},size:4};case"float32":case"float":return{read:function(c){return s.getFloat32(c,u)},size:4};case"float64":case"double":return{read:function(c){return s.getFloat64(c,u)},size:8};default:throw new Error("not support type: "+l)}}for(var i=0,a=n.length;i<a;i++){var o=n[i];o.type==="list"?(o.countReader=r(t,o.countType,e),o.valueReader=r(t,o.itemType,e)):o.valueReader=r(t,o.type,e)}}function yh(n,t,e){for(var r=Ru(e),i=t.format==="binary_little_endian",a=new DataView(n,t.headerLength),o,s=0,l=0;l<t.elements.length;l++){var u=t.elements[l],c=u.properties,f=Fu(c);gh(c,a,i);for(var m=0;m<u.count;m++){o=Ah(s,c),s+=o[1];var A=o[0];Lu(r,u.name,A,f,e)}}return ku(r,e)}function bh(n){var t=0,e=!0,r="",i=[],a=new TextDecoder().decode(n.subarray(0,5)),o=/^ply\r\n/.test(a);do{var s=String.fromCharCode(n[t++]);s!==`
|
|
929
|
-
`&&s!=="\r"?r+=s:(r==="end_header"&&(e=!1),r!==""&&(i.push(r),r=""))}while(e&&t<n.length);return o===!0&&t++,{headerText:i.join("\r")+"\r",headerLength:t}}var xh=function(){function n(t){this.arr=t,this.i=0}return n.prototype.empty=function(){return this.i>=this.arr.length},n.prototype.next=function(){return this.arr[this.i++]},n}(),wh=/^[og]\s*(.+)?/,Eh=/^mtllib /,Sh=/^usemtl /,
|
|
928
|
+
`),ja=typeof Worker!="undefined"&&typeof Blob!="undefined",Au="";if(ja)try{var eh=new Blob([$f],{type:"text/javascript"});Au=URL.createObjectURL(eh)}catch(n){}var gu=function(){function n(){var t=this;if(!ja)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(Au);e.onmessage=function(r){var i=r.data,a=i.id,o=i.result,s=i.error,l=t.getKey(a);t.requests[l]&&(s?t.requests[l](new Error(s)):t.requests[l](null,o),delete t.requests[l])},e.onerror=function(r){return console.error(r)}}return n.prototype.getKey=function(t){return"key_"+String(t)},n.prototype.decompress=function(t,e){var r=++this.callCounter;this.requests[this.getKey(r)]=e,this.worker.postMessage({type:"decompress",id:r,data:t},[t.buffer])},n.prototype.terminate=function(){this.worker.terminate()},n.support=ja,n}();function Cs(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function th(n){for(var t=[],e=n.length,r=function(o){var s={data:n[o],offset:0,readByte:function(){return this.data[this.offset++]}},l=s.data.length,u={data:[],offset:0,writeByte:function(f){var m=Math.floor(this.offset/l);this.data[m]||(this.data[m]=new Uint8Array(l)),this.data[m][this.offset%l]=f,this.offset++}};Xf.decompressFile(s,u),i=new Uint8Array(u.offset);for(var c=0;c<u.offset;c++)i[c]=u.data[Math.floor(c/l)][c%l];t.push(i)},i,a=0;a<e;a++)r(a);return t}function rh(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var l=new gu;l.decompress(n[a],function(u,c){if(l.terminate(),u)return s(u);o(c)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function yu(n){var t=new Uint8Array(n),e=Cs(t.slice(0,4));if(e>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var r=[],i=[],a=4+e*4,o=0;o<e;o++)i[o]=Cs(t.slice(4+o*4,8+o*4)),o===e-1?r[o]=t.subarray(a,a+i[o]):r[o]=t.slice(a,a+i[o]),a+=i[o];return gu.support?rh(r):Promise.resolve(th(r))}var ma=!1,bu=[];function xu(n){if(n===void 0&&(n=!1),!(!n&&ma)){ma=!0;var t=bu.shift();if(t){try{t()}catch(e){}dt.shared.add(function(){return xu(!0)},!0,2,-100)}else ma=!1}}function Ni(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};bu.push(r),dt.shared.add(function(){return xu()},!0,2,-100)})}function Dt(n,t){for(var e={},r=0,i=t;r<i.length;r++){var a=i[r];a in n&&(e[a]=n[a])}return e}function nh(n,t){for(var e=k({},n),r=0,i=t;r<i.length;r++){var a=i[r];a in e&&delete e[a]}return e}const jr=Gr.Reader,$t=Gr.util,zt=Gr.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(Gr.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),wu=zt.Model=(()=>{function n(t){if(this.chunks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.chunks=$t.emptyArray,n.prototype.createAt=$t.Long?$t.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof jr||(e=jr.create(e));let i=r===void 0?e.len:e.pos+r,a=new zt.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(zt.Chunk.decode(e,e.uint32()));break}case 2:{a.createAt=e.uint64();break}case 3:{a.description=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();zt.Chunk=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.vertices=null,n.prototype.faces=null,n.prototype.name="",n.prototype.texture="",n.decode=function(e,r){e instanceof jr||(e=jr.create(e));let i=r===void 0?e.len:e.pos+r,a=new zt.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=zt.Vertices.decode(e,e.uint32());break}case 2:{a.faces=zt.Faces.decode(e,e.uint32());break}case 3:{a.name=e.string();break}case 4:{a.texture=e.string();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("vertices"))throw $t.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw $t.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw $t.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();zt.Vertices=(()=>{function n(t){if(this.xyz=[],this.uvs=[],this.marks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.xyz=$t.emptyArray,n.prototype.uvs=$t.emptyArray,n.prototype.marks=$t.emptyArray,n.decode=function(e,r){e instanceof jr||(e=jr.create(e));let i=r===void 0?e.len:e.pos+r,a=new zt.Vertices;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.xyz&&a.xyz.length||(a.xyz=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.xyz.push(e.float())}else a.xyz.push(e.float());break}case 2:{if(a.uvs&&a.uvs.length||(a.uvs=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.uvs.push(e.float())}else a.uvs.push(e.float());break}case 3:{if(a.marks&&a.marks.length||(a.marks=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.marks.push(e.int32())}else a.marks.push(e.int32());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})();zt.Faces=(()=>{function n(t){if(this.indices=[],this.normals=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.indices=$t.emptyArray,n.prototype.normals=$t.emptyArray,n.decode=function(e,r){e instanceof jr||(e=jr.create(e));let i=r===void 0?e.len:e.pos+r,a=new zt.Faces;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.indices&&a.indices.length||(a.indices=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.indices.push(e.uint32())}else a.indices.push(e.uint32());break}case 2:{if(a.normals&&a.normals.length||(a.normals=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.normals.push(e.float())}else a.normals.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})();zt.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function Eu(n,t){var e,r,i,a={byteLength:0},o=xo((e=t.textureOptions)!==null&&e!==void 0?e:{},(i=(r=t.textureArray)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0),s={};if(t.textureArray)for(var l=0,u=t.textureArray;l<u.length;l++){var c=u[l];s[c]=bo(c,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return a.byteLength=f.body.byteLength,Ni(function(){var m=new Uint8Array(f.body);return wu.decode(m)})}).then(function(f){return Ni(function(){var m,A;return Mu(f,(m=t.textureBaseUri)!==null&&m!==void 0?m:function(){var h=n.lastIndexOf("/");if(h>=0){var p=n.slice(0,h)+"/";return/\/model\/$/.test(p)&&(p=p.replace(/\/model\/$/,"/materials/")),p}return""}(),((A=t.textureArray)!==null&&A!==void 0?A:[]).slice(),o,s,t.fetcher)})}).then(function(f){var m=new d.Group;m.matrixAutoUpdate=!1,m.matrix.compose(m.position,m.quaternion,m.scale),m.name=n;for(var A=0,h=f.objects;A<h.length;A++){var p=h[A];m.add(p)}return{type:"pbm",uri:n,byteLength:a.byteLength,scene:m,textures:f.textures,dispose:function(){return f.dispose()}}})}function Su(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function _a(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function ih(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function Is(n){var t=Su(n.name),e=_a(n.name),r=ih(n.name);return t*1e6+e*1e3+r}function ah(n){for(var t,e,r,i=typeof n.createAt=="number"?n.createAt:0,a=(t=n.description)!==null&&t!==void 0?t:"",o=[],s=!0,l=!0,u=0,c=n.chunks;u<c.length;u++){var f=c[u];if(!f.vertices.marks||f.vertices.marks.length===0){l=!1;break}}for(var m=0,A=n.chunks;m<A.length;m++){var f=A[m];if(!f.faces.normals||f.faces.normals.length===0){s=!1;break}}for(var h=n.chunks.sort(function(pe,ge){return Is(pe)-Is(ge)}),p=[],g=0,v=h;g<v.length;g++){var f=v[g],y=Su(f.name);p[y]||(p[y]=[]),p[y].push(f)}for(var b=0;b<p.length;b++){var x=p[b];if(x)if(s){for(var w=0,E=0;E<x.length;E++){var f=x[E];w+=f.faces.indices.length}for(var M=new Float32Array(w*3),C=new Float32Array(w*2),R=new Float32Array(w*3),L=l?new Float32Array(w):void 0,S=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],O=0,P=0;P<x.length;P++){for(var F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=x[P],V=f.vertices.xyz,D=f.vertices.uvs,z=f.faces.indices,U=f.faces.normals,q=f.vertices.marks,K=z.length,E=0;E<K;E++){var j=z[E],J=M[O*3+E*3]=V[j*3],X=M[O*3+E*3+1]=V[j*3+1],Y=M[O*3+E*3+2]=V[j*3+2];L&&(L[O+E]=q[j]),C[O*2+E*2]=D[j*2],C[O*2+E*2+1]=D[j*2+1];var W=Math.floor(E/3)*3;R[O*3+E*3]=U[W],R[O*3+E*3+1]=U[W+1],R[O*3+E*3+2]=U[W+2],J<F[0]&&(F[0]=J),X<F[1]&&(F[1]=X),Y<F[2]&&(F[2]=Y),J>F[3]&&(F[3]=J),X>F[4]&&(F[4]=X),Y>F[5]&&(F[5]=Y)}F[0]<I[0]&&(I[0]=F[0]),F[1]<I[1]&&(I[1]=F[1]),F[2]<I[2]&&(I[2]=F[2]),F[3]>I[3]&&(I[3]=F[3]),F[4]>I[4]&&(I[4]=F[4]),F[5]>I[5]&&(I[5]=F[5]),S.push({materialIndex:P,name:f.name,chunkName:_a(f.name),start:O,count:f.faces.indices.length,texture:(e=f.texture)!==null&&e!==void 0?e:void 0}),O+=K}var ee={createAt:i,description:a,vertices:M,uvs:C,normals:R,masks:L,indices:null,floorIndex:b,groups:S,extents:I};o.push(ee)}else{for(var w=0,Z=0,E=0;E<x.length;E++){var f=x[E];Z+=f.vertices.xyz.length/3,w+=f.faces.indices.length}for(var M=new Float32Array(Z*3),C=new Float32Array(Z*2),R=void 0,ie=new Float32Array(Z),te=new Uint32Array(w),L=l?new Float32Array(w):void 0,S=[],I=[1/0,1/0,1/0,-1/0,-1/0,-1/0],le=0,O=0,P=0;P<x.length;P++){for(var F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=x[P],V=f.vertices.xyz,oe=f.vertices.marks,D=f.vertices.uvs,z=f.faces.indices,we=V.length/3,K=z.length,E=0;E<we;E++){var J=M[O*3+E*3]=V[E*3],X=M[O*3+E*3+1]=V[E*3+1],Y=M[O*3+E*3+2]=V[E*3+2];L&&(L[O+E]=oe[E]),C[O*2+E*2]=D[E*2],C[O*2+E*2+1]=D[E*2+1],ie[O+E]=b,J<F[0]&&(F[0]=J),X<F[1]&&(F[1]=X),Y<F[2]&&(F[2]=Y),J>F[3]&&(F[3]=J),X>F[4]&&(F[4]=X),Y>F[5]&&(F[5]=Y)}F[0]<I[0]&&(I[0]=F[0]),F[1]<I[1]&&(I[1]=F[1]),F[2]<I[2]&&(I[2]=F[2]),F[3]>I[3]&&(I[3]=F[3]),F[4]>I[4]&&(I[4]=F[4]),F[5]>I[5]&&(I[5]=F[5]);for(var E=0;E<K;E++)te[le+E]=O+z[E];S.push({materialIndex:P,name:f.name,chunkName:_a(f.name),start:le,count:f.faces.indices.length,texture:(r=f.texture)!==null&&r!==void 0?r:void 0}),O+=we,le+=K}var ee={createAt:i,description:a,vertices:M,uvs:C,normals:R,masks:L,indices:te,floorIndex:b,groups:S,extents:I};o.push(ee)}}return o}function bo(n,t,e){var r=k({key:"texture.pbm"},Dt(t,["format","quality","size","sharpen","mappings"])),i=new Bn,a=i.loadTexture(n,{imageURL:{transform:t.transform,options:r},encoding:d.sRGBEncoding,wrapS:d.ClampToEdgeWrapping,wrapT:d.ClampToEdgeWrapping,minFilter:d.LinearFilter,maxSize:typeof r.size=="number"?new d.Vector2(r.size,r.size):void 0,fetcher:e}).then(function(o){var s=o.body;return s.needsUpdate=!0,s});return Object.assign(a,{url:n,textureOptions:t})}function Mu(n,t,e,r,i,a){i===void 0&&(i={});for(var o=ah(n),s=0,l="",u=[],c={},f=new Set,m=0,A=o;m<A.length;m++){var h=A[m],p=h.createAt,g=h.description,v=h.vertices,y=h.masks,b=h.uvs,x=h.normals,w=h.indices,E=h.floorIndex,M=h.groups,C=h.extents,R=new d.Box3;R.min.x=C[0],R.min.y=C[1],R.min.z=C[2],R.max.x=C[3],R.max.y=C[4],R.max.z=C[5];var L=new d.BufferGeometry;L.setAttribute("position",new d.BufferAttribute(v,3)),L.setAttribute("uv",new d.BufferAttribute(b,2)),x&&L.setAttribute("normal",new d.BufferAttribute(x,3)),y&&L.setAttribute("mask",new d.BufferAttribute(y,1)),w&&L.setIndex(new d.BufferAttribute(w,1)),L.boundingBox=R,L.boundingSphere=R.getBoundingSphere(new d.Sphere);for(var S=0,I=M;S<I.length;S++){var O=I[S];L.addGroup(O.start,O.count,O.materialIndex)}f.add(L);for(var P=[],F=0,V=M;F<V.length;F++){var O=V[F],D=e[O.chunkName]||(O.texture?at(t||"",O.texture):void 0),z=new Jr("basic");z.floor=E,L.attributes.normal===void 0&&(z.flatShading=!0),L.attributes.mask&&(z.defines.USE_VERTEX_MARK=!0),P.push(z),D?c[D]?c[D].push(z):c[D]=[z]:z.color=new d.Color(16777215),f.add(z),z.refreshUniforms()}var U=new Tt(L,P);U.name="model_floor_"+E,U.userData.createAt=p,U.userData.description=g,U.matrix.compose(U.position,U.quaternion,U.scale),U.matrixAutoUpdate=!1,U.frustumCulled=!1,s=p,l=g,u.push(U)}var q=function(K){K=xo(K,e.length);for(var j=[],J=function(ee){var Z=null;ee in i&&(Z=i[ee]),Z||(Z=bo(ee,K,a)),j.push(Z.then(function(ie){for(var te=0,le=c[ee];te<le.length;te++){var oe=le[te];oe.map&&(f.delete(oe.map),oe.map.dispose()),oe.map=ie,oe.refreshUniforms(),f.add(ie)}return ie}).catch(function(){for(var ie=0,te=c[ee];ie<te.length;ie++){var le=te[ie];le.map&&(f.delete(le.map),le.map.dispose()),le.map=null,le.color=new d.Color(16777215),le.refreshUniforms()}return null}))},X=0,Y=Object.keys(c);X<Y.length;X++){var W=Y[X];J(W)}for(var W in i)delete i[W];return Promise.all(j).then(function(ee){return ee.filter(function(Z){return Z})})};return q(r).then(function(K){return{createAt:s,description:l,objects:u,textures:K,dispose:function(){f.forEach(function(j){j.dispose()}),f.clear()}}})}function xo(n,t){return n=Object.assign({},n),n.autoResize!==!1&&(t>96?n.size=Math.min(n.size||1/0,100):t>48?n.size=Math.min(n.size||1/0,200):t>24?n.size=Math.min(n.size||1/0,400):t>22?n.size=Math.min(n.size||1/0,800):t>5&&(n.size=Math.min(n.size||1/0,1024))),n}function Cu(n,t){var e,r,i,a={byteLength:0},o=xo((e=t.textureOptions)!==null&&e!==void 0?e:{},(i=(r=t.textureArray)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0),s={};if(t.textureArray)for(var l=0,u=t.textureArray;l<u.length;l++){var c=u[l];s[c]=bo(c,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return yu(f.body)}).then(function(f){return Ni(function(){for(var m,A={chunks:[],createAt:void 0,description:void 0},h=0,p=f;h<p.length;h++){var g=p[h],v=wu.decode(g);v.chunks.length&&((m=A.chunks).push.apply(m,v.chunks),A.createAt=v.createAt,A.description=v.description)}return A})}).then(function(f){return Ni(function(){var m,A,h;return Mu(f,(m=t.textureBaseUri)!==null&&m!==void 0?m:function(){var p=n.lastIndexOf("/");if(p>=0){var g=n.slice(0,p)+"/";return/\/model\/$/.test(g)&&(g=g.replace(/\/model\/$/,"/materials/")),g}return""}(),((A=t.textureArray)!==null&&A!==void 0?A:[]).slice(),(h=t.textureOptions)!==null&&h!==void 0?h:{},s,t.fetcher)})}).then(function(f){var m=new d.Group;m.name=n;for(var A=0,h=f.objects;A<h.length;A++){var p=h[A];m.add(p)}return{type:"at3d",uri:n,byteLength:a.byteLength,scene:m,textures:f.textures,dispose:function(){return f.dispose()}}})}const Xe=Gr.Reader,ot=Gr.util,Pe=Gr.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(Gr.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),oh=Pe.Model=(()=>{function n(t){if(this.meshes=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.meshes=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(Pe.Mesh.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();Pe.Mesh=(()=>{function n(t){if(this.chunks=[],this.matrix=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.name="",n.prototype.chunks=ot.emptyArray,n.prototype.matrix=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Mesh;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.name=e.string();break}case 2:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Pe.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(Pe.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw ot.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();Pe.Matrix=(()=>{function n(t){if(this.elements=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.elements=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Matrix;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.elements&&a.elements.length||(a.elements=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.elements.push(e.float())}else a.elements.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Matrix"},n})();Pe.Chunk=(()=>{function n(t){if(this.material=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.geometry=null,n.prototype.material=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=Pe.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(Pe.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw ot.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Pe.Geometry=(()=>{function n(t){if(this.groups=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.position=null,n.prototype.uv=null,n.prototype.uv2=null,n.prototype.normal=null,n.prototype.groups=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=Pe.Position.decode(e,e.uint32());break}case 2:{a.uv=Pe.UV.decode(e,e.uint32());break}case 3:{a.uv2=Pe.UV.decode(e,e.uint32());break}case 4:{a.normal=Pe.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(Pe.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw ot.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw ot.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();Pe.Position=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Position;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Position"},n})();Pe.UV=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.UV;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/UV"},n})();Pe.Normal=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Normal;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.array&&a.array.length||(a.array=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.array.push(e.float())}else a.array.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Normal"},n})();Pe.Group=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.start=0,n.prototype.count=0,n.prototype.materialIndex=0,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Group;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.start=e.uint32();break}case 2:{a.count=e.uint32();break}case 3:{a.materialIndex=e.uint32();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("start"))throw ot.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw ot.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw ot.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();Pe.Material=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.kd=null,n.prototype.ks=null,n.prototype.ke=null,n.prototype.mapkd="",n.prototype.mapks="",n.prototype.mapke="",n.prototype.norm="",n.prototype.mapbump="",n.prototype.bump="",n.prototype.mapd="",n.prototype.ns=0,n.prototype.d=0,n.prototype.tr=0,n.prototype.mapkdrepeat="",n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=Pe.Color.decode(e,e.uint32());break}case 2:{a.ks=Pe.Color.decode(e,e.uint32());break}case 3:{a.ke=Pe.Color.decode(e,e.uint32());break}case 4:{a.mapkd=e.string();break}case 5:{a.mapks=e.string();break}case 6:{a.mapke=e.string();break}case 7:{a.norm=e.string();break}case 8:{a.mapbump=e.string();break}case 9:{a.bump=e.string();break}case 10:{a.mapd=e.string();break}case 11:{a.ns=e.float();break}case 12:{a.d=e.float();break}case 13:{a.tr=e.float();break}case 14:{a.mapkdrepeat=e.string();break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Material"},n})();Pe.Color=(()=>{function n(t){if(this.rgb=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.rgb=ot.emptyArray,n.decode=function(e,r){e instanceof Xe||(e=Xe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Pe.Color;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{if(a.rgb&&a.rgb.length||(a.rgb=[]),(o&7)===2){let s=e.uint32()+e.pos;for(;e.pos<s;)a.rgb.push(e.float())}else a.rgb.push(e.float());break}default:e.skipType(o&7);break}}return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Color"},n})();function Iu(n,t){var e={byteLength:0};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(r){return e.byteLength=r.body.byteLength,Tu(new Uint8Array(r.body),t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new d.Group;i.matrixAutoUpdate=!1,i.matrix.compose(i.position,i.quaternion,i.scale),i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return{type:"dome",uri:n,byteLength:e.byteLength,scene:i,textures:r.textures,dispose:function(){return r.dispose()}}})}function sh(n){for(var t=[0,0,0],e=0;e<n.attributes.normal.array.length/9;e++)t[0]=n.attributes.normal.array[e*9],t[1]=n.attributes.normal.array[e*9+1],t[2]=n.attributes.normal.array[e*9+2],n.attributes.normal.array[e*9]=n.attributes.normal.array[e*9+6],n.attributes.normal.array[e*9+1]=n.attributes.normal.array[e*9+7],n.attributes.normal.array[e*9+2]=n.attributes.normal.array[e*9+8],n.attributes.normal.array[e*9+6]=t[0],n.attributes.normal.array[e*9+7]=t[1],n.attributes.normal.array[e*9+8]=t[2];for(var e=0;e<n.attributes.position.array.length/9;e++)t[0]=n.attributes.position.array[e*9],t[1]=n.attributes.position.array[e*9+1],t[2]=n.attributes.position.array[e*9+2],n.attributes.position.array[e*9]=n.attributes.position.array[e*9+6],n.attributes.position.array[e*9+1]=n.attributes.position.array[e*9+7],n.attributes.position.array[e*9+2]=n.attributes.position.array[e*9+8],n.attributes.position.array[e*9+6]=t[0],n.attributes.position.array[e*9+7]=t[1],n.attributes.position.array[e*9+8]=t[2];for(var e=0;e<n.attributes.uv.array.length/6;e++)t[0]=n.attributes.uv.array[e*6],t[1]=n.attributes.uv.array[e*6+1],n.attributes.uv.array[e*6]=n.attributes.uv.array[e*6+4],n.attributes.uv.array[e*6+1]=n.attributes.uv.array[e*6+5],n.attributes.uv.array[e*6+4]=t[0],n.attributes.uv.array[e*6+5]=t[1];n.attributes.normal.needsUpdate=!0,n.attributes.position.needsUpdate=!0,n.attributes.uv.needsUpdate=!0}function uh(n){var t=n.position,e=n.normal,r=n.uv,i=n.uv2,a=n.groups,o=new d.BufferGeometry;o.setAttribute("position",new d.BufferAttribute(new Float32Array(t.array),3)),e&&o.setAttribute("normal",new d.BufferAttribute(new Float32Array(e.array),3)),r&&o.setAttribute("uv",new d.BufferAttribute(new Float32Array(r.array),2)),i&&o.setAttribute("uv2",new d.BufferAttribute(new Float32Array(i.array),2));for(var s=0,l=a;s<l.length;s++){var u=l[s];o.addGroup(u.start,u.count,u.materialIndex)}return o}function bn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Mr(n)||(n=at(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=k({key:"texture.dome",size:64},Dt(e,["quality","format","sharpen","mappings"])),l=o[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:s},wrapS:d.RepeatWrapping,wrapT:d.RepeatWrapping,fetcher:a}).then(function(u){var c=u.body;return r&&c.repeat.copy(r),c.needsUpdate=!0,c.updateMatrix(),c});return l}function lh(n,t,e,r,i,a,o,s){var l=[],u=new Jr("phong");if(o.add(u),n.kd&&(u.color=new d.Color().fromArray(n.kd.rgb).convertLinearToSRGB()),n.mapkd){var c=null;if(n.mapkdrepeat){var f=n.mapkdrepeat.split(/\s+/).map(function(p){return Number(p)}),m=f[0],A=f[1];c=new d.Vector2(m,A)}l.push(bn(n.mapkd,t,e,c,r,i,a).then(function(p){p.encoding=d.sRGBEncoding,u.map=p,o.add(p),s.add(p),u.needsUpdate=!0}).catch(Q))}if(n.ks&&(u.specular=new d.Color().fromArray(n.ks.rgb).convertLinearToSRGB()),n.mapks&&l.push(bn(n.mapks,t,e,null,r,i,a).then(function(p){u.specularMap=p,o.add(p),s.add(p)}).catch(Q)),n.ke&&(u.emissive=new d.Color().fromArray(n.ke.rgb).convertLinearToSRGB()),n.mapke&&l.push(bn(n.mapke,t,e,null,r,i,a).then(function(p){p.encoding=d.sRGBEncoding,u.emissiveMap=p,o.add(p),s.add(p)}).catch(Q)),n.norm&&l.push(bn(n.norm,t,e,null,r,i,a).then(function(p){u.normalMap=p,o.add(p),s.add(p)}).catch(Q)),n.mapbump&&l.push(bn(n.mapbump,t,e,null,r,i,a).then(function(p){u.bumpMap=p,o.add(p),s.add(p)}).catch(Q)),n.bump&&l.push(bn(n.bump,t,e,null,r,i,a).then(function(p){u.bumpMap=p,o.add(p),s.add(p)}).catch(Q)),typeof n.ns=="number"&&(u.shininess=n.ns),typeof n.d=="number"){var h=n.d;h>0&&h<1&&(u.opacity=h)}return u.floor=0,u.refreshUniforms(),{material:u,textureReady:Promise.all(l).then(Q)}}function ch(n){return oh.decode(n).meshes}function Tu(n,t,e,r){for(var i=[],a=[],o=new Set,s=ch(n),l=new Bn,u=new d.Matrix4,c=new d.Vector3,f=new d.Quaternion,m=new d.Vector3,A={},h=new Set,p=0,g=s;p<g.length;p++){var v=g[p],y=v.name,b=v.chunks,x=v.matrix;if(!(y==="Ceiling"||y==="CeilingDrop"))for(var w=0,E=x;w<E.length;w++){var M=E[w];u.elements=M.elements;for(var C=new d.Group,R=0;R<b.length;R++){var L=uh(b[R].geometry);L.applyMatrix4(u),u.decompose(c,f,m),m.x*m.y*m.z<0&&L.attributes.normal&&L.attributes.position&&L.attributes.uv&&sh(L),o.add(L);for(var S=[],I=0,O=b[R].material;I<O.length;I++){var P=O[I],F=lh(P,t||"",e,l,r,A,o,h),V=F.material,D=F.textureReady;a.push(D),S.push(V)}var z=new Tt(L,S);z.name="chunk_"+R,z.matrix.compose(z.position,z.quaternion,z.scale),z.matrixAutoUpdate=!1,z.frustumCulled=!1,C.add(z)}C.name=y,i.push(C)}}return Promise.all(a).catch(Q).then(function(){return{createAt:0,description:"",objects:i,textures:Array.from(h),dispose:function(){o.forEach(function(U){U.dispose()}),o.clear()}}})}function Pu(n,t){var e={byteLength:0};return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(r){return e.byteLength=r.body.byteLength,yu(r.body)}).then(function(r){var i=r.reduce(function(s,l){return s+l.length},0),a=new Uint8Array(i),o=0;return r.forEach(function(s){a.set(s,o),o+=s.length}),a}).then(function(r){return Tu(r,t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new d.Group;i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return{type:"domez",uri:n,byteLength:e.byteLength,scene:i,textures:r.textures,dispose:function(){return r.dispose()}}})}var dh=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Bu(n,t){var e=0;return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return e=r.body.byteLength,r.body})}).then(function(r){var i;return yo(r,{copyUV2:!1,addonExtensions:["PBM_mesh"],resourcePath:n.slice(0,n.lastIndexOf("/")+1),search:(i=n.split("?")[1])!==null&&i!==void 0?i:"",fetcher:t.fetcher})}).then(function(r){var i=new d.Matrix4;if(t.upAxis!=="Z"&&i.premultiply(dh),r.CESIUM_RTC){var a=new d.Matrix4().setPosition(r.CESIUM_RTC.center);i.premultiply(a)}var o=r.scene;return o.applyMatrix4(i),{type:"glb",uri:n,byteLength:e,scene:o,textures:r.textures,dispose:function(){return r.dispose()}}})}var xt=new d.Color;function wo(n,t){var e=0;return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"}).then(function(r){return e=r.body.byteLength,r.body})}).then(function(r){var i,a;return fh(r,{propertyNameMapping:(i=t.propertyNameMapping)!==null&&i!==void 0?i:{},customPropertyMapping:(a=t.customPropertyMapping)!==null&&a!==void 0?a:{}})}).then(function(r){var i=r.geometry;switch(t.type){case"geometry":{var a=i;return{type:"ply",uri:n,byteLength:e,scene:a,meta:{},textures:[],dispose:function(){i.dispose()}}}case"mesh":{var o="color"in i.attributes,s=new d.MeshBasicMaterial({vertexColors:o}),a=new d.Mesh(i,s);return{type:"ply",uri:n,byteLength:e,scene:a,meta:{},textures:[],dispose:function(){i.dispose(),s.dispose()}}}case"line":{var o="color"in i.attributes,l=new d.LineBasicMaterial({vertexColors:o}),a=new d.Line(i,l);return a.computeLineDistances(),{type:"ply",uri:n,byteLength:e,scene:a,meta:{},textures:[],dispose:function(){i.dispose(),l.dispose()}}}case"points":{var u=new d.PointsMaterial({}),a=new d.Points(i,u);return{type:"ply",uri:n,byteLength:e,scene:a,meta:{},textures:[],dispose:function(){i.dispose(),u.dispose()}}}case"pbmPointCloud":{var c=new ii,a=new er(i,c);return{type:"ply",uri:n,byteLength:e,scene:a,meta:{},textures:[],dispose:function(){i.dispose(),c.dispose()}}}}throw new Error("Invalid Type: ".concat(t.type))})}function fh(n,t){var e=new Uint8Array(n),r=bh(e),i=r.headerText,a=r.headerLength,o=ph(i,a,t);if(o.format==="ascii"){var s=new TextDecoder().decode(e);return{header:o,geometry:mh(s,o,t)}}else return{header:o,geometry:yh(n,o,t)}}function hh(n,t){var e={name:"",type:n[0]};return e.type==="list"?(e.name=n[3],e.countType=n[1],e.itemType=n[2]):e.name=n[1],e.name in t.propertyNameMapping&&(e.name=t.propertyNameMapping[e.name]),e}function ph(n,t,e){t===void 0&&(t=0);var r=/^ply([\s\S]*)end_header(\r\n|\r|\n)/,i="",a=r.exec(n);a!==null&&(i=a[1]);for(var o={format:"",version:"",comments:[],elements:[],headerLength:t,objInfo:""},s=i.split(/\r\n|\r|\n/),l=null,u=0;u<s.length;u++){var c=s[u];if(c=c.trim(),c!==""){var f=c.split(/\s+/),m=f.shift();switch(c=f.join(" "),m){case"format":o.format=f[0],o.version=f[1];break;case"comment":o.comments.push(c);break;case"element":l&&o.elements.push(l),l={name:f[0],count:parseInt(f[1]),properties:[]};break;case"property":l&&l.properties.push(hh(f,e));break;case"obj_info":o.objInfo=c;break;default:console.log("unhandled",m,f)}}}return l&&o.elements.push(l),o}function Aa(n,t){switch(t){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(n);case"float":case"double":case"float32":case"float64":return parseFloat(n);default:throw new Error("unspport type: "+t)}}function vh(n,t){for(var e={},r=0;r<n.length;r++){if(t.empty())return null;if(n[r].type==="list"){for(var i=[],a=Aa(t.next(),n[r].countType),o=0;o<a;o++){if(t.empty())return null;i.push(Aa(t.next(),n[r].itemType))}e[n[r].name]=i}else e[n[r].name]=Aa(t.next(),n[r].type)}return e}function Ru(n){for(var t={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[],faceVertexColors:[]},e=0,r=Object.keys(n.customPropertyMapping);e<r.length;e++){var i=r[e];t[i]=[]}return t}function Fu(n){var t=n.map(function(r){return r.name});function e(r){for(var i=0,a=r.length;i<a;i++){var o=r[i];if(t.includes(o))return o}return null}return{attrX:e(["x","px","posx"])||"x",attrY:e(["y","py","posy"])||"y",attrZ:e(["z","pz","posz"])||"z",attrNX:e(["nx","normalx"]),attrNY:e(["ny","normaly"]),attrNZ:e(["nz","normalz"]),attrS:e(["s","u","texture_u","tx"]),attrT:e(["t","v","texture_v","ty"]),attrR:e(["red","diffuse_red","r","diffuse_r"]),attrG:e(["green","diffuse_green","g","diffuse_g"]),attrB:e(["blue","diffuse_blue","b","diffuse_b"])}}function mh(n,t,e){var r=Ru(e),i=/end_header\s+(\S[\s\S]*\S|\S)\s*$/,a,o=null;(o=i.exec(n))!==null?a=o[1].split(/\s+/):a=[];var s=new xh(a);e:for(var l=0;l<t.elements.length;l++)for(var u=t.elements[l],c=Fu(u.properties),f=0;f<u.count;f++){var m=vh(u.properties,s);if(!m)break e;Lu(r,u.name,m,c,e)}return ku(r,e)}function ku(n,t){var e=new d.BufferGeometry;n.indices.length>0&&e.setIndex(n.indices),e.setAttribute("position",new d.Float32BufferAttribute(n.vertices,3)),n.normals.length>0&&e.setAttribute("normal",new d.Float32BufferAttribute(n.normals,3)),n.uvs.length>0&&e.setAttribute("uv",new d.Float32BufferAttribute(n.uvs,2)),n.colors.length>0&&e.setAttribute("color",new d.Float32BufferAttribute(n.colors,3)),(n.faceVertexUvs.length>0||n.faceVertexColors.length>0)&&(e=e.toNonIndexed(),n.faceVertexUvs.length>0&&e.setAttribute("uv",new d.Float32BufferAttribute(n.faceVertexUvs,2)),n.faceVertexColors.length>0&&e.setAttribute("color",new d.Float32BufferAttribute(n.faceVertexColors,3)));for(var r=0,i=Object.keys(t.customPropertyMapping);r<i.length;r++){var a=i[r];n[a].length>0&&e.setAttribute(a,new d.Float32BufferAttribute(n[a],t.customPropertyMapping[a].length))}return e.computeBoundingSphere(),e}function Lu(n,t,e,r,i){if(t==="vertex"){r.attrX!==null&&r.attrY!==null&&r.attrZ!==null&&n.vertices.push(e[r.attrX],e[r.attrY],e[r.attrZ]),r.attrNX!==null&&r.attrNY!==null&&r.attrNZ!==null&&n.normals.push(e[r.attrNX],e[r.attrNY],e[r.attrNZ]),r.attrS!==null&&r.attrT!==null&&n.uvs.push(e[r.attrS],e[r.attrT]),r.attrR!==null&&r.attrG!==null&&r.attrB!==null&&(xt.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.colors.push(xt.r,xt.g,xt.b));for(var a=0,o=Object.keys(i.customPropertyMapping);a<o.length;a++)for(var s=o[a],l=0,u=i.customPropertyMapping[s];l<u.length;l++){var c=u[l];n[s].push(e[c])}}else if(t==="face"){var f=e.vertex_indices||e.vertex_index,m=e.texcoord;f.length===3?(n.indices.push(f[0],f[1],f[2]),m&&m.length===6&&(n.faceVertexUvs.push(m[0],m[1]),n.faceVertexUvs.push(m[2],m[3]),n.faceVertexUvs.push(m[4],m[5]))):f.length===4&&(n.indices.push(f[0],f[1],f[3]),n.indices.push(f[1],f[2],f[3])),r.attrR!==null&&r.attrG!==null&&r.attrB!==null&&(xt.setRGB(e[r.attrR]/255,e[r.attrG]/255,e[r.attrB]/255),n.faceVertexColors.push(xt.r,xt.g,xt.b),n.faceVertexColors.push(xt.r,xt.g,xt.b),n.faceVertexColors.push(xt.r,xt.g,xt.b))}}function Ah(n,t){for(var e={},r=0,i=0;i<t.length;i++){var a=t[i],o=a.valueReader;if(a.type==="list"){var s=[],l=a.countReader.read(n+r);r+=a.countReader.size;for(var u=0;u<l;u++)s.push(o.read(n+r)),r+=o.size;e[a.name]=s}else e[a.name]=o.read(n+r),r+=o.size}return[e,r]}function gh(n,t,e){function r(s,l,u){switch(l){case"int8":case"char":return{read:function(c){return s.getInt8(c)},size:1};case"uint8":case"uchar":return{read:function(c){return s.getUint8(c)},size:1};case"int16":case"short":return{read:function(c){return s.getInt16(c,u)},size:2};case"uint16":case"ushort":return{read:function(c){return s.getUint16(c,u)},size:2};case"int32":case"int":return{read:function(c){return s.getInt32(c,u)},size:4};case"uint32":case"uint":return{read:function(c){return s.getUint32(c,u)},size:4};case"float32":case"float":return{read:function(c){return s.getFloat32(c,u)},size:4};case"float64":case"double":return{read:function(c){return s.getFloat64(c,u)},size:8};default:throw new Error("not support type: "+l)}}for(var i=0,a=n.length;i<a;i++){var o=n[i];o.type==="list"?(o.countReader=r(t,o.countType,e),o.valueReader=r(t,o.itemType,e)):o.valueReader=r(t,o.type,e)}}function yh(n,t,e){for(var r=Ru(e),i=t.format==="binary_little_endian",a=new DataView(n,t.headerLength),o,s=0,l=0;l<t.elements.length;l++){var u=t.elements[l],c=u.properties,f=Fu(c);gh(c,a,i);for(var m=0;m<u.count;m++){o=Ah(s,c),s+=o[1];var A=o[0];Lu(r,u.name,A,f,e)}}return ku(r,e)}function bh(n){var t=0,e=!0,r="",i=[],a=new TextDecoder().decode(n.subarray(0,5)),o=/^ply\r\n/.test(a);do{var s=String.fromCharCode(n[t++]);s!==`
|
|
929
|
+
`&&s!=="\r"?r+=s:(r==="end_header"&&(e=!1),r!==""&&(i.push(r),r=""))}while(e&&t<n.length);return o===!0&&t++,{headerText:i.join("\r")+"\r",headerLength:t}}var xh=function(){function n(t){this.arr=t,this.i=0}return n.prototype.empty=function(){return this.i>=this.arr.length},n.prototype.next=function(){return this.arr[this.i++]},n}(),wh=/^[og]\s*(.+)?/,Eh=/^mtllib /,Sh=/^usemtl /,Mh=/^usemap /,Ts=/\s+/,Fn=new d.Color,Ch=function(){function n(){this.objects=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materials={},this.materialLibraries=[],this.startObject("",!1)}return n.prototype.startObject=function(t,e){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=e!==!1;return}var r=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:e!==!1,geometry:{vertices:[],hasNormal:!0,normals:[],hasColor:!0,colors:[],hasUV:!0,uvs:[],index:[],indexMap:{}},materials:[],smooth:!0,startMaterial:function(a,o){var s,l,u=this._finalize(!1);u&&(u.inherited||((s=u.groupCount)!==null&&s!==void 0?s:0)<=0)&&this.materials.splice((l=u.index)!==null&&l!==void 0?l:0,1);var c={index:this.materials.length,name:a||"",mtllib:Array.isArray(o)&&o.length>0?o[o.length-1]:"",smooth:u!==void 0?u.smooth:this.smooth,groupStart:u!==void 0?u.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(f){var m={index:typeof f=="number"?f:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(){return this}};return m.clone=this.clone.bind(m),m}};return this.materials.push(c),c},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(a){var o,s,l=this.currentMaterial();if(l&&l.groupEnd===-1&&(l.groupEnd=this.geometry.index.length,l.groupCount=l.groupEnd-((o=l.groupStart)!==null&&o!==void 0?o:0),l.inherited=!1),a&&this.materials.length>1)for(var u=this.materials.length-1;u>=0;u--)((s=this.materials[u].groupCount)!==null&&s!==void 0?s:0)<=0&&this.materials.splice(u,1);return a&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),l}},r&&r.name&&typeof r.clone=="function"){var i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},n.prototype.finalize=function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},n.prototype.parseVertexIndex=function(t,e){var r=parseInt(t,10);return(r>=0?r-1:r+e/3)*3},n.prototype.parseNormalIndex=function(t,e){var r=parseInt(t,10);return(r>=0?r-1:r+e/3)*3},n.prototype.parseUVIndex=function(t,e){var r=parseInt(t,10);return(r>=0?r-1:r+e/2)*2},n.prototype.addFace=function(t,e,r,i,a,o,s,l,u){var c=this.object.geometry,f=this.vertices.length,m=this.normals.length,A=this.uvs.length,h=this.parseVertexIndex(t,f),p=this.parseVertexIndex(e,f),g=this.parseVertexIndex(r,f),v=s!==void 0?this.parseNormalIndex(s,m):void 0,y=l!==void 0?this.parseNormalIndex(l,m):void 0,b=u!==void 0?this.parseNormalIndex(u,m):void 0,x=i!==void 0?this.parseUVIndex(i,A):void 0,w=a!==void 0?this.parseUVIndex(a,A):void 0,E=o!==void 0?this.parseUVIndex(o,A):void 0;(c.hasNormal===!0&&v===void 0||y===void 0||b===void 0)&&(c.hasNormal=!1),(c.hasUV===!0&&x===void 0||w===void 0||E===void 0)&&(c.hasUV=!1);var M=[h,x,v].join(":"),C=c.indexMap[M];C===void 0&&(C=c.vertices.length/3,c.indexMap[M]=C,c.vertices.push(this.vertices[h+0],this.vertices[h+1],this.vertices[h+2]),c.hasColor&&(this.colors[h]===void 0?c.hasColor=!1:c.colors.push(this.colors[h+0],this.colors[h+1],this.colors[h+2])),c.hasNormal&&c.normals.push(this.normals[h+0],this.normals[h+1],this.normals[h+2]),c.hasUV&&c.uvs.push(this.uvs[x+0],this.uvs[x+1])),c.index.push(C);var R=[p,w,y].join(":"),L=c.indexMap[R];L===void 0&&(L=c.vertices.length/3,c.indexMap[R]=L,c.vertices.push(this.vertices[p+0],this.vertices[p+1],this.vertices[p+2]),c.hasColor&&(this.colors[p]===void 0?c.hasColor=!1:c.colors.push(this.colors[p+0],this.colors[p+1],this.colors[p+2])),c.hasNormal&&c.normals.push(this.normals[p+0],this.normals[p+1],this.normals[p+2]),c.hasUV&&c.uvs.push(this.uvs[w+0],this.uvs[w+1])),c.index.push(L);var S=[g,E,b].join(":"),I=c.indexMap[S];I===void 0&&(I=c.vertices.length/3,c.indexMap[S]=I,c.vertices.push(this.vertices[g+0],this.vertices[g+1],this.vertices[g+2]),c.hasColor&&(this.colors[g]===void 0?c.hasColor=!1:c.colors.push(this.colors[g+0],this.colors[g+1],this.colors[g+2])),c.hasNormal&&c.normals.push(this.normals[g+0],this.normals[g+1],this.normals[g+2]),c.hasUV&&c.uvs.push(this.uvs[E+0],this.uvs[E+1])),c.index.push(I)},n}();function Ih(n){var t=new Ch;n.indexOf(`\r
|
|
930
930
|
`)!==-1&&(n=n.replace(/\r\n/g,`
|
|
931
931
|
`)),n.indexOf(`\\
|
|
932
932
|
`)!==-1&&(n=n.replace(/\\\n/g,""));for(var e=n.split(`
|
|
933
|
-
`),r=[],i=0,a=e.length;i<a;i++){var o=e[i].trimStart();if(o.length!==0){var s=o.charAt(0);if(s!=="#"){if(s==="v"){var l=o.split(Ts);switch(l[0]){case"v":t.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),l.length>=7?(Fn.setRGB(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6])),Fn.convertSRGBToLinear(),t.colors.push(Fn.r,Fn.g,Fn.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case"vt":t.uvs.push(parseFloat(l[1]),parseFloat(l[2]));break}}else if(s==="f"){for(var u=o.slice(1).trim(),c=u.split(Ts),f=[],m=0,A=c.length;m<A;m++){var h=c[m];if(h.length>0){var p=h.split("/");f.push(p)}}for(var g=f[0],m=1,A=f.length-1;m<A;m++){var v=f[m],y=f[m+1];t.addFace(g[0],v[0],y[0],g[1],v[1],y[1],g[2],v[2],y[2])}}else if(s!=="l"){if(s!=="p")if((r=wh.exec(o))!==null){var b=(" "+r[0].slice(1).trim()).slice(1);t.startObject(b)}else if(Sh.test(o))t.object.startMaterial(o.substring(7).trim(),t.materialLibraries);else if(Eh.test(o))t.materialLibraries.push(o.substring(7).trim());else if(
|
|
934
|
-
`),a={name:""},o=/\s+/,s={},l=0;l<i.length;l++){var u=i[l];if(u=u.trim(),!(u.length===0||u.charAt(0)==="#")){var c=u.indexOf(" "),f=c>=0?u.substring(0,c):u;f=f.toLowerCase();var m=c>=0?u.substring(c+1):"";if(m=m.trim(),f==="newmtl")a={name:m},s[m]=a;else if(f==="ka"||f==="kd"||f==="ks"||f==="ke"){var A=m.split(o,3);a[f]=[parseFloat(A[0]),parseFloat(A[1]),parseFloat(A[2])]}else(f==="map_kd"||f==="map_ks"||f==="map_ke"||f==="norm"||f==="map_bump"||f==="bump"||f==="map_d"||f==="ns"||f==="d"||f==="tr")&&(a[f]=m)}}function h(g){var v={url:"",scale:new d.Vector2(1,1),offset:new d.Vector2(0,0),bumpScale:1},y=g.split(/\s+/),b;return b=y.indexOf("-bm"),b>=0&&(v.bumpScale=parseFloat(y[b+1]),y.splice(b,2)),b=y.indexOf("-s"),b>=0&&(v.scale.set(parseFloat(y[b+1]),parseFloat(y[b+2])),y.splice(b,4)),b=y.indexOf("-o"),b>=0&&(v.offset.set(parseFloat(y[b+1]),parseFloat(y[b+2])),y.splice(b,4)),v.url=y.join(" ").trim(),v}function p(g,v,y){var b=h(y),x=at(e.path,b.url);return r.loadTexture(x,{fetcher:e.fetcher,encoding:v==="map"||v==="emissiveMap"?d.sRGBEncoding:d.LinearEncoding,minFilter:d.LinearFilter,magFilter:d.LinearFilter,wrapS:d.RepeatWrapping,wrapT:d.RepeatWrapping}).then(function(w){var E=w.body;return E.repeat.copy(b.scale),E.offset.copy(b.offset),g.bumpScale=b.bumpScale,g[v]=E,E})}return{name:n,create:function(g){var v=new Jr,y=[],b=s[g];if(b){if(b.kd!==void 0&&v.color.fromArray(b.kd),b.ks!==void 0&&v.specular.fromArray(b.ks),b.ke!==void 0&&v.emissive.fromArray(b.ke),b.map_kd!==void 0&&y.push(p(v,"map",b.map_kd)),b.map_ks!==void 0&&y.push(p(v,"specularMap",b.map_ks)),b.map_ke!==void 0&&y.push(p(v,"emissiveMap",b.map_ke)),b.norm!==void 0&&y.push(p(v,"normalMap",b.norm)),b.map_bump!==void 0&&y.push(p(v,"bumpMap",b.map_bump)),b.bump!==void 0&&y.push(p(v,"bumpMap",b.bump)),b.map_d!==void 0&&y.push(p(v,"alphaMap",b.map_d)),b.ns!==void 0&&(v.shininess=parseFloat(b.ns)),b.d!==void 0){var x=parseFloat(b.d);x<1&&(v.opacity=x,v.transparent=!0)}if(b.tr!==void 0){var x=parseFloat(b.tr);x>0&&(v.opacity=1-x,v.transparent=!0)}}var w=Promise.all(y).then(function(E){return v.refreshUniforms(),E});return[v,w]}}}function Ph(n,t){for(var e,r,i=[],a=[],o=new d.Group,s=function(c,f){var m=n.objects[c],A=m.geometry,h=m.materials,p=!1;if(A.vertices.length===0)return"continue";var g=new d.BufferGeometry;a.push(function(){return g.dispose()}),g.setAttribute("position",new d.BufferAttribute(new Float32Array(A.vertices),3)),A.normals.length>0&&g.setAttribute("normal",new d.BufferAttribute(new Float32Array(A.normals),3)),A.colors.length>0&&(p=!0,g.setAttribute("color",new d.BufferAttribute(new Float32Array(A.colors),3))),A.uvs.length>0&&g.setAttribute("uv",new d.BufferAttribute(new Float32Array(A.uvs),2)),A.index.length>0&&g.setIndex(new d.BufferAttribute(new Uint32Array(A.index),1)),g.computeBoundingBox(),g.computeBoundingSphere();for(var v=[],y=function(C,M){var R=h[C],L=R.name+"_"+R.smooth+"_"+p,S=n.materials[L];if(!S){for(var I=null,O=0,P=t;O<P.length;O++){var F=P[O],V=F.name,D=F.create;V===R.mtllib&&(I=D(R.name))}if(!I){var z=new Jr;z.refreshUniforms(),I=[z,Promise.resolve([])]}S=I[0],S.name=R.name,S.flatShading=!(R.smooth||g.attributes.normal),S.vertexColors=p,n.materials[L]=S;var U=I[1];i.push(U),a.push(function(){return S.dispose()})}v.push(S)},b=0,x=h.length;b<x;b++)y(b);for(var b=0,x=h.length;b<x;b++){var w=h[b];g.addGroup((e=w.groupStart)!==null&&e!==void 0?e:0,(r=w.groupCount)!==null&&r!==void 0?r:0,b)}var E=new Tt(g,v);E.name=m.name,o.add(E)},l=0,u=n.objects.length;l<u;l++)s(l);return Promise.all(i).then(function(c){for(var f=[],m=0,A=c;m<A.length;m++){var h=A[m];f=f.concat(h)}return{scene:o,textures:f,dispose:function(){return a.forEach(function(p){return p()})}}})}function Bh(n,t){var e=n.slice(0,n.lastIndexOf("/")+1),r=0,i;return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(a){r=a.body.byteLength;var o=new TextDecoder;return o.decode(a.body)}).then(function(a){return i=Ih(a),Promise.all(i.materialLibraries.map(function(o){var s=at(e,o),l=s.slice(0,s.lastIndexOf("/")+1);return t.fetcher.ajax(s,{responseType:"text"}).then(function(u){return Th(o,u.body,{path:l,fetcher:t.fetcher})})}))}).then(function(a){return Ph(i,a)}).then(function(a){return{type:"obj",uri:n,byteLength:r,scene:a.scene,textures:a.textures,dispose:function(){return a.dispose()}}})}var Ps=new d.Matrix4;function ga(n,t){n.name=t.id;var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras){if(r instanceof d.Mesh||r instanceof d.Points)for(var i=Array.isArray(r.material)?r.material:r.material?[r.material]:[],a=0,o=i;a<o.length;a++){var s=o[a];(s instanceof Jr||s instanceof ii)&&(s.floor=t.extras.floor)}}else if(!(r instanceof er)){if(r instanceof Tt&&e){for(var l=new d.Box3().expandByObject(r),u=l.getCenter(new d.Vector3),c=0,f=0;f<e.length;f++){var m=e[f],A=m.ground,h=m.height;if(u.y<A+h){c=f;break}}t.floor=c,t.tileset.floorLength=Math.max(t.tileset.floorLength,t.floor+1),r.material.forEach(function(p){return p.floor=c})}}})}function Rh(n,t){if(!n.content)return Promise.resolve(n);var e=n.content,r=go(e.uri,t.search);if(n.type==="TILESET"){var i=lt(r,{key:"model.".concat(n.siblingIndex)});return e.loadState="LOADING",e.loadStateUpdateTime=he(),t.fetcher.ajax(i,{responseType:"text"}).then(function(a){return a.body}).then(function(a){var o=r.slice(0,r.lastIndexOf("/")+1);return Ei(JSON.parse(a),o)}).then(function(a){e.loadState="READY",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=0,n.children.length===0&&(n.children=[new mo("".concat(n.id,".0"),a.root,n.tileset,n)])}).then(function(){return n}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=Math.min(e.loadfailRetryDelay+1e3,5e3),Promise.reject(a)})}if(n.type==="SCENEGRAPH")return e.loadState="LOADING",e.loadStateUpdateTime=he(),Promise.resolve().then(function(){var a,o,s,l,u,c,f,m,A,h,p="",g=r.split("#"),v=g[0],y=g[1],b=(y||v).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(b&&(p=b[1]),p==="b3dm"){var x=lt(r,{key:"model.".concat(n.siblingIndex)});return hu(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(w){return w.scene.applyMatrix4(n.transform),w.scene.updateWorldMatrix(!1,!0),w.scene.matrixAutoUpdate=!1,ga(w.scene,n),w})}if(p==="pnts"){var x=lt(r,{key:"model.".concat(n.siblingIndex)});return vu(x,{fetcher:t.fetcher,computeBoundingBox:!1}).then(function(E){if(E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,n.boundingVolume){var C=n.boundingVolume;E.scene.traverse(function(M){if(M instanceof er){Ps.getInverse(M.matrixWorld);var R=new d.Box3;C.getBoundingBox(R),R.applyMatrix4(Ps),M.geometry.boundingBox=R}})}return ga(E.scene,n),E})}if(p==="glb"){var x=lt(r,{key:"model.".concat(n.siblingIndex)});return Bu(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,ga(E.scene,n),E})}if(p==="at3d"){var x=n.extras.at3d?r:lt(r,{key:"model.".concat(n.siblingIndex)});return Mu(x,{textureBaseUri:(a=n.extras.at3d)===null||a===void 0?void 0:a.textureBaseUri,textureArray:(o=n.extras.at3d)===null||o===void 0?void 0:o.textureArray,textureOptions:(s=n.extras.at3d)===null||s===void 0?void 0:s.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="pbm"){var x=n.extras.pbm?r:lt(r,{key:"model.".concat(n.siblingIndex)});return Eu(x,{textureBaseUri:(l=n.extras.pbm)===null||l===void 0?void 0:l.textureBaseUri,textureArray:(u=n.extras.pbm)===null||u===void 0?void 0:u.textureArray,textureOptions:(c=n.extras.pbm)===null||c===void 0?void 0:c.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="dome"){var x=n.extras.dome?r:lt(r,{key:"model.".concat(n.siblingIndex)});return Iu(x,{textureBaseUri:(f=n.extras.dome)===null||f===void 0?void 0:f.textureBaseUri,textureOptions:(m=n.extras.dome)===null||m===void 0?void 0:m.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="domez"){var x=n.extras.domez?r:lt(r,{key:"model.".concat(n.siblingIndex)});return Pu(x,{textureBaseUri:(A=n.extras.domez)===null||A===void 0?void 0:A.textureBaseUri,textureOptions:(h=n.extras.domez)===null||h===void 0?void 0:h.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="ply"){var x=n.extras.ply?r:lt(r,{key:"model.".concat(n.siblingIndex)});return wo(x,{type:"pbmPointCloud",fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="obj"){var x=n.extras.obj?r:lt(r,{key:"model.".concat(n.siblingIndex)});return Bh(x,{fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}throw new Error("Invalid Tile content: ".concat(r))}).then(function(a){a.scene.traverse(function(s){if(s instanceof er)s.material.uniforms.geometricError.value=n.geometricError;else if(s instanceof Tt)for(var l=0,u=s.material;l<u.length;l++){var c=u[l];c.uniforms.geometricError.value=n.geometricError}});var o={type:a.type,uri:a.uri,byteLength:a.byteLength,object:new su(n.id,a.scene,a.dispose)};return Promise.resolve().then(function(){return Promise.all([o.object.generateBvhTree(),t.renderer&&a.textures.length<16?lf(a.textures,t.renderer,1024*1024):null])}).then(function(){return e.loadState="READY",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=0,e.byteLength=o.byteLength,e.data=o,n}).catch(function(s){return Ja(n),Promise.reject(s)})}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=Math.min(e.loadfailRetryDelay+1e3,5e3),Promise.reject(a)});throw new Error("Invalid Tile type: ".concat(n.type))}function Ja(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=he(),n.content.byteLength=0)}var Ou=function(n){se(t,n);function t(e,r,i){var a=n.call(this)||this;return a.name=e,a.line=r,a.edge=i,a.name=e,a.add(r),a.add(i),a}return t.prototype.update=function(e,r,i){var a=i.bounding.distanceToPoint(r.position),o=this.line.material.uniforms;o.totalSize.value=.1+Math.sqrt(a)/10,o.dashSize.value=o.totalSize.value/2,o.dashOffset.value=-r.time/2e3*(1+a/10)%o.totalSize.value,i.needsRender=!0},t.prototype.dispose=function(){this.line.geometry.dispose(),this.line.material.dispose(),this.edge.geometry.dispose(),this.edge.material.dispose()},t}(d.Object3D),ya={vertexShader:`
|
|
933
|
+
`),r=[],i=0,a=e.length;i<a;i++){var o=e[i].trimStart();if(o.length!==0){var s=o.charAt(0);if(s!=="#"){if(s==="v"){var l=o.split(Ts);switch(l[0]){case"v":t.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),l.length>=7?(Fn.setRGB(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6])),Fn.convertSRGBToLinear(),t.colors.push(Fn.r,Fn.g,Fn.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case"vt":t.uvs.push(parseFloat(l[1]),parseFloat(l[2]));break}}else if(s==="f"){for(var u=o.slice(1).trim(),c=u.split(Ts),f=[],m=0,A=c.length;m<A;m++){var h=c[m];if(h.length>0){var p=h.split("/");f.push(p)}}for(var g=f[0],m=1,A=f.length-1;m<A;m++){var v=f[m],y=f[m+1];t.addFace(g[0],v[0],y[0],g[1],v[1],y[1],g[2],v[2],y[2])}}else if(s!=="l"){if(s!=="p")if((r=wh.exec(o))!==null){var b=(" "+r[0].slice(1).trim()).slice(1);t.startObject(b)}else if(Sh.test(o))t.object.startMaterial(o.substring(7).trim(),t.materialLibraries);else if(Eh.test(o))t.materialLibraries.push(o.substring(7).trim());else if(Mh.test(o))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(s==="s"){if(r=o.split(" "),r.length>1){var x=r[1].trim().toLowerCase();t.object.smooth=x!=="0"&&x!=="off"}else t.object.smooth=!0;var w=t.object.currentMaterial();w&&(w.smooth=t.object.smooth)}else{if(o==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+o+'"')}}}}}return t.finalize(),t}function Th(n,t,e){for(var r=new Bn,i=t.split(`
|
|
934
|
+
`),a={name:""},o=/\s+/,s={},l=0;l<i.length;l++){var u=i[l];if(u=u.trim(),!(u.length===0||u.charAt(0)==="#")){var c=u.indexOf(" "),f=c>=0?u.substring(0,c):u;f=f.toLowerCase();var m=c>=0?u.substring(c+1):"";if(m=m.trim(),f==="newmtl")a={name:m},s[m]=a;else if(f==="ka"||f==="kd"||f==="ks"||f==="ke"){var A=m.split(o,3);a[f]=[parseFloat(A[0]),parseFloat(A[1]),parseFloat(A[2])]}else(f==="map_kd"||f==="map_ks"||f==="map_ke"||f==="norm"||f==="map_bump"||f==="bump"||f==="map_d"||f==="ns"||f==="d"||f==="tr")&&(a[f]=m)}}function h(g){var v={url:"",scale:new d.Vector2(1,1),offset:new d.Vector2(0,0),bumpScale:1},y=g.split(/\s+/),b;return b=y.indexOf("-bm"),b>=0&&(v.bumpScale=parseFloat(y[b+1]),y.splice(b,2)),b=y.indexOf("-s"),b>=0&&(v.scale.set(parseFloat(y[b+1]),parseFloat(y[b+2])),y.splice(b,4)),b=y.indexOf("-o"),b>=0&&(v.offset.set(parseFloat(y[b+1]),parseFloat(y[b+2])),y.splice(b,4)),v.url=y.join(" ").trim(),v}function p(g,v,y){var b=h(y),x=at(e.path,b.url);return r.loadTexture(x,{fetcher:e.fetcher,encoding:v==="map"||v==="emissiveMap"?d.sRGBEncoding:d.LinearEncoding,minFilter:d.LinearFilter,magFilter:d.LinearFilter,wrapS:d.RepeatWrapping,wrapT:d.RepeatWrapping}).then(function(w){var E=w.body;return E.repeat.copy(b.scale),E.offset.copy(b.offset),g.bumpScale=b.bumpScale,g[v]=E,E})}return{name:n,create:function(g){var v=new Jr,y=[],b=s[g];if(b){if(b.kd!==void 0&&v.color.fromArray(b.kd),b.ks!==void 0&&v.specular.fromArray(b.ks),b.ke!==void 0&&v.emissive.fromArray(b.ke),b.map_kd!==void 0&&y.push(p(v,"map",b.map_kd)),b.map_ks!==void 0&&y.push(p(v,"specularMap",b.map_ks)),b.map_ke!==void 0&&y.push(p(v,"emissiveMap",b.map_ke)),b.norm!==void 0&&y.push(p(v,"normalMap",b.norm)),b.map_bump!==void 0&&y.push(p(v,"bumpMap",b.map_bump)),b.bump!==void 0&&y.push(p(v,"bumpMap",b.bump)),b.map_d!==void 0&&y.push(p(v,"alphaMap",b.map_d)),b.ns!==void 0&&(v.shininess=parseFloat(b.ns)),b.d!==void 0){var x=parseFloat(b.d);x<1&&(v.opacity=x,v.transparent=!0)}if(b.tr!==void 0){var x=parseFloat(b.tr);x>0&&(v.opacity=1-x,v.transparent=!0)}}var w=Promise.all(y).then(function(E){return v.refreshUniforms(),E});return[v,w]}}}function Ph(n,t){for(var e,r,i=[],a=[],o=new d.Group,s=function(c,f){var m=n.objects[c],A=m.geometry,h=m.materials,p=!1;if(A.vertices.length===0)return"continue";var g=new d.BufferGeometry;a.push(function(){return g.dispose()}),g.setAttribute("position",new d.BufferAttribute(new Float32Array(A.vertices),3)),A.normals.length>0&&g.setAttribute("normal",new d.BufferAttribute(new Float32Array(A.normals),3)),A.colors.length>0&&(p=!0,g.setAttribute("color",new d.BufferAttribute(new Float32Array(A.colors),3))),A.uvs.length>0&&g.setAttribute("uv",new d.BufferAttribute(new Float32Array(A.uvs),2)),A.index.length>0&&g.setIndex(new d.BufferAttribute(new Uint32Array(A.index),1)),g.computeBoundingBox(),g.computeBoundingSphere();for(var v=[],y=function(M,C){var R=h[M],L=R.name+"_"+R.smooth+"_"+p,S=n.materials[L];if(!S){for(var I=null,O=0,P=t;O<P.length;O++){var F=P[O],V=F.name,D=F.create;V===R.mtllib&&(I=D(R.name))}if(!I){var z=new Jr;z.refreshUniforms(),I=[z,Promise.resolve([])]}S=I[0],S.name=R.name,S.flatShading=!(R.smooth||g.attributes.normal),S.vertexColors=p,n.materials[L]=S;var U=I[1];i.push(U),a.push(function(){return S.dispose()})}v.push(S)},b=0,x=h.length;b<x;b++)y(b);for(var b=0,x=h.length;b<x;b++){var w=h[b];g.addGroup((e=w.groupStart)!==null&&e!==void 0?e:0,(r=w.groupCount)!==null&&r!==void 0?r:0,b)}var E=new Tt(g,v);E.name=m.name,o.add(E)},l=0,u=n.objects.length;l<u;l++)s(l);return Promise.all(i).then(function(c){for(var f=[],m=0,A=c;m<A.length;m++){var h=A[m];f=f.concat(h)}return{scene:o,textures:f,dispose:function(){return a.forEach(function(p){return p()})}}})}function Bh(n,t){var e=n.slice(0,n.lastIndexOf("/")+1),r=0,i;return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(a){r=a.body.byteLength;var o=new TextDecoder;return o.decode(a.body)}).then(function(a){return i=Ih(a),Promise.all(i.materialLibraries.map(function(o){var s=at(e,o),l=s.slice(0,s.lastIndexOf("/")+1);return t.fetcher.ajax(s,{responseType:"text"}).then(function(u){return Th(o,u.body,{path:l,fetcher:t.fetcher})})}))}).then(function(a){return Ph(i,a)}).then(function(a){return{type:"obj",uri:n,byteLength:r,scene:a.scene,textures:a.textures,dispose:function(){return a.dispose()}}})}var Ps=new d.Matrix4;function ga(n,t){n.name=t.id;var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras){if(r instanceof d.Mesh||r instanceof d.Points)for(var i=Array.isArray(r.material)?r.material:r.material?[r.material]:[],a=0,o=i;a<o.length;a++){var s=o[a];(s instanceof Jr||s instanceof ii)&&(s.floor=t.extras.floor)}}else if(!(r instanceof er)){if(r instanceof Tt&&e){for(var l=new d.Box3().expandByObject(r),u=l.getCenter(new d.Vector3),c=0,f=0;f<e.length;f++){var m=e[f],A=m.ground,h=m.height;if(u.y<A+h){c=f;break}}t.floor=c,t.tileset.floorLength=Math.max(t.tileset.floorLength,t.floor+1),r.material.forEach(function(p){return p.floor=c})}}})}function Rh(n,t){if(!n.content)return Promise.resolve(n);var e=n.content,r=go(e.uri,t.search);if(n.type==="TILESET"){var i=lt(r,{key:"model.".concat(n.siblingIndex)});return e.loadState="LOADING",e.loadStateUpdateTime=he(),t.fetcher.ajax(i,{responseType:"text"}).then(function(a){return a.body}).then(function(a){var o=r.slice(0,r.lastIndexOf("/")+1);return Ei(JSON.parse(a),o)}).then(function(a){e.loadState="READY",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=0,n.children.length===0&&(n.children=[new mo("".concat(n.id,".0"),a.root,n.tileset,n)])}).then(function(){return n}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=Math.min(e.loadfailRetryDelay+1e3,5e3),Promise.reject(a)})}if(n.type==="SCENEGRAPH")return e.loadState="LOADING",e.loadStateUpdateTime=he(),Promise.resolve().then(function(){var a,o,s,l,u,c,f,m,A,h,p="",g=r.split("#"),v=g[0],y=g[1],b=(y||v).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(b&&(p=b[1]),p==="b3dm"){var x=lt(r,{key:"model.".concat(n.siblingIndex)});return hu(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(w){return w.scene.applyMatrix4(n.transform),w.scene.updateWorldMatrix(!1,!0),w.scene.matrixAutoUpdate=!1,ga(w.scene,n),w})}if(p==="pnts"){var x=lt(r,{key:"model.".concat(n.siblingIndex)});return vu(x,{fetcher:t.fetcher,computeBoundingBox:!1}).then(function(E){if(E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,n.boundingVolume){var M=n.boundingVolume;E.scene.traverse(function(C){if(C instanceof er){Ps.getInverse(C.matrixWorld);var R=new d.Box3;M.getBoundingBox(R),R.applyMatrix4(Ps),C.geometry.boundingBox=R}})}return ga(E.scene,n),E})}if(p==="glb"){var x=lt(r,{key:"model.".concat(n.siblingIndex)});return Bu(x,{upAxis:n.tileset.asset.gltfUpAxis,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,ga(E.scene,n),E})}if(p==="at3d"){var x=n.extras.at3d?r:lt(r,{key:"model.".concat(n.siblingIndex)});return Cu(x,{textureBaseUri:(a=n.extras.at3d)===null||a===void 0?void 0:a.textureBaseUri,textureArray:(o=n.extras.at3d)===null||o===void 0?void 0:o.textureArray,textureOptions:(s=n.extras.at3d)===null||s===void 0?void 0:s.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="pbm"){var x=n.extras.pbm?r:lt(r,{key:"model.".concat(n.siblingIndex)});return Eu(x,{textureBaseUri:(l=n.extras.pbm)===null||l===void 0?void 0:l.textureBaseUri,textureArray:(u=n.extras.pbm)===null||u===void 0?void 0:u.textureArray,textureOptions:(c=n.extras.pbm)===null||c===void 0?void 0:c.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="dome"){var x=n.extras.dome?r:lt(r,{key:"model.".concat(n.siblingIndex)});return Iu(x,{textureBaseUri:(f=n.extras.dome)===null||f===void 0?void 0:f.textureBaseUri,textureOptions:(m=n.extras.dome)===null||m===void 0?void 0:m.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="domez"){var x=n.extras.domez?r:lt(r,{key:"model.".concat(n.siblingIndex)});return Pu(x,{textureBaseUri:(A=n.extras.domez)===null||A===void 0?void 0:A.textureBaseUri,textureOptions:(h=n.extras.domez)===null||h===void 0?void 0:h.textureOptions,fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="ply"){var x=n.extras.ply?r:lt(r,{key:"model.".concat(n.siblingIndex)});return wo(x,{type:"pbmPointCloud",fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}if(p==="obj"){var x=n.extras.obj?r:lt(r,{key:"model.".concat(n.siblingIndex)});return Bh(x,{fetcher:t.fetcher}).then(function(E){return E.scene.applyMatrix4(n.transform),E.scene.updateWorldMatrix(!1,!0),E.scene.matrixAutoUpdate=!1,E})}throw new Error("Invalid Tile content: ".concat(r))}).then(function(a){a.scene.traverse(function(s){if(s instanceof er)s.material.uniforms.geometricError.value=n.geometricError;else if(s instanceof Tt)for(var l=0,u=s.material;l<u.length;l++){var c=u[l];c.uniforms.geometricError.value=n.geometricError}});var o={type:a.type,uri:a.uri,byteLength:a.byteLength,object:new su(n.id,a.scene,a.dispose)};return Promise.resolve().then(function(){return Promise.all([o.object.generateBvhTree(),t.renderer&&a.textures.length<16?lf(a.textures,t.renderer,1024*1024):null])}).then(function(){return e.loadState="READY",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=0,e.byteLength=o.byteLength,e.data=o,n}).catch(function(s){return Ja(n),Promise.reject(s)})}).catch(function(a){return e.loadState="FAILED",e.loadStateUpdateTime=he(),e.loadfailRetryDelay=Math.min(e.loadfailRetryDelay+1e3,5e3),Promise.reject(a)});throw new Error("Invalid Tile type: ".concat(n.type))}function Ja(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=he(),n.content.byteLength=0)}var Ou=function(n){se(t,n);function t(e,r,i){var a=n.call(this)||this;return a.name=e,a.line=r,a.edge=i,a.name=e,a.add(r),a.add(i),a}return t.prototype.update=function(e,r,i){var a=i.bounding.distanceToPoint(r.position),o=this.line.material.uniforms;o.totalSize.value=.1+Math.sqrt(a)/10,o.dashSize.value=o.totalSize.value/2,o.dashOffset.value=-r.time/2e3*(1+a/10)%o.totalSize.value,i.needsRender=!0},t.prototype.dispose=function(){this.line.geometry.dispose(),this.line.material.dispose(),this.edge.geometry.dispose(),this.edge.material.dispose()},t}(d.Object3D),ya={vertexShader:`
|
|
935
935
|
uniform float scale;
|
|
936
936
|
attribute float lineDistance;
|
|
937
937
|
varying float vLineDistance;
|
|
@@ -1029,11 +1029,11 @@ void main() {
|
|
|
1029
1029
|
#include <fog_fragment>
|
|
1030
1030
|
#include <premultiplied_alpha_fragment>
|
|
1031
1031
|
}
|
|
1032
|
-
`,uniforms:{diffuse:{value:new d.Color},size:{value:1}}},Fh=function(n){se(t,n);function t(e,r,i,a){var o=new Float32Array([e.x,e.y,e.z,r.x,r.y,r.z]),s=new Float32Array([0,1]),l=new d.BufferGeometry;l.setAttribute("position",new d.BufferAttribute(o,3)),l.setAttribute("start",new d.BufferAttribute(s,1));var u=new d.ShaderMaterial({vertexShader:ba.vertexShader,fragmentShader:ba.fragmentShader,uniforms:d.UniformsUtils.clone(ba.uniforms)});return u.uniforms.size.value=i,u.uniforms.diffuse.value.copy(a),n.call(this,l,u)||this}return t}(d.Points);function kh(n,t){var e=n.name,r=go(n.content.uri,t.search),i=lt(r,{key:"model.0"}),a=n.content.color;return n.content.loadState="LOADING",n.content.loadStateUpdateTime=he(),wo(i,{type:"geometry",fetcher:t.fetcher}).then(function(o){var s=o.scene,l=new d.ShaderMaterial({vertexShader:ya.vertexShader,fragmentShader:ya.fragmentShader,uniforms:d.UniformsUtils.clone(ya.uniforms)});l.uniforms.diffuse.value.set(a),l.uniforms.totalSize.value=.2,l.uniforms.dashSize.value=l.uniforms.totalSize.value/2;var u=new d.Line(s,l);u.computeLineDistances(),u.applyMatrix4(n.transform),u.updateWorldMatrix(!1,!0),u.matrixAutoUpdate=!1;var c=s.attributes.position.array,f=new Fh(new d.Vector3().fromArray(c,0),new d.Vector3().fromArray(c,c.length-3),12,a);f.applyMatrix4(n.transform),f.updateWorldMatrix(!1,!0),f.matrixAutoUpdate=!1;var m=new Ou(e,u,f);return n.content.data={byteLength:o.byteLength,object:m,uri:i},n.content.byteLength=o.byteLength,n.content.loadState="READY",n.content.loadStateUpdateTime=he(),n}).catch(function(o){return n.content.data=void 0,n.content.loadState="FAILED",n.content.loadStateUpdateTime=he(),n.content.loadfailRetryDelay=Math.min(n.content.loadfailRetryDelay+1e3,5e3),n.content.byteLength=0,Promise.reject(o)})}function Bs(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=he(),n.content.byteLength=0)}var Rs=new d.Vector3,Lh=new d.Matrix3,Oh=new d.Matrix4,ct=6378137,Vu=298.257223563;function Nu(n){for(var t=ct-ct/Vu,e=(ct*ct-t*t)/(ct*ct),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,a=1e3,o=0,s=Math.atan2(n.z,r),l=0;o++<a;){var u=Math.sin(s),c=ct/Math.sqrt(1-e*u*u);l=r/Math.cos(s)-c;var f=Math.atan2(n.z/(c*(1-e)+l),r/(c+l));if(isNaN(f))break;var m=Math.abs(f-s);if(m<i)break;s=f}return n.set(s,Math.atan2(n.y,n.x),l)}function Vh(n){var t=n.x,e=n.y,r=n.z,i=ct-ct/Vu,a=(ct*ct-i*i)/(ct*ct),o=Math.sin(t),s=Math.cos(t),l=Math.sin(e),u=Math.cos(e),c=ct/Math.sqrt(1-a*o*o),f=(c+r)*s*u,m=(c+r)*s*l,A=(i*i/(ct*ct)*c+r)*o;return n.set(f,m,A)}function Nh(n,t){var e=Nu(Rs.copy(n)),r=e.x,i=e.y,a=e.z,o=Math.sin(r),s=Math.sin(i),l=Math.cos(r),u=Math.cos(i);t.fromArray([-s,-o*u,l*u,0,+u,-o*s,l*s,0,0,l,o,0,0,0,0,1]);var c=Lh.setFromMatrix4(t),f=Rs.copy(n).applyMatrix3(c).multiplyScalar(-1);t.setPosition(f);var m=Oh.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return t.premultiply(m),t}var Wt={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},Fs=function(){var n=new d.MeshBasicMaterial;return n.side=d.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=Wt.TILE_MASK,n.stencilFunc=d.AlwaysStencilFunc,n.stencilFuncMask=Wt.TILE_MASK,n.stencilZPass=d.ReplaceStencilOp,n.stencilWriteMask=Wt.TILE_MASK,n}(),ks=function(){var n=new d.MeshBasicMaterial;return n.visible=!1,n}(),Dh=new d.BufferGeometry,zh=new d.MeshBasicMaterial,an=function(n){se(t,n);function t(e,r,i){var a,o,s,l=n.call(this)||this;return l.modelIndex=0,l.renderObjects=[],l.backfaceObjects=[],l.debugObjects=[],l.tileObjects=[],l.debug="none",l.name=i.name,l.type=i.type,l.upAxis=i.upAxis,l.model=e,l.fetcher=i.fetcher,l.search=(a=i.search)!==null&&a!==void 0?a:"",l.groundHeight=i.groundHeight,l.coordinateTransform=i.coordinateTransform,l.boundingBox=new d.Box3,l.idle=!1,l.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,l.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,l.needsRefined=!0,l.refined=!1,l.refineProgress=[0,0],l.loaded=!1,l.disposed=!1,l.needsRender=!0,l.lastRenderHash="",l.matrixAutoUpdate=!1,l.cacheCameras=[],l.clearStencilObject=new d.Mesh(Dh,zh),l.clearStencilObject.frustumCulled=!1,l.clearStencilObject.onAfterRender=function(u){return u.clearStencil()},l.tileset=new br((s=(o=l.model.work)===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",r,{referer:i.referer,tileLoader:function(u){return l.loadContent(u)},tileUnloader:function(u){return l.unloadContent(u)},onTileLoad:function(){},onTileUnload:function(u){},onTileError:function(u,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Tile error",u.id,c)},trajectoryLoader:function(u){return l.loadTrajectory(u)},trajectoryUnloader:function(u){return l.unloadTrajectory(u)},onTrajectoryLoad:function(){},onTrajectoryUnload:function(u){},onTrajectoryError:function(u,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Trajectory error",u,c)}}),l.tileset.root.boundingVolume&&l.tileset.root.boundingVolume.getBoundingBox(l.boundingBox),l}return t.prototype.getRenderHash=function(){return Hi([this.tileset.id,this.tileset.skipLevelOfDetail,this.tileset.selectedTiles.map(function(e){return e.id}),this.tileset.trajectories.map(function(e){return e.index}),this.debug])},Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){return this.tileset.maxMemoryUsage},set:function(e){this.tileset.maxMemoryUsage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){return this.tileset.maxRequests},set:function(e){this.tileset.maxRequests=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requestOrder",{get:function(){return this.tileset.tileRequestOrder},set:function(e){this.tileset.tileRequestOrder=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipLevelOfDetail",{get:function(){return this.tileset.skipLevelOfDetail},set:function(e){this.tileset.skipLevelOfDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mostDetail",{get:function(){return this.tileset.mostDetail},set:function(e){this.tileset.mostDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadSiblings",{get:function(){return this.tileset.loadSiblings},set:function(e){this.tileset.loadSiblings=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadAll",{get:function(){return this.tileset.loadAll},set:function(e){this.tileset.loadAll=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trajectories",{get:function(){return this.tileset.trajectories},enumerable:!1,configurable:!0}),t.prototype.localToEnu=function(e){return e.applyMatrix4(this.coordinateTransform.localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.enuToLocalMatrix)},t.prototype.localToEcef=function(e){return e.applyMatrix4(this.coordinateTransform.localToEcefMatrix)},t.prototype.ecefToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.ecefToLocalMatrix)},t.prototype.localToLla=function(e){return Nu(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal(Vh(e))},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},t.prototype.worldToEcef=function(e){return this.localToEcef(this.worldToLocal(e))},t.prototype.ecefToWorld=function(e){return this.localToWorld(this.ecefToLocal(e))},t.prototype.worldToLla=function(e){return this.localToLla(this.worldToLocal(e))},t.prototype.llaToWorld=function(e){return this.localToWorld(this.llaToLocal(e))},t.prototype.loadContent=function(e){var r=this;return Rh(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?Ja(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return Ja(e),Promise.resolve()},t.prototype.loadAllTilesets=function(){var e=this,r=function(i){var a=[];return e.tileset.root.traverse(function(o){var s;o.type==="TILESET"&&((s=o.content)===null||s===void 0?void 0:s.loadState)!=="READY"&&a.push(o)}),Promise.all(a.map(function(o){return e.loadContent(o).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.loadTrajectory=function(e){var r=this;return kh(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){r.disposed&&Bs(i)})},t.prototype.unloadTrajectory=function(e){return Bs(e),Promise.resolve()},t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=[this.tileset.root],s=this.tileset.transform,l=this.tileset.transformIsIdentity,u,c=[];u=o.pop();){var f=void 0;if(u.boundingVolume){var m=l?u.boundingVolume:u.boundingVolume.clone().applyMatrix4(s);f=m.intersectRay(e.ray,e.far)}else f=!0;if(f){for(var A=0,h=u.children.length;A<h;A++)o.push(u.children[A]);u.selected&&u.content&&u.content.data&&u.content.data.object.visible&&u.content.data.object.intersectRaycaster(e,!1,c)}}return this.model.shownFloorIndex>=0&&(c=c.filter(function(p){return p.floor===a.model.shownFloorIndex})),r&&c.sort(function(p,g){return p.distance-g.distance}),c.map(function(p){p.model=a.model,p.viewLayer=a.viewLayer}),i.push.apply(i,c),i},t.prototype.cloneSkipBackfaceObject=function(e){var r;e instanceof d.Mesh?r=new d.Mesh(e.geometry,Array.isArray(e.material)?e.material.map(function(s){return s.transparent?ks:Fs}):e.material&&e.material.transparent?ks:Fs):e instanceof d.Group?r=new d.Group:r=new d.Object3D,r.copy(e,!1);for(var i=0,a=e.children;i<a.length;i++){var o=a[i];r.add(this.cloneSkipBackfaceObject(o))}return r},t.prototype.update=function(e,r){var i,a,o,s=this,l,u,c;this.renderObjects.length=0,this.backfaceObjects.length=0,this.debugObjects.length=0,this.tileObjects.length=0,this.renderer=e,this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset();var f=this.tileset.frameNumber+1,m=this.visible,A=Math.max(this.maxLevelOfDetail,0),h=Math.min(this.minLevelOfDetail,A),p=Math.max(h,0),g={time:he(),camera:{type:r.type,position:new d.Vector3().copy(r.position),direction:r.getDirection(new d.Vector3),near:r.near,far:r.far,up:new d.Vector3().copy(r.up).applyQuaternion(r.quaternion),visible:r.visible,refine:r.refineModel},minLevelOfDetail:h,maxLevelOfDetail:m&&!this.idle&&this.loaded?A:p,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:f,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new Hn().setFromCamera(r)},v=this.cacheCameras.map(function(ee){return k(k({},g),{camera:{type:r.type,position:new d.Vector3().copy(ee.position),direction:ee.getWorldDirection(new d.Vector3),near:r.near,far:r.far,up:new d.Vector3().copy(ee.up),visible:ee.visible,refine:!0},cullingVolume:new Hn().setFromCamera(ee)})});this.tileset.update(g,v),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(ee){if(s.refineProgress[1]++,ee.content){var Z=ee.content.loadState;if(Z==="UNLOADED"||Z==="LOADING"){s.refined=!1;return}}s.refineProgress[0]++}),this.loaded===!1&&this.tileset.selectedTiles.length>0&&this.tileset.needsRefinedTiles.size>0&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(ee){if(s.loaded!==!1){if(s.tileset.skipLevelOfDetail){if(ee.state.finalResolution&&ee.content){var Z=ee.state.ancestorWithContentAvailable,ie=Z&&Z.content?Z.content:ee.content,te=ie.loadState;(te==="UNLOADED"||te==="LOADING")&&(s.loaded=!1)}}else if(ee.state.visible&&ee.content&&ee.levelOfContent<=0){var te=ee.content.loadState;(te==="UNLOADED"||te==="LOADING")&&(s.loaded=!1)}}}),this.loaded===!0&&(this.refined=!1,this.refineProgress[1]++)),this.remove.apply(this,this.children),this.tileset.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(ee,Z){return ee.floor-Z.floor}),this.debug==="root-bounding-volume"&&this.tileset.root.boundingVolumeDebugObject&&this.debugObjects.push(this.tileset.root.boundingVolumeDebugObject);for(var y=0,b=this.tileset.selectedTiles;y<b.length;y++){var x=b[y];this.debug==="selected-bounding-volume"&&x.boundingVolumeDebugObject&&this.debugObjects.push(x.boundingVolumeDebugObject);var w=(u=(l=x.content)===null||l===void 0?void 0:l.data)===null||u===void 0?void 0:u.object;if(w){if(w.update(e,r,this.model,x),this.tileset.hasMixedContent&&this.tileset.skipLevelOfDetail){if(!x.state.finalResolution){var E=this.cloneSkipBackfaceObject(w);this.backfaceObjects.push(E)}for(var C=x.state.selectionDepth,M=Wt.TILE_MASK|C<<Wt.SKIP_LOD_BIT_SHIFT,R=d.GreaterEqualStencilFunc,L=Wt.SKIP_LOD_MASK,S=d.ReplaceStencilOp,I=Wt.TILE_MASK|Wt.SKIP_LOD_MASK,O=0,P=w.materials;O<P.length;O++){var F=P[O];F.stencilWrite=!0,F.stencilRef=M,F.stencilFunc=R,F.stencilFuncMask=L,F.stencilZPass=S,F.stencilWriteMask=I}}else for(var V=0,D=w.materials;V<D.length;V++){var F=D[V];F.stencilWrite=!1,F.stencilRef=Wt.TILE_MASK,F.stencilFunc=d.AlwaysStencilFunc,F.stencilFuncMask=Wt.TILE_MASK,F.stencilZPass=d.ReplaceStencilOp,F.stencilWriteMask=Wt.TILE_MASK}this.tileObjects.push(w)}}this.tileset.skipLevelOfDetail&&this.backfaceObjects.length&&(i=this.renderObjects).push.apply(i,this.backfaceObjects),this.tileObjects.length&&(a=this.renderObjects).push.apply(a,this.tileObjects),this.tileset.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var z=0,U=this.tileset.selectedTrajectories;z<U.length;z++){var q=U[z],K=(c=q.content.data)===null||c===void 0?void 0:c.object;K&&(K.update(e,r,this.model),this.renderObjects.push(K))}this.debug&&(o=this.renderObjects).push.apply(o,this.debugObjects);for(var j=this.modelIndex*1e4,J=function(ee){var Z=X.renderObjects[ee],ie=ee+j;Z.traverse(function(te){(te instanceof d.Mesh||te instanceof d.Line||te instanceof d.Points)&&(te.renderOrder=ie)}),X.add(Z)},X=this,Y=0;Y<this.renderObjects.length;Y++)J(Y);var W=this.getRenderHash();this.lastRenderHash!==W&&(this.needsRender=!0,this.lastRenderHash=W)},t.prototype.dispose=function(){this.disposed=!0,this.viewLayer=void 0,this.tileset.reset(),this.remove.apply(this,this.children),this.refineProgress[0]=0,this.refineProgress[1]=0,this.refined=!1,this.loaded=!1},t.DEFAULT_MIN_LEVEL_OF_DETAIL=0,t.DEFAULT_MAX_LEVEL_OF_DETAIL=20,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=br.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=br.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_MOST_DETAIL=br.DEFAULT_MOST_DETAIL,t.DEFAULT_LOAD_SIBLINGS=br.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_LOAD_ALL=br.DEFAULT_LOAD_ALL,t.DEFAULT_MAX_REQUESTS=br.DEFAULT_MAX_REQUESTS,t.DEFAULT_REQUEST_ORDER=br.DEFAULT_REQUEST_ORDER,t}(d.Object3D);function Qh(n){return-((n-.25)*360+90)/180*Math.PI}function Xa(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var e,r,i;if(Array.isArray(n)){if(e=n.length,e!=t.length)return!1;for(r=e;r--!==0;)if(!Xa(n[r],t[r]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),e=i.length,e!==Object.keys(t).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=e;r--!==0;){var a=i[r];if(!Xa(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Jt(n){return typeof n=="number"}var Ls=function(){return new Error("Invalid input.")},Os=function(){return new Error("Invalid certificate.")},Vs=function(){return new Error("Invalid signature.")},Uh=function(n){return new Error("date(".concat(n.toString(),") expired."))},qh=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function Hh(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];t.indexOf(a)===-1&&(e[a]=n[a])}return e}function Nn(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=Nn(n[a],!1)+",";return i>-1&&(r+=Nn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return Nn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var l=o[a],u=Nn(n[l],!0);u!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+u),a++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function Gh(n){return String(Nn(n,!1))}function Du(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return Ls();for(var s=function(w){var E=Du(n[w]);if(E instanceof Error)return{value:E};if(!i)i=E.issuer;else if(i!==E.issuer)return{value:Os()};a?E.expire.getTime()<a.getTime()&&(a=E.expire):a=E.expire,o?o=o.filter(function(C){return E.allowHosts.indexOf(C)!==-1}):o=E.allowHosts},l=0;l<n.length;l++){var u=s(l);if(typeof u=="object")return u.value}return wn({issuer:i,expire:a,allowHosts:o})}var c=JSON.parse(n),f=typeof location!="undefined"?location.hostname:"",m=Date.now();if(typeof c!="object")return Ls();var A=new Date(typeof c.expire_at=="string"&&/^\d+$/.test(c.expire_at)?Number(c.expire_at):c.expire_at),h=Array.isArray(c.allow_hosts)?c.allow_hosts:[];if(f.length===0||cn(f)||cr.filter(function(w){return Kr(w,f)}).length>0){var p=String((t=c.certificate)!==null&&t!==void 0?t:"");if(p){var g=new He;return g.readCertPEM(p),wn({issuer:g.getSubjectString(),expire:A,allowHosts:h})}return wn({issuer:"none",expire:A,allowHosts:h})}var v=String((e=c.certificate)!==null&&e!==void 0?e:"");if(!v)return Os();var y=new He;y.readCertPEM(v);var b=String((r=c._signature)!==null&&r!==void 0?r:"");if(!b)return Vs();var x=Gh(Hh(c,["_signature"]));return Tc(x,b,y)===!1?Vs():m<A.getTime()?h.filter(function(w){return Kr(w,f)}).length===0?qh(f):wn({issuer:y.getSubjectString(),expire:A,allowHosts:h}):Uh(A)}var Ns=new d.Matrix4,Eo=new WeakMap,kn=new Set,So=function(){function n(t,e){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={work:this},this.observers=[],this.issuer="none",this.raw={works:[""],options:""},this.transform=new d.Matrix4;{var r=this;this.options={get transform(){return r.transform},set transform(a){r.transform.copy(a)}}}var i=jh(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
|
|
1032
|
+
`,uniforms:{diffuse:{value:new d.Color},size:{value:1}}},Fh=function(n){se(t,n);function t(e,r,i,a){var o=new Float32Array([e.x,e.y,e.z,r.x,r.y,r.z]),s=new Float32Array([0,1]),l=new d.BufferGeometry;l.setAttribute("position",new d.BufferAttribute(o,3)),l.setAttribute("start",new d.BufferAttribute(s,1));var u=new d.ShaderMaterial({vertexShader:ba.vertexShader,fragmentShader:ba.fragmentShader,uniforms:d.UniformsUtils.clone(ba.uniforms)});return u.uniforms.size.value=i,u.uniforms.diffuse.value.copy(a),n.call(this,l,u)||this}return t}(d.Points);function kh(n,t){var e=n.name,r=go(n.content.uri,t.search),i=lt(r,{key:"model.0"}),a=n.content.color;return n.content.loadState="LOADING",n.content.loadStateUpdateTime=he(),wo(i,{type:"geometry",fetcher:t.fetcher}).then(function(o){var s=o.scene,l=new d.ShaderMaterial({vertexShader:ya.vertexShader,fragmentShader:ya.fragmentShader,uniforms:d.UniformsUtils.clone(ya.uniforms)});l.uniforms.diffuse.value.set(a),l.uniforms.totalSize.value=.2,l.uniforms.dashSize.value=l.uniforms.totalSize.value/2;var u=new d.Line(s,l);u.computeLineDistances(),u.applyMatrix4(n.transform),u.updateWorldMatrix(!1,!0),u.matrixAutoUpdate=!1;var c=s.attributes.position.array,f=new Fh(new d.Vector3().fromArray(c,0),new d.Vector3().fromArray(c,c.length-3),12,a);f.applyMatrix4(n.transform),f.updateWorldMatrix(!1,!0),f.matrixAutoUpdate=!1;var m=new Ou(e,u,f);return n.content.data={byteLength:o.byteLength,object:m,uri:i},n.content.byteLength=o.byteLength,n.content.loadState="READY",n.content.loadStateUpdateTime=he(),n}).catch(function(o){return n.content.data=void 0,n.content.loadState="FAILED",n.content.loadStateUpdateTime=he(),n.content.loadfailRetryDelay=Math.min(n.content.loadfailRetryDelay+1e3,5e3),n.content.byteLength=0,Promise.reject(o)})}function Bs(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=he(),n.content.byteLength=0)}var Rs=new d.Vector3,Lh=new d.Matrix3,Oh=new d.Matrix4,ct=6378137,Vu=298.257223563;function Nu(n){for(var t=ct-ct/Vu,e=(ct*ct-t*t)/(ct*ct),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,a=1e3,o=0,s=Math.atan2(n.z,r),l=0;o++<a;){var u=Math.sin(s),c=ct/Math.sqrt(1-e*u*u);l=r/Math.cos(s)-c;var f=Math.atan2(n.z/(c*(1-e)+l),r/(c+l));if(isNaN(f))break;var m=Math.abs(f-s);if(m<i)break;s=f}return n.set(s,Math.atan2(n.y,n.x),l)}function Vh(n){var t=n.x,e=n.y,r=n.z,i=ct-ct/Vu,a=(ct*ct-i*i)/(ct*ct),o=Math.sin(t),s=Math.cos(t),l=Math.sin(e),u=Math.cos(e),c=ct/Math.sqrt(1-a*o*o),f=(c+r)*s*u,m=(c+r)*s*l,A=(i*i/(ct*ct)*c+r)*o;return n.set(f,m,A)}function Nh(n,t){var e=Nu(Rs.copy(n)),r=e.x,i=e.y,a=e.z,o=Math.sin(r),s=Math.sin(i),l=Math.cos(r),u=Math.cos(i);t.fromArray([-s,-o*u,l*u,0,+u,-o*s,l*s,0,0,l,o,0,0,0,0,1]);var c=Lh.setFromMatrix4(t),f=Rs.copy(n).applyMatrix3(c).multiplyScalar(-1);t.setPosition(f);var m=Oh.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return t.premultiply(m),t}var Wt={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},Fs=function(){var n=new d.MeshBasicMaterial;return n.side=d.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=Wt.TILE_MASK,n.stencilFunc=d.AlwaysStencilFunc,n.stencilFuncMask=Wt.TILE_MASK,n.stencilZPass=d.ReplaceStencilOp,n.stencilWriteMask=Wt.TILE_MASK,n}(),ks=function(){var n=new d.MeshBasicMaterial;return n.visible=!1,n}(),Dh=new d.BufferGeometry,zh=new d.MeshBasicMaterial,an=function(n){se(t,n);function t(e,r,i){var a,o,s,l=n.call(this)||this;return l.modelIndex=0,l.renderObjects=[],l.backfaceObjects=[],l.debugObjects=[],l.tileObjects=[],l.debug="none",l.name=i.name,l.type=i.type,l.upAxis=i.upAxis,l.model=e,l.fetcher=i.fetcher,l.search=(a=i.search)!==null&&a!==void 0?a:"",l.groundHeight=i.groundHeight,l.coordinateTransform=i.coordinateTransform,l.boundingBox=new d.Box3,l.idle=!1,l.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,l.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,l.needsRefined=!0,l.refined=!1,l.refineProgress=[0,0],l.loaded=!1,l.disposed=!1,l.needsRender=!0,l.lastRenderHash="",l.matrixAutoUpdate=!1,l.cacheCameras=[],l.clearStencilObject=new d.Mesh(Dh,zh),l.clearStencilObject.frustumCulled=!1,l.clearStencilObject.onAfterRender=function(u){return u.clearStencil()},l.tileset=new br((s=(o=l.model.work)===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",r,{referer:i.referer,tileLoader:function(u){return l.loadContent(u)},tileUnloader:function(u){return l.unloadContent(u)},onTileLoad:function(){},onTileUnload:function(u){},onTileError:function(u,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Tile error",u.id,c)},trajectoryLoader:function(u){return l.loadTrajectory(u)},trajectoryUnloader:function(u){return l.unloadTrajectory(u)},onTrajectoryLoad:function(){},onTrajectoryUnload:function(u){},onTrajectoryError:function(u,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Trajectory error",u,c)}}),l.tileset.root.boundingVolume&&l.tileset.root.boundingVolume.getBoundingBox(l.boundingBox),l}return t.prototype.getRenderHash=function(){return Hi([this.tileset.id,this.tileset.skipLevelOfDetail,this.tileset.selectedTiles.map(function(e){return e.id}),this.tileset.trajectories.map(function(e){return e.index}),this.debug])},Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){return this.tileset.maxMemoryUsage},set:function(e){this.tileset.maxMemoryUsage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){return this.tileset.maxRequests},set:function(e){this.tileset.maxRequests=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requestOrder",{get:function(){return this.tileset.tileRequestOrder},set:function(e){this.tileset.tileRequestOrder=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipLevelOfDetail",{get:function(){return this.tileset.skipLevelOfDetail},set:function(e){this.tileset.skipLevelOfDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mostDetail",{get:function(){return this.tileset.mostDetail},set:function(e){this.tileset.mostDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadSiblings",{get:function(){return this.tileset.loadSiblings},set:function(e){this.tileset.loadSiblings=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadAll",{get:function(){return this.tileset.loadAll},set:function(e){this.tileset.loadAll=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trajectories",{get:function(){return this.tileset.trajectories},enumerable:!1,configurable:!0}),t.prototype.localToEnu=function(e){return e.applyMatrix4(this.coordinateTransform.localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.enuToLocalMatrix)},t.prototype.localToEcef=function(e){return e.applyMatrix4(this.coordinateTransform.localToEcefMatrix)},t.prototype.ecefToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.ecefToLocalMatrix)},t.prototype.localToLla=function(e){return Nu(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal(Vh(e))},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},t.prototype.worldToEcef=function(e){return this.localToEcef(this.worldToLocal(e))},t.prototype.ecefToWorld=function(e){return this.localToWorld(this.ecefToLocal(e))},t.prototype.worldToLla=function(e){return this.localToLla(this.worldToLocal(e))},t.prototype.llaToWorld=function(e){return this.localToWorld(this.llaToLocal(e))},t.prototype.loadContent=function(e){var r=this;return Rh(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?Ja(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return Ja(e),Promise.resolve()},t.prototype.loadAllTilesets=function(){var e=this,r=function(i){var a=[];return e.tileset.root.traverse(function(o){var s;o.type==="TILESET"&&((s=o.content)===null||s===void 0?void 0:s.loadState)!=="READY"&&a.push(o)}),Promise.all(a.map(function(o){return e.loadContent(o).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.loadTrajectory=function(e){var r=this;return kh(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){r.disposed&&Bs(i)})},t.prototype.unloadTrajectory=function(e){return Bs(e),Promise.resolve()},t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=[this.tileset.root],s=this.tileset.transform,l=this.tileset.transformIsIdentity,u,c=[];u=o.pop();){var f=void 0;if(u.boundingVolume){var m=l?u.boundingVolume:u.boundingVolume.clone().applyMatrix4(s);f=m.intersectRay(e.ray,e.far)}else f=!0;if(f){for(var A=0,h=u.children.length;A<h;A++)o.push(u.children[A]);u.selected&&u.content&&u.content.data&&u.content.data.object.visible&&u.content.data.object.intersectRaycaster(e,!1,c)}}return this.model.shownFloorIndex>=0&&(c=c.filter(function(p){return p.floor===a.model.shownFloorIndex})),r&&c.sort(function(p,g){return p.distance-g.distance}),c.map(function(p){p.model=a.model,p.viewLayer=a.viewLayer}),i.push.apply(i,c),i},t.prototype.cloneSkipBackfaceObject=function(e){var r;e instanceof d.Mesh?r=new d.Mesh(e.geometry,Array.isArray(e.material)?e.material.map(function(s){return s.transparent?ks:Fs}):e.material&&e.material.transparent?ks:Fs):e instanceof d.Group?r=new d.Group:r=new d.Object3D,r.copy(e,!1);for(var i=0,a=e.children;i<a.length;i++){var o=a[i];r.add(this.cloneSkipBackfaceObject(o))}return r},t.prototype.update=function(e,r){var i,a,o,s=this,l,u,c;this.renderObjects.length=0,this.backfaceObjects.length=0,this.debugObjects.length=0,this.tileObjects.length=0,this.renderer=e,this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset();var f=this.tileset.frameNumber+1,m=this.visible,A=Math.max(this.maxLevelOfDetail,0),h=Math.min(this.minLevelOfDetail,A),p=Math.max(h,0),g={time:he(),camera:{type:r.type,position:new d.Vector3().copy(r.position),direction:r.getDirection(new d.Vector3),near:r.near,far:r.far,up:new d.Vector3().copy(r.up).applyQuaternion(r.quaternion),visible:r.visible,refine:r.refineModel},minLevelOfDetail:h,maxLevelOfDetail:m&&!this.idle&&this.loaded?A:p,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:f,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new Hn().setFromCamera(r)},v=this.cacheCameras.map(function(ee){return k(k({},g),{camera:{type:r.type,position:new d.Vector3().copy(ee.position),direction:ee.getWorldDirection(new d.Vector3),near:r.near,far:r.far,up:new d.Vector3().copy(ee.up),visible:ee.visible,refine:!0},cullingVolume:new Hn().setFromCamera(ee)})});this.tileset.update(g,v),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(ee){if(s.refineProgress[1]++,ee.content){var Z=ee.content.loadState;if(Z==="UNLOADED"||Z==="LOADING"){s.refined=!1;return}}s.refineProgress[0]++}),this.loaded===!1&&this.tileset.selectedTiles.length>0&&this.tileset.needsRefinedTiles.size>0&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(ee){if(s.loaded!==!1){if(s.tileset.skipLevelOfDetail){if(ee.state.finalResolution&&ee.content){var Z=ee.state.ancestorWithContentAvailable,ie=Z&&Z.content?Z.content:ee.content,te=ie.loadState;(te==="UNLOADED"||te==="LOADING")&&(s.loaded=!1)}}else if(ee.state.visible&&ee.content&&ee.levelOfContent<=0){var te=ee.content.loadState;(te==="UNLOADED"||te==="LOADING")&&(s.loaded=!1)}}}),this.loaded===!0&&(this.refined=!1,this.refineProgress[1]++)),this.remove.apply(this,this.children),this.tileset.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(ee,Z){return ee.floor-Z.floor}),this.debug==="root-bounding-volume"&&this.tileset.root.boundingVolumeDebugObject&&this.debugObjects.push(this.tileset.root.boundingVolumeDebugObject);for(var y=0,b=this.tileset.selectedTiles;y<b.length;y++){var x=b[y];this.debug==="selected-bounding-volume"&&x.boundingVolumeDebugObject&&this.debugObjects.push(x.boundingVolumeDebugObject);var w=(u=(l=x.content)===null||l===void 0?void 0:l.data)===null||u===void 0?void 0:u.object;if(w){if(w.update(e,r,this.model,x),this.tileset.hasMixedContent&&this.tileset.skipLevelOfDetail){if(!x.state.finalResolution){var E=this.cloneSkipBackfaceObject(w);this.backfaceObjects.push(E)}for(var M=x.state.selectionDepth,C=Wt.TILE_MASK|M<<Wt.SKIP_LOD_BIT_SHIFT,R=d.GreaterEqualStencilFunc,L=Wt.SKIP_LOD_MASK,S=d.ReplaceStencilOp,I=Wt.TILE_MASK|Wt.SKIP_LOD_MASK,O=0,P=w.materials;O<P.length;O++){var F=P[O];F.stencilWrite=!0,F.stencilRef=C,F.stencilFunc=R,F.stencilFuncMask=L,F.stencilZPass=S,F.stencilWriteMask=I}}else for(var V=0,D=w.materials;V<D.length;V++){var F=D[V];F.stencilWrite=!1,F.stencilRef=Wt.TILE_MASK,F.stencilFunc=d.AlwaysStencilFunc,F.stencilFuncMask=Wt.TILE_MASK,F.stencilZPass=d.ReplaceStencilOp,F.stencilWriteMask=Wt.TILE_MASK}this.tileObjects.push(w)}}this.tileset.skipLevelOfDetail&&this.backfaceObjects.length&&(i=this.renderObjects).push.apply(i,this.backfaceObjects),this.tileObjects.length&&(a=this.renderObjects).push.apply(a,this.tileObjects),this.tileset.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var z=0,U=this.tileset.selectedTrajectories;z<U.length;z++){var q=U[z],K=(c=q.content.data)===null||c===void 0?void 0:c.object;K&&(K.update(e,r,this.model),this.renderObjects.push(K))}this.debug&&(o=this.renderObjects).push.apply(o,this.debugObjects);for(var j=this.modelIndex*1e4,J=function(ee){var Z=X.renderObjects[ee],ie=ee+j;Z.traverse(function(te){(te instanceof d.Mesh||te instanceof d.Line||te instanceof d.Points)&&(te.renderOrder=ie)}),X.add(Z)},X=this,Y=0;Y<this.renderObjects.length;Y++)J(Y);var W=this.getRenderHash();this.lastRenderHash!==W&&(this.needsRender=!0,this.lastRenderHash=W)},t.prototype.dispose=function(){this.disposed=!0,this.viewLayer=void 0,this.tileset.reset(),this.remove.apply(this,this.children),this.refineProgress[0]=0,this.refineProgress[1]=0,this.refined=!1,this.loaded=!1},t.DEFAULT_MIN_LEVEL_OF_DETAIL=0,t.DEFAULT_MAX_LEVEL_OF_DETAIL=20,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=br.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=br.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_MOST_DETAIL=br.DEFAULT_MOST_DETAIL,t.DEFAULT_LOAD_SIBLINGS=br.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_LOAD_ALL=br.DEFAULT_LOAD_ALL,t.DEFAULT_MAX_REQUESTS=br.DEFAULT_MAX_REQUESTS,t.DEFAULT_REQUEST_ORDER=br.DEFAULT_REQUEST_ORDER,t}(d.Object3D);function Qh(n){return-((n-.25)*360+90)/180*Math.PI}function Xa(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var e,r,i;if(Array.isArray(n)){if(e=n.length,e!=t.length)return!1;for(r=e;r--!==0;)if(!Xa(n[r],t[r]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),e=i.length,e!==Object.keys(t).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=e;r--!==0;){var a=i[r];if(!Xa(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Jt(n){return typeof n=="number"}var Ls=function(){return new Error("Invalid input.")},Os=function(){return new Error("Invalid certificate.")},Vs=function(){return new Error("Invalid signature.")},Uh=function(n){return new Error("date(".concat(n.toString(),") expired."))},qh=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function Hh(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];t.indexOf(a)===-1&&(e[a]=n[a])}return e}function Nn(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=Nn(n[a],!1)+",";return i>-1&&(r+=Nn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return Nn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var l=o[a],u=Nn(n[l],!0);u!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+u),a++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function Gh(n){return String(Nn(n,!1))}function Du(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return Ls();for(var s=function(w){var E=Du(n[w]);if(E instanceof Error)return{value:E};if(!i)i=E.issuer;else if(i!==E.issuer)return{value:Os()};a?E.expire.getTime()<a.getTime()&&(a=E.expire):a=E.expire,o?o=o.filter(function(M){return E.allowHosts.indexOf(M)!==-1}):o=E.allowHosts},l=0;l<n.length;l++){var u=s(l);if(typeof u=="object")return u.value}return wn({issuer:i,expire:a,allowHosts:o})}var c=JSON.parse(n),f=typeof location!="undefined"?location.hostname:"",m=Date.now();if(typeof c!="object")return Ls();var A=new Date(typeof c.expire_at=="string"&&/^\d+$/.test(c.expire_at)?Number(c.expire_at):c.expire_at),h=Array.isArray(c.allow_hosts)?c.allow_hosts:[];if(f.length===0||cn(f)||cr.filter(function(w){return Kr(w,f)}).length>0){var p=String((t=c.certificate)!==null&&t!==void 0?t:"");if(p){var g=new He;return g.readCertPEM(p),wn({issuer:g.getSubjectString(),expire:A,allowHosts:h})}return wn({issuer:"none",expire:A,allowHosts:h})}var v=String((e=c.certificate)!==null&&e!==void 0?e:"");if(!v)return Os();var y=new He;y.readCertPEM(v);var b=String((r=c._signature)!==null&&r!==void 0?r:"");if(!b)return Vs();var x=Gh(Hh(c,["_signature"]));return Tc(x,b,y)===!1?Vs():m<A.getTime()?h.filter(function(w){return Kr(w,f)}).length===0?qh(f):wn({issuer:y.getSubjectString(),expire:A,allowHosts:h}):Uh(A)}var Ns=new d.Matrix4,Eo=new WeakMap,kn=new Set,So=function(){function n(t,e){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={work:this},this.observers=[],this.issuer="none",this.raw={works:[""],options:""},this.transform=new d.Matrix4;{var r=this;this.options={get transform(){return r.transform},set transform(a){r.transform.copy(a)}}}var i=jh(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
|
|
1033
1033
|
Error work input:
|
|
1034
|
-
`+JSON.stringify(t))}return n.prototype.toJSON=function(){return this.raw},n.parse=jn,n}();function Ds(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Wa(n,t){var e=Ds(n),r=Ds(t);if(r==="null")return n;if(r==="value")return t;if(r!==e)return JSON.parse(JSON.stringify(t));if(r==="array")for(var i=0;i<t.length;i++)n[i]=Wa(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Wa(n[a],t[a]);return n}function Co(n,t){return n.indexOf(t)===0}function Mo(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=Xo("".concat(a)).slice(0,7);a="".concat(a,".").concat(o,".jsonp")}if(r.shortPath===!0){var s=a.replace(n,"").split("."),l=(i=s.shift())!==null&&i!==void 0?i:"",u=s.join(".");a=at(n,Xo(l))+(u?"."+u:"")}var c=a.replace(n,"");return r.baseURL&&(a=at(r.baseURL,c)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:c,type:e}),a}function tt(n,t,e,r,i){var a=e;return Cr(e)||(t&&(t=at(t,String(r))),a=at(t,a)),Cr(a)||(a=at(n,a)),Co(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),Mo(n,a,"panorama",i)}function Ln(n,t,e){var r=t;return Cr(r)||(r=at(n,t)),Co(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),Mo(n,r,"model",e)}function pi(n,t,e,r){var i=t;return Cr(i)||(i=at(e,i)),Cr(i)||(i=at(n,i)),Co(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),Mo(n,i,"texture",r)}var zs=function(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null},Kh=function(n){n=n.slice().sort(function(o,s){return o.level-s.level});for(var t=[],e=0,r=n;e<r.length;e++){var i=r[e];if(t.length===0){t.push(i);continue}var a=t[t.length-1];if(i.level>a.level){t.push(i);continue}if(i.size>a.size){t[t.length-1]=i;continue}}return t};function jh(n,t,e){for(var r,i,a,o,s,l,u,c,f,m,A,h,p,g,v,y,b,x,w,E=JSON.stringify(t),C=[],M=0,R=[].concat(n);M<R.length;M++){var L=R[M];L instanceof So?C.push.apply(C,L.raw.works):typeof L=="string"?C.push(L):C.push(JSON.stringify(L))}var S=Du(C);if(S instanceof Error)return S;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=C.map(function(re){return JSON.parse(re)}).reduce(function(re,ae){return Wa(re,ae)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:C,options:E}}});{var I;if(t.workCode&&(typeof t.workCode=="string"?I=t.workCode:typeof t.workCode=="function"&&(I=t.workCode(n))),typeof I=="undefined"&&(I=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof I=="undefined")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return I}})}{var O=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return O}})}if(S instanceof Error)return S;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return S.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return S.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return S.allowHosts}});var P=(r=n.base_url)!==null&&r!==void 0?r:"";if(P&&P[P.length-1]!=="/"&&(P+="/"),S instanceof Error)return S;if(n.model){var F={work:e,layers:[]},V;n.model.file?V=Ln(P,n.model.file,t):n.model.file_url&&(V=Ln(P,n.model.file_url,t)),Object.defineProperty(F,"file",{configurable:!1,get:function(){return V}});var D;n.model.textureBase?D=pi(P,"",n.model.textureBase,t):n.model.material_base_url?D=pi(P,"",n.model.material_base_url,t):F.file&&(D=F.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(F,"textureBase",{configurable:!1,get:function(){return D}});var z;Array.isArray(n.model.textures)?(z=n.model.textures.map(function(re){var ae,H;return pi(P,re,(H=(ae=n.model.textureBase)!==null&&ae!==void 0?ae:n.model.material_base_url)!==null&&H!==void 0?H:"",t)}),Object.freeze(z)):Array.isArray(n.model.material_textures)&&(z=n.model.material_textures.map(function(re){var ae,H;return pi(P,re,(H=(ae=n.model.textureBase)!==null&&ae!==void 0?ae:n.model.material_base_url)!==null&&H!==void 0?H:"",t)}),Object.freeze(z)),Object.defineProperty(F,"textures",{configurable:!1,get:function(){return z}});var U=[];if(Array.isArray(n.model.tiles))for(var q=0,K=n.model.tiles;q<K.length;q++){var j=K[q];j&&(j.tileset||j.tileset_url)&&U.push(Object.freeze({type:(i=j.type)!==null&&i!==void 0?i:"mesh",name:(a=j.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=j.upAxis)!==null&&o!==void 0?o:j.up_axis)!==null&&s!==void 0?s:"-Y",tileset:Ln(P,j.tileset||j.tileset_url,t)}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&U.push(Object.freeze({type:(l=n.model.tiles.type)!==null&&l!==void 0?l:"mesh",name:(u=n.model.tiles.name)!==null&&u!==void 0?u:"lod",upAxis:(f=(c=n.model.tiles.upAxis)!==null&&c!==void 0?c:n.model.tiles.up_axis)!==null&&f!==void 0?f:"-Y",tileset:Ln(P,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var J=0,X=n.model.layers;J<X.length;J++){var Y=X[J];Y&&(Y.tileset||Y.tileset_url)&&U.push(Object.freeze({type:(m=Y.type)!==null&&m!==void 0?m:"mesh",name:(A=Y.name)!==null&&A!==void 0?A:"",upAxis:(h=Y.upAxis)!==null&&h!==void 0?h:Y.up_axis,tileset:Ln(P,Y.tileset||Y.tileset_url,t)}))}Object.freeze(U),Object.defineProperty(F,"layers",{configurable:!1,get:function(){return U}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(F.file||F.layers.length)return F}})}if(S instanceof Error)return S;var W=new Set,ee=new Set;{var Z=[];if(n.observers&&Array.isArray(n.observers)){var ie=[];n.panorama&&(Array.isArray(n.panorama)?ie=n.panorama:Array.isArray(n.panorama.list)?ie=n.panorama.list:Array.isArray(n.panorama.info)&&(ie=n.panorama.info));for(var te=function(re){var ae={},H=n.observers[re];if(!H)return"break";var Ve=ie[re];if(!Ve)return"break";H=Object.assign({},H,Ve,{active:H.active!==!1&&Ve.active!==!1}),Object.defineProperty(ae,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(ae,"index",{configurable:!1,get:function(){return re}}),ee.add(re),Object.defineProperty(ae,"panoIndex",{configurable:!1,get:function(){return re}});var Fe=De({workCode:e.workCode,panoIndex:re});W.add(Fe),Object.defineProperty(ae,"panoId",{configurable:!1,get:function(){return Fe}});var Ie=Object.freeze({workCode:e.workCode,panoIndex:re});Object.defineProperty(ae,"pano",{configurable:!1,get:function(){return Ie}});var Ge=H.active!==!1;Object.defineProperty(ae,"active",{configurable:!1,get:function(){return Ge}});var be=H.loadable===!0;Object.defineProperty(ae,"loadable",{configurable:!1,get:function(){return be}});var ve=H.derived_id;Object.defineProperty(ae,"derivedId",{configurable:!1,get:function(){return ve}});var xe=H.derived_id_str;Object.defineProperty(ae,"derivedIdStr",{configurable:!1,get:function(){return xe}});var ye=(x=(y=(g=(p=n.panorama)===null||p===void 0?void 0:p.pano_high_cube_base_url)!==null&&g!==void 0?g:(v=n.panorama)===null||v===void 0?void 0:v.pano_cube_base_url)!==null&&y!==void 0?y:(b=n.panorama)===null||b===void 0?void 0:b.base_url)!==null&&x!==void 0?x:"",me={up:tt(P,ye,H.images?H.images.up:H.up,re,t),down:tt(P,ye,H.images?H.images.down:H.down,re,t),right:tt(P,ye,H.images?H.images.right:H.right,re,t),left:tt(P,ye,H.images?H.images.left:H.left,re,t),front:tt(P,ye,H.images?H.images.front:H.front,re,t),back:tt(P,ye,H.images?H.images.back:H.back,re,t)};if(H.size_list)me.sizeList=H.size_list.slice();else{var Qe=Jn(me.up);if(Qe&&(me.sizeList=[Qe],H.tiles))for(var Ke=H.tiles.slice().sort(function(qe,nt){return qe-nt}).map(function(qe){return 512*Math.pow(2,qe)}),rt=0,Xr=Ke;rt<Xr.length;rt++){var ke=Xr[rt];ke>Qe&&me.sizeList.push(ke)}}var Ze=H.images?H.images.luminance:H.luminance;Ze&&(me.luminance=Object.freeze({up:tt(P,ye,Ze.up,re,t),down:tt(P,ye,Ze.down,re,t),right:tt(P,ye,Ze.right,re,t),left:tt(P,ye,Ze.left,re,t),front:tt(P,ye,Ze.front,re,t),back:tt(P,ye,Ze.back,re,t)}));var st=void 0;if(H.images)st=H.images.tiles;else if(Array.isArray(H.size_list)){var tr=H.size_list.slice().sort(function(qe,nt){return qe-nt});if(tr[0]){var fn=zs(tr[0]);if(fn)for(var rr=fn-1;rr>=0;rr--)tr.unshift(512*Math.pow(2,rr));st=tr}}else Array.isArray(H.tiles)&&(st=H.tiles.slice(),typeof st[0]=="number"&&(st=st.sort(function(qe,nt){return qe-nt}).map(function(qe){return 512*Math.pow(2,qe)})));if(st){for(var Pt=[],nr=0,Mr=st;nr<Mr.length;nr++){var ke=Mr[nr];if(typeof ke=="number"){var qt=zs(ke);if(typeof qt!="number")continue;var ir=Jn(me.front);if(!ir)continue;if(ke>ir){var Ht=Ot(me.up,ke),ft=Ot(me.down,ke),Le=Ot(me.right,ke),hr=Ot(me.left,ke),gt=Ot(me.front,ke),pr=Ot(me.back,ke);Pt.push(Object.freeze({level:qt,size:ke,scale:1,up:Ht,down:ft,right:Le,left:hr,front:gt,back:pr}))}else{var Ht=me.up,ft=me.down,Le=me.right,hr=me.left,gt=me.front,pr=me.back;Pt.push(Object.freeze({level:qt,size:ir,scale:ke/ir,up:Ht,down:ft,right:Le,left:hr,front:gt,back:pr}))}}else{var qt=ke.level;if(typeof qt!="number")continue;var Qe=ke.size;if(typeof Qe!="number")continue;var Ht=tt(P,ye,ke.up,re,t),ft=tt(P,ye,ke.down,re,t),Le=tt(P,ye,ke.right,re,t),hr=tt(P,ye,ke.left,re,t),gt=tt(P,ye,ke.front,re,t),pr=tt(P,ye,ke.back,re,t);Pt.push(Object.freeze({level:qt,size:Qe,scale:(w=ke.scale)!==null&&w!==void 0?w:1,up:Ht,down:ft,right:Le,left:hr,front:gt,back:pr}))}}Pt=Kh(Pt),Object.freeze(Pt),Object.defineProperty(me,"tiles",{configurable:!1,get:function(){return Pt}})}Object.freeze(me),Object.defineProperty(ae,"images",{configurable:!1,get:function(){return me}});var vr=new d.Vector3;if(H.position instanceof d.Vector3)vr.copy(H.position);else if(Array.isArray(H.position))vr.fromArray(H.position);else return"break";Object.freeze(vr),Object.defineProperty(ae,"position",{configurable:!1,get:function(){return vr}});var Gt=new d.Vector3;if(H.standingPosition instanceof d.Vector3)Gt.copy(H.standingPosition);else if(Array.isArray(H.standingPosition))Gt.fromArray(H.standingPosition);else if(H.standing_position instanceof d.Vector3)Gt.copy(H.standing_position);else if(Array.isArray(H.standing_position))Gt.fromArray(H.standing_position);else return"break";Object.freeze(Gt),Object.defineProperty(ae,"standingPosition",{configurable:!1,get:function(){return Gt}});var Ct=new d.Quaternion;if(H.quaternion instanceof d.Quaternion)Ct.copy(H.quaternion);else if(Array.isArray(H.quaternion))Ct.fromArray(H.quaternion);else if(H.quaternion){var mr=H.quaternion,Ir=mr.x,hn=mr.y,Wr=mr.z,Zr=mr.w;Ct.set(Ir,hn,Wr,Zr)}else return"break";Object.freeze(Ct),Object.defineProperty(ae,"quaternion",{configurable:!1,get:function(){return Ct}});var Kt=0;Jt(H.floorIndex)?Kt=H.floorIndex:Jt(H.floor_index)?Kt=H.floor_index:Jt(H.floor)&&(Kt=H.floor),Object.defineProperty(ae,"floorIndex",{configurable:!1,get:function(){return Kt}});var Ye;H.video&&(Ye={},typeof H.video.source=="string"&&(Ye.source=H.video.source),H.video.matrix instanceof d.Matrix4?Ye.matrix=H.video.matrix.clone():Array.isArray(H.video.matrix)&&(Ye.matrix=new d.Matrix4().fromArray(H.video.matrix)),H.video.size instanceof d.Vector2?Ye.size=H.video.size.clone():Array.isArray(H.video.size)&&(Ye.size=new d.Vector2().fromArray(H.video.size)),Ye.source&&Ye.matrix&&Ye.size&&(ae.video=Ye)),Object.freeze(Ye),Object.defineProperty(ae,"video",{configurable:!1,get:function(){return Ye}}),Array.isArray(H.accessibleNodes)?(ae.accessibleNodes=H.accessibleNodes.slice(),ae.accessibleIds=H.accessibleNodes.map(function(qe){return De({workCode:e.workCode,panoIndex:qe})})):Array.isArray(H.accessible_nodes)&&(ae.accessibleNodes=H.accessible_nodes.slice(),ae.accessibleIds=H.accessible_nodes.map(function(qe){return De({workCode:e.workCode,panoIndex:qe})})),Array.isArray(H.visibleNodes)?(ae.visibleNodes=H.visibleNodes.slice(),ae.visibleIds=H.visibleNodes.map(function(qe){return De({workCode:e.workCode,panoIndex:qe})})):Array.isArray(H.visible_nodes)&&(ae.visibleNodes=H.visible_nodes.slice(),ae.visibleIds=H.visible_nodes.map(function(qe){return De({workCode:e.workCode,panoIndex:qe})})),Z[re]=ae},le=0;le<n.observers.length;le++){var oe=te(le);if(oe==="break")break}}for(var we=function(re){if(re.accessibleIds){var Ve=re.accessibleIds.filter(function(ye){return W.has(ye)});Object.freeze(Ve),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return Ve}})}else{for(var ae=[],H=0;H<Z.length;H++)Z[H]!==re&&(Math.abs(Z[H].position.y-re.position.y)>3||Z[H].position.distanceTo(re.position)>10||ae.push(Z[H].panoId));Object.freeze(ae),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return ae}})}if(re.accessibleNodes){var Ie=re.accessibleNodes.filter(function(ye){return ee.has(ye)});Object.freeze(Ie),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return Ie}})}else{for(var Fe=[],H=0;H<Z.length;H++)Z[H]!==re&&(Math.abs(Z[H].position.y-re.position.y)>3||Z[H].position.distanceTo(re.position)>10||Fe.push(Z[H].panoIndex));Object.freeze(Fe),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return Fe}})}if(re.visibleIds){var be=re.visibleIds.filter(function(ye){return W.has(ye)});Object.freeze(be),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return be}})}else{var Ge=re.accessibleIds.slice();Object.freeze(Ge),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return Ge}})}if(re.visibleNodes){var xe=re.visibleNodes.filter(function(ye){return ee.has(ye)});Object.freeze(xe),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return xe}})}else{var ve=re.accessibleNodes.slice();Object.freeze(ve),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return ve}})}},pe=0,ge=Z;pe<ge.length;pe++){var Re=ge[pe];we(Re)}Object.freeze(Z),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return Z}})}if(S instanceof Error)return S;if(n.initial){if((n.initial.mode==="Panorama"&&e.observers.length===0||n.initial.mode==="Floorplan"||n.initial.mode==="Topview"||n.initial.mode==="Model"||n.initial.mode==="Mapview"||n.initial.mode==="DepthPanorama")&&(e.initial.mode=n.initial.mode),Jt(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),Jt(n.initial.longitude)?e.initial.longitude=n.initial.longitude:Jt(n.initial.heading)&&(e.initial.longitude=Qh(n.initial.heading)),Jt(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var Se=void 0;Jt(n.initial.panoIndex)?Se=n.initial.panoIndex:Jt(n.initial.pano_index)?Se=n.initial.pano_index:Jt(n.initial.pano)&&(Se=n.initial.pano),typeof Se=="number"&&(Se=fe(Se,0,e.observers.length-1),e.initial.panoIndex=Se)}if(Jt(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Te=[0,0,0].map(function(re,ae){var H=Number(n.initial.offset[ae]);return isNaN(H)||!isFinite(H)?0:H});e.initial.offset=new d.Vector3().fromArray(Te)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return S instanceof Error?S:(Eo.set(e,{works:C,options:E}),e)}function jn(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=Eo.get(n);if(e){if(t&&!Xa(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new So(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
|
|
1034
|
+
`+JSON.stringify(t))}return n.prototype.toJSON=function(){return this.raw},n.parse=jn,n}();function Ds(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Wa(n,t){var e=Ds(n),r=Ds(t);if(r==="null")return n;if(r==="value")return t;if(r!==e)return JSON.parse(JSON.stringify(t));if(r==="array")for(var i=0;i<t.length;i++)n[i]=Wa(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Wa(n[a],t[a]);return n}function Mo(n,t){return n.indexOf(t)===0}function Co(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=Xo("".concat(a)).slice(0,7);a="".concat(a,".").concat(o,".jsonp")}if(r.shortPath===!0){var s=a.replace(n,"").split("."),l=(i=s.shift())!==null&&i!==void 0?i:"",u=s.join(".");a=at(n,Xo(l))+(u?"."+u:"")}var c=a.replace(n,"");return r.baseURL&&(a=at(r.baseURL,c)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:c,type:e}),a}function tt(n,t,e,r,i){var a=e;return Mr(e)||(t&&(t=at(t,String(r))),a=at(t,a)),Mr(a)||(a=at(n,a)),Mo(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),Co(n,a,"panorama",i)}function Ln(n,t,e){var r=t;return Mr(r)||(r=at(n,t)),Mo(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),Co(n,r,"model",e)}function pi(n,t,e,r){var i=t;return Mr(i)||(i=at(e,i)),Mr(i)||(i=at(n,i)),Mo(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),Co(n,i,"texture",r)}var zs=function(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null},Kh=function(n){n=n.slice().sort(function(o,s){return o.level-s.level});for(var t=[],e=0,r=n;e<r.length;e++){var i=r[e];if(t.length===0){t.push(i);continue}var a=t[t.length-1];if(i.level>a.level){t.push(i);continue}if(i.size>a.size){t[t.length-1]=i;continue}}return t};function jh(n,t,e){for(var r,i,a,o,s,l,u,c,f,m,A,h,p,g,v,y,b,x,w,E=JSON.stringify(t),M=[],C=0,R=[].concat(n);C<R.length;C++){var L=R[C];L instanceof So?M.push.apply(M,L.raw.works):typeof L=="string"?M.push(L):M.push(JSON.stringify(L))}var S=Du(M);if(S instanceof Error)return S;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=M.map(function(re){return JSON.parse(re)}).reduce(function(re,ae){return Wa(re,ae)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:M,options:E}}});{var I;if(t.workCode&&(typeof t.workCode=="string"?I=t.workCode:typeof t.workCode=="function"&&(I=t.workCode(n))),typeof I=="undefined"&&(I=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof I=="undefined")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return I}})}{var O=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return O}})}if(S instanceof Error)return S;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return S.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return S.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return S.allowHosts}});var P=(r=n.base_url)!==null&&r!==void 0?r:"";if(P&&P[P.length-1]!=="/"&&(P+="/"),S instanceof Error)return S;if(n.model){var F={work:e,layers:[]},V;n.model.file?V=Ln(P,n.model.file,t):n.model.file_url&&(V=Ln(P,n.model.file_url,t)),Object.defineProperty(F,"file",{configurable:!1,get:function(){return V}});var D;n.model.textureBase?D=pi(P,"",n.model.textureBase,t):n.model.material_base_url?D=pi(P,"",n.model.material_base_url,t):F.file&&(D=F.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(F,"textureBase",{configurable:!1,get:function(){return D}});var z;Array.isArray(n.model.textures)?(z=n.model.textures.map(function(re){var ae,H;return pi(P,re,(H=(ae=n.model.textureBase)!==null&&ae!==void 0?ae:n.model.material_base_url)!==null&&H!==void 0?H:"",t)}),Object.freeze(z)):Array.isArray(n.model.material_textures)&&(z=n.model.material_textures.map(function(re){var ae,H;return pi(P,re,(H=(ae=n.model.textureBase)!==null&&ae!==void 0?ae:n.model.material_base_url)!==null&&H!==void 0?H:"",t)}),Object.freeze(z)),Object.defineProperty(F,"textures",{configurable:!1,get:function(){return z}});var U=[];if(Array.isArray(n.model.tiles))for(var q=0,K=n.model.tiles;q<K.length;q++){var j=K[q];j&&(j.tileset||j.tileset_url)&&U.push(Object.freeze({type:(i=j.type)!==null&&i!==void 0?i:"mesh",name:(a=j.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=j.upAxis)!==null&&o!==void 0?o:j.up_axis)!==null&&s!==void 0?s:"-Y",tileset:Ln(P,j.tileset||j.tileset_url,t)}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&U.push(Object.freeze({type:(l=n.model.tiles.type)!==null&&l!==void 0?l:"mesh",name:(u=n.model.tiles.name)!==null&&u!==void 0?u:"lod",upAxis:(f=(c=n.model.tiles.upAxis)!==null&&c!==void 0?c:n.model.tiles.up_axis)!==null&&f!==void 0?f:"-Y",tileset:Ln(P,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var J=0,X=n.model.layers;J<X.length;J++){var Y=X[J];Y&&(Y.tileset||Y.tileset_url)&&U.push(Object.freeze({type:(m=Y.type)!==null&&m!==void 0?m:"mesh",name:(A=Y.name)!==null&&A!==void 0?A:"",upAxis:(h=Y.upAxis)!==null&&h!==void 0?h:Y.up_axis,tileset:Ln(P,Y.tileset||Y.tileset_url,t)}))}Object.freeze(U),Object.defineProperty(F,"layers",{configurable:!1,get:function(){return U}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(F.file||F.layers.length)return F}})}if(S instanceof Error)return S;var W=new Set,ee=new Set;{var Z=[];if(n.observers&&Array.isArray(n.observers)){var ie=[];n.panorama&&(Array.isArray(n.panorama)?ie=n.panorama:Array.isArray(n.panorama.list)?ie=n.panorama.list:Array.isArray(n.panorama.info)&&(ie=n.panorama.info));for(var te=function(re){var ae={},H=n.observers[re];if(!H)return"break";var Ve=ie[re];if(!Ve)return"break";H=Object.assign({},H,Ve,{active:H.active!==!1&&Ve.active!==!1}),Object.defineProperty(ae,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(ae,"index",{configurable:!1,get:function(){return re}}),ee.add(re),Object.defineProperty(ae,"panoIndex",{configurable:!1,get:function(){return re}});var Fe=De({workCode:e.workCode,panoIndex:re});W.add(Fe),Object.defineProperty(ae,"panoId",{configurable:!1,get:function(){return Fe}});var Ie=Object.freeze({workCode:e.workCode,panoIndex:re});Object.defineProperty(ae,"pano",{configurable:!1,get:function(){return Ie}});var Ge=H.active!==!1;Object.defineProperty(ae,"active",{configurable:!1,get:function(){return Ge}});var be=H.loadable===!0;Object.defineProperty(ae,"loadable",{configurable:!1,get:function(){return be}});var ve=H.derived_id;Object.defineProperty(ae,"derivedId",{configurable:!1,get:function(){return ve}});var xe=H.derived_id_str;Object.defineProperty(ae,"derivedIdStr",{configurable:!1,get:function(){return xe}});var ye=(x=(y=(g=(p=n.panorama)===null||p===void 0?void 0:p.pano_high_cube_base_url)!==null&&g!==void 0?g:(v=n.panorama)===null||v===void 0?void 0:v.pano_cube_base_url)!==null&&y!==void 0?y:(b=n.panorama)===null||b===void 0?void 0:b.base_url)!==null&&x!==void 0?x:"",me={up:tt(P,ye,H.images?H.images.up:H.up,re,t),down:tt(P,ye,H.images?H.images.down:H.down,re,t),right:tt(P,ye,H.images?H.images.right:H.right,re,t),left:tt(P,ye,H.images?H.images.left:H.left,re,t),front:tt(P,ye,H.images?H.images.front:H.front,re,t),back:tt(P,ye,H.images?H.images.back:H.back,re,t)};if(H.size_list)me.sizeList=H.size_list.slice();else{var Qe=Jn(me.up);if(Qe&&(me.sizeList=[Qe],H.tiles))for(var Ke=H.tiles.slice().sort(function(qe,nt){return qe-nt}).map(function(qe){return 512*Math.pow(2,qe)}),rt=0,Xr=Ke;rt<Xr.length;rt++){var ke=Xr[rt];ke>Qe&&me.sizeList.push(ke)}}var Ze=H.images?H.images.luminance:H.luminance;Ze&&(me.luminance=Object.freeze({up:tt(P,ye,Ze.up,re,t),down:tt(P,ye,Ze.down,re,t),right:tt(P,ye,Ze.right,re,t),left:tt(P,ye,Ze.left,re,t),front:tt(P,ye,Ze.front,re,t),back:tt(P,ye,Ze.back,re,t)}));var st=void 0;if(H.images)st=H.images.tiles;else if(Array.isArray(H.size_list)){var tr=H.size_list.slice().sort(function(qe,nt){return qe-nt});if(tr[0]){var fn=zs(tr[0]);if(fn)for(var rr=fn-1;rr>=0;rr--)tr.unshift(512*Math.pow(2,rr));st=tr}}else Array.isArray(H.tiles)&&(st=H.tiles.slice(),typeof st[0]=="number"&&(st=st.sort(function(qe,nt){return qe-nt}).map(function(qe){return 512*Math.pow(2,qe)})));if(st){for(var Pt=[],nr=0,Cr=st;nr<Cr.length;nr++){var ke=Cr[nr];if(typeof ke=="number"){var qt=zs(ke);if(typeof qt!="number")continue;var ir=Jn(me.front);if(!ir)continue;if(ke>ir){var Ht=Ot(me.up,ke),ft=Ot(me.down,ke),Le=Ot(me.right,ke),hr=Ot(me.left,ke),gt=Ot(me.front,ke),pr=Ot(me.back,ke);Pt.push(Object.freeze({level:qt,size:ke,scale:1,up:Ht,down:ft,right:Le,left:hr,front:gt,back:pr}))}else{var Ht=me.up,ft=me.down,Le=me.right,hr=me.left,gt=me.front,pr=me.back;Pt.push(Object.freeze({level:qt,size:ir,scale:ke/ir,up:Ht,down:ft,right:Le,left:hr,front:gt,back:pr}))}}else{var qt=ke.level;if(typeof qt!="number")continue;var Qe=ke.size;if(typeof Qe!="number")continue;var Ht=tt(P,ye,ke.up,re,t),ft=tt(P,ye,ke.down,re,t),Le=tt(P,ye,ke.right,re,t),hr=tt(P,ye,ke.left,re,t),gt=tt(P,ye,ke.front,re,t),pr=tt(P,ye,ke.back,re,t);Pt.push(Object.freeze({level:qt,size:Qe,scale:(w=ke.scale)!==null&&w!==void 0?w:1,up:Ht,down:ft,right:Le,left:hr,front:gt,back:pr}))}}Pt=Kh(Pt),Object.freeze(Pt),Object.defineProperty(me,"tiles",{configurable:!1,get:function(){return Pt}})}Object.freeze(me),Object.defineProperty(ae,"images",{configurable:!1,get:function(){return me}});var vr=new d.Vector3;if(H.position instanceof d.Vector3)vr.copy(H.position);else if(Array.isArray(H.position))vr.fromArray(H.position);else return"break";Object.freeze(vr),Object.defineProperty(ae,"position",{configurable:!1,get:function(){return vr}});var Gt=new d.Vector3;if(H.standingPosition instanceof d.Vector3)Gt.copy(H.standingPosition);else if(Array.isArray(H.standingPosition))Gt.fromArray(H.standingPosition);else if(H.standing_position instanceof d.Vector3)Gt.copy(H.standing_position);else if(Array.isArray(H.standing_position))Gt.fromArray(H.standing_position);else return"break";Object.freeze(Gt),Object.defineProperty(ae,"standingPosition",{configurable:!1,get:function(){return Gt}});var Mt=new d.Quaternion;if(H.quaternion instanceof d.Quaternion)Mt.copy(H.quaternion);else if(Array.isArray(H.quaternion))Mt.fromArray(H.quaternion);else if(H.quaternion){var mr=H.quaternion,Ir=mr.x,hn=mr.y,Wr=mr.z,Zr=mr.w;Mt.set(Ir,hn,Wr,Zr)}else return"break";Object.freeze(Mt),Object.defineProperty(ae,"quaternion",{configurable:!1,get:function(){return Mt}});var Kt=0;Jt(H.floorIndex)?Kt=H.floorIndex:Jt(H.floor_index)?Kt=H.floor_index:Jt(H.floor)&&(Kt=H.floor),Object.defineProperty(ae,"floorIndex",{configurable:!1,get:function(){return Kt}});var Ye;H.video&&(Ye={},typeof H.video.source=="string"&&(Ye.source=H.video.source),H.video.matrix instanceof d.Matrix4?Ye.matrix=H.video.matrix.clone():Array.isArray(H.video.matrix)&&(Ye.matrix=new d.Matrix4().fromArray(H.video.matrix)),H.video.size instanceof d.Vector2?Ye.size=H.video.size.clone():Array.isArray(H.video.size)&&(Ye.size=new d.Vector2().fromArray(H.video.size)),Ye.source&&Ye.matrix&&Ye.size&&(ae.video=Ye)),Object.freeze(Ye),Object.defineProperty(ae,"video",{configurable:!1,get:function(){return Ye}}),Array.isArray(H.accessibleNodes)?(ae.accessibleNodes=H.accessibleNodes.slice(),ae.accessibleIds=H.accessibleNodes.map(function(qe){return De({workCode:e.workCode,panoIndex:qe})})):Array.isArray(H.accessible_nodes)&&(ae.accessibleNodes=H.accessible_nodes.slice(),ae.accessibleIds=H.accessible_nodes.map(function(qe){return De({workCode:e.workCode,panoIndex:qe})})),Array.isArray(H.visibleNodes)?(ae.visibleNodes=H.visibleNodes.slice(),ae.visibleIds=H.visibleNodes.map(function(qe){return De({workCode:e.workCode,panoIndex:qe})})):Array.isArray(H.visible_nodes)&&(ae.visibleNodes=H.visible_nodes.slice(),ae.visibleIds=H.visible_nodes.map(function(qe){return De({workCode:e.workCode,panoIndex:qe})})),Z[re]=ae},le=0;le<n.observers.length;le++){var oe=te(le);if(oe==="break")break}}for(var we=function(re){if(re.accessibleIds){var Ve=re.accessibleIds.filter(function(ye){return W.has(ye)});Object.freeze(Ve),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return Ve}})}else{for(var ae=[],H=0;H<Z.length;H++)Z[H]!==re&&(Math.abs(Z[H].position.y-re.position.y)>3||Z[H].position.distanceTo(re.position)>10||ae.push(Z[H].panoId));Object.freeze(ae),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return ae}})}if(re.accessibleNodes){var Ie=re.accessibleNodes.filter(function(ye){return ee.has(ye)});Object.freeze(Ie),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return Ie}})}else{for(var Fe=[],H=0;H<Z.length;H++)Z[H]!==re&&(Math.abs(Z[H].position.y-re.position.y)>3||Z[H].position.distanceTo(re.position)>10||Fe.push(Z[H].panoIndex));Object.freeze(Fe),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return Fe}})}if(re.visibleIds){var be=re.visibleIds.filter(function(ye){return W.has(ye)});Object.freeze(be),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return be}})}else{var Ge=re.accessibleIds.slice();Object.freeze(Ge),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return Ge}})}if(re.visibleNodes){var xe=re.visibleNodes.filter(function(ye){return ee.has(ye)});Object.freeze(xe),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return xe}})}else{var ve=re.accessibleNodes.slice();Object.freeze(ve),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return ve}})}},pe=0,ge=Z;pe<ge.length;pe++){var Re=ge[pe];we(Re)}Object.freeze(Z),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return Z}})}if(S instanceof Error)return S;if(n.initial){if((n.initial.mode==="Panorama"&&e.observers.length===0||n.initial.mode==="Floorplan"||n.initial.mode==="Topview"||n.initial.mode==="Model"||n.initial.mode==="Mapview"||n.initial.mode==="DepthPanorama")&&(e.initial.mode=n.initial.mode),Jt(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),Jt(n.initial.longitude)?e.initial.longitude=n.initial.longitude:Jt(n.initial.heading)&&(e.initial.longitude=Qh(n.initial.heading)),Jt(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var Se=void 0;Jt(n.initial.panoIndex)?Se=n.initial.panoIndex:Jt(n.initial.pano_index)?Se=n.initial.pano_index:Jt(n.initial.pano)&&(Se=n.initial.pano),typeof Se=="number"&&(Se=fe(Se,0,e.observers.length-1),e.initial.panoIndex=Se)}if(Jt(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Te=[0,0,0].map(function(re,ae){var H=Number(n.initial.offset[ae]);return isNaN(H)||!isFinite(H)?0:H});e.initial.offset=new d.Vector3().fromArray(Te)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return S instanceof Error?S:(Eo.set(e,{works:M,options:E}),e)}function jn(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=Eo.get(n);if(e){if(t&&!Xa(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new So(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
|
|
1035
1035
|
Error work input:
|
|
1036
|
-
`+JSON.stringify(n))}}function Za(n){for(var t={},e=[],r={},i=0,a=n;i<a.length;i++){var o=a[i],s=t[o.workCode];s||(s=t[o.workCode]=new d.Matrix4().copy(o.transform));for(var l=0,u=o.observers;l<u.length;l++){var c=u[l],f={isResolved:!0,active:c.active,accessibleIds:c.accessibleIds,visibleIds:c.visibleIds,accessibleNodes:c.accessibleNodes,visibleNodes:c.visibleNodes,floorIndex:c.floorIndex,images:c.images,index:c.index,panoIndex:c.panoIndex,loadable:c.loadable,panoId:c.panoId,pano:c.pano,work:c.work,derivedId:c.derivedId,video:c.video,position:new d.Vector3().copy(c.position).applyMatrix4(s),standingPosition:new d.Vector3().copy(c.standingPosition).applyMatrix4(s),quaternion:new d.Quaternion().setFromRotationMatrix(Ns.makeRotationFromQuaternion(c.quaternion).premultiply(s))};Object.freeze(f),e.push(f),r[f.panoId]=f}}Object.freeze(e);for(var m=n.slice(),A={},h=0,p=m;h<p.length;h++){var o=p[h];A[o.workCode]=o}return Object.freeze(Object.assign(m,{get initial(){return m.length>0?m[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(g){return A[g]},getResolvedObserver:function(g){var v,y;return O0(g)?r[g]:typeof g=="number"?r[De({workCode:(y=(v=n[0])===null||v===void 0?void 0:v.workCode)!==null&&y!==void 0?y:"",panoIndex:g})]:r[De(g)]},update:function(){for(var g=0,v=m;g<v.length;g++){var y=v[g],b=y.transform,x=t[y.workCode];x?x.equals(b)||(x.copy(b),kn.add(y.workCode)):(t[y.workCode]=new d.Matrix4().copy(b),kn.add(y.workCode))}if(kn.size>0){for(var w=0,E=e;w<E.length;w++){var C=E[w];if(kn.has(C.work.workCode)){var M=C.work.observers[C.index],R=C.work.transform;C.position.copy(M.position).applyMatrix4(R),C.standingPosition.copy(M.standingPosition).applyMatrix4(R),C.quaternion.setFromRotationMatrix(Ns.makeRotationFromQuaternion(M.quaternion).premultiply(R))}}kn.clear()}}}))}var zu=new Map;function it(n){var t=zu.get(n);if(t)return t;throw new Error("fetcher never registered.")}function _h(n,t){return zu.set(n,t)}var Qs={computeTangents:function(n){var t=n.index,e=n.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");return}var r=t.array,i=e.position.array,a=e.normal.array,o=e.uv.array,s=i.length/3;e.tangent===void 0&&n.setAttribute("tangent",new d.BufferAttribute(new Float32Array(4*s),4));for(var l=e.tangent.array,u=[],c=[],f=0;f<s;f++)u[f]=new d.Vector3,c[f]=new d.Vector3;var m=new d.Vector3,A=new d.Vector3,h=new d.Vector3,p=new d.Vector2,g=new d.Vector2,v=new d.Vector2,y=new d.Vector3,b=new d.Vector3;function x(q,K,j){m.fromArray(i,q*3),A.fromArray(i,K*3),h.fromArray(i,j*3),p.fromArray(o,q*2),g.fromArray(o,K*2),v.fromArray(o,j*2);var J=A.x-m.x,X=h.x-m.x,Y=A.y-m.y,W=h.y-m.y,ee=A.z-m.z,Z=h.z-m.z,ie=g.x-p.x,te=v.x-p.x,le=g.y-p.y,oe=v.y-p.y,we=1/(ie*oe-te*le);y.set((oe*J-le*X)*we,(oe*Y-le*W)*we,(oe*ee-le*Z)*we),b.set((ie*X-te*J)*we,(ie*W-te*Y)*we,(ie*Z-te*ee)*we),u[q].add(y),u[K].add(y),u[j].add(y),c[q].add(b),c[K].add(b),c[j].add(b)}var w=n.groups;w.length===0&&(w=[{start:0,count:r.length}]);for(var f=0,E=w.length;f<E;++f)for(var C=w[f],M=C.start,R=C.count,L=M,S=M+R;L<S;L+=3)x(r[L+0],r[L+1],r[L+2]);var I=new d.Vector3,O=new d.Vector3,P=new d.Vector3,F=new d.Vector3,V,D,z;function U(q){P.fromArray(a,q*3),F.copy(P),D=u[q],I.copy(D),I.sub(P.multiplyScalar(P.dot(D))).normalize(),O.crossVectors(F,D),z=O.dot(c[q]),V=z<0?-1:1,l[q*4]=I.x,l[q*4+1]=I.y,l[q*4+2]=I.z,l[q*4+3]=V}for(var f=0,E=w.length;f<E;++f)for(var C=w[f],M=C.start,R=C.count,L=M,S=M+R;L<S;L+=3)U(r[L+0]),U(r[L+1]),U(r[L+2])},mergeBufferGeometries:function(n,t){for(var e=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),i=new Set(Object.keys(n[0].morphAttributes)),a={},o={},s=new d.BufferGeometry,l=0,u=0;u<n.length;++u){var c=n[u];if(e!==(c.index!==null))return null;for(var f in c.attributes){if(!r.has(f))return null;a[f]===void 0&&(a[f]=[]),a[f].push(c.attributes[f])}for(var f in c.morphAttributes){if(!i.has(f))return null;o[f]===void 0&&(o[f]=[]),o[f].push(c.morphAttributes[f])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(c.userData),t){var m;if(e)m=c.index.count;else if(c.attributes.position!==void 0)m=c.attributes.position.count;else return null;s.addGroup(l,m,u),l+=m}}if(e){for(var A=0,h=[],u=0;u<n.length;++u){for(var p=n[u].index,g=0;g<p.count;++g)h.push(p.getX(g)+A);A+=n[u].attributes.position.count}s.setIndex(h)}for(var f in a){var v=this.mergeBufferAttributes(a[f]);if(!v)return null;s.setAttribute(f,v)}for(var f in o){var y=o[f][0].length;if(y===0)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[f]=[];for(var u=0;u<y;++u){for(var b=[],g=0;g<o[f].length;++g)b.push(o[f][g][u]);var x=this.mergeBufferAttributes(b);if(!x)return null;s.morphAttributes[f].push(x)}}return s},mergeBufferAttributes:function(n){for(var t,e,r,i=0,a=0;a<n.length;++a){var o=n[a];if(o.isInterleavedBufferAttribute||(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)||(e===void 0&&(e=o.itemSize),e!==o.itemSize)||(r===void 0&&(r=o.normalized),r!==o.normalized))return null;i+=o.array.length}for(var s=new t(i),l=0,a=0;a<n.length;++a)s.set(n[a].array,l),l+=n[a].array.length;return new d.BufferAttribute(s,e,r)},interleaveAttributes:function(n){for(var t,e=0,r=0,i=0,a=n.length;i<a;++i){var o=n[i];if(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;e+=o.array.length,r+=o.itemSize}for(var s=new d.InterleavedBuffer(new t(e),r),l=0,u=[],c=["getX","getY","getZ","getW"],f=["setX","setY","setZ","setW"],m=0,a=n.length;m<a;m++){var o=n[m],A=o.itemSize,h=o.count,p=new d.InterleavedBufferAttribute(s,A,l,o.normalized);u.push(p),l+=A;for(var g=0;g<h;g++)for(var v=0;v<A;v++)p[f[v]](g,o[c[v]](g))}return u},estimateBytesUsed:function(n){var t=0;for(var e in n.attributes){var r=n.getAttribute(e);t+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}var i=n.getIndex();return t+=i?i.count*i.itemSize*i.array.BYTES_PER_ELEMENT:0,t},mergeVertices:function(n,t){t===void 0&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var e={},r=n.getIndex(),i=n.getAttribute("position"),a=r?r.count:i.count,o=0,s=Object.keys(n.attributes),l={},u={},c=[],f=["getX","getY","getZ","getW"],m=0,A=s.length;m<A;m++){var h=s[m];l[h]=[];var p=n.morphAttributes[h];p&&(u[h]=new Array(p.length).fill().map(function(){return[]}))}for(var g=Math.log10(1/t),v=Math.pow(10,g),m=0;m<a;m++){for(var y=r?r.getX(m):m,b="",x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),E=w.itemSize,C=0;C<E;C++)b+="".concat(~~(w[f[C]](y)*v),",");if(b in e)c.push(e[b]);else{for(var x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),p=n.morphAttributes[h],E=w.itemSize,M=l[h],R=u[h],C=0;C<E;C++){var L=f[C];if(M.push(w[L](y)),p)for(var S=0,I=p.length;S<I;S++)R[S].push(p[S][L](y))}e[b]=o,c.push(o),o++}}for(var O=n.clone(),m=0,A=s.length;m<A;m++){var h=s[m],P=n.getAttribute(h),F=new P.array.constructor(l[h]),w=new d.BufferAttribute(F,P.itemSize,P.normalized);if(O.setAttribute(h,w),h in u)for(var x=0;x<u[h].length;x++){var V=n.morphAttributes[h][x],F=new V.array.constructor(u[h][x]),D=new d.BufferAttribute(F,V.itemSize,V.normalized);O.morphAttributes[h][x]=D}}return O.setIndex(c),O}};function Ya(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function Xn(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var Zt=new d.Vector3,xa=new d.Sphere,wa=new d.Matrix4,Us=new d.Matrix4,qs=new d.Box3,Si=new d.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Ci=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),Qu=new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5));function Hs(n,t,e){switch(n){case"Z":break;case"Y":e.copy(Ci);break;case"-Y":e.copy(Si);break;case"WGS84":case"GCJ02":case"BD09":Nh(t,e);break;default:e.identity();break}return e}function Jh(n){var t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(n);if(t){var e=String(t[1]).trim().split(".").slice(1).reverse()[0];if(e)return e}return""}var Mi=function(){function n(t,e){this.scene=t,this.error=e,t.viewLayer=this}return Object.defineProperty(n.prototype,"name",{get:function(){return this.scene.name},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.scene.type},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"upAxis",{get:function(){return this.scene.upAxis},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"groundHeight",{get:function(){return this.scene.groundHeight},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.scene.model},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinates",{get:function(){Zt.setScalar(0);var t=this.scene.localToLla(Zt),e=t.x,r=t.y;return[e,r].map(function(i){return(i/Math.PI*180).toFixed(6)}).join(",")},enumerable:!1,configurable:!0}),n.prototype.getTransformMatrix4=function(t){return t===void 0&&(t=new d.Matrix4),t.copy(this.scene.coordinateTransform.ecefToLocalMatrix),this.scene&&t.premultiply(this.scene.matrixWorld),t},n.prototype.coordinatesToWorldPoint=function(t){var e=new d.Vector3(t.latitude,t.longitude,t.altitude);return this.scene.llaToWorld(e)},n.prototype.worldPointToCoordinates=function(t){return Zt.copy(t),this.scene.worldToLla(Zt),{latitude:Zt.x,longitude:Zt.y,altitude:Zt.z}},n}(),$a=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o=n.call(this)||this;return o.name="",o.onError=(r=e.onError)!==null&&r!==void 0?r:Q,o.onShownFloorChange=(i=e.onShownFloorChange)!==null&&i!==void 0?i:Q,o.onLoad=(a=e.onLoad)!==null&&a!==void 0?a:Q,o.work=null,o.viewLayers=[],o.bounding=new d.Box3(new d.Vector3,new d.Vector3),o.floorLength=0,o.textureOptions={},o.refined=!1,o.refineProgress=[0,0],o.loaded=!1,o.matrixAutoUpdate=!1,o.needsRender=!0,o.autoRefine=!0,o.materialVersion=0,o.materialParameters=k({},Ae),o.cacheCameras=[],o.disposed=!1,o}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.viewLayers.length===0},enumerable:!1,configurable:!0}),t.prototype.getMaterial=function(){return k({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=V0(this.materialParameters,e);if(i){var a=this.materialParameters.shownFloorIndex;r!==a&&this.onShownFloorChange(a),this.materialVersion++,this.needsRender=!0}},Object.defineProperty(t.prototype,"brightness",{get:function(){return this.materialParameters.brightness},set:function(e){this.setMaterial({brightness:typeof e=="number"?e:1})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloorIndex",{get:function(){return this.materialParameters.shownFloorIndex},set:function(e){this.setMaterial({shownFloorIndex:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloor",{get:function(){return this.shownFloorIndex===-1?null:this.shownFloorIndex},set:function(e){this.shownFloorIndex=e===null?-1:e},enumerable:!1,configurable:!0}),t.prototype.show=function(e){this.shownFloor=e!=null?e:null},Object.defineProperty(t.prototype,"clippers",{get:function(){return this.materialParameters.clippers},set:function(e){this.setMaterial({clippers:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"customShaders",{get:function(){return this.materialParameters.customShaders},set:function(e){this.setMaterial({customShaders:e})},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,r){r===void 0&&(r=30/180*Math.PI);for(var i=Math.cos(r),a=[],o=0,s=this.children;o<s.length;o++){var l=s[o];l instanceof an&&l.tileset.selectedTiles.forEach(function(u){var c,f,m;if(!(u.boundingVolume&&u.boundingVolume.distanceToPoint(e.center)>e.radius)){var A=(f=(c=u.content)===null||c===void 0?void 0:c.data)===null||f===void 0?void 0:f.object;if(A&&A.visible){var h=[];if(A.traverseVisible(function(j){if(j instanceof d.Mesh){var J=_d.get(j);if(J){wa.copy(j.matrixWorld),Us.getInverse(wa),xa.copy(e).applyMatrix4(Us);var X=J.trianglesInSphere(xa.center,xa.radius),Y=new d.BufferGeometry;Y.setAttribute("position",new d.BufferAttribute(X,3)),Y.applyMatrix4(j.matrixWorld),Y=Qs.mergeVertices(Y,.01),h.push(Y)}}}),h.length===0)return;for(var p=["a","b","c"],g=Qs.mergeBufferGeometries(h,!1),v=g.getAttribute("position").array,y=((m=g.getIndex())===null||m===void 0?void 0:m.array)||[],b=[],x=[],w=0,E=v.length;w<E;w+=3){var C=new d.Vector3(v[w],v[w+1],v[w+2]);b.push(C)}for(var w=0,E=y.length;w<E;w+=3){var M=y[w],R=y[w+1],L=y[w+2],S=new d.Vector3().crossVectors(b[R].clone().sub(b[M]),b[L].clone().sub(b[M])).normalize();x.push({a:M,b:R,c:L,normal:S})}for(var I={},w=0,E=x.length;w<E;w++)for(var O=x[w],P=0;P<3;P++){var F=O[p[P]],V=O[p[(P+1)%3]],D=[Math.min(F,V),Math.max(F,V)],z=D[0]+"-"+D[1];I[z]===void 0?I[z]={index1:D[0],index2:D[1],face1:w}:I[z].face2=w}for(var z in I){var U=I[z];if(U.face2===void 0||x[U.face1].normal.dot(x[U.face2].normal)<=i){var q=b[U.index1],K=b[U.index2];a.push(new d.Line3(q,K))}}b.length=0,x.length=0}}})}return a},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=null),i===void 0&&(i=!0);for(var a=[],o=0,s=this.children.length;o<s;o++){var l=this.children[o];l.visible&&l instanceof an&&l.intersectRaycaster(e,!1,a)}return r!=null&&(a=a.filter(function(u){return u.floor===r})),this.getMaterial().pointBack==="HIDDEN"&&(a=a.filter(function(u){return!(u.object instanceof er&&u.face&&u.face.normal.angleTo(e.ray.direction)<Math.PI/2)})),i&&a.sort(function(u,c){return u.distance-c.distance}),a},t.prototype.load=function(e,r){var i,a=this,o,s,l,u;if(r===void 0&&(r={}),this.work=e,this.name=this.work.workCode,!e.model)return Promise.resolve();for(var c=e.model,f=0,m=0,A=e.observers;m<A.length;m++){var h=A[m];f=Math.max(f,h.floorIndex)}this.floorLength=f+1;for(var p=!1,g=[],v=function(U){var q=U.tileset,K=U.upAxis,j=U.name,J=U.type;J==="mesh"&&(p=!0);var X=q.split("#"),Y=X[0],W=X[1],ee=(o=(W||Y).split("?")[1])!==null&&o!==void 0?o:"",Z=it(e).ajax(q,{responseType:"text"}).then(function(ie){var te,le,oe,we=q?q.slice(0,q.lastIndexOf("/")+1):"",pe=Ei(JSON.parse(ie.body),we),ge=pe.root,Re=pe.rootMeta,Se=Re===void 0?{}:Re;Se.upAxis&&Se.upAxis!==K&&(K=Se.upAxis),"lodVersion"in pe&&(K="-Y","floorInfo"in pe&&(pe.properties=pe.properties||{},pe.properties.floorInfo=pe.floorInfo.map(function(xe){return{ground:-xe.ground,height:xe.height}}),delete pe.floorInfo),pe.asset.tilesetVersion=String(pe.lodVersion),delete pe.lodVersion);var Te=ge.boundingVolume?xi(ge.boundingVolume):void 0;Te&&ge.transform&&Te.applyMatrix4(wa.fromArray(ge.transform));var re=null,ae=new d.Matrix4,H=new d.Matrix4;Se.coordinate?(re=Se.coordinate.ground_height,ae.fromArray(Se.coordinate.pose_ecef_to_enu),H.fromArray(Se.coordinate.pose_enu_to_ecef)):(Te?Te.getCenter(Zt):Zt.setScalar(0),Hs(K,Zt,ae),H.getInverse(ae));var Ve=new d.Matrix4().copy(Si),Fe=new d.Matrix4().copy(Ci),Ie=new d.Matrix4().premultiply(ae).premultiply(Ve),Ge=new d.Matrix4().getInverse(Ie);pe.root={refine:(te=ge.refine)!==null&&te!==void 0?te:"REPLACE",geometricError:ge.geometricError,transform:Ie.toArray(),boundingVolume:Te?Te.toJson():void 0,viewerRequestVolume:!((le=r["3d-tiles"])===null||le===void 0)&&le.viewerRequestVolume?(oe=r["3d-tiles"])===null||oe===void 0?void 0:oe.viewerRequestVolume.toJson():void 0,children:[ge]};var be=new an(a,pe,{name:j,type:J,upAxis:K,url:q,referer:q,search:ee,fetcher:it(e),groundHeight:re,coordinateTransform:{localToEnuMatrix:Fe,enuToLocalMatrix:Ve,enuToEcefMatrix:H,ecefToEnuMatrix:ae,localToEcefMatrix:Ge,ecefToLocalMatrix:Ie}});if(be.matrix.copy(e.transform),be.matrix.decompose(be.position,be.quaternion,be.scale),be.matrixWorldNeedsUpdate=!0,r["3d-tiles"]){var ve=r["3d-tiles"];typeof ve.debug!="undefined"&&(be.debug=ve.debug),typeof ve.minLevelOfDetail!="undefined"&&(be.minLevelOfDetail=ve.minLevelOfDetail),typeof ve.maxLevelOfDetail!="undefined"&&(be.maxLevelOfDetail=ve.maxLevelOfDetail),typeof ve.skipLevelOfDetail!="undefined"&&(be.skipLevelOfDetail=ve.skipLevelOfDetail),typeof ve.mostDetail!="undefined"&&(be.mostDetail=ve.mostDetail),typeof ve.loadSiblings!="undefined"&&(be.loadSiblings=ve.loadSiblings),typeof ve.loadAll!="undefined"&&(be.loadAll=ve.loadAll),typeof ve.maxMemoryUsage!="undefined"&&(be.maxMemoryUsage=ve.maxMemoryUsage),typeof ve.maxRequests!="undefined"&&(be.maxRequests=ve.maxRequests),typeof ve.requestOrder!="undefined"&&(be.requestOrder=ve.requestOrder),typeof ve.maxScreenSpaceError!="undefined"&&(be.maxScreenSpaceError=ve.maxScreenSpaceError)}return new Mi(be,null)});g.push(Z.catch(function(ie){a.onError(ie);var te=new d.Matrix4,le=new d.Matrix4,oe=new d.Matrix4().copy(Si),we=new d.Matrix4().copy(Ci),pe=new d.Matrix4().premultiply(te).premultiply(oe),ge=new d.Matrix4().getInverse(pe),Re=q?q.slice(0,q.lastIndexOf("/")+1):"",Se=Ei({asset:{version:"0.0"},geometricError:0,root:{geometricError:0}},Re),Te=new an(a,Se,{name:j,type:J,upAxis:K,url:q,referer:q,search:ee,fetcher:it(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:we,enuToLocalMatrix:oe,enuToEcefMatrix:le,ecefToEnuMatrix:te,localToEcefMatrix:ge,ecefToLocalMatrix:pe},onError:a.onError});return new Mi(Te,ie)}))},y=0,b=c.layers;y<b.length;y++){var x=b[y];v(x)}if(!p&&c.file){var w=c.file,E=c.textureBase,C=c.textures,M=Jh(w)||"at3d",R=M==="dome"||M==="domez"?"Y":"Z",L=new d.Matrix4,S=new d.Matrix4,I=new d.Matrix4().copy(Si),O=new d.Matrix4().copy(Ci);Hs(R,Zt.setScalar(0),L),S.getInverse(L);var P=new d.Matrix4().premultiply(L).premultiply(I),F=new d.Matrix4().getInverse(P),V=Ei({asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:P.toArray(),viewerRequestVolume:!((s=r["3d-tiles"])===null||s===void 0)&&s.viewerRequestVolume?(l=r["3d-tiles"])===null||l===void 0?void 0:l.viewerRequestVolume.toJson():void 0,content:{uri:w},extras:(i={},i[M]={textureBaseUri:E,textureArray:C,textureOptions:(u=r.textureOptions)!==null&&u!==void 0?u:{}},i)}},""),D=new an(this,V,{name:"fallback",type:"mesh",upAxis:R,url:"",referer:w,fetcher:it(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:O,enuToLocalMatrix:I,enuToEcefMatrix:S,ecefToEnuMatrix:L,localToEcefMatrix:F,ecefToLocalMatrix:P},onError:this.onError});D.matrix.copy(e.transform),D.matrix.decompose(D.position,D.quaternion,D.scale),D.matrixWorldNeedsUpdate=!0;var z=new Mi(D,null);g.push(Promise.resolve(z))}return Promise.all(g).then(function(U){for(var q,K=[],j=[],J=[],X=0,Y=U;X<Y.length;X++){var W=Y[X];if(a.viewLayers.push(W),a.disposed){W.scene.dispose();continue}switch(a.add(W.scene),W.scene.visible=!1,W.scene.type){case"mesh":K.push(W.scene);break;case"point_cloud":j.push(W.scene);break;default:J.push(W.scene);break}}K.length?K[0].visible=!0:j.length?j[0].visible=!0:J.length&&(J[0].visible=!0);var ee=(q=r["3d-tiles"])===null||q===void 0?void 0:q.showLayers;if(typeof ee=="boolean")for(var Z=0,ie=U;Z<ie.length;Z++){var W=ie[Z];W.scene&&(W.scene.visible=ee)}else if(Array.isArray(ee))for(var te=0,le=U;te<le.length;te++){var W=le[te];W.scene&&(W.scene.visible=ee.indexOf(W.scene.name)!==-1)}})},t.prototype.update=function(e,r,i){if(this.children.length){var a=this.loaded;this.refined=this.work!==null,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=this.work!==null;for(var o=0,s=this.viewLayers;o<s.length;o++){var l=s[o],u=l.scene;u&&(this.work&&(u.idle=this.materialParameters.modelAlpha<=0,u.cacheCameras=this.cacheCameras,this.autoRefine===!1?u.needsRefined=!1:Xn(i)?u.needsRefined=this.materialParameters.modelAlpha===0||this.materialParameters.modelAlpha===1:u.needsRefined=!0,this.work.transform.equals(u.matrix)||(u.matrix.copy(this.work.transform),u.matrix.decompose(u.position,u.quaternion,u.scale),u.matrixWorldNeedsUpdate=!0)),u.update(e,r),u.needsRender===!0&&(u.needsRender=!1,this.needsRender=!0),u.refined===!1&&(this.refined=!1),this.refineProgress[0]+=u.refineProgress[0],this.refineProgress[1]+=u.refineProgress[1],u.loaded===!1&&(this.loaded=!1))}this.bounding.makeEmpty();for(var c=0,f=this.viewLayers;c<f.length;c++){var l=f[c],u=l.scene;u&&(u.boundingBox.isEmpty()||(qs.copy(u.boundingBox).applyMatrix4(u.matrix),this.bounding.union(qs)))}this.bounding.isEmpty()&&this.bounding.copy(Qu),a===!1&&this.loaded===!0&&this.onLoad()}else this.work&&!this.work.model?(this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!0):(this.refined=!1,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!1),this.bounding.set(new d.Vector3,new d.Vector3)},t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)e instanceof an&&e.dispose(),this.remove(e)},t}(d.Object3D);function Gs(){var n=new d.Box3,t=nh(Ae,["clippers","shownFloorIndex","brightness","customShaders"]),e=Object.assign([],{bounding:n,needsRender:!1,refined:!1,refineProgress:[0,0],loaded:!1,materialVersion:0,cacheCameras:[],autoUpdate:!0,intersectRaycaster:function(r,i,a){a===void 0&&(a=!0);var o;if(e.length===1)o=e[0].intersectRaycaster(r,i,a);else if(e.length===0)o=[];else{o=[];for(var s=0,l=e;s<l.length;s++){var u=l[s];if(u.visible){var c=u.intersectRaycaster(r,i,!1);c.length&&o.push.apply(o,c)}}a&&o.sort(function(f,m){return f.distance-m.distance})}return o},setMaterial:function(r){var i=V0(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return k({},t)},resetBrightness:function(){for(var r=0,i=e;r<i.length;r++){var a=i[r];a.setMaterial({brightness:1})}},update:function(r,i,a){if(e.autoUpdate!==!1){e.refined=e.length>0,e.loaded=e.length>0,e.refineProgress[0]=0,e.refineProgress[1]=0,n.makeEmpty();for(var o=0,s=e.cacheCameras;o<s.length;o++){var l=s[o];l.updateMatrixWorld(!0),l.updateProjectionMatrix()}for(var u=0,c=0,f=e;c<f.length;c++){for(var m=f[c],A=0,h=m.viewLayers;A<h.length;A++){var p=h[A];p.scene.modelIndex=u++}m.setMaterial(t),m.cacheCameras=e.cacheCameras,m.update(r,i,a),m.needsRender===!0&&(e.needsRender=!0,m.needsRender=!1),m.refined===!1&&(e.refined=!1),e.refineProgress[0]+=m.refineProgress[0],e.refineProgress[1]+=m.refineProgress[1],m.loaded===!1&&(e.loaded=!1),n.union(m.bounding)}n.isEmpty()&&n.copy(Qu)}}});return e}var Ks=function(n){return n*(2-n)},Xh=function(){var n=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),e=new Uint8Array([0,2,1,2,3,1]),r=new d.BufferGeometry;return r.setAttribute("position",new d.BufferAttribute(n,3)),r.setAttribute("uv",new d.BufferAttribute(t,2)),r.setIndex(new d.BufferAttribute(e,1)),r}(),Wh=`
|
|
1036
|
+
`+JSON.stringify(n))}}function Za(n){for(var t={},e=[],r={},i=0,a=n;i<a.length;i++){var o=a[i],s=t[o.workCode];s||(s=t[o.workCode]=new d.Matrix4().copy(o.transform));for(var l=0,u=o.observers;l<u.length;l++){var c=u[l],f={isResolved:!0,active:c.active,accessibleIds:c.accessibleIds,visibleIds:c.visibleIds,accessibleNodes:c.accessibleNodes,visibleNodes:c.visibleNodes,floorIndex:c.floorIndex,images:c.images,index:c.index,panoIndex:c.panoIndex,loadable:c.loadable,panoId:c.panoId,pano:c.pano,work:c.work,derivedId:c.derivedId,video:c.video,position:new d.Vector3().copy(c.position).applyMatrix4(s),standingPosition:new d.Vector3().copy(c.standingPosition).applyMatrix4(s),quaternion:new d.Quaternion().setFromRotationMatrix(Ns.makeRotationFromQuaternion(c.quaternion).premultiply(s))};Object.freeze(f),e.push(f),r[f.panoId]=f}}Object.freeze(e);for(var m=n.slice(),A={},h=0,p=m;h<p.length;h++){var o=p[h];A[o.workCode]=o}return Object.freeze(Object.assign(m,{get initial(){return m.length>0?m[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(g){return A[g]},getResolvedObserver:function(g){var v,y;return O0(g)?r[g]:typeof g=="number"?r[De({workCode:(y=(v=n[0])===null||v===void 0?void 0:v.workCode)!==null&&y!==void 0?y:"",panoIndex:g})]:r[De(g)]},update:function(){for(var g=0,v=m;g<v.length;g++){var y=v[g],b=y.transform,x=t[y.workCode];x?x.equals(b)||(x.copy(b),kn.add(y.workCode)):(t[y.workCode]=new d.Matrix4().copy(b),kn.add(y.workCode))}if(kn.size>0){for(var w=0,E=e;w<E.length;w++){var M=E[w];if(kn.has(M.work.workCode)){var C=M.work.observers[M.index],R=M.work.transform;M.position.copy(C.position).applyMatrix4(R),M.standingPosition.copy(C.standingPosition).applyMatrix4(R),M.quaternion.setFromRotationMatrix(Ns.makeRotationFromQuaternion(C.quaternion).premultiply(R))}}kn.clear()}}}))}var zu=new Map;function it(n){var t=zu.get(n);if(t)return t;throw new Error("fetcher never registered.")}function _h(n,t){return zu.set(n,t)}var Qs={computeTangents:function(n){var t=n.index,e=n.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");return}var r=t.array,i=e.position.array,a=e.normal.array,o=e.uv.array,s=i.length/3;e.tangent===void 0&&n.setAttribute("tangent",new d.BufferAttribute(new Float32Array(4*s),4));for(var l=e.tangent.array,u=[],c=[],f=0;f<s;f++)u[f]=new d.Vector3,c[f]=new d.Vector3;var m=new d.Vector3,A=new d.Vector3,h=new d.Vector3,p=new d.Vector2,g=new d.Vector2,v=new d.Vector2,y=new d.Vector3,b=new d.Vector3;function x(q,K,j){m.fromArray(i,q*3),A.fromArray(i,K*3),h.fromArray(i,j*3),p.fromArray(o,q*2),g.fromArray(o,K*2),v.fromArray(o,j*2);var J=A.x-m.x,X=h.x-m.x,Y=A.y-m.y,W=h.y-m.y,ee=A.z-m.z,Z=h.z-m.z,ie=g.x-p.x,te=v.x-p.x,le=g.y-p.y,oe=v.y-p.y,we=1/(ie*oe-te*le);y.set((oe*J-le*X)*we,(oe*Y-le*W)*we,(oe*ee-le*Z)*we),b.set((ie*X-te*J)*we,(ie*W-te*Y)*we,(ie*Z-te*ee)*we),u[q].add(y),u[K].add(y),u[j].add(y),c[q].add(b),c[K].add(b),c[j].add(b)}var w=n.groups;w.length===0&&(w=[{start:0,count:r.length}]);for(var f=0,E=w.length;f<E;++f)for(var M=w[f],C=M.start,R=M.count,L=C,S=C+R;L<S;L+=3)x(r[L+0],r[L+1],r[L+2]);var I=new d.Vector3,O=new d.Vector3,P=new d.Vector3,F=new d.Vector3,V,D,z;function U(q){P.fromArray(a,q*3),F.copy(P),D=u[q],I.copy(D),I.sub(P.multiplyScalar(P.dot(D))).normalize(),O.crossVectors(F,D),z=O.dot(c[q]),V=z<0?-1:1,l[q*4]=I.x,l[q*4+1]=I.y,l[q*4+2]=I.z,l[q*4+3]=V}for(var f=0,E=w.length;f<E;++f)for(var M=w[f],C=M.start,R=M.count,L=C,S=C+R;L<S;L+=3)U(r[L+0]),U(r[L+1]),U(r[L+2])},mergeBufferGeometries:function(n,t){for(var e=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),i=new Set(Object.keys(n[0].morphAttributes)),a={},o={},s=new d.BufferGeometry,l=0,u=0;u<n.length;++u){var c=n[u];if(e!==(c.index!==null))return null;for(var f in c.attributes){if(!r.has(f))return null;a[f]===void 0&&(a[f]=[]),a[f].push(c.attributes[f])}for(var f in c.morphAttributes){if(!i.has(f))return null;o[f]===void 0&&(o[f]=[]),o[f].push(c.morphAttributes[f])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(c.userData),t){var m;if(e)m=c.index.count;else if(c.attributes.position!==void 0)m=c.attributes.position.count;else return null;s.addGroup(l,m,u),l+=m}}if(e){for(var A=0,h=[],u=0;u<n.length;++u){for(var p=n[u].index,g=0;g<p.count;++g)h.push(p.getX(g)+A);A+=n[u].attributes.position.count}s.setIndex(h)}for(var f in a){var v=this.mergeBufferAttributes(a[f]);if(!v)return null;s.setAttribute(f,v)}for(var f in o){var y=o[f][0].length;if(y===0)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[f]=[];for(var u=0;u<y;++u){for(var b=[],g=0;g<o[f].length;++g)b.push(o[f][g][u]);var x=this.mergeBufferAttributes(b);if(!x)return null;s.morphAttributes[f].push(x)}}return s},mergeBufferAttributes:function(n){for(var t,e,r,i=0,a=0;a<n.length;++a){var o=n[a];if(o.isInterleavedBufferAttribute||(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)||(e===void 0&&(e=o.itemSize),e!==o.itemSize)||(r===void 0&&(r=o.normalized),r!==o.normalized))return null;i+=o.array.length}for(var s=new t(i),l=0,a=0;a<n.length;++a)s.set(n[a].array,l),l+=n[a].array.length;return new d.BufferAttribute(s,e,r)},interleaveAttributes:function(n){for(var t,e=0,r=0,i=0,a=n.length;i<a;++i){var o=n[i];if(t===void 0&&(t=o.array.constructor),t!==o.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;e+=o.array.length,r+=o.itemSize}for(var s=new d.InterleavedBuffer(new t(e),r),l=0,u=[],c=["getX","getY","getZ","getW"],f=["setX","setY","setZ","setW"],m=0,a=n.length;m<a;m++){var o=n[m],A=o.itemSize,h=o.count,p=new d.InterleavedBufferAttribute(s,A,l,o.normalized);u.push(p),l+=A;for(var g=0;g<h;g++)for(var v=0;v<A;v++)p[f[v]](g,o[c[v]](g))}return u},estimateBytesUsed:function(n){var t=0;for(var e in n.attributes){var r=n.getAttribute(e);t+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}var i=n.getIndex();return t+=i?i.count*i.itemSize*i.array.BYTES_PER_ELEMENT:0,t},mergeVertices:function(n,t){t===void 0&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var e={},r=n.getIndex(),i=n.getAttribute("position"),a=r?r.count:i.count,o=0,s=Object.keys(n.attributes),l={},u={},c=[],f=["getX","getY","getZ","getW"],m=0,A=s.length;m<A;m++){var h=s[m];l[h]=[];var p=n.morphAttributes[h];p&&(u[h]=new Array(p.length).fill().map(function(){return[]}))}for(var g=Math.log10(1/t),v=Math.pow(10,g),m=0;m<a;m++){for(var y=r?r.getX(m):m,b="",x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),E=w.itemSize,M=0;M<E;M++)b+="".concat(~~(w[f[M]](y)*v),",");if(b in e)c.push(e[b]);else{for(var x=0,A=s.length;x<A;x++)for(var h=s[x],w=n.getAttribute(h),p=n.morphAttributes[h],E=w.itemSize,C=l[h],R=u[h],M=0;M<E;M++){var L=f[M];if(C.push(w[L](y)),p)for(var S=0,I=p.length;S<I;S++)R[S].push(p[S][L](y))}e[b]=o,c.push(o),o++}}for(var O=n.clone(),m=0,A=s.length;m<A;m++){var h=s[m],P=n.getAttribute(h),F=new P.array.constructor(l[h]),w=new d.BufferAttribute(F,P.itemSize,P.normalized);if(O.setAttribute(h,w),h in u)for(var x=0;x<u[h].length;x++){var V=n.morphAttributes[h][x],F=new V.array.constructor(u[h][x]),D=new d.BufferAttribute(F,V.itemSize,V.normalized);O.morphAttributes[h][x]=D}}return O.setIndex(c),O}};function Ya(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function Xn(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var Zt=new d.Vector3,xa=new d.Sphere,wa=new d.Matrix4,Us=new d.Matrix4,qs=new d.Box3,Si=new d.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Mi=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),Qu=new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5));function Hs(n,t,e){switch(n){case"Z":break;case"Y":e.copy(Mi);break;case"-Y":e.copy(Si);break;case"WGS84":case"GCJ02":case"BD09":Nh(t,e);break;default:e.identity();break}return e}function Jh(n){var t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(n);if(t){var e=String(t[1]).trim().split(".").slice(1).reverse()[0];if(e)return e}return""}var Ci=function(){function n(t,e){this.scene=t,this.error=e,t.viewLayer=this}return Object.defineProperty(n.prototype,"name",{get:function(){return this.scene.name},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.scene.type},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"upAxis",{get:function(){return this.scene.upAxis},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"groundHeight",{get:function(){return this.scene.groundHeight},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.scene.model},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinates",{get:function(){Zt.setScalar(0);var t=this.scene.localToLla(Zt),e=t.x,r=t.y;return[e,r].map(function(i){return(i/Math.PI*180).toFixed(6)}).join(",")},enumerable:!1,configurable:!0}),n.prototype.getTransformMatrix4=function(t){return t===void 0&&(t=new d.Matrix4),t.copy(this.scene.coordinateTransform.ecefToLocalMatrix),this.scene&&t.premultiply(this.scene.matrixWorld),t},n.prototype.coordinatesToWorldPoint=function(t){var e=new d.Vector3(t.latitude,t.longitude,t.altitude);return this.scene.llaToWorld(e)},n.prototype.worldPointToCoordinates=function(t){return Zt.copy(t),this.scene.worldToLla(Zt),{latitude:Zt.x,longitude:Zt.y,altitude:Zt.z}},n}(),$a=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o=n.call(this)||this;return o.name="",o.onError=(r=e.onError)!==null&&r!==void 0?r:Q,o.onShownFloorChange=(i=e.onShownFloorChange)!==null&&i!==void 0?i:Q,o.onLoad=(a=e.onLoad)!==null&&a!==void 0?a:Q,o.work=null,o.viewLayers=[],o.bounding=new d.Box3(new d.Vector3,new d.Vector3),o.floorLength=0,o.textureOptions={},o.refined=!1,o.refineProgress=[0,0],o.loaded=!1,o.matrixAutoUpdate=!1,o.needsRender=!0,o.autoRefine=!0,o.materialVersion=0,o.materialParameters=k({},Ae),o.cacheCameras=[],o.disposed=!1,o}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.viewLayers.length===0},enumerable:!1,configurable:!0}),t.prototype.getMaterial=function(){return k({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=V0(this.materialParameters,e);if(i){var a=this.materialParameters.shownFloorIndex;r!==a&&this.onShownFloorChange(a),this.materialVersion++,this.needsRender=!0}},Object.defineProperty(t.prototype,"brightness",{get:function(){return this.materialParameters.brightness},set:function(e){this.setMaterial({brightness:typeof e=="number"?e:1})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloorIndex",{get:function(){return this.materialParameters.shownFloorIndex},set:function(e){this.setMaterial({shownFloorIndex:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownFloor",{get:function(){return this.shownFloorIndex===-1?null:this.shownFloorIndex},set:function(e){this.shownFloorIndex=e===null?-1:e},enumerable:!1,configurable:!0}),t.prototype.show=function(e){this.shownFloor=e!=null?e:null},Object.defineProperty(t.prototype,"clippers",{get:function(){return this.materialParameters.clippers},set:function(e){this.setMaterial({clippers:e})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"customShaders",{get:function(){return this.materialParameters.customShaders},set:function(e){this.setMaterial({customShaders:e})},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,r){r===void 0&&(r=30/180*Math.PI);for(var i=Math.cos(r),a=[],o=0,s=this.children;o<s.length;o++){var l=s[o];l instanceof an&&l.tileset.selectedTiles.forEach(function(u){var c,f,m;if(!(u.boundingVolume&&u.boundingVolume.distanceToPoint(e.center)>e.radius)){var A=(f=(c=u.content)===null||c===void 0?void 0:c.data)===null||f===void 0?void 0:f.object;if(A&&A.visible){var h=[];if(A.traverseVisible(function(j){if(j instanceof d.Mesh){var J=_d.get(j);if(J){wa.copy(j.matrixWorld),Us.getInverse(wa),xa.copy(e).applyMatrix4(Us);var X=J.trianglesInSphere(xa.center,xa.radius),Y=new d.BufferGeometry;Y.setAttribute("position",new d.BufferAttribute(X,3)),Y.applyMatrix4(j.matrixWorld),Y=Qs.mergeVertices(Y,.01),h.push(Y)}}}),h.length===0)return;for(var p=["a","b","c"],g=Qs.mergeBufferGeometries(h,!1),v=g.getAttribute("position").array,y=((m=g.getIndex())===null||m===void 0?void 0:m.array)||[],b=[],x=[],w=0,E=v.length;w<E;w+=3){var M=new d.Vector3(v[w],v[w+1],v[w+2]);b.push(M)}for(var w=0,E=y.length;w<E;w+=3){var C=y[w],R=y[w+1],L=y[w+2],S=new d.Vector3().crossVectors(b[R].clone().sub(b[C]),b[L].clone().sub(b[C])).normalize();x.push({a:C,b:R,c:L,normal:S})}for(var I={},w=0,E=x.length;w<E;w++)for(var O=x[w],P=0;P<3;P++){var F=O[p[P]],V=O[p[(P+1)%3]],D=[Math.min(F,V),Math.max(F,V)],z=D[0]+"-"+D[1];I[z]===void 0?I[z]={index1:D[0],index2:D[1],face1:w}:I[z].face2=w}for(var z in I){var U=I[z];if(U.face2===void 0||x[U.face1].normal.dot(x[U.face2].normal)<=i){var q=b[U.index1],K=b[U.index2];a.push(new d.Line3(q,K))}}b.length=0,x.length=0}}})}return a},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=null),i===void 0&&(i=!0);for(var a=[],o=0,s=this.children.length;o<s;o++){var l=this.children[o];l.visible&&l instanceof an&&l.intersectRaycaster(e,!1,a)}return r!=null&&(a=a.filter(function(u){return u.floor===r})),this.getMaterial().pointBack==="HIDDEN"&&(a=a.filter(function(u){return!(u.object instanceof er&&u.face&&u.face.normal.angleTo(e.ray.direction)<Math.PI/2)})),i&&a.sort(function(u,c){return u.distance-c.distance}),a},t.prototype.load=function(e,r){var i,a=this,o,s,l,u;if(r===void 0&&(r={}),this.work=e,this.name=this.work.workCode,!e.model)return Promise.resolve();for(var c=e.model,f=0,m=0,A=e.observers;m<A.length;m++){var h=A[m];f=Math.max(f,h.floorIndex)}this.floorLength=f+1;for(var p=!1,g=[],v=function(U){var q=U.tileset,K=U.upAxis,j=U.name,J=U.type;J==="mesh"&&(p=!0);var X=q.split("#"),Y=X[0],W=X[1],ee=(o=(W||Y).split("?")[1])!==null&&o!==void 0?o:"",Z=it(e).ajax(q,{responseType:"text"}).then(function(ie){var te,le,oe,we=q?q.slice(0,q.lastIndexOf("/")+1):"",pe=Ei(JSON.parse(ie.body),we),ge=pe.root,Re=pe.rootMeta,Se=Re===void 0?{}:Re;Se.upAxis&&Se.upAxis!==K&&(K=Se.upAxis),"lodVersion"in pe&&(K="-Y","floorInfo"in pe&&(pe.properties=pe.properties||{},pe.properties.floorInfo=pe.floorInfo.map(function(xe){return{ground:-xe.ground,height:xe.height}}),delete pe.floorInfo),pe.asset.tilesetVersion=String(pe.lodVersion),delete pe.lodVersion);var Te=ge.boundingVolume?xi(ge.boundingVolume):void 0;Te&&ge.transform&&Te.applyMatrix4(wa.fromArray(ge.transform));var re=null,ae=new d.Matrix4,H=new d.Matrix4;Se.coordinate?(re=Se.coordinate.ground_height,ae.fromArray(Se.coordinate.pose_ecef_to_enu),H.fromArray(Se.coordinate.pose_enu_to_ecef)):(Te?Te.getCenter(Zt):Zt.setScalar(0),Hs(K,Zt,ae),H.getInverse(ae));var Ve=new d.Matrix4().copy(Si),Fe=new d.Matrix4().copy(Mi),Ie=new d.Matrix4().premultiply(ae).premultiply(Ve),Ge=new d.Matrix4().getInverse(Ie);pe.root={refine:(te=ge.refine)!==null&&te!==void 0?te:"REPLACE",geometricError:ge.geometricError,transform:Ie.toArray(),boundingVolume:Te?Te.toJson():void 0,viewerRequestVolume:!((le=r["3d-tiles"])===null||le===void 0)&&le.viewerRequestVolume?(oe=r["3d-tiles"])===null||oe===void 0?void 0:oe.viewerRequestVolume.toJson():void 0,children:[ge]};var be=new an(a,pe,{name:j,type:J,upAxis:K,url:q,referer:q,search:ee,fetcher:it(e),groundHeight:re,coordinateTransform:{localToEnuMatrix:Fe,enuToLocalMatrix:Ve,enuToEcefMatrix:H,ecefToEnuMatrix:ae,localToEcefMatrix:Ge,ecefToLocalMatrix:Ie}});if(be.matrix.copy(e.transform),be.matrix.decompose(be.position,be.quaternion,be.scale),be.matrixWorldNeedsUpdate=!0,r["3d-tiles"]){var ve=r["3d-tiles"];typeof ve.debug!="undefined"&&(be.debug=ve.debug),typeof ve.minLevelOfDetail!="undefined"&&(be.minLevelOfDetail=ve.minLevelOfDetail),typeof ve.maxLevelOfDetail!="undefined"&&(be.maxLevelOfDetail=ve.maxLevelOfDetail),typeof ve.skipLevelOfDetail!="undefined"&&(be.skipLevelOfDetail=ve.skipLevelOfDetail),typeof ve.mostDetail!="undefined"&&(be.mostDetail=ve.mostDetail),typeof ve.loadSiblings!="undefined"&&(be.loadSiblings=ve.loadSiblings),typeof ve.loadAll!="undefined"&&(be.loadAll=ve.loadAll),typeof ve.maxMemoryUsage!="undefined"&&(be.maxMemoryUsage=ve.maxMemoryUsage),typeof ve.maxRequests!="undefined"&&(be.maxRequests=ve.maxRequests),typeof ve.requestOrder!="undefined"&&(be.requestOrder=ve.requestOrder),typeof ve.maxScreenSpaceError!="undefined"&&(be.maxScreenSpaceError=ve.maxScreenSpaceError)}return new Ci(be,null)});g.push(Z.catch(function(ie){a.onError(ie);var te=new d.Matrix4,le=new d.Matrix4,oe=new d.Matrix4().copy(Si),we=new d.Matrix4().copy(Mi),pe=new d.Matrix4().premultiply(te).premultiply(oe),ge=new d.Matrix4().getInverse(pe),Re=q?q.slice(0,q.lastIndexOf("/")+1):"",Se=Ei({asset:{version:"0.0"},geometricError:0,root:{geometricError:0}},Re),Te=new an(a,Se,{name:j,type:J,upAxis:K,url:q,referer:q,search:ee,fetcher:it(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:we,enuToLocalMatrix:oe,enuToEcefMatrix:le,ecefToEnuMatrix:te,localToEcefMatrix:ge,ecefToLocalMatrix:pe},onError:a.onError});return new Ci(Te,ie)}))},y=0,b=c.layers;y<b.length;y++){var x=b[y];v(x)}if(!p&&c.file){var w=c.file,E=c.textureBase,M=c.textures,C=Jh(w)||"at3d",R=C==="dome"||C==="domez"?"Y":"Z",L=new d.Matrix4,S=new d.Matrix4,I=new d.Matrix4().copy(Si),O=new d.Matrix4().copy(Mi);Hs(R,Zt.setScalar(0),L),S.getInverse(L);var P=new d.Matrix4().premultiply(L).premultiply(I),F=new d.Matrix4().getInverse(P),V=Ei({asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:P.toArray(),viewerRequestVolume:!((s=r["3d-tiles"])===null||s===void 0)&&s.viewerRequestVolume?(l=r["3d-tiles"])===null||l===void 0?void 0:l.viewerRequestVolume.toJson():void 0,content:{uri:w},extras:(i={},i[C]={textureBaseUri:E,textureArray:M,textureOptions:(u=r.textureOptions)!==null&&u!==void 0?u:{}},i)}},""),D=new an(this,V,{name:"fallback",type:"mesh",upAxis:R,url:"",referer:w,fetcher:it(e),groundHeight:null,coordinateTransform:{localToEnuMatrix:O,enuToLocalMatrix:I,enuToEcefMatrix:S,ecefToEnuMatrix:L,localToEcefMatrix:F,ecefToLocalMatrix:P},onError:this.onError});D.matrix.copy(e.transform),D.matrix.decompose(D.position,D.quaternion,D.scale),D.matrixWorldNeedsUpdate=!0;var z=new Ci(D,null);g.push(Promise.resolve(z))}return Promise.all(g).then(function(U){for(var q,K=[],j=[],J=[],X=0,Y=U;X<Y.length;X++){var W=Y[X];if(a.viewLayers.push(W),a.disposed){W.scene.dispose();continue}switch(a.add(W.scene),W.scene.visible=!1,W.scene.type){case"mesh":K.push(W.scene);break;case"point_cloud":j.push(W.scene);break;default:J.push(W.scene);break}}K.length?K[0].visible=!0:j.length?j[0].visible=!0:J.length&&(J[0].visible=!0);var ee=(q=r["3d-tiles"])===null||q===void 0?void 0:q.showLayers;if(typeof ee=="boolean")for(var Z=0,ie=U;Z<ie.length;Z++){var W=ie[Z];W.scene&&(W.scene.visible=ee)}else if(Array.isArray(ee))for(var te=0,le=U;te<le.length;te++){var W=le[te];W.scene&&(W.scene.visible=ee.indexOf(W.scene.name)!==-1)}})},t.prototype.update=function(e,r,i){if(this.children.length){var a=this.loaded;this.refined=this.work!==null,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=this.work!==null;for(var o=0,s=this.viewLayers;o<s.length;o++){var l=s[o],u=l.scene;u&&(this.work&&(u.idle=this.materialParameters.modelAlpha<=0,u.cacheCameras=this.cacheCameras,this.autoRefine===!1?u.needsRefined=!1:Xn(i)?u.needsRefined=this.materialParameters.modelAlpha===0||this.materialParameters.modelAlpha===1:u.needsRefined=!0,this.work.transform.equals(u.matrix)||(u.matrix.copy(this.work.transform),u.matrix.decompose(u.position,u.quaternion,u.scale),u.matrixWorldNeedsUpdate=!0)),u.update(e,r),u.needsRender===!0&&(u.needsRender=!1,this.needsRender=!0),u.refined===!1&&(this.refined=!1),this.refineProgress[0]+=u.refineProgress[0],this.refineProgress[1]+=u.refineProgress[1],u.loaded===!1&&(this.loaded=!1))}this.bounding.makeEmpty();for(var c=0,f=this.viewLayers;c<f.length;c++){var l=f[c],u=l.scene;u&&(u.boundingBox.isEmpty()||(qs.copy(u.boundingBox).applyMatrix4(u.matrix),this.bounding.union(qs)))}this.bounding.isEmpty()&&this.bounding.copy(Qu),a===!1&&this.loaded===!0&&this.onLoad()}else this.work&&!this.work.model?(this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!0):(this.refined=!1,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!1),this.bounding.set(new d.Vector3,new d.Vector3)},t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)e instanceof an&&e.dispose(),this.remove(e)},t}(d.Object3D);function Gs(){var n=new d.Box3,t=nh(Ae,["clippers","shownFloorIndex","brightness","customShaders"]),e=Object.assign([],{bounding:n,needsRender:!1,refined:!1,refineProgress:[0,0],loaded:!1,materialVersion:0,cacheCameras:[],autoUpdate:!0,intersectRaycaster:function(r,i,a){a===void 0&&(a=!0);var o;if(e.length===1)o=e[0].intersectRaycaster(r,i,a);else if(e.length===0)o=[];else{o=[];for(var s=0,l=e;s<l.length;s++){var u=l[s];if(u.visible){var c=u.intersectRaycaster(r,i,!1);c.length&&o.push.apply(o,c)}}a&&o.sort(function(f,m){return f.distance-m.distance})}return o},setMaterial:function(r){var i=V0(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return k({},t)},resetBrightness:function(){for(var r=0,i=e;r<i.length;r++){var a=i[r];a.setMaterial({brightness:1})}},update:function(r,i,a){if(e.autoUpdate!==!1){e.refined=e.length>0,e.loaded=e.length>0,e.refineProgress[0]=0,e.refineProgress[1]=0,n.makeEmpty();for(var o=0,s=e.cacheCameras;o<s.length;o++){var l=s[o];l.updateMatrixWorld(!0),l.updateProjectionMatrix()}for(var u=0,c=0,f=e;c<f.length;c++){for(var m=f[c],A=0,h=m.viewLayers;A<h.length;A++){var p=h[A];p.scene.modelIndex=u++}m.setMaterial(t),m.cacheCameras=e.cacheCameras,m.update(r,i,a),m.needsRender===!0&&(e.needsRender=!0,m.needsRender=!1),m.refined===!1&&(e.refined=!1),e.refineProgress[0]+=m.refineProgress[0],e.refineProgress[1]+=m.refineProgress[1],m.loaded===!1&&(e.loaded=!1),n.union(m.bounding)}n.isEmpty()&&n.copy(Qu)}}});return e}var Ks=function(n){return n*(2-n)},Xh=function(){var n=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),e=new Uint8Array([0,2,1,2,3,1]),r=new d.BufferGeometry;return r.setAttribute("position",new d.BufferAttribute(n,3)),r.setAttribute("uv",new d.BufferAttribute(t,2)),r.setIndex(new d.BufferAttribute(e,1)),r}(),Wh=`
|
|
1037
1037
|
varying vec2 vUv;
|
|
1038
1038
|
#include <common>
|
|
1039
1039
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1145,7 +1145,7 @@ void main() {
|
|
|
1145
1145
|
|
|
1146
1146
|
gl_FragColor = vec4(gl_FragColor.rgb * baseColor, gl_FragColor.a * opacity * opacity);
|
|
1147
1147
|
}
|
|
1148
|
-
`,Uu=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a=n.call(this)||this,o=(r=e.color)!==null&&r!==void 0?r:16777215,s=(i=e.scale)!==null&&i!==void 0?i:1;return a.progress=0,a.opacity=0,a.loading=!1,a.current=!1,a.disabled=!1,a.currentMotion=new
|
|
1148
|
+
`,Uu=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a=n.call(this)||this,o=(r=e.color)!==null&&r!==void 0?r:16777215,s=(i=e.scale)!==null&&i!==void 0?i:1;return a.progress=0,a.opacity=0,a.loading=!1,a.current=!1,a.disabled=!1,a.currentMotion=new Me({progress:0}),a.ringMotion=new Me({scale:1,opacity:1}),a.tapMotion=new Me({scale:1,opacity:1}),a.loadingOpacityMotion=new Me({opacity:0}),a.progressMotion=new Me({progress:0}),a.progressOpacityMotion=new Me({opacity:0}),a.opacityMotion=new Me({opacity:0}),a.disableMotion=new Me({progress:0}),a.panoMesh=new d.Mesh(Xh,new d.ShaderMaterial({blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:Wh,fragmentShader:Zh,uniforms:{baseColor:{value:new d.Color(o)},circleScale:{value:1},ringScale:{value:1},ringOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0}}})),a.renderOrder=-2,a.panoMesh.renderOrder=-2,a.panoMesh.position.y=.004,a.panoMesh.scale.set(s,1,s),a.add(a.panoMesh),a.currentStartTime=he(),a.needsRender=!0,a}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=fe(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(Q),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(Q).then(function(){r.progressMotion.set({progress:0},0).catch(Q)}):this.progressMotion.set({progress:fe(e*1.2,0,1)},100).catch(Q)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=fe(e,0,1),this.opacityMotion.set({opacity:e},200).catch(Q))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(Q),this.current=e,this.current===!0&&(this.currentStartTime=he()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(Q))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(Q))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();var r=[{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}];return this.progressOpacityMotion.set({opacity:0},0).catch(Q),this.progressMotion.set({progress:0},0).catch(Q),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(Q),e.progressMotion.set({progress:e.progress},120).catch(Q)}).catch(Q)},t.prototype.updateTime=function(e,r){if(!this.progressMotion.ended){this.progressMotion.update(e);var i=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=i,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var a=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=a,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var a=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=a,this.needsRender=!0}if(this.visible=this.opacityMotion.value.opacity!==0,(!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;{var o=(e-this.currentStartTime-1500)/2e3;if(o%5<2){var s=1+Math.sin(Math.PI*o)/25*this.currentMotion.value.progress;this.panoMesh.material.uniforms.circleScale.value=s,this.needsRender=!0}}{var l=(e-this.currentStartTime-1500)/2e3;if(l%5<2){var u=l%1;this.panoMesh.material.uniforms.expand0.value=Ks(u)*this.currentMotion.value.progress,this.needsRender=!0}}{var c=(e-this.currentStartTime-1e3)/2e3;if(c%5<2){var u=c%1;this.panoMesh.material.uniforms.expand1.value=Ks(u)*this.currentMotion.value.progress,this.needsRender=!0}}}if(this.currentMotion.value.progress>.2&&this.progress===0&&this.loading===!1){var f=(e-this.currentStartTime-1e3)/2e3;f%5<2?this.ringMotion.getTargetKeyframe().value.scale!==.8&&this.ringMotion.set({scale:.8,opacity:0},600).catch(Q):this.ringMotion.getTargetKeyframe().value.scale!==1&&this.ringMotion.set({scale:1,opacity:1},600).catch(Q)}else this.ringMotion.getTargetKeyframe().value.scale!==1&&this.ringMotion.set({scale:1,opacity:1},600).catch(Q);if(!this.ringMotion.ended){var m=this.ringMotion.value,s=m.scale,a=m.opacity;this.ringMotion.update(e),this.panoMesh.material.uniforms.ringScale.value=s,this.panoMesh.material.uniforms.ringOpacity.value=a,this.needsRender=!0}if(!this.disableMotion.ended){var i=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=i,this.needsRender=!0}},t.prototype.dispose=function(){this.ringMotion.dispose(),this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(d.Object3D),js=function(n){return n*(2-n)},Yh=function(){var n=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),e=new Uint8Array([0,2,1,2,3,1]),r=new d.BufferGeometry;return r.setAttribute("position",new d.BufferAttribute(n,3)),r.setAttribute("uv",new d.BufferAttribute(t,2)),r.setIndex(new d.BufferAttribute(e,1)),r}(),$h=`
|
|
1149
1149
|
varying vec2 vUv;
|
|
1150
1150
|
#include <common>
|
|
1151
1151
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1247,7 +1247,7 @@ void main() {
|
|
|
1247
1247
|
|
|
1248
1248
|
gl_FragColor = vec4(gl_FragColor.rgb * baseColor, gl_FragColor.a * opacity * opacity);
|
|
1249
1249
|
}
|
|
1250
|
-
`,tp=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a=n.call(this)||this,o=(r=e.color)!==null&&r!==void 0?r:16777215,s=(i=e.scale)!==null&&i!==void 0?i:1;return a.progress=0,a.opacity=0,a.loading=!1,a.current=!1,a.disabled=!1,a.currentMotion=new
|
|
1250
|
+
`,tp=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a=n.call(this)||this,o=(r=e.color)!==null&&r!==void 0?r:16777215,s=(i=e.scale)!==null&&i!==void 0?i:1;return a.progress=0,a.opacity=0,a.loading=!1,a.current=!1,a.disabled=!1,a.currentMotion=new Me({progress:0}),a.tapMotion=new Me({scale:1,opacity:1}),a.loadingOpacityMotion=new Me({opacity:0}),a.progressMotion=new Me({progress:0}),a.progressOpacityMotion=new Me({opacity:0}),a.opacityMotion=new Me({opacity:0}),a.disableMotion=new Me({progress:0}),a.panoMesh=new d.Mesh(Yh,new d.ShaderMaterial({blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:$h,fragmentShader:ep,uniforms:{baseColor:{value:new d.Color(o)},circleScale:{value:1},circleOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0}}})),a.renderOrder=-2,a.panoMesh.renderOrder=-2,a.panoMesh.position.y=.004,a.panoMesh.scale.set(s,1,s),a.add(a.panoMesh),a.currentStartTime=he(),a.needsRender=!0,a}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=fe(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(Q),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(Q).then(function(){r.progressMotion.set({progress:0},0).catch(Q)}):this.progressMotion.set({progress:fe(e*1.2,0,1)},100).catch(Q)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=fe(e,0,1),this.opacityMotion.set({opacity:e},200).catch(Q))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(Q),this.current=e,this.current===!0&&(this.currentStartTime=he()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(Q))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(Q))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();var r=[{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}];return this.progressOpacityMotion.set({opacity:0},0).catch(Q),this.progressMotion.set({progress:0},0).catch(Q),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(Q),e.progressMotion.set({progress:e.progress},120).catch(Q)}).catch(Q)},t.prototype.updateTime=function(e,r){if(!this.progressMotion.ended){this.progressMotion.update(e);var i=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=i,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var a=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=a,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var a=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=a,this.needsRender=!0}if(this.visible=this.opacityMotion.value.opacity!==0,(!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.panoMesh.material.uniforms.circleOpacity.value=Math.max(.6,1-Math.max(this.loadingOpacityMotion.value.opacity,this.progressOpacityMotion.value.opacity)),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;{var o=(e-this.currentStartTime-1500)/2e3;if(o%5<2){var s=1+Math.sin(Math.PI*o)/25*this.currentMotion.value.progress;this.panoMesh.material.uniforms.circleScale.value=s,this.needsRender=!0}}{var l=(e-this.currentStartTime-1500)/2e3;if(l%5<2){var u=l%1;this.panoMesh.material.uniforms.expand0.value=js(u)*this.currentMotion.value.progress,this.needsRender=!0}}{var c=(e-this.currentStartTime-1e3)/2e3;if(c%5<2){var u=c%1;this.panoMesh.material.uniforms.expand1.value=js(u)*this.currentMotion.value.progress,this.needsRender=!0}}}if(!this.disableMotion.ended){var i=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=i,this.needsRender=!0}},t.prototype.dispose=function(){this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(d.Object3D),_s=function(n){return n*(2-n)},rp=function(){var n=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),e=new Uint8Array([0,2,1,2,3,1]),r=new d.BufferGeometry;return r.setAttribute("position",new d.BufferAttribute(n,3)),r.setAttribute("uv",new d.BufferAttribute(t,2)),r.setIndex(new d.BufferAttribute(e,1)),r}(),np=`
|
|
1251
1251
|
varying vec2 vUv;
|
|
1252
1252
|
#include <common>
|
|
1253
1253
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1390,7 +1390,7 @@ void main() {
|
|
|
1390
1390
|
|
|
1391
1391
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);
|
|
1392
1392
|
}
|
|
1393
|
-
`,ap=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c=n.call(this)||this,f=(r=e.color)!==null&&r!==void 0?r:16777215,m=(i=e.scale)!==null&&i!==void 0?i:1,A=e.map,h=(a=e.mapAlpha)!==null&&a!==void 0?a:1,p=(o=e.mapUseColor)!==null&&o!==void 0?o:!1,g=(s=e.mapUseReverse)!==null&&s!==void 0?s:!1,v=(l=e.borderWidth)!==null&&l!==void 0?l:.1,y=(u=e.borderColor)!==null&&u!==void 0?u:16777215;return c.progress=0,c.opacity=0,c.loading=!1,c.current=!1,c.disabled=!1,c.currentMotion=new
|
|
1393
|
+
`,ap=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c=n.call(this)||this,f=(r=e.color)!==null&&r!==void 0?r:16777215,m=(i=e.scale)!==null&&i!==void 0?i:1,A=e.map,h=(a=e.mapAlpha)!==null&&a!==void 0?a:1,p=(o=e.mapUseColor)!==null&&o!==void 0?o:!1,g=(s=e.mapUseReverse)!==null&&s!==void 0?s:!1,v=(l=e.borderWidth)!==null&&l!==void 0?l:.1,y=(u=e.borderColor)!==null&&u!==void 0?u:16777215;return c.progress=0,c.opacity=0,c.loading=!1,c.current=!1,c.disabled=!1,c.currentMotion=new Me({progress:0}),c.tapMotion=new Me({scale:1,opacity:1}),c.loadingOpacityMotion=new Me({opacity:0}),c.progressMotion=new Me({progress:0}),c.progressOpacityMotion=new Me({opacity:0}),c.opacityMotion=new Me({opacity:0}),c.disableMotion=new Me({progress:0}),c.panoMesh=new d.Mesh(rp,new d.ShaderMaterial({blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:np,fragmentShader:ip,defines:{USE_COLOR:p,USE_MAP:A!==void 0,USE_BORDER:v>0,USE_REVERSE:g},uniforms:{baseColor:{value:new d.Color(f)},circleScale:{value:1},circleOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0},map:{value:A},mapAlpha:{value:h},borderWidth:{value:v},borderColor:{value:new d.Color(y)}}})),c.renderOrder=-2,c.panoMesh.renderOrder=-2,c.panoMesh.position.y=.004,c.panoMesh.scale.set(m,1,m),c.add(c.panoMesh),c.currentStartTime=he(),c.needsRender=!0,c}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=fe(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(Q),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(Q).then(function(){r.progressMotion.set({progress:0},0).catch(Q)}):this.progressMotion.set({progress:fe(e*1.2,0,1)},100).catch(Q)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=fe(e,0,1),this.opacityMotion.set({opacity:e},200).catch(Q))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(Q),this.current=e,this.current===!0&&(this.currentStartTime=he()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(Q))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(Q))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();var r=[{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}];return this.progressOpacityMotion.set({opacity:0},0).catch(Q),this.progressMotion.set({progress:0},0).catch(Q),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(Q),e.progressMotion.set({progress:e.progress},120).catch(Q)}).catch(Q)},t.prototype.updateTime=function(e,r){if(!this.progressMotion.ended){this.progressMotion.update(e);var i=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=i,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var a=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=a,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);var a=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=a,this.needsRender=!0}if(this.visible=this.opacityMotion.value.opacity!==0,(!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.panoMesh.material.uniforms.circleOpacity.value=Math.max(.6,1-Math.max(this.loadingOpacityMotion.value.opacity,this.progressOpacityMotion.value.opacity)),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;{var o=(e-this.currentStartTime-1500)/2e3;if(o%5<2){var s=o%1;this.panoMesh.material.uniforms.expand0.value=_s(s)*this.currentMotion.value.progress,this.needsRender=!0}}{var l=(e-this.currentStartTime-1e3)/2e3;if(l%5<2){var s=l%1;this.panoMesh.material.uniforms.expand1.value=_s(s)*this.currentMotion.value.progress,this.needsRender=!0}}}if(!this.disableMotion.ended){var i=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=i,this.needsRender=!0}},t.prototype.dispose=function(){this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(d.Object3D),op=new d.CircleBufferGeometry(.1,16),sp=`
|
|
1394
1394
|
varying vec2 vUv;
|
|
1395
1395
|
#include <common>
|
|
1396
1396
|
#include <logdepthbuf_pars_vertex>
|
|
@@ -1429,7 +1429,7 @@ void main() {
|
|
|
1429
1429
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
1430
1430
|
* Licensed under the MIT license */var Qn=function(n,t,e,r){var i=["","webkit","Moz","MS","ms","o"],a=t.createElement?t.createElement("div"):r,o="function",s=Math.round,l=Math.abs,u=Date.now;function c(T,B,N){return setTimeout(y(T,N),B)}function f(T,B,N){return Array.isArray(T)?(m(T,N[B],N),!0):!1}function m(T,B,N){var G;if(T)if(T.forEach)T.forEach(B,N);else if(T.length!==r)for(G=0;G<T.length;)B.call(N,T[G],G,T),G++;else for(G in T)T.hasOwnProperty(G)&&B.call(N,T[G],G,T)}function A(T,B,N){var G="DEPRECATED METHOD: "+B+`
|
|
1431
1431
|
`+N+` AT
|
|
1432
|
-
`;return function(){var $=new Error("get-stack-trace"),ce=$&&$.stack?$.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Me=n.console&&(n.console.warn||n.console.log);return Me&&Me.call(n.console,G,ce),T.apply(this,arguments)}}var h;typeof Object.assign!="function"?h=function(B){if(B===r||B===null)throw new TypeError("Cannot convert undefined or null to object");for(var N=Object(B),G=1;G<arguments.length;G++){var $=arguments[G];if($!==r&&$!==null)for(var ce in $)$.hasOwnProperty(ce)&&(N[ce]=$[ce])}return N}:h=Object.assign;var p=A(function(B,N,G){for(var $=Object.keys(N),ce=0;ce<$.length;)(!G||G&&B[$[ce]]===r)&&(B[$[ce]]=N[$[ce]]),ce++;return B},"extend","Use `assign`."),g=A(function(B,N){return p(B,N,!0)},"merge","Use `assign`.");function v(T,B,N){var G=B.prototype,$;$=T.prototype=Object.create(G),$.constructor=T,$._super=G,N&&h($,N)}function y(T,B){return function(){return T.apply(B,arguments)}}function b(T,B){return typeof T==o?T.apply(B&&B[0]||r,B):T}function x(T,B){return T===r?B:T}function w(T,B,N){m(R(B),function(G){T.addEventListener(G,N,!1)})}function E(T,B,N){m(R(B),function(G){T.removeEventListener(G,N,!1)})}function C(T,B){for(;T;){if(T==B)return!0;T=T.parentNode}return!1}function M(T,B){return T.indexOf(B)>-1}function R(T){return T.trim().split(/\s+/g)}function L(T,B,N){if(T.indexOf&&!N)return T.indexOf(B);for(var G=0;G<T.length;){if(N&&T[G][N]==B||!N&&T[G]===B)return G;G++}return-1}function S(T){return Array.prototype.slice.call(T,0)}function I(T,B,N){for(var G=[],$=[],ce=0;ce<T.length;){var Me=T[ce][B];L($,Me)<0&&G.push(T[ce]),$[ce]=Me,ce++}return G=G.sort(function(bt,je){return bt[B]>je[B]}),G}function O(T,B){for(var N,G,$=B[0].toUpperCase()+B.slice(1),ce=0;ce<i.length;){if(N=i[ce],G=N?N+$:B,G in T)return G;ce++}return r}var P=1;function F(){return P++}function V(T){var B=T.ownerDocument||T;return B.defaultView||B.parentWindow||n}var D=/mobile|tablet|ip(ad|hone|od)|android/i,z="ontouchstart"in n,U=O(n,"PointerEvent")!==r,q=z&&D.test(navigator.userAgent),K="touch",j="pen",J="mouse",X="kinect",Y=25,W=1,ee=2,Z=4,ie=8,te=1,le=2,oe=4,we=8,pe=16,ge=le|oe,Re=we|pe,Se=ge|Re,Te=["x","y"],re=["clientX","clientY"];function ae(T,B){var N=this;this.manager=T,this.callback=B,this.element=T.element,this.target=T.options.inputTarget,this.domHandler=function(G){b(T.options.enable,[T])&&N.handler(G)},this.init()}ae.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(V(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(V(this.element),this.evWin,this.domHandler)}};function H(T){var B,N=T.options.inputClass;return N?B=N:U?B=nr:q?B=gt:z?B=Ct:B=st,new B(T,Ve)}function Ve(T,B,N){var G=N.pointers.length,$=N.changedPointers.length,ce=B&W&&G-$===0,Me=B&(Z|ie)&&G-$===0;N.isFirst=!!ce,N.isFinal=!!Me,ce&&(T.session={}),N.eventType=B,Fe(T,N),T.emit("hammer.input",N),T.recognize(N),T.session.prevInput=N}function Fe(T,B){var N=T.session,G=B.pointers,$=G.length;N.firstInput||(N.firstInput=be(B)),$>1&&!N.firstMultiple?N.firstMultiple=be(B):$===1&&(N.firstMultiple=!1);var ce=N.firstInput,Me=N.firstMultiple,$e=Me?Me.center:ce.center,bt=B.center=ve(G);B.timeStamp=u(),B.deltaTime=B.timeStamp-ce.timeStamp,B.angle=Qe($e,bt),B.distance=me($e,bt),Ie(N,B),B.offsetDirection=ye(B.deltaX,B.deltaY);var je=xe(B.deltaTime,B.deltaX,B.deltaY);B.overallVelocityX=je.x,B.overallVelocityY=je.y,B.overallVelocity=l(je.x)>l(je.y)?je.x:je.y,B.scale=Me?rt(Me.pointers,G):1,B.rotation=Me?Ke(Me.pointers,G):0,B.maxPointers=N.prevInput?B.pointers.length>N.prevInput.maxPointers?B.pointers.length:N.prevInput.maxPointers:B.pointers.length,Ge(N,B);var or=T.element;C(B.srcEvent.target,or)&&(or=B.srcEvent.target),B.target=or}function Ie(T,B){var N=B.center,G=T.offsetDelta||{},$=T.prevDelta||{},ce=T.prevInput||{};(B.eventType===W||ce.eventType===Z)&&($=T.prevDelta={x:ce.deltaX||0,y:ce.deltaY||0},G=T.offsetDelta={x:N.x,y:N.y}),B.deltaX=$.x+(N.x-G.x),B.deltaY=$.y+(N.y-G.y)}function Ge(T,B){var N=T.lastInterval||B,G=B.timeStamp-N.timeStamp,$,ce,Me,$e;if(B.eventType!=ie&&(G>Y||N.velocity===r)){var bt=B.deltaX-N.deltaX,je=B.deltaY-N.deltaY,or=xe(G,bt,je);ce=or.x,Me=or.y,$=l(or.x)>l(or.y)?or.x:or.y,$e=ye(bt,je),T.lastInterval=B}else $=N.velocity,ce=N.velocityX,Me=N.velocityY,$e=N.direction;B.velocity=$,B.velocityX=ce,B.velocityY=Me,B.direction=$e}function be(T){for(var B=[],N=0;N<T.pointers.length;)B[N]={clientX:s(T.pointers[N].clientX),clientY:s(T.pointers[N].clientY)},N++;return{timeStamp:u(),pointers:B,center:ve(B),deltaX:T.deltaX,deltaY:T.deltaY}}function ve(T){var B=T.length;if(B===1)return{x:s(T[0].clientX),y:s(T[0].clientY)};for(var N=0,G=0,$=0;$<B;)N+=T[$].clientX,G+=T[$].clientY,$++;return{x:s(N/B),y:s(G/B)}}function xe(T,B,N){return{x:B/T||0,y:N/T||0}}function ye(T,B){return T===B?te:l(T)>=l(B)?T<0?le:oe:B<0?we:pe}function me(T,B,N){N||(N=Te);var G=B[N[0]]-T[N[0]],$=B[N[1]]-T[N[1]];return Math.sqrt(G*G+$*$)}function Qe(T,B,N){N||(N=Te);var G=B[N[0]]-T[N[0]],$=B[N[1]]-T[N[1]];return Math.atan2($,G)*180/Math.PI}function Ke(T,B){return Qe(B[1],B[0],re)+Qe(T[1],T[0],re)}function rt(T,B){return me(B[0],B[1],re)/me(T[0],T[1],re)}var Xr={mousedown:W,mousemove:ee,mouseup:Z},ke="mousedown",Ze="mousemove mouseup";function st(){this.evEl=ke,this.evWin=Ze,this.pressed=!1,ae.apply(this,arguments)}v(st,ae,{handler:function(B){var N=Xr[B.type];N&W&&(B.button===0||B.button===2)&&(this.pressed=!0),N&ee&&B.which!==1&&(N=Z),this.pressed&&(N&Z&&(this.pressed=!1),this.callback(this.manager,N,{pointers:[B],changedPointers:[B],pointerType:J,srcEvent:B}))}});var tr={pointerdown:W,pointermove:ee,pointerup:Z,pointercancel:ie,pointerout:ie},fn={2:K,3:j,4:J,5:X},rr="pointerdown",Pt="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(rr="MSPointerDown",Pt="MSPointerMove MSPointerUp MSPointerCancel");function nr(){this.evEl=rr,this.evWin=Pt,ae.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}v(nr,ae,{handler:function(B){var N=this.store,G=!1,$=!1,ce=B.type.toLowerCase().replace("ms",""),Me=tr[ce],$e=fn[B.pointerType]||B.pointerType,bt=$e==K,je=L(N,B.pointerId,"pointerId");Me&W&&(B.button===0||B.button===2||bt)?je<0&&(N.push(B),je=N.length-1):Me&(Z|ie)?G=!0:!bt&&B.buttons===0&&(G=!0,$=!0,Me=tr.pointerup),!(je<0)&&($||(N[je]=B),this.callback(this.manager,Me,{pointers:N,changedPointers:[B],pointerType:$e,srcEvent:N[je]}),G&&N.splice(je,1))}});var Mr={touchstart:W,touchmove:ee,touchend:Z,touchcancel:ie},qt="touchstart",ir="touchstart touchmove touchend touchcancel";function Ht(){this.evTarget=qt,this.evWin=ir,this.started=!1,ae.apply(this,arguments)}v(Ht,ae,{handler:function(B){var N=Mr[B.type];if(N===W&&(this.started=!0),!!this.started){var G=ft.call(this,B,N);N&(Z|ie)&&G[0].length-G[1].length===0&&(this.started=!1),this.callback(this.manager,N,{pointers:G[0],changedPointers:G[1],pointerType:K,srcEvent:B})}}});function ft(T,B){var N=S(T.touches),G=S(T.changedTouches);return B&(Z|ie)&&(N=I(N.concat(G),"identifier")),[N,G]}var Le={touchstart:W,touchmove:ee,touchend:Z,touchcancel:ie},hr="touchstart touchmove touchend touchcancel";function gt(){this.evTarget=hr,this.targetIds={},ae.apply(this,arguments)}v(gt,ae,{handler:function(B){var N=Le[B.type],G=pr.call(this,B,N);G&&this.callback(this.manager,N,{pointers:G[0],changedPointers:G[1],pointerType:K,srcEvent:B})}});function pr(T,B){var N=S(T.touches),G=this.targetIds;if(B&(W|ee)&&N.length===1)return G[N[0].identifier]=!0,[N,N];var $,ce,Me=S(T.changedTouches),$e=[],bt=this.target;if(ce=N.filter(function(je){return C(je.target,bt)}),B===W)for($=0;$<ce.length;)G[ce[$].identifier]=!0,$++;for($=0;$<Me.length;)G[Me[$].identifier]&&$e.push(Me[$]),B&(Z|ie)&&delete G[Me[$].identifier],$++;if($e.length)return[I(ce.concat($e),"identifier"),$e]}var vr=2500,Gt=25;function Ct(){ae.apply(this,arguments);var T=y(this.handler,this);this.touch=new gt(this.manager,T),this.mouse=new st(this.manager,T),this.primaryTouch=null,this.lastTouches=[]}v(Ct,ae,{handler:function(B,N,G){var $=G.pointerType==K,ce=G.pointerType==J;if(!(ce&&G.sourceCapabilities&&G.sourceCapabilities.firesTouchEvents)){if($)mr.call(this,N,G);else if(ce&&hn.call(this,G))return;this.callback(B,N,G)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function mr(T,B){T&W?(this.primaryTouch=B.changedPointers[0].identifier,Ir.call(this,B)):T&(Z|ie)&&Ir.call(this,B)}function Ir(T){var B=T.changedPointers[0];if(B.identifier===this.primaryTouch){var N={x:B.clientX,y:B.clientY};this.lastTouches.push(N);var G=this.lastTouches,$=function(){var ce=G.indexOf(N);ce>-1&&G.splice(ce,1)};setTimeout($,vr)}}function hn(T){for(var B=T.srcEvent.clientX,N=T.srcEvent.clientY,G=0;G<this.lastTouches.length;G++){var $=this.lastTouches[G],ce=Math.abs(B-$.x),Me=Math.abs(N-$.y);if(ce<=Gt&&Me<=Gt)return!0}return!1}var Wr=a?O(a.style,"touchAction"):r,Zr=Wr!==r,Kt="compute",Ye="auto",qe="manipulation",nt="none",yt="pan-x",ht="pan-y",jt=dl();function Tr(T,B){this.manager=T,this.set(B)}Tr.prototype={set:function(T){T==Kt&&(T=this.compute()),Zr&&this.manager.element.style&&jt[T]&&(this.manager.element.style[Wr]=T),this.actions=T.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var T=[];return m(this.manager.recognizers,function(B){b(B.options.enable,[B])&&(T=T.concat(B.getTouchAction()))}),Yr(T.join(" "))},preventDefaults:function(T){var B=T.srcEvent,N=T.offsetDirection;if(this.manager.session.prevented){B.preventDefault();return}var G=this.actions,$=M(G,nt)&&!jt[nt],ce=M(G,ht)&&!jt[ht],Me=M(G,yt)&&!jt[yt];if($){var $e=T.pointers.length===1,bt=T.distance<2,je=T.deltaTime<250;if($e&&bt&&je)return}if(!(Me&&ce)&&($||ce&&N&ge||Me&&N&Re))return this.preventSrc(B)},preventSrc:function(T){this.manager.session.prevented=!0,T.preventDefault()}};function Yr(T){if(M(T,nt))return nt;var B=M(T,yt),N=M(T,ht);return B&&N?nt:B||N?B?yt:ht:M(T,qe)?qe:Ye}function dl(){if(!Zr)return!1;var T={},B=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(N){T[N]=B?n.CSS.supports("touch-action",N):!0}),T}var si=1,Bt=2,pn=4,Pr=8,Ar=Pr,Rn=16,ar=32;function gr(T){this.options=h({},this.defaults,T||{}),this.id=F(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=si,this.simultaneous={},this.requireFail=[]}gr.prototype={defaults:{},set:function(T){return h(this.options,T),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(T){if(f(T,"recognizeWith",this))return this;var B=this.simultaneous;return T=ui(T,this),B[T.id]||(B[T.id]=T,T.recognizeWith(this)),this},dropRecognizeWith:function(T){return f(T,"dropRecognizeWith",this)?this:(T=ui(T,this),delete this.simultaneous[T.id],this)},requireFailure:function(T){if(f(T,"requireFailure",this))return this;var B=this.requireFail;return T=ui(T,this),L(B,T)===-1&&(B.push(T),T.requireFailure(this)),this},dropRequireFailure:function(T){if(f(T,"dropRequireFailure",this))return this;T=ui(T,this);var B=L(this.requireFail,T);return B>-1&&this.requireFail.splice(B,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(T){return!!this.simultaneous[T.id]},emit:function(T){var B=this,N=this.state;function G($){B.manager.emit($,T)}N<Pr&&G(B.options.event+zo(N)),G(B.options.event),T.additionalEvent&&G(T.additionalEvent),N>=Pr&&G(B.options.event+zo(N))},tryEmit:function(T){if(this.canEmit())return this.emit(T);this.state=ar},canEmit:function(){for(var T=0;T<this.requireFail.length;){if(!(this.requireFail[T].state&(ar|si)))return!1;T++}return!0},recognize:function(T){var B=h({},T);if(!b(this.options.enable,[this,B])){this.reset(),this.state=ar;return}this.state&(Ar|Rn|ar)&&(this.state=si),this.state=this.process(B),this.state&(Bt|pn|Pr|Rn)&&this.tryEmit(B)},process:function(T){},getTouchAction:function(){},reset:function(){}};function zo(T){return T&Rn?"cancel":T&Pr?"end":T&pn?"move":T&Bt?"start":""}function Qo(T){return T==pe?"down":T==we?"up":T==le?"left":T==oe?"right":""}function ui(T,B){var N=B.manager;return N?N.get(T):T}function _t(){gr.apply(this,arguments)}v(_t,gr,{defaults:{pointers:1},attrTest:function(T){var B=this.options.pointers;return B===0||T.pointers.length===B},process:function(T){var B=this.state,N=T.eventType,G=B&(Bt|pn),$=this.attrTest(T);return G&&(N&ie||!$)?B|Rn:G||$?N&Z?B|Pr:B&Bt?B|pn:Bt:ar}});function li(){_t.apply(this,arguments),this.pX=null,this.pY=null}v(li,_t,{defaults:{event:"pan",threshold:10,pointers:1,direction:Se},getTouchAction:function(){var T=this.options.direction,B=[];return T&ge&&B.push(ht),T&Re&&B.push(yt),B},directionTest:function(T){var B=this.options,N=!0,G=T.distance,$=T.direction,ce=T.deltaX,Me=T.deltaY;return $&B.direction||(B.direction&ge?($=ce===0?te:ce<0?le:oe,N=ce!=this.pX,G=Math.abs(T.deltaX)):($=Me===0?te:Me<0?we:pe,N=Me!=this.pY,G=Math.abs(T.deltaY))),T.direction=$,N&&G>B.threshold&&$&B.direction},attrTest:function(T){return _t.prototype.attrTest.call(this,T)&&(this.state&Bt||!(this.state&Bt)&&this.directionTest(T))},emit:function(T){this.pX=T.deltaX,this.pY=T.deltaY;var B=Qo(T.direction);B&&(T.additionalEvent=this.options.event+B),this._super.emit.call(this,T)}});function Ji(){_t.apply(this,arguments)}v(Ji,_t,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[nt]},attrTest:function(T){return this._super.attrTest.call(this,T)&&(Math.abs(T.scale-1)>this.options.threshold||this.state&Bt)},emit:function(T){if(T.scale!==1){var B=T.scale<1?"in":"out";T.additionalEvent=this.options.event+B}this._super.emit.call(this,T)}});function Xi(){gr.apply(this,arguments),this._timer=null,this._input=null}v(Xi,gr,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ye]},process:function(T){var B=this.options,N=T.pointers.length===B.pointers,G=T.distance<B.threshold,$=T.deltaTime>B.time;if(this._input=T,!G||!N||T.eventType&(Z|ie)&&!$)this.reset();else if(T.eventType&W)this.reset(),this._timer=c(function(){this.state=Ar,this.tryEmit()},B.time,this);else if(T.eventType&Z)return Ar;return ar},reset:function(){clearTimeout(this._timer)},emit:function(T){this.state===Ar&&(T&&T.eventType&Z?this.manager.emit(this.options.event+"up",T):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function Wi(){_t.apply(this,arguments)}v(Wi,_t,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[nt]},attrTest:function(T){return this._super.attrTest.call(this,T)&&(Math.abs(T.rotation)>this.options.threshold||this.state&Bt)}});function Zi(){_t.apply(this,arguments)}v(Zi,_t,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ge|Re,pointers:1},getTouchAction:function(){return li.prototype.getTouchAction.call(this)},attrTest:function(T){var B=this.options.direction,N;return B&(ge|Re)?N=T.overallVelocity:B&ge?N=T.overallVelocityX:B&Re&&(N=T.overallVelocityY),this._super.attrTest.call(this,T)&&B&T.offsetDirection&&T.distance>this.options.threshold&&T.maxPointers==this.options.pointers&&l(N)>this.options.velocity&&T.eventType&Z},emit:function(T){var B=Qo(T.offsetDirection);B&&this.manager.emit(this.options.event+B,T),this.manager.emit(this.options.event,T)}});function ci(){gr.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}v(ci,gr,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[qe]},process:function(T){var B=this.options,N=T.pointers.length===B.pointers,G=T.distance<B.threshold,$=T.deltaTime<B.time;if(this.reset(),T.eventType&W&&this.count===0)return this.failTimeout();if(G&&$&&N){if(T.eventType!=Z)return this.failTimeout();var ce=this.pTime?T.timeStamp-this.pTime<B.interval:!0,Me=!this.pCenter||me(this.pCenter,T.center)<B.posThreshold;this.pTime=T.timeStamp,this.pCenter=T.center,!Me||!ce?this.count=1:this.count+=1,this._input=T;var $e=this.count%B.taps;if($e===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=Ar,this.tryEmit()},B.interval,this),Bt):Ar}return ar},failTimeout:function(){return this._timer=c(function(){this.state=ar},this.options.interval,this),ar},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ar&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function vn(T,B){return B=B||{},B.recognizers=x(B.recognizers,vn.defaults.preset),new Yi(T,B)}vn.VERSION="2.0.7",vn.defaults={domEvents:!1,touchAction:Kt,enable:!0,inputTarget:null,inputClass:null,preset:[[Wi,{enable:!1}],[Ji,{enable:!1},["rotate"]],[Zi,{direction:ge}],[li,{direction:ge},["swipe"]],[ci],[ci,{event:"doubletap",taps:2},["tap"]],[Xi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var fl=1,Uo=2;function Yi(T,B){this.options=h({},vn.defaults,B||{}),this.options.inputTarget=this.options.inputTarget||T,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=T,this.input=H(this),this.touchAction=new Tr(this,this.options.touchAction),qo(this,!0),m(this.options.recognizers,function(N){var G=this.add(new N[0](N[1]));N[2]&&G.recognizeWith(N[2]),N[3]&&G.requireFailure(N[3])},this)}Yi.prototype={set:function(T){return h(this.options,T),T.touchAction&&this.touchAction.update(),T.inputTarget&&(this.input.destroy(),this.input.target=T.inputTarget,this.input.init()),this},stop:function(T){this.session.stopped=T?Uo:fl},recognize:function(T){var B=this.session;if(!B.stopped){this.touchAction.preventDefaults(T);var N,G=this.recognizers,$=B.curRecognizer;(!$||$&&$.state&Ar)&&($=B.curRecognizer=null);for(var ce=0;ce<G.length;)N=G[ce],B.stopped!==Uo&&(!$||N==$||N.canRecognizeWith($))?N.recognize(T):N.reset(),!$&&N.state&(Bt|pn|Pr)&&($=B.curRecognizer=N),ce++}},get:function(T){if(T instanceof gr)return T;for(var B=this.recognizers,N=0;N<B.length;N++)if(B[N].options.event==T)return B[N];return null},add:function(T){if(f(T,"add",this))return this;var B=this.get(T.options.event);return B&&this.remove(B),this.recognizers.push(T),T.manager=this,this.touchAction.update(),T},remove:function(T){if(f(T,"remove",this))return this;if(T=this.get(T),T){var B=this.recognizers,N=L(B,T);N!==-1&&(B.splice(N,1),this.touchAction.update())}return this},on:function(T,B){if(T!==r&&B!==r){var N=this.handlers;return m(R(T),function(G){N[G]=N[G]||[],N[G].push(B)}),this}},off:function(T,B){if(T!==r){var N=this.handlers;return m(R(T),function(G){B?N[G]&&N[G].splice(L(N[G],B),1):delete N[G]}),this}},emit:function(T,B){this.options.domEvents&&hl(T,B);var N=this.handlers[T]&&this.handlers[T].slice();if(!(!N||!N.length)){B.type=T,B.preventDefault=function(){B.srcEvent.preventDefault()};for(var G=0;G<N.length;)N[G](B),G++}},destroy:function(){this.element&&qo(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function qo(T,B){var N=T.element;if(N.style){var G;m(T.options.cssProps,function($,ce){G=O(N.style,ce),B?(T.oldCssProps[G]=N.style[G],N.style[G]=$):N.style[G]=T.oldCssProps[G]||""}),B||(T.oldCssProps={})}}function hl(T,B){var N=t.createEvent("Event");N.initEvent(T,!0,!0),N.gesture=B,B.target.dispatchEvent(N)}return h(vn,{INPUT_START:W,INPUT_MOVE:ee,INPUT_END:Z,INPUT_CANCEL:ie,STATE_POSSIBLE:si,STATE_BEGAN:Bt,STATE_CHANGED:pn,STATE_ENDED:Pr,STATE_RECOGNIZED:Ar,STATE_CANCELLED:Rn,STATE_FAILED:ar,DIRECTION_NONE:te,DIRECTION_LEFT:le,DIRECTION_RIGHT:oe,DIRECTION_UP:we,DIRECTION_DOWN:pe,DIRECTION_HORIZONTAL:ge,DIRECTION_VERTICAL:Re,DIRECTION_ALL:Se,Manager:Yi,Input:ae,TouchAction:Tr,TouchInput:gt,MouseInput:st,PointerEventInput:nr,TouchMouseInput:Ct,SingleTouchInput:Ht,Recognizer:gr,AttrRecognizer:_t,Tap:ci,Pan:li,Swipe:Zi,Pinch:Ji,Rotate:Wi,Press:Xi,on:w,off:E,each:m,merge:g,extend:p,assign:h,inherit:v,bindFn:y,prefixed:O}),vn}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function Ws(n,t,e){var r=t.getBoundingClientRect(),i=r.top,a=r.left,o=r.width,s=r.height;return e&&(a=a+o*e.left,i=i+s*(1-e.bottom-e.height),o=o*e.width,s=s*e.height),new d.Vector2((n.x-a)/o*2-1,-(n.y-i)/s*2+1)}var Hu=new d.OrthographicCamera(-1,1,1,-1,0,1),Io=new d.BufferGeometry;Io.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Io.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var un=new d.Mesh(Io),To=new d.Scene;To.add(un);var gp=`
|
|
1432
|
+
`;return function(){var $=new Error("get-stack-trace"),ce=$&&$.stack?$.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Ce=n.console&&(n.console.warn||n.console.log);return Ce&&Ce.call(n.console,G,ce),T.apply(this,arguments)}}var h;typeof Object.assign!="function"?h=function(B){if(B===r||B===null)throw new TypeError("Cannot convert undefined or null to object");for(var N=Object(B),G=1;G<arguments.length;G++){var $=arguments[G];if($!==r&&$!==null)for(var ce in $)$.hasOwnProperty(ce)&&(N[ce]=$[ce])}return N}:h=Object.assign;var p=A(function(B,N,G){for(var $=Object.keys(N),ce=0;ce<$.length;)(!G||G&&B[$[ce]]===r)&&(B[$[ce]]=N[$[ce]]),ce++;return B},"extend","Use `assign`."),g=A(function(B,N){return p(B,N,!0)},"merge","Use `assign`.");function v(T,B,N){var G=B.prototype,$;$=T.prototype=Object.create(G),$.constructor=T,$._super=G,N&&h($,N)}function y(T,B){return function(){return T.apply(B,arguments)}}function b(T,B){return typeof T==o?T.apply(B&&B[0]||r,B):T}function x(T,B){return T===r?B:T}function w(T,B,N){m(R(B),function(G){T.addEventListener(G,N,!1)})}function E(T,B,N){m(R(B),function(G){T.removeEventListener(G,N,!1)})}function M(T,B){for(;T;){if(T==B)return!0;T=T.parentNode}return!1}function C(T,B){return T.indexOf(B)>-1}function R(T){return T.trim().split(/\s+/g)}function L(T,B,N){if(T.indexOf&&!N)return T.indexOf(B);for(var G=0;G<T.length;){if(N&&T[G][N]==B||!N&&T[G]===B)return G;G++}return-1}function S(T){return Array.prototype.slice.call(T,0)}function I(T,B,N){for(var G=[],$=[],ce=0;ce<T.length;){var Ce=T[ce][B];L($,Ce)<0&&G.push(T[ce]),$[ce]=Ce,ce++}return G=G.sort(function(bt,je){return bt[B]>je[B]}),G}function O(T,B){for(var N,G,$=B[0].toUpperCase()+B.slice(1),ce=0;ce<i.length;){if(N=i[ce],G=N?N+$:B,G in T)return G;ce++}return r}var P=1;function F(){return P++}function V(T){var B=T.ownerDocument||T;return B.defaultView||B.parentWindow||n}var D=/mobile|tablet|ip(ad|hone|od)|android/i,z="ontouchstart"in n,U=O(n,"PointerEvent")!==r,q=z&&D.test(navigator.userAgent),K="touch",j="pen",J="mouse",X="kinect",Y=25,W=1,ee=2,Z=4,ie=8,te=1,le=2,oe=4,we=8,pe=16,ge=le|oe,Re=we|pe,Se=ge|Re,Te=["x","y"],re=["clientX","clientY"];function ae(T,B){var N=this;this.manager=T,this.callback=B,this.element=T.element,this.target=T.options.inputTarget,this.domHandler=function(G){b(T.options.enable,[T])&&N.handler(G)},this.init()}ae.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(V(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(V(this.element),this.evWin,this.domHandler)}};function H(T){var B,N=T.options.inputClass;return N?B=N:U?B=nr:q?B=gt:z?B=Mt:B=st,new B(T,Ve)}function Ve(T,B,N){var G=N.pointers.length,$=N.changedPointers.length,ce=B&W&&G-$===0,Ce=B&(Z|ie)&&G-$===0;N.isFirst=!!ce,N.isFinal=!!Ce,ce&&(T.session={}),N.eventType=B,Fe(T,N),T.emit("hammer.input",N),T.recognize(N),T.session.prevInput=N}function Fe(T,B){var N=T.session,G=B.pointers,$=G.length;N.firstInput||(N.firstInput=be(B)),$>1&&!N.firstMultiple?N.firstMultiple=be(B):$===1&&(N.firstMultiple=!1);var ce=N.firstInput,Ce=N.firstMultiple,$e=Ce?Ce.center:ce.center,bt=B.center=ve(G);B.timeStamp=u(),B.deltaTime=B.timeStamp-ce.timeStamp,B.angle=Qe($e,bt),B.distance=me($e,bt),Ie(N,B),B.offsetDirection=ye(B.deltaX,B.deltaY);var je=xe(B.deltaTime,B.deltaX,B.deltaY);B.overallVelocityX=je.x,B.overallVelocityY=je.y,B.overallVelocity=l(je.x)>l(je.y)?je.x:je.y,B.scale=Ce?rt(Ce.pointers,G):1,B.rotation=Ce?Ke(Ce.pointers,G):0,B.maxPointers=N.prevInput?B.pointers.length>N.prevInput.maxPointers?B.pointers.length:N.prevInput.maxPointers:B.pointers.length,Ge(N,B);var or=T.element;M(B.srcEvent.target,or)&&(or=B.srcEvent.target),B.target=or}function Ie(T,B){var N=B.center,G=T.offsetDelta||{},$=T.prevDelta||{},ce=T.prevInput||{};(B.eventType===W||ce.eventType===Z)&&($=T.prevDelta={x:ce.deltaX||0,y:ce.deltaY||0},G=T.offsetDelta={x:N.x,y:N.y}),B.deltaX=$.x+(N.x-G.x),B.deltaY=$.y+(N.y-G.y)}function Ge(T,B){var N=T.lastInterval||B,G=B.timeStamp-N.timeStamp,$,ce,Ce,$e;if(B.eventType!=ie&&(G>Y||N.velocity===r)){var bt=B.deltaX-N.deltaX,je=B.deltaY-N.deltaY,or=xe(G,bt,je);ce=or.x,Ce=or.y,$=l(or.x)>l(or.y)?or.x:or.y,$e=ye(bt,je),T.lastInterval=B}else $=N.velocity,ce=N.velocityX,Ce=N.velocityY,$e=N.direction;B.velocity=$,B.velocityX=ce,B.velocityY=Ce,B.direction=$e}function be(T){for(var B=[],N=0;N<T.pointers.length;)B[N]={clientX:s(T.pointers[N].clientX),clientY:s(T.pointers[N].clientY)},N++;return{timeStamp:u(),pointers:B,center:ve(B),deltaX:T.deltaX,deltaY:T.deltaY}}function ve(T){var B=T.length;if(B===1)return{x:s(T[0].clientX),y:s(T[0].clientY)};for(var N=0,G=0,$=0;$<B;)N+=T[$].clientX,G+=T[$].clientY,$++;return{x:s(N/B),y:s(G/B)}}function xe(T,B,N){return{x:B/T||0,y:N/T||0}}function ye(T,B){return T===B?te:l(T)>=l(B)?T<0?le:oe:B<0?we:pe}function me(T,B,N){N||(N=Te);var G=B[N[0]]-T[N[0]],$=B[N[1]]-T[N[1]];return Math.sqrt(G*G+$*$)}function Qe(T,B,N){N||(N=Te);var G=B[N[0]]-T[N[0]],$=B[N[1]]-T[N[1]];return Math.atan2($,G)*180/Math.PI}function Ke(T,B){return Qe(B[1],B[0],re)+Qe(T[1],T[0],re)}function rt(T,B){return me(B[0],B[1],re)/me(T[0],T[1],re)}var Xr={mousedown:W,mousemove:ee,mouseup:Z},ke="mousedown",Ze="mousemove mouseup";function st(){this.evEl=ke,this.evWin=Ze,this.pressed=!1,ae.apply(this,arguments)}v(st,ae,{handler:function(B){var N=Xr[B.type];N&W&&(B.button===0||B.button===2)&&(this.pressed=!0),N&ee&&B.which!==1&&(N=Z),this.pressed&&(N&Z&&(this.pressed=!1),this.callback(this.manager,N,{pointers:[B],changedPointers:[B],pointerType:J,srcEvent:B}))}});var tr={pointerdown:W,pointermove:ee,pointerup:Z,pointercancel:ie,pointerout:ie},fn={2:K,3:j,4:J,5:X},rr="pointerdown",Pt="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(rr="MSPointerDown",Pt="MSPointerMove MSPointerUp MSPointerCancel");function nr(){this.evEl=rr,this.evWin=Pt,ae.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}v(nr,ae,{handler:function(B){var N=this.store,G=!1,$=!1,ce=B.type.toLowerCase().replace("ms",""),Ce=tr[ce],$e=fn[B.pointerType]||B.pointerType,bt=$e==K,je=L(N,B.pointerId,"pointerId");Ce&W&&(B.button===0||B.button===2||bt)?je<0&&(N.push(B),je=N.length-1):Ce&(Z|ie)?G=!0:!bt&&B.buttons===0&&(G=!0,$=!0,Ce=tr.pointerup),!(je<0)&&($||(N[je]=B),this.callback(this.manager,Ce,{pointers:N,changedPointers:[B],pointerType:$e,srcEvent:N[je]}),G&&N.splice(je,1))}});var Cr={touchstart:W,touchmove:ee,touchend:Z,touchcancel:ie},qt="touchstart",ir="touchstart touchmove touchend touchcancel";function Ht(){this.evTarget=qt,this.evWin=ir,this.started=!1,ae.apply(this,arguments)}v(Ht,ae,{handler:function(B){var N=Cr[B.type];if(N===W&&(this.started=!0),!!this.started){var G=ft.call(this,B,N);N&(Z|ie)&&G[0].length-G[1].length===0&&(this.started=!1),this.callback(this.manager,N,{pointers:G[0],changedPointers:G[1],pointerType:K,srcEvent:B})}}});function ft(T,B){var N=S(T.touches),G=S(T.changedTouches);return B&(Z|ie)&&(N=I(N.concat(G),"identifier")),[N,G]}var Le={touchstart:W,touchmove:ee,touchend:Z,touchcancel:ie},hr="touchstart touchmove touchend touchcancel";function gt(){this.evTarget=hr,this.targetIds={},ae.apply(this,arguments)}v(gt,ae,{handler:function(B){var N=Le[B.type],G=pr.call(this,B,N);G&&this.callback(this.manager,N,{pointers:G[0],changedPointers:G[1],pointerType:K,srcEvent:B})}});function pr(T,B){var N=S(T.touches),G=this.targetIds;if(B&(W|ee)&&N.length===1)return G[N[0].identifier]=!0,[N,N];var $,ce,Ce=S(T.changedTouches),$e=[],bt=this.target;if(ce=N.filter(function(je){return M(je.target,bt)}),B===W)for($=0;$<ce.length;)G[ce[$].identifier]=!0,$++;for($=0;$<Ce.length;)G[Ce[$].identifier]&&$e.push(Ce[$]),B&(Z|ie)&&delete G[Ce[$].identifier],$++;if($e.length)return[I(ce.concat($e),"identifier"),$e]}var vr=2500,Gt=25;function Mt(){ae.apply(this,arguments);var T=y(this.handler,this);this.touch=new gt(this.manager,T),this.mouse=new st(this.manager,T),this.primaryTouch=null,this.lastTouches=[]}v(Mt,ae,{handler:function(B,N,G){var $=G.pointerType==K,ce=G.pointerType==J;if(!(ce&&G.sourceCapabilities&&G.sourceCapabilities.firesTouchEvents)){if($)mr.call(this,N,G);else if(ce&&hn.call(this,G))return;this.callback(B,N,G)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function mr(T,B){T&W?(this.primaryTouch=B.changedPointers[0].identifier,Ir.call(this,B)):T&(Z|ie)&&Ir.call(this,B)}function Ir(T){var B=T.changedPointers[0];if(B.identifier===this.primaryTouch){var N={x:B.clientX,y:B.clientY};this.lastTouches.push(N);var G=this.lastTouches,$=function(){var ce=G.indexOf(N);ce>-1&&G.splice(ce,1)};setTimeout($,vr)}}function hn(T){for(var B=T.srcEvent.clientX,N=T.srcEvent.clientY,G=0;G<this.lastTouches.length;G++){var $=this.lastTouches[G],ce=Math.abs(B-$.x),Ce=Math.abs(N-$.y);if(ce<=Gt&&Ce<=Gt)return!0}return!1}var Wr=a?O(a.style,"touchAction"):r,Zr=Wr!==r,Kt="compute",Ye="auto",qe="manipulation",nt="none",yt="pan-x",ht="pan-y",jt=dl();function Tr(T,B){this.manager=T,this.set(B)}Tr.prototype={set:function(T){T==Kt&&(T=this.compute()),Zr&&this.manager.element.style&&jt[T]&&(this.manager.element.style[Wr]=T),this.actions=T.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var T=[];return m(this.manager.recognizers,function(B){b(B.options.enable,[B])&&(T=T.concat(B.getTouchAction()))}),Yr(T.join(" "))},preventDefaults:function(T){var B=T.srcEvent,N=T.offsetDirection;if(this.manager.session.prevented){B.preventDefault();return}var G=this.actions,$=C(G,nt)&&!jt[nt],ce=C(G,ht)&&!jt[ht],Ce=C(G,yt)&&!jt[yt];if($){var $e=T.pointers.length===1,bt=T.distance<2,je=T.deltaTime<250;if($e&&bt&&je)return}if(!(Ce&&ce)&&($||ce&&N&ge||Ce&&N&Re))return this.preventSrc(B)},preventSrc:function(T){this.manager.session.prevented=!0,T.preventDefault()}};function Yr(T){if(C(T,nt))return nt;var B=C(T,yt),N=C(T,ht);return B&&N?nt:B||N?B?yt:ht:C(T,qe)?qe:Ye}function dl(){if(!Zr)return!1;var T={},B=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(N){T[N]=B?n.CSS.supports("touch-action",N):!0}),T}var si=1,Bt=2,pn=4,Pr=8,Ar=Pr,Rn=16,ar=32;function gr(T){this.options=h({},this.defaults,T||{}),this.id=F(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=si,this.simultaneous={},this.requireFail=[]}gr.prototype={defaults:{},set:function(T){return h(this.options,T),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(T){if(f(T,"recognizeWith",this))return this;var B=this.simultaneous;return T=ui(T,this),B[T.id]||(B[T.id]=T,T.recognizeWith(this)),this},dropRecognizeWith:function(T){return f(T,"dropRecognizeWith",this)?this:(T=ui(T,this),delete this.simultaneous[T.id],this)},requireFailure:function(T){if(f(T,"requireFailure",this))return this;var B=this.requireFail;return T=ui(T,this),L(B,T)===-1&&(B.push(T),T.requireFailure(this)),this},dropRequireFailure:function(T){if(f(T,"dropRequireFailure",this))return this;T=ui(T,this);var B=L(this.requireFail,T);return B>-1&&this.requireFail.splice(B,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(T){return!!this.simultaneous[T.id]},emit:function(T){var B=this,N=this.state;function G($){B.manager.emit($,T)}N<Pr&&G(B.options.event+zo(N)),G(B.options.event),T.additionalEvent&&G(T.additionalEvent),N>=Pr&&G(B.options.event+zo(N))},tryEmit:function(T){if(this.canEmit())return this.emit(T);this.state=ar},canEmit:function(){for(var T=0;T<this.requireFail.length;){if(!(this.requireFail[T].state&(ar|si)))return!1;T++}return!0},recognize:function(T){var B=h({},T);if(!b(this.options.enable,[this,B])){this.reset(),this.state=ar;return}this.state&(Ar|Rn|ar)&&(this.state=si),this.state=this.process(B),this.state&(Bt|pn|Pr|Rn)&&this.tryEmit(B)},process:function(T){},getTouchAction:function(){},reset:function(){}};function zo(T){return T&Rn?"cancel":T&Pr?"end":T&pn?"move":T&Bt?"start":""}function Qo(T){return T==pe?"down":T==we?"up":T==le?"left":T==oe?"right":""}function ui(T,B){var N=B.manager;return N?N.get(T):T}function _t(){gr.apply(this,arguments)}v(_t,gr,{defaults:{pointers:1},attrTest:function(T){var B=this.options.pointers;return B===0||T.pointers.length===B},process:function(T){var B=this.state,N=T.eventType,G=B&(Bt|pn),$=this.attrTest(T);return G&&(N&ie||!$)?B|Rn:G||$?N&Z?B|Pr:B&Bt?B|pn:Bt:ar}});function li(){_t.apply(this,arguments),this.pX=null,this.pY=null}v(li,_t,{defaults:{event:"pan",threshold:10,pointers:1,direction:Se},getTouchAction:function(){var T=this.options.direction,B=[];return T&ge&&B.push(ht),T&Re&&B.push(yt),B},directionTest:function(T){var B=this.options,N=!0,G=T.distance,$=T.direction,ce=T.deltaX,Ce=T.deltaY;return $&B.direction||(B.direction&ge?($=ce===0?te:ce<0?le:oe,N=ce!=this.pX,G=Math.abs(T.deltaX)):($=Ce===0?te:Ce<0?we:pe,N=Ce!=this.pY,G=Math.abs(T.deltaY))),T.direction=$,N&&G>B.threshold&&$&B.direction},attrTest:function(T){return _t.prototype.attrTest.call(this,T)&&(this.state&Bt||!(this.state&Bt)&&this.directionTest(T))},emit:function(T){this.pX=T.deltaX,this.pY=T.deltaY;var B=Qo(T.direction);B&&(T.additionalEvent=this.options.event+B),this._super.emit.call(this,T)}});function Ji(){_t.apply(this,arguments)}v(Ji,_t,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[nt]},attrTest:function(T){return this._super.attrTest.call(this,T)&&(Math.abs(T.scale-1)>this.options.threshold||this.state&Bt)},emit:function(T){if(T.scale!==1){var B=T.scale<1?"in":"out";T.additionalEvent=this.options.event+B}this._super.emit.call(this,T)}});function Xi(){gr.apply(this,arguments),this._timer=null,this._input=null}v(Xi,gr,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ye]},process:function(T){var B=this.options,N=T.pointers.length===B.pointers,G=T.distance<B.threshold,$=T.deltaTime>B.time;if(this._input=T,!G||!N||T.eventType&(Z|ie)&&!$)this.reset();else if(T.eventType&W)this.reset(),this._timer=c(function(){this.state=Ar,this.tryEmit()},B.time,this);else if(T.eventType&Z)return Ar;return ar},reset:function(){clearTimeout(this._timer)},emit:function(T){this.state===Ar&&(T&&T.eventType&Z?this.manager.emit(this.options.event+"up",T):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function Wi(){_t.apply(this,arguments)}v(Wi,_t,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[nt]},attrTest:function(T){return this._super.attrTest.call(this,T)&&(Math.abs(T.rotation)>this.options.threshold||this.state&Bt)}});function Zi(){_t.apply(this,arguments)}v(Zi,_t,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ge|Re,pointers:1},getTouchAction:function(){return li.prototype.getTouchAction.call(this)},attrTest:function(T){var B=this.options.direction,N;return B&(ge|Re)?N=T.overallVelocity:B&ge?N=T.overallVelocityX:B&Re&&(N=T.overallVelocityY),this._super.attrTest.call(this,T)&&B&T.offsetDirection&&T.distance>this.options.threshold&&T.maxPointers==this.options.pointers&&l(N)>this.options.velocity&&T.eventType&Z},emit:function(T){var B=Qo(T.offsetDirection);B&&this.manager.emit(this.options.event+B,T),this.manager.emit(this.options.event,T)}});function ci(){gr.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}v(ci,gr,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[qe]},process:function(T){var B=this.options,N=T.pointers.length===B.pointers,G=T.distance<B.threshold,$=T.deltaTime<B.time;if(this.reset(),T.eventType&W&&this.count===0)return this.failTimeout();if(G&&$&&N){if(T.eventType!=Z)return this.failTimeout();var ce=this.pTime?T.timeStamp-this.pTime<B.interval:!0,Ce=!this.pCenter||me(this.pCenter,T.center)<B.posThreshold;this.pTime=T.timeStamp,this.pCenter=T.center,!Ce||!ce?this.count=1:this.count+=1,this._input=T;var $e=this.count%B.taps;if($e===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=Ar,this.tryEmit()},B.interval,this),Bt):Ar}return ar},failTimeout:function(){return this._timer=c(function(){this.state=ar},this.options.interval,this),ar},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ar&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function vn(T,B){return B=B||{},B.recognizers=x(B.recognizers,vn.defaults.preset),new Yi(T,B)}vn.VERSION="2.0.7",vn.defaults={domEvents:!1,touchAction:Kt,enable:!0,inputTarget:null,inputClass:null,preset:[[Wi,{enable:!1}],[Ji,{enable:!1},["rotate"]],[Zi,{direction:ge}],[li,{direction:ge},["swipe"]],[ci],[ci,{event:"doubletap",taps:2},["tap"]],[Xi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var fl=1,Uo=2;function Yi(T,B){this.options=h({},vn.defaults,B||{}),this.options.inputTarget=this.options.inputTarget||T,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=T,this.input=H(this),this.touchAction=new Tr(this,this.options.touchAction),qo(this,!0),m(this.options.recognizers,function(N){var G=this.add(new N[0](N[1]));N[2]&&G.recognizeWith(N[2]),N[3]&&G.requireFailure(N[3])},this)}Yi.prototype={set:function(T){return h(this.options,T),T.touchAction&&this.touchAction.update(),T.inputTarget&&(this.input.destroy(),this.input.target=T.inputTarget,this.input.init()),this},stop:function(T){this.session.stopped=T?Uo:fl},recognize:function(T){var B=this.session;if(!B.stopped){this.touchAction.preventDefaults(T);var N,G=this.recognizers,$=B.curRecognizer;(!$||$&&$.state&Ar)&&($=B.curRecognizer=null);for(var ce=0;ce<G.length;)N=G[ce],B.stopped!==Uo&&(!$||N==$||N.canRecognizeWith($))?N.recognize(T):N.reset(),!$&&N.state&(Bt|pn|Pr)&&($=B.curRecognizer=N),ce++}},get:function(T){if(T instanceof gr)return T;for(var B=this.recognizers,N=0;N<B.length;N++)if(B[N].options.event==T)return B[N];return null},add:function(T){if(f(T,"add",this))return this;var B=this.get(T.options.event);return B&&this.remove(B),this.recognizers.push(T),T.manager=this,this.touchAction.update(),T},remove:function(T){if(f(T,"remove",this))return this;if(T=this.get(T),T){var B=this.recognizers,N=L(B,T);N!==-1&&(B.splice(N,1),this.touchAction.update())}return this},on:function(T,B){if(T!==r&&B!==r){var N=this.handlers;return m(R(T),function(G){N[G]=N[G]||[],N[G].push(B)}),this}},off:function(T,B){if(T!==r){var N=this.handlers;return m(R(T),function(G){B?N[G]&&N[G].splice(L(N[G],B),1):delete N[G]}),this}},emit:function(T,B){this.options.domEvents&&hl(T,B);var N=this.handlers[T]&&this.handlers[T].slice();if(!(!N||!N.length)){B.type=T,B.preventDefault=function(){B.srcEvent.preventDefault()};for(var G=0;G<N.length;)N[G](B),G++}},destroy:function(){this.element&&qo(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function qo(T,B){var N=T.element;if(N.style){var G;m(T.options.cssProps,function($,ce){G=O(N.style,ce),B?(T.oldCssProps[G]=N.style[G],N.style[G]=$):N.style[G]=T.oldCssProps[G]||""}),B||(T.oldCssProps={})}}function hl(T,B){var N=t.createEvent("Event");N.initEvent(T,!0,!0),N.gesture=B,B.target.dispatchEvent(N)}return h(vn,{INPUT_START:W,INPUT_MOVE:ee,INPUT_END:Z,INPUT_CANCEL:ie,STATE_POSSIBLE:si,STATE_BEGAN:Bt,STATE_CHANGED:pn,STATE_ENDED:Pr,STATE_RECOGNIZED:Ar,STATE_CANCELLED:Rn,STATE_FAILED:ar,DIRECTION_NONE:te,DIRECTION_LEFT:le,DIRECTION_RIGHT:oe,DIRECTION_UP:we,DIRECTION_DOWN:pe,DIRECTION_HORIZONTAL:ge,DIRECTION_VERTICAL:Re,DIRECTION_ALL:Se,Manager:Yi,Input:ae,TouchAction:Tr,TouchInput:gt,MouseInput:st,PointerEventInput:nr,TouchMouseInput:Mt,SingleTouchInput:Ht,Recognizer:gr,AttrRecognizer:_t,Tap:ci,Pan:li,Swipe:Zi,Pinch:Ji,Rotate:Wi,Press:Xi,on:w,off:E,each:m,merge:g,extend:p,assign:h,inherit:v,bindFn:y,prefixed:O}),vn}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function Ws(n,t,e){var r=t.getBoundingClientRect(),i=r.top,a=r.left,o=r.width,s=r.height;return e&&(a=a+o*e.left,i=i+s*(1-e.bottom-e.height),o=o*e.width,s=s*e.height),new d.Vector2((n.x-a)/o*2-1,-(n.y-i)/s*2+1)}var Hu=new d.OrthographicCamera(-1,1,1,-1,0,1),Io=new d.BufferGeometry;Io.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Io.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var un=new d.Mesh(Io),To=new d.Scene;To.add(un);var gp=`
|
|
1433
1433
|
varying vec2 vUv;
|
|
1434
1434
|
void main() {
|
|
1435
1435
|
vUv = uv;
|
|
@@ -1470,7 +1470,7 @@ void main() {
|
|
|
1470
1470
|
|
|
1471
1471
|
gl_Position = projectionMatrix * mvPosition;
|
|
1472
1472
|
}
|
|
1473
|
-
`,Cp=new d.OrthographicCamera(-1,1,1,-1,0,1),Po=new d.BufferGeometry;Po.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Po.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var Ku=new d.MeshBasicMaterial,to=new d.Mesh(Po,Ku),ju=new d.Scene;ju.add(to);var Mp=function(){function n(t){this.renderer=t,this.material=new d.ShaderMaterial({vertexShader:Sp,fragmentShader:Ep,uniforms:Object.assign({depthBuffer:new d.Uniform(null)}),blending:d.NoBlending,depthWrite:!0,depthTest:!0}),this.renderer.getContext()&&this.renderer.getContext()instanceof WebGLRenderingContext&&(this.material.extensions.fragDepth=!0)}return n.prototype.render=function(t,e){var r=this.renderer.getRenderTarget();this.material.uniforms.depthBuffer.value=t,to.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(ju,Cp),this.renderer.setRenderTarget(r),to.material=Ku},n.prototype.dispose=function(){this.material.dispose()},n}(),Ca=new d.Vector2,Bo=function(n){se(t,n);function t(e){var r,i,a,o,s,l,u=n.call(this)||this,c=t.parseArgs(e);u.mode="",u.pending=new Set,u.userAction=c.initial.userAction,u.destroyed=!1,u.ident=c.ident,u.scene=c.scene,u.xrCustomObjectsScene=c.xrCustomObjectsScene,u.helper=c.helper,u.boundingMesh=c.boundingMesh,u.camera=c.camera,u.renderer=c.renderer,u.scissor=c.scissor,u.element=c.element,u.models=c.models,u.enableWheel=c.enableWheel,u.enableIOSEDR=(r=c.enableIOSEDR)!==null&&r!==void 0?r:!1,u.enableEDL=(i=c.enableEDL)!==null&&i!==void 0?i:!0,u.enableHQ=(a=c.enableHQ)!==null&&a!==void 0?a:!0,u.works=c.works,u.imageOptions=c.imageOptions,u.videoTexture=c.videoTexture,u.extraElements=c.extraElements,u.initial=c.initial,u.currentPano=typeof u.initial.state.panoIndex=="number"?{workCode:(l=(o=u.initial.state.workCode)!==null&&o!==void 0?o:(s=c.works[0])===null||s===void 0?void 0:s.workCode)!==null&&l!==void 0?l:"",panoIndex:u.initial.state.panoIndex}:{workCode:u.initial.currentState.workCode,panoIndex:u.initial.currentState.panoIndex},u.needsRender=!0,u.modelSceneNeedsRender=!0,u.cameraMotion=new Ce({longitude:{value:u.camera.pose.longitude,circle:[0,Math.PI*2]},latitude:u.camera.pose.latitude,fov:u.camera.pose.fov}),u.inMomentumMovement=null,u.eventUnbinds=[c.element].concat(c.extraElements||[]).map(function(m){return u.bindEvents(m)}),u.pending.add("init-animation"),u.initAnimationReady=new Promise(function(m){dt.shared.add(function(){u.initAnimation().then(function(){u.pending.delete("init-animation"),m()})},!0)}),u.initAnimationIsReady=!1,u.initAnimationReady.then(function(){return u.initAnimationIsReady=!0}),u.modelScene=c.modelScene;var f=new d.Vector2;return u.renderer.getDrawingBufferSize(f),u.modelRenderTarget=c.modelRenderTarget,u.copyPass=new Gu(u.renderer),u.depthCopyPass=new Mp(u.renderer),u.screenBuffers=[],u.lastPostProcessingType=null,u}return t.parseArgs=function(e){return e instanceof t?e:k({},e)},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,c,f=this.parseArgs(e),m=f.initial,A=m.state,h=m.currentState,p=typeof A.panoIndex=="number"?{workCode:(a=(r=A.workCode)!==null&&r!==void 0?r:(i=f.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:A.panoIndex}:{workCode:h.workCode,panoIndex:h.panoIndex};return k(k({},p),{mode:"",longitude:(o=A.longitude)!==null&&o!==void 0?o:h.longitude,latitude:(s=A.latitude)!==null&&s!==void 0?s:h.latitude,fov:(l=A.fov)!==null&&l!==void 0?l:h.fov,offset:(u=A.offset)!==null&&u!==void 0?u:h.offset,distance:(c=A.distance)!==null&&c!==void 0?c:h.distance})},t.prototype.destroy=function(){var e;this.stopMomentumMovement(),this.destroyed=!0,this.off(),this.cameraMotion.dispose();for(var r=0,i=this.eventUnbinds;r<i.length;r++){var a=i[r];a()}this.copyEffect&&(this.copyEffect.dispose(),delete this.copyEffect),delete this.panState,(e=this.pressState)===null||e===void 0||e.stop(),delete this.pressState},t.prototype.isReady=function(){return this.inMomentumMovement===null&&this.pending.size===0&&this.cameraMotion.ended===!0},t.prototype.bindExtraElement=function(e){for(var r=0,i=this.eventUnbinds;r<i.length;r++){var a=i[r];if(a.element===e)return}this.eventUnbinds.push(this.bindEvents(e))},t.prototype.unbindExtraElement=function(e){for(var r=[],i=0,a=this.eventUnbinds;i<a.length;i++){var o=a[i];o.element===e?o():r.push(o)}this.eventUnbinds=r},t.prototype.updateRenderSize=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.modelRenderTarget.setSize(e.x,e.y),this.screenBuffers.forEach(function(r){r.setSize(e.x,e.y)})},t.prototype.updateModel=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0},t.prototype.updateWork=function(e,r,i,a){return this.works=e,this.userAction=a,!1},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={};this.cameraMotion.ended&&(this.cameraMotion.update(e),i.longitude=this.cameraMotion.value.longitude,i.latitude=this.cameraMotion.value.latitude,i.fov=this.cameraMotion.value.fov),Ut(i)&&this.setCamera(i)}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera)),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.postProcessing=function(e,r){this.destroyed},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={};return e.longitude!==void 0&&(o.longitude=e.longitude),e.latitude!==void 0&&(o.latitude=e.latitude),e.fov!==void 0&&(o.fov=e.fov),a.cameraMotion.set(o,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=0,l=e;s<l.length;s++){var u=l[s];o.push({key:u.key,progress:u.progress,value:{longitude:u.value.longitude,latitude:u.value.latitude,fov:u.value.fov}})}return a.cameraMotion.setKeyframes(o,r)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance})},t.prototype.initAnimation=function(){var e=this.initial;e.state,e.currentState,e.duration;var r=e.userAction,i=t.initAnimationEndState(this);return this.userAction=r,this.emit("initAnimation.start",_("initAnimation.start",{state:i,userAction:this.userAction})),this.emit("initAnimation.end",_("initAnimation.end",{state:i,userAction:this.userAction})),Promise.resolve()},t.prototype.setCamera=function(e){var r,i,a,o,s;e===void 0&&(e={});var l=(r=e.longitude)!==null&&r!==void 0?r:this.camera.pose.longitude,u=(i=e.latitude)!==null&&i!==void 0?i:this.camera.pose.latitude,c=(a=e.fov)!==null&&a!==void 0?a:this.camera.pose.fov,f=(o=e.distance)!==null&&o!==void 0?o:this.camera.pose.distance,m=(s=e.offset)!==null&&s!==void 0?s:this.camera.pose.offset,A=Lt(l,this.camera.pose.longitude,Math.PI*2)||Lt(u,this.camera.pose.latitude),h=Lt(c,this.camera.pose.fov),p=Lt(f,this.camera.pose.distance),g=Ii(m,this.camera.pose.offset);(h||A||g||p)&&(this.camera.setFromPose({longitude:l,latitude:u,fov:c,distance:f,offset:m}),this.emit("camera.update",_("camera.update",{userAction:this.userAction,state:k(k({},this.currentPano),{mode:this.mode,longitude:l,latitude:u,fov:c,offset:m,distance:f})})),this.needsRender=!0,this.modelSceneNeedsRender=!0)},t.prototype.stopMomentumMovement=function(){if(this.inMomentumMovement&&this.inMomentumMovement.event&&!this.inMomentumMovement.event.defaultPrevented&&!this.inMomentumMovement.event.isFinal){var e=_("gesture.momentum",k(k({},this.inMomentumMovement.event),{isFirst:!1,isFinal:!0}));this.emit("gesture.momentum",e)}this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pan",e)},t.prototype.onTapGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.tap",e)},t.prototype.onDblTapGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.dbltap",e),!e.defaultPrevented&&(e.type="gesture.tap",this.onTapGesture(e))},t.prototype.onPressGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.press",e)},t.prototype.onPinchGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pinch",e)},t.prototype.onMouseWheel=function(e){this.stopMomentumMovement(),this.emit("gesture.mousewheel",e)},t.prototype.onMouseMove=function(e){this.stopMomentumMovement(),this.emit("gesture.mousemove",e)},t.prototype.relativeClientPosition=function(e){return Ws(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(S){var I=Ws(S,r.element,r.scissor);return!(Math.abs(I.x)>1||Math.abs(I.y)>1)},a=new Qn.Manager(e),o=function(S){var I=S.session;return I.firstInput||null},s=new Qn.Pan({threshold:10,pointers:0}),l=new Qn.Tap({interval:410}),u=new Qn.Pinch({threshold:0,pointers:2});a.add([s,l,u]),a.on("panstart pan",function(S){var I=o(a);if(!(I&&!i(I.center))){var O=_("gesture.pan",{target:S.target,pointerType:S.pointerType,srcEvent:S.srcEvent,pointers:S.pointers.map(function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}),isFirst:S.isFirst,isFinal:S.isFinal,scale:S.scale,center:function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}(S.center),velocityX:S.velocityX,velocityY:S.velocityY,overallVelocityX:S.overallVelocityX,overallVelocityY:S.overallVelocityY,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onPanGesture(O),b()}}),a.on("tap",function(S){if(!(S.pointerType==="mouse"&&S.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var O=_("gesture.tap",{target:S.target,pointerType:S.pointerType,srcEvent:S.srcEvent,pointers:S.pointers.map(function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}),isFirst:!0,isFinal:!0,scale:S.scale,center:function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}(S.center),velocityX:S.velocityX,velocityY:S.velocityY,overallVelocityX:S.overallVelocityX,overallVelocityY:S.overallVelocityY,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onTapGesture(O),b()}}}),a.on("pinchstart pinch pinchend",function(S){var I=o(a);if(!(I&&!i(I.center))){var O=_("gesture.pinch",{target:S.target,pointerType:S.pointerType,srcEvent:S.srcEvent,pointers:S.pointers.map(function(P){var F,V=r.relativeClientPosition(P),D=new d.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(V,r.camera),{x:P.x,y:P.y,delta:(F=P.delta)!==null&&F!==void 0?F:0,buttons:0,coords:V,raycaster:D}}),isFirst:S.type==="pinchstart",isFinal:S.type==="pinchend",scale:S.scale,center:function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}(S.center),velocityX:S.velocityX,velocityY:S.velocityY,overallVelocityX:S.overallVelocityX,overallVelocityY:S.overallVelocityY,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onPinchGesture(O),b()}}),a.on("dbltap",function(S){if(!(S.pointerType==="mouse"&&S.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var O=_("gesture.dbltap",{target:S.target,pointerType:S.pointerType,srcEvent:S.srcEvent,pointers:S.pointers.map(function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}),isFirst:!0,isFinal:!0,scale:S.scale,center:function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}(S.center),velocityX:S.velocityX,velocityY:S.velocityY,overallVelocityX:S.overallVelocityX,overallVelocityY:S.overallVelocityY,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onDblTapGesture(O),b()}}});var c=null,f=null,m=function(S,I,O){var P={x:O.clientX,y:O.clientY},F=r.relativeClientPosition(P),V=new d.Raycaster;V.params.Points={threshold:.1},V.setFromCamera(F,r.camera);var D=k(k({},P),{coords:F,raycaster:V,buttons:O.buttons,delta:0}),z=S==="pinchend"?I:I-O.deltaY/280,U=_("gesture.pinch",{target:O.target,pointerType:"mouse",srcEvent:O,pointers:[k({},D)],isFirst:S==="pinchstart",isFinal:S==="pinchend",scale:fe(z,.1,10),center:k({},D),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});return U},A=function(S){var I,O={x:S.clientX,y:S.clientY};if(i(O)){if(S.preventDefault(),S.ctrlKey){var P=(I=c==null?void 0:c.prevEvent.scale)!==null&&I!==void 0?I:1,F=m(c?"pinch":"pinchstart",P,S);c===null?c={firstEvent:F,prevEvent:F}:c.prevEvent=F,r.onPinchGesture(F),f!==null&&window.clearTimeout(f),f=window.setTimeout(function(){var j;f=null;var J=(j=c==null?void 0:c.prevEvent.scale)!==null&&j!==void 0?j:1,X=m("pinchend",J,S);c=null,r.onPinchGesture(X)},200)}else{var V=(Math.abs(S.deltaY)>Math.abs(S.deltaX)?S.deltaY:S.deltaX)/-60,D=r.mouseWheelState!==void 0,z={x:S.clientX,y:S.clientY},U=r.relativeClientPosition(z),q=new d.Raycaster;q.params.Points={threshold:.1},q.setFromCamera(U,r.camera);var K=k(k({},z),{coords:U,raycaster:q,buttons:S.buttons,delta:V}),F=_("gesture.mousewheel",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[k({},K)],isFirst:D,isFinal:!1,scale:0,center:k({},K),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onMouseWheel(F),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var J=_("gesture.mousewheel",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[k(k({},K),{delta:0})],isFirst:!1,isFinal:!0,scale:0,center:k(k({},K),{delta:0}),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onMouseWheel(J)},100)}}b()}},h=function(S){if(!zn){if(!i({x:S.clientX,y:S.clientY})){p();return}var I=!1;r.mouseMoveState||(I=!0);var O={x:S.clientX,y:S.clientY},P=r.relativeClientPosition(O),F=new d.Raycaster;F.params.Points={threshold:.1},F.setFromCamera(P,r.camera);var V=k(k({},O),{coords:P,raycaster:F,buttons:S.buttons,delta:0}),D=_("gesture.mousemove",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[k({},V)],isFirst:I,isFinal:!1,scale:0,center:k({},V),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.mouseMoveState={timeStamp:he(),event:D},r.onMouseMove(D),r.pressState&&Math.abs(S.clientX-r.pressState.event.center.y)>10&&Math.abs(S.clientY-r.pressState.event.center.y)>10&&b()}},p=function(){if(r.mouseMoveState){var S=_(r.mouseMoveState.event.type,k(k({},r.mouseMoveState.event),{isFinal:!0}));delete r.mouseMoveState,r.onMouseMove(S)}b()},g=function(S){if(!i(S.center)){b();return}var I=!1;r.pressState||(I=!0,r.pressState={event:S,timeStamp:he(),stop:Q});var O=he()-r.pressState.timeStamp,P=_(r.pressState.event.type,k(k({},r.pressState.event),{isFirst:I,isFinal:!1,center:k(k({},r.pressState.event.center),{delta:O}),pointers:r.pressState.event.pointers.map(function(F){return k(k({},F),{delta:O})})}));r.onPressGesture(P),r.pressState&&(r.pressState.stop=dt.shared.add(function(F){g(S)},!0,1))},v=function(S){if(b(),!(S.touches.length>1||S.changedTouches.length<=0)){var I={x:S.changedTouches[0].clientX,y:S.changedTouches[0].clientY},O=r.relativeClientPosition(I),P=new d.Raycaster;P.params.Points={threshold:.1},P.setFromCamera(O,r.camera);var F=k(k({},I),{coords:O,raycaster:P,buttons:0,delta:0}),V=_("gesture.press",{target:S.target,pointerType:"touch",srcEvent:S,pointers:[k({},F)],isFirst:!1,isFinal:!1,scale:0,center:F,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});g(V)}},y=function(S){b();var I={x:S.clientX,y:S.clientY},O=r.relativeClientPosition(I),P=new d.Raycaster;P.params.Points={threshold:.1},P.setFromCamera(O,r.camera);var F=k(k({},I),{coords:O,raycaster:P,buttons:S.buttons,delta:0}),V=_("gesture.press",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[k({},F)],isFirst:!1,isFinal:!1,scale:0,center:F,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});g(V)},b=function(){var S;if(r.pressState){var I=he()-r.pressState.timeStamp,O=_(r.pressState.event.type,k(k({},r.pressState.event),{center:k(k({},r.pressState.event.center),{delta:I}),isFirst:!1,isFinal:!0,pointers:r.pressState.event.pointers.map(function(P){return k(k({},P),{delta:I})})}));r.onPressGesture(O),(S=r.pressState)===null||S===void 0||S.stop(),delete r.pressState}},x=null,w=function(S){var I,O=!1,P=!1;switch(S.type){case"gesturestart":O=!0;break;case"gestureend":P=!0;break}var F={x:S.clientX,y:S.clientY},V=r.relativeClientPosition(F),D=new d.Raycaster;D.params.Points={threshold:.1},D.setFromCamera(V,r.camera);var z=k(k({},F),{coords:V,raycaster:D,buttons:0,delta:0}),U=_("gesture.pinch",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[k({},z)],isFirst:O,isFinal:P,scale:(I=S.scale)!==null&&I!==void 0?I:1,center:k({},z),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});return U},E=function(S){if(S.preventDefault(),!zn){var I=w(S);x={firstEvent:I};var O=x.firstEvent;O&&!i(O.center)||r.onPinchGesture(I)}},C=function(S){if(S.preventDefault(),!zn&&x){var I=w(S),O=x.firstEvent;O&&!i(O.center)||r.onPinchGesture(I)}},M=function(S){if(S.preventDefault(),!zn&&x){var I=w(S),O=x.firstEvent;x=null,!(O&&!i(O.center))&&r.onPinchGesture(I)}},R=function(S){if(S&&typeof S.preventDefault=="function"&&S.currentTarget===e&&S.preventDefault(),typeof getSelection=="function"){var I=getSelection();I&&I.focusNode&&(I.removeAllRanges&&I.removeAllRanges(),I.empty&&I.empty())}};this.enableWheel&&e.addEventListener("wheel",A,{passive:!1}),e.addEventListener("mousemove",h,!1),e.addEventListener("mouseout",p,!1),e.addEventListener("touchstart",v,{passive:!0}),e.addEventListener("touchend",b,!1),e.addEventListener("touchcancel",b,!1),e.addEventListener("mousedown",y,!1),e.addEventListener("mouseup",b,!1),e.addEventListener("gesturestart",E,{passive:!1}),e.addEventListener("gesturechange",C,{passive:!1}),e.addEventListener("gestureend",M,{passive:!1}),e.addEventListener("touchstart",R,{passive:!1}),e.addEventListener("contextmenu",R,!1);var L=function(){a.destroy(),e.removeEventListener("wheel",A,!1),e.removeEventListener("mousemove",h,!1),e.removeEventListener("mouseout",p,!1),e.removeEventListener("touchstart",v,!1),e.removeEventListener("touchend",b,!1),e.removeEventListener("touchcancel",b,!1),e.removeEventListener("mousedown",y,!1),e.removeEventListener("mouseup",b,!1),e.removeEventListener("gesturestart",E,!1),e.removeEventListener("gesturechange",C,!1),e.removeEventListener("gestureend",M,!1),e.removeEventListener("touchstart",R,!1),e.removeEventListener("contextmenu",R,!1)};return Object.assign(L,{element:e})},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=Q);var a=this.works.getResolvedObserver(e);if(!a)return Promise.resolve();var o=["right","left","up","down","front","back"];return Promise.all(o.map(function(s){var l=k({key:"pano.".concat(De(e),".").concat(s)},Dt(i.imageOptions,["size","format","quality","mappings"])),u=a.images[s],c=sn(u,i.imageOptions.transform,l);return it(a.work).preload(c,{timeout:500})})).then(function(){return r(e),e})},t.prototype.updateScreenBuffer=function(e){var r,i,a,o,s,l;if(this.lastPostProcessingType!==e)if(this.lastPostProcessingType=e,e==="luminance"){if(this.screenBuffers.length===0){var u=this.renderer.getDrawingBufferSize(Ca);this.screenBuffers=[new d.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:d.sRGBEncoding}),this.modelRenderTarget]}}else if(e==="edl"){if(this.screenBuffers.length===0){var u=this.renderer.getDrawingBufferSize(Ca);this.screenBuffers=[new d.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,encoding:(o=(a=this.renderer)===null||a===void 0?void 0:a.outputEncoding)!==null&&o!==void 0?o:d.sRGBEncoding,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType}),this.modelRenderTarget]}this.models.setMaterial({useEDL:!0})}else if(e==="hq"){if(this.screenBuffers.length===0){var u=this.renderer.getDrawingBufferSize(Ca),c=new d.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(u.x,u.y,d.UnsignedIntType)});c.depthTexture.format=d.DepthFormat,c.depthBuffer=!0;var f=new d.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,encoding:(l=(s=this.renderer)===null||s===void 0?void 0:s.outputEncoding)!==null&&l!==void 0?l:d.sRGBEncoding,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:c.depthTexture});this.screenBuffers=[c,f,this.modelRenderTarget]}this.models.setMaterial({useHQDepth:!0,useHQWeight:!1,pointShape:"CIRCLE"})}else this.screenBuffers&&(this.screenBuffers.forEach(function(m){m.dispose()}),this.screenBuffers=[]),this.models.setMaterial({useEDL:!1,useHQDepth:!1,useHQWeight:!1})},t}(qi),ro=function(n){se(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Floorplan",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultFov=a.defaultFov,r.maxFov=a.maxFov,r.minFov=a.minFov,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.modelInScreen=a.modelInScreen,r.locationMotion=new Ce({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Ce({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Ce({perspToOrtho:r.camera.perspToOrtho.x}),r.currentTapId=null,r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.parseArgs=function(e){var r,i,a,o,s,l,u,c,f;if(e instanceof t)return e;var m=n.parseArgs.call(this,e);return k(k({},m),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultFov:(a=e.defaultFov)!==null&&a!==void 0?a:80,maxFov:(o=e.maxFov)!==null&&o!==void 0?o:120,minFov:(s=e.minFov)!==null&&s!==void 0?s:20,maxLatitude:(l=e.maxLatitude)!==null&&l!==void 0?l:+Math.PI/2,minLatitude:(u=e.minLatitude)!==null&&u!==void 0?u:-Math.PI/2,modelInScreen:(c=e.modelInScreen)!==null&&c!==void 0?c:"boundingbox-center",intersectMeshCreator:(f=e.intersectMeshCreator)!==null&&f!==void 0?f:function(){return new Gi}})},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,c=this.parseArgs(e),f=e.initial,m=f.state,A=f.currentState,h=typeof m.panoIndex=="number"?{workCode:(a=(r=m.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:m.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=k(k({},h),{mode:"Floorplan",longitude:(o=m.longitude)!==null&&o!==void 0?o:Ya(A.mode)?A.longitude:c.defaultLongitude,latitude:fe((s=m.latitude)!==null&&s!==void 0?s:A.mode==="Floorplan"?A.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),fov:(l=m.fov)!==null&&l!==void 0?l:c.defaultFov,offset:m.offset?m.offset.clone():e.models.bounding.getCenter(new d.Vector3),distance:(u=m.distance)!==null&&u!==void 0?u:t.distanceFromModel(c.models,c.defaultFov,c.camera.aspect)});return p},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){var o;return this.works=e,this.updateCamera(r,(o=i.duration)!==null&&o!==void 0?o:0,a),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new d.Vector3),i=t.distanceFromModel(e,this.defaultFov,this.camera.aspect);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:i},0).catch(Q)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var c=u[l];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),Ut(i)||this.models.setMaterial(i),Ut(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new d.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l=Dt(s,["longitude","latitude","fov"]),u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(c,a/3).catch(Q),e.perspToOrthoMotion.set(f,a).catch(Q),e.cameraMotion.set(l,a).catch(Q),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(m){var A=k(k(k({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.updateRenderSize=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.screenBuffers.forEach(function(r){r.setSize(e.x,e.y)})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var a=this.works.resolvedObservers.filter(function(u){for(var c,f=0,m=r.models;f<m.length;f++){var A=m[f];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===u.work.workCode)return!0}return!1}),o=dr(a,function(u){return u.standingPosition.distanceTo(i.point)},!0),s=o[0],l=o[1];return s&&l<10?s:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new d.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=k({},i),l={longitude:0,latitude:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.998,l.longitude+=s.longitude,l.latitude+=s.latitude;var c=_r(this.cameraMotion.value.longitude+l.longitude),f=fe(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),m=k(k({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),A=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),h=_("gesture.momentum",k(k({},e),{isFirst:r,isFinal:A,state:m}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(Q),A?this.inMomentumMovement=null:dt.shared.add(function(p,g){o.requestMomentumMovement(e,!1,s,g|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.relativeClientPosition(e.center),s=this.camera.pose.latitude<Math.PI/6||o.y<0?1:-1;a.x*=s;var l=this.coordinatesForOffset(a),u=_r(this.cameraMotion.value.longitude+l.longitude),c=fe(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(c=this.cameraMotion.value.latitude);var f=k(k({},this.currentPano),{mode:this.mode,longitude:u,latitude:c,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.state=f,this.emit("gesture.pan",e),!e.defaultPrevented&&(this.cameraMotion.set({longitude:f.longitude,latitude:f.latitude},0).catch(Q),e.isFinal)){var m=e.velocityX*s,A=e.velocityY;this.inMomentumMovement={uuid:St()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:m,y:A}),0)}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&(delete this.panState,delete this.pinchState),typeof i!="undefined"){var a=fe(i/e.scale,this.minFov,this.maxFov);e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:a},0).catch(Q),this.onPanGesture(e))}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState){if(this.emit("gesture.mousemove",e),e.defaultPrevented){this.hideIntersectMesh();return}var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=_("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new d.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var f=a.ray.origin.distanceTo(c),m=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(f*m/10,1);this.intersectMesh.scale.set(A,A,A);var h=c.clone().add(u);if(this.intersectMesh.lookAt(h),Math.abs(l.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=this,i=r.minFov,a=r.maxFov,o=fe(this.camera.fov-e.center.delta,i,a);e.state.fov=o,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:o},0).catch(Q)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=!0,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=k(k({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new d.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var l=this.currentTapId=St();this.preloadPano(a.pano).then(function(u){r.currentTapId===l&&r.emit("pano.request",_("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.onDblTapGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.cameraMotion.value.fov,i=this.minFov-r<r-this.defaultFov?this.minFov:this.defaultFov;e.state.fov=i,this.emit("gesture.dbltap",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:i},360).catch(Q),this.hideIntersectMesh())},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t}(Bo),Ip=function(n){se(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="Topview",r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=k(k({},e),{defaultLongitude:0,defaultLatitude:Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{longitude:r.defaultLongitude,latitude:r.defaultLatitude,mode:"Topview"})},t.prototype.updateModel=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0;var r=this.models.bounding.getCenter(new d.Vector3);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:ro.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(Q)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var c=u[l];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.y,z:c.value.offset.z}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={longitude:s.longitude,latitude:s.latitude,fov:s.fov},u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:1};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(c,a/3).catch(Q),e.perspToOrthoMotion.set(f,a).catch(Q),e.cameraMotion.set(l,a).catch(Q),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(m){var A=k(k(k({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.requestMomentumMovement=function(){this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.locationMotion.value.distance;s*=Math.tan(this.cameraMotion.value.fov/2*Math.PI/180);var l=this.renderer.getSize(new d.Vector2),u=2*a.x*s/l.y,c=2*a.y*s/l.y,f=new d.Vector3;f.setFromMatrixColumn(this.camera.matrix,0),f.multiplyScalar(-u),o.add(f),f.setFromMatrixColumn(this.camera.matrix,1),f.multiplyScalar(c),o.add(f),this.modelInScreen==="boundingbox-center"&&o.clamp(this.models.bounding.min,this.models.bounding.max);var m=k(k({},this.currentPano),{mode:this.mode,longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:o,distance:this.locationMotion.value.distance});e.state=m,this.emit("gesture.pan",e),!e.defaultPrevented&&this.locationMotion.set({x:o.x,y:o.y,z:o.z},0).catch(Q)}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var a=fe(i/e.scale,this.minFov,this.maxFov);e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:a},0).catch(Q),e.type="gesture.pan",this.onPanGesture(e))}}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=fe(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov);e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:r},0).catch(Q)}},t}(ro),_u=function(n){se(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="PanoramaLike",r.defaultLatitude=i.defaultLatitude,r.defaultFov=i.defaultFov,r.maxFov=i.maxFov,r.minFov=i.minFov,r.maxLatitude=i.maxLatitude,r.minLatitude=i.minLatitude,r.moveSpeed=i.moveSpeed,r.intersectMeshCreator=i.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u,c;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return k(k({},f),{defaultLatitude:(r=e.defaultLatitude)!==null&&r!==void 0?r:0,defaultFov:(i=e.defaultFov)!==null&&i!==void 0?i:90,maxFov:(a=e.maxFov)!==null&&a!==void 0?a:120,minFov:(o=e.minFov)!==null&&o!==void 0?o:20,maxLatitude:(s=e.maxLatitude)!==null&&s!==void 0?s:+Math.PI/2,minLatitude:(l=e.minLatitude)!==null&&l!==void 0?l:-Math.PI/2,moveSpeed:(u=e.moveSpeed)!==null&&u!==void 0?u:3.4,intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new Gi}})},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u=this.parseArgs(e),c=u.works,f=e.initial,m=f.state,A=f.currentState,h=typeof m.panoIndex=="number"?{workCode:(a=(r=m.workCode)!==null&&r!==void 0?r:(i=u.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:m.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=c.getResolvedObserver(h),g=(o=m.longitude)!==null&&o!==void 0?o:A.longitude,v=fe((s=m.latitude)!==null&&s!==void 0?s:Xn(A.mode)?A.latitude:u.defaultLatitude,u.minLatitude,u.maxLatitude),y=fe((l=m.fov)!==null&&l!==void 0?l:Xn(A.mode)?A.fov:u.defaultFov,u.minFov,u.maxFov),b=p?p.position.clone():new d.Vector3;return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"PanoramaLike",longitude:g,latitude:v,fov:y,offset:b,distance:0}},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose()),delete this.panState},t.prototype.isReady=function(){return this.panState||this.pinchState?!1:n.prototype.isReady.call(this)},t.prototype.calculateMovingDuration=function(e,r){switch(typeof e){case"function":return e(r,this.moveSpeed);case"number":return e;case"string":return Number(e);default:return fe(r,2,5)/this.moveSpeed*1e3}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.coordinatesForOffset=function(e){var r=this.cameraMotion.value.fov,i=this.camera.aspect,a=this.renderer.getSize(new d.Vector2);return{longitude:2*e.x/(a.x*this.scissor.width)*r/95*i,latitude:-2*e.y/(a.y*this.scissor.height)*r/95}},t.prototype.cameraBounce=function(){var e=this.cameraMotion.value,r=e.longitude,i=e.latitude,a=e.fov,o=[{progress:0,value:{longitude:r,latitude:i,fov:a}},{progress:.5,value:{longitude:r,latitude:i,fov:a*.98}},{progress:1,value:{longitude:r,latitude:i,fov:a}}];this.cameraMotion.setKeyframes(o,500).catch(Q)},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=k({},i),l={longitude:0,latitude:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.99,l.longitude+=s.longitude,l.latitude+=s.latitude;var c=_r(this.cameraMotion.value.longitude+l.longitude),f=fe(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),m=k(k({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),A=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),h=_("gesture.momentum",k(k({},e),{isFirst:r,isFinal:A,state:m}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(Q),A?this.inMomentumMovement=null:dt.shared.add(function(p,g){o.requestMomentumMovement(e,!1,s,g|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.coordinatesForOffset(a),s=_r(this.cameraMotion.value.longitude+o.longitude),l=fe(this.cameraMotion.value.latitude+o.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(l=this.cameraMotion.value.latitude);var u=k(k({},this.currentPano),{mode:this.mode,longitude:s,latitude:l,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance});if(e.state=u,this.emit("gesture.pan",e),!e.defaultPrevented){var c={longitude:u.longitude,latitude:u.latitude,fov:u.fov};if(this.cameraMotion.set(c,0).catch(Q),e.isFinal){var f=e.velocityX,m=e.velocityY*.6;Math.abs(m)>.5&&Math.abs(f)<.5&&(f=0),this.inMomentumMovement={uuid:St()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:f,y:m}),0)}}}},t.prototype.onPinchGesture=function(e){var r;this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov,a=e.scale;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var o=fe(i/a,this.minFov,this.maxFov);e.state.fov=o,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:o},0).catch(Q),e.type="gesture.pan",this.onPanGesture(e))}},t.prototype.onMouseWheel=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=fe(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov);e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:r},0).catch(Q),this.onMouseMove(e))},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=_("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new d.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var f=c.clone().add(u);if(this.intersectMesh.lookAt(f),Math.abs(l.y)>.99){var m=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(m.z,m.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onDblTapGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.cameraMotion.value.fov,i=2,a=this.works.getResolvedObserver(this.currentPano);if(a){var o=a.images.tiles;o&&o.length&&(i=Math.max.apply(Math,o.map(function(u){return u.level})))}var s=Math.max(40-i*5,this.minFov,5),l=s-r<r-this.defaultFov?s:this.defaultFov;e.state.fov=l,this.emit("gesture.dbltap",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:l},360).catch(Q),this.hideIntersectMesh())},t}(Bo),Tp="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d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AAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",Ma;function Ju(){return Ma||(Ma=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=Tp,e.addEventListener("timeupdate",function r(){e.removeEventListener("timeupdate",r,!1),clearTimeout(t);var i=document.createElement("canvas");i.width=i.height=1;var a=i.getContext("2d");if(!a){n(!1);return}a.drawImage(e,0,0,1,1);var o=a.getImageData(0,0,1,1).data;o[3]>10?n(!0):n(!1)},!1),e.addEventListener("canplay",function r(){e.removeEventListener("canplay",r,!1),e.play()},!1),t=window.setTimeout(function(){return n(!1)},1e3)}))}var Pp=`
|
|
1473
|
+
`,Mp=new d.OrthographicCamera(-1,1,1,-1,0,1),Po=new d.BufferGeometry;Po.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Po.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var Ku=new d.MeshBasicMaterial,to=new d.Mesh(Po,Ku),ju=new d.Scene;ju.add(to);var Cp=function(){function n(t){this.renderer=t,this.material=new d.ShaderMaterial({vertexShader:Sp,fragmentShader:Ep,uniforms:Object.assign({depthBuffer:new d.Uniform(null)}),blending:d.NoBlending,depthWrite:!0,depthTest:!0}),this.renderer.getContext()&&this.renderer.getContext()instanceof WebGLRenderingContext&&(this.material.extensions.fragDepth=!0)}return n.prototype.render=function(t,e){var r=this.renderer.getRenderTarget();this.material.uniforms.depthBuffer.value=t,to.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(ju,Mp),this.renderer.setRenderTarget(r),to.material=Ku},n.prototype.dispose=function(){this.material.dispose()},n}(),Ma=new d.Vector2,Bo=function(n){se(t,n);function t(e){var r,i,a,o,s,l,u=n.call(this)||this,c=t.parseArgs(e);u.mode="",u.pending=new Set,u.userAction=c.initial.userAction,u.destroyed=!1,u.ident=c.ident,u.scene=c.scene,u.xrCustomObjectsScene=c.xrCustomObjectsScene,u.helper=c.helper,u.boundingMesh=c.boundingMesh,u.camera=c.camera,u.renderer=c.renderer,u.scissor=c.scissor,u.element=c.element,u.models=c.models,u.enableWheel=c.enableWheel,u.enableIOSEDR=(r=c.enableIOSEDR)!==null&&r!==void 0?r:!1,u.enableEDL=(i=c.enableEDL)!==null&&i!==void 0?i:!0,u.enableHQ=(a=c.enableHQ)!==null&&a!==void 0?a:!0,u.works=c.works,u.imageOptions=c.imageOptions,u.videoTexture=c.videoTexture,u.extraElements=c.extraElements,u.initial=c.initial,u.currentPano=typeof u.initial.state.panoIndex=="number"?{workCode:(l=(o=u.initial.state.workCode)!==null&&o!==void 0?o:(s=c.works[0])===null||s===void 0?void 0:s.workCode)!==null&&l!==void 0?l:"",panoIndex:u.initial.state.panoIndex}:{workCode:u.initial.currentState.workCode,panoIndex:u.initial.currentState.panoIndex},u.needsRender=!0,u.modelSceneNeedsRender=!0,u.cameraMotion=new Me({longitude:{value:u.camera.pose.longitude,circle:[0,Math.PI*2]},latitude:u.camera.pose.latitude,fov:u.camera.pose.fov}),u.inMomentumMovement=null,u.eventUnbinds=[c.element].concat(c.extraElements||[]).map(function(m){return u.bindEvents(m)}),u.pending.add("init-animation"),u.initAnimationReady=new Promise(function(m){dt.shared.add(function(){u.initAnimation().then(function(){u.pending.delete("init-animation"),m()})},!0)}),u.initAnimationIsReady=!1,u.initAnimationReady.then(function(){return u.initAnimationIsReady=!0}),u.modelScene=c.modelScene;var f=new d.Vector2;return u.renderer.getDrawingBufferSize(f),u.modelRenderTarget=c.modelRenderTarget,u.copyPass=new Gu(u.renderer),u.depthCopyPass=new Cp(u.renderer),u.screenBuffers=[],u.lastPostProcessingType=null,u}return t.parseArgs=function(e){return e instanceof t?e:k({},e)},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,c,f=this.parseArgs(e),m=f.initial,A=m.state,h=m.currentState,p=typeof A.panoIndex=="number"?{workCode:(a=(r=A.workCode)!==null&&r!==void 0?r:(i=f.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:A.panoIndex}:{workCode:h.workCode,panoIndex:h.panoIndex};return k(k({},p),{mode:"",longitude:(o=A.longitude)!==null&&o!==void 0?o:h.longitude,latitude:(s=A.latitude)!==null&&s!==void 0?s:h.latitude,fov:(l=A.fov)!==null&&l!==void 0?l:h.fov,offset:(u=A.offset)!==null&&u!==void 0?u:h.offset,distance:(c=A.distance)!==null&&c!==void 0?c:h.distance})},t.prototype.destroy=function(){var e;this.stopMomentumMovement(),this.destroyed=!0,this.off(),this.cameraMotion.dispose();for(var r=0,i=this.eventUnbinds;r<i.length;r++){var a=i[r];a()}this.copyEffect&&(this.copyEffect.dispose(),delete this.copyEffect),delete this.panState,(e=this.pressState)===null||e===void 0||e.stop(),delete this.pressState},t.prototype.isReady=function(){return this.inMomentumMovement===null&&this.pending.size===0&&this.cameraMotion.ended===!0},t.prototype.bindExtraElement=function(e){for(var r=0,i=this.eventUnbinds;r<i.length;r++){var a=i[r];if(a.element===e)return}this.eventUnbinds.push(this.bindEvents(e))},t.prototype.unbindExtraElement=function(e){for(var r=[],i=0,a=this.eventUnbinds;i<a.length;i++){var o=a[i];o.element===e?o():r.push(o)}this.eventUnbinds=r},t.prototype.updateRenderSize=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.modelRenderTarget.setSize(e.x,e.y),this.screenBuffers.forEach(function(r){r.setSize(e.x,e.y)})},t.prototype.updateModel=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0},t.prototype.updateWork=function(e,r,i,a){return this.works=e,this.userAction=a,!1},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={};this.cameraMotion.ended&&(this.cameraMotion.update(e),i.longitude=this.cameraMotion.value.longitude,i.latitude=this.cameraMotion.value.latitude,i.fov=this.cameraMotion.value.fov),Ut(i)&&this.setCamera(i)}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera)),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.postProcessing=function(e,r){this.destroyed},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={};return e.longitude!==void 0&&(o.longitude=e.longitude),e.latitude!==void 0&&(o.latitude=e.latitude),e.fov!==void 0&&(o.fov=e.fov),a.cameraMotion.set(o,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=0,l=e;s<l.length;s++){var u=l[s];o.push({key:u.key,progress:u.progress,value:{longitude:u.value.longitude,latitude:u.value.latitude,fov:u.value.fov}})}return a.cameraMotion.setKeyframes(o,r)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance})},t.prototype.initAnimation=function(){var e=this.initial;e.state,e.currentState,e.duration;var r=e.userAction,i=t.initAnimationEndState(this);return this.userAction=r,this.emit("initAnimation.start",_("initAnimation.start",{state:i,userAction:this.userAction})),this.emit("initAnimation.end",_("initAnimation.end",{state:i,userAction:this.userAction})),Promise.resolve()},t.prototype.setCamera=function(e){var r,i,a,o,s;e===void 0&&(e={});var l=(r=e.longitude)!==null&&r!==void 0?r:this.camera.pose.longitude,u=(i=e.latitude)!==null&&i!==void 0?i:this.camera.pose.latitude,c=(a=e.fov)!==null&&a!==void 0?a:this.camera.pose.fov,f=(o=e.distance)!==null&&o!==void 0?o:this.camera.pose.distance,m=(s=e.offset)!==null&&s!==void 0?s:this.camera.pose.offset,A=Lt(l,this.camera.pose.longitude,Math.PI*2)||Lt(u,this.camera.pose.latitude),h=Lt(c,this.camera.pose.fov),p=Lt(f,this.camera.pose.distance),g=Ii(m,this.camera.pose.offset);(h||A||g||p)&&(this.camera.setFromPose({longitude:l,latitude:u,fov:c,distance:f,offset:m}),this.emit("camera.update",_("camera.update",{userAction:this.userAction,state:k(k({},this.currentPano),{mode:this.mode,longitude:l,latitude:u,fov:c,offset:m,distance:f})})),this.needsRender=!0,this.modelSceneNeedsRender=!0)},t.prototype.stopMomentumMovement=function(){if(this.inMomentumMovement&&this.inMomentumMovement.event&&!this.inMomentumMovement.event.defaultPrevented&&!this.inMomentumMovement.event.isFinal){var e=_("gesture.momentum",k(k({},this.inMomentumMovement.event),{isFirst:!1,isFinal:!0}));this.emit("gesture.momentum",e)}this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pan",e)},t.prototype.onTapGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.tap",e)},t.prototype.onDblTapGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.dbltap",e),!e.defaultPrevented&&(e.type="gesture.tap",this.onTapGesture(e))},t.prototype.onPressGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.press",e)},t.prototype.onPinchGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pinch",e)},t.prototype.onMouseWheel=function(e){this.stopMomentumMovement(),this.emit("gesture.mousewheel",e)},t.prototype.onMouseMove=function(e){this.stopMomentumMovement(),this.emit("gesture.mousemove",e)},t.prototype.relativeClientPosition=function(e){return Ws(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(S){var I=Ws(S,r.element,r.scissor);return!(Math.abs(I.x)>1||Math.abs(I.y)>1)},a=new Qn.Manager(e),o=function(S){var I=S.session;return I.firstInput||null},s=new Qn.Pan({threshold:10,pointers:0}),l=new Qn.Tap({interval:410}),u=new Qn.Pinch({threshold:0,pointers:2});a.add([s,l,u]),a.on("panstart pan",function(S){var I=o(a);if(!(I&&!i(I.center))){var O=_("gesture.pan",{target:S.target,pointerType:S.pointerType,srcEvent:S.srcEvent,pointers:S.pointers.map(function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}),isFirst:S.isFirst,isFinal:S.isFinal,scale:S.scale,center:function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}(S.center),velocityX:S.velocityX,velocityY:S.velocityY,overallVelocityX:S.overallVelocityX,overallVelocityY:S.overallVelocityY,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onPanGesture(O),b()}}),a.on("tap",function(S){if(!(S.pointerType==="mouse"&&S.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var O=_("gesture.tap",{target:S.target,pointerType:S.pointerType,srcEvent:S.srcEvent,pointers:S.pointers.map(function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}),isFirst:!0,isFinal:!0,scale:S.scale,center:function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}(S.center),velocityX:S.velocityX,velocityY:S.velocityY,overallVelocityX:S.overallVelocityX,overallVelocityY:S.overallVelocityY,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onTapGesture(O),b()}}}),a.on("pinchstart pinch pinchend",function(S){var I=o(a);if(!(I&&!i(I.center))){var O=_("gesture.pinch",{target:S.target,pointerType:S.pointerType,srcEvent:S.srcEvent,pointers:S.pointers.map(function(P){var F,V=r.relativeClientPosition(P),D=new d.Raycaster;return D.params.Points={threshold:.1},D.setFromCamera(V,r.camera),{x:P.x,y:P.y,delta:(F=P.delta)!==null&&F!==void 0?F:0,buttons:0,coords:V,raycaster:D}}),isFirst:S.type==="pinchstart",isFinal:S.type==="pinchend",scale:S.scale,center:function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}(S.center),velocityX:S.velocityX,velocityY:S.velocityY,overallVelocityX:S.overallVelocityX,overallVelocityY:S.overallVelocityY,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onPinchGesture(O),b()}}),a.on("dbltap",function(S){if(!(S.pointerType==="mouse"&&S.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var O=_("gesture.dbltap",{target:S.target,pointerType:S.pointerType,srcEvent:S.srcEvent,pointers:S.pointers.map(function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}),isFirst:!0,isFinal:!0,scale:S.scale,center:function(P){var F=r.relativeClientPosition(P),V=new d.Raycaster;return V.params.Points={threshold:.1},V.setFromCamera(F,r.camera),{x:P.x,y:P.y,delta:0,buttons:0,coords:F,raycaster:V}}(S.center),velocityX:S.velocityX,velocityY:S.velocityY,overallVelocityX:S.overallVelocityX,overallVelocityY:S.overallVelocityY,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onDblTapGesture(O),b()}}});var c=null,f=null,m=function(S,I,O){var P={x:O.clientX,y:O.clientY},F=r.relativeClientPosition(P),V=new d.Raycaster;V.params.Points={threshold:.1},V.setFromCamera(F,r.camera);var D=k(k({},P),{coords:F,raycaster:V,buttons:O.buttons,delta:0}),z=S==="pinchend"?I:I-O.deltaY/280,U=_("gesture.pinch",{target:O.target,pointerType:"mouse",srcEvent:O,pointers:[k({},D)],isFirst:S==="pinchstart",isFinal:S==="pinchend",scale:fe(z,.1,10),center:k({},D),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});return U},A=function(S){var I,O={x:S.clientX,y:S.clientY};if(i(O)){if(S.preventDefault(),S.ctrlKey){var P=(I=c==null?void 0:c.prevEvent.scale)!==null&&I!==void 0?I:1,F=m(c?"pinch":"pinchstart",P,S);c===null?c={firstEvent:F,prevEvent:F}:c.prevEvent=F,r.onPinchGesture(F),f!==null&&window.clearTimeout(f),f=window.setTimeout(function(){var j;f=null;var J=(j=c==null?void 0:c.prevEvent.scale)!==null&&j!==void 0?j:1,X=m("pinchend",J,S);c=null,r.onPinchGesture(X)},200)}else{var V=(Math.abs(S.deltaY)>Math.abs(S.deltaX)?S.deltaY:S.deltaX)/-60,D=r.mouseWheelState!==void 0,z={x:S.clientX,y:S.clientY},U=r.relativeClientPosition(z),q=new d.Raycaster;q.params.Points={threshold:.1},q.setFromCamera(U,r.camera);var K=k(k({},z),{coords:U,raycaster:q,buttons:S.buttons,delta:V}),F=_("gesture.mousewheel",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[k({},K)],isFirst:D,isFinal:!1,scale:0,center:k({},K),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onMouseWheel(F),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var J=_("gesture.mousewheel",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[k(k({},K),{delta:0})],isFirst:!1,isFinal:!0,scale:0,center:k(k({},K),{delta:0}),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.onMouseWheel(J)},100)}}b()}},h=function(S){if(!zn){if(!i({x:S.clientX,y:S.clientY})){p();return}var I=!1;r.mouseMoveState||(I=!0);var O={x:S.clientX,y:S.clientY},P=r.relativeClientPosition(O),F=new d.Raycaster;F.params.Points={threshold:.1},F.setFromCamera(P,r.camera);var V=k(k({},O),{coords:P,raycaster:F,buttons:S.buttons,delta:0}),D=_("gesture.mousemove",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[k({},V)],isFirst:I,isFinal:!1,scale:0,center:k({},V),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});r.mouseMoveState={timeStamp:he(),event:D},r.onMouseMove(D),r.pressState&&Math.abs(S.clientX-r.pressState.event.center.y)>10&&Math.abs(S.clientY-r.pressState.event.center.y)>10&&b()}},p=function(){if(r.mouseMoveState){var S=_(r.mouseMoveState.event.type,k(k({},r.mouseMoveState.event),{isFinal:!0}));delete r.mouseMoveState,r.onMouseMove(S)}b()},g=function(S){if(!i(S.center)){b();return}var I=!1;r.pressState||(I=!0,r.pressState={event:S,timeStamp:he(),stop:Q});var O=he()-r.pressState.timeStamp,P=_(r.pressState.event.type,k(k({},r.pressState.event),{isFirst:I,isFinal:!1,center:k(k({},r.pressState.event.center),{delta:O}),pointers:r.pressState.event.pointers.map(function(F){return k(k({},F),{delta:O})})}));r.onPressGesture(P),r.pressState&&(r.pressState.stop=dt.shared.add(function(F){g(S)},!0,1))},v=function(S){if(b(),!(S.touches.length>1||S.changedTouches.length<=0)){var I={x:S.changedTouches[0].clientX,y:S.changedTouches[0].clientY},O=r.relativeClientPosition(I),P=new d.Raycaster;P.params.Points={threshold:.1},P.setFromCamera(O,r.camera);var F=k(k({},I),{coords:O,raycaster:P,buttons:0,delta:0}),V=_("gesture.press",{target:S.target,pointerType:"touch",srcEvent:S,pointers:[k({},F)],isFirst:!1,isFinal:!1,scale:0,center:F,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});g(V)}},y=function(S){b();var I={x:S.clientX,y:S.clientY},O=r.relativeClientPosition(I),P=new d.Raycaster;P.params.Points={threshold:.1},P.setFromCamera(O,r.camera);var F=k(k({},I),{coords:O,raycaster:P,buttons:S.buttons,delta:0}),V=_("gesture.press",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[k({},F)],isFirst:!1,isFinal:!1,scale:0,center:F,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});g(V)},b=function(){var S;if(r.pressState){var I=he()-r.pressState.timeStamp,O=_(r.pressState.event.type,k(k({},r.pressState.event),{center:k(k({},r.pressState.event.center),{delta:I}),isFirst:!1,isFinal:!0,pointers:r.pressState.event.pointers.map(function(P){return k(k({},P),{delta:I})})}));r.onPressGesture(O),(S=r.pressState)===null||S===void 0||S.stop(),delete r.pressState}},x=null,w=function(S){var I,O=!1,P=!1;switch(S.type){case"gesturestart":O=!0;break;case"gestureend":P=!0;break}var F={x:S.clientX,y:S.clientY},V=r.relativeClientPosition(F),D=new d.Raycaster;D.params.Points={threshold:.1},D.setFromCamera(V,r.camera);var z=k(k({},F),{coords:V,raycaster:D,buttons:0,delta:0}),U=_("gesture.pinch",{target:S.target,pointerType:"mouse",srcEvent:S,pointers:[k({},z)],isFirst:O,isFinal:P,scale:(I=S.scale)!==null&&I!==void 0?I:1,center:k({},z),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),_e(r.camera.pose))});return U},E=function(S){if(S.preventDefault(),!zn){var I=w(S);x={firstEvent:I};var O=x.firstEvent;O&&!i(O.center)||r.onPinchGesture(I)}},M=function(S){if(S.preventDefault(),!zn&&x){var I=w(S),O=x.firstEvent;O&&!i(O.center)||r.onPinchGesture(I)}},C=function(S){if(S.preventDefault(),!zn&&x){var I=w(S),O=x.firstEvent;x=null,!(O&&!i(O.center))&&r.onPinchGesture(I)}},R=function(S){if(S&&typeof S.preventDefault=="function"&&S.currentTarget===e&&S.preventDefault(),typeof getSelection=="function"){var I=getSelection();I&&I.focusNode&&(I.removeAllRanges&&I.removeAllRanges(),I.empty&&I.empty())}};this.enableWheel&&e.addEventListener("wheel",A,{passive:!1}),e.addEventListener("mousemove",h,!1),e.addEventListener("mouseout",p,!1),e.addEventListener("touchstart",v,{passive:!0}),e.addEventListener("touchend",b,!1),e.addEventListener("touchcancel",b,!1),e.addEventListener("mousedown",y,!1),e.addEventListener("mouseup",b,!1),e.addEventListener("gesturestart",E,{passive:!1}),e.addEventListener("gesturechange",M,{passive:!1}),e.addEventListener("gestureend",C,{passive:!1}),e.addEventListener("touchstart",R,{passive:!1}),e.addEventListener("contextmenu",R,!1);var L=function(){a.destroy(),e.removeEventListener("wheel",A,!1),e.removeEventListener("mousemove",h,!1),e.removeEventListener("mouseout",p,!1),e.removeEventListener("touchstart",v,!1),e.removeEventListener("touchend",b,!1),e.removeEventListener("touchcancel",b,!1),e.removeEventListener("mousedown",y,!1),e.removeEventListener("mouseup",b,!1),e.removeEventListener("gesturestart",E,!1),e.removeEventListener("gesturechange",M,!1),e.removeEventListener("gestureend",C,!1),e.removeEventListener("touchstart",R,!1),e.removeEventListener("contextmenu",R,!1)};return Object.assign(L,{element:e})},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=Q);var a=this.works.getResolvedObserver(e);if(!a)return Promise.resolve();var o=["right","left","up","down","front","back"];return Promise.all(o.map(function(s){var l=k({key:"pano.".concat(De(e),".").concat(s)},Dt(i.imageOptions,["size","format","quality","mappings"])),u=a.images[s],c=sn(u,i.imageOptions.transform,l);return it(a.work).preload(c,{timeout:500})})).then(function(){return r(e),e})},t.prototype.updateScreenBuffer=function(e){var r,i,a,o,s,l;if(this.lastPostProcessingType!==e)if(this.lastPostProcessingType=e,e==="luminance"){if(this.screenBuffers.length===0){var u=this.renderer.getDrawingBufferSize(Ma);this.screenBuffers=[new d.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:d.sRGBEncoding}),this.modelRenderTarget]}}else if(e==="edl"){if(this.screenBuffers.length===0){var u=this.renderer.getDrawingBufferSize(Ma);this.screenBuffers=[new d.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,encoding:(o=(a=this.renderer)===null||a===void 0?void 0:a.outputEncoding)!==null&&o!==void 0?o:d.sRGBEncoding,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType}),this.modelRenderTarget]}this.models.setMaterial({useEDL:!0})}else if(e==="hq"){if(this.screenBuffers.length===0){var u=this.renderer.getDrawingBufferSize(Ma),c=new d.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(u.x,u.y,d.UnsignedIntType)});c.depthTexture.format=d.DepthFormat,c.depthBuffer=!0;var f=new d.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,encoding:(l=(s=this.renderer)===null||s===void 0?void 0:s.outputEncoding)!==null&&l!==void 0?l:d.sRGBEncoding,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:c.depthTexture});this.screenBuffers=[c,f,this.modelRenderTarget]}this.models.setMaterial({useHQDepth:!0,useHQWeight:!1,pointShape:"CIRCLE"})}else this.screenBuffers&&(this.screenBuffers.forEach(function(m){m.dispose()}),this.screenBuffers=[]),this.models.setMaterial({useEDL:!1,useHQDepth:!1,useHQWeight:!1})},t}(qi),ro=function(n){se(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Floorplan",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultFov=a.defaultFov,r.maxFov=a.maxFov,r.minFov=a.minFov,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.modelInScreen=a.modelInScreen,r.locationMotion=new Me({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Me({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Me({perspToOrtho:r.camera.perspToOrtho.x}),r.currentTapId=null,r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.parseArgs=function(e){var r,i,a,o,s,l,u,c,f;if(e instanceof t)return e;var m=n.parseArgs.call(this,e);return k(k({},m),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultFov:(a=e.defaultFov)!==null&&a!==void 0?a:80,maxFov:(o=e.maxFov)!==null&&o!==void 0?o:120,minFov:(s=e.minFov)!==null&&s!==void 0?s:20,maxLatitude:(l=e.maxLatitude)!==null&&l!==void 0?l:+Math.PI/2,minLatitude:(u=e.minLatitude)!==null&&u!==void 0?u:-Math.PI/2,modelInScreen:(c=e.modelInScreen)!==null&&c!==void 0?c:"boundingbox-center",intersectMeshCreator:(f=e.intersectMeshCreator)!==null&&f!==void 0?f:function(){return new Gi}})},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,c=this.parseArgs(e),f=e.initial,m=f.state,A=f.currentState,h=typeof m.panoIndex=="number"?{workCode:(a=(r=m.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:m.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=k(k({},h),{mode:"Floorplan",longitude:(o=m.longitude)!==null&&o!==void 0?o:Ya(A.mode)?A.longitude:c.defaultLongitude,latitude:fe((s=m.latitude)!==null&&s!==void 0?s:A.mode==="Floorplan"?A.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),fov:(l=m.fov)!==null&&l!==void 0?l:c.defaultFov,offset:m.offset?m.offset.clone():e.models.bounding.getCenter(new d.Vector3),distance:(u=m.distance)!==null&&u!==void 0?u:t.distanceFromModel(c.models,c.defaultFov,c.camera.aspect)});return p},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){var o;return this.works=e,this.updateCamera(r,(o=i.duration)!==null&&o!==void 0?o:0,a),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new d.Vector3),i=t.distanceFromModel(e,this.defaultFov,this.camera.aspect);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:i},0).catch(Q)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var c=u[l];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),Ut(i)||this.models.setMaterial(i),Ut(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new d.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l=Dt(s,["longitude","latitude","fov"]),u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(c,a/3).catch(Q),e.perspToOrthoMotion.set(f,a).catch(Q),e.cameraMotion.set(l,a).catch(Q),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(m){var A=k(k(k({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.updateRenderSize=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.screenBuffers.forEach(function(r){r.setSize(e.x,e.y)})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var a=this.works.resolvedObservers.filter(function(u){for(var c,f=0,m=r.models;f<m.length;f++){var A=m[f];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===u.work.workCode)return!0}return!1}),o=dr(a,function(u){return u.standingPosition.distanceTo(i.point)},!0),s=o[0],l=o[1];return s&&l<10?s:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new d.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=k({},i),l={longitude:0,latitude:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.998,l.longitude+=s.longitude,l.latitude+=s.latitude;var c=_r(this.cameraMotion.value.longitude+l.longitude),f=fe(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),m=k(k({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),A=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),h=_("gesture.momentum",k(k({},e),{isFirst:r,isFinal:A,state:m}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(Q),A?this.inMomentumMovement=null:dt.shared.add(function(p,g){o.requestMomentumMovement(e,!1,s,g|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.relativeClientPosition(e.center),s=this.camera.pose.latitude<Math.PI/6||o.y<0?1:-1;a.x*=s;var l=this.coordinatesForOffset(a),u=_r(this.cameraMotion.value.longitude+l.longitude),c=fe(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(c=this.cameraMotion.value.latitude);var f=k(k({},this.currentPano),{mode:this.mode,longitude:u,latitude:c,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.state=f,this.emit("gesture.pan",e),!e.defaultPrevented&&(this.cameraMotion.set({longitude:f.longitude,latitude:f.latitude},0).catch(Q),e.isFinal)){var m=e.velocityX*s,A=e.velocityY;this.inMomentumMovement={uuid:St()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:m,y:A}),0)}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&(delete this.panState,delete this.pinchState),typeof i!="undefined"){var a=fe(i/e.scale,this.minFov,this.maxFov);e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:a},0).catch(Q),this.onPanGesture(e))}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState){if(this.emit("gesture.mousemove",e),e.defaultPrevented){this.hideIntersectMesh();return}var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=_("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new d.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var f=a.ray.origin.distanceTo(c),m=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(f*m/10,1);this.intersectMesh.scale.set(A,A,A);var h=c.clone().add(u);if(this.intersectMesh.lookAt(h),Math.abs(l.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=this,i=r.minFov,a=r.maxFov,o=fe(this.camera.fov-e.center.delta,i,a);e.state.fov=o,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:o},0).catch(Q)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=!0,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=k(k({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new d.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var l=this.currentTapId=St();this.preloadPano(a.pano).then(function(u){r.currentTapId===l&&r.emit("pano.request",_("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.onDblTapGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.cameraMotion.value.fov,i=this.minFov-r<r-this.defaultFov?this.minFov:this.defaultFov;e.state.fov=i,this.emit("gesture.dbltap",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:i},360).catch(Q),this.hideIntersectMesh())},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t}(Bo),Ip=function(n){se(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="Topview",r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=k(k({},e),{defaultLongitude:0,defaultLatitude:Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{longitude:r.defaultLongitude,latitude:r.defaultLatitude,mode:"Topview"})},t.prototype.updateModel=function(e){this.needsRender=!0,this.modelSceneNeedsRender=!0;var r=this.models.bounding.getCenter(new d.Vector3);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:ro.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(Q)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var c=u[l];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.y,z:c.value.offset.z}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={longitude:s.longitude,latitude:s.latitude,fov:s.fov},u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:1};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(c,a/3).catch(Q),e.perspToOrthoMotion.set(f,a).catch(Q),e.cameraMotion.set(l,a).catch(Q),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(m){var A=k(k(k({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.requestMomentumMovement=function(){this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.locationMotion.value.distance;s*=Math.tan(this.cameraMotion.value.fov/2*Math.PI/180);var l=this.renderer.getSize(new d.Vector2),u=2*a.x*s/l.y,c=2*a.y*s/l.y,f=new d.Vector3;f.setFromMatrixColumn(this.camera.matrix,0),f.multiplyScalar(-u),o.add(f),f.setFromMatrixColumn(this.camera.matrix,1),f.multiplyScalar(c),o.add(f),this.modelInScreen==="boundingbox-center"&&o.clamp(this.models.bounding.min,this.models.bounding.max);var m=k(k({},this.currentPano),{mode:this.mode,longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:o,distance:this.locationMotion.value.distance});e.state=m,this.emit("gesture.pan",e),!e.defaultPrevented&&this.locationMotion.set({x:o.x,y:o.y,z:o.z},0).catch(Q)}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var a=fe(i/e.scale,this.minFov,this.maxFov);e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:a},0).catch(Q),e.type="gesture.pan",this.onPanGesture(e))}}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement();var r=fe(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov);e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&this.cameraMotion.set({fov:r},0).catch(Q)}},t}(ro),_u=function(n){se(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="PanoramaLike",r.defaultLatitude=i.defaultLatitude,r.defaultFov=i.defaultFov,r.maxFov=i.maxFov,r.minFov=i.minFov,r.maxLatitude=i.maxLatitude,r.minLatitude=i.minLatitude,r.moveSpeed=i.moveSpeed,r.intersectMeshCreator=i.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u,c;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return k(k({},f),{defaultLatitude:(r=e.defaultLatitude)!==null&&r!==void 0?r:0,defaultFov:(i=e.defaultFov)!==null&&i!==void 0?i:90,maxFov:(a=e.maxFov)!==null&&a!==void 0?a:120,minFov:(o=e.minFov)!==null&&o!==void 0?o:20,maxLatitude:(s=e.maxLatitude)!==null&&s!==void 0?s:+Math.PI/2,minLatitude:(l=e.minLatitude)!==null&&l!==void 0?l:-Math.PI/2,moveSpeed:(u=e.moveSpeed)!==null&&u!==void 0?u:3.4,intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new Gi}})},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u=this.parseArgs(e),c=u.works,f=e.initial,m=f.state,A=f.currentState,h=typeof m.panoIndex=="number"?{workCode:(a=(r=m.workCode)!==null&&r!==void 0?r:(i=u.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:m.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=c.getResolvedObserver(h),g=(o=m.longitude)!==null&&o!==void 0?o:A.longitude,v=fe((s=m.latitude)!==null&&s!==void 0?s:Xn(A.mode)?A.latitude:u.defaultLatitude,u.minLatitude,u.maxLatitude),y=fe((l=m.fov)!==null&&l!==void 0?l:Xn(A.mode)?A.fov:u.defaultFov,u.minFov,u.maxFov),b=p?p.position.clone():new d.Vector3;return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"PanoramaLike",longitude:g,latitude:v,fov:y,offset:b,distance:0}},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose()),delete this.panState},t.prototype.isReady=function(){return this.panState||this.pinchState?!1:n.prototype.isReady.call(this)},t.prototype.calculateMovingDuration=function(e,r){switch(typeof e){case"function":return e(r,this.moveSpeed);case"number":return e;case"string":return Number(e);default:return fe(r,2,5)/this.moveSpeed*1e3}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.coordinatesForOffset=function(e){var r=this.cameraMotion.value.fov,i=this.camera.aspect,a=this.renderer.getSize(new d.Vector2);return{longitude:2*e.x/(a.x*this.scissor.width)*r/95*i,latitude:-2*e.y/(a.y*this.scissor.height)*r/95}},t.prototype.cameraBounce=function(){var e=this.cameraMotion.value,r=e.longitude,i=e.latitude,a=e.fov,o=[{progress:0,value:{longitude:r,latitude:i,fov:a}},{progress:.5,value:{longitude:r,latitude:i,fov:a*.98}},{progress:1,value:{longitude:r,latitude:i,fov:a}}];this.cameraMotion.setKeyframes(o,500).catch(Q)},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=k({},i),l={longitude:0,latitude:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.99,l.longitude+=s.longitude,l.latitude+=s.latitude;var c=_r(this.cameraMotion.value.longitude+l.longitude),f=fe(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),m=k(k({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),A=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),h=_("gesture.momentum",k(k({},e),{isFirst:r,isFinal:A,state:m}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(Q),A?this.inMomentumMovement=null:dt.shared.add(function(p,g){o.requestMomentumMovement(e,!1,s,g|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.coordinatesForOffset(a),s=_r(this.cameraMotion.value.longitude+o.longitude),l=fe(this.cameraMotion.value.latitude+o.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(l=this.cameraMotion.value.latitude);var u=k(k({},this.currentPano),{mode:this.mode,longitude:s,latitude:l,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance});if(e.state=u,this.emit("gesture.pan",e),!e.defaultPrevented){var c={longitude:u.longitude,latitude:u.latitude,fov:u.fov};if(this.cameraMotion.set(c,0).catch(Q),e.isFinal){var f=e.velocityX,m=e.velocityY*.6;Math.abs(m)>.5&&Math.abs(f)<.5&&(f=0),this.inMomentumMovement={uuid:St()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:f,y:m}),0)}}}},t.prototype.onPinchGesture=function(e){var r;this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov,a=e.scale;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var o=fe(i/a,this.minFov,this.maxFov);e.state.fov=o,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:o},0).catch(Q),e.type="gesture.pan",this.onPanGesture(e))}},t.prototype.onMouseWheel=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=fe(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov);e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:r},0).catch(Q),this.onMouseMove(e))},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=_("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new d.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var f=c.clone().add(u);if(this.intersectMesh.lookAt(f),Math.abs(l.y)>.99){var m=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(m.z,m.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onDblTapGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.cameraMotion.value.fov,i=2,a=this.works.getResolvedObserver(this.currentPano);if(a){var o=a.images.tiles;o&&o.length&&(i=Math.max.apply(Math,o.map(function(u){return u.level})))}var s=Math.max(40-i*5,this.minFov,5),l=s-r<r-this.defaultFov?s:this.defaultFov;e.state.fov=l,this.emit("gesture.dbltap",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:l},360).catch(Q),this.hideIntersectM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AAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",Ca;function Ju(){return Ca||(Ca=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=Tp,e.addEventListener("timeupdate",function r(){e.removeEventListener("timeupdate",r,!1),clearTimeout(t);var i=document.createElement("canvas");i.width=i.height=1;var a=i.getContext("2d");if(!a){n(!1);return}a.drawImage(e,0,0,1,1);var o=a.getImageData(0,0,1,1).data;o[3]>10?n(!0):n(!1)},!1),e.addEventListener("canplay",function r(){e.removeEventListener("canplay",r,!1),e.play()},!1),t=window.setTimeout(function(){return n(!1)},1e3)}))}var Pp=`
|
|
1474
1474
|
#include <common>
|
|
1475
1475
|
uniform sampler2D inputBuffer;
|
|
1476
1476
|
uniform float scale;
|
|
@@ -1554,7 +1554,7 @@ void main() {
|
|
|
1554
1554
|
gl_FragColor.a = 1.0 - texture2D(luminanceMap, vUv).r;
|
|
1555
1555
|
#endif
|
|
1556
1556
|
}
|
|
1557
|
-
`,Qp=function(n){se(t,n);function t(){var e=n.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null},flipY:{value:1},level:{value:0}},vertexShader:Dp,fragmentShader:zp})||this;return e.depthTest=!1,e.depthWrite=!1,e.blending=d.NoBlending,e.map=e.uniforms.map.value,e.luminanceMap=e.uniforms.luminanceMap.value,e.flipY=!!e.uniforms.flipY.value,e.level=e.uniforms.level.value,Object.defineProperties(e,{map:{get:function(){return this.uniforms.map.value},set:function(r){this.uniforms.map.value=r}},luminanceMap:{get:function(){return this.uniforms.luminanceMap.value},set:function(r){this.uniforms.luminanceMap.value=r,this.defines.USE_LUMINANCE=r!==null,this.needsUpdate=!0}},flipY:{get:function(){return this.uniforms.flipY.value===1},set:function(r){this.uniforms.flipY.value=r?1:0}},level:{get:function(){return this.uniforms.level.value},set:function(r){this.uniforms.level.value=r}}}),e}return t}(d.ShaderMaterial),Up=function(n){se(t,n);function t(e,r){var i=n.call(this,ji,new Qp)||this;return e.box.getCenter(i.position),i.quaternion.multiplyQuaternions(new d.Quaternion().setFromAxisAngle(new d.Vector3(0,1,0),-Math.PI),Lp[e.face]),i.scale.setScalar(e.size),i.node=e,i.name="tiling:tile",i.material.visible=!1,i.activeTime=-1,i.disposed=!1,i.needsRender=!1,i.frustumCulled=!1,r.then(function(a){var o=a[0],s=a[1];i.disposed?(o.dispose(),s==null||s.dispose()):(i.material.map=o,i.material.luminanceMap=s,i.material.flipY=!!o.flipY,i.material.level=e.level,i.material.needsUpdate=!0,i.material.visible=!0,i.needsRender=!0)}).catch(Q),i}return t.prototype.updateTime=function(e){},t.prototype.dispose=function(){var e;this.disposed=!0,this.material.map&&(this.material.map.dispose(),(e=this.material.luminanceMap)===null||e===void 0||e.dispose()),this.material.dispose()},t}(d.Mesh),qp=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!1,e.name="tiling",e}return t}(d.Group),Hp=function(){function n(t,e,r){this.disposed=!1,this.textureLoader=new Bn,this.minLevel=e,this.level=0,this.panoId="[0]",this.maxRequest=n.DEFAULT_MAX_REQUEST,this.pedding=0,this.tileTree=Qa(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=r,this.fetcher=t,this.object=new qp,this.object.renderOrder=-3}return n.prototype.setFetcher=function(t){this.fetcher=t},n.prototype.cleanup=function(){var t=this;this.tileMeshes.forEach(function(e){e.dispose(),t.object.remove(e),t.object.needsRender=!0}),this.tileMeshes.clear()},n.prototype.setRotation=function(t){this.disposed||this.object.quaternion.equals(t)||(this.object.quaternion.copy(t),this.object.needsRender=!0)},n.prototype.setPosition=function(t){this.disposed||this.object.position.equals(t)||(this.object.position.copy(t),this.object.needsRender=!0)},n.prototype.setResource=function(t,e){var r,i;if(!this.disposed&&!(this.resource===t&&this.luminance===e)){this.cleanup(),this.resource=t;var a=(i=(r=t.slice().sort(function(o,s){return s.level-o.level})[0])===null||r===void 0?void 0:r.level)!==null&&i!==void 0?i:0;this.tileTree=Qa(a),this.luminance=e,this.object.needsRender=!0}},n.prototype.update=function(t,e,r){var i=this;if(!this.disposed){this.level=e;var a=t.planes[5].normal,o=[];e>=this.minLevel&&po(this.tileTree,function(y){if(!(y.level<i.minLevel)){if(y.level>e||!t.intersectsBox(y.box))return!1;o.push(y)}}),o.sort(function(y,b){return y.level!==b.level?y.level-b.level:y.box.getCenter(Ys).angleTo(a)-b.box.getCenter(Ys).angleTo(a)});for(var s=new Set,l=function(y){var b=u.resource.filter(function(K){return K.level===y.level})[0];if(!b)return"continue";if(s.add(y),u.tileMeshes.has(y))return u.tileMeshes.get(y).activeTime=r,"continue";if(u.pedding>=u.maxRequest)return"continue";var x=b.size,w=u.imageOptions.transform,E=Math.pow(2,y.level)*y.position.y,
|
|
1557
|
+
`,Qp=function(n){se(t,n);function t(){var e=n.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null},flipY:{value:1},level:{value:0}},vertexShader:Dp,fragmentShader:zp})||this;return e.depthTest=!1,e.depthWrite=!1,e.blending=d.NoBlending,e.map=e.uniforms.map.value,e.luminanceMap=e.uniforms.luminanceMap.value,e.flipY=!!e.uniforms.flipY.value,e.level=e.uniforms.level.value,Object.defineProperties(e,{map:{get:function(){return this.uniforms.map.value},set:function(r){this.uniforms.map.value=r}},luminanceMap:{get:function(){return this.uniforms.luminanceMap.value},set:function(r){this.uniforms.luminanceMap.value=r,this.defines.USE_LUMINANCE=r!==null,this.needsUpdate=!0}},flipY:{get:function(){return this.uniforms.flipY.value===1},set:function(r){this.uniforms.flipY.value=r?1:0}},level:{get:function(){return this.uniforms.level.value},set:function(r){this.uniforms.level.value=r}}}),e}return t}(d.ShaderMaterial),Up=function(n){se(t,n);function t(e,r){var i=n.call(this,ji,new Qp)||this;return e.box.getCenter(i.position),i.quaternion.multiplyQuaternions(new d.Quaternion().setFromAxisAngle(new d.Vector3(0,1,0),-Math.PI),Lp[e.face]),i.scale.setScalar(e.size),i.node=e,i.name="tiling:tile",i.material.visible=!1,i.activeTime=-1,i.disposed=!1,i.needsRender=!1,i.frustumCulled=!1,r.then(function(a){var o=a[0],s=a[1];i.disposed?(o.dispose(),s==null||s.dispose()):(i.material.map=o,i.material.luminanceMap=s,i.material.flipY=!!o.flipY,i.material.level=e.level,i.material.needsUpdate=!0,i.material.visible=!0,i.needsRender=!0)}).catch(Q),i}return t.prototype.updateTime=function(e){},t.prototype.dispose=function(){var e;this.disposed=!0,this.material.map&&(this.material.map.dispose(),(e=this.material.luminanceMap)===null||e===void 0||e.dispose()),this.material.dispose()},t}(d.Mesh),qp=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!1,e.name="tiling",e}return t}(d.Group),Hp=function(){function n(t,e,r){this.disposed=!1,this.textureLoader=new Bn,this.minLevel=e,this.level=0,this.panoId="[0]",this.maxRequest=n.DEFAULT_MAX_REQUEST,this.pedding=0,this.tileTree=Qa(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=r,this.fetcher=t,this.object=new qp,this.object.renderOrder=-3}return n.prototype.setFetcher=function(t){this.fetcher=t},n.prototype.cleanup=function(){var t=this;this.tileMeshes.forEach(function(e){e.dispose(),t.object.remove(e),t.object.needsRender=!0}),this.tileMeshes.clear()},n.prototype.setRotation=function(t){this.disposed||this.object.quaternion.equals(t)||(this.object.quaternion.copy(t),this.object.needsRender=!0)},n.prototype.setPosition=function(t){this.disposed||this.object.position.equals(t)||(this.object.position.copy(t),this.object.needsRender=!0)},n.prototype.setResource=function(t,e){var r,i;if(!this.disposed&&!(this.resource===t&&this.luminance===e)){this.cleanup(),this.resource=t;var a=(i=(r=t.slice().sort(function(o,s){return s.level-o.level})[0])===null||r===void 0?void 0:r.level)!==null&&i!==void 0?i:0;this.tileTree=Qa(a),this.luminance=e,this.object.needsRender=!0}},n.prototype.update=function(t,e,r){var i=this;if(!this.disposed){this.level=e;var a=t.planes[5].normal,o=[];e>=this.minLevel&&po(this.tileTree,function(y){if(!(y.level<i.minLevel)){if(y.level>e||!t.intersectsBox(y.box))return!1;o.push(y)}}),o.sort(function(y,b){return y.level!==b.level?y.level-b.level:y.box.getCenter(Ys).angleTo(a)-b.box.getCenter(Ys).angleTo(a)});for(var s=new Set,l=function(y){var b=u.resource.filter(function(K){return K.level===y.level})[0];if(!b)return"continue";if(s.add(y),u.tileMeshes.has(y))return u.tileMeshes.get(y).activeTime=r,"continue";if(u.pedding>=u.maxRequest)return"continue";var x=b.size,w=u.imageOptions.transform,E=Math.pow(2,y.level)*y.position.y,M=Math.pow(2,y.level)*y.position.x,C="".concat(u.panoId,".").concat(y.face,".").concat(y.level,".").concat(E,".").concat(M),R=k(k({key:"pano_tile.".concat(C)},Dt(u.imageOptions,["format","size","quality","sharpen","mappings"])),{size:b.scale>=1?void 0:x*y.size*b.scale,cut:[x*y.position.x,x*y.position.y,x*y.size,x*y.size]}),L=u.textureLoader.loadTexture(b[y.face],{imageURL:{transform:w,options:R},minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,fetcher:u.fetcher}).then(function(K){return K.body}),S=null;if(u.luminance){var I=u.luminance[y.face],O=I.match(/\/cube_(\d+)\//),P=O?Number(O[1]):!1;if(P!==!1){var F=b.size*b.scale/2,V=F*y.size,D=P<F?I.replace(/\/cube_(\d+)\//,"cube_"+F):I,z=k(k({},R),{size:P*y.size===V?void 0:V,cut:[P*y.position.x,P*y.position.y,P*y.size,P*y.size],key:"pano_tile_luminance.".concat(C)});S=u.textureLoader.loadTexture(D,{imageURL:{transform:u.imageOptions.transform,options:z},minFilter:d.LinearFilter,magFilter:d.LinearFilter,fetcher:u.fetcher}).then(function(K){return K.body}).catch(function(){return null})}}u.pedding++;var U=Promise.all([L,S]).then(function(K){return i.pedding--,K},function(K){return i.pedding--,Promise.reject(K)}),q=new Up(y,U);q.name="tiling:tile-".concat(C),q.activeTime=r,q.renderOrder=y.level,u.tileMeshes.set(y,q),u.object.needsRender=!0,u.object.add(q)},u=this,c=0,f=o;c<f.length;c++){var m=f[c];l(m)}var A=[];this.tileMeshes.forEach(function(y,b){s.has(b)||A.push(b),y.visible=b.level<=e});for(var h=A.sort(function(y,b){var x,w,E,M;return((w=(x=i.tileMeshes.get(b))===null||x===void 0?void 0:x.activeTime)!==null&&w!==void 0?w:0)-((M=(E=i.tileMeshes.get(y))===null||E===void 0?void 0:E.activeTime)!==null&&M!==void 0?M:0)}).slice(Math.max(0,kp-s.size)),p=0,g=h;p<g.length;p++){var m=g[p],v=this.tileMeshes.get(m);v&&(v.dispose(),this.object.remove(v),this.object.needsRender=!0),this.tileMeshes.delete(m)}}},n.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},n.DEFAULT_MAX_REQUEST=3,n}(),Gp=new Float32Array([-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,-1,-1,1,-1,-1]),Kp=new Uint8Array([0,2,1,2,3,1,4,6,5,6,7,5,8,10,9,10,11,9,12,14,13,14,15,13,16,18,17,18,19,17,20,22,21,22,23,21]),Fo=new d.BufferGeometry;Fo.setAttribute("position",new d.BufferAttribute(Gp,3));Fo.setIndex(new d.BufferAttribute(Kp,1));var jp=`
|
|
1558
1558
|
#if defined(USE_PANO_VIDEO)
|
|
1559
1559
|
varying vec3 worldPosition;
|
|
1560
1560
|
#endif
|
|
@@ -1589,7 +1589,7 @@ void main() {
|
|
|
1589
1589
|
gl_FragColor = vec4(videoColor.rgb, match * blendAlpha * alpha);
|
|
1590
1590
|
#endif
|
|
1591
1591
|
}
|
|
1592
|
-
`,Jp=function(){function n(){this.material=new d.ShaderMaterial({vertexShader:jp,fragmentShader:_p,uniforms:{size:new d.Uniform(null),matrix:new d.Uniform(null),alpha:new d.Uniform(null),map:new d.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor}),this.object=new d.Mesh(Fo,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new Ce({alpha:0})}return n.prototype.setMaterial=function(t){t?(this.material.uniforms.size.value=t.size,this.material.uniforms.matrix.value=t.matrix,this.material.uniforms.map.value=t.map,this.alphaMotion.set({alpha:t.alpha},500).catch(Q),this.material.uniforms.alpha.value=t.alpha):(this.material.uniforms.size.value=null,this.material.uniforms.matrix.value=null,this.material.uniforms.map.value=null,this.alphaMotion.set({alpha:0},0).catch(Q));var e=t!==null,r=this.material.defines.USE_PANO_VIDEO;e!==r&&(this.material.defines.USE_PANO_VIDEO=e,this.material.needsUpdate=!0,this.object.visible=t!==null)},n.prototype.updateTime=function(t){this.alphaMotion.ended||(this.alphaMotion.update(t),this.material.uniforms.alpha.value=this.alphaMotion.value.alpha)},n.prototype.dispose=function(){this.material.dispose()},n}(),Xp=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),$s=new d.Vector3(-1,1,1),e0=function(){function n(t){t===void 0&&(t=0),this.width=t,this.pool=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.pool.length},enumerable:!1,configurable:!0}),n.prototype.create=function(){return new d.WebGLCubeRenderTarget(this.width,{stencilBuffer:!1,depthBuffer:!1})},n.prototype.pop=function(){var t=this.pool.pop();return t||this.create()},n.prototype.push=function(t){this.pool.indexOf(t)===-1&&this.pool.push(t)},n.prototype.clear=function(){for(var t=0,e=this.pool;t<e.length;t++){var r=e[t];r.dispose()}this.pool.length=0},n}(),ko=function(n){se(t,n);function t(e){var r=this,i,a,o,s,l=t.parseArgs(e);r=n.call(this,l)||this,r.TILED_CUBE_TEXTURE_LEVEL=2,r.mode="Panorama",r.tileLevel=0,r.initAnimationed=!1,r.maxAccessibleDistance=l.maxAccessibleDistance,r.panoTapTriggerRadius=l.panoTapTriggerRadius,r.panoCircleMeshCreator=l.panoCircleMeshCreator,r.tileLevelForFov=l.tileLevelForFov,r.tileMaxRequest=l.tileMaxRequest,r.luminanceAdaptiveEffectEnable=l.luminanceAdaptiveEffectEnable,r.luminanceAdaptiveEffect=new Zs(r.renderer,r.modelScene,r.camera,r.models),r.colorCubeRenderTargetPool=new e0,r.luminanceCubeRenderTargetPool=new e0;var u=r.models.getMaterial()||{},c=u.pano0,f=u.pano1;c&&(f==null?void 0:f.map)!==c.map&&(r.models.setMaterial({pano0:f}),c.map.dispose(),c.map instanceof Ne&&c.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(c.map.cubeRenderTarget),c.luminanceMap&&(c.luminanceMap.dispose(),c.luminanceMap instanceof Ne&&c.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(c.luminanceMap.cubeRenderTarget)));for(var m=r.colorCubeRenderTargetPool.size;m<2;m++){var A=Math.max(1024*r.TILED_CUBE_TEXTURE_LEVEL,512),h=r.colorCubeRenderTargetPool.create();h.setSize(A,A),qa(null,h,r.renderer),r.colorCubeRenderTargetPool.push(h)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new Ce({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Ce({modelAlpha:(a=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&a!==void 0?a:0}),r.perspToOrthoMotion=new Ce({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=St()]={panoId:De(r.currentPano),panoPicture:(s=(o=r.models.getMaterial())===null||o===void 0?void 0:o.pano1)!==null&&s!==void 0?s:null,position:r.camera.pose.offset.clone(),effect:"fly",fixCameraTransform:new d.Matrix4};var p=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new Bn,r.tiling=new Hp(p?it(p.work):Bi,r.TILED_CUBE_TEXTURE_LEVEL+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new Jp,r.scene.add(r.panoVideo.object),r}return t.parseArgs=function(e){var r,i,a,o,s,l;if(e instanceof t)return e;var u=n.parseArgs.call(this,e);return k(k({},u),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:5,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:.5,panoCircleMeshCreator:(a=e.panoCircleMeshCreator)!==null&&a!==void 0?a:function(c){return new Uu},tileLevelForFov:(o=e.tileLevelForFov)!==null&&o!==void 0?o:function(c,f){var m=function(v){return v/Math.PI*180},A=function(v){return v/180*Math.PI},h=f.height/2/Math.tan(A(c/2)),p=f.width>f.height?c:m(Math.atan(Math.tan(A(c/2))*(f.width/f.height))*2);p*=.9;var g=h*(Math.tan(A(p/2))-Math.tan(A(p/2-1)));return g>80?5:g>60?4:g>40?3:g>18?2:g>12?1:0},tileMaxRequest:(s=e.tileMaxRequest)!==null&&s!==void 0?s:3,luminanceAdaptiveEffectEnable:(l=e.luminanceAdaptiveEffectEnable)!==null&&l!==void 0?l:!0})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{mode:"Panorama"})},t.prototype.destroy=function(){var e,r;if(n.prototype.destroy.call(this),this.scene.remove(this.tiling.object),this.tiling.dispose(),this.locationMotion.dispose(),this.colorCubeRenderTargetPool.clear(),this.luminanceCubeRenderTargetPool.clear(),delete this.pendingTextureTask,this.panoMeshes)for(var i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],l=this.panoMeshes[s];this.helper.remove(l),l.dispose(),delete this.panoMeshes[s]}var u=this.videoTexture.image;u.pause(),u.oncanplay=function(){},u.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var c=(e=this.models.getMaterial())!==null&&e!==void 0?e:{},f=c.pano0,m=c.pano1,A=0,h=Object.keys(this.panoResources);A<h.length;A++){var p=h[A],g=this.panoResources[p];if(g.panoPicture){var v=g.panoPicture.map;v&&v!==(f==null?void 0:f.map)&&v!==(m==null?void 0:m.map)&&(v.dispose(),(r=g.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),g.panoPicture=null)}delete this.panoResources[p]}this.luminanceAdaptiveEffect.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended!==!0?!1:n.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e,r,i,a=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),o=((e=a.panoPicture)===null||e===void 0?void 0:e.map)instanceof Ne&&(i=(r=a.panoPicture)===null||r===void 0?void 0:r.map.tilePending)!==null&&i!==void 0?i:0,s=this.tiling.pedding;return this.initAnimationed&&o<=0&&s<=0},t.prototype.updateWork=function(e,r,i,a){var o=this;this.userAction=a,this.works=e;var s=t.initAnimationEndState(k(k({},this),{initial:{currentState:k(k({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}})),l={workCode:s.workCode,panoIndex:s.panoIndex},u=this.works.getWork(l.workCode);return this.tiling.setFetcher(u?it(u):Bi),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(l,{effect:i.effect,duration:i.duration,longitude:r.longitude,latitude:r.latitude,fov:r.fov,moveEndCallback:function(){o.initAnimationed=!0},moveCancelCallback:function(){o.initAnimationed=!0}},a),!0},t.prototype.updateModel=function(e){this.models=e,this.updatePanoMeshes()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,l,u,c,f,m,A,h;if(!this.destroyed){var p={},g={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],E=x[1],C=this.panoResourceFromLocationMotionKeyframe(w),M=this.panoResourceFromLocationMotionKeyframe(E),R=new d.Vector3().copy(C.position),L=new d.Vector3().copy(M.position),S=this.locationMotion.value.count-E.value.count+1;p.progress=S,M.panoPicture&&(S<1?C.panoPicture&&(p.pano0=C.panoPicture):p.pano0=M.panoPicture,p.pano1=M.panoPicture),M.effect==="montage"?p.transition="BLACK":M.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(M.effect==="zoomin"||M.effect==="zoomout")&&(p.progress=Math.pow(S,3)),S<1&&M.effect!=="fly"&&(p.pano0&&C.panoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:C.panoPicture.matrix.clone().premultiply(C.fixCameraTransform).setPosition(M.position)}),R.copy(L),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new d.Vector3(R.x+(L.x-R.x)*S,R.y+(L.y-R.y)*S,R.z+(L.z-R.z)*S);for(var I=[],O=[],P=0,F=this.locationMotion.keyframes;P<F.length;P++){var V=F[P],D=V.key,z=V.progress;D!==void 0&&(I.push(D),z>this.locationMotion.progress&&O.push(D))}for(var U=0,q=Object.keys(this.panoResources);U<q.length;U++){var K=q[U];if(!(O.indexOf(K)>=0)){var j=this.panoResources[K];if(j.panoPicture){var J=j.panoPicture.map,X=j.panoPicture.luminanceMap;if(J){if(J===((a=p.pano0)===null||a===void 0?void 0:a.map)||J===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;J instanceof Ne&&J.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose(),X&&(X instanceof Ne&&X.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(X.cubeRenderTarget),X.dispose()),j.panoPicture=null}}I.indexOf(K)>=0||delete this.panoResources[K]}}this.currentPano=At(M.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:At(v.panoId),state:k(k(k(k({},At(y.panoId)),{mode:this.mode}),_e(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}Ut(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ne&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=p.pano0)===null||l===void 0)&&l.luminanceMap&&p.pano0.luminanceMap instanceof Ne&&!p.pano0.luminanceMap.cubeRenderTarget&&(p.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((u=p.pano1)===null||u===void 0)&&u.map&&p.pano1.map instanceof Ne&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=p.pano1)===null||c===void 0)&&c.luminanceMap&&p.pano1.luminanceMap instanceof Ne&&!p.pano1.luminanceMap.cubeRenderTarget&&(p.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(p)),Ut(g)===!1&&this.setCamera(g);var Y=this.works.getResolvedObserver(this.currentPano),W=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||b)for(var ee=0,Z=Object.keys(this.panoMeshes);ee<Z.length;ee++){var ie=Z[ee],te=this.panoMeshes[ie];te.setOpacity(0),te.setCurrent(!1),te.updateTime&&te.updateTime(e,r),te.visible=!1}else if(Y){var le=dr(Y.visibleIds,function(ve){var xe=i.works.getResolvedObserver(ve);return xe?Y.standingPosition.distanceTo(xe.standingPosition):1/0},!0),oe=le[1];oe=fe(oe,2.5,1/0);for(var we=Y.visibleIds.concat(De(this.currentPano)),pe=this.camera.getDirection(new d.Vector3),ge=0,Re=Object.keys(this.panoMeshes);ge<Re.length;ge++){var ie=Re[ge],te=this.panoMeshes[ie],Se=this.works.getResolvedObserver(ie);if(we.indexOf(ie)===-1)te.setCurrent(!1),te.setOpacity(0);else if(!Se)te.setCurrent(!1),te.setOpacity(0);else if(!Se.loadable&&!Se.active)te.setCurrent(!1),te.setOpacity(0);else{var Te=te.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);te.setCurrent(!te.loading&&te.progress===0&&W!==null&&W.panoId===ie),te.setOpacity(Te<.01?0:fe(oe/Te*1.2,.4,.85));var re=this.camera.position.clone().setY(te.position.y),ae=new d.Vector3().copy(te.position).sub(re).normalize();if(ie===De(this.currentPano)){var H=fe((.5-re.distanceTo(te.position))/.5,0,1);ae.multiplyScalar(1-H).add(pe.clone().multiplyScalar(H))}ae.length()>0&&te.quaternion.setFromEuler(new d.Euler(0,Math.atan2(ae.x,ae.z),0))}te.updateTime&&te.updateTime(e,r)}}var Ve=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ve=i.renderer.getDrawingBufferSize(new d.Vector2);ve.width*=i.scissor.width,ve.height*=i.scissor.height;var xe=y.panoId,ye=i.works.getResolvedObserver(xe),me=i.imageOptions.size;if(typeof me=="undefined"&&ye){var Qe=ye.images.up.match(/\/cube_(\d+)\//);Qe&&(me=Number(Qe[1]))}typeof me=="undefined"&&(me=2048);var Ke=0;me>=1024&&(Ke=1),me>=2048&&(Ke=2),me>=4096&&(Ke=3),me>=8192&&(Ke=4);var rt=i.tileLevelForFov(i.camera.fov,ve);return rt>Ke?rt:0}(),Fe=function(){var ve=i.camera.quaternion.clone(),xe=i.works.getResolvedObserver(y.panoId),ye=xe!=null?xe:Y;ye&&ve.premultiply(ye.quaternion.clone().inverse());var me=new d.Matrix4().makeRotationFromQuaternion(ve),Qe=new d.Matrix4().getInverse(me),Ke=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Qe));return Ke}();y.panoId===De(this.currentPano)&&(((f=y.panoPicture)===null||f===void 0?void 0:f.map)instanceof Ne&&(y.panoPicture.map.maxRequest=this.tileMaxRequest,y.panoPicture.map.update(Fe,Ve),y.panoPicture.map.needsRender===!0&&(y.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((m=y.panoPicture)===null||m===void 0?void 0:m.luminanceMap)instanceof Ne&&(y.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,y.panoPicture.luminanceMap.update(Fe,Ve),y.panoPicture.luminanceMap.needsRender===!0&&(y.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ie=this.tiling.object.visible;if(this.initAnimationed){var Ge=y.panoId,be=this.works.getResolvedObserver(Ge);be?ai(this.camera.position,be.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ge&&this.tiling.cleanup(),this.tiling.panoId=Ge,this.tiling.setResource((h=(A=be.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&be.images.luminance?be.images.luminance:null),this.tiling.setFetcher(it(be.work)),this.tiling.setRotation(be.quaternion),this.tiling.setPosition(be.position),this.tiling.maxRequest=this.tileMaxRequest,Ve>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Fe,Ve,e):this.tiling.update(Fe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ie!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.intersectMesh.scale.setScalar(fe(this.cameraMotion.value.fov/45,0,1))}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget(),a=this.works.getResolvedObserver(this.currentPano);a&&a.video&&(this.needsRender=!0,this.modelSceneNeedsRender=!0),this.updateScreenBuffer(r),e&&(r==="luminance"?(this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable,this.luminanceAdaptiveEffect.render(this.screenBuffers)):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.postProcessing=function(e,r){if(!this.destroyed&&r==="luminance")return this.luminanceAdaptiveEffect||(this.luminanceAdaptiveEffect=new Zs(this.renderer,this.scene,this.camera,this.models),this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable),this.luminanceAdaptiveEffect.render(e)},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[1],i=this.panoResourceFromLocationMotionKeyframe(r),a=this.works.getResolvedObserver(i.panoId);return{workCode:a?a.work.workCode:this.currentPano.workCode,panoIndex:a?a.panoIndex:this.currentPano.panoIndex,mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:a?a.position.clone():this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,c=(o=r.effect)!==null&&o!==void 0?o:"fly";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));var m=Jn(f.images.up),A=this.imageOptions.size;typeof A=="undefined"&&f&&m&&(A=Number(m)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=k({key:"pano.".concat(f.panoId)},Dt(this.imageOptions,["format","size","quality","sharpen","mappings"])),g=f.images,v=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(F){return F.size>A}))!==null&&l!==void 0?l:null,y=h,b={key:"pano_luminance.".concat(f.panoId),size:p.size?p.size/2:void 0},x=this.enableIOSEDR&&f.images.luminance?f.images.luminance:null,w=function(){if(!f.images.tiles||!x)return null;var F=Jn(x.up);return F?v==null?void 0:v.map(function(V){var D=V.size*V.scale/2;return F<D?{level:V.level,size:D,scale:1,back:Ot(x.back,D),front:Ot(x.front,D),left:Ot(x.left,D),right:Ot(x.right,D),up:Ot(x.up,D),down:Ot(x.down,D)}:{level:V.level,size:F,scale:D/F,back:x.back,front:x.front,left:x.left,right:x.right,up:x.up,down:x.down}}):null}(),E="pano:"+Hi([g,p,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===E)return;var C=this.pendingTextureTask.panoId;(u=this.panoMeshes[C])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano}))}var M="move-to-pano-"+f.panoId;this.pending.add(M);var R=this.models.getMaterial()||{},L=R.pano0,S=R.pano1,I;if(L&&L.map.name===E&&L.luminanceMap!==null===this.enableIOSEDR?I=L:(S==null?void 0:S.map.name)===E&&S.luminanceMap!==null===this.enableIOSEDR&&(I=S),I){var O={panoId:f.panoId,effect:c,panoPicture:{zoom:1,map:I.map,luminanceMap:I.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,$s)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};dt.shared.add(function(){a.pending.delete(M),a.doMoveToPano(f.pano,O,r)},!0,1);return}this.pendingTextureTask={panoId:f.panoId,hash:E,onLoad:function(F,V){var D;if(a.pending.delete(M),a.destroyed)F.body.dispose();else{F.body.name=E;var z={panoId:f.panoId,effect:c,panoPicture:{zoom:1,map:F.body,luminanceMap:(D=V==null?void 0:V.body)!==null&&D!==void 0?D:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,$s)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,z,r)}},onError:function(F){a.pending.delete(M);var V=k(k(k({},f.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",_("pano.error",{error:F,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:V})),a.emit("pano.cancel",_("pano.cancel",{error:F,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:V})),a.emit("error",F),r.moveCancelCallback&&r.moveCancelCallback()}};var P=this.panoMeshes[f.panoId];P&&P.tap&&P.tap(),Promise.all([this.tileLevelForFov&&v&&v.length?this.textureLoader.loadTiledCubeTexture(g,v,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:h,options:p},minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,format:d.RGBAFormat,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(F){var V,D;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:F,meta:null,pano:f.pano})),((V=a.pendingTextureTask)===null||V===void 0?void 0:V.hash)===E&&((D=a.panoMeshes[f.panoId])===null||D===void 0||D.setProgress(F))},this.renderer):this.textureLoader.loadCubeTexture(g,{imageURL:{transform:h,options:p},format:d.RGBAFormat,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(F){var V,D;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:F,meta:null,pano:f.pano})),((V=a.pendingTextureTask)===null||V===void 0?void 0:V.hash)===E&&((D=a.panoMeshes[f.panoId])===null||D===void 0||D.setProgress(F))},this.renderer),x?this.tileLevelForFov&&w&&w.length?this.textureLoader.loadTiledCubeTexture(x,w,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:y,options:b},minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,fetcher:it(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(x,{imageURL:{transform:y,options:b},fetcher:it(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(F){var V,D,z=F[0],U=F[1];((V=a.pendingTextureTask)===null||V===void 0?void 0:V.hash)===E?(a.pendingTextureTask.onLoad(z,U),(D=a.panoMeshes[f.panoId])===null||D===void 0||D.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:z.meta,pano:f.pano}))):(z.body.dispose(),U==null||U.body.dispose())}).catch(function(F){var V,D;((V=a.pendingTextureTask)===null||V===void 0?void 0:V.hash)===E&&(a.pendingTextureTask.onError(F),(D=a.panoMeshes[f.panoId])===null||D===void 0||D.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:F,progress:0,meta:null,pano:f.pano})),a.emit("error",F))}),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial,a=i.duration,o=i.effect,s=i.userAction;e.userAction=s;var l=t.initAnimationEndState(e),u={workCode:l.workCode,panoIndex:l.panoIndex},c={modelAlpha:0},f={perspToOrtho:0},m=!1;e.moveToPano(u,{longitude:l.longitude,latitude:l.latitude,fov:l.fov,effect:o,duration:a,moveStartCallback:function(A){m=!0,e.perspToOrthoMotion.set(f,a).catch(Q),e.modelAlphaMotion.setKeyframes([{progress:0,value:k({},e.modelAlphaMotion.value)},{progress:.6,value:k({},e.modelAlphaMotion.value)},{progress:1,value:c}],a).catch(Q),e.emit("initAnimation.start",_("initAnimation.start",{state:A,userAction:e.userAction}))},moveEndCallback:function(A){e.emit("initAnimation.end",_("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var A=k(k(k({},u),{mode:e.mode}),_e(e.camera.pose));m===!1&&e.emit("initAnimation.start",_("initAnimation.start",{state:A,userAction:e.userAction})),e.emit("initAnimation.end",_("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()}},s)})},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var r=0,i=1;i<e.length;i++){var a=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,o=this.panoResourceFromLocationMotionKeyframe(e[i]).position,s=a.distanceTo(o)*(e[i].value.count-e[i-1].value.count);r+=s}return r},t.prototype.updatePanoMeshes=function(){for(var e=this,r={},i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],l=this.panoMeshes[s];r[s]=l,delete this.panoMeshes[s]}for(var u=1,c={},f=function(E){var C=dr(E.accessibleIds,function(R){var L=e.works.getResolvedObserver(R);if(!L)return 1/0;var S=L.standingPosition.distanceTo(E.standingPosition);return fe(S,1,1/0)},!0),M=C[1];c[E.panoId]===void 0&&(c[E.panoId]=M)},m=0,A=this.works.resolvedObservers;m<A.length;m++){var h=A[m];f(h)}var p=Object.keys(c).map(function(E){return c[E]});if(p.length){var g=p.reduce(function(E,C){return E+C},0)/p.length;u=fe(g*.6,1,3)}for(var v=0,y=this.works.resolvedObservers;v<y.length;v++){var h=y[v],l=void 0;r[h.panoId]?(l=r[h.panoId],l.loading===!0&&h.loadable===!1&&l.setLoading(!1),delete r[h.panoId]):(l=this.panoCircleMeshCreator(h.pano),l.name="PanoCircleMesh_"+h.panoId,this.helper.add(l)),l.scale.set(u,1,u),l.position.copy(h.standingPosition),this.panoMeshes[h.panoId]=l}for(var b=0,x=Object.keys(r);b<x.length;b++){var w=x[b];this.helper.remove(r[w]),r[w].dispose(),delete r[w]}},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,c,f,m,A,h,p,g;i===void 0&&(i={});var v=he(),y=St();this.tiling.cleanup(),this.panoResources[y]=r;var b=1,x,w,E;if(this.locationMotion.ended){var C=this.locationMotion.getKeyFrameSegment(v);C[0];var M=C[1],R=this.locationMotion.value,L=((o=this.panoResourceFromLocationMotionKeyframe(M))!==null&&o!==void 0?o:this.camera).position,S=r.position;x=Math.max(L.distanceTo(S),b),w=[{key:M.key,progress:0,value:k(k({},R),{count:0})},{key:y,progress:1,value:{distance:0,count:1}}],E=0}else{var I=this.locationMotion.getKeyFrameSegment(v),O=I[0],M=I[1],R=this.locationMotion.value,P=this.panoResourceFromLocationMotionKeyframe(O).position,L=this.panoResourceFromLocationMotionKeyframe(M).position,S=r.position,F=M.value.count-R.count,V=Math.max(P.distanceTo(L),b)*F,D=Math.max(L.distanceTo(S),b);x=V+D,w=[{key:O.key,progress:0,value:k({},R)},{key:M.key,progress:V/x,value:M.value},{key:y,progress:1,value:{count:M.value.count+1,distance:0}}];var z=this.locationMotionKeyframesLength(this.locationMotion.keyframes),U=this.locationMotionKeyframesLength(w);z===0||z===0?E=0:E=this.locationMotion.getProgressVelocity(v)*z/U}var q=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?x:0),K={longitude:i.longitude,latitude:i.latitude,fov:i.fov},j=k(k({},e),{mode:this.mode,longitude:(s=K.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(l=K.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(u=K.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),J=this.currentPano;if(this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:J,progress:0,state:j,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(j),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(K,q).catch(Q);else{var X=Nt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),Y=Nt({longitude:(c=K.longitude)!==null&&c!==void 0?c:this.cameraMotion.value.longitude,latitude:(f=K.latitude)!==null&&f!==void 0?f:this.cameraMotion.value.latitude}),W=new d.Object3D;W.lookAt(X);var ee=new d.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(Y);var Z=new d.Matrix4().makeRotationFromQuaternion(W.quaternion),ie=new d.Matrix4().getInverse(ee).premultiply(Z),te=this.cameraMotion.value.fov,le=(m=K.fov)!==null&&m!==void 0?m:this.cameraMotion.value.fov,oe=1;r.effect==="zoomin"?oe=1.5:r.effect==="zoomout"&&(oe=.4);for(var we=fe(le*oe,1,170),pe=0;pe<w.length-1;pe++){var ge=w[pe].key;if(ge){var Re=this.panoResources[ge];Re&&(Re.fixCameraTransform.copy(ie),Re.panoPicture&&(Re.panoPicture.zoom=Math.tan(te/2/180*Math.PI)/Math.tan(we/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(A=K.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(h=K.latitude)!==null&&h!==void 0?h:this.cameraMotion.value.latitude,fov:we}},{progress:1,value:{longitude:(p=K.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(g=K.latitude)!==null&&g!==void 0?g:this.cameraMotion.value.latitude,fov:le}}],q).catch(Q)}var Se=this.locationMotion.setKeyframes(w,q,E);Se.then(function(){for(var Te,re,ae=0,H=a.models;ae<H.length;ae++){var Ve=H[ae];Ve.show()}var Fe=k(k({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:a.camera.pose.distance});a.emit("pano.arrived",_("pano.arrived",{options:i,prevPano:J,progress:1,state:Fe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Fe);var Ie=a.works.getResolvedObserver(e);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ge=Xp.clone().multiply((re=(Te=a.models.getMaterial().pano1)===null||Te===void 0?void 0:Te.matrix)!==null&&re!==void 0?re:new d.Matrix4).multiply(Ie.video.matrix),be={map:a.videoTexture,size:Ie.video.size,matrix:Ge,alpha:1},ve=St(),xe=a.videoTexture.image;xe.setAttribute("uuid",ve),Ju().then(function(ye){ye&&Ie.video&&xe.getAttribute("uuid")===ve&&(xe.oncanplay=function(){xe.oncanplay=Q,xe.play()},xe.ontimeupdate=function(){xe.currentTime>.5&&(xe.ontimeupdate=Q,a.panoVideo.setMaterial(be))},xe.src=Ie.video.source)}).catch(function(){xe.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:J,progress:0,state:j,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.works.getResolvedObserver(this.currentPano);if(!i)return null;var a=e!=null?e:new d.Raycaster(this.camera.position.clone(),this.camera.getDirection(new d.Vector3));a.params.Points={threshold:.1};var o=i.standingPosition.clone();if(i.position.distanceTo(a.ray.origin)>1){var s=this.models.intersectRaycaster(new d.Raycaster(a.ray.origin,new d.Vector3(0,-1,0)))[0];s&&s.distance<=2?o.copy(s.point):o.copy(a.ray.origin).add(new d.Vector3(0,-1.5,0))}var l=this.models.intersectRaycaster(a)[0],u=l?l.point:a.ray.origin.clone().add(a.ray.direction.clone().normalize().multiplyScalar(3)),c=u.clone().sub(o).normalize();if(c.length()===0)return null;for(var f=i.accessibleIds.filter(function(w){if(w===De(r.currentPano))return!1;var E=r.works.getResolvedObserver(w);if(!E)return!1;var C=E.standingPosition.clone().project(r.camera);return Math.abs(C.z)>1||Math.abs(C.x)>1||Math.abs(C.y)>1?!1:E.loadable||E.active}),m=f.slice().sort(function(w,E){var C=r.works.getResolvedObserver(w).standingPosition.clone().distanceTo(o),M=r.works.getResolvedObserver(E).standingPosition.clone().distanceTo(o);return C-M}),A=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];A<h.length;A++)for(var p=h[A],g=0,v=m;g<v.length;g++){var y=v[g],b=this.works.getResolvedObserver(y);if(b){var x=b.standingPosition.clone().sub(o);if(x&&x.length()!==0&&c.angleTo(x)<p)return b}}return null},t.prototype.onTapGesture=function(e){var r=this,i;if(this.userAction=e.userAction,this.stopMomentumMovement(),!!this.initAnimationed){if(!this.locationMotion.ended){var a=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]);if(a.panoId!==De(this.currentPano))return}var o=e.center.raycaster,s=this.camera.getDirection(new d.Vector3).setY(0),l=null,u=this.works.getResolvedObserver(this.currentPano);if(u){var c=u.accessibleIds.filter(function(U){if(U===De(r.currentPano))return!1;var q=r.works.getResolvedObserver(U);return!q||q.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:q.loadable||q.active}),f=this.models.intersectRaycaster(o)[0];if(f){var m=dr(c,function(U){var q=r.works.getResolvedObserver(U);if(!q)return 1/0;var K=q.standingPosition.clone();return K.distanceTo(f.point)},!0),A=m[0],h=m[1];A&&h<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(A))!==null&&i!==void 0?i:null)}l||(l=this.getForwardObserverOrNot(o));for(var p=0,g=this.locationMotion.keyframes;p<g.length;p++){var v=g[p],y=this.panoResourceFromLocationMotionKeyframe(v);if(!(v.progress<this.locationMotion.progress)&&l&&y.panoId===l.panoId){l=null;break}}if(!l)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var b={},x=Math.PI/6,w=Math.PI/12,E=l.position.clone().setY(0).sub(u.position.clone().setY(0)).normalize(),C=[],M=[],R=[],L=0,S=l.accessibleIds;L<S.length;L++){var A=S[L],I=At(A);if(!(Yt(I,this.currentPano)||Yt(I,l.pano))){var O=this.works.getResolvedObserver(A);if(O){var P=O.position.clone().sub(l.position).setY(0);E.angleTo(P)<x&&R.push(P)}}}var F=R.length>0?R:Et(Et([],C,!0),M,!0),V=F.slice().sort(function(U,q){return U.angleTo(E)-q.angleTo(E)})[0];V&&V.angleTo(s)>w&&(b.longitude=Math.atan2(-V.x,-V.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(b.latitude=fe(0,this.minLatitude,this.maxLatitude));var D=k({},e.state);if(D.workCode=l.pano.workCode,D.panoIndex=l.pano.panoIndex,b.longitude!==void 0&&(D.longitude=b.longitude),b.latitude!==void 0&&(D.latitude=b.latitude),b.fov!==void 0&&(D.fov=b.fov),D.distance=0,D.offset=l.position.clone(),e.state=D,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:D,userAction:e.userAction,options:b,progress:0,error:null})),l&&!l.active){var z=l.panoId;this.panoMeshes[z]&&(this.panoMeshes[z].setDisabled(!1),this.panoMeshes[z].setLoading(!0))}l&&l.active&&this.emit("pano.request",_("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:D,options:b,error:null}))}}}}},t}(_u),xr=Math.PI/180,En=180/Math.PI,Xu=.001,Wu=1,_n=function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),Wp=function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),Zp=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),Zu=function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),Yp=function(){var n=!1;if(Zu()===65){var t=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var e=t[1].split(".");e[0],e[1];var r=e[2],i=e[3];n=parseInt(r,10)===3325&&parseInt(i,10)<148}}return function(){return n}}(),$p=function(){var n=_n()&&Wp()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),Yu=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function t0(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return Yu()?!n:n}function ev(n){return!(isNaN(n)||n<=Xu||n>Wu)}function tv(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var r0=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function n0(n){var t,e=n.indexOf("://");e!==-1?t=e+3:t=0;var r=n.indexOf("/",t);return r===-1&&(r=n.length),n.substring(0,r)}function rv(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=n0(document.referrer),e=n0(window.location.href);return n&&t!==e}var i0=function(){function n(r,i,a){var o=i?i[0]:0,s=i?i[1]:0,l=i?i[2]:0,u=i?i[3]:1,c=o+o,f=s+s,m=l+l,A=o*c,h=o*f,p=o*m,g=s*f,v=s*m,y=l*m,b=u*c,x=u*f,w=u*m;return r[0]=1-(g+y),r[1]=h+w,r[2]=p-x,r[3]=0,r[4]=h-w,r[5]=1-(A+y),r[6]=v+b,r[7]=0,r[8]=p+x,r[9]=v-b,r[10]=1-(A+g),r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function t(r,i,a){var o=a[0],s=a[1],l=a[2],u,c,f,m,A,h,p,g,v,y,b,x;return i===r?(r[12]=i[0]*o+i[4]*s+i[8]*l+i[12],r[13]=i[1]*o+i[5]*s+i[9]*l+i[13],r[14]=i[2]*o+i[6]*s+i[10]*l+i[14],r[15]=i[3]*o+i[7]*s+i[11]*l+i[15]):(u=i[0],c=i[1],f=i[2],m=i[3],A=i[4],h=i[5],p=i[6],g=i[7],v=i[8],y=i[9],b=i[10],x=i[11],r[0]=u,r[1]=c,r[2]=f,r[3]=m,r[4]=A,r[5]=h,r[6]=p,r[7]=g,r[8]=v,r[9]=y,r[10]=b,r[11]=x,r[12]=u*o+A*s+v*l+i[12],r[13]=c*o+h*s+y*l+i[13],r[14]=f*o+p*s+b*l+i[14],r[15]=m*o+g*s+x*l+i[15]),r}function e(r,i){var a=i[0],o=i[1],s=i[2],l=i[3],u=i[4],c=i[5],f=i[6],m=i[7],A=i[8],h=i[9],p=i[10],g=i[11],v=i[12],y=i[13],b=i[14],x=i[15],w=a*c-o*u,E=a*f-s*u,C=a*m-l*u,M=o*f-s*c,R=o*m-l*c,L=s*m-l*f,S=A*y-h*v,I=A*b-p*v,O=A*x-g*v,P=h*b-p*y,F=h*x-g*y,V=p*x-g*b,D=w*V-E*F+C*P+M*O-R*I+L*S;return D?(D=1/D,r[0]=(c*V-f*F+m*P)*D,r[1]=(s*F-o*V-l*P)*D,r[2]=(y*L-b*R+x*M)*D,r[3]=(p*R-h*L-g*M)*D,r[4]=(f*O-u*V-m*I)*D,r[5]=(a*V-s*O+l*I)*D,r[6]=(b*C-v*L-x*E)*D,r[7]=(A*L-p*C+g*E)*D,r[8]=(u*F-c*O+m*S)*D,r[9]=(o*O-a*F-l*S)*D,r[10]=(v*R-y*C+x*w)*D,r[11]=(h*C-A*R-g*w)*D,r[12]=(c*I-u*P-f*S)*D,r[13]=(a*P-o*I+s*S)*D,r[14]=(y*E-v*M-b*w)*D,r[15]=(A*M-h*E+p*w)*D,r):null}return function(r,i,a){n(r,i),a&&t(r,r,a),e(r,r)}}(),Ta=function(){function n(t,e){t===void 0&&(t=new d.Vector3),e===void 0&&(e=0),this.sample=t,this.timestampS=e}return n.prototype.set=function(t,e){this.sample=t,this.timestampS=e},n.prototype.copy=function(t){this.set(t.sample,t.timestampS)},n}(),nv=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new Ta,this.currentGyroMeasurement=new Ta,this.previousGyroMeasurement=new Ta,_n()?this.filterQ=new d.Quaternion(-1,0,0,1):this.filterQ=new d.Quaternion(1,0,0,1),this.previousFilterQ=new d.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new d.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new d.Vector3,this.measuredGravity=new d.Vector3,this.gyroIntegralQ=new d.Quaternion}return n.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},n.prototype.addGyroMeasurement=function(t,e){this.currentGyroMeasurement.set(t,e);var r=e-this.previousGyroMeasurement.timestampS;ev(r)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},n.prototype.getOrientation=function(){return this.filterQ},n.prototype.run_=function(){if(!this.isOrientationInitialized){this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),this.isOrientationInitialized=!0;return}var t=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,e=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,t);this.gyroIntegralQ.multiply(e),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(e);var r=new d.Quaternion;r.copy(this.filterQ),r.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(r),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var i=new d.Quaternion;i.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),i.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",En*tv(i),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var a=new d.Quaternion;a.copy(this.filterQ),a.multiply(i),this.filterQ.slerp(a,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},n.prototype.accelToQuaternion_=function(t){var e=new d.Vector3;e.copy(t),e.normalize();var r=new d.Quaternion;return r.setFromUnitVectors(new d.Vector3(0,0,-1),e),r.inverse(),r},n.prototype.gyroToQuaternionDelta_=function(t,e){var r=new d.Quaternion,i=new d.Vector3;return i.copy(t),i.normalize(),r.setFromAxisAngle(i,t.length()*e),r},n}(),iv=function(){function n(t,e){this.predictionTimeS=t,this.isDebug=e,this.previousQ=new d.Quaternion,this.previousTimestampS=null,this.deltaQ=new d.Quaternion,this.outQ=new d.Quaternion}return n.prototype.getPrediction=function(t,e,r){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=r,t;var i=new d.Vector3;i.copy(e),i.normalize();var a=e.length();if(a<xr*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(En*a).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var o=a*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(i,o),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=r,this.outQ},n}(),av=function(){function n(t){this.coefficients=t}return n.prototype.distortInverse=function(t){for(var e=0,r=1,i=t-this.distort(e);Math.abs(r-e)>1e-4;){var a=t-this.distort(r),o=r-a*((r-e)/(a-i));e=r,r=o,i=a}return r},n.prototype.distort=function(t){for(var e=t*t,r=0,i=0;i<this.coefficients.length;i++)r=e*(r+this.coefficients[i]);return(r+1)*t},n}(),ov=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),a0=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),sv=function(){function n(t,e,r,i){this.viewer={id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]},this.device={widthMeters:.11,heightMeters:.062,bevelMeters:.004},this.depthNear=.01,this.depthFar=1e4,this.yawOnly=r,this.accelerometer=new d.Vector3,this.gyroscope=new d.Vector3,this.filter=new nv(t,i),this.posePredictor=new iv(e,i),this.isFirefoxAndroid=Zp(),this.isIOS=_n();var a=Zu();this.isDeviceMotionInRadians=!this.isIOS&&a!==null&&a<66,this.isWithoutDeviceMotion=Yp()||$p(),this.filterToWorldQ=new d.Quaternion,_n()?this.filterToWorldQ.setFromAxisAngle(new d.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new d.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new d.Quaternion,this.worldToScreenQ=new d.Quaternion,this.originalPoseAdjustQ=new d.Quaternion;var o=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new d.Vector3(0,0,1),o),this.setScreenTransform_(),t0()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new d.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return n.prototype.getPosition=function(){return null},n.prototype.getOrientation=function(){var t;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||function(){var a=new d.Quaternion().setFromAxisAngle(new d.Vector3(0,0,-1),0),o=new d.Quaternion;return typeof window!="undefined"&&window.orientation===-90?o.setFromAxisAngle(new d.Vector3(0,1,0),Math.PI/-2):o.setFromAxisAngle(new d.Vector3(0,1,0),Math.PI/2),a.multiply(o)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||function(){var a=new d.Quaternion;return a.setFromAxisAngle(new d.Vector3(1,0,0),-Math.PI/2),a}(),t=this._deviceOrientationQ;var e=new d.Quaternion;return e.copy(t),e.multiply(this.deviceOrientationFilterToWorldQ),e.multiply(this.resetQ),e.multiply(this.worldToScreenQ),e.multiplyQuaternions(this.deviceOrientationFixQ,e),this.yawOnly&&(e.x=0,e.z=0,e.normalize()),this.orientationOut_[0]=e.x,this.orientationOut_[1]=e.y,this.orientationOut_[2]=e.z,this.orientationOut_[3]=e.w,this.orientationOut_}else{var r=this.filter.getOrientation();t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS)}var i=new d.Quaternion;return i.copy(this.filterToWorldQ),i.multiply(this.resetQ),i.multiply(t),i.multiply(this.worldToScreenQ),this.yawOnly&&(i.x=0,i.z=0,i.normalize()),this.orientationOut_[0]=i.x,this.orientationOut_[1]=i.y,this.orientationOut_[2]=i.z,this.orientationOut_[3]=i.w,this.orientationOut_},n.prototype.getPose=function(){var t=new ov;return t.orientation=this.getOrientation(),t},n.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),t0()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},n.prototype.getFrameData=function(t){var e=this.getOrientation(),r=this.getEyeOffset(),i=this.getEyeProjectionMatrix();return t.pose.angularAcceleration=null,t.pose.angularVelocity=null,t.pose.linearAcceleration=null,t.pose.linearVelocity=null,t.pose.orientation=e,t.pose.position=null,t.timestamp=this.previousTimestampS,t.leftProjectionMatrix.set(i.left),t.rightProjectionMatrix.set(i.right),i0(t.leftViewMatrix,e,r.left),i0(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window=="undefined")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),i=this.onDeviceOrientation_.bind(this);return _n()&&rv()&&window.addEventListener("message",r),window.addEventListener("orientationchange",e),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",i):window.addEventListener("devicemotion",t),function(){window.removeEventListener("devicemotion",t),window.removeEventListener("deviceorientation",e),window.removeEventListener("orientationchange",e),window.removeEventListener("message",r)}},n.prototype.getEyeOffset=function(){return{left:[-this.viewer.interLensDistance*.5,0,0],right:[this.viewer.interLensDistance*.5,0,0]}},n.prototype.getEyeProjectionMatrix=function(){var t=this.getEyeFieldOfView(),e=this.depthNear,r=this.depthFar,i={left:[],right:[]};{var a=t.left.upDegrees*xr,o=t.left.downDegrees*xr,s=t.left.leftDegrees*xr,l=t.left.rightDegrees*xr,u=2/(s+l),c=2/(a+o);i.left[0]=u,i.left[1]=0,i.left[2]=0,i.left[3]=0,i.left[4]=0,i.left[5]=c,i.left[6]=0,i.left[7]=0,i.left[8]=-((s-l)*u*.5),i.left[9]=(a-o)*c*.5,i.left[10]=r/(e-r),i.left[11]=-1,i.left[12]=0,i.left[13]=0,i.left[14]=r*e/(e-r),i.left[15]=0}{var a=t.right.upDegrees*xr,o=t.right.downDegrees*xr,s=t.right.leftDegrees*xr,l=t.right.rightDegrees*xr,u=2/(s+l),c=2/(a+o);i.right[0]=u,i.right[1]=0,i.right[2]=0,i.right[3]=0,i.right[4]=0,i.right[5]=c,i.right[6]=0,i.right[7]=0,i.right[8]=-((s-l)*u*.5),i.right[9]=(a-o)*c*.5,i.right[10]=r/(e-r),i.right[11]=-1,i.right[12]=0,i.right[13]=0,i.right[14]=r*e/(e-r),i.right[15]=0}return i},n.prototype.getEyeFieldOfView=function(){var t=this.viewer,e=this.device,r=new av(t.distortionCoefficients),i=t.screenLensDistance,a=(e.widthMeters-t.interLensDistance)/2,o=t.interLensDistance/2,s=t.baselineLensDistance-e.bevelMeters,l=e.heightMeters-s,u=En*Math.atan(r.distort(a/i)),c=En*Math.atan(r.distort(o/i)),f=En*Math.atan(r.distort(s/i)),m=En*Math.atan(r.distort(l/i)),A=new a0,h=new a0;return A.leftDegrees=Math.min(u,t.fov),A.rightDegrees=Math.min(c,t.fov),A.downDegrees=Math.min(f,t.fov),A.upDegrees=Math.min(m,t.fov),h.leftDegrees=A.rightDegrees,h.rightDegrees=A.leftDegrees,h.upDegrees=A.upDegrees,h.downDegrees=A.downDegrees,{left:A,right:h}},n.prototype.onDeviceOrientation_=function(t){this._deviceOrientationQ=this._deviceOrientationQ||new d.Quaternion;var e=t.alpha,r=t.beta,i=t.gamma;e=(e||0)*Math.PI/180,r=(r||0)*Math.PI/180,i=(i||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new d.Euler(e,r,-i,"YXZ"))},n.prototype.onDeviceMotion_=function(t){this.updateDeviceMotion_(t)},n.prototype.updateDeviceMotion_=function(t){var e=t.accelerationIncludingGravity,r=t.rotationRate,i=t.timeStamp/1e3,a=i-this.previousTimestampS;if(a<0){r0("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(a<=Xu||a>Wu){r0("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),this.previousTimestampS=i;return}e&&(this.accelerometer.set(-e.x,-e.y,-e.z),r&&(Yu()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,i)),this.filter.addAccelMeasurement(this.accelerometer,i)),this.previousTimestampS=i},n.prototype.onOrientationChange_=function(){this.setScreenTransform_()},n.prototype.onMessage_=function(t){var e=t.data;if(!(!e||!e.type)){var r=e.type.toLowerCase();r==="devicemotion"&&this.updateDeviceMotion_(e.deviceMotionEvent)}},n.prototype.setScreenTransform_=function(){this.worldToScreenQ.set(0,0,0,1);var t=typeof window!="undefined"?window.orientation:0;switch(t){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new d.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new d.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n}(),mi=[0,0,.5,1],Ai=[.5,0,.5,1],uv=function(){function n(t){var e=this;this.renderer=t,this.sensor=new sv(.98,.04,!1,!1),this.scale=1,this.cameraL=new d.PerspectiveCamera,this.cameraR=new d.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var i=e.renderer.getSize(new d.Vector2);e.renderer.setScissor(0,0,i.width,i.height),e.renderer.setViewport(0,0,i.width,i.height),e.renderer.setScissorTest(!1),r()}}return n.prototype.render=function(t,e){var r=this.renderer.getSize(new d.Vector2);if(r.width>r.height){var i=t.autoUpdate;i&&(t.updateMatrixWorld(),t.autoUpdate=!1);var a={x:Math.round(r.width*mi[0]),y:Math.round(r.height*mi[1]),width:Math.round(r.width*mi[2]),height:Math.round(r.height*mi[3])},o={x:Math.round(r.width*Ai[0]),y:Math.round(r.height*Ai[1]),width:Math.round(r.width*Ai[2]),height:Math.round(r.height*Ai[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),e.parent===null&&e.updateMatrixWorld(),e.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),e.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var s=this.sensor.getEyeOffset();this.cameraL.translateOnAxis(new d.Vector3().fromArray(s.left),this.scale),this.cameraR.translateOnAxis(new d.Vector3().fromArray(s.right),this.scale);var l=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=l.left.slice(),this.cameraR.projectionMatrix.elements=l.right.slice(),this.renderer.setViewport(a.x,a.y,a.width,a.height),this.renderer.setScissor(a.x,a.y,a.width,a.height),this.renderer.render(t,this.cameraL),this.renderer.setViewport(o.x,o.y,o.width,o.height),this.renderer.setScissor(o.x,o.y,o.width,o.height),this.renderer.render(t,this.cameraR),this.renderer.setViewport(0,0,r.width,r.height),this.renderer.setScissor(0,0,r.width,r.height),this.renderer.setScissorTest(!1),i&&(t.autoUpdate=!0)}else this.renderer.render(t,e)},n.prototype.dispose=function(){},n}();const lv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6Dg4OAgICCgoKKioqEhISIiIhqamqCgoKIiIiQkJCIiIiWlpawsLBmZmaAgICenp6Li4uBgYGTk5OMjIyVlZWFhYWCgoKvr6+Ojo59fX2SkpKvr6+Ojo6QkJCurq6BgYGxsbF8fHx4eHitra2enp6srKyJiYmurq54eHj5+fl+fn57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Bc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var Pa,Ba={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},o0=typeof navigator!="undefined"&&(Pa=Ba[navigator.language.split("-")[0]])!==null&&Pa!==void 0?Pa:Ba.zh,dv=`
|
|
1592
|
+
`,Jp=function(){function n(){this.material=new d.ShaderMaterial({vertexShader:jp,fragmentShader:_p,uniforms:{size:new d.Uniform(null),matrix:new d.Uniform(null),alpha:new d.Uniform(null),map:new d.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor}),this.object=new d.Mesh(Fo,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new Me({alpha:0})}return n.prototype.setMaterial=function(t){t?(this.material.uniforms.size.value=t.size,this.material.uniforms.matrix.value=t.matrix,this.material.uniforms.map.value=t.map,this.alphaMotion.set({alpha:t.alpha},500).catch(Q),this.material.uniforms.alpha.value=t.alpha):(this.material.uniforms.size.value=null,this.material.uniforms.matrix.value=null,this.material.uniforms.map.value=null,this.alphaMotion.set({alpha:0},0).catch(Q));var e=t!==null,r=this.material.defines.USE_PANO_VIDEO;e!==r&&(this.material.defines.USE_PANO_VIDEO=e,this.material.needsUpdate=!0,this.object.visible=t!==null)},n.prototype.updateTime=function(t){this.alphaMotion.ended||(this.alphaMotion.update(t),this.material.uniforms.alpha.value=this.alphaMotion.value.alpha)},n.prototype.dispose=function(){this.material.dispose()},n}(),Xp=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),$s=new d.Vector3(-1,1,1),e0=function(){function n(t){t===void 0&&(t=0),this.width=t,this.pool=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.pool.length},enumerable:!1,configurable:!0}),n.prototype.create=function(){return new d.WebGLCubeRenderTarget(this.width,{stencilBuffer:!1,depthBuffer:!1})},n.prototype.pop=function(){var t=this.pool.pop();return t||this.create()},n.prototype.push=function(t){this.pool.indexOf(t)===-1&&this.pool.push(t)},n.prototype.clear=function(){for(var t=0,e=this.pool;t<e.length;t++){var r=e[t];r.dispose()}this.pool.length=0},n}(),ko=function(n){se(t,n);function t(e){var r=this,i,a,o,s,l=t.parseArgs(e);r=n.call(this,l)||this,r.TILED_CUBE_TEXTURE_LEVEL=2,r.mode="Panorama",r.tileLevel=0,r.initAnimationed=!1,r.maxAccessibleDistance=l.maxAccessibleDistance,r.panoTapTriggerRadius=l.panoTapTriggerRadius,r.panoCircleMeshCreator=l.panoCircleMeshCreator,r.tileLevelForFov=l.tileLevelForFov,r.tileMaxRequest=l.tileMaxRequest,r.luminanceAdaptiveEffectEnable=l.luminanceAdaptiveEffectEnable,r.luminanceAdaptiveEffect=new Zs(r.renderer,r.modelScene,r.camera,r.models),r.colorCubeRenderTargetPool=new e0,r.luminanceCubeRenderTargetPool=new e0;var u=r.models.getMaterial()||{},c=u.pano0,f=u.pano1;c&&(f==null?void 0:f.map)!==c.map&&(r.models.setMaterial({pano0:f}),c.map.dispose(),c.map instanceof Ne&&c.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(c.map.cubeRenderTarget),c.luminanceMap&&(c.luminanceMap.dispose(),c.luminanceMap instanceof Ne&&c.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(c.luminanceMap.cubeRenderTarget)));for(var m=r.colorCubeRenderTargetPool.size;m<2;m++){var A=Math.max(1024*r.TILED_CUBE_TEXTURE_LEVEL,512),h=r.colorCubeRenderTargetPool.create();h.setSize(A,A),qa(null,h,r.renderer),r.colorCubeRenderTargetPool.push(h)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new Me({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Me({modelAlpha:(a=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&a!==void 0?a:0}),r.perspToOrthoMotion=new Me({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=St()]={panoId:De(r.currentPano),panoPicture:(s=(o=r.models.getMaterial())===null||o===void 0?void 0:o.pano1)!==null&&s!==void 0?s:null,position:r.camera.pose.offset.clone(),effect:"fly",fixCameraTransform:new d.Matrix4};var p=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new Bn,r.tiling=new Hp(p?it(p.work):Bi,r.TILED_CUBE_TEXTURE_LEVEL+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new Jp,r.scene.add(r.panoVideo.object),r}return t.parseArgs=function(e){var r,i,a,o,s,l;if(e instanceof t)return e;var u=n.parseArgs.call(this,e);return k(k({},u),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:5,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:.5,panoCircleMeshCreator:(a=e.panoCircleMeshCreator)!==null&&a!==void 0?a:function(c){return new Uu},tileLevelForFov:(o=e.tileLevelForFov)!==null&&o!==void 0?o:function(c,f){var m=function(v){return v/Math.PI*180},A=function(v){return v/180*Math.PI},h=f.height/2/Math.tan(A(c/2)),p=f.width>f.height?c:m(Math.atan(Math.tan(A(c/2))*(f.width/f.height))*2);p*=.9;var g=h*(Math.tan(A(p/2))-Math.tan(A(p/2-1)));return g>80?5:g>60?4:g>40?3:g>18?2:g>12?1:0},tileMaxRequest:(s=e.tileMaxRequest)!==null&&s!==void 0?s:3,luminanceAdaptiveEffectEnable:(l=e.luminanceAdaptiveEffectEnable)!==null&&l!==void 0?l:!0})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{mode:"Panorama"})},t.prototype.destroy=function(){var e,r;if(n.prototype.destroy.call(this),this.scene.remove(this.tiling.object),this.tiling.dispose(),this.locationMotion.dispose(),this.colorCubeRenderTargetPool.clear(),this.luminanceCubeRenderTargetPool.clear(),delete this.pendingTextureTask,this.panoMeshes)for(var i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],l=this.panoMeshes[s];this.helper.remove(l),l.dispose(),delete this.panoMeshes[s]}var u=this.videoTexture.image;u.pause(),u.oncanplay=function(){},u.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var c=(e=this.models.getMaterial())!==null&&e!==void 0?e:{},f=c.pano0,m=c.pano1,A=0,h=Object.keys(this.panoResources);A<h.length;A++){var p=h[A],g=this.panoResources[p];if(g.panoPicture){var v=g.panoPicture.map;v&&v!==(f==null?void 0:f.map)&&v!==(m==null?void 0:m.map)&&(v.dispose(),(r=g.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),g.panoPicture=null)}delete this.panoResources[p]}this.luminanceAdaptiveEffect.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended!==!0?!1:n.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e,r,i,a=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),o=((e=a.panoPicture)===null||e===void 0?void 0:e.map)instanceof Ne&&(i=(r=a.panoPicture)===null||r===void 0?void 0:r.map.tilePending)!==null&&i!==void 0?i:0,s=this.tiling.pedding;return this.initAnimationed&&o<=0&&s<=0},t.prototype.updateWork=function(e,r,i,a){var o=this;this.userAction=a,this.works=e;var s=t.initAnimationEndState(k(k({},this),{initial:{currentState:k(k({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}})),l={workCode:s.workCode,panoIndex:s.panoIndex},u=this.works.getWork(l.workCode);return this.tiling.setFetcher(u?it(u):Bi),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(l,{effect:i.effect,duration:i.duration,longitude:r.longitude,latitude:r.latitude,fov:r.fov,moveEndCallback:function(){o.initAnimationed=!0},moveCancelCallback:function(){o.initAnimationed=!0}},a),!0},t.prototype.updateModel=function(e){this.models=e,this.updatePanoMeshes()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,l,u,c,f,m,A,h;if(!this.destroyed){var p={},g={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],E=x[1],M=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(E),R=new d.Vector3().copy(M.position),L=new d.Vector3().copy(C.position),S=this.locationMotion.value.count-E.value.count+1;p.progress=S,C.panoPicture&&(S<1?M.panoPicture&&(p.pano0=M.panoPicture):p.pano0=C.panoPicture,p.pano1=C.panoPicture),C.effect==="montage"?p.transition="BLACK":C.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(p.progress=Math.pow(S,3)),S<1&&C.effect!=="fly"&&(p.pano0&&M.panoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:M.panoPicture.matrix.clone().premultiply(M.fixCameraTransform).setPosition(C.position)}),R.copy(L),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new d.Vector3(R.x+(L.x-R.x)*S,R.y+(L.y-R.y)*S,R.z+(L.z-R.z)*S);for(var I=[],O=[],P=0,F=this.locationMotion.keyframes;P<F.length;P++){var V=F[P],D=V.key,z=V.progress;D!==void 0&&(I.push(D),z>this.locationMotion.progress&&O.push(D))}for(var U=0,q=Object.keys(this.panoResources);U<q.length;U++){var K=q[U];if(!(O.indexOf(K)>=0)){var j=this.panoResources[K];if(j.panoPicture){var J=j.panoPicture.map,X=j.panoPicture.luminanceMap;if(J){if(J===((a=p.pano0)===null||a===void 0?void 0:a.map)||J===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;J instanceof Ne&&J.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose(),X&&(X instanceof Ne&&X.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(X.cubeRenderTarget),X.dispose()),j.panoPicture=null}}I.indexOf(K)>=0||delete this.panoResources[K]}}this.currentPano=At(C.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:At(v.panoId),state:k(k(k(k({},At(y.panoId)),{mode:this.mode}),_e(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}Ut(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ne&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=p.pano0)===null||l===void 0)&&l.luminanceMap&&p.pano0.luminanceMap instanceof Ne&&!p.pano0.luminanceMap.cubeRenderTarget&&(p.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((u=p.pano1)===null||u===void 0)&&u.map&&p.pano1.map instanceof Ne&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=p.pano1)===null||c===void 0)&&c.luminanceMap&&p.pano1.luminanceMap instanceof Ne&&!p.pano1.luminanceMap.cubeRenderTarget&&(p.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(p)),Ut(g)===!1&&this.setCamera(g);var Y=this.works.getResolvedObserver(this.currentPano),W=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||b)for(var ee=0,Z=Object.keys(this.panoMeshes);ee<Z.length;ee++){var ie=Z[ee],te=this.panoMeshes[ie];te.setOpacity(0),te.setCurrent(!1),te.updateTime&&te.updateTime(e,r),te.visible=!1}else if(Y){var le=dr(Y.visibleIds,function(ve){var xe=i.works.getResolvedObserver(ve);return xe?Y.standingPosition.distanceTo(xe.standingPosition):1/0},!0),oe=le[1];oe=fe(oe,2.5,1/0);for(var we=Y.visibleIds.concat(De(this.currentPano)),pe=this.camera.getDirection(new d.Vector3),ge=0,Re=Object.keys(this.panoMeshes);ge<Re.length;ge++){var ie=Re[ge],te=this.panoMeshes[ie],Se=this.works.getResolvedObserver(ie);if(we.indexOf(ie)===-1)te.setCurrent(!1),te.setOpacity(0);else if(!Se)te.setCurrent(!1),te.setOpacity(0);else if(!Se.loadable&&!Se.active)te.setCurrent(!1),te.setOpacity(0);else{var Te=te.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);te.setCurrent(!te.loading&&te.progress===0&&W!==null&&W.panoId===ie),te.setOpacity(Te<.01?0:fe(oe/Te*1.2,.4,.85));var re=this.camera.position.clone().setY(te.position.y),ae=new d.Vector3().copy(te.position).sub(re).normalize();if(ie===De(this.currentPano)){var H=fe((.5-re.distanceTo(te.position))/.5,0,1);ae.multiplyScalar(1-H).add(pe.clone().multiplyScalar(H))}ae.length()>0&&te.quaternion.setFromEuler(new d.Euler(0,Math.atan2(ae.x,ae.z),0))}te.updateTime&&te.updateTime(e,r)}}var Ve=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ve=i.renderer.getDrawingBufferSize(new d.Vector2);ve.width*=i.scissor.width,ve.height*=i.scissor.height;var xe=y.panoId,ye=i.works.getResolvedObserver(xe),me=i.imageOptions.size;if(typeof me=="undefined"&&ye){var Qe=ye.images.up.match(/\/cube_(\d+)\//);Qe&&(me=Number(Qe[1]))}typeof me=="undefined"&&(me=2048);var Ke=0;me>=1024&&(Ke=1),me>=2048&&(Ke=2),me>=4096&&(Ke=3),me>=8192&&(Ke=4);var rt=i.tileLevelForFov(i.camera.fov,ve);return rt>Ke?rt:0}(),Fe=function(){var ve=i.camera.quaternion.clone(),xe=i.works.getResolvedObserver(y.panoId),ye=xe!=null?xe:Y;ye&&ve.premultiply(ye.quaternion.clone().inverse());var me=new d.Matrix4().makeRotationFromQuaternion(ve),Qe=new d.Matrix4().getInverse(me),Ke=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Qe));return Ke}();y.panoId===De(this.currentPano)&&(((f=y.panoPicture)===null||f===void 0?void 0:f.map)instanceof Ne&&(y.panoPicture.map.maxRequest=this.tileMaxRequest,y.panoPicture.map.update(Fe,Ve),y.panoPicture.map.needsRender===!0&&(y.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((m=y.panoPicture)===null||m===void 0?void 0:m.luminanceMap)instanceof Ne&&(y.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,y.panoPicture.luminanceMap.update(Fe,Ve),y.panoPicture.luminanceMap.needsRender===!0&&(y.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ie=this.tiling.object.visible;if(this.initAnimationed){var Ge=y.panoId,be=this.works.getResolvedObserver(Ge);be?ai(this.camera.position,be.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ge&&this.tiling.cleanup(),this.tiling.panoId=Ge,this.tiling.setResource((h=(A=be.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&be.images.luminance?be.images.luminance:null),this.tiling.setFetcher(it(be.work)),this.tiling.setRotation(be.quaternion),this.tiling.setPosition(be.position),this.tiling.maxRequest=this.tileMaxRequest,Ve>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Fe,Ve,e):this.tiling.update(Fe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ie!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.intersectMesh.scale.setScalar(fe(this.cameraMotion.value.fov/45,0,1))}},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget(),a=this.works.getResolvedObserver(this.currentPano);a&&a.video&&(this.needsRender=!0,this.modelSceneNeedsRender=!0),this.updateScreenBuffer(r),e&&(r==="luminance"?(this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable,this.luminanceAdaptiveEffect.render(this.screenBuffers)):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.postProcessing=function(e,r){if(!this.destroyed&&r==="luminance")return this.luminanceAdaptiveEffect||(this.luminanceAdaptiveEffect=new Zs(this.renderer,this.scene,this.camera,this.models),this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable),this.luminanceAdaptiveEffect.render(e)},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[1],i=this.panoResourceFromLocationMotionKeyframe(r),a=this.works.getResolvedObserver(i.panoId);return{workCode:a?a.work.workCode:this.currentPano.workCode,panoIndex:a?a.panoIndex:this.currentPano.panoIndex,mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:a?a.position.clone():this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,c=(o=r.effect)!==null&&o!==void 0?o:"fly";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));var m=Jn(f.images.up),A=this.imageOptions.size;typeof A=="undefined"&&f&&m&&(A=Number(m)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=k({key:"pano.".concat(f.panoId)},Dt(this.imageOptions,["format","size","quality","sharpen","mappings"])),g=f.images,v=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(F){return F.size>A}))!==null&&l!==void 0?l:null,y=h,b={key:"pano_luminance.".concat(f.panoId),size:p.size?p.size/2:void 0},x=this.enableIOSEDR&&f.images.luminance?f.images.luminance:null,w=function(){if(!f.images.tiles||!x)return null;var F=Jn(x.up);return F?v==null?void 0:v.map(function(V){var D=V.size*V.scale/2;return F<D?{level:V.level,size:D,scale:1,back:Ot(x.back,D),front:Ot(x.front,D),left:Ot(x.left,D),right:Ot(x.right,D),up:Ot(x.up,D),down:Ot(x.down,D)}:{level:V.level,size:F,scale:D/F,back:x.back,front:x.front,left:x.left,right:x.right,up:x.up,down:x.down}}):null}(),E="pano:"+Hi([g,p,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===E)return;var M=this.pendingTextureTask.panoId;(u=this.panoMeshes[M])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano}))}var C="move-to-pano-"+f.panoId;this.pending.add(C);var R=this.models.getMaterial()||{},L=R.pano0,S=R.pano1,I;if(L&&L.map.name===E&&L.luminanceMap!==null===this.enableIOSEDR?I=L:(S==null?void 0:S.map.name)===E&&S.luminanceMap!==null===this.enableIOSEDR&&(I=S),I){var O={panoId:f.panoId,effect:c,panoPicture:{zoom:1,map:I.map,luminanceMap:I.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,$s)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};dt.shared.add(function(){a.pending.delete(C),a.doMoveToPano(f.pano,O,r)},!0,1);return}this.pendingTextureTask={panoId:f.panoId,hash:E,onLoad:function(F,V){var D;if(a.pending.delete(C),a.destroyed)F.body.dispose();else{F.body.name=E;var z={panoId:f.panoId,effect:c,panoPicture:{zoom:1,map:F.body,luminanceMap:(D=V==null?void 0:V.body)!==null&&D!==void 0?D:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,$s)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,z,r)}},onError:function(F){a.pending.delete(C);var V=k(k(k({},f.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",_("pano.error",{error:F,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:V})),a.emit("pano.cancel",_("pano.cancel",{error:F,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:V})),a.emit("error",F),r.moveCancelCallback&&r.moveCancelCallback()}};var P=this.panoMeshes[f.panoId];P&&P.tap&&P.tap(),Promise.all([this.tileLevelForFov&&v&&v.length?this.textureLoader.loadTiledCubeTexture(g,v,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:h,options:p},minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,format:d.RGBAFormat,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(F){var V,D;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:F,meta:null,pano:f.pano})),((V=a.pendingTextureTask)===null||V===void 0?void 0:V.hash)===E&&((D=a.panoMeshes[f.panoId])===null||D===void 0||D.setProgress(F))},this.renderer):this.textureLoader.loadCubeTexture(g,{imageURL:{transform:h,options:p},format:d.RGBAFormat,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(F){var V,D;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:F,meta:null,pano:f.pano})),((V=a.pendingTextureTask)===null||V===void 0?void 0:V.hash)===E&&((D=a.panoMeshes[f.panoId])===null||D===void 0||D.setProgress(F))},this.renderer),x?this.tileLevelForFov&&w&&w.length?this.textureLoader.loadTiledCubeTexture(x,w,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:y,options:b},minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,fetcher:it(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(x,{imageURL:{transform:y,options:b},fetcher:it(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(F){var V,D,z=F[0],U=F[1];((V=a.pendingTextureTask)===null||V===void 0?void 0:V.hash)===E?(a.pendingTextureTask.onLoad(z,U),(D=a.panoMeshes[f.panoId])===null||D===void 0||D.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:z.meta,pano:f.pano}))):(z.body.dispose(),U==null||U.body.dispose())}).catch(function(F){var V,D;((V=a.pendingTextureTask)===null||V===void 0?void 0:V.hash)===E&&(a.pendingTextureTask.onError(F),(D=a.panoMeshes[f.panoId])===null||D===void 0||D.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:F,progress:0,meta:null,pano:f.pano})),a.emit("error",F))}),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial,a=i.duration,o=i.effect,s=i.userAction;e.userAction=s;var l=t.initAnimationEndState(e),u={workCode:l.workCode,panoIndex:l.panoIndex},c={modelAlpha:0},f={perspToOrtho:0},m=!1;e.moveToPano(u,{longitude:l.longitude,latitude:l.latitude,fov:l.fov,effect:o,duration:a,moveStartCallback:function(A){m=!0,e.perspToOrthoMotion.set(f,a).catch(Q),e.modelAlphaMotion.setKeyframes([{progress:0,value:k({},e.modelAlphaMotion.value)},{progress:.6,value:k({},e.modelAlphaMotion.value)},{progress:1,value:c}],a).catch(Q),e.emit("initAnimation.start",_("initAnimation.start",{state:A,userAction:e.userAction}))},moveEndCallback:function(A){e.emit("initAnimation.end",_("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var A=k(k(k({},u),{mode:e.mode}),_e(e.camera.pose));m===!1&&e.emit("initAnimation.start",_("initAnimation.start",{state:A,userAction:e.userAction})),e.emit("initAnimation.end",_("initAnimation.end",{state:A,userAction:e.userAction})),e.initAnimationed=!0,r()}},s)})},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var r=0,i=1;i<e.length;i++){var a=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,o=this.panoResourceFromLocationMotionKeyframe(e[i]).position,s=a.distanceTo(o)*(e[i].value.count-e[i-1].value.count);r+=s}return r},t.prototype.updatePanoMeshes=function(){for(var e=this,r={},i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],l=this.panoMeshes[s];r[s]=l,delete this.panoMeshes[s]}for(var u=1,c={},f=function(E){var M=dr(E.accessibleIds,function(R){var L=e.works.getResolvedObserver(R);if(!L)return 1/0;var S=L.standingPosition.distanceTo(E.standingPosition);return fe(S,1,1/0)},!0),C=M[1];c[E.panoId]===void 0&&(c[E.panoId]=C)},m=0,A=this.works.resolvedObservers;m<A.length;m++){var h=A[m];f(h)}var p=Object.keys(c).map(function(E){return c[E]});if(p.length){var g=p.reduce(function(E,M){return E+M},0)/p.length;u=fe(g*.6,1,3)}for(var v=0,y=this.works.resolvedObservers;v<y.length;v++){var h=y[v],l=void 0;r[h.panoId]?(l=r[h.panoId],l.loading===!0&&h.loadable===!1&&l.setLoading(!1),delete r[h.panoId]):(l=this.panoCircleMeshCreator(h.pano),l.name="PanoCircleMesh_"+h.panoId,this.helper.add(l)),l.scale.set(u,1,u),l.position.copy(h.standingPosition),this.panoMeshes[h.panoId]=l}for(var b=0,x=Object.keys(r);b<x.length;b++){var w=x[b];this.helper.remove(r[w]),r[w].dispose(),delete r[w]}},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,c,f,m,A,h,p,g;i===void 0&&(i={});var v=he(),y=St();this.tiling.cleanup(),this.panoResources[y]=r;var b=1,x,w,E;if(this.locationMotion.ended){var M=this.locationMotion.getKeyFrameSegment(v);M[0];var C=M[1],R=this.locationMotion.value,L=((o=this.panoResourceFromLocationMotionKeyframe(C))!==null&&o!==void 0?o:this.camera).position,S=r.position;x=Math.max(L.distanceTo(S),b),w=[{key:C.key,progress:0,value:k(k({},R),{count:0})},{key:y,progress:1,value:{distance:0,count:1}}],E=0}else{var I=this.locationMotion.getKeyFrameSegment(v),O=I[0],C=I[1],R=this.locationMotion.value,P=this.panoResourceFromLocationMotionKeyframe(O).position,L=this.panoResourceFromLocationMotionKeyframe(C).position,S=r.position,F=C.value.count-R.count,V=Math.max(P.distanceTo(L),b)*F,D=Math.max(L.distanceTo(S),b);x=V+D,w=[{key:O.key,progress:0,value:k({},R)},{key:C.key,progress:V/x,value:C.value},{key:y,progress:1,value:{count:C.value.count+1,distance:0}}];var z=this.locationMotionKeyframesLength(this.locationMotion.keyframes),U=this.locationMotionKeyframesLength(w);z===0||z===0?E=0:E=this.locationMotion.getProgressVelocity(v)*z/U}var q=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?x:0),K={longitude:i.longitude,latitude:i.latitude,fov:i.fov},j=k(k({},e),{mode:this.mode,longitude:(s=K.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(l=K.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(u=K.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),J=this.currentPano;if(this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:J,progress:0,state:j,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(j),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(K,q).catch(Q);else{var X=Nt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),Y=Nt({longitude:(c=K.longitude)!==null&&c!==void 0?c:this.cameraMotion.value.longitude,latitude:(f=K.latitude)!==null&&f!==void 0?f:this.cameraMotion.value.latitude}),W=new d.Object3D;W.lookAt(X);var ee=new d.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(Y);var Z=new d.Matrix4().makeRotationFromQuaternion(W.quaternion),ie=new d.Matrix4().getInverse(ee).premultiply(Z),te=this.cameraMotion.value.fov,le=(m=K.fov)!==null&&m!==void 0?m:this.cameraMotion.value.fov,oe=1;r.effect==="zoomin"?oe=1.5:r.effect==="zoomout"&&(oe=.4);for(var we=fe(le*oe,1,170),pe=0;pe<w.length-1;pe++){var ge=w[pe].key;if(ge){var Re=this.panoResources[ge];Re&&(Re.fixCameraTransform.copy(ie),Re.panoPicture&&(Re.panoPicture.zoom=Math.tan(te/2/180*Math.PI)/Math.tan(we/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(A=K.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(h=K.latitude)!==null&&h!==void 0?h:this.cameraMotion.value.latitude,fov:we}},{progress:1,value:{longitude:(p=K.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(g=K.latitude)!==null&&g!==void 0?g:this.cameraMotion.value.latitude,fov:le}}],q).catch(Q)}var Se=this.locationMotion.setKeyframes(w,q,E);Se.then(function(){for(var Te,re,ae=0,H=a.models;ae<H.length;ae++){var Ve=H[ae];Ve.show()}var Fe=k(k({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:a.camera.pose.distance});a.emit("pano.arrived",_("pano.arrived",{options:i,prevPano:J,progress:1,state:Fe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Fe);var Ie=a.works.getResolvedObserver(e);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ge=Xp.clone().multiply((re=(Te=a.models.getMaterial().pano1)===null||Te===void 0?void 0:Te.matrix)!==null&&re!==void 0?re:new d.Matrix4).multiply(Ie.video.matrix),be={map:a.videoTexture,size:Ie.video.size,matrix:Ge,alpha:1},ve=St(),xe=a.videoTexture.image;xe.setAttribute("uuid",ve),Ju().then(function(ye){ye&&Ie.video&&xe.getAttribute("uuid")===ve&&(xe.oncanplay=function(){xe.oncanplay=Q,xe.play()},xe.ontimeupdate=function(){xe.currentTime>.5&&(xe.ontimeupdate=Q,a.panoVideo.setMaterial(be))},xe.src=Ie.video.source)}).catch(function(){xe.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:J,progress:0,state:j,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.works.getResolvedObserver(this.currentPano);if(!i)return null;var a=e!=null?e:new d.Raycaster(this.camera.position.clone(),this.camera.getDirection(new d.Vector3));a.params.Points={threshold:.1};var o=i.standingPosition.clone();if(i.position.distanceTo(a.ray.origin)>1){var s=this.models.intersectRaycaster(new d.Raycaster(a.ray.origin,new d.Vector3(0,-1,0)))[0];s&&s.distance<=2?o.copy(s.point):o.copy(a.ray.origin).add(new d.Vector3(0,-1.5,0))}var l=this.models.intersectRaycaster(a)[0],u=l?l.point:a.ray.origin.clone().add(a.ray.direction.clone().normalize().multiplyScalar(3)),c=u.clone().sub(o).normalize();if(c.length()===0)return null;for(var f=i.accessibleIds.filter(function(w){if(w===De(r.currentPano))return!1;var E=r.works.getResolvedObserver(w);if(!E)return!1;var M=E.standingPosition.clone().project(r.camera);return Math.abs(M.z)>1||Math.abs(M.x)>1||Math.abs(M.y)>1?!1:E.loadable||E.active}),m=f.slice().sort(function(w,E){var M=r.works.getResolvedObserver(w).standingPosition.clone().distanceTo(o),C=r.works.getResolvedObserver(E).standingPosition.clone().distanceTo(o);return M-C}),A=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];A<h.length;A++)for(var p=h[A],g=0,v=m;g<v.length;g++){var y=v[g],b=this.works.getResolvedObserver(y);if(b){var x=b.standingPosition.clone().sub(o);if(x&&x.length()!==0&&c.angleTo(x)<p)return b}}return null},t.prototype.onTapGesture=function(e){var r=this,i;if(this.userAction=e.userAction,this.stopMomentumMovement(),!!this.initAnimationed){if(!this.locationMotion.ended){var a=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]);if(a.panoId!==De(this.currentPano))return}var o=e.center.raycaster,s=this.camera.getDirection(new d.Vector3).setY(0),l=null,u=this.works.getResolvedObserver(this.currentPano);if(u){var c=u.accessibleIds.filter(function(U){if(U===De(r.currentPano))return!1;var q=r.works.getResolvedObserver(U);return!q||q.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:q.loadable||q.active}),f=this.models.intersectRaycaster(o)[0];if(f){var m=dr(c,function(U){var q=r.works.getResolvedObserver(U);if(!q)return 1/0;var K=q.standingPosition.clone();return K.distanceTo(f.point)},!0),A=m[0],h=m[1];A&&h<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(A))!==null&&i!==void 0?i:null)}l||(l=this.getForwardObserverOrNot(o));for(var p=0,g=this.locationMotion.keyframes;p<g.length;p++){var v=g[p],y=this.panoResourceFromLocationMotionKeyframe(v);if(!(v.progress<this.locationMotion.progress)&&l&&y.panoId===l.panoId){l=null;break}}if(!l)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var b={},x=Math.PI/6,w=Math.PI/12,E=l.position.clone().setY(0).sub(u.position.clone().setY(0)).normalize(),M=[],C=[],R=[],L=0,S=l.accessibleIds;L<S.length;L++){var A=S[L],I=At(A);if(!(Yt(I,this.currentPano)||Yt(I,l.pano))){var O=this.works.getResolvedObserver(A);if(O){var P=O.position.clone().sub(l.position).setY(0);E.angleTo(P)<x&&R.push(P)}}}var F=R.length>0?R:Et(Et([],M,!0),C,!0),V=F.slice().sort(function(U,q){return U.angleTo(E)-q.angleTo(E)})[0];V&&V.angleTo(s)>w&&(b.longitude=Math.atan2(-V.x,-V.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(b.latitude=fe(0,this.minLatitude,this.maxLatitude));var D=k({},e.state);if(D.workCode=l.pano.workCode,D.panoIndex=l.pano.panoIndex,b.longitude!==void 0&&(D.longitude=b.longitude),b.latitude!==void 0&&(D.latitude=b.latitude),b.fov!==void 0&&(D.fov=b.fov),D.distance=0,D.offset=l.position.clone(),e.state=D,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:D,userAction:e.userAction,options:b,progress:0,error:null})),l&&!l.active){var z=l.panoId;this.panoMeshes[z]&&(this.panoMeshes[z].setDisabled(!1),this.panoMeshes[z].setLoading(!0))}l&&l.active&&this.emit("pano.request",_("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:D,options:b,error:null}))}}}}},t}(_u),xr=Math.PI/180,En=180/Math.PI,Xu=.001,Wu=1,_n=function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),Wp=function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),Zp=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),Zu=function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),Yp=function(){var n=!1;if(Zu()===65){var t=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var e=t[1].split(".");e[0],e[1];var r=e[2],i=e[3];n=parseInt(r,10)===3325&&parseInt(i,10)<148}}return function(){return n}}(),$p=function(){var n=_n()&&Wp()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),Yu=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function t0(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return Yu()?!n:n}function ev(n){return!(isNaN(n)||n<=Xu||n>Wu)}function tv(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var r0=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function n0(n){var t,e=n.indexOf("://");e!==-1?t=e+3:t=0;var r=n.indexOf("/",t);return r===-1&&(r=n.length),n.substring(0,r)}function rv(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=n0(document.referrer),e=n0(window.location.href);return n&&t!==e}var i0=function(){function n(r,i,a){var o=i?i[0]:0,s=i?i[1]:0,l=i?i[2]:0,u=i?i[3]:1,c=o+o,f=s+s,m=l+l,A=o*c,h=o*f,p=o*m,g=s*f,v=s*m,y=l*m,b=u*c,x=u*f,w=u*m;return r[0]=1-(g+y),r[1]=h+w,r[2]=p-x,r[3]=0,r[4]=h-w,r[5]=1-(A+y),r[6]=v+b,r[7]=0,r[8]=p+x,r[9]=v-b,r[10]=1-(A+g),r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function t(r,i,a){var o=a[0],s=a[1],l=a[2],u,c,f,m,A,h,p,g,v,y,b,x;return i===r?(r[12]=i[0]*o+i[4]*s+i[8]*l+i[12],r[13]=i[1]*o+i[5]*s+i[9]*l+i[13],r[14]=i[2]*o+i[6]*s+i[10]*l+i[14],r[15]=i[3]*o+i[7]*s+i[11]*l+i[15]):(u=i[0],c=i[1],f=i[2],m=i[3],A=i[4],h=i[5],p=i[6],g=i[7],v=i[8],y=i[9],b=i[10],x=i[11],r[0]=u,r[1]=c,r[2]=f,r[3]=m,r[4]=A,r[5]=h,r[6]=p,r[7]=g,r[8]=v,r[9]=y,r[10]=b,r[11]=x,r[12]=u*o+A*s+v*l+i[12],r[13]=c*o+h*s+y*l+i[13],r[14]=f*o+p*s+b*l+i[14],r[15]=m*o+g*s+x*l+i[15]),r}function e(r,i){var a=i[0],o=i[1],s=i[2],l=i[3],u=i[4],c=i[5],f=i[6],m=i[7],A=i[8],h=i[9],p=i[10],g=i[11],v=i[12],y=i[13],b=i[14],x=i[15],w=a*c-o*u,E=a*f-s*u,M=a*m-l*u,C=o*f-s*c,R=o*m-l*c,L=s*m-l*f,S=A*y-h*v,I=A*b-p*v,O=A*x-g*v,P=h*b-p*y,F=h*x-g*y,V=p*x-g*b,D=w*V-E*F+M*P+C*O-R*I+L*S;return D?(D=1/D,r[0]=(c*V-f*F+m*P)*D,r[1]=(s*F-o*V-l*P)*D,r[2]=(y*L-b*R+x*C)*D,r[3]=(p*R-h*L-g*C)*D,r[4]=(f*O-u*V-m*I)*D,r[5]=(a*V-s*O+l*I)*D,r[6]=(b*M-v*L-x*E)*D,r[7]=(A*L-p*M+g*E)*D,r[8]=(u*F-c*O+m*S)*D,r[9]=(o*O-a*F-l*S)*D,r[10]=(v*R-y*M+x*w)*D,r[11]=(h*M-A*R-g*w)*D,r[12]=(c*I-u*P-f*S)*D,r[13]=(a*P-o*I+s*S)*D,r[14]=(y*E-v*C-b*w)*D,r[15]=(A*C-h*E+p*w)*D,r):null}return function(r,i,a){n(r,i),a&&t(r,r,a),e(r,r)}}(),Ta=function(){function n(t,e){t===void 0&&(t=new d.Vector3),e===void 0&&(e=0),this.sample=t,this.timestampS=e}return n.prototype.set=function(t,e){this.sample=t,this.timestampS=e},n.prototype.copy=function(t){this.set(t.sample,t.timestampS)},n}(),nv=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new Ta,this.currentGyroMeasurement=new Ta,this.previousGyroMeasurement=new Ta,_n()?this.filterQ=new d.Quaternion(-1,0,0,1):this.filterQ=new d.Quaternion(1,0,0,1),this.previousFilterQ=new d.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new d.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new d.Vector3,this.measuredGravity=new d.Vector3,this.gyroIntegralQ=new d.Quaternion}return n.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},n.prototype.addGyroMeasurement=function(t,e){this.currentGyroMeasurement.set(t,e);var r=e-this.previousGyroMeasurement.timestampS;ev(r)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},n.prototype.getOrientation=function(){return this.filterQ},n.prototype.run_=function(){if(!this.isOrientationInitialized){this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),this.isOrientationInitialized=!0;return}var t=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,e=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,t);this.gyroIntegralQ.multiply(e),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(e);var r=new d.Quaternion;r.copy(this.filterQ),r.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(r),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var i=new d.Quaternion;i.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),i.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",En*tv(i),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var a=new d.Quaternion;a.copy(this.filterQ),a.multiply(i),this.filterQ.slerp(a,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},n.prototype.accelToQuaternion_=function(t){var e=new d.Vector3;e.copy(t),e.normalize();var r=new d.Quaternion;return r.setFromUnitVectors(new d.Vector3(0,0,-1),e),r.inverse(),r},n.prototype.gyroToQuaternionDelta_=function(t,e){var r=new d.Quaternion,i=new d.Vector3;return i.copy(t),i.normalize(),r.setFromAxisAngle(i,t.length()*e),r},n}(),iv=function(){function n(t,e){this.predictionTimeS=t,this.isDebug=e,this.previousQ=new d.Quaternion,this.previousTimestampS=null,this.deltaQ=new d.Quaternion,this.outQ=new d.Quaternion}return n.prototype.getPrediction=function(t,e,r){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=r,t;var i=new d.Vector3;i.copy(e),i.normalize();var a=e.length();if(a<xr*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(En*a).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var o=a*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(i,o),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=r,this.outQ},n}(),av=function(){function n(t){this.coefficients=t}return n.prototype.distortInverse=function(t){for(var e=0,r=1,i=t-this.distort(e);Math.abs(r-e)>1e-4;){var a=t-this.distort(r),o=r-a*((r-e)/(a-i));e=r,r=o,i=a}return r},n.prototype.distort=function(t){for(var e=t*t,r=0,i=0;i<this.coefficients.length;i++)r=e*(r+this.coefficients[i]);return(r+1)*t},n}(),ov=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),a0=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),sv=function(){function n(t,e,r,i){this.viewer={id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]},this.device={widthMeters:.11,heightMeters:.062,bevelMeters:.004},this.depthNear=.01,this.depthFar=1e4,this.yawOnly=r,this.accelerometer=new d.Vector3,this.gyroscope=new d.Vector3,this.filter=new nv(t,i),this.posePredictor=new iv(e,i),this.isFirefoxAndroid=Zp(),this.isIOS=_n();var a=Zu();this.isDeviceMotionInRadians=!this.isIOS&&a!==null&&a<66,this.isWithoutDeviceMotion=Yp()||$p(),this.filterToWorldQ=new d.Quaternion,_n()?this.filterToWorldQ.setFromAxisAngle(new d.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new d.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new d.Quaternion,this.worldToScreenQ=new d.Quaternion,this.originalPoseAdjustQ=new d.Quaternion;var o=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new d.Vector3(0,0,1),o),this.setScreenTransform_(),t0()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new d.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return n.prototype.getPosition=function(){return null},n.prototype.getOrientation=function(){var t;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||function(){var a=new d.Quaternion().setFromAxisAngle(new d.Vector3(0,0,-1),0),o=new d.Quaternion;return typeof window!="undefined"&&window.orientation===-90?o.setFromAxisAngle(new d.Vector3(0,1,0),Math.PI/-2):o.setFromAxisAngle(new d.Vector3(0,1,0),Math.PI/2),a.multiply(o)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||function(){var a=new d.Quaternion;return a.setFromAxisAngle(new d.Vector3(1,0,0),-Math.PI/2),a}(),t=this._deviceOrientationQ;var e=new d.Quaternion;return e.copy(t),e.multiply(this.deviceOrientationFilterToWorldQ),e.multiply(this.resetQ),e.multiply(this.worldToScreenQ),e.multiplyQuaternions(this.deviceOrientationFixQ,e),this.yawOnly&&(e.x=0,e.z=0,e.normalize()),this.orientationOut_[0]=e.x,this.orientationOut_[1]=e.y,this.orientationOut_[2]=e.z,this.orientationOut_[3]=e.w,this.orientationOut_}else{var r=this.filter.getOrientation();t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS)}var i=new d.Quaternion;return i.copy(this.filterToWorldQ),i.multiply(this.resetQ),i.multiply(t),i.multiply(this.worldToScreenQ),this.yawOnly&&(i.x=0,i.z=0,i.normalize()),this.orientationOut_[0]=i.x,this.orientationOut_[1]=i.y,this.orientationOut_[2]=i.z,this.orientationOut_[3]=i.w,this.orientationOut_},n.prototype.getPose=function(){var t=new ov;return t.orientation=this.getOrientation(),t},n.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),t0()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},n.prototype.getFrameData=function(t){var e=this.getOrientation(),r=this.getEyeOffset(),i=this.getEyeProjectionMatrix();return t.pose.angularAcceleration=null,t.pose.angularVelocity=null,t.pose.linearAcceleration=null,t.pose.linearVelocity=null,t.pose.orientation=e,t.pose.position=null,t.timestamp=this.previousTimestampS,t.leftProjectionMatrix.set(i.left),t.rightProjectionMatrix.set(i.right),i0(t.leftViewMatrix,e,r.left),i0(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window=="undefined")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),i=this.onDeviceOrientation_.bind(this);return _n()&&rv()&&window.addEventListener("message",r),window.addEventListener("orientationchange",e),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",i):window.addEventListener("devicemotion",t),function(){window.removeEventListener("devicemotion",t),window.removeEventListener("deviceorientation",e),window.removeEventListener("orientationchange",e),window.removeEventListener("message",r)}},n.prototype.getEyeOffset=function(){return{left:[-this.viewer.interLensDistance*.5,0,0],right:[this.viewer.interLensDistance*.5,0,0]}},n.prototype.getEyeProjectionMatrix=function(){var t=this.getEyeFieldOfView(),e=this.depthNear,r=this.depthFar,i={left:[],right:[]};{var a=t.left.upDegrees*xr,o=t.left.downDegrees*xr,s=t.left.leftDegrees*xr,l=t.left.rightDegrees*xr,u=2/(s+l),c=2/(a+o);i.left[0]=u,i.left[1]=0,i.left[2]=0,i.left[3]=0,i.left[4]=0,i.left[5]=c,i.left[6]=0,i.left[7]=0,i.left[8]=-((s-l)*u*.5),i.left[9]=(a-o)*c*.5,i.left[10]=r/(e-r),i.left[11]=-1,i.left[12]=0,i.left[13]=0,i.left[14]=r*e/(e-r),i.left[15]=0}{var a=t.right.upDegrees*xr,o=t.right.downDegrees*xr,s=t.right.leftDegrees*xr,l=t.right.rightDegrees*xr,u=2/(s+l),c=2/(a+o);i.right[0]=u,i.right[1]=0,i.right[2]=0,i.right[3]=0,i.right[4]=0,i.right[5]=c,i.right[6]=0,i.right[7]=0,i.right[8]=-((s-l)*u*.5),i.right[9]=(a-o)*c*.5,i.right[10]=r/(e-r),i.right[11]=-1,i.right[12]=0,i.right[13]=0,i.right[14]=r*e/(e-r),i.right[15]=0}return i},n.prototype.getEyeFieldOfView=function(){var t=this.viewer,e=this.device,r=new av(t.distortionCoefficients),i=t.screenLensDistance,a=(e.widthMeters-t.interLensDistance)/2,o=t.interLensDistance/2,s=t.baselineLensDistance-e.bevelMeters,l=e.heightMeters-s,u=En*Math.atan(r.distort(a/i)),c=En*Math.atan(r.distort(o/i)),f=En*Math.atan(r.distort(s/i)),m=En*Math.atan(r.distort(l/i)),A=new a0,h=new a0;return A.leftDegrees=Math.min(u,t.fov),A.rightDegrees=Math.min(c,t.fov),A.downDegrees=Math.min(f,t.fov),A.upDegrees=Math.min(m,t.fov),h.leftDegrees=A.rightDegrees,h.rightDegrees=A.leftDegrees,h.upDegrees=A.upDegrees,h.downDegrees=A.downDegrees,{left:A,right:h}},n.prototype.onDeviceOrientation_=function(t){this._deviceOrientationQ=this._deviceOrientationQ||new d.Quaternion;var e=t.alpha,r=t.beta,i=t.gamma;e=(e||0)*Math.PI/180,r=(r||0)*Math.PI/180,i=(i||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new d.Euler(e,r,-i,"YXZ"))},n.prototype.onDeviceMotion_=function(t){this.updateDeviceMotion_(t)},n.prototype.updateDeviceMotion_=function(t){var e=t.accelerationIncludingGravity,r=t.rotationRate,i=t.timeStamp/1e3,a=i-this.previousTimestampS;if(a<0){r0("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(a<=Xu||a>Wu){r0("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),this.previousTimestampS=i;return}e&&(this.accelerometer.set(-e.x,-e.y,-e.z),r&&(Yu()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,i)),this.filter.addAccelMeasurement(this.accelerometer,i)),this.previousTimestampS=i},n.prototype.onOrientationChange_=function(){this.setScreenTransform_()},n.prototype.onMessage_=function(t){var e=t.data;if(!(!e||!e.type)){var r=e.type.toLowerCase();r==="devicemotion"&&this.updateDeviceMotion_(e.deviceMotionEvent)}},n.prototype.setScreenTransform_=function(){this.worldToScreenQ.set(0,0,0,1);var t=typeof window!="undefined"?window.orientation:0;switch(t){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new d.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new d.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n}(),mi=[0,0,.5,1],Ai=[.5,0,.5,1],uv=function(){function n(t){var e=this;this.renderer=t,this.sensor=new sv(.98,.04,!1,!1),this.scale=1,this.cameraL=new d.PerspectiveCamera,this.cameraR=new d.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var i=e.renderer.getSize(new d.Vector2);e.renderer.setScissor(0,0,i.width,i.height),e.renderer.setViewport(0,0,i.width,i.height),e.renderer.setScissorTest(!1),r()}}return n.prototype.render=function(t,e){var r=this.renderer.getSize(new d.Vector2);if(r.width>r.height){var i=t.autoUpdate;i&&(t.updateMatrixWorld(),t.autoUpdate=!1);var a={x:Math.round(r.width*mi[0]),y:Math.round(r.height*mi[1]),width:Math.round(r.width*mi[2]),height:Math.round(r.height*mi[3])},o={x:Math.round(r.width*Ai[0]),y:Math.round(r.height*Ai[1]),width:Math.round(r.width*Ai[2]),height:Math.round(r.height*Ai[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),e.parent===null&&e.updateMatrixWorld(),e.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),e.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var s=this.sensor.getEyeOffset();this.cameraL.translateOnAxis(new d.Vector3().fromArray(s.left),this.scale),this.cameraR.translateOnAxis(new d.Vector3().fromArray(s.right),this.scale);var l=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=l.left.slice(),this.cameraR.projectionMatrix.elements=l.right.slice(),this.renderer.setViewport(a.x,a.y,a.width,a.height),this.renderer.setScissor(a.x,a.y,a.width,a.height),this.renderer.render(t,this.cameraL),this.renderer.setViewport(o.x,o.y,o.width,o.height),this.renderer.setScissor(o.x,o.y,o.width,o.height),this.renderer.render(t,this.cameraR),this.renderer.setViewport(0,0,r.width,r.height),this.renderer.setScissor(0,0,r.width,r.height),this.renderer.setScissorTest(!1),i&&(t.autoUpdate=!0)}else this.renderer.render(t,e)},n.prototype.dispose=function(){},n}();const lv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6Dg4OAgICCgoKKioqEhISIiIhqamqCgoKIiIiQkJCIiIiWlpawsLBmZmaAgICenp6Li4uBgYGTk5OMjIyVlZWFhYWCgoKvr6+Ojo59fX2SkpKvr6+Ojo6QkJCurq6BgYGxsbF8fHx4eHitra2enp6srKyJiYmurq54eHj5+fl+f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yBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var Pa,Ba={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},o0=typeof navigator!="undefined"&&(Pa=Ba[navigator.language.split("-")[0]])!==null&&Pa!==void 0?Pa:Ba.zh,dv=`
|
|
1593
1593
|
<style>
|
|
1594
1594
|
.$id {
|
|
1595
1595
|
all: initial;
|
|
@@ -1950,7 +1950,7 @@ void main() {
|
|
|
1950
1950
|
|
|
1951
1951
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity * outside * inside);
|
|
1952
1952
|
}
|
|
1953
|
-
`,gv=function(n){se(t,n);function t(){var e=n.call(this)||this;e.progress=0,e.opacity=0,e.loading=!1,e.current=!1,e.disabled=!1,e.currentMotion=new Ce({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new Ce({opacity:0}),e.loadingMotion=new Ce({opacity:0}),e.disableMotion=new Ce({opacity:0});var r={blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return e.hitTestMesh=new d.Mesh(Ra,new d.MeshBasicMaterial(k(k({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new d.Mesh(Ra,new d.ShaderMaterial(k(k({},r),{vertexShader:mv,fragmentShader:Av,uniforms:{opacity:{value:0}}}))),e.panoMesh=new d.Mesh(Ra,new d.ShaderMaterial(k(k({},r),{vertexShader:pv,fragmentShader:vv,uniforms:{circleScale:{value:1.1},circleFade:{value:0},circleOpacity:{value:.5},loadingAngle:{value:0},loadingOpacity:{value:0},opacity:{value:0},disable:{value:0}}}))),e.add(e.hitTestMesh),e.add(e.ringMesh),e.add(e.panoMesh),e.renderOrder=1e4,e.needsRender=!0,e}return t.prototype.setProgress=function(e){this.progress=e,this.setLoading(e>0)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=fe(e,0,1),this.opacityMotion.set({opacity:e},30).catch(Q))},t.prototype.setCurrent=function(e){if(this.current!==e){if(e){var r=[{progress:0,value:{ringScale:2,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.05,value:{ringScale:1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.15,value:{ringScale:1.2,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.25,value:{ringScale:1.1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.8,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1}},{progress:.9,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:.92,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:1,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1.1}}];this.currentMotion.setKeyframes(r,1500).catch(Q)}else{var r=[{progress:0,value:k({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(r,200).catch(Q)}this.current=e}},t.prototype.setLoading=function(e){this.loading!==e&&(e?this.loadingMotion.setKeyframes([{progress:0,value:{opacity:0}},{progress:.3,value:{opacity:0}},{progress:1,value:{opacity:.8}}],500).catch(Q):this.loadingMotion.set({opacity:0},0).catch(Q),this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.needsRender=!0)},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({opacity:e?1:0},300).catch(Q),this.needsRender=!0)},t.prototype.tap=function(){return Promise.resolve()},t.prototype.updateTime=function(e,r){this.opacityMotion.update(e),this.currentMotion.update(e),this.loadingMotion.update(e);var i=this.opacityMotion.value.opacity;this.visible=i!==0;var a=this.currentMotion.value,o=a.ringScale,s=a.ringOpacity,l=a.circleFade,u=a.circleOpacity,c=a.circleScale;this.ringMesh.scale.set(o,1,o),this.ringMesh.material.uniforms.opacity.value=s*i,this.panoMesh.material.uniforms.opacity.value=i,this.panoMesh.material.uniforms.circleOpacity.value=u,this.panoMesh.material.uniforms.circleScale.value=c,this.panoMesh.material.uniforms.circleFade.value=l,this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingMotion.value.opacity,this.panoMesh.material.uniforms.disable.value=this.disableMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0},t.prototype.dispose=function(){this.hitTestMesh.material.dispose(),this.ringMesh.material.dispose(),this.panoMesh.material.dispose()},t}(d.Object3D),yv=1500,bv=function(n){se(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new uv(r.renderer);var a=hv();r.helperElement=a;var o=new Qn(a);return r.element.parentNode&&(r.element.parentNode.insertBefore(a,r.element),r.setHelperElementSize(),o.on("tap",function(){return r.emit("vr.requestExit",_("vr.requestExit",{}))})),r.destroyHelper=function(){o.destroy(),a.parentNode&&a.parentNode.removeChild(a),delete r.helperElement},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=k(k({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{mode:"VRPanorama"})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper();for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}},t.prototype.isReady=function(){return!1},t.prototype.updateRenderSize=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.setHelperElementSize()},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updatePanoMeshesVisible=function(){for(var e=this.works.getResolvedObserver(this.currentPano),r=(e?e.visibleIds:[]).concat(De(this.currentPano)),i=0,a=this.works.resolvedObservers;i<a.length;i++){var o=a[i],s=this.panoMeshes[o.panoId];s&&(r.indexOf(o.panoId)>=0?s.parent!==this.helper&&this.helper.add(s):s.parent===this.helper&&(this.helper.remove(s),s.setOpacity(0)))}},t.prototype.updatePanoMeshes=function(){for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}for(var s=0,l=this.works.resolvedObservers;s<l.length;s++){var u=l[s],c=u.panoId,f=new gv;f.name="panoSphere_".concat(c),f.position.copy(u.position),f.needsRender=!0,this.panoMeshes[c]=f}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,l,u,c,f,m,A,h;if(!this.destroyed){var p=this.currentPano;this.userAction=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0;var g={},v={},y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),b=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),x=!1;if(this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),g.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),E=w[0],C=w[1],M=this.panoResourceFromLocationMotionKeyframe(E),R=this.panoResourceFromLocationMotionKeyframe(C),L=M.position,S=R.position,I=this.locationMotion.value.count-C.value.count+1;g.progress=I,R.panoPicture&&(I<1?M.panoPicture&&(g.pano0=M.panoPicture):g.pano0=R.panoPicture,g.pano1=R.panoPicture),R.effect==="montage"?g.transition="BLACK":R.effect==="spread"?g.transition="SPREAD":g.transition="FADE",(R.effect==="zoomin"||R.effect==="zoomout")&&(g.progress=Math.pow(I,3)),I<1&&R.effect!=="fly"&&(g.pano0&&M.panoPicture&&(g.pano0={map:g.pano0.map,zoom:g.pano0.zoom,luminanceMap:g.pano0.luminanceMap,matrix:M.panoPicture.matrix.clone().premultiply(M.fixCameraTransform).setPosition(R.position)}),L.copy(S),x=!0),v.distance=this.locationMotion.value.distance,v.offset=new d.Vector3(L.x+(S.x-L.x)*I,L.y+(S.y-L.y)*I,L.z+(S.z-L.z)*I);for(var O=[],P=[],F=0,V=this.locationMotion.keyframes;F<V.length;F++){var D=V[F],z=D.key,U=D.progress;z!==void 0&&(O.push(z),U>this.locationMotion.progress&&P.push(z))}for(var q=0,K=Object.keys(this.panoResources);q<K.length;q++){var j=K[q];if(!(P.indexOf(j)>=0)){var J=this.panoResources[j];if(J.panoPicture){var X=J.panoPicture.map,Y=J.panoPicture.luminanceMap;if(X){if(X===((a=g.pano0)===null||a===void 0?void 0:a.map)||X===((o=g.pano1)===null||o===void 0?void 0:o.map))continue;X instanceof Ne&&X.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(X.cubeRenderTarget),X.dispose(),Y&&(Y instanceof Ne&&Y.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(Y.cubeRenderTarget),Y.dispose()),J.panoPicture=null}}O.indexOf(j)>=0||delete this.panoResources[j]}}this.currentPano=At(R.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:At(y.panoId),state:k(k(k(k({},At(b.panoId)),{mode:this.mode}),_e(this.camera.pose)),v),options:{},progress:this.locationMotion.progress,error:null}))}Ut(g)===!1&&(!((s=g.pano0)===null||s===void 0)&&s.map&&g.pano0.map instanceof Ne&&!g.pano0.map.cubeRenderTarget&&(g.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=g.pano0)===null||l===void 0)&&l.luminanceMap&&g.pano0.luminanceMap instanceof Ne&&!g.pano0.luminanceMap.cubeRenderTarget&&(g.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((u=g.pano1)===null||u===void 0)&&u.map&&g.pano1.map instanceof Ne&&!g.pano1.map.cubeRenderTarget&&(g.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=g.pano1)===null||c===void 0)&&c.luminanceMap&&g.pano1.luminanceMap instanceof Ne&&!g.pano1.luminanceMap.cubeRenderTarget&&(g.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(g)),v.offset&&this.camera.position.copy(v.offset),Yt(this.currentPano,p)&&this.updatePanoMeshesVisible();var W=this.camera.pose.longitude,ee=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose();var Z=this.works.getResolvedObserver(this.currentPano);if(this.camera.pose.distance>.1||x)for(var ie=0,te=Object.keys(this.panoMeshes);ie<te.length;ie++){var le=te[ie],oe=this.panoMeshes[le];oe.setOpacity(0),oe.updateTime&&oe.updateTime(e,r),oe.visible=!1}else if(Z)for(var we=Z.visibleIds.concat(De(this.currentPano)),pe=0,ge=we;pe<ge.length;pe++){var le=ge[pe],Re=At(le),Se=this.works.getResolvedObserver(Re);if(Se){var oe=this.panoMeshes[le];if(!Se.loadable&&!Se.active){oe.setOpacity(0);continue}var Te=oe.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Te<.05?oe.setOpacity(0):oe.setOpacity(fe(1.5/Te,0,1)),Yt(this.currentPano,Re)&&oe.setOpacity(0),oe.lookAt(this.camera.position)}}if(this.locationMotion.ended)for(var re=this.intersect(e),ae=0,H=this.works.resolvedObservers;ae<H.length;ae++){var Se=H[ae],oe=this.panoMeshes[Se.panoId];oe&&(oe.setCurrent(oe===re),oe.updateTime&&oe.updateTime(e,r))}(W!==this.camera.pose.longitude||ee!==this.camera.pose.latitude)&&(this.cameraMotion.set(Dt(this.camera.pose,["longitude","latitude"]),0).catch(Q),this.emit("camera.update",_("camera.update",{userAction:!0,state:k(k(k({},this.currentPano),{mode:this.mode}),_e(this.camera.pose))})));var Ve=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ve=i.renderer.getDrawingBufferSize(new d.Vector2);ve.width*=i.scissor.width,ve.height*=i.scissor.height;var xe=b.panoId,ye=i.works.getResolvedObserver(xe),me=i.imageOptions.size;if(typeof me=="undefined"&&ye){var Qe=ye.images.up.match(/\/cube_(\d+)\//);Qe&&(me=Number(Qe[1]))}typeof me=="undefined"&&(me=2048);var Ke=0;me>=1024&&(Ke=1),me>=2048&&(Ke=2),me>=4096&&(Ke=3),me>=8192&&(Ke=4);var rt=i.tileLevelForFov(i.camera.fov,ve);return rt>Ke?rt:0}(),Fe=function(){var ve=i.camera.quaternion.clone(),xe=i.works.getResolvedObserver(b.panoId),ye=xe!=null?xe:Z;ye&&ve.premultiply(ye.quaternion.clone().inverse());var me=new d.Matrix4().makeRotationFromQuaternion(ve),Qe=new d.Matrix4().getInverse(me),Ke=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Qe));return Ke}();b.panoId===De(this.currentPano)&&(((f=b.panoPicture)===null||f===void 0?void 0:f.map)instanceof Ne&&(b.panoPicture.map.maxRequest=this.tileMaxRequest,b.panoPicture.map.update(Fe,Ve),b.panoPicture.map.needsRender===!0&&(b.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((m=b.panoPicture)===null||m===void 0?void 0:m.luminanceMap)instanceof Ne&&(b.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,b.panoPicture.luminanceMap.update(Fe,Ve),b.panoPicture.luminanceMap.needsRender===!0&&(b.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ie=this.tiling.object.visible;if(this.initAnimationed){var Ge=b.panoId,be=this.works.getResolvedObserver(Ge);be?ai(this.camera.position,be.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ge&&this.tiling.cleanup(),this.tiling.panoId=Ge,this.tiling.setResource((h=(A=be.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&be.images.luminance?be.images.luminance:null),this.tiling.setFetcher(it(be.work)),this.tiling.setRotation(be.quaternion),this.tiling.setPosition(be.position),this.tiling.maxRequest=this.tileMaxRequest,Ve>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Fe,Ve,e):this.tiling.update(Fe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ie!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},t.prototype.render=function(){this.cardboard.render(this.modelScene,this.camera),this.renderer.autoClear=!1,this.cardboard.render(this.scene,this.camera),this.renderer.autoClear=!0},t.prototype.setCamera=function(e){},t.prototype.destroyHelper=function(){},t.prototype.setHelperElementSize=function(){if(this.helperElement){var e=new d.Vector2(this.element.offsetWidth,this.element.offsetHeight),r=e.x*this.scissor.left,i=e.y*(1-this.scissor.bottom-this.scissor.height),a=e.x*this.scissor.width,o=e.y*this.scissor.height;this.helperElement.style.marginLeft=r+"px",this.helperElement.style.marginTop=i+"px",this.helperElement.style.width=a+"px",this.helperElement.style.height=o+"px"}},t.prototype.intersect=function(e){var r,i;if(this.locationMotion.ended===!1){this.intersectMesh.visible=!1,delete this.activePanoMesh,delete this.activeTime;return}if(this.activePanoMesh&&this.activeTime&&e-this.activeTime>yv){for(var a=this.activePanoMesh,o=Object.keys(this.panoMeshes),s=null,l=0,u=o;l<u.length;l++){var c=u[l];if(this.panoMeshes[c]===a){s=c;break}}return s!==null&&this.moveToPano(At(s),{},!0),delete this.activePanoMesh,delete this.activeTime,a}var f=this.camera.getDirection(new d.Vector3),m=new d.Raycaster(this.camera.position,f);m.params.Points={threshold:.1};for(var A=void 0,h=[],p=this.works.getResolvedObserver(this.currentPano),g=p?p.visibleIds:[],v=0,y=g;v<y.length;v++){var s=y[v],b=this.panoMeshes[s],x=m.intersectObject((r=b.hitTestMesh)!==null&&r!==void 0?r:b,!0)[0];x&&h.push({panoMesh:b,intersection:k({floor:(i=p==null?void 0:p.floorIndex)!==null&&i!==void 0?i:0},x)})}var w=h.sort(function(L,S){return L.intersection.distance-S.intersection.distance})[0];w?(A=w.intersection,this.activePanoMesh!==w.panoMesh&&(this.activePanoMesh=w.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(w.panoMesh.position),this.intersectMesh.lookAt(this.camera.position)):(this.activePanoMesh=void 0,this.activeTime=void 0),A||(A=this.models.intersectRaycaster(m)[0]);var E=_("intersect.update",{raycaster:m,intersection:A!=null?A:null,object:this.intersectMesh});if(this.emit("intersect.update",E),E.defaultPrevented){this.hideIntersectMesh();return}if(A&&A.face){var C=A.face.normal,M=new d.Quaternion;M.setFromUnitVectors(new d.Vector3(0,0,1),C),this.intersectMesh.quaternion.copy(M);var R=A.point.clone();this.intersectMesh.position.copy(R),w?this.intersectMesh.visible=!1:this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return w==null?void 0:w.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(ko),xv=new d.Vector3(0,1.6,0),wv=function(n){se(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Model",r.locationMotion=new Ce({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Ce({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Ce({perspToOrtho:r.camera.perspToOrtho.x}),r}return t.parseArgs=function(e){return e instanceof t?e:n.parseArgs.call(this,e)},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u=this.parseArgs(e),c=u.works,f=e.initial,m=f.state,A=f.currentState,h=typeof m.panoIndex=="number"?{workCode:(a=(r=m.workCode)!==null&&r!==void 0?r:(i=u.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:m.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=c.getResolvedObserver(h),g=(o=m.longitude)!==null&&o!==void 0?o:A.longitude,v=fe((s=m.latitude)!==null&&s!==void 0?s:!p||Xn(A.mode)?A.latitude:u.defaultLatitude,u.minLatitude,u.maxLatitude),y=fe((l=m.fov)!==null&&l!==void 0?l:!p||Xn(A.mode)?A.fov:u.defaultFov,u.minFov,u.maxFov),b=new d.Vector3;if(u.initial.state.offset)b.copy(u.initial.state.offset);else if(p)b.copy(p.position);else{var x=Nt(A).setLength(A.distance);b.copy(u.initial.currentState.offset).sub(x)}return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"Model",longitude:g,latitude:v,fov:y,offset:b,distance:0}},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.works=e;var o=t.initAnimationEndState(k(k({},this),{initial:{currentState:k(k({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));return this.hideIntersectMesh(),this.moveToPosition(o.offset,{duration:0,longitude:o.longitude,latitude:o.latitude,fov:o.fov},a),!0},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return o.distance=0,e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var c=u[l];o.push({key:c.key,progress:c.progress,value:{distance:0,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};if(this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),!this.locationMotion.ended){this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var o=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.works.resolvedObservers,l=dr(s,function(u){return u.position.distanceTo(o)});this.currentPano=l?{workCode:l.work.workCode,panoIndex:l.panoIndex}:{workCode:"",panoIndex:0}}this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),Ut(i)||this.models.setMaterial(i),Ut(a)||this.setCamera(a)}},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={modelAlpha:1},u={perspToOrtho:0},c={longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(f){e.perspToOrthoMotion.set(u,a).catch(Q),e.modelAlphaMotion.set(l,a).catch(Q),e.emit("initAnimation.start",_("initAnimation.start",{state:f,userAction:e.userAction}))},moveEndCallback:function(f){e.emit("initAnimation.end",_("initAnimation.end",{state:f,userAction:e.userAction})),r()},moveCancelCallback:function(){var f=e.currentPano,m=k(k({},f),{mode:e.mode,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance});e.emit("initAnimation.end",_("initAnimation.end",{state:m,userAction:e.userAction})),r()}};e.moveToPosition(s.offset,c,o)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new d.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={});var a=this.works.getResolvedObserver(e);a&&this.moveToPosition(a.position,r,i)},t.prototype.moveToPosition=function(e,r,i){var a=this,o,s,l;r===void 0&&(r={}),this.userAction=i,this.stopMomentumMovement();for(var u=he(),c=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),f=c.distanceTo(e),m=this.locationMotion.getProgressVelocity(u),A=0,h=1;h<this.locationMotion.keyframes.length;h++){var p=this.locationMotion.keyframes[h-1].value,g=p.x,v=p.y,y=p.z,b=this.locationMotion.keyframes[h].value,x=b.x,w=b.y,E=b.z;A+=Math.sqrt(Math.pow(x-g,2)+Math.pow(w-v,2)+Math.pow(E-y,2))}var C=f===0?0:m*A/f,M=this.calculateMovingDuration(r.duration,f),R={x:e.x,y:e.y,z:e.z,distance:0},L={longitude:r.longitude,latitude:r.latitude,fov:r.fov},S=this.works.resolvedObservers,I=dr(S,function(V){return V.position.distanceTo(c)}),O=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:"",panoIndex:0},P=k(k({},O),{mode:this.mode,longitude:(o=L.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=L.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=L.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:e.clone(),distance:0}),F=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:r,prevPano:F,progress:0,state:P,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(P),this.cameraMotion.set(L,M).catch(Q),this.locationMotion.set(R,M,C).then(function(){for(var V=0,D=a.models;V<D.length;V++){var z=D[V];z.show()}var U=k(k(k({},O),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.arrived",_("pano.arrived",{options:r,prevPano:F,progress:0,state:U,userAction:a.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(U)},function(){r.moveCancelCallback&&r.moveCancelCallback(),a.emit("pano.cancel",_("pano.cancel",{options:r,prevPano:F,progress:0,state:P,userAction:a.userAction,error:null}))})},t.prototype.onTapGesture=function(e){var r=e.center.raycaster;this.stopMomentumMovement();var i=this.models.intersectRaycaster(r)[0];if(i&&i.face){var a=i.face.normal,o=i.point;if(new d.Vector3(0,1,0).angleTo(a)>Math.PI/3){var s=a.clone().setLength(.3).add(o);r.set(s,new d.Vector3(0,-1,0)),i=this.models.intersectRaycaster(r)[0]}}if(i){var l=new d.Vector3().copy(i.point).add(xv),u=this.works.resolvedObservers,c=dr(u,function(A){return A.position.distanceTo(l)},!0),f=c[0],m=c[1];f&&m<5&&(l.y=f.position.y),e.state.offset.copy(l),e.state.distance=0,this.emit("gesture.tap",e),e.defaultPrevented||this.moveToPosition(l,{},!0)}else this.emit("gesture.tap",e),e.defaultPrevented||this.cameraBounce()},t}(_u);const Ev=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{Znv\x07H{vs|z-znA-z|qrycvrZnv\x07Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1953
|
+
`,gv=function(n){se(t,n);function t(){var e=n.call(this)||this;e.progress=0,e.opacity=0,e.loading=!1,e.current=!1,e.disabled=!1,e.currentMotion=new Me({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new Me({opacity:0}),e.loadingMotion=new Me({opacity:0}),e.disableMotion=new Me({opacity:0});var r={blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return e.hitTestMesh=new d.Mesh(Ra,new d.MeshBasicMaterial(k(k({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new d.Mesh(Ra,new d.ShaderMaterial(k(k({},r),{vertexShader:mv,fragmentShader:Av,uniforms:{opacity:{value:0}}}))),e.panoMesh=new d.Mesh(Ra,new d.ShaderMaterial(k(k({},r),{vertexShader:pv,fragmentShader:vv,uniforms:{circleScale:{value:1.1},circleFade:{value:0},circleOpacity:{value:.5},loadingAngle:{value:0},loadingOpacity:{value:0},opacity:{value:0},disable:{value:0}}}))),e.add(e.hitTestMesh),e.add(e.ringMesh),e.add(e.panoMesh),e.renderOrder=1e4,e.needsRender=!0,e}return t.prototype.setProgress=function(e){this.progress=e,this.setLoading(e>0)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=fe(e,0,1),this.opacityMotion.set({opacity:e},30).catch(Q))},t.prototype.setCurrent=function(e){if(this.current!==e){if(e){var r=[{progress:0,value:{ringScale:2,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.05,value:{ringScale:1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.15,value:{ringScale:1.2,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.25,value:{ringScale:1.1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.8,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1}},{progress:.9,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:.92,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:1,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1.1}}];this.currentMotion.setKeyframes(r,1500).catch(Q)}else{var r=[{progress:0,value:k({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(r,200).catch(Q)}this.current=e}},t.prototype.setLoading=function(e){this.loading!==e&&(e?this.loadingMotion.setKeyframes([{progress:0,value:{opacity:0}},{progress:.3,value:{opacity:0}},{progress:1,value:{opacity:.8}}],500).catch(Q):this.loadingMotion.set({opacity:0},0).catch(Q),this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.needsRender=!0)},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({opacity:e?1:0},300).catch(Q),this.needsRender=!0)},t.prototype.tap=function(){return Promise.resolve()},t.prototype.updateTime=function(e,r){this.opacityMotion.update(e),this.currentMotion.update(e),this.loadingMotion.update(e);var i=this.opacityMotion.value.opacity;this.visible=i!==0;var a=this.currentMotion.value,o=a.ringScale,s=a.ringOpacity,l=a.circleFade,u=a.circleOpacity,c=a.circleScale;this.ringMesh.scale.set(o,1,o),this.ringMesh.material.uniforms.opacity.value=s*i,this.panoMesh.material.uniforms.opacity.value=i,this.panoMesh.material.uniforms.circleOpacity.value=u,this.panoMesh.material.uniforms.circleScale.value=c,this.panoMesh.material.uniforms.circleFade.value=l,this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingMotion.value.opacity,this.panoMesh.material.uniforms.disable.value=this.disableMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0},t.prototype.dispose=function(){this.hitTestMesh.material.dispose(),this.ringMesh.material.dispose(),this.panoMesh.material.dispose()},t}(d.Object3D),yv=1500,bv=function(n){se(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new uv(r.renderer);var a=hv();r.helperElement=a;var o=new Qn(a);return r.element.parentNode&&(r.element.parentNode.insertBefore(a,r.element),r.setHelperElementSize(),o.on("tap",function(){return r.emit("vr.requestExit",_("vr.requestExit",{}))})),r.destroyHelper=function(){o.destroy(),a.parentNode&&a.parentNode.removeChild(a),delete r.helperElement},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=k(k({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{mode:"VRPanorama"})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper();for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}},t.prototype.isReady=function(){return!1},t.prototype.updateRenderSize=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.setHelperElementSize()},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updatePanoMeshesVisible=function(){for(var e=this.works.getResolvedObserver(this.currentPano),r=(e?e.visibleIds:[]).concat(De(this.currentPano)),i=0,a=this.works.resolvedObservers;i<a.length;i++){var o=a[i],s=this.panoMeshes[o.panoId];s&&(r.indexOf(o.panoId)>=0?s.parent!==this.helper&&this.helper.add(s):s.parent===this.helper&&(this.helper.remove(s),s.setOpacity(0)))}},t.prototype.updatePanoMeshes=function(){for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}for(var s=0,l=this.works.resolvedObservers;s<l.length;s++){var u=l[s],c=u.panoId,f=new gv;f.name="panoSphere_".concat(c),f.position.copy(u.position),f.needsRender=!0,this.panoMeshes[c]=f}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,l,u,c,f,m,A,h;if(!this.destroyed){var p=this.currentPano;this.userAction=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0;var g={},v={},y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),b=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),x=!1;if(this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),g.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),E=w[0],M=w[1],C=this.panoResourceFromLocationMotionKeyframe(E),R=this.panoResourceFromLocationMotionKeyframe(M),L=C.position,S=R.position,I=this.locationMotion.value.count-M.value.count+1;g.progress=I,R.panoPicture&&(I<1?C.panoPicture&&(g.pano0=C.panoPicture):g.pano0=R.panoPicture,g.pano1=R.panoPicture),R.effect==="montage"?g.transition="BLACK":R.effect==="spread"?g.transition="SPREAD":g.transition="FADE",(R.effect==="zoomin"||R.effect==="zoomout")&&(g.progress=Math.pow(I,3)),I<1&&R.effect!=="fly"&&(g.pano0&&C.panoPicture&&(g.pano0={map:g.pano0.map,zoom:g.pano0.zoom,luminanceMap:g.pano0.luminanceMap,matrix:C.panoPicture.matrix.clone().premultiply(C.fixCameraTransform).setPosition(R.position)}),L.copy(S),x=!0),v.distance=this.locationMotion.value.distance,v.offset=new d.Vector3(L.x+(S.x-L.x)*I,L.y+(S.y-L.y)*I,L.z+(S.z-L.z)*I);for(var O=[],P=[],F=0,V=this.locationMotion.keyframes;F<V.length;F++){var D=V[F],z=D.key,U=D.progress;z!==void 0&&(O.push(z),U>this.locationMotion.progress&&P.push(z))}for(var q=0,K=Object.keys(this.panoResources);q<K.length;q++){var j=K[q];if(!(P.indexOf(j)>=0)){var J=this.panoResources[j];if(J.panoPicture){var X=J.panoPicture.map,Y=J.panoPicture.luminanceMap;if(X){if(X===((a=g.pano0)===null||a===void 0?void 0:a.map)||X===((o=g.pano1)===null||o===void 0?void 0:o.map))continue;X instanceof Ne&&X.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(X.cubeRenderTarget),X.dispose(),Y&&(Y instanceof Ne&&Y.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(Y.cubeRenderTarget),Y.dispose()),J.panoPicture=null}}O.indexOf(j)>=0||delete this.panoResources[j]}}this.currentPano=At(R.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:At(y.panoId),state:k(k(k(k({},At(b.panoId)),{mode:this.mode}),_e(this.camera.pose)),v),options:{},progress:this.locationMotion.progress,error:null}))}Ut(g)===!1&&(!((s=g.pano0)===null||s===void 0)&&s.map&&g.pano0.map instanceof Ne&&!g.pano0.map.cubeRenderTarget&&(g.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=g.pano0)===null||l===void 0)&&l.luminanceMap&&g.pano0.luminanceMap instanceof Ne&&!g.pano0.luminanceMap.cubeRenderTarget&&(g.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((u=g.pano1)===null||u===void 0)&&u.map&&g.pano1.map instanceof Ne&&!g.pano1.map.cubeRenderTarget&&(g.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=g.pano1)===null||c===void 0)&&c.luminanceMap&&g.pano1.luminanceMap instanceof Ne&&!g.pano1.luminanceMap.cubeRenderTarget&&(g.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(g)),v.offset&&this.camera.position.copy(v.offset),Yt(this.currentPano,p)&&this.updatePanoMeshesVisible();var W=this.camera.pose.longitude,ee=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose();var Z=this.works.getResolvedObserver(this.currentPano);if(this.camera.pose.distance>.1||x)for(var ie=0,te=Object.keys(this.panoMeshes);ie<te.length;ie++){var le=te[ie],oe=this.panoMeshes[le];oe.setOpacity(0),oe.updateTime&&oe.updateTime(e,r),oe.visible=!1}else if(Z)for(var we=Z.visibleIds.concat(De(this.currentPano)),pe=0,ge=we;pe<ge.length;pe++){var le=ge[pe],Re=At(le),Se=this.works.getResolvedObserver(Re);if(Se){var oe=this.panoMeshes[le];if(!Se.loadable&&!Se.active){oe.setOpacity(0);continue}var Te=oe.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Te<.05?oe.setOpacity(0):oe.setOpacity(fe(1.5/Te,0,1)),Yt(this.currentPano,Re)&&oe.setOpacity(0),oe.lookAt(this.camera.position)}}if(this.locationMotion.ended)for(var re=this.intersect(e),ae=0,H=this.works.resolvedObservers;ae<H.length;ae++){var Se=H[ae],oe=this.panoMeshes[Se.panoId];oe&&(oe.setCurrent(oe===re),oe.updateTime&&oe.updateTime(e,r))}(W!==this.camera.pose.longitude||ee!==this.camera.pose.latitude)&&(this.cameraMotion.set(Dt(this.camera.pose,["longitude","latitude"]),0).catch(Q),this.emit("camera.update",_("camera.update",{userAction:!0,state:k(k(k({},this.currentPano),{mode:this.mode}),_e(this.camera.pose))})));var Ve=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ve=i.renderer.getDrawingBufferSize(new d.Vector2);ve.width*=i.scissor.width,ve.height*=i.scissor.height;var xe=b.panoId,ye=i.works.getResolvedObserver(xe),me=i.imageOptions.size;if(typeof me=="undefined"&&ye){var Qe=ye.images.up.match(/\/cube_(\d+)\//);Qe&&(me=Number(Qe[1]))}typeof me=="undefined"&&(me=2048);var Ke=0;me>=1024&&(Ke=1),me>=2048&&(Ke=2),me>=4096&&(Ke=3),me>=8192&&(Ke=4);var rt=i.tileLevelForFov(i.camera.fov,ve);return rt>Ke?rt:0}(),Fe=function(){var ve=i.camera.quaternion.clone(),xe=i.works.getResolvedObserver(b.panoId),ye=xe!=null?xe:Z;ye&&ve.premultiply(ye.quaternion.clone().inverse());var me=new d.Matrix4().makeRotationFromQuaternion(ve),Qe=new d.Matrix4().getInverse(me),Ke=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Qe));return Ke}();b.panoId===De(this.currentPano)&&(((f=b.panoPicture)===null||f===void 0?void 0:f.map)instanceof Ne&&(b.panoPicture.map.maxRequest=this.tileMaxRequest,b.panoPicture.map.update(Fe,Ve),b.panoPicture.map.needsRender===!0&&(b.panoPicture.map.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)),((m=b.panoPicture)===null||m===void 0?void 0:m.luminanceMap)instanceof Ne&&(b.panoPicture.luminanceMap.maxRequest=this.tileMaxRequest,b.panoPicture.luminanceMap.update(Fe,Ve),b.panoPicture.luminanceMap.needsRender===!0&&(b.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0)));{var Ie=this.tiling.object.visible;if(this.initAnimationed){var Ge=b.panoId,be=this.works.getResolvedObserver(Ge);be?ai(this.camera.position,be.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ge&&this.tiling.cleanup(),this.tiling.panoId=Ge,this.tiling.setResource((h=(A=be.images)===null||A===void 0?void 0:A.tiles)!==null&&h!==void 0?h:[],this.enableIOSEDR&&be.images.luminance?be.images.luminance:null),this.tiling.setFetcher(it(be.work)),this.tiling.setRotation(be.quaternion),this.tiling.setPosition(be.position),this.tiling.maxRequest=this.tileMaxRequest,Ve>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Fe,Ve,e):this.tiling.update(Fe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ie!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},t.prototype.render=function(){this.cardboard.render(this.modelScene,this.camera),this.renderer.autoClear=!1,this.cardboard.render(this.scene,this.camera),this.renderer.autoClear=!0},t.prototype.setCamera=function(e){},t.prototype.destroyHelper=function(){},t.prototype.setHelperElementSize=function(){if(this.helperElement){var e=new d.Vector2(this.element.offsetWidth,this.element.offsetHeight),r=e.x*this.scissor.left,i=e.y*(1-this.scissor.bottom-this.scissor.height),a=e.x*this.scissor.width,o=e.y*this.scissor.height;this.helperElement.style.marginLeft=r+"px",this.helperElement.style.marginTop=i+"px",this.helperElement.style.width=a+"px",this.helperElement.style.height=o+"px"}},t.prototype.intersect=function(e){var r,i;if(this.locationMotion.ended===!1){this.intersectMesh.visible=!1,delete this.activePanoMesh,delete this.activeTime;return}if(this.activePanoMesh&&this.activeTime&&e-this.activeTime>yv){for(var a=this.activePanoMesh,o=Object.keys(this.panoMeshes),s=null,l=0,u=o;l<u.length;l++){var c=u[l];if(this.panoMeshes[c]===a){s=c;break}}return s!==null&&this.moveToPano(At(s),{},!0),delete this.activePanoMesh,delete this.activeTime,a}var f=this.camera.getDirection(new d.Vector3),m=new d.Raycaster(this.camera.position,f);m.params.Points={threshold:.1};for(var A=void 0,h=[],p=this.works.getResolvedObserver(this.currentPano),g=p?p.visibleIds:[],v=0,y=g;v<y.length;v++){var s=y[v],b=this.panoMeshes[s],x=m.intersectObject((r=b.hitTestMesh)!==null&&r!==void 0?r:b,!0)[0];x&&h.push({panoMesh:b,intersection:k({floor:(i=p==null?void 0:p.floorIndex)!==null&&i!==void 0?i:0},x)})}var w=h.sort(function(L,S){return L.intersection.distance-S.intersection.distance})[0];w?(A=w.intersection,this.activePanoMesh!==w.panoMesh&&(this.activePanoMesh=w.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(w.panoMesh.position),this.intersectMesh.lookAt(this.camera.position)):(this.activePanoMesh=void 0,this.activeTime=void 0),A||(A=this.models.intersectRaycaster(m)[0]);var E=_("intersect.update",{raycaster:m,intersection:A!=null?A:null,object:this.intersectMesh});if(this.emit("intersect.update",E),E.defaultPrevented){this.hideIntersectMesh();return}if(A&&A.face){var M=A.face.normal,C=new d.Quaternion;C.setFromUnitVectors(new d.Vector3(0,0,1),M),this.intersectMesh.quaternion.copy(C);var R=A.point.clone();this.intersectMesh.position.copy(R),w?this.intersectMesh.visible=!1:this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return w==null?void 0:w.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(ko),xv=new d.Vector3(0,1.6,0),wv=function(n){se(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Model",r.locationMotion=new Me({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Me({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Me({perspToOrtho:r.camera.perspToOrtho.x}),r}return t.parseArgs=function(e){return e instanceof t?e:n.parseArgs.call(this,e)},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u=this.parseArgs(e),c=u.works,f=e.initial,m=f.state,A=f.currentState,h=typeof m.panoIndex=="number"?{workCode:(a=(r=m.workCode)!==null&&r!==void 0?r:(i=u.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:m.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},p=c.getResolvedObserver(h),g=(o=m.longitude)!==null&&o!==void 0?o:A.longitude,v=fe((s=m.latitude)!==null&&s!==void 0?s:!p||Xn(A.mode)?A.latitude:u.defaultLatitude,u.minLatitude,u.maxLatitude),y=fe((l=m.fov)!==null&&l!==void 0?l:!p||Xn(A.mode)?A.fov:u.defaultFov,u.minFov,u.maxFov),b=new d.Vector3;if(u.initial.state.offset)b.copy(u.initial.state.offset);else if(p)b.copy(p.position);else{var x=Nt(A).setLength(A.distance);b.copy(u.initial.currentState.offset).sub(x)}return{workCode:h.workCode,panoIndex:h.panoIndex,mode:"Model",longitude:g,latitude:v,fov:y,offset:b,distance:0}},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.works=e;var o=t.initAnimationEndState(k(k({},this),{initial:{currentState:k(k({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));return this.hideIntersectMesh(),this.moveToPosition(o.offset,{duration:0,longitude:o.longitude,latitude:o.latitude,fov:o.fov},a),!0},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return o.distance=0,e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var c=u[l];o.push({key:c.key,progress:c.progress,value:{distance:0,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};if(this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),!this.locationMotion.ended){this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var o=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.works.resolvedObservers,l=dr(s,function(u){return u.position.distanceTo(o)});this.currentPano=l?{workCode:l.work.workCode,panoIndex:l.panoIndex}:{workCode:"",panoIndex:0}}this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),Ut(i)||this.models.setMaterial(i),Ut(a)||this.setCamera(a)}},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={modelAlpha:1},u={perspToOrtho:0},c={longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(f){e.perspToOrthoMotion.set(u,a).catch(Q),e.modelAlphaMotion.set(l,a).catch(Q),e.emit("initAnimation.start",_("initAnimation.start",{state:f,userAction:e.userAction}))},moveEndCallback:function(f){e.emit("initAnimation.end",_("initAnimation.end",{state:f,userAction:e.userAction})),r()},moveCancelCallback:function(){var f=e.currentPano,m=k(k({},f),{mode:e.mode,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance});e.emit("initAnimation.end",_("initAnimation.end",{state:m,userAction:e.userAction})),r()}};e.moveToPosition(s.offset,c,o)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new d.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={});var a=this.works.getResolvedObserver(e);a&&this.moveToPosition(a.position,r,i)},t.prototype.moveToPosition=function(e,r,i){var a=this,o,s,l;r===void 0&&(r={}),this.userAction=i,this.stopMomentumMovement();for(var u=he(),c=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),f=c.distanceTo(e),m=this.locationMotion.getProgressVelocity(u),A=0,h=1;h<this.locationMotion.keyframes.length;h++){var p=this.locationMotion.keyframes[h-1].value,g=p.x,v=p.y,y=p.z,b=this.locationMotion.keyframes[h].value,x=b.x,w=b.y,E=b.z;A+=Math.sqrt(Math.pow(x-g,2)+Math.pow(w-v,2)+Math.pow(E-y,2))}var M=f===0?0:m*A/f,C=this.calculateMovingDuration(r.duration,f),R={x:e.x,y:e.y,z:e.z,distance:0},L={longitude:r.longitude,latitude:r.latitude,fov:r.fov},S=this.works.resolvedObservers,I=dr(S,function(V){return V.position.distanceTo(c)}),O=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:"",panoIndex:0},P=k(k({},O),{mode:this.mode,longitude:(o=L.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=L.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=L.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:e.clone(),distance:0}),F=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:r,prevPano:F,progress:0,state:P,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(P),this.cameraMotion.set(L,C).catch(Q),this.locationMotion.set(R,C,M).then(function(){for(var V=0,D=a.models;V<D.length;V++){var z=D[V];z.show()}var U=k(k(k({},O),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.arrived",_("pano.arrived",{options:r,prevPano:F,progress:0,state:U,userAction:a.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(U)},function(){r.moveCancelCallback&&r.moveCancelCallback(),a.emit("pano.cancel",_("pano.cancel",{options:r,prevPano:F,progress:0,state:P,userAction:a.userAction,error:null}))})},t.prototype.onTapGesture=function(e){var r=e.center.raycaster;this.stopMomentumMovement();var i=this.models.intersectRaycaster(r)[0];if(i&&i.face){var a=i.face.normal,o=i.point;if(new d.Vector3(0,1,0).angleTo(a)>Math.PI/3){var s=a.clone().setLength(.3).add(o);r.set(s,new d.Vector3(0,-1,0)),i=this.models.intersectRaycaster(r)[0]}}if(i){var l=new d.Vector3().copy(i.point).add(xv),u=this.works.resolvedObservers,c=dr(u,function(A){return A.position.distanceTo(l)},!0),f=c[0],m=c[1];f&&m<5&&(l.y=f.position.y),e.state.offset.copy(l),e.state.distance=0,this.emit("gesture.tap",e),e.defaultPrevented||this.moveToPosition(l,{},!0)}else this.emit("gesture.tap",e),e.defaultPrevented||this.cameraBounce()},t}(_u);const Ev=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{Znv\x07H{vs|z-znA-z|qrycvrZnv\x07Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1954
1954
|
b-J-HrpA-z]|vv|{-J-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H\f`),Sv=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`0r\x07r{v|{-TYlRealsntlqr}u-G-r{noyr<<<<-nqn}rq-s|z-ur-RQY-unqr-p|qr-s|z-Puvvn{-O|pur{\b-v{-py|q-p|z}nrG<<-u}G<<tvuo;p|z<py|qp|z}nr<{x<rr<znr<}ytv{<\0RQY<unqr<RQY<<}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{H{vs|z-sy|n-prr{dvquH{vs|z-sy|n-prr{UrvtuH{vs|z-rp?-{rvtuo|h[RVTUO\\b_lP\\b[ajH{vs|z-sy|n-rqy\`r{tuH{vs|z-sy|n-nqvH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-[rnH{vs|z-sy|n-SnH{vs|z-znA-]|wH{vs|z-nz}yr?Q-RQYP|y|Hn\bv{t-rp?-bHsy|n-r}|{r5sy|n-qr}u6
|
|
1955
1955
|
--rp?-_nqv-J-nqv-<-rp?5prr{dvqu9-prr{Urvtu6H--sy|n-z-J-=;=H--s|5v{-v-J-=H-v-I-[RVTUO\\b_lP\\b[aH-v886
|
|
1956
1956
|
----rp?-[rvtuo|-J-b-8-_nqv-7-{rvtuo|hvjH----sy|n-{rvtuo|Qr}u-J-r\x07r?Q5RQYP|y|9-[rvtuo|6;nH----{rvtuo|Qr}u-J-5{rvtuo|Qr}u-JJ->;=6-L-=;=-G-{rvtuo|Qr}uH----vs5{rvtuo|Qr}u-.J-=;=6
|
|
@@ -1959,11 +1959,11 @@ void main() {
|
|
|
1959
1959
|
--------z-8J-zn\x075=;=9-qr}u-:-{rvtuo|Qr}u6H------\f----\f--\f--r{-z-<-sy|n5[RVTUO\\b_lP\\b[a6H\f|vq-znv{56
|
|
1960
1960
|
--rpA-pRQY-J-r\x07r?Q5RQYP|y|9-b6H--sy|n-qr}u-J-pRQY;nH--qr}u-J-5qr}u-JJ->;=6-L-=;=-G-qr}uH--sy|n-r-J-r}|{r5qr}u6H--sy|n-unqr-J-r\x07}5:r-7-@==;=-7-rqy\`r{tu6H--tylSntP|y|-J-rpA5pRQY;to-7-unqr9-|}npv\b6H--
|
|
1961
1961
|
-<<-vr-rtyn-u\b}ro|yvp-qr}u-nyr-|-qr}u-ossr----sy|n-qy-J-}|5?;=9-qr}u6H----rpA-q}-J-]|w-7-rpA5=;=9-=;=9-:qy9->;=6H----sy|n-} -J-q}; -<-q};H----sy|n-sntQr}u-J-5} -8->;=6-<-?;=H----<<-tylSntQr}uRea-J-sntQr}uH--\f--vs5qr}u-JJ-=;=6
|
|
1962
|
-
----qvpnqH--\f\f`);var
|
|
1963
|
-
`,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+Ev,r=this.getDefines()+Sv;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},
|
|
1962
|
+
----qvpnqH--\f\f`);var Mv=function(n){se(t,n);function t(e){var r=n.call(this)||this;return r.uniforms={screenWidth:Rt("f",0),screenHeight:Rt("f",0),edlStrength:Rt("f",1),uNear:Rt("f",1),uFar:Rt("f",1),radius:Rt("f",1),neighbours:Rt("2fv",new Float32Array),depthMap:Rt("t",new d.Texture),uEDLColor:Rt("t",new d.Texture),uEDLDepth:Rt("t",new d.Texture),opacity:Rt("f",1),uProj:Rt("Matrix4fv",new Float32Array)},r.neighbourCount=8,r.updateShaderSource(),r.transparent=!0,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},t.prototype.getDefines=function(){var e="";return e+="#define NEIGHBOUR_COUNT "+this.neighbourCount+`
|
|
1963
|
+
`,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+Ev,r=this.getDefines()+Sv;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Ct([Xt("screenWidth"),It("design:type",Number)],t.prototype,"screenWidth",void 0),Ct([Xt("screenHeight"),It("design:type",Number)],t.prototype,"screenHeight",void 0),Ct([Xt("edlStrength"),It("design:type",Number)],t.prototype,"edlStrength",void 0),Ct([Xt("uNear"),It("design:type",Number)],t.prototype,"uNear",void 0),Ct([Xt("uFar"),It("design:type",Number)],t.prototype,"uFar",void 0),Ct([Xt("radius"),It("design:type",Number)],t.prototype,"radius",void 0),Ct([Xt("neighbours",!0),It("design:type",Float32Array)],t.prototype,"neighbours",void 0),Ct([Xt("depthMap"),It("design:type",d.Texture)],t.prototype,"depthMap",void 0),Ct([Xt("uEDLColor"),It("design:type",d.Texture)],t.prototype,"uEDLColor",void 0),Ct([Xt("uEDLDepth"),It("design:type",d.Texture)],t.prototype,"uEDLDepth",void 0),Ct([Xt("uProj"),It("design:type",Array)],t.prototype,"uProj",void 0),t}(d.RawShaderMaterial);function Rt(n,t){return{type:n,value:t}}function Xt(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var Cv=new d.OrthographicCamera(-1,1,1,-1,0,1),Lo=new d.BufferGeometry;Lo.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Lo.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var $u=new d.Mesh(Lo),el=new d.Scene;el.add($u);var Iv=function(n){se(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new d.Vector2,o.renderer=e,o.material=new Mv,$u.material=o.material,o.material.needsUpdate=!0,o}return t.prototype.render=function(e){this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera);var r=this.camera,i=this.material.uniforms,a=this.renderer.getSize(this.sharedV2);i.screenWidth.value=a.x,i.screenHeight.value=a.y;var o=r.projectionMatrix,s=new Float32Array(16);s.set(o.elements);for(var l=new Float32Array(this.material.neighbourCount*2),u=0;u<this.material.neighbourCount;u++)l[2*u+0]=Math.cos(2*u*Math.PI/this.material.neighbourCount),l[2*u+1]=Math.sin(2*u*Math.PI/this.material.neighbourCount);i.neighbours.value=l,i.uNear.value=r.near,i.uFar.value=r.far,i.uEDLColor.value=e[0].texture,i.uProj.value=s,i.edlStrength.value=.25,i.radius.value=1,i.opacity.value=1,this.renderer.setRenderTarget(e[1]),this.renderer.render(el,Cv)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Ro);const Tv=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{H{vs|z-nz}yr?Q-drvtuZn}H{vs|z-nz}yr?Q-Qr}uZn}Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1964
1964
|
sy|n-qr}u-J-r\x07r?Q5Qr}uZn}9-b6;Hvs5qr}u-KJ->;=6
|
|
1965
1965
|
qvpnqH\frpA-p|y|-J-r\x07r?Q5drvtuZn}9-b6H-p|y|-J-p|y|-<-p|y|;HtylSntP|y|-J-rpA5p|y|;\x07\b 9->;=6H-\f`),Pv=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{Znv\x07H{vs|z-znA-z|qrycvrZnv\x07Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1966
|
-
b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var Bv=function(n){se(t,n);function t(e){var r=n.call(this,{vertexShader:Pv,fragmentShader:Tv})||this;return r.uniforms={uDepthMap:s0("t",null),uWeightMap:s0("t",null)},r.depthTest=!0,r.depthWrite=!0,r.opacity=1,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},Mt([u0("uDepthMap"),It("design:type",Number)],t.prototype,"uDepthMap",void 0),Mt([u0("uWeightMap"),It("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(d.RawShaderMaterial);function s0(n,t){return{type:n,value:t}}function u0(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var Rv=new d.OrthographicCamera(-1,1,1,-1,0,1),Oo=new d.BufferGeometry;Oo.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Oo.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var tl=new d.Mesh(Oo),rl=new d.Scene;rl.add(tl);var Fv=function(n){se(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new d.Vector2,o.renderer=e,o.material=new Bv,o.camera=i,tl.material=o.material,o}return t.prototype.render=function(e){this.models.setMaterial({useHQDepth:!0,useHQWeight:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new d.Color(0,0,0)),this.renderer.setClearAlpha(0),this.renderer.setRenderTarget(e[1]),this.renderer.render(this.scene,this.camera),this.material.uniforms.uWeightMap.value=e[1].texture,this.material.uniforms.uDepthMap.value=e[0].depthTexture,this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new d.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(rl,Rv)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Ro),Fa=.5,ka=.5,l0=Math.PI/7,kv=function(n){se(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Mapview",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultDistance=a.defaultDistance,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.cameraType=a.cameraType,r.modelInScreen=a.modelInScreen,r.locationMotion=new Ce({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Ce({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Ce({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new d.WebGLRenderTarget(1024,1024,{generateMipmaps:!1,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(1024,1024,d.UnsignedIntType)}),r.edlEffect=new Iv(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new Fv(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u,c;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return k(k({},f),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:150,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:+Math.PI/2,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:0,cameraType:(l=e.cameraType)!==null&&l!==void 0?l:"auto",modelInScreen:(u=e.modelInScreen)!==null&&u!==void 0?u:"boundingbox-center",intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new Gi}})},t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,c=this.parseArgs(e),f=c.works,m=c.models,A=e.initial,h=A.state,p=A.currentState,g=typeof h.panoIndex=="number"?{workCode:(a=(r=h.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:h.panoIndex}:{workCode:p.workCode,panoIndex:p.panoIndex},v=f.getResolvedObserver(g),y=(o=h.fov)!==null&&o!==void 0?o:60,b=fe((s=h.latitude)!==null&&s!==void 0?s:Ya(p.mode)?p.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),x=t.distanceFromModel(c.models,y,c.camera.aspect),w=new d.Vector3,E=(l=h.distance)!==null&&l!==void 0?l:Math.min(c.defaultDistance,x),C=(u=h.longitude)!==null&&u!==void 0?u:Ya(p.mode)?p.longitude:c.defaultLongitude;return h.offset?w.copy(h.offset):c.defaultDistance<x&&v?(w.copy(v.position),h.longitude===void 0&&(C=p.longitude)):w.copy(m.bounding.getCenter(w)),k(k({},g),{mode:"Mapview",longitude:C,latitude:b,fov:y,offset:w,distance:E})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(k(k({},this),{initial:{currentState:k(k({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},l={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(l,i.duration).catch(Q),this.cameraMotion.set(s,i.duration).catch(Q),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var c=u[l];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var o=0;this.cameraType==="auto"?o=Math.PI/2-this.cameraMotion.value.latitude<.02?1:0:this.cameraType==="perspective"?o=0:this.cameraType==="orthographic"&&(o=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(Q),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),Ut(i)||this.models.setMaterial(i),Ut(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new d.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={longitude:s.longitude,latitude:s.latitude,fov:s.fov},u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(f,a).catch(Q),e.modelAlphaMotion.set(c,a/3).catch(Q),e.cameraMotion.set(l,a).catch(Q),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(m){var A=k(k(k({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var a=this.works.resolvedObservers.filter(function(u){for(var c,f=0,m=r.models;f<m.length;f++){var A=m[f];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===u.work.workCode)return!0}return!1}),o=dr(a,function(u){return u.standingPosition.distanceTo(i.point)},!0),s=o[0],l=o[1];return s&&l<10?s:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new d.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=k({},i),l={longitude:0,latitude:0,x:0,y:0,z:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,l.longitude+=s.longitude,l.latitude+=s.latitude,l.x+=s.x,l.y+=s.y,l.z+=s.z;var c=_r(this.cameraMotion.value.longitude+l.longitude),f=fe(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),m=new d.Vector3(this.locationMotion.value.x+l.x,this.locationMotion.value.y+l.y,this.locationMotion.value.z+l.z),A=k(k({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,offset:m,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(Math.abs(s.longitude)>1e-4||Math.abs(s.latitude)>1e-4||Math.abs(s.x)>1e-4||Math.abs(s.y)>1e-4||Math.abs(s.z)>1e-4),p=_("gesture.momentum",k(k({},e),{isFirst:r,isFinal:h,state:A}));if(this.inMomentumMovement.event=p,this.emit("gesture.momentum",p),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(Q),this.locationMotion.set({x:A.offset.x,y:A.offset.y,z:A.offset.z},0).catch(Q),h?this.inMomentumMovement=null:dt.shared.add(function(g,v){o.requestMomentumMovement(e,!1,s,v|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=Nt(e,new d.Vector3),i=new d.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),a=new d.Raycaster(i,r);a.params.Points={threshold:.1},a.near=Fa;var o;if(a.ray.direction.y<-.3&&(o=this.models.intersectRaycaster(a).filter(function(f){var m,A=(m=f.face)===null||m===void 0?void 0:m.normal;return A&&a.ray.direction.dot(A)>=0?!1:f.distance>ka+a.near})[0],!o)){var s=new d.Plane(new d.Vector3(0,1,0),-this.models.bounding.min.y),l=a.ray.intersectPlane(s,new d.Vector3);if(l){var u=l.distanceTo(a.ray.origin);u<1e4&&u>=a.near&&(o={distance:u,floor:0,point:l,object:this.scene,face:null})}}if(!o){var c=Math.max(e.distance,3);o={distance:c,floor:0,point:a.ray.direction.clone().setLength(c).add(a.ray.origin),object:this.scene,face:null}}o&&(e.distance=fe(o.distance,0,1/0),e.offset.copy(i).add(r.clone().multiplyScalar(e.distance)))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.pointers.length,i=this.panState,a=0;e.pointerType==="mouse"&&(a=e.srcEvent.buttons),i&&a===0&&i.buttons!==0&&(a=i.buttons);var o=i==null?void 0:i.target;if(!o){var s=this.relativeClientPosition(e.center),l=new d.Raycaster;l.params.Points={threshold:.1},l.setFromCamera(s,this.camera),l.near=Fa,o=new d.Vector3().copy(l.ray.direction).multiplyScalar(3).add(l.ray.origin);var u=this.models.intersectRaycaster(l)[0];if(!u&&l.ray.direction.y<-.3){var c=new d.Plane(new d.Vector3(0,1,0),0),f=l.ray.intersectPlane(c,new d.Vector3);if(f){var m=f.distanceTo(l.ray.origin);m<1e4&&m>=l.near&&(u={distance:m,floor:0,point:f,object:this.scene})}}if(u)o.copy(u.point);else{var A=new d.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),c=new d.Plane().setFromNormalAndCoplanarPoint(A,this.camera.pose.offset);l.ray.intersectPlane(c,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||a===2;if(h){var p={x:e.center.x-i.x,y:e.center.y-i.y},g=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),v=Nt(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(g),y=new d.Vector3().copy(v).sub(i.target).length();y*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var b=this.renderer.getSize(new d.Vector2),x=2*p.x*y/b.y,w=2*p.y*y/b.y,E=new d.Vector3;if(E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-x),g.add(E),this.camera.pose.latitude<l0?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(w),g.add(E),this.modelInScreen==="boundingbox-center"){var C=this.models.bounding.clone();C.expandByScalar(this.camera.pose.distance),g.clamp(C.min,C.max)}var M=k(k({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:g,distance:this.camera.pose.distance});if(e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(Q),e.isFinal&&(this.fixFinalState(M),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(Q)),e.isFinal){var R=this.renderer.getSize(new d.Vector2),L=2*e.velocityX*y/R.y,S=2*e.velocityY*y/R.y,I=new d.Vector3,O=new d.Vector3;I.setFromMatrixColumn(this.camera.matrix,0),I.multiplyScalar(-L),O.add(I),this.camera.pose.latitude<l0?I.setFromMatrixColumn(this.camera.matrix,1):(I.setFromMatrixColumn(this.camera.matrix,0),I.crossVectors(this.camera.up,I)),I.multiplyScalar(S),O.add(I),this.inMomentumMovement={uuid:St()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:O.x,y:O.y,z:O.z},0)}}else{var p={x:e.center.x-i.x,y:e.center.y-i.y},P=this.coordinatesForOffset(p),F=_r(this.cameraMotion.value.longitude+P.longitude),V=fe(this.cameraMotion.value.latitude+P.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(V=this.cameraMotion.value.latitude);var M=k(k({},this.currentPano),{mode:this.mode,longitude:F,latitude:V,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&Object.assign(e,{__fixFinalState:!0}),e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(Q):this.cameraMotion.set({longitude:M.longitude,latitude:M.latitude},0).catch(Q),e.isFinal){var D=e.velocityX,z=e.velocityY;this.inMomentumMovement={uuid:St()},this.requestMomentumMovement(e,!0,k(k({},this.coordinatesForOffset({x:D,y:z})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var i=(r=this.pinchState)===null||r===void 0?void 0:r.distance;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,scale:1,distance:this.locationMotion.value.distance};return}if(typeof i!="undefined"){var a=this.models.bounding.getCenter(new d.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=fe(i/e.scale,ka,1/0),l=e.state.offset.clone().sub(Nt(e.state).setLength(s)),u=this.models.bounding.containsPoint(l),c;if(!u&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(l)>o?c=e.state.distance:(c=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=c,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(Q),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var f=e.state;this.fixFinalState(e.state);var m={x:f.offset.x,y:f.offset.y,z:f.offset.z,distance:f.distance};this.locationMotion.set(m,0).catch(Q)}delete this.panState,delete this.pinchState}}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(a.near=Fa,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=_("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new d.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var f=a.ray.origin.distanceTo(c),m=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(f*m/10,1);this.intersectMesh.scale.set(A,A,A);var h=c.clone().add(u);if(this.intersectMesh.lookAt(h),Math.abs(l.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady)if(this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh(),e.isFinal){var r=e.state;if(this.fixFinalState(r),this.emit("gesture.mousewheel",e),e.defaultPrevented)return;var i={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(i,0).catch(Q)}else{var a=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1);if(this.locationMotion.value.distance-a>=ka){var o=this.locationMotion.value.distance-a;e.state.distance=o}else{var s=Nt(this.cameraMotion.value);s.setLength(a),e.state.offset.add(s),this.modelInScreen==="boundingbox-center"&&e.state.offset.clamp(this.models.bounding.min,this.models.bounding.max)}if(this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:e.state.distance,x:e.state.offset.x,y:e.state.offset.y,z:e.state.offset.z},0).catch(Q)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=k(k({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new d.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var l=this.currentTapId=St();this.preloadPano(a.pano).then(function(u){r.currentTapId===l&&r.emit("pano.request",_("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.onDblTapGesture=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.state,i=e.center.raycaster,a=i.ray.origin.clone().add(i.ray.direction.clone().setLength(3)),o=1,s=3,l=o,u=this.models.intersectRaycaster(i)[0];if(u&&(a=u.point.clone(),u.distance>(o+s)/2?l=o:l=s),e.state.distance=l,e.state.offset=a,this.emit("gesture.dbltap",e),!e.defaultPrevented){var c={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(c,360).catch(Q),this.hideIntersectMesh()}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(r==="edl"?this.edlEffect.render(this.screenBuffers):r==="hq"?this.hqEffect.render(this.screenBuffers):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t}(Bo);function c0(n){return n==null}var Lv={type:"move"},d0=function(){function n(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return n.prototype.getHandSpace=function(){return this._hand===null&&(this._hand=new d.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},n.prototype.getTargetRaySpace=function(){return this._targetRay===null&&(this._targetRay=new d.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new d.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new d.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new d.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new d.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new d.Vector3),this._grip},n.prototype.dispatchEvent=function(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this},n.prototype.disconnect=function(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this},n.prototype.getAxes=function(){return this._axes},n.prototype.update=function(t,e,r){var i=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(t&&t.gamepad&&t.gamepad.axes&&(this._axes=[t.gamepad.axes[2],t.gamepad.axes[3]]),t&&e.session.visibilityState!=="visible-blurred")if(s!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Lv))),u&&t.hand){o=!0;for(var c=0,f=t.hand.values();c<f.length;c++){var m=f[c],A=e.getJointPose(m,r);if(u.joints[m.jointName]===void 0){var h=new d.Group;h.matrixAutoUpdate=!1,h.visible=!1,u.joints[m.jointName]=h,u.add(h)}var p=u.joints[m.jointName];A!==null&&(p.matrix.fromArray(A.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=A.radius),p.visible=A!==null}var g=u.joints["index-finger-tip"],v=u.joints["thumb-tip"],y=g.position.distanceTo(v.position),b=.02,x=.005;u.inputState.pinching&&y>b+x?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&y<=b-x&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this},n}(),Ov=1,Vv=function(){function n(t,e,r){var i,a,o,s,l;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var u=navigator.userAgent.toLowerCase(),c;u.includes("pico")?c="Pico":u.includes("oculus")?c="Oculus":c="VP",this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:c,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(o=r==null?void 0:r.referenceSpaceType)!==null&&o!==void 0?o:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(s=r==null?void 0:r.onSessionStart)!==null&&s!==void 0?s:Q,this.onSessionEndCallback=(l=r==null?void 0:r.onSessionEnd)!==null&&l!==void 0?l:Q,this.controllers=[new d0,new d0],this.inputSourcesMap=new Map,this.cameraVR=new d.ArrayCamera,this.cameraL=new d.PerspectiveCamera,this.cameraR=new d.PerspectiveCamera,this.cameraL.viewport=new d.Vector4,this.cameraR.viewport=new d.Vector4,this.cameraL.layers.enable(1),this.cameraR.layers.enable(2),this.cameraVR.layers.enable(1),this.cameraVR.layers.enable(2),this.isPresenting=!1,this.currentDepthNear=null,this.currentDepthFar=null,this.cameraLPos=new d.Vector3,this.cameraRPos=new d.Vector3}return n.prototype.getController=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getRightController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="right"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getLeftController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="left"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getControllerGrip=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getGripSpace()},n.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},n.prototype.updateCamera=function(t,e){e===null?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)},n.prototype.setProjectionFromUnion=function(t,e,r){this.cameraLPos.setFromMatrixPosition(e.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),a=e.projectionMatrix.elements,o=r.projectionMatrix.elements,s=a[14]/(a[10]-1),l=a[14]/(a[10]+1),u=(a[9]+1)/a[5],c=(a[9]-1)/a[5],f=(a[8]-1)/a[0],m=(o[8]+1)/o[0],A=s*f,h=s*m,p=i/(-f+m),g=p*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(g),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var v=s+p,y=l+p,b=A-g,x=h+(i-g),w=u*l/y*v,E=c*l/y*v;t.projectionMatrix.makePerspective(b,x,w,E,v,y)},n.prototype.getCamera=function(t){this.cameraVR.near=this.cameraR.near=this.cameraL.near=t.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=t.far,this.session&&(this.currentDepthNear!==this.cameraVR.near||this.currentDepthFar!==this.cameraVR.far)&&(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var e=t.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,e);for(var i=0;i<r.length;i++)this.updateCamera(r[i],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var a=t.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return r.length===2?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},n.prototype.updateInputSources=function(t){if(!this.session){console.warn("session is lose!");return}for(var e=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(e[r],this.controllers[r]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=this.inputSourcesMap.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],a=this.inputSourcesMap.get(i);a&&a.dispatchEvent({type:"connected",data:i})}},n.prototype.onSessionEvent=function(t){var e=this.inputSourcesMap.get(t.inputSource);e&&e.dispatchEvent({type:t.type})},n.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach(function(t,e){t.disconnect(e)}),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,dt.shared.setContext(null),this.onSessionEndCallback()},n.prototype.onRequestReferenceSpace=function(t){this.referenceSpace=t,this.isPresenting=!0,this.session&&this.onSessionStartCallback(this.session)},n.prototype.setSession=function(t){var e=this;if(this.session=t,this.session){this.session.addEventListener("select",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectstart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeeze",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezestart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezeend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("end",function(i){e.onSessionEnd()});var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then(function(){var i={antialias:r==null?void 0:r.antialias,alpha:r==null?void 0:r.alpha,depth:r==null?void 0:r.depth,stencil:r==null?void 0:r.stencil,framebufferScaleFactor:Ov};if(!e.session){console.error("session is lose while set session!");return}switch(e.machineType){case"Pico":case"VP":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;case"Oculus":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(a){e.onRequestReferenceSpace(a)}),e.session.addEventListener("inputsourceschange",function(a){e.updateInputSources(a)})})}},n}(),Vo=function(n){se(t,n);function t(){var e=n.call(this)||this;e.type="LineSegmentsGeometry";var r=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],a=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(a),e.setAttribute("position",new d.Float32BufferAttribute(r,3)),e.setAttribute("uv",new d.Float32BufferAttribute(i,2)),e}return t.prototype.applyMatrix4=function(e){var r=this.attributes.instanceStart,i=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(e),i.applyMatrix4(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new d.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new d.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new d.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new d.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new d.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new d.InterleavedBufferAttribute(i,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new d.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new d.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new d.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new d.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var a=0,o=new d.Vector3,s=0,l=e.count;s<l;s++)o.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(o)),o.fromBufferAttribute(r,s),a=Math.max(a,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(d.InstancedBufferGeometry);Object.assign(Vo.prototype,{isLineSegmentsGeometry:!0});var La={uniforms:d.UniformsUtils.merge([d.UniformsLib.common,d.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new d.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
|
|
1966
|
+
b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var Bv=function(n){se(t,n);function t(e){var r=n.call(this,{vertexShader:Pv,fragmentShader:Tv})||this;return r.uniforms={uDepthMap:s0("t",null),uWeightMap:s0("t",null)},r.depthTest=!0,r.depthWrite=!0,r.opacity=1,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},Ct([u0("uDepthMap"),It("design:type",Number)],t.prototype,"uDepthMap",void 0),Ct([u0("uWeightMap"),It("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(d.RawShaderMaterial);function s0(n,t){return{type:n,value:t}}function u0(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var Rv=new d.OrthographicCamera(-1,1,1,-1,0,1),Oo=new d.BufferGeometry;Oo.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Oo.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var tl=new d.Mesh(Oo),rl=new d.Scene;rl.add(tl);var Fv=function(n){se(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new d.Vector2,o.renderer=e,o.material=new Bv,o.camera=i,tl.material=o.material,o}return t.prototype.render=function(e){this.models.setMaterial({useHQDepth:!0,useHQWeight:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new d.Color(0,0,0)),this.renderer.setClearAlpha(0),this.renderer.setRenderTarget(e[1]),this.renderer.render(this.scene,this.camera),this.material.uniforms.uWeightMap.value=e[1].texture,this.material.uniforms.uDepthMap.value=e[0].depthTexture,this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new d.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(rl,Rv)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Ro),Fa=.5,ka=.5,l0=Math.PI/7,kv=function(n){se(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Mapview",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultDistance=a.defaultDistance,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.cameraType=a.cameraType,r.modelInScreen=a.modelInScreen,r.locationMotion=new Me({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Me({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Me({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new d.WebGLRenderTarget(1024,1024,{generateMipmaps:!1,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(1024,1024,d.UnsignedIntType)}),r.edlEffect=new Iv(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new Fv(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u,c;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return k(k({},f),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:150,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:+Math.PI/2,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:0,cameraType:(l=e.cameraType)!==null&&l!==void 0?l:"auto",modelInScreen:(u=e.modelInScreen)!==null&&u!==void 0?u:"boundingbox-center",intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new Gi}})},t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,c=this.parseArgs(e),f=c.works,m=c.models,A=e.initial,h=A.state,p=A.currentState,g=typeof h.panoIndex=="number"?{workCode:(a=(r=h.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:h.panoIndex}:{workCode:p.workCode,panoIndex:p.panoIndex},v=f.getResolvedObserver(g),y=(o=h.fov)!==null&&o!==void 0?o:60,b=fe((s=h.latitude)!==null&&s!==void 0?s:Ya(p.mode)?p.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),x=t.distanceFromModel(c.models,y,c.camera.aspect),w=new d.Vector3,E=(l=h.distance)!==null&&l!==void 0?l:Math.min(c.defaultDistance,x),M=(u=h.longitude)!==null&&u!==void 0?u:Ya(p.mode)?p.longitude:c.defaultLongitude;return h.offset?w.copy(h.offset):c.defaultDistance<x&&v?(w.copy(v.position),h.longitude===void 0&&(M=p.longitude)):w.copy(m.bounding.getCenter(w)),k(k({},g),{mode:"Mapview",longitude:M,latitude:b,fov:y,offset:w,distance:E})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(k(k({},this),{initial:{currentState:k(k({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},l={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(l,i.duration).catch(Q),this.cameraMotion.set(s,i.duration).catch(Q),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var c=u[l];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var o=0;this.cameraType==="auto"?o=Math.PI/2-this.cameraMotion.value.latitude<.02?1:0:this.cameraType==="perspective"?o=0:this.cameraType==="orthographic"&&(o=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(Q),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),Ut(i)||this.models.setMaterial(i),Ut(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(he())[1],r=this.locationMotion.getKeyFrameSegment(he())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new d.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={longitude:s.longitude,latitude:s.latitude,fov:s.fov},u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(f,a).catch(Q),e.modelAlphaMotion.set(c,a/3).catch(Q),e.cameraMotion.set(l,a).catch(Q),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(m){var A=k(k(k({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:A,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var a=this.works.resolvedObservers.filter(function(u){for(var c,f=0,m=r.models;f<m.length;f++){var A=m[f];if(A.visible&&((c=A.work)===null||c===void 0?void 0:c.workCode)===u.work.workCode)return!0}return!1}),o=dr(a,function(u){return u.standingPosition.distanceTo(i.point)},!0),s=o[0],l=o[1];return s&&l<10?s:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new d.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=k({},i),l={longitude:0,latitude:0,x:0,y:0,z:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,l.longitude+=s.longitude,l.latitude+=s.latitude,l.x+=s.x,l.y+=s.y,l.z+=s.z;var c=_r(this.cameraMotion.value.longitude+l.longitude),f=fe(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),m=new d.Vector3(this.locationMotion.value.x+l.x,this.locationMotion.value.y+l.y,this.locationMotion.value.z+l.z),A=k(k({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,offset:m,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(Math.abs(s.longitude)>1e-4||Math.abs(s.latitude)>1e-4||Math.abs(s.x)>1e-4||Math.abs(s.y)>1e-4||Math.abs(s.z)>1e-4),p=_("gesture.momentum",k(k({},e),{isFirst:r,isFinal:h,state:A}));if(this.inMomentumMovement.event=p,this.emit("gesture.momentum",p),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(Q),this.locationMotion.set({x:A.offset.x,y:A.offset.y,z:A.offset.z},0).catch(Q),h?this.inMomentumMovement=null:dt.shared.add(function(g,v){o.requestMomentumMovement(e,!1,s,v|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=Nt(e,new d.Vector3),i=new d.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),a=new d.Raycaster(i,r);a.params.Points={threshold:.1},a.near=Fa;var o;if(a.ray.direction.y<-.3&&(o=this.models.intersectRaycaster(a).filter(function(f){var m,A=(m=f.face)===null||m===void 0?void 0:m.normal;return A&&a.ray.direction.dot(A)>=0?!1:f.distance>ka+a.near})[0],!o)){var s=new d.Plane(new d.Vector3(0,1,0),-this.models.bounding.min.y),l=a.ray.intersectPlane(s,new d.Vector3);if(l){var u=l.distanceTo(a.ray.origin);u<1e4&&u>=a.near&&(o={distance:u,floor:0,point:l,object:this.scene,face:null})}}if(!o){var c=Math.max(e.distance,3);o={distance:c,floor:0,point:a.ray.direction.clone().setLength(c).add(a.ray.origin),object:this.scene,face:null}}o&&(e.distance=fe(o.distance,0,1/0),e.offset.copy(i).add(r.clone().multiplyScalar(e.distance)))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.pointers.length,i=this.panState,a=0;e.pointerType==="mouse"&&(a=e.srcEvent.buttons),i&&a===0&&i.buttons!==0&&(a=i.buttons);var o=i==null?void 0:i.target;if(!o){var s=this.relativeClientPosition(e.center),l=new d.Raycaster;l.params.Points={threshold:.1},l.setFromCamera(s,this.camera),l.near=Fa,o=new d.Vector3().copy(l.ray.direction).multiplyScalar(3).add(l.ray.origin);var u=this.models.intersectRaycaster(l)[0];if(!u&&l.ray.direction.y<-.3){var c=new d.Plane(new d.Vector3(0,1,0),0),f=l.ray.intersectPlane(c,new d.Vector3);if(f){var m=f.distanceTo(l.ray.origin);m<1e4&&m>=l.near&&(u={distance:m,floor:0,point:f,object:this.scene})}}if(u)o.copy(u.point);else{var A=new d.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),c=new d.Plane().setFromNormalAndCoplanarPoint(A,this.camera.pose.offset);l.ray.intersectPlane(c,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||a===2;if(h){var p={x:e.center.x-i.x,y:e.center.y-i.y},g=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),v=Nt(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(g),y=new d.Vector3().copy(v).sub(i.target).length();y*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var b=this.renderer.getSize(new d.Vector2),x=2*p.x*y/b.y,w=2*p.y*y/b.y,E=new d.Vector3;if(E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-x),g.add(E),this.camera.pose.latitude<l0?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(w),g.add(E),this.modelInScreen==="boundingbox-center"){var M=this.models.bounding.clone();M.expandByScalar(this.camera.pose.distance),g.clamp(M.min,M.max)}var C=k(k({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:g,distance:this.camera.pose.distance});if(e.state=C,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(Q),e.isFinal&&(this.fixFinalState(C),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:C.distance,x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(Q)),e.isFinal){var R=this.renderer.getSize(new d.Vector2),L=2*e.velocityX*y/R.y,S=2*e.velocityY*y/R.y,I=new d.Vector3,O=new d.Vector3;I.setFromMatrixColumn(this.camera.matrix,0),I.multiplyScalar(-L),O.add(I),this.camera.pose.latitude<l0?I.setFromMatrixColumn(this.camera.matrix,1):(I.setFromMatrixColumn(this.camera.matrix,0),I.crossVectors(this.camera.up,I)),I.multiplyScalar(S),O.add(I),this.inMomentumMovement={uuid:St()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:O.x,y:O.y,z:O.z},0)}}else{var p={x:e.center.x-i.x,y:e.center.y-i.y},P=this.coordinatesForOffset(p),F=_r(this.cameraMotion.value.longitude+P.longitude),V=fe(this.cameraMotion.value.latitude+P.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(V=this.cameraMotion.value.latitude);var C=k(k({},this.currentPano),{mode:this.mode,longitude:F,latitude:V,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&Object.assign(e,{__fixFinalState:!0}),e.state=C,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:C.distance,x:C.offset.x,y:C.offset.y,z:C.offset.z},0).catch(Q):this.cameraMotion.set({longitude:C.longitude,latitude:C.latitude},0).catch(Q),e.isFinal){var D=e.velocityX,z=e.velocityY;this.inMomentumMovement={uuid:St()},this.requestMomentumMovement(e,!0,k(k({},this.coordinatesForOffset({x:D,y:z})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var i=(r=this.pinchState)===null||r===void 0?void 0:r.distance;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,scale:1,distance:this.locationMotion.value.distance};return}if(typeof i!="undefined"){var a=this.models.bounding.getCenter(new d.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=fe(i/e.scale,ka,1/0),l=e.state.offset.clone().sub(Nt(e.state).setLength(s)),u=this.models.bounding.containsPoint(l),c;if(!u&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(l)>o?c=e.state.distance:(c=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=c,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(Q),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var f=e.state;this.fixFinalState(e.state);var m={x:f.offset.x,y:f.offset.y,z:f.offset.z,distance:f.distance};this.locationMotion.set(m,0).catch(Q)}delete this.panState,delete this.pinchState}}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(a.near=Fa,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=_("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new d.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var f=a.ray.origin.distanceTo(c),m=2*Math.tan(.5*this.camera.fov/180*Math.PI),A=Math.max(f*m/10,1);this.intersectMesh.scale.set(A,A,A);var h=c.clone().add(u);if(this.intersectMesh.lookAt(h),Math.abs(l.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady)if(this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh(),e.isFinal){var r=e.state;if(this.fixFinalState(r),this.emit("gesture.mousewheel",e),e.defaultPrevented)return;var i={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(i,0).catch(Q)}else{var a=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1);if(this.locationMotion.value.distance-a>=ka){var o=this.locationMotion.value.distance-a;e.state.distance=o}else{var s=Nt(this.cameraMotion.value);s.setLength(a),e.state.offset.add(s),this.modelInScreen==="boundingbox-center"&&e.state.offset.clamp(this.models.bounding.min,this.models.bounding.max)}if(this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:e.state.distance,x:e.state.offset.x,y:e.state.offset.y,z:e.state.offset.z},0).catch(Q)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=k(k({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new d.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var l=this.currentTapId=St();this.preloadPano(a.pano).then(function(u){r.currentTapId===l&&r.emit("pano.request",_("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.onDblTapGesture=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.state,i=e.center.raycaster,a=i.ray.origin.clone().add(i.ray.direction.clone().setLength(3)),o=1,s=3,l=o,u=this.models.intersectRaycaster(i)[0];if(u&&(a=u.point.clone(),u.distance>(o+s)/2?l=o:l=s),e.state.distance=l,e.state.offset=a,this.emit("gesture.dbltap",e),!e.defaultPrevented){var c={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(c,360).catch(Q),this.hideIntersectMesh()}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(r==="edl"?this.edlEffect.render(this.screenBuffers):r==="hq"?this.hqEffect.render(this.screenBuffers):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t}(Bo);function c0(n){return n==null}var Lv={type:"move"},d0=function(){function n(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return n.prototype.getHandSpace=function(){return this._hand===null&&(this._hand=new d.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},n.prototype.getTargetRaySpace=function(){return this._targetRay===null&&(this._targetRay=new d.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new d.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new d.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new d.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new d.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new d.Vector3),this._grip},n.prototype.dispatchEvent=function(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this},n.prototype.disconnect=function(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this},n.prototype.getAxes=function(){return this._axes},n.prototype.update=function(t,e,r){var i=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(t&&t.gamepad&&t.gamepad.axes&&(this._axes=[t.gamepad.axes[2],t.gamepad.axes[3]]),t&&e.session.visibilityState!=="visible-blurred")if(s!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Lv))),u&&t.hand){o=!0;for(var c=0,f=t.hand.values();c<f.length;c++){var m=f[c],A=e.getJointPose(m,r);if(u.joints[m.jointName]===void 0){var h=new d.Group;h.matrixAutoUpdate=!1,h.visible=!1,u.joints[m.jointName]=h,u.add(h)}var p=u.joints[m.jointName];A!==null&&(p.matrix.fromArray(A.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=A.radius),p.visible=A!==null}var g=u.joints["index-finger-tip"],v=u.joints["thumb-tip"],y=g.position.distanceTo(v.position),b=.02,x=.005;u.inputState.pinching&&y>b+x?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&y<=b-x&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this},n}(),Ov=1,Vv=function(){function n(t,e,r){var i,a,o,s,l;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var u=navigator.userAgent.toLowerCase(),c;u.includes("pico")?c="Pico":u.includes("oculus")?c="Oculus":c="VP",this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:c,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(o=r==null?void 0:r.referenceSpaceType)!==null&&o!==void 0?o:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(s=r==null?void 0:r.onSessionStart)!==null&&s!==void 0?s:Q,this.onSessionEndCallback=(l=r==null?void 0:r.onSessionEnd)!==null&&l!==void 0?l:Q,this.controllers=[new d0,new d0],this.inputSourcesMap=new Map,this.cameraVR=new d.ArrayCamera,this.cameraL=new d.PerspectiveCamera,this.cameraR=new d.PerspectiveCamera,this.cameraL.viewport=new d.Vector4,this.cameraR.viewport=new d.Vector4,this.cameraL.layers.enable(1),this.cameraR.layers.enable(2),this.cameraVR.layers.enable(1),this.cameraVR.layers.enable(2),this.isPresenting=!1,this.currentDepthNear=null,this.currentDepthFar=null,this.cameraLPos=new d.Vector3,this.cameraRPos=new d.Vector3}return n.prototype.getController=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getRightController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="right"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getLeftController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="left"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getControllerGrip=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getGripSpace()},n.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},n.prototype.updateCamera=function(t,e){e===null?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)},n.prototype.setProjectionFromUnion=function(t,e,r){this.cameraLPos.setFromMatrixPosition(e.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),a=e.projectionMatrix.elements,o=r.projectionMatrix.elements,s=a[14]/(a[10]-1),l=a[14]/(a[10]+1),u=(a[9]+1)/a[5],c=(a[9]-1)/a[5],f=(a[8]-1)/a[0],m=(o[8]+1)/o[0],A=s*f,h=s*m,p=i/(-f+m),g=p*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(g),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var v=s+p,y=l+p,b=A-g,x=h+(i-g),w=u*l/y*v,E=c*l/y*v;t.projectionMatrix.makePerspective(b,x,w,E,v,y)},n.prototype.getCamera=function(t){this.cameraVR.near=this.cameraR.near=this.cameraL.near=t.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=t.far,this.session&&(this.currentDepthNear!==this.cameraVR.near||this.currentDepthFar!==this.cameraVR.far)&&(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var e=t.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,e);for(var i=0;i<r.length;i++)this.updateCamera(r[i],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var a=t.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return r.length===2?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},n.prototype.updateInputSources=function(t){if(!this.session){console.warn("session is lose!");return}for(var e=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(e[r],this.controllers[r]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=this.inputSourcesMap.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],a=this.inputSourcesMap.get(i);a&&a.dispatchEvent({type:"connected",data:i})}},n.prototype.onSessionEvent=function(t){var e=this.inputSourcesMap.get(t.inputSource);e&&e.dispatchEvent({type:t.type})},n.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach(function(t,e){t.disconnect(e)}),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,dt.shared.setContext(null),this.onSessionEndCallback()},n.prototype.onRequestReferenceSpace=function(t){this.referenceSpace=t,this.isPresenting=!0,this.session&&this.onSessionStartCallback(this.session)},n.prototype.setSession=function(t){var e=this;if(this.session=t,this.session){this.session.addEventListener("select",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectstart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeeze",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezestart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezeend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("end",function(i){e.onSessionEnd()});var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then(function(){var i={antialias:r==null?void 0:r.antialias,alpha:r==null?void 0:r.alpha,depth:r==null?void 0:r.depth,stencil:r==null?void 0:r.stencil,framebufferScaleFactor:Ov};if(!e.session){console.error("session is lose while set session!");return}switch(e.machineType){case"Pico":case"VP":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;case"Oculus":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(a){e.onRequestReferenceSpace(a)}),e.session.addEventListener("inputsourceschange",function(a){e.updateInputSources(a)})})}},n}(),Vo=function(n){se(t,n);function t(){var e=n.call(this)||this;e.type="LineSegmentsGeometry";var r=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],a=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(a),e.setAttribute("position",new d.Float32BufferAttribute(r,3)),e.setAttribute("uv",new d.Float32BufferAttribute(i,2)),e}return t.prototype.applyMatrix4=function(e){var r=this.attributes.instanceStart,i=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(e),i.applyMatrix4(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new d.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new d.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new d.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new d.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new d.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new d.InterleavedBufferAttribute(i,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new d.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new d.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new d.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new d.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var a=0,o=new d.Vector3,s=0,l=e.count;s<l;s++)o.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(o)),o.fromBufferAttribute(r,s),a=Math.max(a,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(d.InstancedBufferGeometry);Object.assign(Vo.prototype,{isLineSegmentsGeometry:!0});var La={uniforms:d.UniformsUtils.merge([d.UniformsLib.common,d.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new d.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
|
|
1967
1967
|
#include <common>
|
|
1968
1968
|
#include <color_pars_vertex>
|
|
1969
1969
|
#include <fog_pars_vertex>
|
|
@@ -2162,7 +2162,7 @@ void main() {
|
|
|
2162
2162
|
#include <premultiplied_alpha_fragment>
|
|
2163
2163
|
|
|
2164
2164
|
}
|
|
2165
|
-
`},No=function(n){se(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(La.uniforms),vertexShader:La.vertexShader,fragmentShader:La.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(i){this.uniforms.diffuse.value=i}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(i){this.uniforms.linewidth.value=i}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(i){this.uniforms.dashScale.value=i}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(i){this.uniforms.dashSize.value=i}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(i){this.uniforms.gapSize.value=i}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(i){this.uniforms.opacity.value=i}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(i){this.uniforms.resolution.value.copy(i)}}}),r.setValues(e),r}return t}(d.ShaderMaterial);Object.assign(No.prototype,{isLineMaterial:!0});var nl=function(n){se(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new Vo,i.material=r!==void 0?r:new No({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new d.Vector3,s=new d.Vector3,l=0,u=0,c=r.count;l<c;l++,u+=2)o.fromBufferAttribute(r,l),s.fromBufferAttribute(i,l),a[u]=u===0?0:a[u-1],a[u+1]=a[u]+o.distanceTo(s);var f=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(f,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,l=this.material,u=l.resolution,c=l.linewidth,f=s.attributes.instanceStart,m=s.attributes.instanceEnd,A=new d.Vector4,h=new d.Vector4,p=new d.Vector4,g=new d.Vector3,v=new d.Matrix4,y=new d.Line3,b=new d.Vector3;i.at(1,p),p.w=1,p.applyMatrix4(a.matrixWorldInverse),p.applyMatrix4(o),p.multiplyScalar(1/p.w),p.x*=u.x/2,p.y*=u.y/2,p.z=0,g.copy(p);var x=this.matrixWorld;v.multiplyMatrices(a.matrixWorldInverse,x);for(var w=0,E=f.count;w<E;w++){A.fromBufferAttribute(f,w),h.fromBufferAttribute(m,w),A.w=1,h.w=1,A.applyMatrix4(v),h.applyMatrix4(v),A.applyMatrix4(o),h.applyMatrix4(o),A.multiplyScalar(1/A.w),h.multiplyScalar(1/h.w);var C=A.z<-1&&h.z<-1,M=A.z>1&&h.z>1;if(!(C||M)){A.x*=u.x/2,A.y*=u.y/2,h.x*=u.x/2,h.y*=u.y/2,y.start.copy(A),y.start.z=0,y.end.copy(h),y.end.z=0;var R=y.closestPointToPointParameter(g,!0);y.at(R,b);var L=d.MathUtils.lerp(A.z,h.z,R),S=L>=-1&&L<=1,I=g.distanceTo(b)<c*.5;if(S&&I){y.start.fromBufferAttribute(f,w),y.end.fromBufferAttribute(m,w),y.start.applyMatrix4(x),y.end.applyMatrix4(x);var O=new d.Vector3,P=new d.Vector3;i.distanceSqToSegment(y.start,y.end,P,O),r.push({point:P,pointOnLine:O,distance:i.origin.distanceTo(P),object:this,faceIndex:w})}}}},t}(d.Mesh);Object.assign(nl.prototype,{isLineSegments2:!0});var il=function(n){se(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(nl);Object.assign(il.prototype,{isLine2:!0});var al=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(Vo);Object.assign(al.prototype,{isLineGeometry:!0});var Nv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2l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k5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",f0=14467195,Dv=8,zv=2,Qv=20,h0=null,no=function(n){se(t,n);function t(e,r){e===void 0&&(e=new d.Vector3),r===void 0&&(r=new d.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new al,o=new No({color:f0,linewidth:zv,dashScale:Qv,dashed:!1});i.line=new il(a,o);var s=new d.BufferGeometry,l=new d.PointsMaterial({color:f0,size:Dv,map:h0||(h0=new d.TextureLoader().load(Nv)),sizeAttenuation:!1,transparent:!0});return i.points=new d.Points(s,l),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,r),i.add(i.line,i.points),i}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.12"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new d.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new d.Vector3(e[0],e[1],e[2]),new d.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(d.Object3D);Object.assign(no.prototype,{isFiveLine:!0});var Je={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function ol(n){return Qi(this,void 0,void 0,function(){var t;return Ui(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function Uv(n){return Qi(this,void 0,void 0,function(){var t,e;return Ui(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,ol("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function qv(n,t){return Qi(this,arguments,void 0,function(e,r,i,a){var o,s,l,u,c,f;return i===void 0&&(i=null),a===void 0&&(a=!0),Ui(this,function(m){switch(m.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,Uv(r)];case 1:if(o=m.sent(),e.profiles.some(function(A){var h=o[A];return h&&(s={profileId:A,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(l=o[i],!l)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(l.path),deprecated:!!l.deprecated}}return[4,ol(s.profilePath)];case 2:if(u=m.sent(),a){if(f=void 0,f=u.layouts[e.handedness],!f)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));f.assetPath&&(c=s.profilePath.replace("profile.json",f.assetPath))}return[2,{profile:u,assetPath:c}]}})})}var Hv={xAxis:0,yAxis:0,button:0,state:Je.ComponentState.DEFAULT};function Gv(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var Kv=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Je.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Hv)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=Gv(e,r),s=o.normalizedXAxis,l=o.normalizedYAxis;switch(this.componentProperty){case Je.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Je.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?l:.5;break;case Je.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Je.ComponentProperty.STATE:this.valueNodeProperty===Je.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),jv=function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(i){var a=new Kv(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Je.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=k({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Je.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=Je.ComponentState.PRESSED:(r.touched||this.values.button>Je.ButtonTouchThreshold)&&(this.values.state=Je.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Je.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Je.AxisTouchThreshold&&(this.values.state=Je.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Je.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Je.AxisTouchThreshold&&(this.values.state=Je.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),_v=function(){function n(t,e,r){var i=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(a){var o=i.layoutDescription.components[a];i.components[a]=new jv(a,o)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n}(),Jv="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Xv="generic-trigger",Wv=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(i){i instanceof d.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,l=i.value,u=i.valueNodeProperty;a&&(u===Je.VisualResponseProperty.VISIBILITY?a.visible=l:u===Je.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,l),a.position.lerpVectors(o.position,s.position,l)))})}))},t}(Un.Object3D);function Zv(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Je.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Un.SphereGeometry(.001),s=new Un.MeshBasicMaterial({color:255}),l=new Un.Mesh(o,s);e.touchPointNode.add(l)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(u){var c=u.valueNodeName,f=u.minNodeName,m=u.maxNodeName,A=u.valueNodeProperty;if(A===Je.VisualResponseProperty.TRANSFORM){if(u.minNode=t.getObjectByName(f),u.maxNode=t.getObjectByName(m),!u.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!u.maxNode){console.warn("Could not find ".concat(m," in the model"));return}}u.valueNode=t.getObjectByName(c),u.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function p0(n,t){Zv(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof d.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var Yv=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=Jv,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new Wv,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||qv(o,e.path,Xv).then(function(s){var l=s.profile,u=s.assetPath;r.motionController=new _v(o,l,u);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),p0(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(f){e._assetCache[r.motionController.assetUrl]=f,i=f.scene.clone(),p0(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function $v(n,t){return n}var v0=300,em=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),m0=new d.Vector3(-1,1,1),tm=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new Vv(r.renderer,r.renderer.getContext(),{onSessionStart:function(l){r.emit("xr.session.start",_("xr.session.start",{session:l,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",_("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new no,right:new no},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new d.Group,new d.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new Yv;o.gltfLoader={load:function(l,u){Bi.ajax(l,{responseType:"arraybuffer"}).then(function(c){var f;return yo(c.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:Bi})}).then(function(c){return u(c)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=St()]={panoId:De(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new d.Matrix4},r.parallaxCameraMatrixs=[];var s=dt.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var l=r.xrManager.getControllerGrip(0);l.add(o.createControllerModel(l)),r.controllerWrappers[0].add(l);var u=r.xrManager.getControllerGrip(1);u.add(o.createControllerModel(u)),r.controllerWrappers[1].add(u)}),r.xrHandleState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=k(k({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var m=Jn(f.images.up),A=this.imageOptions.size;typeof A=="undefined"&&f&&m&&(A=Number(m)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=function(S,I){return $v(sn(S,h,I))},g=k({key:"pano.".concat(f.panoId)},Dt(this.imageOptions,["format","size","quality"])),v=f.images,y=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(S){return S.size>A}))!==null&&l!==void 0?l:null,b="pano:"+Hi([v,g,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var x=this.pendingTextureTask.panoId;(u=this.panoMeshes[x])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano}))}var w=this.models.getMaterial()||{},E=w.pano0,C=w.pano1,M;if((E==null?void 0:E.map.name)===b?M=E:(C==null?void 0:C.map.name)===b&&(M=C),M){var R={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:M.map,luminanceMap:M.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,m0)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};this.doMoveToPano(f.pano,R,r);return}var L="move-to-pano-"+f.panoId;this.pending.add(L),this.pendingTextureTask={panoId:f.panoId,hash:b,onLoad:function(S){if(a.pending.delete(L),a.destroyed)S.body.dispose();else{S.body.name=b;var I={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:S.body,luminanceMap:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,m0)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,I,r)}},onError:function(S){a.pending.delete(L);var I=k(k(k({},f.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",_("pano.error",{error:S,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",_("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(v,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:g},format:d.RGBAFormat,minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(S){var I,O;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:S,meta:null,pano:f.pano})),((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(S))},this.renderer):this.textureLoader.loadCubeTexture(v,{imageURL:{transform:p,options:g},format:d.RGBAFormat,fetcher:it(f.work)},void 0,void 0,function(S){var I,O;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(S)),a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:S,meta:null,pano:f.pano}))},this.renderer)]).then(function(S){var I,O,P=S[0];((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b?(a.pendingTextureTask.onLoad(P),(O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:P.meta,pano:f.pano}))):P.body.dispose()}).catch(function(S){var I,O;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&(a.pendingTextureTask.onError(S),(O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:S,progress:0,meta:null,pano:f.pano})),a.emit("error",S))}),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,c,f,m,A,h,p;i===void 0&&(i={});var g=he(),v=St();this.panoResources[v]=r;var y=1,b,x,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(g);E[0];var C=E[1],M=this.locationMotion.value,R=this.panoResourceFromLocationMotionKeyframe(C).position,L=r.position;b=Math.max(R.distanceTo(L),y),x=[{key:C.key,progress:0,value:k(k({},M),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],w=0}else{var S=this.locationMotion.getKeyFrameSegment(g),I=S[0],C=S[1],M=this.locationMotion.value,O=this.panoResourceFromLocationMotionKeyframe(I).position,R=this.panoResourceFromLocationMotionKeyframe(C).position,L=r.position,P=C.value.count-M.count,F=Math.max(O.distanceTo(R),y)*P,V=Math.max(R.distanceTo(L),y);b=F+V,x=[{key:I.key,progress:0,value:k({},M)},{key:C.key,progress:F/b,value:C.value},{key:v,progress:1,value:{count:C.value.count+1,distance:0}}];var D=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(x);w=this.locationMotion.getProgressVelocity(g)*D/z}var U=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),q={longitude:i.longitude,latitude:i.latitude,fov:i.fov},K=k(k({},e),{mode:this.mode,longitude:(o=q.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=q.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=q.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:0}),j=this.currentPano;if(this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:j,progress:0,state:K,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(K),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(q,U).catch(Q);else{var J=Nt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),X=Nt({longitude:(u=q.longitude)!==null&&u!==void 0?u:this.cameraMotion.value.longitude,latitude:(c=q.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),Y=new d.Object3D;Y.lookAt(J);var W=new d.Matrix4().makeRotationFromQuaternion(Y.quaternion);Y.lookAt(X);var ee=new d.Matrix4().makeRotationFromQuaternion(Y.quaternion),Z=new d.Matrix4().getInverse(W).premultiply(ee),ie=this.cameraMotion.value.fov,te=(f=q.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,le=1;r.effect==="zoomin"?le=1.5:r.effect==="zoomout"&&(le=.4);for(var oe=te*le,we=0;we<x.length-1;we++){var pe=x[we].key;if(pe){var ge=this.panoResources[pe];ge&&(ge.fixCameraTransform.copy(Z),ge.leftPanoPicture&&(ge.leftPanoPicture.zoom=Math.tan(ie/2/180*Math.PI)/Math.tan(oe/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(m=q.longitude)!==null&&m!==void 0?m:this.cameraMotion.value.longitude,latitude:(A=q.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:oe}},{progress:1,value:{longitude:(h=q.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(p=q.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:te}}],U).catch(Q)}var Re=this.locationMotion.setKeyframes(x,U,w);Re.then(function(){for(var Se,Te,re,ae=0,H=a.models;ae<H.length;ae++){var Ve=H[ae];Ve.show()}var Fe=k(k({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",_("pano.arrived",{options:i,prevPano:j,progress:1,state:Fe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Fe);var Ie=a.works.getResolvedObserver(a.currentPano);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ge=em.clone().multiply((re=(Te=(Se=a.models.getMaterial())===null||Se===void 0?void 0:Se.pano1)===null||Te===void 0?void 0:Te.matrix)!==null&&re!==void 0?re:new d.Matrix4).multiply(Ie.video.matrix),be={map:a.videoTexture,size:Ie.video.size,matrix:Ge,alpha:1},ve=St(),xe=a.videoTexture.image;xe.setAttribute("uuid",ve),Ju().then(function(ye){ye&&Ie.video&&xe.getAttribute("uuid")===ve&&(xe.oncanplay=function(){xe.oncanplay=Q,xe.play()},xe.ontimeupdate=function(){xe.currentTime>.5&&(xe.ontimeupdate=Q,a.panoVideo.setMaterial(be))},xe.src=Ie.video.source)}).catch(function(){xe.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:j,progress:0,state:K,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var l=this.camera.getDirection(new d.Vector3).setY(0),u=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var f=c.accessibleIds.filter(function(X){var Y=At(X);if(Yt(Y,r.currentPano))return!1;var W=r.works.getResolvedObserver(Y);return!W||W.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:W.loadable||W.active}),m=this.models.intersectRaycaster(e)[0];if(m){var A=dr(f,function(X){var Y=r.works.getResolvedObserver(X);if(!Y)return 1/0;var W=Y.standingPosition.clone();return W.distanceTo(m.point)},!0),h=A[0],p=A[1];h&&p<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(c0(u)){var g=this.getForwardObserverOrNot(e);g&&(u=g)}for(var v=0,y=this.locationMotion.keyframes;v<y.length;v++){var b=y[v],x=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&u&&x.panoId===u.panoId){u=null;break}}if(c0(u))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(u&&!u.active){var w=u.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var E={};if(u){for(var C=Math.PI/6,M=Math.PI/12,R=new d.Vector3(0,1,0),L=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),S=L.clone().applyAxisAngle(R,C),I=L.clone().applyAxisAngle(R,-C),O=[],P=[],F=[],V=0,D=u.accessibleIds;V<D.length;V++){var h=D[V],z=At(h);if(!(Yt(z,this.currentPano)||Yt(z,u.pano))){var U=this.works.getResolvedObserver(h);if(U){var q=U.position.clone().sub(u.position).setY(0);L.angleTo(q)<C?F.push(q):S.angleTo(q)<C?O.push(q):I.angleTo(q)<C&&P.push(q)}}}var K=F.length>0?F:Et(Et([],O,!0),P,!0),j=K.slice().sort(function(X,Y){return X.angleTo(L)-Y.angleTo(L)})[0];j&&j.angleTo(l)>M&&(E.longitude=Math.atan2(-j.x,-j.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=fe(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var J={workCode:u.pano.workCode,panoIndex:u.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:u?u.position.clone():new d.Vector3};return this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:J,userAction:!0,options:E,progress:0,error:null})),u&&u.active?(this.emit("pano.request",_("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:J,options:E,error:null})),u.pano):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var i=this,a,o,s,l,u,c,f,m,A=[],h=2;h<arguments.length;h++)A[h-2]=arguments[h];this.userAction=!0;var p={},g={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],E=x[1],C=this.panoResourceFromLocationMotionKeyframe(w),M=this.panoResourceFromLocationMotionKeyframe(E),R=new d.Vector3().copy(C.position),L=new d.Vector3().copy(M.position),S=this.locationMotion.value.count-E.value.count+1;p.progress=S,M.leftPanoPicture&&(S<1?C.leftPanoPicture&&(p.pano0=C.leftPanoPicture):p.pano0=M.leftPanoPicture,p.pano1=M.leftPanoPicture),M.effect==="montage"?p.transition="BLACK":M.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(M.effect==="zoomin"||M.effect==="zoomout")&&(p.progress=Math.pow(S,3)),S<1&&M.effect!=="fly"&&(p.pano0&&C.leftPanoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:C.leftPanoPicture.matrix.clone().setPosition(M.position)}),R.copy(L),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new d.Vector3(R.x+(L.x-R.x)*S,R.y+(L.y-R.y)*S,R.z+(L.z-R.z)*S);for(var I=[],O=[],P=0,F=this.locationMotion.keyframes;P<F.length;P++){var V=F[P],D=V.key,z=V.progress;D!==void 0&&(I.push(D),z>this.locationMotion.progress&&O.push(D))}for(var U=0,q=Object.keys(this.panoResources);U<q.length;U++){var K=q[U];if(!(O.indexOf(K)>=0)){var j=this.panoResources[K];if(j.leftPanoPicture){var J=j.leftPanoPicture.map;if(J){if(J===((a=p.pano0)===null||a===void 0?void 0:a.map)||J===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;J instanceof Ne&&J.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose(),j.leftPanoPicture=null}}I.indexOf(K)>=0||delete this.panoResources[K]}}this.currentPano=At(M.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:At(v.panoId),state:k(k(k(k({},At(y.panoId)),{mode:this.mode}),_e(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}Ut(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ne&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=p.pano1)===null||l===void 0)&&l.map&&p.pano1.map instanceof Ne&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(p)),Ut(g)===!1&&this.setCamera(g);var X=this.works.getResolvedObserver(this.currentPano),Y=A[1];if(!Y){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var W=this.xrManager.referenceSpace;if(W){var ee=this.xrManager.cameraVR,Z=this.xrManager.cameraL,ie=this.xrManager.cameraR,te=[Z,ie],le=Y.getViewerPose(W),oe=new d.Vector3(0,0,0);if(le){var we;we=this.xrManager.session.renderState.baseLayer;var pe=le.views;if(!we){console.error("no layer found");return}this.renderer.setFramebuffer(we.framebuffer);var ge=!1;pe.length!==ee.cameras.length&&(ee.cameras.length=0,ge=!0),this.parallaxCameraMatrixs=[];var Re=new d.Vector3,Se=new d.Vector3;new d.Matrix4().fromArray(pe[0].transform.matrix).decompose(Re,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(pe[1].transform.matrix).decompose(Se,new d.Quaternion,new d.Vector3),Se.clone().sub(Re).normalize();var Te=new d.Vector3,re=new d.Quaternion,ae=new d.Vector3;this.camera.matrix.decompose(Te,re,ae);for(var H=0;H<pe.length;H++){var Ve=pe[H],Fe=we.getViewport(Ve),Ie=te[H];Ie.matrix.fromArray(Ve.transform.matrix);var Ge=new d.Vector3,be=new d.Quaternion,ve=new d.Vector3;Ie.matrix.decompose(Ge,be,ve),oe.copy(Te),Ie.position.copy(Te),Ie.quaternion.copy(be),Ie.scale.copy(ve),Ie.updateMatrix(),Ie.projectionMatrix.fromArray(Ve.projectionMatrix),Ie.viewport.set(Fe.x,Fe.y,Fe.width,Fe.height),ge===!0&&ee.cameras.push(Ie)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var H=0;H<this.xrManager.session.inputSources.length;H++)if(this.xrManager.session.inputSources[H]&&this.xrManager.session.inputSources[H].targetRayMode==="transient-pointer"){var xe=Y.getPose(this.xrManager.session.inputSources[H].targetRaySpace,W);if(xe){var ye=new d.Vector3(0,0,-1).applyQuaternion(xe.transform.orientation),me=new d.Raycaster(this.camera.position,ye);this.gazeRay=me}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Qe=this.xrManager.session.inputSources,H=0;H<Qe.length;H++){var Ke=this.xrManager.controllers[H],rt=Qe[H];if(rt){Ke&&Ke.update(rt,Y,W);var me=this.xrManager.getController(H),Xr=new d.Vector3(0,1.2,0),ke=me.position.clone().add(oe).sub(Xr);rt.handedness==="left"?this.xrControllerRay.left.set(ke,new d.Vector3(0,0,-1).applyEuler(me.rotation)):rt.handedness==="right"&&this.xrControllerRay.right.set(ke,new d.Vector3(0,0,-1).applyEuler(me.rotation)),this.controllerWrappers[H].position.copy(new d.Vector3(0,0,0).add(oe).sub(Xr));var Ze=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ze.length===0&&(Ze=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Tr){var Yr;return k({floor:(Yr=X==null?void 0:X.floorIndex)!==null&&Yr!==void 0?Yr:0},Tr)})),Ze.length>=1&&Ze[0].face)if(rt.handedness==="right"){var st=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),tr=Ze[0].face.normal,fn=tr.clone(),rr=Ze[0].point.clone();this.intersectMesh.position.copy(rr);var Pt=rr.clone().add(fn);if(this.intersectMesh.lookAt(Pt),Math.abs(tr.y)>.99){var nr=this.camera.position.clone().sub(rr);this.intersectMesh.rotation.z=-Math.atan2(nr.z,nr.x)}this.intersectMesh.visible=!0,this.needsRender=!0,st.length>0?(this.pointerLines.right.setPoints(ke,st[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(ke,Ze[0].point));var Mr=Ze[0],qt=_("intersect.update",{raycaster:(u=this.xrControllerRay.right)!==null&&u!==void 0?u:null,intersection:Mr!=null?Mr:null,object:this.intersectMesh});if(this.emit("intersect.update",qt),qt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(ke,Ze[0].point)}}this.updateControllerHelper(Qe,e,r)}if(this.camera.pose.distance>.1||b)for(var ir=0,Ht=Object.keys(this.panoMeshes);ir<Ht.length;ir++){var ft=Ht[ir],Le=this.panoMeshes[ft];Le.setOpacity(0),Le.setCurrent(!1),Le.updateTime&&Le.updateTime(e,r),Le.visible=!1}else if(X){var hr=dr(X.visibleIds,function(ht){var jt=i.works.getResolvedObserver(ht);return jt?X.standingPosition.distanceTo(jt.standingPosition):1/0},!0),gt=hr[1];gt=fe(gt,2.5,1/0);for(var pr=X.visibleIds.concat(De(this.currentPano)),vr=this.getForwardObserverOrNot(),Gt=this.camera.getDirection(new d.Vector3),Ct=0,mr=Object.keys(this.panoMeshes);Ct<mr.length;Ct++){var ft=mr[Ct],Le=this.panoMeshes[ft],Ir=this.works.getResolvedObserver(ft);if(pr.indexOf(ft)===-1)Le.setCurrent(!1),Le.setOpacity(0);else if(!Ir)Le.setCurrent(!1),Le.setOpacity(0);else if(!Ir.loadable&&!Ir.active)Le.setCurrent(!1),Le.setOpacity(0);else{var hn=Le.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Le.setCurrent(!Le.loading&&Le.progress===0&&vr!==null&&vr.panoId===ft),Le.setOpacity(hn<.01?0:fe(gt/hn*1.2,.65,.98));var Wr=this.camera.position.clone().setY(Le.position.y),ye=new d.Vector3().copy(Le.position).sub(Wr).normalize();if(ft===De(this.currentPano)){var Zr=fe((.5-Wr.distanceTo(Le.position))/.5,0,1);ye.multiplyScalar(1-Zr).add(Gt.clone().multiplyScalar(Zr))}ye.length()>0&&Le.quaternion.setFromEuler(new d.Euler(0,Math.atan2(ye.x,ye.z),0))}Le.updateTime&&Le.updateTime(e,r)}}var Kt=function(){return 4}(),Ye=function(){var ht=new d.PerspectiveCamera;ht.applyMatrix4(ee.matrix),ht.position.set(0,0,0);var jt=i.works.getResolvedObserver(y.panoId),Tr=jt!=null?jt:X;Tr&&ht.quaternion.premultiply(Tr.quaternion.clone().inverse()),ht.updateProjectionMatrix(),ht.updateMatrixWorld(!0);var Yr=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(ht.projectionMatrix,ht.matrixWorldInverse));return Yr}();y.panoId===De(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Ne&&(y.leftPanoPicture.map.maxRequest=this.tileMaxRequest,y.leftPanoPicture.map.update(Ye,Kt),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var qe=this.tiling.object.visible;if(this.initAnimationed){var nt=y.panoId,yt=this.works.getResolvedObserver(nt);yt?ai(this.camera.position,yt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==nt&&this.tiling.cleanup(),this.tiling.panoId=nt,this.tiling.setResource((m=(f=yt.images)===null||f===void 0?void 0:f.tiles)!==null&&m!==void 0?m:[],this.enableIOSEDR&&yt.images.luminance?yt.images.luminance:null),this.tiling.setFetcher(it(yt.work)),this.tiling.setRotation(yt.quaternion),this.tiling.setPosition(yt.position),this.tiling.maxRequest=this.tileMaxRequest,Kt>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ye,Kt,e):this.tiling.update(Ye,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;qe!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},l=0;l<e.length;l++){var u=e[l].handedness,c=e[l].gamepad;switch(u){case"left":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"LeftPinch",r));var f={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=f;break;case"right":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"RightPinch",r));var m={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=m,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",_("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",_("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>v0&&this.emit("xr.gesture.press",_("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",_("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=v0){var l=_("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),u=this.emit("xr.gesture.tap",l);!u&&!l.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t}(ko),Ft={Floorplan:ro,Topview:Ip,Panorama:ko,VRPanorama:bv,Model:wv,Mapview:kv,XRPanorama:tm},sl=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function rm(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=Nt(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function nm(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function A0(n){{var t=new d.DirectionalLight(16777215,.3);t.position.copy(new d.Vector3(1,1,1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);t.position.copy(new d.Vector3(-1,-1,-1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);n.add(t)}{var t=new d.AmbientLight(16777215,.6);n.add(t)}}function im(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],l=s.split("="),u=(t=l[0])===null||t===void 0?void 0:t.trim(),c=(e=l[1])===null||e===void 0?void 0:e.trim();u&&c&&(r[u]=c)}return r}function ul(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=im((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const am="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR/1XPxwJhp5DAV67T9ZPwFdovhBMIGUYoRBN4wim6S3eoXVEHXdLgmwY0x6BQnO4xPJ0Ar5OVxhQF0L9UslRM4yaQQfQImnBegi8vhY2A1k6YLlrj61TwDdNQnIISwiPvpD7TwYQTssZXK47vg8y9Gp2nxRcATkozOEmdCeObSt3IIo+xf/00I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2,1,3,2]),_i=new d.BufferGeometry;_i.setAttribute("position",new d.BufferAttribute(om,3));_i.setAttribute("uv",new d.BufferAttribute(sm,2));_i.setIndex(new d.BufferAttribute(um,1));var Ti=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),ll=new d.Mesh(_i,Ti);ll.matrixAutoUpdate=!1;var Do=new d.Scene;Do.add(ll);Do.matrixAutoUpdate=!1;var oi=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);oi.position.set(0,0,.5);oi.lookAt(0,0,0);oi.updateMatrixWorld(!0);oi.matrixAutoUpdate=!1;var lm=new d.Vector4,cm=new d.Vector4;function dm(n){if(Ti.map){var r=n.getViewport(lm),i=n.getScissor(cm),a=n.getScissorTest(),o=n.autoClear,s=i.x+y0[0]/3,l=i.y+y0[1]/3,u=g0[0]/3,c=g0[1]/3;n.setViewport(s,l,u,c),n.setScissor(s,l,u,c),n.setScissorTest(!0),n.autoClear=!1,n.render(Do,oi),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new d.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=d.ClampToEdgeWrapping,t.wrapT=d.ClampToEdgeWrapping,t.minFilter=d.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,Ti.needsUpdate=!0,e.onload=Q},e.src=am,Ti.map=t}}var fm=800,b0=90,hm=function(n){return n.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},pm=new d.Vector2,gi=new d.Frustum,yi=new d.Matrix4,x0=new WeakMap,Oa=new WeakMap,w0=Za([]),cl=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c,f,m,A,h=n.call(this)||this;if(h.ident=St(),typeof window!="undefined"&&(io.instances[h.ident]=h),h.renderSwitch01=0,h.currentMode="Panorama",h.pano={workCode:"",panoIndex:0},h.needsRender=!1,h.modelSceneNeedsRender=!1,h.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,h.imageOptions=k({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=k({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},h.fps={testCount:0,testTime:he()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:fm,h.enableWheel=(l=e.enableWheel)!==null&&l!==void 0?l:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof nn&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new nn({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision});var p=ul();h.renderer.setPixelRatio(p===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(L){L instanceof Error&&h.throwError(L)}h.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(c=(u=h.renderer)===null||u===void 0?void 0:u.outputEncoding)!==null&&c!==void 0?c:d.sRGBEncoding,generateMipmaps:!1});var g=new d.DepthTexture(1,1);g.generateMipmaps=!1,g.format=d.DepthStencilFormat,g.type=d.UnsignedInt248Type,h.modelRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(m=(f=h.renderer)===null||f===void 0?void 0:f.outputEncoding)!==null&&m!==void 0?m:d.sRGBEncoding,depthTexture:g,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new q0(b0),h.scene=new U0,h.xrCustomObjectsScene=new d.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(A=e.requestProxy)!==null&&A!==void 0?A:hm,h.networkSubscribe=new B0,h.networkSubscribe.on("network",function(L,S,I,O){var P;h.emit("network.resource",_("network.resource",{source:L,requestType:S,requestState:I,detail:O})),(P=h.analysis)===null||P===void 0||P.network(h.works,L,S,I,O)}),h.boundingMesh=dp(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=Gs(),h.models.push(new $a),h.lastModels=Gs(),h.lastWorks=Za([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new d.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new d.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new d.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new d.VideoTexture(e.videoInstance||nm()),A0(h.scene),A0(h.modelScene),h.state={mode:h.currentMode,workCode:h.pano.workCode,panoIndex:h.pano.panoIndex,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone(),distance:h.camera.pose.distance},h.stateSynced=!1,h._enablePostProcessing=!1,h._enableIOSEDR=!1,h._enableEDL=!1,h._enableHQ=!1,h.destroyed=!1,h.paused=!0,typeof window!="undefined"&&(e.play!==!1&&h.play(),h.stopAnimationLoop=dt.shared.add(function(L,S){for(var I=[],O=2;O<arguments.length;O++)I[O-2]=arguments[O];h.updateTime.apply(h,Et([L,S],I,!1))},!1,0,10));var v=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",_("vr.requestExit",{}))},y=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",y,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",y,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var b=0,x=e.plugins;b<x.length;b++){var w=x[b];if(typeof w=="function")w(h);else if(Array.isArray(w)){var E=w[0],C=w[1],M=w[2];if(typeof E=="function"){var R=E(h,M);typeof C=="string"&&(h.plugins[C]?h.throwError(new Error("plugin name ".concat(C," is exists."))):h.plugins[C]=R)}}}return h.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,rm(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.12"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Vi.decoderPath},set:function(e){Vi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Kn.transcoderPath},set:function(e){Kn.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new d.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(f){if(!(!(f instanceof d.Mesh)||f instanceof Tt)){var m=Object.keys(i).filter(function(h){return h===f.uuid})[0];if(m)if(s.meshOriginMaterialMap.set(m,f.material),s.meshReplaceMaterialMap.get(m))f.material=s.meshReplaceMaterialMap.get(m);else{var A=new d.ShaderMaterial({uniforms:{color:{value:i[m]}},vertexShader:`
|
|
2165
|
+
`},No=function(n){se(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(La.uniforms),vertexShader:La.vertexShader,fragmentShader:La.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(i){this.uniforms.diffuse.value=i}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(i){this.uniforms.linewidth.value=i}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(i){this.uniforms.dashScale.value=i}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(i){this.uniforms.dashSize.value=i}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(i){this.uniforms.gapSize.value=i}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(i){this.uniforms.opacity.value=i}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(i){this.uniforms.resolution.value.copy(i)}}}),r.setValues(e),r}return t}(d.ShaderMaterial);Object.assign(No.prototype,{isLineMaterial:!0});var nl=function(n){se(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new Vo,i.material=r!==void 0?r:new No({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new d.Vector3,s=new d.Vector3,l=0,u=0,c=r.count;l<c;l++,u+=2)o.fromBufferAttribute(r,l),s.fromBufferAttribute(i,l),a[u]=u===0?0:a[u-1],a[u+1]=a[u]+o.distanceTo(s);var f=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(f,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,l=this.material,u=l.resolution,c=l.linewidth,f=s.attributes.instanceStart,m=s.attributes.instanceEnd,A=new d.Vector4,h=new d.Vector4,p=new d.Vector4,g=new d.Vector3,v=new d.Matrix4,y=new d.Line3,b=new d.Vector3;i.at(1,p),p.w=1,p.applyMatrix4(a.matrixWorldInverse),p.applyMatrix4(o),p.multiplyScalar(1/p.w),p.x*=u.x/2,p.y*=u.y/2,p.z=0,g.copy(p);var x=this.matrixWorld;v.multiplyMatrices(a.matrixWorldInverse,x);for(var w=0,E=f.count;w<E;w++){A.fromBufferAttribute(f,w),h.fromBufferAttribute(m,w),A.w=1,h.w=1,A.applyMatrix4(v),h.applyMatrix4(v),A.applyMatrix4(o),h.applyMatrix4(o),A.multiplyScalar(1/A.w),h.multiplyScalar(1/h.w);var M=A.z<-1&&h.z<-1,C=A.z>1&&h.z>1;if(!(M||C)){A.x*=u.x/2,A.y*=u.y/2,h.x*=u.x/2,h.y*=u.y/2,y.start.copy(A),y.start.z=0,y.end.copy(h),y.end.z=0;var R=y.closestPointToPointParameter(g,!0);y.at(R,b);var L=d.MathUtils.lerp(A.z,h.z,R),S=L>=-1&&L<=1,I=g.distanceTo(b)<c*.5;if(S&&I){y.start.fromBufferAttribute(f,w),y.end.fromBufferAttribute(m,w),y.start.applyMatrix4(x),y.end.applyMatrix4(x);var O=new d.Vector3,P=new d.Vector3;i.distanceSqToSegment(y.start,y.end,P,O),r.push({point:P,pointOnLine:O,distance:i.origin.distanceTo(P),object:this,faceIndex:w})}}}},t}(d.Mesh);Object.assign(nl.prototype,{isLineSegments2:!0});var il=function(n){se(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(nl);Object.assign(il.prototype,{isLine2:!0});var al=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(Vo);Object.assign(al.prototype,{isLineGeometry:!0});var Nv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09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1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",f0=14467195,Dv=8,zv=2,Qv=20,h0=null,no=function(n){se(t,n);function t(e,r){e===void 0&&(e=new d.Vector3),r===void 0&&(r=new d.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new al,o=new No({color:f0,linewidth:zv,dashScale:Qv,dashed:!1});i.line=new il(a,o);var s=new d.BufferGeometry,l=new d.PointsMaterial({color:f0,size:Dv,map:h0||(h0=new d.TextureLoader().load(Nv)),sizeAttenuation:!1,transparent:!0});return i.points=new d.Points(s,l),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,r),i.add(i.line,i.points),i}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.13"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new d.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new d.Vector3(e[0],e[1],e[2]),new d.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(d.Object3D);Object.assign(no.prototype,{isFiveLine:!0});var Je={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function ol(n){return Qi(this,void 0,void 0,function(){var t;return Ui(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function Uv(n){return Qi(this,void 0,void 0,function(){var t,e;return Ui(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,ol("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function qv(n,t){return Qi(this,arguments,void 0,function(e,r,i,a){var o,s,l,u,c,f;return i===void 0&&(i=null),a===void 0&&(a=!0),Ui(this,function(m){switch(m.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,Uv(r)];case 1:if(o=m.sent(),e.profiles.some(function(A){var h=o[A];return h&&(s={profileId:A,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(l=o[i],!l)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(l.path),deprecated:!!l.deprecated}}return[4,ol(s.profilePath)];case 2:if(u=m.sent(),a){if(f=void 0,f=u.layouts[e.handedness],!f)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));f.assetPath&&(c=s.profilePath.replace("profile.json",f.assetPath))}return[2,{profile:u,assetPath:c}]}})})}var Hv={xAxis:0,yAxis:0,button:0,state:Je.ComponentState.DEFAULT};function Gv(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var Kv=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Je.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Hv)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=Gv(e,r),s=o.normalizedXAxis,l=o.normalizedYAxis;switch(this.componentProperty){case Je.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Je.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?l:.5;break;case Je.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Je.ComponentProperty.STATE:this.valueNodeProperty===Je.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),jv=function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(i){var a=new Kv(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Je.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=k({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Je.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=Je.ComponentState.PRESSED:(r.touched||this.values.button>Je.ButtonTouchThreshold)&&(this.values.state=Je.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Je.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Je.AxisTouchThreshold&&(this.values.state=Je.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Je.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Je.AxisTouchThreshold&&(this.values.state=Je.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),_v=function(){function n(t,e,r){var i=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(a){var o=i.layoutDescription.components[a];i.components[a]=new jv(a,o)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n}(),Jv="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Xv="generic-trigger",Wv=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(i){i instanceof d.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,l=i.value,u=i.valueNodeProperty;a&&(u===Je.VisualResponseProperty.VISIBILITY?a.visible=l:u===Je.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,l),a.position.lerpVectors(o.position,s.position,l)))})}))},t}(Un.Object3D);function Zv(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Je.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Un.SphereGeometry(.001),s=new Un.MeshBasicMaterial({color:255}),l=new Un.Mesh(o,s);e.touchPointNode.add(l)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(u){var c=u.valueNodeName,f=u.minNodeName,m=u.maxNodeName,A=u.valueNodeProperty;if(A===Je.VisualResponseProperty.TRANSFORM){if(u.minNode=t.getObjectByName(f),u.maxNode=t.getObjectByName(m),!u.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!u.maxNode){console.warn("Could not find ".concat(m," in the model"));return}}u.valueNode=t.getObjectByName(c),u.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function p0(n,t){Zv(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof d.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var Yv=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=Jv,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new Wv,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||qv(o,e.path,Xv).then(function(s){var l=s.profile,u=s.assetPath;r.motionController=new _v(o,l,u);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),p0(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(f){e._assetCache[r.motionController.assetUrl]=f,i=f.scene.clone(),p0(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function $v(n,t){return n}var v0=300,em=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),m0=new d.Vector3(-1,1,1),tm=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new Vv(r.renderer,r.renderer.getContext(),{onSessionStart:function(l){r.emit("xr.session.start",_("xr.session.start",{session:l,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",_("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new no,right:new no},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new d.Group,new d.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new Yv;o.gltfLoader={load:function(l,u){Bi.ajax(l,{responseType:"arraybuffer"}).then(function(c){var f;return yo(c.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:Bi})}).then(function(c){return u(c)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=St()]={panoId:De(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new d.Matrix4},r.parallaxCameraMatrixs=[];var s=dt.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var l=r.xrManager.getControllerGrip(0);l.add(o.createControllerModel(l)),r.controllerWrappers[0].add(l);var u=r.xrManager.getControllerGrip(1);u.add(o.createControllerModel(u)),r.controllerWrappers[1].add(u)}),r.xrHandleState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=k(k({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var m=Jn(f.images.up),A=this.imageOptions.size;typeof A=="undefined"&&f&&m&&(A=Number(m)),typeof A=="undefined"&&(A=2048);var h=this.imageOptions.transform,p=function(S,I){return $v(sn(S,h,I))},g=k({key:"pano.".concat(f.panoId)},Dt(this.imageOptions,["format","size","quality"])),v=f.images,y=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(S){return S.size>A}))!==null&&l!==void 0?l:null,b="pano:"+Hi([v,g,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var x=this.pendingTextureTask.panoId;(u=this.panoMeshes[x])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano}))}var w=this.models.getMaterial()||{},E=w.pano0,M=w.pano1,C;if((E==null?void 0:E.map.name)===b?C=E:(M==null?void 0:M.map.name)===b&&(C=M),C){var R={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:C.map,luminanceMap:C.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,m0)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};this.doMoveToPano(f.pano,R,r);return}var L="move-to-pano-"+f.panoId;this.pending.add(L),this.pendingTextureTask={panoId:f.panoId,hash:b,onLoad:function(S){if(a.pending.delete(L),a.destroyed)S.body.dispose();else{S.body.name=b;var I={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:S.body,luminanceMap:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,m0)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,I,r)}},onError:function(S){a.pending.delete(L);var I=k(k(k({},f.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",_("pano.error",{error:S,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",_("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(v,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:g},format:d.RGBAFormat,minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(S){var I,O;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:S,meta:null,pano:f.pano})),((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(S))},this.renderer):this.textureLoader.loadCubeTexture(v,{imageURL:{transform:p,options:g},format:d.RGBAFormat,fetcher:it(f.work)},void 0,void 0,function(S){var I,O;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&((O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(S)),a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:S,meta:null,pano:f.pano}))},this.renderer)]).then(function(S){var I,O,P=S[0];((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b?(a.pendingTextureTask.onLoad(P),(O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:P.meta,pano:f.pano}))):P.body.dispose()}).catch(function(S){var I,O;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===b&&(a.pendingTextureTask.onError(S),(O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:S,progress:0,meta:null,pano:f.pano})),a.emit("error",S))}),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,c,f,m,A,h,p;i===void 0&&(i={});var g=he(),v=St();this.panoResources[v]=r;var y=1,b,x,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(g);E[0];var M=E[1],C=this.locationMotion.value,R=this.panoResourceFromLocationMotionKeyframe(M).position,L=r.position;b=Math.max(R.distanceTo(L),y),x=[{key:M.key,progress:0,value:k(k({},C),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],w=0}else{var S=this.locationMotion.getKeyFrameSegment(g),I=S[0],M=S[1],C=this.locationMotion.value,O=this.panoResourceFromLocationMotionKeyframe(I).position,R=this.panoResourceFromLocationMotionKeyframe(M).position,L=r.position,P=M.value.count-C.count,F=Math.max(O.distanceTo(R),y)*P,V=Math.max(R.distanceTo(L),y);b=F+V,x=[{key:I.key,progress:0,value:k({},C)},{key:M.key,progress:F/b,value:M.value},{key:v,progress:1,value:{count:M.value.count+1,distance:0}}];var D=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(x);w=this.locationMotion.getProgressVelocity(g)*D/z}var U=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),q={longitude:i.longitude,latitude:i.latitude,fov:i.fov},K=k(k({},e),{mode:this.mode,longitude:(o=q.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=q.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=q.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:0}),j=this.currentPano;if(this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:j,progress:0,state:K,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(K),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(q,U).catch(Q);else{var J=Nt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),X=Nt({longitude:(u=q.longitude)!==null&&u!==void 0?u:this.cameraMotion.value.longitude,latitude:(c=q.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),Y=new d.Object3D;Y.lookAt(J);var W=new d.Matrix4().makeRotationFromQuaternion(Y.quaternion);Y.lookAt(X);var ee=new d.Matrix4().makeRotationFromQuaternion(Y.quaternion),Z=new d.Matrix4().getInverse(W).premultiply(ee),ie=this.cameraMotion.value.fov,te=(f=q.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,le=1;r.effect==="zoomin"?le=1.5:r.effect==="zoomout"&&(le=.4);for(var oe=te*le,we=0;we<x.length-1;we++){var pe=x[we].key;if(pe){var ge=this.panoResources[pe];ge&&(ge.fixCameraTransform.copy(Z),ge.leftPanoPicture&&(ge.leftPanoPicture.zoom=Math.tan(ie/2/180*Math.PI)/Math.tan(oe/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(m=q.longitude)!==null&&m!==void 0?m:this.cameraMotion.value.longitude,latitude:(A=q.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:oe}},{progress:1,value:{longitude:(h=q.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(p=q.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:te}}],U).catch(Q)}var Re=this.locationMotion.setKeyframes(x,U,w);Re.then(function(){for(var Se,Te,re,ae=0,H=a.models;ae<H.length;ae++){var Ve=H[ae];Ve.show()}var Fe=k(k({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",_("pano.arrived",{options:i,prevPano:j,progress:1,state:Fe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Fe);var Ie=a.works.getResolvedObserver(a.currentPano);if(Ie&&Ie.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ge=em.clone().multiply((re=(Te=(Se=a.models.getMaterial())===null||Se===void 0?void 0:Se.pano1)===null||Te===void 0?void 0:Te.matrix)!==null&&re!==void 0?re:new d.Matrix4).multiply(Ie.video.matrix),be={map:a.videoTexture,size:Ie.video.size,matrix:Ge,alpha:1},ve=St(),xe=a.videoTexture.image;xe.setAttribute("uuid",ve),Ju().then(function(ye){ye&&Ie.video&&xe.getAttribute("uuid")===ve&&(xe.oncanplay=function(){xe.oncanplay=Q,xe.play()},xe.ontimeupdate=function(){xe.currentTime>.5&&(xe.ontimeupdate=Q,a.panoVideo.setMaterial(be))},xe.src=Ie.video.source)}).catch(function(){xe.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:j,progress:0,state:K,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var l=this.camera.getDirection(new d.Vector3).setY(0),u=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var f=c.accessibleIds.filter(function(X){var Y=At(X);if(Yt(Y,r.currentPano))return!1;var W=r.works.getResolvedObserver(Y);return!W||W.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:W.loadable||W.active}),m=this.models.intersectRaycaster(e)[0];if(m){var A=dr(f,function(X){var Y=r.works.getResolvedObserver(X);if(!Y)return 1/0;var W=Y.standingPosition.clone();return W.distanceTo(m.point)},!0),h=A[0],p=A[1];h&&p<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(c0(u)){var g=this.getForwardObserverOrNot(e);g&&(u=g)}for(var v=0,y=this.locationMotion.keyframes;v<y.length;v++){var b=y[v],x=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&u&&x.panoId===u.panoId){u=null;break}}if(c0(u))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(u&&!u.active){var w=u.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var E={};if(u){for(var M=Math.PI/6,C=Math.PI/12,R=new d.Vector3(0,1,0),L=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),S=L.clone().applyAxisAngle(R,M),I=L.clone().applyAxisAngle(R,-M),O=[],P=[],F=[],V=0,D=u.accessibleIds;V<D.length;V++){var h=D[V],z=At(h);if(!(Yt(z,this.currentPano)||Yt(z,u.pano))){var U=this.works.getResolvedObserver(h);if(U){var q=U.position.clone().sub(u.position).setY(0);L.angleTo(q)<M?F.push(q):S.angleTo(q)<M?O.push(q):I.angleTo(q)<M&&P.push(q)}}}var K=F.length>0?F:Et(Et([],O,!0),P,!0),j=K.slice().sort(function(X,Y){return X.angleTo(L)-Y.angleTo(L)})[0];j&&j.angleTo(l)>C&&(E.longitude=Math.atan2(-j.x,-j.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=fe(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var J={workCode:u.pano.workCode,panoIndex:u.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:u?u.position.clone():new d.Vector3};return this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:J,userAction:!0,options:E,progress:0,error:null})),u&&u.active?(this.emit("pano.request",_("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:J,options:E,error:null})),u.pano):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var i=this,a,o,s,l,u,c,f,m,A=[],h=2;h<arguments.length;h++)A[h-2]=arguments[h];this.userAction=!0;var p={},g={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var x=this.locationMotion.getKeyFrameSegment(e),w=x[0],E=x[1],M=this.panoResourceFromLocationMotionKeyframe(w),C=this.panoResourceFromLocationMotionKeyframe(E),R=new d.Vector3().copy(M.position),L=new d.Vector3().copy(C.position),S=this.locationMotion.value.count-E.value.count+1;p.progress=S,C.leftPanoPicture&&(S<1?M.leftPanoPicture&&(p.pano0=M.leftPanoPicture):p.pano0=C.leftPanoPicture,p.pano1=C.leftPanoPicture),C.effect==="montage"?p.transition="BLACK":C.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(p.progress=Math.pow(S,3)),S<1&&C.effect!=="fly"&&(p.pano0&&M.leftPanoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:M.leftPanoPicture.matrix.clone().setPosition(C.position)}),R.copy(L),b=!0),g.distance=this.locationMotion.value.distance,g.offset=new d.Vector3(R.x+(L.x-R.x)*S,R.y+(L.y-R.y)*S,R.z+(L.z-R.z)*S);for(var I=[],O=[],P=0,F=this.locationMotion.keyframes;P<F.length;P++){var V=F[P],D=V.key,z=V.progress;D!==void 0&&(I.push(D),z>this.locationMotion.progress&&O.push(D))}for(var U=0,q=Object.keys(this.panoResources);U<q.length;U++){var K=q[U];if(!(O.indexOf(K)>=0)){var j=this.panoResources[K];if(j.leftPanoPicture){var J=j.leftPanoPicture.map;if(J){if(J===((a=p.pano0)===null||a===void 0?void 0:a.map)||J===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;J instanceof Ne&&J.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(J.cubeRenderTarget),J.dispose(),j.leftPanoPicture=null}}I.indexOf(K)>=0||delete this.panoResources[K]}}this.currentPano=At(C.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:At(v.panoId),state:k(k(k(k({},At(y.panoId)),{mode:this.mode}),_e(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}Ut(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ne&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=p.pano1)===null||l===void 0)&&l.map&&p.pano1.map instanceof Ne&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(p)),Ut(g)===!1&&this.setCamera(g);var X=this.works.getResolvedObserver(this.currentPano),Y=A[1];if(!Y){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var W=this.xrManager.referenceSpace;if(W){var ee=this.xrManager.cameraVR,Z=this.xrManager.cameraL,ie=this.xrManager.cameraR,te=[Z,ie],le=Y.getViewerPose(W),oe=new d.Vector3(0,0,0);if(le){var we;we=this.xrManager.session.renderState.baseLayer;var pe=le.views;if(!we){console.error("no layer found");return}this.renderer.setFramebuffer(we.framebuffer);var ge=!1;pe.length!==ee.cameras.length&&(ee.cameras.length=0,ge=!0),this.parallaxCameraMatrixs=[];var Re=new d.Vector3,Se=new d.Vector3;new d.Matrix4().fromArray(pe[0].transform.matrix).decompose(Re,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(pe[1].transform.matrix).decompose(Se,new d.Quaternion,new d.Vector3),Se.clone().sub(Re).normalize();var Te=new d.Vector3,re=new d.Quaternion,ae=new d.Vector3;this.camera.matrix.decompose(Te,re,ae);for(var H=0;H<pe.length;H++){var Ve=pe[H],Fe=we.getViewport(Ve),Ie=te[H];Ie.matrix.fromArray(Ve.transform.matrix);var Ge=new d.Vector3,be=new d.Quaternion,ve=new d.Vector3;Ie.matrix.decompose(Ge,be,ve),oe.copy(Te),Ie.position.copy(Te),Ie.quaternion.copy(be),Ie.scale.copy(ve),Ie.updateMatrix(),Ie.projectionMatrix.fromArray(Ve.projectionMatrix),Ie.viewport.set(Fe.x,Fe.y,Fe.width,Fe.height),ge===!0&&ee.cameras.push(Ie)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var H=0;H<this.xrManager.session.inputSources.length;H++)if(this.xrManager.session.inputSources[H]&&this.xrManager.session.inputSources[H].targetRayMode==="transient-pointer"){var xe=Y.getPose(this.xrManager.session.inputSources[H].targetRaySpace,W);if(xe){var ye=new d.Vector3(0,0,-1).applyQuaternion(xe.transform.orientation),me=new d.Raycaster(this.camera.position,ye);this.gazeRay=me}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Qe=this.xrManager.session.inputSources,H=0;H<Qe.length;H++){var Ke=this.xrManager.controllers[H],rt=Qe[H];if(rt){Ke&&Ke.update(rt,Y,W);var me=this.xrManager.getController(H),Xr=new d.Vector3(0,1.2,0),ke=me.position.clone().add(oe).sub(Xr);rt.handedness==="left"?this.xrControllerRay.left.set(ke,new d.Vector3(0,0,-1).applyEuler(me.rotation)):rt.handedness==="right"&&this.xrControllerRay.right.set(ke,new d.Vector3(0,0,-1).applyEuler(me.rotation)),this.controllerWrappers[H].position.copy(new d.Vector3(0,0,0).add(oe).sub(Xr));var Ze=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ze.length===0&&(Ze=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Tr){var Yr;return k({floor:(Yr=X==null?void 0:X.floorIndex)!==null&&Yr!==void 0?Yr:0},Tr)})),Ze.length>=1&&Ze[0].face)if(rt.handedness==="right"){var st=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),tr=Ze[0].face.normal,fn=tr.clone(),rr=Ze[0].point.clone();this.intersectMesh.position.copy(rr);var Pt=rr.clone().add(fn);if(this.intersectMesh.lookAt(Pt),Math.abs(tr.y)>.99){var nr=this.camera.position.clone().sub(rr);this.intersectMesh.rotation.z=-Math.atan2(nr.z,nr.x)}this.intersectMesh.visible=!0,this.needsRender=!0,st.length>0?(this.pointerLines.right.setPoints(ke,st[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(ke,Ze[0].point));var Cr=Ze[0],qt=_("intersect.update",{raycaster:(u=this.xrControllerRay.right)!==null&&u!==void 0?u:null,intersection:Cr!=null?Cr:null,object:this.intersectMesh});if(this.emit("intersect.update",qt),qt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(ke,Ze[0].point)}}this.updateControllerHelper(Qe,e,r)}if(this.camera.pose.distance>.1||b)for(var ir=0,Ht=Object.keys(this.panoMeshes);ir<Ht.length;ir++){var ft=Ht[ir],Le=this.panoMeshes[ft];Le.setOpacity(0),Le.setCurrent(!1),Le.updateTime&&Le.updateTime(e,r),Le.visible=!1}else if(X){var hr=dr(X.visibleIds,function(ht){var jt=i.works.getResolvedObserver(ht);return jt?X.standingPosition.distanceTo(jt.standingPosition):1/0},!0),gt=hr[1];gt=fe(gt,2.5,1/0);for(var pr=X.visibleIds.concat(De(this.currentPano)),vr=this.getForwardObserverOrNot(),Gt=this.camera.getDirection(new d.Vector3),Mt=0,mr=Object.keys(this.panoMeshes);Mt<mr.length;Mt++){var ft=mr[Mt],Le=this.panoMeshes[ft],Ir=this.works.getResolvedObserver(ft);if(pr.indexOf(ft)===-1)Le.setCurrent(!1),Le.setOpacity(0);else if(!Ir)Le.setCurrent(!1),Le.setOpacity(0);else if(!Ir.loadable&&!Ir.active)Le.setCurrent(!1),Le.setOpacity(0);else{var hn=Le.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Le.setCurrent(!Le.loading&&Le.progress===0&&vr!==null&&vr.panoId===ft),Le.setOpacity(hn<.01?0:fe(gt/hn*1.2,.65,.98));var Wr=this.camera.position.clone().setY(Le.position.y),ye=new d.Vector3().copy(Le.position).sub(Wr).normalize();if(ft===De(this.currentPano)){var Zr=fe((.5-Wr.distanceTo(Le.position))/.5,0,1);ye.multiplyScalar(1-Zr).add(Gt.clone().multiplyScalar(Zr))}ye.length()>0&&Le.quaternion.setFromEuler(new d.Euler(0,Math.atan2(ye.x,ye.z),0))}Le.updateTime&&Le.updateTime(e,r)}}var Kt=function(){return 4}(),Ye=function(){var ht=new d.PerspectiveCamera;ht.applyMatrix4(ee.matrix),ht.position.set(0,0,0);var jt=i.works.getResolvedObserver(y.panoId),Tr=jt!=null?jt:X;Tr&&ht.quaternion.premultiply(Tr.quaternion.clone().inverse()),ht.updateProjectionMatrix(),ht.updateMatrixWorld(!0);var Yr=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(ht.projectionMatrix,ht.matrixWorldInverse));return Yr}();y.panoId===De(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Ne&&(y.leftPanoPicture.map.maxRequest=this.tileMaxRequest,y.leftPanoPicture.map.update(Ye,Kt),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var qe=this.tiling.object.visible;if(this.initAnimationed){var nt=y.panoId,yt=this.works.getResolvedObserver(nt);yt?ai(this.camera.position,yt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==nt&&this.tiling.cleanup(),this.tiling.panoId=nt,this.tiling.setResource((m=(f=yt.images)===null||f===void 0?void 0:f.tiles)!==null&&m!==void 0?m:[],this.enableIOSEDR&&yt.images.luminance?yt.images.luminance:null),this.tiling.setFetcher(it(yt.work)),this.tiling.setRotation(yt.quaternion),this.tiling.setPosition(yt.position),this.tiling.maxRequest=this.tileMaxRequest,Kt>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ye,Kt,e):this.tiling.update(Ye,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;qe!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},l=0;l<e.length;l++){var u=e[l].handedness,c=e[l].gamepad;switch(u){case"left":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"LeftPinch",r));var f={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=f;break;case"right":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"RightPinch",r));var m={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=m,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",_("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",_("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>v0&&this.emit("xr.gesture.press",_("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",_("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=v0){var l=_("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),u=this.emit("xr.gesture.tap",l);!u&&!l.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t}(ko),Ft={Floorplan:ro,Topview:Ip,Panorama:ko,VRPanorama:bv,Model:wv,Mapview:kv,XRPanorama:tm},sl=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function rm(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=Nt(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function nm(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function A0(n){{var t=new d.DirectionalLight(16777215,.3);t.position.copy(new d.Vector3(1,1,1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);t.position.copy(new d.Vector3(-1,-1,-1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);n.add(t)}{var t=new d.AmbientLight(16777215,.6);n.add(t)}}function im(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],l=s.split("="),u=(t=l[0])===null||t===void 0?void 0:t.trim(),c=(e=l[1])===null||e===void 0?void 0:e.trim();u&&c&&(r[u]=c)}return r}function ul(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=im((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const am="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR/1XPxwJhp5DAV67T9ZPwFdovhBMIGUYoRBN4wim6S3eoXVEHXdLgmwY0x6BQnO4xPJ0Ar5OVxhQF0L9UslRM4yaQQfQImnBegi8vhY2A1k6YLlrj61TwDdNQnIISwiPvpD7TwYQTssZXK47vg8y9Gp2nxRcATkozOEmdCeObSt3IIo+xf/00IDRKAaZ89PBTkHqpkA5LagKeNZKlIhqX8RcQ95GHtdYA62Y6rOg5LLsOSnoyvk4V38hFhytef+V9/3DER1P48W89o1GxE9o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AClmEaYhqhdit89QC7niSbCEM2sdkBuHYxQg9ri5ZjkuhI6DMP+J7cTvEtokEx0aPscyddoFJKpSZqV7G1GTxcpmEthpnw5058c6GfwqpwzGOtGjXSJI3FLYhc+O+jSr9aGhPWQlRshS8AticLX7wnsgbXxt6gsWCpRBa0vRGQM8oB9dhmP3QAwFX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var g0=[351,63],y0=[20,20],om=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),sm=new Float32Array([0,0,1,0,0,1,1,1]),um=new Uint8Array([0,1,2,1,3,2]),_i=new d.BufferGeometry;_i.setAttribute("position",new d.BufferAttribute(om,3));_i.setAttribute("uv",new d.BufferAttribute(sm,2));_i.setIndex(new d.BufferAttribute(um,1));var Ti=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),ll=new d.Mesh(_i,Ti);ll.matrixAutoUpdate=!1;var Do=new d.Scene;Do.add(ll);Do.matrixAutoUpdate=!1;var oi=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);oi.position.set(0,0,.5);oi.lookAt(0,0,0);oi.updateMatrixWorld(!0);oi.matrixAutoUpdate=!1;var lm=new d.Vector4,cm=new d.Vector4;function dm(n){if(Ti.map){var r=n.getViewport(lm),i=n.getScissor(cm),a=n.getScissorTest(),o=n.autoClear,s=i.x+y0[0]/3,l=i.y+y0[1]/3,u=g0[0]/3,c=g0[1]/3;n.setViewport(s,l,u,c),n.setScissor(s,l,u,c),n.setScissorTest(!0),n.autoClear=!1,n.render(Do,oi),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new d.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=d.ClampToEdgeWrapping,t.wrapT=d.ClampToEdgeWrapping,t.minFilter=d.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,Ti.needsUpdate=!0,e.onload=Q},e.src=am,Ti.map=t}}var fm=800,b0=90,hm=function(n){return n.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},pm=new d.Vector2,gi=new d.Frustum,yi=new d.Matrix4,x0=new WeakMap,Oa=new WeakMap,w0=Za([]),cl=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c,f,m,A,h=n.call(this)||this;if(h.ident=St(),typeof window!="undefined"&&(io.instances[h.ident]=h),h.renderSwitch01=0,h.currentMode="Panorama",h.pano={workCode:"",panoIndex:0},h.needsRender=!1,h.modelSceneNeedsRender=!1,h.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,h.imageOptions=k({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=k({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},h.fps={testCount:0,testTime:he()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:fm,h.enableWheel=(l=e.enableWheel)!==null&&l!==void 0?l:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof nn&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new nn({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision});var p=ul();h.renderer.setPixelRatio(p===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(L){L instanceof Error&&h.throwError(L)}h.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(c=(u=h.renderer)===null||u===void 0?void 0:u.outputEncoding)!==null&&c!==void 0?c:d.sRGBEncoding,generateMipmaps:!1});var g=new d.DepthTexture(1,1);g.generateMipmaps=!1,g.format=d.DepthStencilFormat,g.type=d.UnsignedInt248Type,h.modelRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(m=(f=h.renderer)===null||f===void 0?void 0:f.outputEncoding)!==null&&m!==void 0?m:d.sRGBEncoding,depthTexture:g,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new q0(b0),h.scene=new U0,h.xrCustomObjectsScene=new d.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(A=e.requestProxy)!==null&&A!==void 0?A:hm,h.networkSubscribe=new B0,h.networkSubscribe.on("network",function(L,S,I,O){var P;h.emit("network.resource",_("network.resource",{source:L,requestType:S,requestState:I,detail:O})),(P=h.analysis)===null||P===void 0||P.network(h.works,L,S,I,O)}),h.boundingMesh=dp(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=Gs(),h.models.push(new $a),h.lastModels=Gs(),h.lastWorks=Za([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new d.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new d.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new d.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new d.VideoTexture(e.videoInstance||nm()),A0(h.scene),A0(h.modelScene),h.state={mode:h.currentMode,workCode:h.pano.workCode,panoIndex:h.pano.panoIndex,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone(),distance:h.camera.pose.distance},h.stateSynced=!1,h._enablePostProcessing=!1,h._enableIOSEDR=!1,h._enableEDL=!1,h._enableHQ=!1,h.destroyed=!1,h.paused=!0,typeof window!="undefined"&&(e.play!==!1&&h.play(),h.stopAnimationLoop=dt.shared.add(function(L,S){for(var I=[],O=2;O<arguments.length;O++)I[O-2]=arguments[O];h.updateTime.apply(h,Et([L,S],I,!1))},!1,0,10));var v=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",_("vr.requestExit",{}))},y=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",y,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",y,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var b=0,x=e.plugins;b<x.length;b++){var w=x[b];if(typeof w=="function")w(h);else if(Array.isArray(w)){var E=w[0],M=w[1],C=w[2];if(typeof E=="function"){var R=E(h,C);typeof M=="string"&&(h.plugins[M]?h.throwError(new Error("plugin name ".concat(M," is exists."))):h.plugins[M]=R)}}}return h.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,rm(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.13"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Vi.decoderPath},set:function(e){Vi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Kn.transcoderPath},set:function(e){Kn.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new d.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(f){if(!(!(f instanceof d.Mesh)||f instanceof Tt)){var m=Object.keys(i).filter(function(h){return h===f.uuid})[0];if(m)if(s.meshOriginMaterialMap.set(m,f.material),s.meshReplaceMaterialMap.get(m))f.material=s.meshReplaceMaterialMap.get(m);else{var A=new d.ShaderMaterial({uniforms:{color:{value:i[m]}},vertexShader:`
|
|
2166
2166
|
void main() {
|
|
2167
2167
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
2168
2168
|
gl_Position = projectionMatrix * mvPosition;
|
|
@@ -2172,4 +2172,4 @@ void main() {
|
|
|
2172
2172
|
void main() {
|
|
2173
2173
|
gl_FragColor = vec4( color, 1.0 );
|
|
2174
2174
|
}
|
|
2175
|
-
`});A.depthTest=f.material.depthTest,A.side=f.material.side,s.meshReplaceMaterialMap.set(m,A),f.material=A}}});var l=this.renderer.getSize(new d.Vector2);this.camera.setViewOffset(l.width,l.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var u=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,u),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(f){!(f instanceof d.Mesh)||f instanceof Tt||s.meshOriginMaterialMap.get(f.uuid)&&(f.material=s.meshOriginMaterialMap.get(f.uuid))}),this.models.setMaterial({constantColor:null});var c=Object.keys(i).filter(function(f){return i[f].equals(new d.Color().setRGB(u[0]/255,u[1]/255,u[2]/255))})[0];return c||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete io.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),(e=this.renderer)===null||e===void 0||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var i=this.getElement();i&&i.parentNode&&i.parentNode.removeChild(i);var a=this.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((r=a.pano0)===null||r===void 0?void 0:r.map)&&a.pano1.map.dispose());for(var o=0,s=this.models;o<s.length;o++){var l=s[o];l.dispose()}this.models.length=0,this.models.setMaterial({pano0:null,pano1:null}),this.meshReplaceMaterialMap.forEach(function(u){u.dispose()}),this.meshOriginMaterialMap.forEach(function(u){u.dispose()}),this.renderer instanceof nn&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){var r;if(Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize){var i=new d.Vector2;(r=this.renderer)===null||r===void 0||r.getDrawingBufferSize(i),this.controller.updateRenderSize(i)}},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",_("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(e){this._enableIOSEDR!==e&&(this._enableIOSEDR=e,this.currentMode&&this.currentMode==="Panorama"&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"postProcessingType",{get:function(){return this.currentMode==="Panorama"&&this.enableIOSEDR&&this.enablePostProcessing?"luminance":this.currentMode==="Mapview"&&this.enableEDL?"edl":this.currentMode==="Mapview"&&this.enableHQ?"hq":null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this._enableEDL},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启EDL");this._enableEDL!==e&&(this._enableEDL=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this._enableHQ},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启HQ");this._enableHQ!==e&&(this._enableHQ=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return this._enablePostProcessing},set:function(e){this._enablePostProcessing!==e&&(this._enablePostProcessing=e),this.needsRender=!0,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var i=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),this.currentMode==="Panorama"&&(i=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),this.currentMode==="Model"&&(i=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),this.currentMode==="Floorplan"&&(i=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),this.currentMode==="Topview"&&(i=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.mapview),this.currentMode==="Mapview"&&(i=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),this.currentMode==="VRPanorama"&&(i=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(i=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&i&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof nn)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var i=this.getElement();if(i){e.appendChild(i),this.refresh(r);var a=window.getComputedStyle(e).position;a!=="relative"&&a!=="absolute"&&a!=="fixed"&&a!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){if(e===void 0&&(e={}),!!this.renderer){var i=this.getElement();if(i){var a=i.parentNode;if(a&&a.nodeName){var o=e.width,s=o===void 0?a.offsetWidth:o,l=e.height,u=l===void 0?a.offsetHeight:l;this.renderer instanceof nn&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,u))}var c=new d.Vector2;if(this.renderer.getDrawingBufferSize(c),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(c),this.modelRenderTarget.width!==c.x||this.modelRenderTarget.height!==c.y){this.modelRenderTarget.setSize(c.x,c.y),this.modelRenderTarget.depthTexture.dispose();var f=new d.DepthTexture(c.x,c.y);f.generateMipmaps=!1,f.format=d.DepthStencilFormat,f.type=d.UnsignedInt248Type,this.modelRenderTarget.depthTexture=f,this.modelRenderTarget.depthTexture.needsUpdate=!0}this.needsRender=!0,this.modelSceneNeedsRender=!0,this.render(Q,!0)}}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,i=e.latitude,a=e.fov,o=e.offset,s=e.distance;return{longitude:r,latitude:i,fov:a,offset:o.clone(),distance:s}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCamera(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.updateCameraWithKeyframes=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCameraWithKeyframes(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,i=e.latitude;return{longitude:r,latitude:i}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getResolvedObserver(this.pano);if(e){var r=new d.Object3D;return r.position.copy(e.position),r.quaternion.copy(e.quaternion),r.scale.set(1,1,1),r.matrix.compose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1,fp(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=Oa.get(this);if(!e)return w0;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!Eo.has(a))return w0}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,i,a){var o=this;if(a===void 0&&(a=!0),!this.renderer)throw new Error("renderer is not initialized");var s=this.lastLoadWorkTask.then(function(){return pp(e)?e.then(function(l){return o.load_(l,r,i,a)}):o.load_(e,r,i,a)});return this.lastLoadWorkTask=s.catch(function(l){o.throwError(l)}),s},t.prototype.load_=function(e,r,i,a){var o=this,s,l,u,c,f,m,A,h,p;a===void 0&&(a=!0);var g={};typeof i=="number"?g.duration=i:typeof i=="object"&&Object.assign(g,i),this.controller||(g.duration=0,g.effect="instant");var v=[];if(Array.isArray(e))for(var y=0,b=e;y<b.length;y++){var x=b[y];typeof x!="string"&&"work"in x?v.push(jn(x.work,x)):v.push(jn(x))}else v.push(jn(e));for(var w=Za(v),E=function(W){var ee=C,Z=new ho({allowHosts:W.allowHosts,get requestProxy(){return ee.requestProxy},get networkSubscribe(){return ee.networkSubscribe}});_h(W,Z)},C=this,M=0,R=w;M<R.length;M++){var L=R[M];E(L)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var S=w.initial,I=S.work.observers[0],O=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:S.work.workCode,panoIndex:0},P=(s=S.mode)!==null&&s!==void 0?s:I?"Panorama":"Mapview",F={};if(r==="inherit"){P=this.currentMode;var V=w.resolvedObservers[this.panoIndex];V?O={workCode:V.work.workCode,panoIndex:V.panoIndex}:typeof w.initial.panoIndex=="number"?O={workCode:w.initial.work.workCode,panoIndex:w.initial.panoIndex}:(P==="Panorama"||P==="VRPanorama"||P==="XRPanorama")&&(P="Mapview"),F={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:this.camera.pose.distance,offset:this.camera.pose.offset.clone()}}else if(r==="initial")typeof S.panoIndex=="number"&&(O={workCode:S.work.workCode,panoIndex:S.panoIndex}),S.mode&&(P=S.mode),F={longitude:S.longitude,latitude:S.latitude,fov:S.fov,distance:S.distance,offset:(l=S.offset)===null||l===void 0?void 0:l.clone()};else{if(P=(u=r.mode)!==null&&u!==void 0?u:this.currentMode,typeof r.panoIndex=="number"){var V=w.getResolvedObserver({workCode:(f=(c=r.workCode)!==null&&c!==void 0?c:S.work.workCode)!==null&&f!==void 0?f:"",panoIndex:r.panoIndex});V&&(O={workCode:V.work.workCode,panoIndex:V.panoIndex})}F={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var D=k(k(k({},O),{mode:P}),F);this.emit("works.request",_("works.request",{input:e,works:w,state:D,userAction:a}));var z=function(){var W,ee;o.pano=O;var Z=(W=g.duration)!==null&&W!==void 0?W:o.modeChangeDuration,ie="fly";(o.currentMode==="Panorama"||o.currentMode==="VRPanorama"||o.currentMode==="XRPanorama")&&o.currentMode===P&&(ie=(ee=g.effect)!==null&&ee!==void 0?ee:"fade");var te=k(k({initial:{state:D,currentState:o.getCurrentState(),duration:Z,effect:ie,userAction:a}},o.commonParams()),o.controllerInits[P]);if(o.controller&&o.currentMode===P)o.controller.updateWork(w,D,{effect:ie,duration:Z},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(P,te));else{var le=o.currentMode,oe=Ft[P].initAnimationEndState(te);if(o.controller)o.controller.destroy();else{var we=Ft[P].initAnimationEndState(te);o.camera.setFromPose(we),o.modelGroup.visible=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(P,te);var pe=_("mode.change",{prevMode:le,mode:P,state:oe,userAction:a});o.emit("mode.change",pe)}};if(Oa.set(this,w),!this.controller){var U=k(k({initial:{state:D,currentState:this.getCurrentState(),duration:(m=g.duration)!==null&&m!==void 0?m:this.modeChangeDuration,effect:(A=g.effect)!==null&&A!==void 0?A:"fade",userAction:a}},this.commonParams()),this.controllerInits[P]),q=Ft[P].initAnimationEndState(U);this.camera.setFromPose(q),this.emit("camera.update",_("camera.update",{state:this.getCurrentState(),userAction:a}))}this.updateConfiguration(g,!1);var K=Promise.resolve();if(P===t.Mode.Floorplan||P===t.Mode.Topview||P===t.Mode.Mapview||P===t.Mode.Model)K=this.loadModel(w,g).then(function(){o.needsRender=!0,o.modelSceneNeedsRender=!0,z(),o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))});else{if(!this.controller){var j=new d.Vector3,J=w.getResolvedObserver(O);J&&j.copy(J.position),this.camera.setFromPose({fov:F.fov,longitude:F.longitude,latitude:F.latitude,distance:F.distance,offset:(h=F.offset)!==null&&h!==void 0?h:j}),this.needsRender=!0,this.modelSceneNeedsRender=!0}z();var X=!1,Y=function(){o.works===w&&X===!1&&(o.needsRender=!0,o.modelSceneNeedsRender=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(w,g),X=!0)};this.controller.once("pano.arrived",Y),this.controller.once("pano.cancel",Y),setTimeout(Y,((p=g.duration)!==null&&p!==void 0?p:this.modeChangeDuration)+1e3)}return this.emit("works.load",_("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:w})),K.then(function(){return o.ready()}).then(function(){var W;o.emit("works.ready",_("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:w})),(W=o.analysis)===null||W===void 0||W.work(w)})},t.prototype.reset=function(){var e=this,r=this.lastLoadWorkTask.then(function(){return e.reset_()});return this.lastLoadWorkTask=r.catch(function(i){e.throwError(i)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var i;e.controller&&(e.controller.destroy(),e.controller=void 0);var a=e.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((i=a.pano0)===null||i===void 0?void 0:i.map)&&a.pano1.map.dispose()),e.models.setMaterial({pano0:null,pano1:null});for(var o=0,s=e.models;o<s.length;o++){var l=s[o];e.lastModels.push(l)}if(e.models.length=0,e.lastModels.length>0){for(var u=0,c=e.lastModels;u<c.length;u++){var l=c[u];e.modelGroup.remove(l),l.dispose(),e.needsRender=!0,e.modelSceneNeedsRender=!0}e.lastModels.length=0}e.lastWorks&&delete e.lastWorks,Oa.delete(e),e.currentMode="Panorama",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:b0,longitude:0,latitude:0,offset:new d.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.models.needsRender=!1,e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(l,u){var c,f,m,A;if(!s.renderer)throw new Error("renderer is not initialized.");r=k({},r);var h=0;s.controller&&(typeof i=="number"?h=i:h=(c=i==null?void 0:i.duration)!==null&&c!==void 0?c:s.modeChangeDuration);var p="fly";s.controller&&typeof i=="object"&&i.effect&&(p=i.effect);var g=typeof r.panoIndex=="number"?{workCode:(A=(f=r.workCode)!==null&&f!==void 0?f:(m=s.work)===null||m===void 0?void 0:m.workCode)!==null&&A!==void 0?A:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var v=new Error('mode "'.concat(e,'" is not existed'));s.throwError(v),u(v);return}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!s.models.loaded){var v=new Error("model is not ready.");s.throwError(v),u(v);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(g)){var v=new Error("PanoId ".concat(De(g)," not existed."));s.throwError(v),u(v);return}var y=s.controller,b=s.currentMode,x=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?Yt(s.pano,g)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(g,k({duration:h},r),a):s.controller.updateCamera(r,h,a).catch(Q):(Yt(s.pano,g)||(s.pano=g),s.controller.updateCamera(r,h,a).catch(Q));else{var E=k(k({},r),g),C=k(k({initial:{state:E,currentState:s.getCurrentState(),duration:h,effect:p,userAction:a}},s.commonParams()),s.controllerInits[e]),M=Ft[e].initAnimationEndState(C),R=_("mode.change.request",{prevMode:s.currentMode,mode:e,state:M,userAction:a});if(s.emit("mode.change.request",R),!R.defaultPrevented){y&&y.destroy(),s.controller=s.applyController(e,C);var L=_("mode.change",{prevMode:s.currentMode,mode:e,state:M,userAction:a});s.emit("mode.change",L)}}l()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),vp().then(function(){return x()}).catch(function(E){E instanceof Error&&(s.exitFullscreen(),s.throwError(E),u(E))});else if(e===t.Mode.XRPanorama){var w=dt.shared.getContext();w?w.end():mp().then(function(E){dt.shared.setContext(E),x()}).catch(function(E){E instanceof Error&&(s.throwError(E),u(E))})}else x()})},t.prototype.getPixels=function(e,r,i,a,o,s,l){if(!this.renderer)throw new Error("renderer is not initialized.");var u=this.renderer.getPixelRatio(),c=this.renderer.getRenderTarget(),f=this.renderer.getSize(new d.Vector2);e=Math.ceil(e),r=Math.ceil(r),i=Math.ceil(i),a=Math.ceil(a),o=Math.ceil(o!=null?o:u),s=s!=null?s:!1;var m=this.getPixelsRenderTarget;m.setSize(i*o,a*o),this.renderer.setRenderTarget(m),this.camera.setViewOffset(f.width,f.height,e,f.height-r-a,i,a),this.camera.pixelRatio=o,this.camera.resolution.set(i,a),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height;for(var A=0,h=this.scene.children;A<h.length;A++){var p=h[A];p instanceof d.Object3D&&p.traverseVisible(function(S){S.setResolution&&S.setResolution(i*o/u,a*o/u)})}this.controller?(this.controller.updateRenderSize(new d.Vector2(i*o,a*o)),this.controller.render(!0,this.postProcessingType)):(this.renderer.render(this.scene,this.camera),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!1,this.renderer.render(this.modelScene,this.camera),this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0);var g=i*o,v=a*o,y=g*v,b=y*4,x;try{if(l){if(l.length!==b)throw new Error("buffer length is not equals pixels ".concat(b))}else l=new Uint8Array(b);if(this.renderer.readRenderTargetPixels(m,0,0,i*o,a*o,l),s)for(var w=y/2,E=0,C=0,M=0,R=0;C<w;C++)for(R=(v-Math.floor(C/g)-1)*g+C%g,M=0;M<4;M++)E=l[C*4+M],l[C*4+M]=l[R*4+M],l[R*4+M]=E}catch(S){x=S}if(this.renderer.setRenderTarget(c),this.controller&&this.controller.updateRenderSize){var L=new d.Vector2;this.renderer.getDrawingBufferSize(L),this.controller.updateRenderSize(L)}if(this.camera.clearViewOffset(),this.camera.pixelRatio=u,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,x)throw x;return l},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},Object.defineProperty(t.prototype,"observers",{get:function(){return this.works.resolvedObservers},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){var i=this;if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var a=this.renderer.getSize(pm);this.scene.traverseVisible(function(o){o.setResolution&&o.setResolution(a.x,a.y)})}return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(i.onlyRenderIfNeeds?i.modelSceneNeedsRender:!0,i.postProcessingType),i.info={memory:k({},i.controller.renderer.info.memory),render:k({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:k({},i.renderer.info.memory),render:k({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&dm(i.renderer)),e&&dt.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,Et([e,r],o,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.updateTime(e,r),this.renderer){Kn.detectSupport(this.renderer);var l=this.models.loaded,u=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),l===!1&&this.models.loaded===!0&&this.emit("models.load",_("models.load",{models:this.models})),u===!1&&this.models.refined===!0&&this.emit("models.refined",_("models.refined",{models:this.models})),this.models.loaded){for(var c=0,f=this.models;c<f.length;c++){var m=f[c];m.parent!==this.modelGroup&&(this.modelGroup.add(m),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var A=0,h=this.lastModels;A<h.length;A++){var m=h[A];this.modelGroup.remove(m),m.dispose(),this.needsRender=!0,this.modelSceneNeedsRender=!0}this.lastModels.length=0}this.lastWorks&&delete this.lastWorks}this.lastModels.setMaterial(this.models.getMaterial()),this.lastModels.materialVersion=this.models.materialVersion,this.lastModels.update(this.renderer,this.camera,this.currentMode)}this.syncingState=!1;var p=new d.Vector2(512,512),g=new d.Vector2(512,512);this.renderer&&(this.renderer.getSize(p),p.x*=this.scissor.width,p.y*=this.scissor.height,this.renderer.getDrawingBufferSize(g),g.x*=this.scissor.width,g.y*=this.scissor.height);{for(var v=new d.Box3,y=new d.Box3,b=new d.Vector3(4,4,4),x=0,w=this.works.resolvedObservers;x<w.length;x++){var E=w[x];y.setFromCenterAndSize(E.position,b),v.union(y)}if(v.union(this.models.bounding),this.lastWorks)for(var C=0,M=this.lastWorks.resolvedObservers;C<M.length;C++){var E=M[C];y.setFromCenterAndSize(E.position,b),v.union(y)}v.union(this.lastModels.bounding),v.getCenter(this.boundingMesh.position),v.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(v),this.renderer&&this.boundingMesh.update(this.renderer,this.camera,this.model)}var R=_("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",R),!R.defaultPrevented){var L=[];yi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),gi.setFromProjectionMatrix(yi);for(var S=0,I=this.scene.children;S<I.length;S++){var O=I[S];O!==this.modelGroup&&O!==this.boundingMesh&&O.traverseVisible(function(U){if(U.setResolution&&U.setResolution(p.x,p.y),U.setTime&&U.setTime(e),U.mixer instanceof d.AnimationMixer){var q=x0.get(U.mixer);q||(q=new d.Clock,x0.set(U.mixer,q)),U.mixer.update(q.getDelta())}(U instanceof d.Mesh||U instanceof d.Line||U instanceof d.Points)&&(U instanceof d.ImmediateRenderObject||!U.frustumCulled||gi.intersectsObject(U))&&L.push(U)})}if(g.width*g.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var P=void 0;if(this.onlyRenderIfNeeds!==!0)P=this.render();else{if(this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.models.needsRender===!0&&(this.models.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.needsRender!==!0)for(var F=0,V=L;F<V.length;F++){var D=V[F],z=function(U){U.needsRender===!0?(U.needsRender=!1,a.needsRender=!0):U.mixer&&U.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};z(D),D.traverseAncestors(z)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(P=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",_("render",{needsRender:P!==void 0,info:this.info}))}this.needsRender=!1,this.modelSceneNeedsRender=!1}this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0)}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof nn&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={}),i===void 0&&(i=!0);var a=this,o=a.controller,s=a.renderer;if(!o)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!s)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var l=this.works.getResolvedObserver(e);if(!l)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var u={workCode:l.work.workCode,panoIndex:l.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(u,r,i):l&&(this.pano=u,this.once("initAnimation.start",function(c){r.moveStartCallback&&r.moveStartCallback(c.state)}),this.once("initAnimation.end",function(c){r.moveEndCallback&&r.moveEndCallback(c.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},i)),this.ready()},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=Q);var a=this.works.getResolvedObserver(e);if(!a)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var o=["right","left","up","down","front","back"],s=he();return Promise.all(o.map(function(l){var u=k({key:"pano.".concat(a.panoId,".").concat(l)},Dt(i.imageOptions,["size","format","quality","mappings"])),c=a.images[l],f=i.imageOptions.transform?i.imageOptions.transform(c,u):lt(c,u);return it(a.work).preload(f)})).then(function(){var l=he()-s;return r(l),l})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(this.models.length>0&&r){var i=this.camera.position,a=e.clone().sub(i),o=new d.Raycaster(i,a.clone().normalize());o.params.Points={threshold:.1};var s=this.models.intersectRaycaster(o)[0];if(s&&s.distance+.01<a.length())return null}var l=e.clone().project(this.camera);if(Math.abs(l.z)>1)return null;var u=this.renderer.getSize(new d.Vector2),c=u.x*this.scissor.width,f=u.y*this.scissor.height,m=u.x*this.scissor.left+(l.x+1)/2*c,A=u.y*(1-this.scissor.bottom-this.scissor.height)+(-l.y+1)/2*f;return new d.Vector2(m,A)},t.prototype.getRenderObjects=function(e){yi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),gi.setFromProjectionMatrix(yi),e||(e=this.scene);var r=[];return e.traverseVisible(function(i){(i instanceof d.Mesh||i instanceof d.Line||i instanceof d.Points)&&(i instanceof d.ImmediateRenderObject||!i.frustumCulled||gi.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return k(k({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,l,u,c,f,m,A,h;r===void 0&&(r=!1),i===void 0&&(i=!0),e=Object.assign({},e),e.offset&&!(e instanceof d.Vector3)&&(e.offset=new d.Vector3(e.offset.x,e.offset.y,e.offset.z));var p;typeof e.panoIndex=="number"&&(e.workCode?p={workCode:e.workCode,panoIndex:e.panoIndex}:p={workCode:(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",panoIndex:e.panoIndex});var g=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,v,y,b,x,w;if((e.mode===t.Mode.Floorplan||e.mode===t.Mode.Topview||e.mode===t.Mode.Mapview||e.mode===t.Mode.Model)&&!this.models.loaded){this.throwError(new Error("model is not ready."));return}if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==g){if(g==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var E={workCode:p==null?void 0:p.workCode,panoIndex:p==null?void 0:p.panoIndex};typeof e.longitude=="number"&&(E.longitude=e.longitude),typeof e.latitude=="number"&&(E.latitude=e.latitude),typeof e.fov=="number"&&(E.fov=e.fov),typeof e.distance=="number"&&(E.distance=e.distance),e.offset instanceof d.Vector3&&(E.offset=e.offset);var C=k(k({initial:{state:E,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[g]),M=Ft[g].initAnimationEndState(C);v=M.longitude,y=M.latitude,b=M.fov,x=M.offset,w=M.distance}else v=(l=e.longitude)!==null&&l!==void 0?l:this.state.longitude,y=(u=e.latitude)!==null&&u!==void 0?u:this.state.latitude,b=(c=e.fov)!==null&&c!==void 0?c:this.state.fov,x=(f=e.offset)!==null&&f!==void 0?f:this.state.offset,w=(m=e.distance)!==null&&m!==void 0?m:this.state.distance;var R={workCode:(p!=null?p:this.pano).workCode,panoIndex:(p!=null?p:this.pano).panoIndex,mode:g,longitude:v,latitude:y,fov:b,offset:x,distance:w};this.emit("state.set",_("state.set",{userAction:i,state:R})),zr(this.state,R)||(this.controller&&R.mode==="VRPanorama"&&R.mode!==this.state.mode?(ur(this.state,R),this.changeMode("VRPanorama")):this.controller&&R.mode==="XRPanorama"&&R.mode!==this.state.mode?(ur(this.state,R),this.changeMode("XRPanorama")):(ur(this.state,R),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===R.mode&&(this.syncingState=this.syncState(he(),0,r),this.syncingState&&((A=this.controller)===null||A===void 0||A.updateTime(he(),0),this.syncingState=!1)),this.emit("state.change",_("state.change",{userAction:i,state:this.state})),(h=this.analysis)===null||h===void 0||h.state(this.works,this.state)))},t.prototype.aroundScissor=function(e){if(this.renderer){if(this.state.mode==="XRPanorama"){e();return}var r=new d.Vector2,i=this.scissor.left!==0||this.scissor.bottom!==0||this.scissor.width!==1||this.scissor.height!==1;if(i){this.renderer.getSize(r);var a=Math.floor(r.x*this.scissor.left),o=Math.floor(r.y*this.scissor.bottom),s=Math.floor(r.x*this.scissor.width),l=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(a,o,s,l),this.renderer.setScissor(a,o,s,l),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,r.x,r.y),this.renderer.setScissor(0,0,r.x,r.y),this.renderer.setScissorTest(!1))}},t.prototype.syncState=function(e,r,i){i===void 0&&(i=!1);var a=this.stateSynced;if(this.stateSynced=!1,this.works.length===0||!this.controller)return!1;if(this.state.mode!==this.currentMode){var o={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,o,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Ft.Model){if(Ii(this.camera.pose.offset,this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,k(k({},s),{duration:i?0:void 0}),!1),!0}}else{var l={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!Yt(l,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(l,s,!1),!0}}if(this.controller instanceof Ft.Floorplan||this.controller instanceof Ft.Topview||this.controller instanceof Ft.Mapview){var u=1,c=.2,f=.2,m=Math.PI/45,A=i?this.state.fov:Ea(this.camera.pose.fov,this.state.fov,u),h=Math.abs(this.camera.pose.distance-this.state.distance),p=h>f*15?h/15:c,g=i?this.state.distance:Ea(this.camera.pose.distance,this.state.distance,p),v=this.camera.pose.offset.distanceTo(this.state.offset),y=v>f*15?v/15:f,b=i?new d.Vector3().copy(this.state.offset):hp(this.camera.pose.offset,this.state.offset,y),x=i?{longitude:this.state.longitude,latitude:this.state.latitude}:Xs({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},m),w=x.longitude,E=x.latitude;if(Lt(A,this.camera.pose.fov)||Ii(b,this.camera.pose.offset)||Lt(g,this.camera.pose.distance)||Lt(w,this.camera.pose.longitude,Math.PI*2)||Lt(E,this.camera.pose.latitude)){var C={x:b.x,y:b.y,z:b.z},M={fov:A};return Object.assign(C,{distance:g}),Object.assign(M,{longitude:w,latitude:E}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(M,0).catch(Q),this.controller.locationMotion.set(C,0).catch(Q),!0}}else{var R=1,L=Math.PI/45,A=i?this.state.fov:Ea(this.camera.pose.fov,this.state.fov,R),S=i?{longitude:this.state.longitude,latitude:this.state.latitude}:Xs({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},L),w=S.longitude,E=S.latitude,g=this.state.distance,b=new d.Vector3().copy(this.state.offset);if(Lt(g,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),Ii(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),Lt(w,this.camera.pose.longitude,Math.PI*2)||Lt(E,this.camera.pose.latitude)||Lt(A,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:w,latitude:E,fov:A},0).catch(Q),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",_("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var I=this.currentMode,O=I===t.Mode.Floorplan||I===t.Mode.Topview||I===t.Mode.Mapview||I===t.Mode.Model;if(!O||this.models.loaded){var P=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var F=0,V=P;F<V.length;F++){var D=V[F];this.controller instanceof Ft.Panorama&&D.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(D):D()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var a;r.readyCallbacks.push(Object.assign(i,{tile:(a=e.tile)!==null&&a!==void 0?a:!1}))})},t.prototype.requestFullscreen=function(){var e;if(zn){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,r){for(var i=this,a=[],o=function(g){var v=s.models.filter(function(b){var x;return((x=b.work)===null||x===void 0?void 0:x.workCode)===g.workCode})[0];if(v)v.work=g,a.push(v);else{var y=new $a({onError:function(b){i.emit("model.error",_("model.error",{work:g,model:y,error:b})),i.throwError(b)},onShownFloorChange:function(b){i.emit("model.changeShownFloor",_("model.changeShownFloor",{work:g,model:y,error:null}))},onLoad:function(){i.emit("model.load",_("model.load",{work:g,model:y,error:null}))}});a.push(y),s.emit("model.request",_("model.request",{work:g,model:y,error:null})),y.load(g,{textureOptions:s.textureOptions,"3d-tiles":r["3d-tiles"]})}},s=this,l=0,u=e;l<u.length;l++){var c=u[l];o(c)}if(this.models.length>0){for(var f=0,m=this.models;f<m.length;f++){var A=m[f];a.indexOf(A)===-1&&this.lastModels.push(A)}this.models.length=0}for(var h=0,p=a;h<p.length;h++){var A=p[h];this.models.push(A)}return this.renderer&&(this.models.loaded=!1),new Promise(function(g){i.on("models.load",function(){g()})})},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),models:this.models,works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,enableIOSEDR:this._enableIOSEDR,enableEDL:this.enableEDL,enableHQ:this.enableHQ,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene,modelRenderTarget:this.modelRenderTarget}},t.prototype.applyController=function(e,r){var i=this;if(!this.renderer)throw new Error("renderer is not initialized.");e!==t.Mode.Mapview&&(this.enableEDL=!1,this.enableHQ=!1);var a=Ft[e];this.currentMode=e;for(var o=new a(r),s=function(A){o.on(A,function(){for(var h=[],p=0;p<arguments.length;p++)h[p]=arguments[p];var g=i.emit.apply(i,Et([A],h,!1));if(g)return!1})},l=0,u=sl;l<u.length;l++){var c=u[l];s(c)}{var f=Ft[e].initAnimationEndState(r),m=r.initial.userAction;zr(this.state,f)||(ur(this.state,f),this.emit("state.change",_("state.change",{userAction:m,state:this.state}))),this.emit("currentState.change",_("currentState.change",{userAction:m,state:this.getCurrentState()}))}return o.on("camera.update",function(A){var h;if(i.controller){var p=i.controller.getTargetState();A.userAction&&i.syncingState===!1&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:A.userAction,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}i.emit("currentState.change",_("currentState.change",{userAction:A.userAction,state:i.getCurrentState()}))}),o.on("initAnimation.start",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("initAnimation.end",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h,p=A.state,g=A.userAction;i.pano={workCode:p.workCode,panoIndex:p.panoIndex},g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.arrived",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.cancel",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h=A.userAction;i.emit("currentState.change",_("currentState.change",{userAction:h,state:i.getCurrentState()}))}),o.on("pano.request",function(A){i.emit("pano.request",A),A.defaultPrevented||i.moveToPano(A.state,A.options,A.userAction)}),o.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),o.on("error",function(A){return i.throwError(A)}),o},t.prototype.removeEventListeners=function(){},t.prototype.getWorkResources=function(e){var r=this,i,a=this.models.find(function(u){return u.work===e}),o=((i=a==null?void 0:a.viewLayers)!==null&&i!==void 0?i:[]).map(function(u){return u.scene});function s(u){var c=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(u);if(c){var f=String(c[1]).trim().split(".").slice(1).reverse()[0];if(f)return f}return""}function l(u,c){c===void 0&&(c=0);var f=[];if(u.content&&u.content.uri){var m=s(u.content.uri);if(m==="json"){var A=lt(u.content.uri,{key:"model.".concat(c)});f.push({url:A,type:"tileset"})}else if(m==="at3d"&&u.extras[m]){var A=u.content.uri;f.push({url:A,type:"model"});for(var h=u.extras[m],p=h.textureArray,g=h.textureOptions,v=0,y=p;v<y.length;v++){var b=y[v],x=k({key:"texture.pbm"},Dt(g,["format","quality","size","sharpen","mappings"])),w=sn(b,g==null?void 0:g.transform,x);f.push({url:w,type:"texture"})}}else{var A=lt(u.content.uri,{key:"model.".concat(c)});f.push({url:A,type:"model"})}}if(u.children)for(var E=0;E<u.children.length;E++){var C=u.children[E];f.push.apply(f,l(C,E))}return f}return Promise.all(o.map(function(u){return u.loadAllTilesets()})).then(function(){for(var u=[],c=["right","left","up","down","front","back"],f=0,m=e.observers;f<m.length;f++){for(var A=m[f],h=0,p=c;h<p.length;h++){var g=p[h],v=k({key:"pano.".concat(De(A.pano),".").concat(g)},Dt(r.imageOptions,["size","format","quality","mappings"])),y=A.images[g],b=sn(y,r.imageOptions.transform,v);u.push({url:b,type:"pano"})}if(A.images.tiles)for(var x=0,w=A.images.tiles;x<w.length;x++)for(var E=w[x],C=0,M=c;C<M.length;C++)for(var g=M[C],R=E.size,L=Math.pow(2,E.level),S=1/L,I=0;I<L;I++)for(var O=0;O<L;O++){var P="".concat(A.panoId,".").concat(g,".").concat(E.level,".").concat(I,".").concat(O),v=k(k({key:"pano_tile.".concat(P)},Dt(r.imageOptions,["format","size","quality","sharpen","mappings"])),{size:E.scale>=1?void 0:R*S*E.scale,cut:[R*S*O,R*S*I,R*S,R*S]}),b=sn(E[g],r.imageOptions.transform,v);u.push({url:b,type:"pano_tile"})}}for(var F=0,V=o;F<V.length;F++){var D=V[F];D.tileset.url&&u.push({url:D.tileset.url,type:"model"}),u.push.apply(u,l(D.tileset.root))}return u})},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(qi),io={instances:{},constructor:cl};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:io});var vm=function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function i(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function a(){i(),e.textContent="VR NOT SUPPORTED"}function o(l){l.style.position="absolute",l.style.bottom="20px",l.style.padding="12px 6px",l.style.border="1px solid #fff",l.style.borderRadius="4px",l.style.background="rgba(0,0,0,0.1)",l.style.color="#fff",l.style.font="normal 13px sans-serif",l.style.textAlign="center",l.style.opacity="0.5",l.style.outline="none",l.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",o(e),navigator.xr.isSessionSupported("immersive-vr").then(function(l){l?r():a()}),e;var s=document.createElement("a");return window.isSecureContext===!1?(s.href=document.location.href.replace(/^http:/,"https:"),s.innerHTML="WEBXR NEEDS HTTPS"):(s.href="https://immersiveweb.dev/",s.innerHTML="WEBXR NOT AVAILABLE"),s.style.left="calc(50% - 90px)",s.style.width="180px",s.style.textDecoration="none",o(s),s},n}();exports.AnimationFrameLoop=dt;exports.Camera=q0;exports.CustomShader=Jc;exports.Fetcher=ho;exports.Five=cl;exports.InternalWebGLRenderer=nn;exports.IntersectMesh=Gi;exports.Model=$a;exports.ModelViewLayer=Mi;exports.NetworkSubscribe=B0;exports.PBMContainer=nd;exports.PBMGroup=_c;exports.PBMMesh=Tt;exports.PBMMeshMaterial=Jr;exports.PBMPointCloud=er;exports.PBMPointCloudMaterial=ii;exports.PROXY_CONTROLLER_EVENT_NAMES=sl;exports.PanoCircleMesh=Uu;exports.PanoCircleMeshCustom=ap;exports.PanoCircleMeshSolid=tp;exports.Scene=U0;exports.Subscribe=qi;exports.TextureLoader=Bn;exports.Tile=mo;exports.Tile3DModel=an;exports.TileCache=J0;exports.TileCubeTextureTarget=Ne;exports.TileNode=su;exports.TileRequestScheduler=_0;exports.Tileset=br;exports.Trajectory=X0;exports.TrajectoryNode=Ou;exports.Work=So;exports.XRButton=vm;exports.defaultImageURLTransform=lt;exports.defaultPbmParameters=Ae;exports.getViewportScale=ul;exports.imageSupport=k0;exports.isPanoId=O0;exports.loadAt3d=Mu;exports.loadB3dm=hu;exports.loadDome=Iu;exports.loadDomez=Pu;exports.loadGlb=Bu;exports.loadPbm=Eu;exports.loadPly=wo;exports.loadPnts=vu;exports.panoEqual=Yt;exports.panoParse=At;exports.panoStringify=De;exports.parseWork=jn;
|
|
2175
|
+
`});A.depthTest=f.material.depthTest,A.side=f.material.side,s.meshReplaceMaterialMap.set(m,A),f.material=A}}});var l=this.renderer.getSize(new d.Vector2);this.camera.setViewOffset(l.width,l.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var u=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,u),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(f){!(f instanceof d.Mesh)||f instanceof Tt||s.meshOriginMaterialMap.get(f.uuid)&&(f.material=s.meshOriginMaterialMap.get(f.uuid))}),this.models.setMaterial({constantColor:null});var c=Object.keys(i).filter(function(f){return i[f].equals(new d.Color().setRGB(u[0]/255,u[1]/255,u[2]/255))})[0];return c||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete io.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),(e=this.renderer)===null||e===void 0||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var i=this.getElement();i&&i.parentNode&&i.parentNode.removeChild(i);var a=this.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((r=a.pano0)===null||r===void 0?void 0:r.map)&&a.pano1.map.dispose());for(var o=0,s=this.models;o<s.length;o++){var l=s[o];l.dispose()}this.models.length=0,this.models.setMaterial({pano0:null,pano1:null}),this.meshReplaceMaterialMap.forEach(function(u){u.dispose()}),this.meshOriginMaterialMap.forEach(function(u){u.dispose()}),this.renderer instanceof nn&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){var r;if(Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize){var i=new d.Vector2;(r=this.renderer)===null||r===void 0||r.getDrawingBufferSize(i),this.controller.updateRenderSize(i)}},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",_("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(e){this._enableIOSEDR!==e&&(this._enableIOSEDR=e,this.currentMode&&this.currentMode==="Panorama"&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"postProcessingType",{get:function(){return this.currentMode==="Panorama"&&this.enableIOSEDR&&this.enablePostProcessing?"luminance":this.currentMode==="Mapview"&&this.enableEDL?"edl":this.currentMode==="Mapview"&&this.enableHQ?"hq":null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this._enableEDL},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启EDL");this._enableEDL!==e&&(this._enableEDL=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this._enableHQ},set:function(e){if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启HQ");this._enableHQ!==e&&(this._enableHQ=e,this.boundingMesh.visible=!e,this.needsRender=!0,this.modelSceneNeedsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return this._enablePostProcessing},set:function(e){this._enablePostProcessing!==e&&(this._enablePostProcessing=e),this.needsRender=!0,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var i=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),this.currentMode==="Panorama"&&(i=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),this.currentMode==="Model"&&(i=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),this.currentMode==="Floorplan"&&(i=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),this.currentMode==="Topview"&&(i=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.mapview),this.currentMode==="Mapview"&&(i=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),this.currentMode==="VRPanorama"&&(i=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(i=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&i&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof nn)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var i=this.getElement();if(i){e.appendChild(i),this.refresh(r);var a=window.getComputedStyle(e).position;a!=="relative"&&a!=="absolute"&&a!=="fixed"&&a!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){if(e===void 0&&(e={}),!!this.renderer){var i=this.getElement();if(i){var a=i.parentNode;if(a&&a.nodeName){var o=e.width,s=o===void 0?a.offsetWidth:o,l=e.height,u=l===void 0?a.offsetHeight:l;this.renderer instanceof nn&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,u))}var c=new d.Vector2;if(this.renderer.getDrawingBufferSize(c),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(c),this.modelRenderTarget.width!==c.x||this.modelRenderTarget.height!==c.y){this.modelRenderTarget.setSize(c.x,c.y),this.modelRenderTarget.depthTexture.dispose();var f=new d.DepthTexture(c.x,c.y);f.generateMipmaps=!1,f.format=d.DepthStencilFormat,f.type=d.UnsignedInt248Type,this.modelRenderTarget.depthTexture=f,this.modelRenderTarget.depthTexture.needsUpdate=!0}this.needsRender=!0,this.modelSceneNeedsRender=!0,this.render(Q,!0)}}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,i=e.latitude,a=e.fov,o=e.offset,s=e.distance;return{longitude:r,latitude:i,fov:a,offset:o.clone(),distance:s}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCamera(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.updateCameraWithKeyframes=function(e,r,i){return i===void 0&&(i=!0),this.controller?this.controller.updateCameraWithKeyframes(e,r,i):Promise.reject(new Error("controller is not initialized."))},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,i=e.latitude;return{longitude:r,latitude:i}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getResolvedObserver(this.pano);if(e){var r=new d.Object3D;return r.position.copy(e.position),r.quaternion.copy(e.quaternion),r.scale.set(1,1,1),r.matrix.compose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1,fp(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=Oa.get(this);if(!e)return w0;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!Eo.has(a))return w0}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,i,a){var o=this;if(a===void 0&&(a=!0),!this.renderer)throw new Error("renderer is not initialized");var s=this.lastLoadWorkTask.then(function(){return pp(e)?e.then(function(l){return o.load_(l,r,i,a)}):o.load_(e,r,i,a)});return this.lastLoadWorkTask=s.catch(function(l){o.throwError(l)}),s},t.prototype.load_=function(e,r,i,a){var o=this,s,l,u,c,f,m,A,h,p;a===void 0&&(a=!0);var g={};typeof i=="number"?g.duration=i:typeof i=="object"&&Object.assign(g,i),this.controller||(g.duration=0,g.effect="instant");var v=[];if(Array.isArray(e))for(var y=0,b=e;y<b.length;y++){var x=b[y];typeof x!="string"&&"work"in x?v.push(jn(x.work,x)):v.push(jn(x))}else v.push(jn(e));for(var w=Za(v),E=function(W){var ee=M,Z=new ho({allowHosts:W.allowHosts,get requestProxy(){return ee.requestProxy},get networkSubscribe(){return ee.networkSubscribe}});_h(W,Z)},M=this,C=0,R=w;C<R.length;C++){var L=R[C];E(L)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var S=w.initial,I=S.work.observers[0],O=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:S.work.workCode,panoIndex:0},P=(s=S.mode)!==null&&s!==void 0?s:I?"Panorama":"Mapview",F={};if(r==="inherit"){P=this.currentMode;var V=w.resolvedObservers[this.panoIndex];V?O={workCode:V.work.workCode,panoIndex:V.panoIndex}:typeof w.initial.panoIndex=="number"?O={workCode:w.initial.work.workCode,panoIndex:w.initial.panoIndex}:(P==="Panorama"||P==="VRPanorama"||P==="XRPanorama")&&(P="Mapview"),F={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:this.camera.pose.distance,offset:this.camera.pose.offset.clone()}}else if(r==="initial")typeof S.panoIndex=="number"&&(O={workCode:S.work.workCode,panoIndex:S.panoIndex}),S.mode&&(P=S.mode),F={longitude:S.longitude,latitude:S.latitude,fov:S.fov,distance:S.distance,offset:(l=S.offset)===null||l===void 0?void 0:l.clone()};else{if(P=(u=r.mode)!==null&&u!==void 0?u:this.currentMode,typeof r.panoIndex=="number"){var V=w.getResolvedObserver({workCode:(f=(c=r.workCode)!==null&&c!==void 0?c:S.work.workCode)!==null&&f!==void 0?f:"",panoIndex:r.panoIndex});V&&(O={workCode:V.work.workCode,panoIndex:V.panoIndex})}F={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var D=k(k(k({},O),{mode:P}),F);this.emit("works.request",_("works.request",{input:e,works:w,state:D,userAction:a}));var z=function(){var W,ee;o.pano=O;var Z=(W=g.duration)!==null&&W!==void 0?W:o.modeChangeDuration,ie="fly";(o.currentMode==="Panorama"||o.currentMode==="VRPanorama"||o.currentMode==="XRPanorama")&&o.currentMode===P&&(ie=(ee=g.effect)!==null&&ee!==void 0?ee:"fade");var te=k(k({initial:{state:D,currentState:o.getCurrentState(),duration:Z,effect:ie,userAction:a}},o.commonParams()),o.controllerInits[P]);if(o.controller&&o.currentMode===P)o.controller.updateWork(w,D,{effect:ie,duration:Z},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(P,te));else{var le=o.currentMode,oe=Ft[P].initAnimationEndState(te);if(o.controller)o.controller.destroy();else{var we=Ft[P].initAnimationEndState(te);o.camera.setFromPose(we),o.modelGroup.visible=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(P,te);var pe=_("mode.change",{prevMode:le,mode:P,state:oe,userAction:a});o.emit("mode.change",pe)}};if(Oa.set(this,w),!this.controller){var U=k(k({initial:{state:D,currentState:this.getCurrentState(),duration:(m=g.duration)!==null&&m!==void 0?m:this.modeChangeDuration,effect:(A=g.effect)!==null&&A!==void 0?A:"fade",userAction:a}},this.commonParams()),this.controllerInits[P]),q=Ft[P].initAnimationEndState(U);this.camera.setFromPose(q),this.emit("camera.update",_("camera.update",{state:this.getCurrentState(),userAction:a}))}this.updateConfiguration(g,!1);var K=Promise.resolve();if(P===t.Mode.Floorplan||P===t.Mode.Topview||P===t.Mode.Mapview||P===t.Mode.Model)K=this.loadModel(w,g).then(function(){o.needsRender=!0,o.modelSceneNeedsRender=!0,z(),o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))});else{if(!this.controller){var j=new d.Vector3,J=w.getResolvedObserver(O);J&&j.copy(J.position),this.camera.setFromPose({fov:F.fov,longitude:F.longitude,latitude:F.latitude,distance:F.distance,offset:(h=F.offset)!==null&&h!==void 0?h:j}),this.needsRender=!0,this.modelSceneNeedsRender=!0}z();var X=!1,Y=function(){o.works===w&&X===!1&&(o.needsRender=!0,o.modelSceneNeedsRender=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(w,g),X=!0)};this.controller.once("pano.arrived",Y),this.controller.once("pano.cancel",Y),setTimeout(Y,((p=g.duration)!==null&&p!==void 0?p:this.modeChangeDuration)+1e3)}return this.emit("works.load",_("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:w})),K.then(function(){return o.ready()}).then(function(){var W;o.emit("works.ready",_("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:w})),(W=o.analysis)===null||W===void 0||W.work(w)})},t.prototype.reset=function(){var e=this,r=this.lastLoadWorkTask.then(function(){return e.reset_()});return this.lastLoadWorkTask=r.catch(function(i){e.throwError(i)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var i;e.controller&&(e.controller.destroy(),e.controller=void 0);var a=e.models.getMaterial();a&&(a.pano0&&a.pano0.map.dispose(),a.pano1&&a.pano1.map!==((i=a.pano0)===null||i===void 0?void 0:i.map)&&a.pano1.map.dispose()),e.models.setMaterial({pano0:null,pano1:null,modelAlpha:1}),e.lastModels.setMaterial({pano0:null,pano1:null,modelAlpha:1}),e.renderer&&(e.models.update(e.renderer,e.camera,e.currentMode),e.lastModels.update(e.renderer,e.camera,e.currentMode),e.model&&e.boundingMesh.update(e.renderer,e.camera,e.model));for(var o=0,s=e.models;o<s.length;o++){var l=s[o];e.lastModels.push(l)}if(e.models.length=0,e.lastModels.length>0){for(var u=0,c=e.lastModels;u<c.length;u++){var l=c[u];e.modelGroup.remove(l),l.dispose(),e.needsRender=!0,e.modelSceneNeedsRender=!0}e.lastModels.length=0}e.lastWorks&&delete e.lastWorks,Oa.delete(e),e.currentMode="Panorama",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:b0,longitude:0,latitude:0,offset:new d.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.models.needsRender=!1,e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(l,u){var c,f,m,A;if(!s.renderer)throw new Error("renderer is not initialized.");r=k({},r);var h=0;s.controller&&(typeof i=="number"?h=i:h=(c=i==null?void 0:i.duration)!==null&&c!==void 0?c:s.modeChangeDuration);var p="fly";s.controller&&typeof i=="object"&&i.effect&&(p=i.effect);var g=typeof r.panoIndex=="number"?{workCode:(A=(f=r.workCode)!==null&&f!==void 0?f:(m=s.work)===null||m===void 0?void 0:m.workCode)!==null&&A!==void 0?A:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var v=new Error('mode "'.concat(e,'" is not existed'));s.throwError(v),u(v);return}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!s.models.loaded){var v=new Error("model is not ready.");s.throwError(v),u(v);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(g)){var v=new Error("PanoId ".concat(De(g)," not existed."));s.throwError(v),u(v);return}var y=s.controller,b=s.currentMode,x=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?Yt(s.pano,g)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(g,k({duration:h},r),a):s.controller.updateCamera(r,h,a).catch(Q):(Yt(s.pano,g)||(s.pano=g),s.controller.updateCamera(r,h,a).catch(Q));else{var E=k(k({},r),g),M=k(k({initial:{state:E,currentState:s.getCurrentState(),duration:h,effect:p,userAction:a}},s.commonParams()),s.controllerInits[e]),C=Ft[e].initAnimationEndState(M),R=_("mode.change.request",{prevMode:s.currentMode,mode:e,state:C,userAction:a});if(s.emit("mode.change.request",R),!R.defaultPrevented){y&&y.destroy(),s.controller=s.applyController(e,M);var L=_("mode.change",{prevMode:s.currentMode,mode:e,state:C,userAction:a});s.emit("mode.change",L)}}l()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),vp().then(function(){return x()}).catch(function(E){E instanceof Error&&(s.exitFullscreen(),s.throwError(E),u(E))});else if(e===t.Mode.XRPanorama){var w=dt.shared.getContext();w?w.end():mp().then(function(E){dt.shared.setContext(E),x()}).catch(function(E){E instanceof Error&&(s.throwError(E),u(E))})}else x()})},t.prototype.getPixels=function(e,r,i,a,o,s,l){if(!this.renderer)throw new Error("renderer is not initialized.");var u=this.renderer.getPixelRatio(),c=this.renderer.getRenderTarget(),f=this.renderer.getSize(new d.Vector2);e=Math.ceil(e),r=Math.ceil(r),i=Math.ceil(i),a=Math.ceil(a),o=Math.ceil(o!=null?o:u),s=s!=null?s:!1;var m=this.getPixelsRenderTarget;m.setSize(i*o,a*o),this.renderer.setRenderTarget(m),this.camera.setViewOffset(f.width,f.height,e,f.height-r-a,i,a),this.camera.pixelRatio=o,this.camera.resolution.set(i,a),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height;for(var A=0,h=this.scene.children;A<h.length;A++){var p=h[A];p instanceof d.Object3D&&p.traverseVisible(function(S){S.setResolution&&S.setResolution(i*o/u,a*o/u)})}this.controller?(this.controller.updateRenderSize(new d.Vector2(i*o,a*o)),this.controller.render(!0,this.postProcessingType)):(this.renderer.render(this.scene,this.camera),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!1,this.renderer.render(this.modelScene,this.camera),this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0);var g=i*o,v=a*o,y=g*v,b=y*4,x;try{if(l){if(l.length!==b)throw new Error("buffer length is not equals pixels ".concat(b))}else l=new Uint8Array(b);if(this.renderer.readRenderTargetPixels(m,0,0,i*o,a*o,l),s)for(var w=y/2,E=0,M=0,C=0,R=0;M<w;M++)for(R=(v-Math.floor(M/g)-1)*g+M%g,C=0;C<4;C++)E=l[M*4+C],l[M*4+C]=l[R*4+C],l[R*4+C]=E}catch(S){x=S}if(this.renderer.setRenderTarget(c),this.controller&&this.controller.updateRenderSize){var L=new d.Vector2;this.renderer.getDrawingBufferSize(L),this.controller.updateRenderSize(L)}if(this.camera.clearViewOffset(),this.camera.pixelRatio=u,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,x)throw x;return l},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},Object.defineProperty(t.prototype,"observers",{get:function(){return this.works.resolvedObservers},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){var i=this;if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var a=this.renderer.getSize(pm);this.scene.traverseVisible(function(o){o.setResolution&&o.setResolution(a.x,a.y)})}return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(i.onlyRenderIfNeeds?i.modelSceneNeedsRender:!0,i.postProcessingType),i.info={memory:k({},i.controller.renderer.info.memory),render:k({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:k({},i.renderer.info.memory),render:k({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&i.renderer.getRenderTarget()!==i.getPixelsRenderTarget&&dm(i.renderer)),e&&dt.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,Et([e,r],o,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.updateTime(e,r),this.renderer){Kn.detectSupport(this.renderer);var l=this.models.loaded,u=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),l===!1&&this.models.loaded===!0&&this.emit("models.load",_("models.load",{models:this.models})),u===!1&&this.models.refined===!0&&this.emit("models.refined",_("models.refined",{models:this.models})),this.models.loaded){for(var c=0,f=this.models;c<f.length;c++){var m=f[c];m.parent!==this.modelGroup&&(this.modelGroup.add(m),this.needsRender=!0,this.modelSceneNeedsRender=!0)}if(this.lastModels.length>0){for(var A=0,h=this.lastModels;A<h.length;A++){var m=h[A];this.modelGroup.remove(m),m.dispose(),this.needsRender=!0,this.modelSceneNeedsRender=!0}this.lastModels.length=0}this.lastWorks&&delete this.lastWorks}this.lastModels.setMaterial(this.models.getMaterial()),this.lastModels.materialVersion=this.models.materialVersion,this.lastModels.update(this.renderer,this.camera,this.currentMode)}this.syncingState=!1;var p=new d.Vector2(512,512),g=new d.Vector2(512,512);this.renderer&&(this.renderer.getSize(p),p.x*=this.scissor.width,p.y*=this.scissor.height,this.renderer.getDrawingBufferSize(g),g.x*=this.scissor.width,g.y*=this.scissor.height);{for(var v=new d.Box3,y=new d.Box3,b=new d.Vector3(4,4,4),x=0,w=this.works.resolvedObservers;x<w.length;x++){var E=w[x];y.setFromCenterAndSize(E.position,b),v.union(y)}if(v.union(this.models.bounding),this.lastWorks)for(var M=0,C=this.lastWorks.resolvedObservers;M<C.length;M++){var E=C[M];y.setFromCenterAndSize(E.position,b),v.union(y)}v.union(this.lastModels.bounding),v.getCenter(this.boundingMesh.position),v.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(v),this.renderer&&this.model&&this.boundingMesh.update(this.renderer,this.camera,this.model)}var R=_("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",R),!R.defaultPrevented){var L=[];yi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),gi.setFromProjectionMatrix(yi);for(var S=0,I=this.scene.children;S<I.length;S++){var O=I[S];O!==this.modelGroup&&O!==this.boundingMesh&&O.traverseVisible(function(U){if(U.setResolution&&U.setResolution(p.x,p.y),U.setTime&&U.setTime(e),U.mixer instanceof d.AnimationMixer){var q=x0.get(U.mixer);q||(q=new d.Clock,x0.set(U.mixer,q)),U.mixer.update(q.getDelta())}(U instanceof d.Mesh||U instanceof d.Line||U instanceof d.Points)&&(U instanceof d.ImmediateRenderObject||!U.frustumCulled||gi.intersectsObject(U))&&L.push(U)})}if(g.width*g.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var P=void 0;if(this.onlyRenderIfNeeds!==!0)P=this.render();else{if(this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.models.needsRender===!0&&(this.models.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.needsRender!==!0)for(var F=0,V=L;F<V.length;F++){var D=V[F],z=function(U){U.needsRender===!0?(U.needsRender=!1,a.needsRender=!0):U.mixer&&U.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};z(D),D.traverseAncestors(z)}(this.needsRender!==!1||this.modelSceneNeedsRender!==!1)&&(P=this.render())}this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("render")&&this.emit("render",_("render",{needsRender:P!==void 0,info:this.info}))}this.needsRender=!1,this.modelSceneNeedsRender=!1}this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0)}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof nn&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={}),i===void 0&&(i=!0);var a=this,o=a.controller,s=a.renderer;if(!o)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!s)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var l=this.works.getResolvedObserver(e);if(!l)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var u={workCode:l.work.workCode,panoIndex:l.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(u,r,i):l&&(this.pano=u,this.once("initAnimation.start",function(c){r.moveStartCallback&&r.moveStartCallback(c.state)}),this.once("initAnimation.end",function(c){r.moveEndCallback&&r.moveEndCallback(c.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},i)),this.ready()},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=Q);var a=this.works.getResolvedObserver(e);if(!a)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var o=["right","left","up","down","front","back"],s=he();return Promise.all(o.map(function(l){var u=k({key:"pano.".concat(a.panoId,".").concat(l)},Dt(i.imageOptions,["size","format","quality","mappings"])),c=a.images[l],f=i.imageOptions.transform?i.imageOptions.transform(c,u):lt(c,u);return it(a.work).preload(f)})).then(function(){var l=he()-s;return r(l),l})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(this.models.length>0&&r){var i=this.camera.position,a=e.clone().sub(i),o=new d.Raycaster(i,a.clone().normalize());o.params.Points={threshold:.1};var s=this.models.intersectRaycaster(o)[0];if(s&&s.distance+.01<a.length())return null}var l=e.clone().project(this.camera);if(Math.abs(l.z)>1)return null;var u=this.renderer.getSize(new d.Vector2),c=u.x*this.scissor.width,f=u.y*this.scissor.height,m=u.x*this.scissor.left+(l.x+1)/2*c,A=u.y*(1-this.scissor.bottom-this.scissor.height)+(-l.y+1)/2*f;return new d.Vector2(m,A)},t.prototype.getRenderObjects=function(e){yi.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),gi.setFromProjectionMatrix(yi),e||(e=this.scene);var r=[];return e.traverseVisible(function(i){(i instanceof d.Mesh||i instanceof d.Line||i instanceof d.Points)&&(i instanceof d.ImmediateRenderObject||!i.frustumCulled||gi.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return k(k({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,l,u,c,f,m,A,h;r===void 0&&(r=!1),i===void 0&&(i=!0),e=Object.assign({},e),e.offset&&!(e instanceof d.Vector3)&&(e.offset=new d.Vector3(e.offset.x,e.offset.y,e.offset.z));var p;typeof e.panoIndex=="number"&&(e.workCode?p={workCode:e.workCode,panoIndex:e.panoIndex}:p={workCode:(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",panoIndex:e.panoIndex});var g=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,v,y,b,x,w;if((e.mode===t.Mode.Floorplan||e.mode===t.Mode.Topview||e.mode===t.Mode.Mapview||e.mode===t.Mode.Model)&&!this.models.loaded){this.throwError(new Error("model is not ready."));return}if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==g){if(g==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var E={workCode:p==null?void 0:p.workCode,panoIndex:p==null?void 0:p.panoIndex};typeof e.longitude=="number"&&(E.longitude=e.longitude),typeof e.latitude=="number"&&(E.latitude=e.latitude),typeof e.fov=="number"&&(E.fov=e.fov),typeof e.distance=="number"&&(E.distance=e.distance),e.offset instanceof d.Vector3&&(E.offset=e.offset);var M=k(k({initial:{state:E,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[g]),C=Ft[g].initAnimationEndState(M);v=C.longitude,y=C.latitude,b=C.fov,x=C.offset,w=C.distance}else v=(l=e.longitude)!==null&&l!==void 0?l:this.state.longitude,y=(u=e.latitude)!==null&&u!==void 0?u:this.state.latitude,b=(c=e.fov)!==null&&c!==void 0?c:this.state.fov,x=(f=e.offset)!==null&&f!==void 0?f:this.state.offset,w=(m=e.distance)!==null&&m!==void 0?m:this.state.distance;var R={workCode:(p!=null?p:this.pano).workCode,panoIndex:(p!=null?p:this.pano).panoIndex,mode:g,longitude:v,latitude:y,fov:b,offset:x,distance:w};this.emit("state.set",_("state.set",{userAction:i,state:R})),zr(this.state,R)||(this.controller&&R.mode==="VRPanorama"&&R.mode!==this.state.mode?(ur(this.state,R),this.changeMode("VRPanorama")):this.controller&&R.mode==="XRPanorama"&&R.mode!==this.state.mode?(ur(this.state,R),this.changeMode("XRPanorama")):(ur(this.state,R),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===R.mode&&(this.syncingState=this.syncState(he(),0,r),this.syncingState&&((A=this.controller)===null||A===void 0||A.updateTime(he(),0),this.syncingState=!1)),this.emit("state.change",_("state.change",{userAction:i,state:this.state})),(h=this.analysis)===null||h===void 0||h.state(this.works,this.state)))},t.prototype.aroundScissor=function(e){if(this.renderer){if(this.state.mode==="XRPanorama"){e();return}var r=new d.Vector2,i=this.scissor.left!==0||this.scissor.bottom!==0||this.scissor.width!==1||this.scissor.height!==1;if(i){this.renderer.getSize(r);var a=Math.floor(r.x*this.scissor.left),o=Math.floor(r.y*this.scissor.bottom),s=Math.floor(r.x*this.scissor.width),l=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(a,o,s,l),this.renderer.setScissor(a,o,s,l),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,r.x,r.y),this.renderer.setScissor(0,0,r.x,r.y),this.renderer.setScissorTest(!1))}},t.prototype.syncState=function(e,r,i){i===void 0&&(i=!1);var a=this.stateSynced;if(this.stateSynced=!1,this.works.length===0||!this.controller)return!1;if(this.state.mode!==this.currentMode){var o={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,o,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Ft.Model){if(Ii(this.camera.pose.offset,this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,k(k({},s),{duration:i?0:void 0}),!1),!0}}else{var l={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!Yt(l,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(l,s,!1),!0}}if(this.controller instanceof Ft.Floorplan||this.controller instanceof Ft.Topview||this.controller instanceof Ft.Mapview){var u=1,c=.2,f=.2,m=Math.PI/45,A=i?this.state.fov:Ea(this.camera.pose.fov,this.state.fov,u),h=Math.abs(this.camera.pose.distance-this.state.distance),p=h>f*15?h/15:c,g=i?this.state.distance:Ea(this.camera.pose.distance,this.state.distance,p),v=this.camera.pose.offset.distanceTo(this.state.offset),y=v>f*15?v/15:f,b=i?new d.Vector3().copy(this.state.offset):hp(this.camera.pose.offset,this.state.offset,y),x=i?{longitude:this.state.longitude,latitude:this.state.latitude}:Xs({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},m),w=x.longitude,E=x.latitude;if(Lt(A,this.camera.pose.fov)||Ii(b,this.camera.pose.offset)||Lt(g,this.camera.pose.distance)||Lt(w,this.camera.pose.longitude,Math.PI*2)||Lt(E,this.camera.pose.latitude)){var M={x:b.x,y:b.y,z:b.z},C={fov:A};return Object.assign(M,{distance:g}),Object.assign(C,{longitude:w,latitude:E}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(C,0).catch(Q),this.controller.locationMotion.set(M,0).catch(Q),!0}}else{var R=1,L=Math.PI/45,A=i?this.state.fov:Ea(this.camera.pose.fov,this.state.fov,R),S=i?{longitude:this.state.longitude,latitude:this.state.latitude}:Xs({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},L),w=S.longitude,E=S.latitude,g=this.state.distance,b=new d.Vector3().copy(this.state.offset);if(Lt(g,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),Ii(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),Lt(w,this.camera.pose.longitude,Math.PI*2)||Lt(E,this.camera.pose.latitude)||Lt(A,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:w,latitude:E,fov:A},0).catch(Q),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",_("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var I=this.currentMode,O=I===t.Mode.Floorplan||I===t.Mode.Topview||I===t.Mode.Mapview||I===t.Mode.Model;if(!O||this.models.loaded){var P=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var F=0,V=P;F<V.length;F++){var D=V[F];this.controller instanceof Ft.Panorama&&D.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(D):D()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var a;r.readyCallbacks.push(Object.assign(i,{tile:(a=e.tile)!==null&&a!==void 0?a:!1}))})},t.prototype.requestFullscreen=function(){var e;if(zn){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,r){for(var i=this,a=[],o=function(g){var v=s.models.filter(function(b){var x;return((x=b.work)===null||x===void 0?void 0:x.workCode)===g.workCode})[0];if(v)v.work=g,a.push(v);else{var y=new $a({onError:function(b){i.emit("model.error",_("model.error",{work:g,model:y,error:b})),i.throwError(b)},onShownFloorChange:function(b){i.emit("model.changeShownFloor",_("model.changeShownFloor",{work:g,model:y,error:null}))},onLoad:function(){i.emit("model.load",_("model.load",{work:g,model:y,error:null}))}});a.push(y),s.emit("model.request",_("model.request",{work:g,model:y,error:null})),y.load(g,{textureOptions:s.textureOptions,"3d-tiles":r["3d-tiles"]})}},s=this,l=0,u=e;l<u.length;l++){var c=u[l];o(c)}if(this.models.length>0){for(var f=0,m=this.models;f<m.length;f++){var A=m[f];a.indexOf(A)===-1&&this.lastModels.push(A)}this.models.length=0}for(var h=0,p=a;h<p.length;h++){var A=p[h];this.models.push(A)}return this.renderer&&(this.models.loaded=!1),new Promise(function(g){i.on("models.load",function(){g()})})},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),models:this.models,works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,enableIOSEDR:this._enableIOSEDR,enableEDL:this.enableEDL,enableHQ:this.enableHQ,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene,modelRenderTarget:this.modelRenderTarget}},t.prototype.applyController=function(e,r){var i=this;if(!this.renderer)throw new Error("renderer is not initialized.");e!==t.Mode.Mapview&&(this.enableEDL=!1,this.enableHQ=!1);var a=Ft[e];this.currentMode=e;for(var o=new a(r),s=function(A){o.on(A,function(){for(var h=[],p=0;p<arguments.length;p++)h[p]=arguments[p];var g=i.emit.apply(i,Et([A],h,!1));if(g)return!1})},l=0,u=sl;l<u.length;l++){var c=u[l];s(c)}{var f=Ft[e].initAnimationEndState(r),m=r.initial.userAction;zr(this.state,f)||(ur(this.state,f),this.emit("state.change",_("state.change",{userAction:m,state:this.state}))),this.emit("currentState.change",_("currentState.change",{userAction:m,state:this.getCurrentState()}))}return o.on("camera.update",function(A){var h;if(i.controller){var p=i.controller.getTargetState();A.userAction&&i.syncingState===!1&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:A.userAction,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}i.emit("currentState.change",_("currentState.change",{userAction:A.userAction,state:i.getCurrentState()}))}),o.on("initAnimation.start",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("initAnimation.end",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h,p=A.state,g=A.userAction;i.pano={workCode:p.workCode,panoIndex:p.panoIndex},g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.arrived",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.cancel",function(A){var h,p=A.state,g=A.userAction;g&&i.state.mode===p.mode&&!zr(i.state,p)&&(ur(i.state,p),i.emit("state.change",_("state.change",{userAction:g,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),o.on("pano.moveTo",function(A){var h=A.userAction;i.emit("currentState.change",_("currentState.change",{userAction:h,state:i.getCurrentState()}))}),o.on("pano.request",function(A){i.emit("pano.request",A),A.defaultPrevented||i.moveToPano(A.state,A.options,A.userAction)}),o.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),o.on("error",function(A){return i.throwError(A)}),o},t.prototype.removeEventListeners=function(){},t.prototype.getWorkResources=function(e){var r=this,i,a=this.models.find(function(u){return u.work===e}),o=((i=a==null?void 0:a.viewLayers)!==null&&i!==void 0?i:[]).map(function(u){return u.scene});function s(u){var c=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(u);if(c){var f=String(c[1]).trim().split(".").slice(1).reverse()[0];if(f)return f}return""}function l(u,c){c===void 0&&(c=0);var f=[];if(u.content&&u.content.uri){var m=s(u.content.uri);if(m==="json"){var A=lt(u.content.uri,{key:"model.".concat(c)});f.push({url:A,type:"tileset"})}else if(m==="at3d"&&u.extras[m]){var A=u.content.uri;f.push({url:A,type:"model"});for(var h=u.extras[m],p=h.textureArray,g=h.textureOptions,v=0,y=p;v<y.length;v++){var b=y[v],x=k({key:"texture.pbm"},Dt(g,["format","quality","size","sharpen","mappings"])),w=sn(b,g==null?void 0:g.transform,x);f.push({url:w,type:"texture"})}}else{var A=lt(u.content.uri,{key:"model.".concat(c)});f.push({url:A,type:"model"})}}if(u.children)for(var E=0;E<u.children.length;E++){var M=u.children[E];f.push.apply(f,l(M,E))}return f}return Promise.all(o.map(function(u){return u.loadAllTilesets()})).then(function(){for(var u=[],c=["right","left","up","down","front","back"],f=0,m=e.observers;f<m.length;f++){for(var A=m[f],h=0,p=c;h<p.length;h++){var g=p[h],v=k({key:"pano.".concat(De(A.pano),".").concat(g)},Dt(r.imageOptions,["size","format","quality","mappings"])),y=A.images[g],b=sn(y,r.imageOptions.transform,v);u.push({url:b,type:"pano"})}if(A.images.tiles)for(var x=0,w=A.images.tiles;x<w.length;x++)for(var E=w[x],M=0,C=c;M<C.length;M++)for(var g=C[M],R=E.size,L=Math.pow(2,E.level),S=1/L,I=0;I<L;I++)for(var O=0;O<L;O++){var P="".concat(A.panoId,".").concat(g,".").concat(E.level,".").concat(I,".").concat(O),v=k(k({key:"pano_tile.".concat(P)},Dt(r.imageOptions,["format","size","quality","sharpen","mappings"])),{size:E.scale>=1?void 0:R*S*E.scale,cut:[R*S*O,R*S*I,R*S,R*S]}),b=sn(E[g],r.imageOptions.transform,v);u.push({url:b,type:"pano_tile"})}}for(var F=0,V=o;F<V.length;F++){var D=V[F];D.tileset.url&&u.push({url:D.tileset.url,type:"model"}),u.push.apply(u,l(D.tileset.root))}return u})},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(qi),io={instances:{},constructor:cl};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:io});var vm=function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function i(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function a(){i(),e.textContent="VR NOT SUPPORTED"}function o(l){l.style.position="absolute",l.style.bottom="20px",l.style.padding="12px 6px",l.style.border="1px solid #fff",l.style.borderRadius="4px",l.style.background="rgba(0,0,0,0.1)",l.style.color="#fff",l.style.font="normal 13px sans-serif",l.style.textAlign="center",l.style.opacity="0.5",l.style.outline="none",l.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",o(e),navigator.xr.isSessionSupported("immersive-vr").then(function(l){l?r():a()}),e;var s=document.createElement("a");return window.isSecureContext===!1?(s.href=document.location.href.replace(/^http:/,"https:"),s.innerHTML="WEBXR NEEDS HTTPS"):(s.href="https://immersiveweb.dev/",s.innerHTML="WEBXR NOT AVAILABLE"),s.style.left="calc(50% - 90px)",s.style.width="180px",s.style.textDecoration="none",o(s),s},n}();exports.AnimationFrameLoop=dt;exports.Camera=q0;exports.CustomShader=Jc;exports.Fetcher=ho;exports.Five=cl;exports.InternalWebGLRenderer=nn;exports.IntersectMesh=Gi;exports.Model=$a;exports.ModelViewLayer=Ci;exports.NetworkSubscribe=B0;exports.PBMContainer=nd;exports.PBMGroup=_c;exports.PBMMesh=Tt;exports.PBMMeshMaterial=Jr;exports.PBMPointCloud=er;exports.PBMPointCloudMaterial=ii;exports.PROXY_CONTROLLER_EVENT_NAMES=sl;exports.PanoCircleMesh=Uu;exports.PanoCircleMeshCustom=ap;exports.PanoCircleMeshSolid=tp;exports.Scene=U0;exports.Subscribe=qi;exports.TextureLoader=Bn;exports.Tile=mo;exports.Tile3DModel=an;exports.TileCache=J0;exports.TileCubeTextureTarget=Ne;exports.TileNode=su;exports.TileRequestScheduler=_0;exports.Tileset=br;exports.Trajectory=X0;exports.TrajectoryNode=Ou;exports.Work=So;exports.XRButton=vm;exports.defaultImageURLTransform=lt;exports.defaultPbmParameters=Ae;exports.getViewportScale=ul;exports.imageSupport=k0;exports.isPanoId=O0;exports.loadAt3d=Cu;exports.loadB3dm=hu;exports.loadDome=Iu;exports.loadDomez=Pu;exports.loadGlb=Bu;exports.loadPbm=Eu;exports.loadPly=wo;exports.loadPnts=vu;exports.panoEqual=Yt;exports.panoParse=At;exports.panoStringify=De;exports.parseWork=jn;
|