@realsee/five 6.0.0-alpha.64 → 6.0.0-alpha.65
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/five/index.js +66 -66
- package/five/index.mjs +1123 -1130
- 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/react/index.js +2 -2
- package/react/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-react.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 +20 -20
- 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: 12/
|
|
5
|
-
* Version: 6.0.0-alpha.
|
|
4
|
+
* Generated: 12/14/2023
|
|
5
|
+
* Version: 6.0.0-alpha.65
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
* No amendment to or modification of this Agreement will be binding unless in
|
|
253
253
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
254
254
|
* Agreement and all related documents shall be drafted in English.
|
|
255
|
-
*/"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Sn=require("three"),
|
|
255
|
+
*/"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Sn=require("three"),m0=require("protobufjs/minimal");function _s(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const d=_s(Sn),Or=_s(m0);var Ao=Number(d.REVISION);if(Ao<115||Ao>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');/**
|
|
256
256
|
* @license
|
|
257
257
|
* The 'jsrsasign'(RSA-Sign JavaScript Library) License
|
|
258
258
|
*
|
|
@@ -340,11 +340,11 @@
|
|
|
340
340
|
* https://code.google.com/p/crypto-js/wiki/License
|
|
341
341
|
* PART: ext/cryptojs
|
|
342
342
|
*/var ee={},ge=ge||function(n,t){var e={},r=e.lib={},i=r.Base=function(){function p(){}return{extend:function(v){p.prototype=this;var m=new p;return v&&m.mixIn(v),m.hasOwnProperty("init")||(m.init=function(){m.$super.init.apply(this,arguments)}),m.init.prototype=m,m.$super=this,m},create:function(){var v=this.extend();return v.init.apply(v,arguments),v},init:function(){},mixIn:function(v){for(var m in v)v.hasOwnProperty(m)&&(this[m]=v[m]);v.hasOwnProperty("toString")&&(this.toString=v.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=r.WordArray=i.extend({init:function(p,v){p=this.words=p||[],v!=t?this.sigBytes=v:this.sigBytes=p.length*4},toString:function(p){return(p||s).stringify(this)},concat:function(p){var v=this.words,m=p.words,A=this.sigBytes,y=p.sigBytes;if(this.clamp(),A%4)for(var f=0;f<y;f++){var g=m[f>>>2]>>>24-f%4*8&255;v[A+f>>>2]|=g<<24-(A+f)%4*8}else for(var f=0;f<y;f+=4)v[A+f>>>2]=m[f>>>2];return this.sigBytes+=y,this},clamp:function(){var p=this.words,v=this.sigBytes;p[v>>>2]&=4294967295<<32-v%4*8,p.length=n.ceil(v/4)},clone:function(){var p=i.clone.call(this);return p.words=this.words.slice(0),p},random:function(p){for(var v=[],m=0;m<p;m+=4)v.push(n.random()*4294967296|0);return new a.init(v,p)}}),o=e.enc={},s=o.Hex={stringify:function(p){for(var v=p.words,m=p.sigBytes,A=[],y=0;y<m;y++){var f=v[y>>>2]>>>24-y%4*8&255;A.push((f>>>4).toString(16)),A.push((f&15).toString(16))}return A.join("")},parse:function(p){for(var v=p.length,m=[],A=0;A<v;A+=2)m[A>>>3]|=parseInt(p.substr(A,2),16)<<24-A%8*4;return new a.init(m,v/2)}},u=o.Latin1={stringify:function(p){for(var v=p.words,m=p.sigBytes,A=[],y=0;y<m;y++){var f=v[y>>>2]>>>24-y%4*8&255;A.push(String.fromCharCode(f))}return A.join("")},parse:function(p){for(var v=p.length,m=[],A=0;A<v;A++)m[A>>>2]|=(p.charCodeAt(A)&255)<<24-A%4*8;return new a.init(m,v)}},c=o.Utf8={stringify:function(p){try{return decodeURIComponent(escape(u.stringify(p)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(p){return u.parse(unescape(encodeURIComponent(p)))}},l=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(p){typeof p=="string"&&(p=c.parse(p)),this._data.concat(p),this._nDataBytes+=p.sigBytes},_process:function(p){var v=this._data,m=v.words,A=v.sigBytes,y=this.blockSize,f=y*4,g=A/f;p?g=n.ceil(g):g=n.max((g|0)-this._minBufferSize,0);var b=g*y,w=n.min(b*4,A);if(b){for(var E=0;E<b;E+=y)this._doProcessBlock(m,E);var x=m.splice(0,b);v.sigBytes-=w}return new a.init(x,w)},clone:function(){var p=i.clone.call(this);return p._data=this._data.clone(),p},_minBufferSize:0});r.Hasher=l.extend({cfg:i.extend(),init:function(p){this.cfg=this.cfg.extend(p),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(p){return this._append(p),this._process(),this},finalize:function(p){p&&this._append(p);var v=this._doFinalize();return v},blockSize:512/32,_createHelper:function(p){return function(v,m){return new p.init(m).finalize(v)}},_createHmacHelper:function(p){return function(v,m){return new h.HMAC.init(p,m).finalize(v)}}});var h=e.algo={};return e}(Math);(function(n){for(var t=ge,v=t.lib,e=v.WordArray,r=v.Hasher,v=t.algo,i=[],a=[],o=function(A){return 4294967296*(A-(A|0))|0},s=2,u=0;64>u;){var c;e:{c=s;for(var l=n.sqrt(c),h=2;h<=l;h++)if(!(c%h)){c=!1;break e}c=!0}c&&(8>u&&(i[u]=o(n.pow(s,.5))),a[u]=o(n.pow(s,1/3)),u++),s++}var p=[],v=v.SHA256=r.extend({_doReset:function(){this._hash=new e.init(i.slice(0))},_doProcessBlock:function(m,A){for(var y=this._hash.words,f=y[0],g=y[1],b=y[2],w=y[3],E=y[4],x=y[5],M=y[6],C=y[7],I=0;64>I;I++){if(16>I)p[I]=m[A+I]|0;else{var P=p[I-15],S=p[I-2];p[I]=((P<<25|P>>>7)^(P<<14|P>>>18)^P>>>3)+p[I-7]+((S<<15|S>>>17)^(S<<13|S>>>19)^S>>>10)+p[I-16]}P=C+((E<<26|E>>>6)^(E<<21|E>>>11)^(E<<7|E>>>25))+(E&x^~E&M)+a[I]+p[I],S=((f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22))+(f&g^f&b^g&b),C=M,M=x,x=E,E=w+P|0,w=b,b=g,g=f,f=P+S|0}y[0]=y[0]+f|0,y[1]=y[1]+g|0,y[2]=y[2]+b|0,y[3]=y[3]+w|0,y[4]=y[4]+E|0,y[5]=y[5]+x|0,y[6]=y[6]+M|0,y[7]=y[7]+C|0},_doFinalize:function(){var m=this._data,A=m.words,y=8*this._nDataBytes,f=8*m.sigBytes;return A[f>>>5]|=128<<24-f%32,A[(f+64>>>9<<4)+14]=n.floor(y/4294967296),A[(f+64>>>9<<4)+15]=y,m.sigBytes=4*A.length,this._process(),this._hash},clone:function(){var m=r.clone.call(this);return m._hash=this._hash.clone(),m}});t.SHA256=r._createHelper(v),t.HmacSHA256=r._createHmacHelper(v)})(Math);ge.lib.Cipher||function(n){var v=ge,t=v.lib,e=t.Base,r=t.WordArray,i=t.BufferedBlockAlgorithm,a=v.enc.Base64,o=v.algo.EvpKDF,s=t.Cipher=i.extend({cfg:e.extend(),createEncryptor:function(A,y){return this.create(this._ENC_XFORM_MODE,A,y)},createDecryptor:function(A,y){return this.create(this._DEC_XFORM_MODE,A,y)},init:function(A,y,f){this.cfg=this.cfg.extend(f),this._xformMode=A,this._key=y,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(A){return this._append(A),this._process()},finalize:function(A){return A&&this._append(A),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(A){return{encrypt:function(y,f,g){return(typeof f=="string"?m:p).encrypt(A,y,f,g)},decrypt:function(y,f,g){return(typeof f=="string"?m:p).decrypt(A,y,f,g)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var h=v.mode={},u=function(A,y,f){var g=this._iv;g?this._iv=n:g=this._prevBlock;for(var b=0;b<f;b++)A[y+b]^=g[b]},c=(t.BlockCipherMode=e.extend({createEncryptor:function(A,y){return this.Encryptor.create(A,y)},createDecryptor:function(A,y){return this.Decryptor.create(A,y)},init:function(A,y){this._cipher=A,this._iv=y}})).extend();c.Encryptor=c.extend({processBlock:function(A,y){var f=this._cipher,g=f.blockSize;u.call(this,A,y,g),f.encryptBlock(A,y),this._prevBlock=A.slice(y,y+g)}}),c.Decryptor=c.extend({processBlock:function(A,y){var f=this._cipher,g=f.blockSize,b=A.slice(y,y+g);f.decryptBlock(A,y),u.call(this,A,y,g),this._prevBlock=b}}),h=h.CBC=c,c=(v.pad={}).Pkcs7={pad:function(A,y){for(var f=4*y,f=f-A.sigBytes%f,g=f<<24|f<<16|f<<8|f,b=[],w=0;w<f;w+=4)b.push(g);f=r.create(b,f),A.concat(f)},unpad:function(A){A.sigBytes-=A.words[A.sigBytes-1>>>2]&255}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:h,padding:c}),reset:function(){s.reset.call(this);var y=this.cfg,A=y.iv,y=y.mode;if(this._xformMode==this._ENC_XFORM_MODE)var f=y.createEncryptor;else f=y.createDecryptor,this._minBufferSize=1;this._mode=f.call(y,this,A&&A.words)},_doProcessBlock:function(A,y){this._mode.processBlock(A,y)},_doFinalize:function(){var A=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){A.pad(this._data,this.blockSize);var y=this._process(!0)}else y=this._process(!0),A.unpad(y);return y},blockSize:4});var l=t.CipherParams=e.extend({init:function(A){this.mixIn(A)},toString:function(A){return(A||this.formatter).stringify(this)}}),h=(v.format={}).OpenSSL={stringify:function(A){var y=A.ciphertext;return A=A.salt,(A?r.create([1398893684,1701076831]).concat(A).concat(y):y).toString(a)},parse:function(A){A=a.parse(A);var y=A.words;if(y[0]==1398893684&&y[1]==1701076831){var f=r.create(y.slice(2,4));y.splice(0,4),A.sigBytes-=16}return l.create({ciphertext:A,salt:f})}},p=t.SerializableCipher=e.extend({cfg:e.extend({format:h}),encrypt:function(A,y,f,g){g=this.cfg.extend(g);var b=A.createEncryptor(f,g);return y=b.finalize(y),b=b.cfg,l.create({ciphertext:y,key:f,iv:b.iv,algorithm:A,mode:b.mode,padding:b.padding,blockSize:A.blockSize,formatter:g.format})},decrypt:function(A,y,f,g){return g=this.cfg.extend(g),y=this._parse(y,g.format),A.createDecryptor(f,g).finalize(y.ciphertext)},_parse:function(A,y){return typeof A=="string"?y.parse(A,this):A}}),v=(v.kdf={}).OpenSSL={execute:function(A,y,f,g){return g||(g=r.random(8)),A=o.create({keySize:y+f}).compute(A,g),f=r.create(A.words.slice(y),4*f),A.sigBytes=4*y,l.create({key:A,iv:f,salt:g})}},m=t.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:v}),encrypt:function(A,y,f,g){return g=this.cfg.extend(g),f=g.kdf.execute(f,A.keySize,A.ivSize),g.iv=f.iv,A=p.encrypt.call(this,A,y,f.key,g),A.mixIn(f),A},decrypt:function(A,y,f,g){return g=this.cfg.extend(g),y=this._parse(y,g.format),f=g.kdf.execute(f,A.keySize,A.ivSize,y.salt),g.iv=f.iv,p.decrypt.call(this,A,y,f.key,g)}})}();(function(){for(var n=ge,t=n.lib.BlockCipher,x=n.algo,e=[],r=[],i=[],a=[],o=[],s=[],u=[],c=[],l=[],h=[],p=[],v=0;256>v;v++)p[v]=128>v?v<<1:v<<1^283;for(var m=0,A=0,v=0;256>v;v++){var y=A^A<<1^A<<2^A<<3^A<<4,y=y>>>8^y&255^99;e[m]=y,r[y]=m;var f=p[m],g=p[f],b=p[g],w=257*p[y]^16843008*y;i[m]=w<<24|w>>>8,a[m]=w<<16|w>>>16,o[m]=w<<8|w>>>24,s[m]=w,w=16843009*b^65537*g^257*f^16843008*m,u[y]=w<<24|w>>>8,c[y]=w<<16|w>>>16,l[y]=w<<8|w>>>24,h[y]=w,m?(m=f^p[p[p[b^f]]],A^=p[p[A]]):m=A=1}var E=[0,1,2,4,8,16,32,64,128,27,54],x=x.AES=t.extend({_doReset:function(){for(var I=this._key,M=I.words,C=I.sigBytes/4,I=4*((this._nRounds=C+6)+1),P=this._keySchedule=[],S=0;S<I;S++)if(S<C)P[S]=M[S];else{var F=P[S-1];S%C?6<C&&S%C==4&&(F=e[F>>>24]<<24|e[F>>>16&255]<<16|e[F>>>8&255]<<8|e[F&255]):(F=F<<8|F>>>24,F=e[F>>>24]<<24|e[F>>>16&255]<<16|e[F>>>8&255]<<8|e[F&255],F^=E[S/C|0]<<24),P[S]=P[S-C]^F}for(M=this._invKeySchedule=[],C=0;C<I;C++)S=I-C,F=C%4?P[S]:P[S-4],M[C]=4>C||4>=S?F:u[e[F>>>24]]^c[e[F>>>16&255]]^l[e[F>>>8&255]]^h[e[F&255]]},encryptBlock:function(M,C){this._doCryptBlock(M,C,this._keySchedule,i,a,o,s,e)},decryptBlock:function(M,C){var I=M[C+1];M[C+1]=M[C+3],M[C+3]=I,this._doCryptBlock(M,C,this._invKeySchedule,u,c,l,h,r),I=M[C+1],M[C+1]=M[C+3],M[C+3]=I},_doCryptBlock:function(M,C,I,P,S,F,k,O){for(var L=this._nRounds,G=M[C]^I[0],K=M[C+1]^I[1],Y=M[C+2]^I[2],X=M[C+3]^I[3],N=4,V=1;V<L;V++)var j=P[G>>>24]^S[K>>>16&255]^F[Y>>>8&255]^k[X&255]^I[N++],z=P[K>>>24]^S[Y>>>16&255]^F[X>>>8&255]^k[G&255]^I[N++],U=P[Y>>>24]^S[X>>>16&255]^F[G>>>8&255]^k[K&255]^I[N++],X=P[X>>>24]^S[G>>>16&255]^F[K>>>8&255]^k[Y&255]^I[N++],G=j,K=z,Y=U;j=(O[G>>>24]<<24|O[K>>>16&255]<<16|O[Y>>>8&255]<<8|O[X&255])^I[N++],z=(O[K>>>24]<<24|O[Y>>>16&255]<<16|O[X>>>8&255]<<8|O[G&255])^I[N++],U=(O[Y>>>24]<<24|O[X>>>16&255]<<16|O[G>>>8&255]<<8|O[K&255])^I[N++],X=(O[X>>>24]<<24|O[G>>>16&255]<<16|O[K>>>8&255]<<8|O[Y&255])^I[N++],M[C]=j,M[C+1]=z,M[C+2]=U,M[C+3]=X},keySize:8});n.AES=t._createHelper(x)})();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
343
|
-
*/var Fr;function ue(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 jt(){return new ue(null)}function b0(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 w0(n,t,e,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var u=this[n]&32767,c=this[n++]>>15,l=s*u+c*o;u=o*u+((l&32767)<<15)+e[r]+(i&1073741823),i=(u>>>30)+(l>>>15)+s*c+(i>>>30),e[r++]=u&1073741823}return i}function E0(n,t,e,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var u=this[n]&16383,c=this[n++]>>14,l=s*u+c*o;u=o*u+((l&16383)<<14)+e[r]+i,i=(u>>28)+(l>>14)+s*c,e[r++]=u&268435455}return i}typeof navigator<"u"&&navigator.appName=="Microsoft Internet Explorer"?(ue.prototype.am=w0,Fr=30):typeof navigator<"u"&&navigator.appName!="Netscape"?(ue.prototype.am=b0,Fr=26):(ue.prototype.am=E0,Fr=28);ue.prototype.DB=Fr;ue.prototype.DM=(1<<Fr)-1;ue.prototype.DV=1<<Fr;var La=52;ue.prototype.FV=Math.pow(2,La);ue.prototype.F1=La-Fr;ue.prototype.F2=2*Fr-La;var x0="0123456789abcdefghijklmnopqrstuvwxyz",Ei=new Array,hn,zt;hn=48;for(zt=0;zt<=9;++zt)Ei[hn++]=zt;hn=97;for(zt=10;zt<36;++zt)Ei[hn++]=zt;hn=65;for(zt=10;zt<36;++zt)Ei[hn++]=zt;function mr(n){return x0.charAt(n)}function M0(n,t){var e=Ei[n.charCodeAt(t)];return e??-1}function C0(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function I0(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 Da(n){var t=jt();return t.fromInt(n),t}function S0(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:M0(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&&ue.ZERO.subTo(this,this)}function T0(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function P0(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=mr(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+=mr(r));return i?a:"0"}function B0(){var n=jt();return ue.ZERO.subTo(this,n),n}function R0(){return this.s<0?this.negate():this}function F0(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 Na(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 O0(){return this.t<=0?0:this.DB*(this.t-1)+Na(this[this.t-1]^this.s&this.DM)}function k0(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 L0(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 D0(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 N0(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 Q0(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 V0(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&&ue.ZERO.subTo(t,t)}function U0(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 q0(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=jt());var a=jt(),o=this.s,s=n.s,u=this.DB-Na(r[r.t-1]);u>0?(r.lShiftTo(u,a),i.lShiftTo(u,e)):(r.copyTo(a),i.copyTo(e));var c=a.t,l=a[c-1];if(l!=0){var h=l*(1<<this.F1)+(c>1?a[c-2]>>this.F2:0),p=this.FV/h,v=(1<<this.F1)/h,m=1<<this.F2,A=e.t,y=A-c,f=t??jt();for(a.dlShiftTo(y,f),e.compareTo(f)>=0&&(e[e.t++]=1,e.subTo(f,e)),ue.ONE.dlShiftTo(c,f),f.subTo(a,a);a.t<c;)a[a.t++]=0;for(;--y>=0;){var g=e[--A]==l?this.DM:Math.floor(e[A]*p+(e[A-1]+m)*v);if((e[A]+=a.am(0,g,e,y,0,c))<g)for(a.dlShiftTo(y,f),e.subTo(f,e);e[A]<--g;)e.subTo(f,e)}t!=null&&(e.drShiftTo(c,t),o!=s&&ue.ZERO.subTo(t,t)),e.t=c,e.clamp(),u>0&&e.rShiftTo(u,e),o<0&&ue.ZERO.subTo(e,e)}}}function z0(n){var t=jt();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(ue.ZERO)>0&&n.subTo(t,t),t}function pn(n){this.m=n}function H0(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function j0(n){return n}function _0(n){n.divRemTo(this.m,null,n)}function G0(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function K0(n,t){n.squareTo(t),this.reduce(t)}pn.prototype.convert=H0;pn.prototype.revert=j0;pn.prototype.reduce=_0;pn.prototype.mulTo=G0;pn.prototype.sqrTo=K0;function W0(){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 vn(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 X0(n){var t=jt();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(ue.ZERO)>0&&this.m.subTo(t,t),t}function Y0(n){var t=jt();return n.copyTo(t),this.reduce(t),t}function J0(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 Z0(n,t){n.squareTo(t),this.reduce(t)}function $0(n,t,e){n.multiplyTo(t,e),this.reduce(e)}vn.prototype.convert=X0;vn.prototype.revert=Y0;vn.prototype.reduce=J0;vn.prototype.mulTo=$0;vn.prototype.sqrTo=Z0;function el(){return(this.t>0?this[0]&1:this.s)==0}function tl(n,t){if(n>4294967295||n<1)return ue.ONE;var e=jt(),r=jt(),i=t.convert(this),a=Na(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 rl(n,t){var e;return n<256||t.isEven()?e=new pn(t):e=new vn(t),this.exp(n,e)}ue.prototype.copyTo=C0;ue.prototype.fromInt=I0;ue.prototype.fromString=S0;ue.prototype.clamp=T0;ue.prototype.dlShiftTo=k0;ue.prototype.drShiftTo=L0;ue.prototype.lShiftTo=D0;ue.prototype.rShiftTo=N0;ue.prototype.subTo=Q0;ue.prototype.multiplyTo=V0;ue.prototype.squareTo=U0;ue.prototype.divRemTo=q0;ue.prototype.invDigit=W0;ue.prototype.isEven=el;ue.prototype.exp=tl;ue.prototype.toString=P0;ue.prototype.negate=B0;ue.prototype.abs=R0;ue.prototype.compareTo=F0;ue.prototype.bitLength=O0;ue.prototype.mod=z0;ue.prototype.modPowInt=rl;ue.ZERO=Da(0);ue.ONE=Da(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function nl(){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 il(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function al(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function ol(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=Da(e),i=jt(),a=jt(),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}ue.prototype.chunkSize=il;ue.prototype.toRadix=ol;ue.prototype.intValue=nl;ue.prototype.signum=al;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var sn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ws="=";function sl(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=sn.charAt(e>>6)+sn.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=sn.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=sn.charAt(e>>2)+sn.charAt((e&3)<<4));(r.length&3)>0;)r+=Ws;return r}function Qa(n){var t="",e,r=0,i,a;for(e=0;e<n.length&&n.charAt(e)!=Ws;++e)a=sn.indexOf(n.charAt(e)),!(a<0)&&(r==0?(t+=mr(a>>2),i=a&3,r=1):r==1?(t+=mr(i<<2|a>>4),i=a&15,r=2):r==2?(t+=mr(i),t+=mr(a>>2),i=a&3,r=3):(t+=mr(i<<2|a>>4),t+=mr(a&15),r=0));return r==1&&(t+=mr(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Ct(n,t){return new ue(n,t)}function ul(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 ue(e)}function yo(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 ll(n,t,e,r){var i=ee.crypto.MessageDigest,a=ee.crypto.Util,o=null;if(e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(A){return gr(a.hashHex(xi(A),o))}),n.length+2*r+2>t)throw"Message too long for RSA";var s="",u;for(u=0;u<t-n.length-2*r-2;u+=1)s+="\0";var c=e("")+s+""+n,l=new Array(r);new SecureRandom().nextBytes(l);var h=yo(l,c.length,e),p=[];for(u=0;u<c.length;u+=1)p[u]=c.charCodeAt(u)^h.charCodeAt(u);var v=yo(p,l.length,e),m=[0];for(u=0;u<l.length;u+=1)m[u+1]=l[u]^v.charCodeAt(u);return new ue(m.concat(p))}function Ce(){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 cl(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=Ct(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function dl(n){return n.modPowInt(this.e,this.n)}function fl(n){var t=ul(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 hl(n,t,e){var r=ll(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}Ce.prototype.doPublic=dl;Ce.prototype.setPublic=cl;Ce.prototype.encrypt=fl;Ce.prototype.encryptOAEP=hl;Ce.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function pl(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 bo(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 vl(n,t,e,r){var i=ee.crypto.MessageDigest,a=ee.crypto.Util,o=null;e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(y){return gr(a.hashHex(xi(y),o))}),n=n.toByteArray();var h;for(h=0;h<n.length;h+=1)n[h]&=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),u=n.substr(r+1),c=bo(u,r,e),l=[],h;for(h=0;h<s.length;h+=1)l[h]=s.charCodeAt(h)^c.charCodeAt(h);var p=bo(String.fromCharCode.apply(String,l),n.length-r,e),v=[];for(h=0;h<u.length;h+=1)v[h]=u.charCodeAt(h)^p.charCodeAt(h);if(v=String.fromCharCode.apply(String,v),v.substr(0,r)!==e(""))throw"Hash mismatch";v=v.substr(r);var m=v.indexOf(""),A=m!=-1?v.substr(0,m).lastIndexOf("\0"):-1;if(A+1!=m)throw"Malformed data";return v.substr(m+1)}function Al(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=Ct(n,16),this.e=parseInt(t,16),this.d=Ct(e,16);else throw"Invalid RSA private key"}function ml(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=Ct(n,16),this.e=parseInt(t,16),this.d=Ct(e,16),this.p=Ct(r,16),this.q=Ct(i,16),this.dmp1=Ct(a,16),this.dmq1=Ct(o,16),this.coeff=Ct(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function gl(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 yl(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=Ct(n,16),e=this.doPrivate(t);return e==null?null:pl(e,this.n.bitLength()+7>>3)}function bl(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=Ct(n,16),i=this.doPrivate(r);return i==null?null:vl(i,this.n.bitLength()+7>>3,t,e)}Ce.prototype.doPrivate=gl;Ce.prototype.setPrivate=Al;Ce.prototype.setPrivateEx=ml;Ce.prototype.decrypt=yl;Ce.prototype.decryptOAEP=bl;(typeof ee.lang>"u"||!ee.lang)&&(ee.lang={});ee.lang.String=function(){};function wl(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function nt(n){return Qa(wl(n))}function ir(n){return decodeURIComponent(Il(n))}function gr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function xi(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function El(n){return sl(n)}function xl(n){var t=El(n),e=t.replace(/(.{64})/g,`$1\r
|
|
344
|
-
`);return e=e.replace(/\r\n$/,""),e}function
|
|
343
|
+
*/var Fr;function ue(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 jt(){return new ue(null)}function g0(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 y0(n,t,e,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var u=this[n]&32767,c=this[n++]>>15,l=s*u+c*o;u=o*u+((l&32767)<<15)+e[r]+(i&1073741823),i=(u>>>30)+(l>>>15)+s*c+(i>>>30),e[r++]=u&1073741823}return i}function b0(n,t,e,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var u=this[n]&16383,c=this[n++]>>14,l=s*u+c*o;u=o*u+((l&16383)<<14)+e[r]+i,i=(u>>28)+(l>>14)+s*c,e[r++]=u&268435455}return i}typeof navigator<"u"&&navigator.appName=="Microsoft Internet Explorer"?(ue.prototype.am=y0,Fr=30):typeof navigator<"u"&&navigator.appName!="Netscape"?(ue.prototype.am=g0,Fr=26):(ue.prototype.am=b0,Fr=28);ue.prototype.DB=Fr;ue.prototype.DM=(1<<Fr)-1;ue.prototype.DV=1<<Fr;var La=52;ue.prototype.FV=Math.pow(2,La);ue.prototype.F1=La-Fr;ue.prototype.F2=2*Fr-La;var w0="0123456789abcdefghijklmnopqrstuvwxyz",Ei=new Array,hn,zt;hn=48;for(zt=0;zt<=9;++zt)Ei[hn++]=zt;hn=97;for(zt=10;zt<36;++zt)Ei[hn++]=zt;hn=65;for(zt=10;zt<36;++zt)Ei[hn++]=zt;function mr(n){return w0.charAt(n)}function E0(n,t){var e=Ei[n.charCodeAt(t)];return e??-1}function x0(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function M0(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 Da(n){var t=jt();return t.fromInt(n),t}function C0(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:E0(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&&ue.ZERO.subTo(this,this)}function I0(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function S0(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=mr(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+=mr(r));return i?a:"0"}function T0(){var n=jt();return ue.ZERO.subTo(this,n),n}function P0(){return this.s<0?this.negate():this}function B0(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 Na(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 R0(){return this.t<=0?0:this.DB*(this.t-1)+Na(this[this.t-1]^this.s&this.DM)}function F0(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 O0(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 k0(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 L0(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 D0(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 N0(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&&ue.ZERO.subTo(t,t)}function Q0(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 V0(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=jt());var a=jt(),o=this.s,s=n.s,u=this.DB-Na(r[r.t-1]);u>0?(r.lShiftTo(u,a),i.lShiftTo(u,e)):(r.copyTo(a),i.copyTo(e));var c=a.t,l=a[c-1];if(l!=0){var h=l*(1<<this.F1)+(c>1?a[c-2]>>this.F2:0),p=this.FV/h,v=(1<<this.F1)/h,m=1<<this.F2,A=e.t,y=A-c,f=t??jt();for(a.dlShiftTo(y,f),e.compareTo(f)>=0&&(e[e.t++]=1,e.subTo(f,e)),ue.ONE.dlShiftTo(c,f),f.subTo(a,a);a.t<c;)a[a.t++]=0;for(;--y>=0;){var g=e[--A]==l?this.DM:Math.floor(e[A]*p+(e[A-1]+m)*v);if((e[A]+=a.am(0,g,e,y,0,c))<g)for(a.dlShiftTo(y,f),e.subTo(f,e);e[A]<--g;)e.subTo(f,e)}t!=null&&(e.drShiftTo(c,t),o!=s&&ue.ZERO.subTo(t,t)),e.t=c,e.clamp(),u>0&&e.rShiftTo(u,e),o<0&&ue.ZERO.subTo(e,e)}}}function U0(n){var t=jt();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(ue.ZERO)>0&&n.subTo(t,t),t}function pn(n){this.m=n}function q0(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function z0(n){return n}function H0(n){n.divRemTo(this.m,null,n)}function j0(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function _0(n,t){n.squareTo(t),this.reduce(t)}pn.prototype.convert=q0;pn.prototype.revert=z0;pn.prototype.reduce=H0;pn.prototype.mulTo=j0;pn.prototype.sqrTo=_0;function G0(){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 vn(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 K0(n){var t=jt();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(ue.ZERO)>0&&this.m.subTo(t,t),t}function W0(n){var t=jt();return n.copyTo(t),this.reduce(t),t}function X0(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 Y0(n,t){n.squareTo(t),this.reduce(t)}function J0(n,t,e){n.multiplyTo(t,e),this.reduce(e)}vn.prototype.convert=K0;vn.prototype.revert=W0;vn.prototype.reduce=X0;vn.prototype.mulTo=J0;vn.prototype.sqrTo=Y0;function Z0(){return(this.t>0?this[0]&1:this.s)==0}function $0(n,t){if(n>4294967295||n<1)return ue.ONE;var e=jt(),r=jt(),i=t.convert(this),a=Na(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 el(n,t){var e;return n<256||t.isEven()?e=new pn(t):e=new vn(t),this.exp(n,e)}ue.prototype.copyTo=x0;ue.prototype.fromInt=M0;ue.prototype.fromString=C0;ue.prototype.clamp=I0;ue.prototype.dlShiftTo=F0;ue.prototype.drShiftTo=O0;ue.prototype.lShiftTo=k0;ue.prototype.rShiftTo=L0;ue.prototype.subTo=D0;ue.prototype.multiplyTo=N0;ue.prototype.squareTo=Q0;ue.prototype.divRemTo=V0;ue.prototype.invDigit=G0;ue.prototype.isEven=Z0;ue.prototype.exp=$0;ue.prototype.toString=S0;ue.prototype.negate=T0;ue.prototype.abs=P0;ue.prototype.compareTo=B0;ue.prototype.bitLength=R0;ue.prototype.mod=U0;ue.prototype.modPowInt=el;ue.ZERO=Da(0);ue.ONE=Da(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function tl(){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 rl(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function nl(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function il(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=Da(e),i=jt(),a=jt(),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}ue.prototype.chunkSize=rl;ue.prototype.toRadix=il;ue.prototype.intValue=tl;ue.prototype.signum=nl;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var sn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gs="=";function al(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=sn.charAt(e>>6)+sn.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=sn.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=sn.charAt(e>>2)+sn.charAt((e&3)<<4));(r.length&3)>0;)r+=Gs;return r}function Qa(n){var t="",e,r=0,i,a;for(e=0;e<n.length&&n.charAt(e)!=Gs;++e)a=sn.indexOf(n.charAt(e)),!(a<0)&&(r==0?(t+=mr(a>>2),i=a&3,r=1):r==1?(t+=mr(i<<2|a>>4),i=a&15,r=2):r==2?(t+=mr(i),t+=mr(a>>2),i=a&3,r=3):(t+=mr(i<<2|a>>4),t+=mr(a&15),r=0));return r==1&&(t+=mr(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Ct(n,t){return new ue(n,t)}function ol(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 ue(e)}function mo(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 sl(n,t,e,r){var i=ee.crypto.MessageDigest,a=ee.crypto.Util,o=null;if(e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(A){return gr(a.hashHex(xi(A),o))}),n.length+2*r+2>t)throw"Message too long for RSA";var s="",u;for(u=0;u<t-n.length-2*r-2;u+=1)s+="\0";var c=e("")+s+""+n,l=new Array(r);new SecureRandom().nextBytes(l);var h=mo(l,c.length,e),p=[];for(u=0;u<c.length;u+=1)p[u]=c.charCodeAt(u)^h.charCodeAt(u);var v=mo(p,l.length,e),m=[0];for(u=0;u<l.length;u+=1)m[u+1]=l[u]^v.charCodeAt(u);return new ue(m.concat(p))}function Ce(){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 ul(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=Ct(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function ll(n){return n.modPowInt(this.e,this.n)}function cl(n){var t=ol(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 dl(n,t,e){var r=sl(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}Ce.prototype.doPublic=ll;Ce.prototype.setPublic=ul;Ce.prototype.encrypt=cl;Ce.prototype.encryptOAEP=dl;Ce.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function fl(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 go(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 hl(n,t,e,r){var i=ee.crypto.MessageDigest,a=ee.crypto.Util,o=null;e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(y){return gr(a.hashHex(xi(y),o))}),n=n.toByteArray();var h;for(h=0;h<n.length;h+=1)n[h]&=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),u=n.substr(r+1),c=go(u,r,e),l=[],h;for(h=0;h<s.length;h+=1)l[h]=s.charCodeAt(h)^c.charCodeAt(h);var p=go(String.fromCharCode.apply(String,l),n.length-r,e),v=[];for(h=0;h<u.length;h+=1)v[h]=u.charCodeAt(h)^p.charCodeAt(h);if(v=String.fromCharCode.apply(String,v),v.substr(0,r)!==e(""))throw"Hash mismatch";v=v.substr(r);var m=v.indexOf(""),A=m!=-1?v.substr(0,m).lastIndexOf("\0"):-1;if(A+1!=m)throw"Malformed data";return v.substr(m+1)}function pl(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=Ct(n,16),this.e=parseInt(t,16),this.d=Ct(e,16);else throw"Invalid RSA private key"}function vl(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=Ct(n,16),this.e=parseInt(t,16),this.d=Ct(e,16),this.p=Ct(r,16),this.q=Ct(i,16),this.dmp1=Ct(a,16),this.dmq1=Ct(o,16),this.coeff=Ct(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function Al(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 ml(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=Ct(n,16),e=this.doPrivate(t);return e==null?null:fl(e,this.n.bitLength()+7>>3)}function gl(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=Ct(n,16),i=this.doPrivate(r);return i==null?null:hl(i,this.n.bitLength()+7>>3,t,e)}Ce.prototype.doPrivate=Al;Ce.prototype.setPrivate=pl;Ce.prototype.setPrivateEx=vl;Ce.prototype.decrypt=ml;Ce.prototype.decryptOAEP=gl;(typeof ee.lang>"u"||!ee.lang)&&(ee.lang={});ee.lang.String=function(){};function yl(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function nt(n){return Qa(yl(n))}function ir(n){return decodeURIComponent(Ml(n))}function gr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function xi(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function bl(n){return al(n)}function wl(n){var t=bl(n),e=t.replace(/(.{64})/g,`$1\r
|
|
344
|
+
`);return e=e.replace(/\r\n$/,""),e}function El(n){var t=n.replace(/[^0-9A-Za-z\/+=]*/g,""),e=Qa(t);return e}function xl(n,t){var e=wl(n);return"-----BEGIN "+t+`-----\r
|
|
345
345
|
`+e+`\r
|
|
346
346
|
-----END `+t+`-----\r
|
|
347
|
-
`}function Xr(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 [^-]+-----[^]*$/,"")),Ml(n)}function Il(n){return n.replace(/(..)/g,"%$1")}function Sl(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 wo(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{throw t}}else return n.length==32?Sl(n):n}function Tl(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,u=128|o&63;return ir(s.toString(16)+u.toString(16))}var s=224|(a&240)>>4,u=128|(a&15)<<2|(o&192)>>6,c=128|o&63;return ir(s.toString(16)+u.toString(16)+c.toString(16))}var e=n.match(/.{4}/g),r=e.map(t);return r.join("")}ee.lang.String.isHex=function(n){return Xs(n)};function Xs(n){return!!(n.length%2==0&&(n.match(/^[0-9a-f]+$/)||n.match(/^[0-9A-F]+$/)))}ee.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 Eo(n){return n.length%2==1?"0"+n:n.substr(0,1)>"7"?"00"+n:n}function Pl(n){if(!Xs(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=[],u="",o=0;o<a.length;o++)a[o]&128?u=u+xo((a[o]&127).toString(2),7):(u=u+xo((a[o]&127).toString(2),7),s.push(new String(parseInt(u,2))),u="");var c=t.join(".");return s.length>0&&(c=c+"."+s.join(".")),c}catch{return null}}var xo=function(n,t,e){return e==null&&(e="0"),n.length>=t?n:new Array(t-n.length+1).join(e)+n};function Bl(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{return-1}}(typeof ee.crypto>"u"||!ee.crypto)&&(ee.crypto={});ee.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:ge.algo.MD5,sha1:ge.algo.SHA1,sha224:ge.algo.SHA224,sha256:ge.algo.SHA256,sha384:ge.algo.SHA384,sha512:ge.algo.SHA512,ripemd160:ge.algo.RIPEMD160},this.hashString=function(n,t){var e=new ee.crypto.MessageDigest({alg:t});return e.digestString(n)},this.hashHex=function(n,t){var e=new ee.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")}};ee.crypto.MessageDigest=function(n){this.setAlgAndProvider=function(t,e){if(t=ee.crypto.MessageDigest.getCanonicalAlgName(t),t!==null&&e===void 0&&(e=ee.crypto.Util.DEFAULTPROVIDER[t]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)!=-1&&e=="cryptojs"){try{this.md=ee.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=ge.enc.Hex.parse(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return r.toString(ge.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=ee.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))};ee.crypto.MessageDigest.getCanonicalAlgName=function(n){return typeof n=="string"&&(n=n.toLowerCase(),n=n.replace(/-/,"")),n};ee.crypto.MessageDigest.getHashLength=function(n){var t=ee.crypto.MessageDigest,e=t.getCanonicalAlgName(n);if(t.HASHLENGTH[e]===void 0)throw"not supported algorithm: "+n;return t.HASHLENGTH[e]};ee.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20};ee.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 ee.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=Kr.getKey(i):o=Kr.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 Ce&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,i,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof Ce&&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=ee.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=Kr.getKey(n.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}};ee.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 Kr=function(){var n=function(m,A,y){return r(ge.AES,m,A,y)},t=function(m,A,y){return r(ge.TripleDES,m,A,y)},e=function(m,A,y){return r(ge.DES,m,A,y)},r=function(m,A,y,f){var g=ge.enc.Hex.parse(A),b=ge.enc.Hex.parse(y),w=ge.enc.Hex.parse(f),E={};E.key=b,E.iv=w,E.ciphertext=g;var x=m.decrypt(E,b,{iv:w});return ge.enc.Hex.stringify(x)},i=function(m,A,y){return s(ge.AES,m,A,y)},a=function(m,A,y){return s(ge.TripleDES,m,A,y)},o=function(m,A,y){return s(ge.DES,m,A,y)},s=function(m,A,y,f){var g=ge.enc.Hex.parse(A),b=ge.enc.Hex.parse(y),w=ge.enc.Hex.parse(f),E=m.encrypt(g,b,{iv:w}),x=ge.enc.Hex.parse(E.toString()),M=ge.enc.Base64.stringify(x);return M},u={"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}},c=function(m){var A=ge.lib.WordArray.random(m),y=ge.enc.Hex.stringify(A);return y},l=function(m){var A={},y=m.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));y&&(A.cipher=y[1],A.ivsalt=y[2]);var f=m.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));f&&(A.type=f[1]);var g=-1,b=0;m.indexOf(`\r
|
|
347
|
+
`}function Xr(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 [^-]+-----[^]*$/,"")),El(n)}function Ml(n){return n.replace(/(..)/g,"%$1")}function Cl(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 yo(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{throw t}}else return n.length==32?Cl(n):n}function Il(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,u=128|o&63;return ir(s.toString(16)+u.toString(16))}var s=224|(a&240)>>4,u=128|(a&15)<<2|(o&192)>>6,c=128|o&63;return ir(s.toString(16)+u.toString(16)+c.toString(16))}var e=n.match(/.{4}/g),r=e.map(t);return r.join("")}ee.lang.String.isHex=function(n){return Ks(n)};function Ks(n){return!!(n.length%2==0&&(n.match(/^[0-9a-f]+$/)||n.match(/^[0-9A-F]+$/)))}ee.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 bo(n){return n.length%2==1?"0"+n:n.substr(0,1)>"7"?"00"+n:n}function Sl(n){if(!Ks(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=[],u="",o=0;o<a.length;o++)a[o]&128?u=u+wo((a[o]&127).toString(2),7):(u=u+wo((a[o]&127).toString(2),7),s.push(new String(parseInt(u,2))),u="");var c=t.join(".");return s.length>0&&(c=c+"."+s.join(".")),c}catch{return null}}var wo=function(n,t,e){return e==null&&(e="0"),n.length>=t?n:new Array(t-n.length+1).join(e)+n};function Tl(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{return-1}}(typeof ee.crypto>"u"||!ee.crypto)&&(ee.crypto={});ee.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:ge.algo.MD5,sha1:ge.algo.SHA1,sha224:ge.algo.SHA224,sha256:ge.algo.SHA256,sha384:ge.algo.SHA384,sha512:ge.algo.SHA512,ripemd160:ge.algo.RIPEMD160},this.hashString=function(n,t){var e=new ee.crypto.MessageDigest({alg:t});return e.digestString(n)},this.hashHex=function(n,t){var e=new ee.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")}};ee.crypto.MessageDigest=function(n){this.setAlgAndProvider=function(t,e){if(t=ee.crypto.MessageDigest.getCanonicalAlgName(t),t!==null&&e===void 0&&(e=ee.crypto.Util.DEFAULTPROVIDER[t]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)!=-1&&e=="cryptojs"){try{this.md=ee.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=ge.enc.Hex.parse(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return r.toString(ge.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=ee.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))};ee.crypto.MessageDigest.getCanonicalAlgName=function(n){return typeof n=="string"&&(n=n.toLowerCase(),n=n.replace(/-/,"")),n};ee.crypto.MessageDigest.getHashLength=function(n){var t=ee.crypto.MessageDigest,e=t.getCanonicalAlgName(n);if(t.HASHLENGTH[e]===void 0)throw"not supported algorithm: "+n;return t.HASHLENGTH[e]};ee.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20};ee.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 ee.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=Kr.getKey(i):o=Kr.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 Ce&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,i,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof Ce&&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=ee.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=Kr.getKey(n.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}};ee.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 Kr=function(){var n=function(m,A,y){return r(ge.AES,m,A,y)},t=function(m,A,y){return r(ge.TripleDES,m,A,y)},e=function(m,A,y){return r(ge.DES,m,A,y)},r=function(m,A,y,f){var g=ge.enc.Hex.parse(A),b=ge.enc.Hex.parse(y),w=ge.enc.Hex.parse(f),E={};E.key=b,E.iv=w,E.ciphertext=g;var x=m.decrypt(E,b,{iv:w});return ge.enc.Hex.stringify(x)},i=function(m,A,y){return s(ge.AES,m,A,y)},a=function(m,A,y){return s(ge.TripleDES,m,A,y)},o=function(m,A,y){return s(ge.DES,m,A,y)},s=function(m,A,y,f){var g=ge.enc.Hex.parse(A),b=ge.enc.Hex.parse(y),w=ge.enc.Hex.parse(f),E=m.encrypt(g,b,{iv:w}),x=ge.enc.Hex.parse(E.toString()),M=ge.enc.Base64.stringify(x);return M},u={"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}},c=function(m){var A=ge.lib.WordArray.random(m),y=ge.enc.Hex.stringify(A);return y},l=function(m){var A={},y=m.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));y&&(A.cipher=y[1],A.ivsalt=y[2]);var f=m.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));f&&(A.type=f[1]);var g=-1,b=0;m.indexOf(`\r
|
|
348
348
|
\r
|
|
349
349
|
`)!=-1&&(g=m.indexOf(`\r
|
|
350
350
|
\r
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
`,I+=`\r
|
|
360
360
|
`,I+=C,I+=`\r
|
|
361
361
|
-----END `+m+` PRIVATE KEY-----\r
|
|
362
|
-
`,I},parseHexOfEncryptedPKCS8:function(m){var A=ie,y=A.getChildIdx,f=A.getV,g={},b=y(m,0);if(b.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+b.length;g.ciphertext=f(m,b[1]);var w=y(m,b[0]);if(w.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+w.length;if(f(m,w[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var E=y(m,w[1]);if(w.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+E.length;var x=y(m,E[1]);if(x.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+x.length;if(f(m,x[0])!="2a864886f70d0307")throw"this only supports TripleDES";g.encryptionSchemeAlg="TripleDES",g.encryptionSchemeIV=f(m,x[1]);var M=y(m,E[0]);if(M.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+M.length;if(f(m,M[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var C=y(m,M[1]);if(C.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+C.length;g.pbkdf2Salt=f(m,C[0]);var I=f(m,C[1]);try{g.pbkdf2Iter=parseInt(I,16)}catch{throw"malformed format pbkdf2Iter: "+I}return g},getPBKDF2KeyHexFromParam:function(m,A){var y=ge.enc.Hex.parse(m.pbkdf2Salt),f=m.pbkdf2Iter,g=ge.PBKDF2(A,y,{keySize:192/32,iterations:f}),b=ge.enc.Hex.stringify(g);return b},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(m,A){var y=Xr(m,"ENCRYPTED PRIVATE KEY"),f=this.parseHexOfEncryptedPKCS8(y),g=Kr.getPBKDF2KeyHexFromParam(f,A),b={};b.ciphertext=ge.enc.Hex.parse(f.ciphertext);var w=ge.enc.Hex.parse(g),E=ge.enc.Hex.parse(f.encryptionSchemeIV),x=ge.TripleDES.decrypt(b,w,{iv:E}),M=ge.enc.Hex.stringify(x);return M},getKeyFromEncryptedPKCS8PEM:function(m,A){var y=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(m,A),f=this.getKeyFromPlainPrivatePKCS8Hex(y);return f},parsePlainPrivatePKCS8Hex:function(m){var A=ie,y=A.getChildIdx,f=A.getV,g={};if(g.algparam=null,m.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var b=y(m,0);if(b.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(m.substr(b[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var w=y(m,b[1]);if(w.length!=2)throw new Error("malformed PKCS8 private key(code:004)");if(m.substr(w[0],2)!="06")throw new Error("malformed PKCS8 private key(code:005)");if(g.algoid=f(m,w[0]),m.substr(w[1],2)=="06"&&(g.algparam=f(m,w[1])),m.substr(b[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return g.keyidx=A.getVidx(m,b[2]),g},getKeyFromPlainPrivatePKCS8PEM:function(m){var A=Xr(m,"PRIVATE KEY"),y=this.getKeyFromPlainPrivatePKCS8Hex(A);return y},getKeyFromPlainPrivatePKCS8Hex:function(m){var A=this.parsePlainPrivatePKCS8Hex(m),y;if(A.algoid=="2a864886f70d010101")y=new Ce;else if(ee.crypto.DSA&&A.algoid=="2a8648ce380401")y=new ee.crypto.DSA;else if(ee.crypto.ECDSA&&A.algoid=="2a8648ce3d0201")y=new ee.crypto.ECDSA;else throw"unsupported private key algorithm";return y.readPKCS8PrvKeyHex(m),y},_getKeyFromPublicPKCS8Hex:function(m){var A,y=ie.getVbyList(m,0,[0,0],"06");if(y==="2a864886f70d010101")A=new Ce;else if(ee.crypto.DSA&&y==="2a8648ce380401")A=new ee.crypto.DSA;else if(ee.crypto.ECDSA&&y==="2a8648ce3d0201")A=new ee.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return A.readPKCS8PubKeyHex(m),A},parsePublicRawRSAKeyHex:function(m){var A=ie,y=A.getChildIdx,f=A.getV,g={};if(m.substr(0,2)!="30")throw"malformed RSA key(code:001)";var b=y(m,0);if(b.length!=2)throw"malformed RSA key(code:002)";if(m.substr(b[0],2)!="02")throw"malformed RSA key(code:003)";if(g.n=f(m,b[0]),m.substr(b[1],2)!="02")throw"malformed RSA key(code:004)";return g.e=f(m,b[1]),g},parsePublicPKCS8Hex:function(m){var A=ie,y=A.getChildIdx,f=A.getV,g={};g.algparam=null;var b=y(m,0);if(b.length!=2)throw"outer DERSequence shall have 2 elements: "+b.length;var w=b[0];if(m.substr(w,2)!="30")throw"malformed PKCS8 public key(code:001)";var E=y(m,w);if(E.length!=2)throw"malformed PKCS8 public key(code:002)";if(m.substr(E[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(g.algoid=f(m,E[0]),m.substr(E[1],2)=="06"?g.algparam=f(m,E[1]):m.substr(E[1],2)=="30"&&(g.algparam={},g.algparam.p=A.getVbyList(m,E[1],[0],"02"),g.algparam.q=A.getVbyList(m,E[1],[1],"02"),g.algparam.g=A.getVbyList(m,E[1],[2],"02")),m.substr(b[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return g.key=f(m,b[1]).substr(2),g}}}();Kr.getKey=function(n,t,e){var r=ie,i=r.getChildIdx;r.getV;var a=r.getVbyList,o=ee.crypto,s=o.ECDSA,u=o.DSA,c=Ce,l=Xr,h=Kr;if(typeof c<"u"&&n instanceof c||typeof s<"u"&&n instanceof s||typeof u<"u"&&n instanceof u)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 p=new c;return p.setPublic(n.n,n.e),p}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 p=new c;return p.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),p}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var p=new c;return p.setPrivate(n.n,n.e,n.d),p}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var p=new u;return p.setPublic(n.p,n.q,n.g,n.y),p}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var p=new u;return p.setPrivate(n.p,n.q,n.g,n.y,n.x),p}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var p=new c;return p.setPublic(nt(n.n),nt(n.e)),p}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 p=new c;return p.setPrivateEx(nt(n.n),nt(n.e),nt(n.d),nt(n.p),nt(n.q),nt(n.dp),nt(n.dq),nt(n.qi)),p}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var p=new c;return p.setPrivate(nt(n.n),nt(n.e),nt(n.d)),p}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d===void 0){var v=new s({curve:n.crv}),m=v.ecparams.keylen/4,A=("0000000000"+nt(n.x)).slice(-m),y=("0000000000"+nt(n.y)).slice(-m),f="04"+A+y;return v.setPublicKeyHex(f),v}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d!==void 0){var v=new s({curve:n.crv}),m=v.ecparams.keylen/4,A=("0000000000"+nt(n.x)).slice(-m),y=("0000000000"+nt(n.y)).slice(-m),f="04"+A+y,g=("0000000000"+nt(n.d)).slice(-m);return v.setPublicKeyHex(f),v.setPrivateKeyHex(g),v}if(e==="pkcs5prv"){var b=n,r=ie,w,p;if(w=i(b,0),w.length===9)p=new c,p.readPKCS5PrvKeyHex(b);else if(w.length===6)p=new u,p.readPKCS5PrvKeyHex(b);else if(w.length>2&&b.substr(w[1],2)==="04")p=new s,p.readPKCS5PrvKeyHex(b);else throw"unsupported PKCS#1/5 hexadecimal key";return p}if(e==="pkcs8prv"){var p=h.getKeyFromPlainPrivatePKCS8Hex(n);return p}if(e==="pkcs8pub")return h._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return qe.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return qe.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var E=Xr(n,"PUBLIC KEY");return h._getKeyFromPublicPKCS8Hex(E)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var x=l(n,"RSA PRIVATE KEY");return h.getKey(x,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var M=l(n,"DSA PRIVATE KEY"),C=a(M,0,[1],"02"),I=a(M,0,[2],"02"),P=a(M,0,[3],"02"),S=a(M,0,[4],"02"),F=a(M,0,[5],"02"),p=new u;return p.setPrivate(new ue(C,16),new ue(I,16),new ue(P,16),new ue(S,16),new ue(F,16)),p}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var x=l(n,"EC PRIVATE KEY");return h.getKey(x,null,"pkcs5prv")}if(n.indexOf("-END PRIVATE KEY-")!=-1)return h.getKeyFromPlainPrivatePKCS8PEM(n);if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var k=h.getDecryptedKeyHex(n,t),O=new Ce;return O.readPKCS5PrvKeyHex(k),O}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var M=h.getDecryptedKeyHex(n,t),p=a(M,0,[1],"04"),L=a(M,0,[2,0],"06"),N=a(M,0,[3,0],"03").substr(2),V="";if(ee.crypto.OID.oidhex2name[L]!==void 0)V=ee.crypto.OID.oidhex2name[L];else throw"undefined OID(hex) in KJUR.crypto.OID: "+L;var v=new s({curve:V});return v.setPublicKeyHex(N),v.setPrivateKeyHex(p),v.isPublic=!1,v}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var M=h.getDecryptedKeyHex(n,t),C=a(M,0,[1],"02"),I=a(M,0,[2],"02"),P=a(M,0,[3],"02"),S=a(M,0,[4],"02"),F=a(M,0,[5],"02"),p=new u;return p.setPrivate(new ue(C,16),new ue(I,16),new ue(P,16),new ue(S,16),new ue(F,16)),p}if(n.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return h.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument")};(typeof ee.asn1>"u"||!ee.asn1)&&(ee.asn1={});ee.asn1.ASN1Util={};ee.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),u=("00000000"+s.toString(2)).slice(-8);if(a=a+u.substr(1,7),u.substr(0,1)=="0"){var c=new ue(a,2);i=i+"."+c.toString(10),a=""}}return i};var ie=new function(){};ie.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};ie.getL=function(n,t){var e=ie.getLblen(n,t);return e<1?"":n.substr(t+2,e*2)};ie.getVblen=function(n,t){var e,r;return e=ie.getL(n,t),e==""?-1:(e.substr(0,1)==="8"?r=new ue(e.substr(2),16):r=new ue(e,16),r.intValue())};ie.getVidx=function(n,t){var e=ie.getLblen(n,t);return e<0?e:t+(e+1)*2};ie.getV=function(n,t){var e=ie.getVidx(n,t),r=ie.getVblen(n,t);return n.substr(e,r*2)};ie.getTLV=function(n,t){return n.substr(t,2)+ie.getL(n,t)+ie.getV(n,t)};ie.getTLVblen=function(n,t){return 2+ie.getLblen(n,t)*2+ie.getVblen(n,t)*2};ie.getNextSiblingIdx=function(n,t){var e=ie.getVidx(n,t),r=ie.getVblen(n,t);return e+r*2};ie.getChildIdx=function(n,t){var e=ie,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 u=e.getTLVblen(n,s);if(o+=u,o<=a&&r.push(s),s+=u,o>=a)break}return r};ie.getNthChildIdx=function(n,t,e){var r=ie.getChildIdx(n,t);return r[e]};ie.getIdxbyList=function(n,t,e,r){var i=ie,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))};ie.getIdxbyListEx=function(n,t,e,r){var i=ie,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,u=0;u<o.length;u++){var c=n.substr(o[u],2);if(typeof a=="number"&&!i.isContextTag(c)&&s==a||typeof a=="string"&&i.isContextTag(c,a))return i.getIdxbyListEx(n,o[u],e,r);i.isContextTag(c)||s++}return-1};ie.getTLVbyList=function(n,t,e,r){var i=ie,a=i.getIdxbyList(n,t,e,r);return a==-1||a>=n.length?null:i.getTLV(n,a)};ie.getTLVbyListEx=function(n,t,e,r){var i=ie,a=i.getIdxbyListEx(n,t,e,r);return a==-1?null:i.getTLV(n,a)};ie.getVbyList=function(n,t,e,r,i){var a=ie,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)};ie.getVbyListEx=function(n,t,e,r,i){var a=ie,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)};ie.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=ie.getV(n,t);return r=="02"?parseInt(i,16):Bl(i)}catch{return e}};ie.getOID=function(n,t,e){e==null&&(e=null);try{if(n.substr(t,2)!="06")return e;var r=ie.getV(n,t);return Pl(r)}catch{return e}};ie.getOIDName=function(n,t,e){e==null&&(e=null);try{var r=ie.getOID(n,t,e);if(r==e)return e;var i=ee.asn1.x509.OID.oid2name(r);return i==""?r:i}catch{return e}};ie.getString=function(n,t,e){e==null&&(e=null);try{var r=ie.getV(n,t);return gr(r)}catch{return e}};ie.hextooidstr=function(n){var t=function(h,p){return h.length>=p?h:new Array(p-h.length+1).join("0")+h},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 u=[],c="",s=0;s<o.length;s++)o[s]&128?c=c+t((o[s]&127).toString(2),7):(c=c+t((o[s]&127).toString(2),7),u.push(new String(parseInt(c,2))),c="");var l=e.join(".");return u.length>0&&(l=l+"."+u.join(".")),l};ie.isContextTag=function(n,t){n=n.toLowerCase();var e,r;try{e=parseInt(n,16)}catch{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{return!1}};ie.isASN1HEX=function(n){var t=ie;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};ie.checkStrictDER=function(n,t,e,r,i){var a=ie;if(e===void 0){if(typeof n!="string")throw new Error("not hex string");if(n=n.toLowerCase(),!ee.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 u=a.getTLV(n,t),c=u.length-2-a.getL(n,t).length;if(c!==s*2)throw new Error("V string length and L's value not the same:"+c+"/"+s*2);if(t===0&&n.length!=u.length)throw new Error("total length and TLV length unmatch:"+n.length+"!="+u.length);var l=n.substr(t,2);if(l==="02"){var h=a.getVidx(n,t);if(n.substr(h,2)=="00"&&n.charCodeAt(h+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(l,16)&32){for(var p=a.getVblen(n,t),v=0,m=a.getChildIdx(n,t),A=0;A<m.length;A++){var y=a.getTLV(n,m[A]);v+=y.length,a.checkStrictDER(n,m[A],e,r,i)}if(p*2!=v)throw new Error("sum of children's TLV length and L unmatch: "+p*2+"!="+v)}};ie.oidname=function(n){var t=ee.asn1;ee.lang.String.isHex(n)&&(n=t.ASN1Util.oidHexToInt(n));var e=t.x509.OID.oid2name(n);return e===""&&(e=n),e};(typeof ee.asn1>"u"||!ee.asn1)&&(ee.asn1={});(typeof ee.asn1.x509>"u"||!ee.asn1.x509)&&(ee.asn1.x509={});ee.asn1.x509.AlgorithmIdentifier={};ee.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};ee.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]<"u")return this.objCache[t];if(typeof this.name2oidList[t]>"u")throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],r=new ee.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 ee.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r}};ee.asn1.x509.OID.oid2name=function(n){var t=ee.asn1.x509.OID.name2oidList;for(var e in t)if(t[e]==n)return e;return""};ee.asn1.x509.OID.oid2atype=function(n){var t=ee.asn1.x509.OID.atype2oidList;for(var e in t)if(t[e]==n)return e;return n};ee.asn1.x509.OID.name2oid=function(n){if(n.match(/^[0-9.]+$/))return n;var t=ee.asn1.x509.OID.name2oidList;return t[n]===void 0?"":t[n]};Ce.getPosArrayOfChildrenFromHex=function(n){return ie.getChildIdx(n,0)};Ce.getHexValueArrayOfChildrenFromHex=function(n){var t=ie,e=t.getV,p=Ce.getPosArrayOfChildrenFromHex(n),r=e(n,p[0]),i=e(n,p[1]),a=e(n,p[2]),o=e(n,p[3]),s=e(n,p[4]),u=e(n,p[5]),c=e(n,p[6]),l=e(n,p[7]),h=e(n,p[8]),p=new Array;return p.push(r,i,a,o,s,u,c,l,h),p};Ce.prototype.readPrivateKeyFromPEMString=function(n){var t=Xr(n),e=Ce.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Ce.prototype.readPKCS5PrvKeyHex=function(n){var t=Ce.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};Ce.prototype.readPKCS8PrvKeyHex=function(n){var t,e,r,i,a,o,s,u,c=ie,l=c.getVbyListEx;if(c.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");try{t=l(n,0,[2,0,1],"02"),e=l(n,0,[2,0,2],"02"),r=l(n,0,[2,0,3],"02"),i=l(n,0,[2,0,4],"02"),a=l(n,0,[2,0,5],"02"),o=l(n,0,[2,0,6],"02"),s=l(n,0,[2,0,7],"02"),u=l(n,0,[2,0,8],"02")}catch{throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,e,r,i,a,o,s,u)};Ce.prototype.readPKCS5PubKeyHex=function(n){var t=ie,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)};Ce.prototype.readPKCS8PubKeyHex=function(n){var t=ie;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)};Ce.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new qe,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function Ys(n){for(var t in ee.crypto.Util.DIGESTINFOHEAD){var e=ee.crypto.Util.DIGESTINFOHEAD[t],r=e.length;if(n.substring(0,r)==e){var i=[t,n.substring(r)];return i}}return[]}Ce.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=Ct(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=Ys(o);if(s.length==0)return!1;var u=s[0],c=s[1],l=function(p){return ee.crypto.Util.hashString(p,u)},h=l(n);return c==h};Ce.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=Ct(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),a=Ys(i);if(a.length==0)return!1;a[0];var o=a[1];return o==n};Ce.prototype.verifyPSS=function(n,t,e,r){var i=function(o){return ee.crypto.Util.hashHex(o,e)},a=i(xi(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(a,t,e,r)};Ce.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new ue(t,16),a=function(g){return ee.crypto.Util.hashHex(g,e)},o=gr(n),s=o.length,u=this.n.bitLength()-1,c=Math.ceil(u/8),l;if(r===-1||r===void 0)r=s;else if(r===-2)r=c-s-2;else if(r<-2)throw new Error("invalid salt length");if(c<s+r+2)throw new Error("data too long");var h=this.doPublic(i).toByteArray();for(l=0;l<h.length;l+=1)h[l]&=255;for(;h.length<c;)h.unshift(0);if(h[c-1]!==188)throw new Error("encoded message does not end in 0xbc");h=String.fromCharCode.apply(String,h);var p=h.substr(0,c-s-1),v=h.substr(p.length,s),m=65280>>8*c-u&255;if(p.charCodeAt(0)&m)throw new Error("bits beyond keysize not zero");var A=pss_mgf1_str(v,p.length,a),y=[];for(l=0;l<p.length;l+=1)y[l]=p.charCodeAt(l)^A.charCodeAt(l);y[0]&=~m;var f=c-s-r-2;for(l=0;l<f;l+=1)if(y[l]!==0)throw new Error("leftmost octets not zero");if(y[f]!==1)throw new Error("0x01 marker not found");return v===gr(a(xi("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,y.slice(-r)))))};Ce.SALT_LEN_HLEN=-1;Ce.SALT_LEN_MAX=-2;Ce.SALT_LEN_RECOVER=-2;function qe(n){var t=ie,e=t.getChildIdx,r=t.getV,i=t.getTLV,a=t.getVbyList,o=t.getVbyListEx,s=t.getTLVbyList,u=t.getTLVbyListEx,c=t.getIdxbyList,l=t.getIdxbyListEx,h=t.getVidx,p=t.getInt,v=t.oidname,m=t.hextooidstr,A=Xr,y;try{y=ee.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch{}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 f=s(this.hex,0,[0,0]);if(f.substr(0,2)=="a0"){var g=s(f,0,[0]),b=p(g,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 f=u(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(f)},this.getAlgorithmIdentifierName=function(f){for(var g in y)if(f===y[g])return g;return v(o(f,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 f=this.getIssuer();return f.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 f=this.getSubject();return f.str},this.getNotBefore=function(){var f=a(this.hex,0,[0,4+this.foffset,0]);return f=f.replace(/(..)/g,"%$1"),f=decodeURIComponent(f),f},this.getNotAfter=function(){var f=a(this.hex,0,[0,4+this.foffset,1]);return f=f.replace(/(..)/g,"%$1"),f=decodeURIComponent(f),f},this.getPublicKeyHex=function(){return t.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return c(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var f=this.getPublicKeyIdx();return c(this.hex,f,[1,0],"30")},this.getPublicKey=function(){return Kr.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var f=s(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(f)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(f){var g=this.getSignatureAlgorithmField(),b=this.getSignatureValueHex(),w=s(this.hex,0,[0],"30"),E=new ee.crypto.Signature({alg:g});return E.init(f),E.updateHex(w),E.verify(b)},this.parseExt=function(f){var g,b,w;if(f===void 0){if(w=this.hex,this.version!==3)return-1;g=c(w,0,[0,7,0],"30"),b=e(w,g)}else{w=Xr(f);var E=c(w,0,[0,3,0,0],"06");if(r(w,E)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}g=c(w,0,[0,3,0,1,0],"30"),b=e(w,g),this.hex=w}this.aExtInfo=new Array;for(var x=0;x<b.length;x++){var M={};M.critical=!1;var C=e(w,b[x]),I=0;C.length===3&&(M.critical=!0,I=1),M.oid=t.hextooidstr(a(w,b[x],[0],"06"));var P=c(w,b[x],[1+I]);M.vidx=h(w,P),this.aExtInfo.push(M)}},this.getExtInfo=function(f){var g=this.aExtInfo,b=f;if(f.match(/^[0-9.]+$/)||(b=ee.asn1.x509.OID.name2oid(f)),b!==""){for(var w=0;w<g.length;w++)if(g[w].oid===b)return g[w]}},this.getExtBasicConstraints=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("basicConstraints");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"basicConstraints"};if(g&&(w.critical=!0),f==="3000")return w;if(f==="30030101ff")return w.cA=!0,w;if(f.substr(0,12)==="30060101ff02"){var E=r(f,10),x=parseInt(E,16);return w.cA=!0,w.pathLen=x,w}throw new Error("hExtV parse error: "+f)},this.getExtKeyUsage=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("keyUsage");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"keyUsage"};return g&&(w.critical=!0),w.names=this.getExtKeyUsageString(f).split(","),w},this.getExtKeyUsageBin=function(f){if(f===void 0){var g=this.getExtInfo("keyUsage");if(g===void 0)return"";f=i(this.hex,g.vidx)}if(f.length!=8&&f.length!=10)throw new Error("malformed key usage value: "+f);var b="000000000000000"+parseInt(f.substr(6),16).toString(2);return f.length==8&&(b=b.slice(-8)),f.length==10&&(b=b.slice(-16)),b=b.replace(/0+$/,""),b==""&&(b="0"),b},this.getExtKeyUsageString=function(f){for(var g=this.getExtKeyUsageBin(f),b=new Array,w=0;w<g.length;w++)g.substr(w,1)=="1"&&b.push(qe.KEYUSAGE_NAME[w]);return b.join(",")},this.getExtSubjectKeyIdentifier=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("subjectKeyIdentifier");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"subjectKeyIdentifier"};g&&(w.critical=!0);var E=r(f,0);return w.kid={hex:E},w},this.getExtAuthorityKeyIdentifier=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("authorityKeyIdentifier");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"authorityKeyIdentifier"};g&&(w.critical=!0);for(var E=e(f,0),x=0;x<E.length;x++){var M=f.substr(E[x],2);if(M==="80"&&(w.kid={hex:r(f,E[x])}),M==="a1"){var C=i(f,E[x]),I=this.getGeneralNames(C);w.issuer=I[0].dn}M==="82"&&(w.sn={hex:r(f,E[x])})}return w},this.getExtExtKeyUsage=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("extKeyUsage");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"extKeyUsage",array:[]};g&&(w.critical=!0);for(var E=e(f,0),x=0;x<E.length;x++)w.array.push(v(r(f,E[x])));return w},this.getExtExtKeyUsageName=function(){var f=this.getExtInfo("extKeyUsage");if(f===void 0)return f;var g=new Array,b=i(this.hex,f.vidx);if(b==="")return g;for(var w=e(b,0),E=0;E<w.length;E++)g.push(v(r(b,w[E])));return g},this.getExtSubjectAltName=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("subjectAltName");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"subjectAltName",array:[]};return g&&(w.critical=!0),w.array=this.getGeneralNames(f),w},this.getExtIssuerAltName=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("issuerAltName");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"issuerAltName",array:[]};return g&&(w.critical=!0),w.array=this.getGeneralNames(f),w},this.getGeneralNames=function(f){for(var g=e(f,0),b=[],w=0;w<g.length;w++){var E=this.getGeneralName(i(f,g[w]));E!==void 0&&b.push(E)}return b},this.getGeneralName=function(f){var g=f.substr(0,2),b=r(f,0),w=gr(b);if(g=="81")return{rfc822:w};if(g=="82")return{dns:w};if(g=="86")return{uri:w};if(g=="87")return{ip:wo(b)};if(g=="a4")return{dn:this.getX500Name(b)}},this.getExtSubjectAltName2=function(){var f,g,b,w=this.getExtInfo("subjectAltName");if(w===void 0)return w;for(var E=new Array,x=i(this.hex,w.vidx),M=e(x,0),C=0;C<M.length;C++)b=x.substr(M[C],2),f=r(x,M[C]),b==="81"&&(g=ir(f),E.push(["MAIL",g])),b==="82"&&(g=ir(f),E.push(["DNS",g])),b==="84"&&(g=qe.hex2dn(f,0),E.push(["DN",g])),b==="86"&&(g=ir(f),E.push(["URI",g])),b==="87"&&(g=wo(f),E.push(["IP",g]));return E},this.getExtCRLDistributionPoints=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("cRLDistributionPoints");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"cRLDistributionPoints",array:[]};g&&(w.critical=!0);for(var E=e(f,0),x=0;x<E.length;x++){var M=i(f,E[x]);w.array.push(this.getDistributionPoint(M))}return w},this.getDistributionPoint=function(f){for(var g={},b=e(f,0),w=0;w<b.length;w++){var E=f.substr(b[w],2),x=i(f,b[w]);E=="a0"&&(g.dpname=this.getDistributionPointName(x))}return g},this.getDistributionPointName=function(f){for(var g={},b=e(f,0),w=0;w<b.length;w++){var E=f.substr(b[w],2),x=i(f,b[w]);E=="a0"&&(g.full=this.getGeneralNames(x))}return g},this.getExtCRLDistributionPointsURI=function(){var f=this.getExtInfo("cRLDistributionPoints");if(f===void 0)return f;for(var g=new Array,b=e(this.hex,f.vidx),w=0;w<b.length;w++)try{var E=a(this.hex,b[w],[0,0,0],"86"),x=ir(E);g.push(x)}catch{}return g},this.getExtAIAInfo=function(){var f=this.getExtInfo("authorityInfoAccess");if(f===void 0)return f;for(var g={ocsp:[],caissuer:[]},b=e(this.hex,f.vidx),w=0;w<b.length;w++){var E=a(this.hex,b[w],[0],"06"),x=a(this.hex,b[w],[1],"86");E==="2b06010505073001"&&g.ocsp.push(ir(x)),E==="2b06010505073002"&&g.caissuer.push(ir(x))}return g},this.getExtAuthorityInfoAccess=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("authorityInfoAccess");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"authorityInfoAccess",array:[]};g&&(w.critical=!0);for(var E=e(f,0),x=0;x<E.length;x++){var M=o(f,E[x],[0],"06"),C=a(f,E[x],[1],"86"),I=ir(C);if(M=="2b06010505073001")w.array.push({ocsp:I});else if(M=="2b06010505073002")w.array.push({caissuer:I});else throw new Error("unknown method: "+M)}return w},this.getExtCertificatePolicies=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("certificatePolicies");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"certificatePolicies",array:[]};g&&(w.critical=!0);for(var E=e(f,0),x=0;x<E.length;x++){var M=i(f,E[x]),C=this.getPolicyInformation(M);w.array.push(C)}return w},this.getPolicyInformation=function(f){var g={},b=a(f,0,[0],"06");g.policyoid=v(b);var w=l(f,0,[1],"30");if(w!=-1){g.array=[];for(var E=e(f,w),x=0;x<E.length;x++){var M=i(f,E[x]),C=this.getPolicyQualifierInfo(M);g.array.push(C)}}return g},this.getPolicyQualifierInfo=function(f){var g={},b=a(f,0,[0],"06");if(b==="2b06010505070201"){var w=o(f,0,[1],"16");g.cps=gr(w)}else if(b==="2b06010505070202"){var E=s(f,0,[1],"30");g.unotice=this.getUserNotice(E)}return g},this.getUserNotice=function(f){for(var g={},b=e(f,0),w=0;w<b.length;w++){var E=i(f,b[w]);E.substr(0,2)!="30"&&(g.exptext=this.getDisplayText(E))}return g},this.getDisplayText=function(f){var g={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},b={};return b.type=g[f.substr(0,2)],b.str=gr(r(f,0)),b},this.getExtCRLNumber=function(f,g){var b={extname:"cRLNumber"};if(g&&(b.critical=!0),f.substr(0,2)=="02")return b.num={hex:r(f,0)},b;throw new Error("hExtV parse error: "+f)},this.getExtCRLReason=function(f,g){var b={extname:"cRLReason"};if(g&&(b.critical=!0),f.substr(0,2)=="0a")return b.code=parseInt(r(f,0),16),b;throw new Error("hExtV parse error: "+f)},this.getExtOcspNonce=function(f,g){var b={extname:"ocspNonce"};g&&(b.critical=!0);var w=r(f,0);return b.hex=w,b},this.getExtOcspNoCheck=function(f,g){var b={extname:"ocspNoCheck"};return g&&(b.critical=!0),b},this.getExtAdobeTimeStamp=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("adobeTimeStamp");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"adobeTimeStamp"};g&&(w.critical=!0);var E=e(f,0);if(E.length>1){var x=i(f,E[1]),M=this.getGeneralName(x);M.uri!=null&&(w.uri=M.uri)}if(E.length>2){var C=i(f,E[2]);C=="0101ff"&&(w.reqauth=!0),C=="010100"&&(w.reqauth=!1)}return w},this.getX500NameRule=function(f){for(var g=null,b=[],w=0;w<f.length;w++)for(var E=f[w],x=0;x<E.length;x++)b.push(E[x]);for(var w=0;w<b.length;w++){var M=b[w],C=M.ds,I=M.value,P=M.type;if(C!="prn"&&C!="utf8"&&C!="ia5")return"mixed";if(C=="ia5"){if(P!="CN")return"mixed";if(ee.lang.String.isMail(I))continue;return"mixed"}if(P=="C"){if(C=="prn")continue;return"mixed"}if(g==null)g=C;else if(g!==C)return"mixed"}return g??"prn"},this.getX500Name=function(f){var g=this.getX500NameArray(f),b=this.dnarraytostr(g);return{array:g,str:b}},this.getX500NameArray=function(f){for(var g=[],b=e(f,0),w=0;w<b.length;w++)g.push(this.getRDN(i(f,b[w])));return g},this.getRDN=function(f){for(var g=[],b=e(f,0),w=0;w<b.length;w++)g.push(this.getAttrTypeAndValue(i(f,b[w])));return g},this.getAttrTypeAndValue=function(f){var g={type:null,value:null,ds:null},b=e(f,0),w=a(f,b[0],[],"06"),E=a(f,b[1],[]),x=ee.asn1.ASN1Util.oidHexToInt(w);return g.type=ee.asn1.x509.OID.oid2atype(x),g.ds=this.HEX2STAG[f.substr(b[1],2)],g.ds!="bmp"?g.value=ir(E):g.value=Tl(E),g},this.readCertPEM=function(f){this.readCertHex(A(f))},this.readCertHex=function(f){this.hex=f,this.getVersion();try{c(this.hex,0,[0,7],"a3"),this.parseExt()}catch{}},this.getParam=function(){var f={};return f.version=this.getVersion(),f.serial={hex:this.getSerialNumberHex()},f.sigalg=this.getSignatureAlgorithmField(),f.issuer=this.getIssuer(),f.notbefore=this.getNotBefore(),f.notafter=this.getNotAfter(),f.subject=this.getSubject(),f.sbjpubkey=Cl(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(f.ext=this.getExtParamArray()),f.sighex=this.getSignatureValueHex(),f},this.getExtParamArray=function(f){if(f==null){var g=l(this.hex,0,[0,"[3]"]);g!=-1&&(f=u(this.hex,0,[0,"[3]",0],"30"))}for(var b=[],w=e(f,0),E=0;E<w.length;E++){var x=i(f,w[E]),M=this.getExtParam(x);M!=null&&b.push(M)}return b},this.getExtParam=function(f){var g=e(f,0),b=g.length;if(b!=2&&b!=3)throw new Error("wrong number elements in Extension: "+b+" "+f);var w=m(a(f,0,[0],"06")),E=!1;b==3&&s(f,0,[1])=="0101ff"&&(E=!0);var x=s(f,0,[b-1,0]),M=void 0;if(w=="2.5.29.14"?M=this.getExtSubjectKeyIdentifier(x,E):w=="2.5.29.15"?M=this.getExtKeyUsage(x,E):w=="2.5.29.17"?M=this.getExtSubjectAltName(x,E):w=="2.5.29.18"?M=this.getExtIssuerAltName(x,E):w=="2.5.29.19"?M=this.getExtBasicConstraints(x,E):w=="2.5.29.31"?M=this.getExtCRLDistributionPoints(x,E):w=="2.5.29.32"?M=this.getExtCertificatePolicies(x,E):w=="2.5.29.35"?M=this.getExtAuthorityKeyIdentifier(x,E):w=="2.5.29.37"?M=this.getExtExtKeyUsage(x,E):w=="1.3.6.1.5.5.7.1.1"?M=this.getExtAuthorityInfoAccess(x,E):w=="2.5.29.20"?M=this.getExtCRLNumber(x,E):w=="2.5.29.21"?M=this.getExtCRLReason(x,E):w=="1.3.6.1.5.5.7.48.1.2"?M=this.getExtOcspNonce(x,E):w=="1.3.6.1.5.5.7.48.1.5"?M=this.getExtOcspNoCheck(x,E):w=="1.2.840.113583.1.1.9.1"&&(M=this.getExtAdobeTimeStamp(x,E)),M!=null)return M;var C={extname:w,extn:x};return E&&(C.critical=!0),C},this.findExt=function(f,g){for(var b=0;b<f.length;b++)if(f[b].extname==g)return f[b];return null},this.dnarraytostr=function(f){function g(w){return w.map(function(E){return b(E).replace(/\+/,"\\+")}).join("+")}function b(w){return w.type+"="+w.value}return"/"+f.map(function(w){return g(w).replace(/\//,"\\/")}).join("/")},this.getInfo=function(){var f=function(j){var z=JSON.stringify(j.array).replace(/[\[\]\{\}\"]/g,"");return z},g=function(j){for(var z="",U=j.array,X=0;X<U.length;X++){var G=U[X];if(z+=" policy oid: "+G.policyoid+`
|
|
362
|
+
`,I},parseHexOfEncryptedPKCS8:function(m){var A=ie,y=A.getChildIdx,f=A.getV,g={},b=y(m,0);if(b.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+b.length;g.ciphertext=f(m,b[1]);var w=y(m,b[0]);if(w.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+w.length;if(f(m,w[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var E=y(m,w[1]);if(w.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+E.length;var x=y(m,E[1]);if(x.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+x.length;if(f(m,x[0])!="2a864886f70d0307")throw"this only supports TripleDES";g.encryptionSchemeAlg="TripleDES",g.encryptionSchemeIV=f(m,x[1]);var M=y(m,E[0]);if(M.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+M.length;if(f(m,M[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var C=y(m,M[1]);if(C.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+C.length;g.pbkdf2Salt=f(m,C[0]);var I=f(m,C[1]);try{g.pbkdf2Iter=parseInt(I,16)}catch{throw"malformed format pbkdf2Iter: "+I}return g},getPBKDF2KeyHexFromParam:function(m,A){var y=ge.enc.Hex.parse(m.pbkdf2Salt),f=m.pbkdf2Iter,g=ge.PBKDF2(A,y,{keySize:192/32,iterations:f}),b=ge.enc.Hex.stringify(g);return b},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(m,A){var y=Xr(m,"ENCRYPTED PRIVATE KEY"),f=this.parseHexOfEncryptedPKCS8(y),g=Kr.getPBKDF2KeyHexFromParam(f,A),b={};b.ciphertext=ge.enc.Hex.parse(f.ciphertext);var w=ge.enc.Hex.parse(g),E=ge.enc.Hex.parse(f.encryptionSchemeIV),x=ge.TripleDES.decrypt(b,w,{iv:E}),M=ge.enc.Hex.stringify(x);return M},getKeyFromEncryptedPKCS8PEM:function(m,A){var y=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(m,A),f=this.getKeyFromPlainPrivatePKCS8Hex(y);return f},parsePlainPrivatePKCS8Hex:function(m){var A=ie,y=A.getChildIdx,f=A.getV,g={};if(g.algparam=null,m.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var b=y(m,0);if(b.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(m.substr(b[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var w=y(m,b[1]);if(w.length!=2)throw new Error("malformed PKCS8 private key(code:004)");if(m.substr(w[0],2)!="06")throw new Error("malformed PKCS8 private key(code:005)");if(g.algoid=f(m,w[0]),m.substr(w[1],2)=="06"&&(g.algparam=f(m,w[1])),m.substr(b[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return g.keyidx=A.getVidx(m,b[2]),g},getKeyFromPlainPrivatePKCS8PEM:function(m){var A=Xr(m,"PRIVATE KEY"),y=this.getKeyFromPlainPrivatePKCS8Hex(A);return y},getKeyFromPlainPrivatePKCS8Hex:function(m){var A=this.parsePlainPrivatePKCS8Hex(m),y;if(A.algoid=="2a864886f70d010101")y=new Ce;else if(ee.crypto.DSA&&A.algoid=="2a8648ce380401")y=new ee.crypto.DSA;else if(ee.crypto.ECDSA&&A.algoid=="2a8648ce3d0201")y=new ee.crypto.ECDSA;else throw"unsupported private key algorithm";return y.readPKCS8PrvKeyHex(m),y},_getKeyFromPublicPKCS8Hex:function(m){var A,y=ie.getVbyList(m,0,[0,0],"06");if(y==="2a864886f70d010101")A=new Ce;else if(ee.crypto.DSA&&y==="2a8648ce380401")A=new ee.crypto.DSA;else if(ee.crypto.ECDSA&&y==="2a8648ce3d0201")A=new ee.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return A.readPKCS8PubKeyHex(m),A},parsePublicRawRSAKeyHex:function(m){var A=ie,y=A.getChildIdx,f=A.getV,g={};if(m.substr(0,2)!="30")throw"malformed RSA key(code:001)";var b=y(m,0);if(b.length!=2)throw"malformed RSA key(code:002)";if(m.substr(b[0],2)!="02")throw"malformed RSA key(code:003)";if(g.n=f(m,b[0]),m.substr(b[1],2)!="02")throw"malformed RSA key(code:004)";return g.e=f(m,b[1]),g},parsePublicPKCS8Hex:function(m){var A=ie,y=A.getChildIdx,f=A.getV,g={};g.algparam=null;var b=y(m,0);if(b.length!=2)throw"outer DERSequence shall have 2 elements: "+b.length;var w=b[0];if(m.substr(w,2)!="30")throw"malformed PKCS8 public key(code:001)";var E=y(m,w);if(E.length!=2)throw"malformed PKCS8 public key(code:002)";if(m.substr(E[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(g.algoid=f(m,E[0]),m.substr(E[1],2)=="06"?g.algparam=f(m,E[1]):m.substr(E[1],2)=="30"&&(g.algparam={},g.algparam.p=A.getVbyList(m,E[1],[0],"02"),g.algparam.q=A.getVbyList(m,E[1],[1],"02"),g.algparam.g=A.getVbyList(m,E[1],[2],"02")),m.substr(b[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return g.key=f(m,b[1]).substr(2),g}}}();Kr.getKey=function(n,t,e){var r=ie,i=r.getChildIdx;r.getV;var a=r.getVbyList,o=ee.crypto,s=o.ECDSA,u=o.DSA,c=Ce,l=Xr,h=Kr;if(typeof c<"u"&&n instanceof c||typeof s<"u"&&n instanceof s||typeof u<"u"&&n instanceof u)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 p=new c;return p.setPublic(n.n,n.e),p}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 p=new c;return p.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),p}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var p=new c;return p.setPrivate(n.n,n.e,n.d),p}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var p=new u;return p.setPublic(n.p,n.q,n.g,n.y),p}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var p=new u;return p.setPrivate(n.p,n.q,n.g,n.y,n.x),p}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var p=new c;return p.setPublic(nt(n.n),nt(n.e)),p}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 p=new c;return p.setPrivateEx(nt(n.n),nt(n.e),nt(n.d),nt(n.p),nt(n.q),nt(n.dp),nt(n.dq),nt(n.qi)),p}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var p=new c;return p.setPrivate(nt(n.n),nt(n.e),nt(n.d)),p}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d===void 0){var v=new s({curve:n.crv}),m=v.ecparams.keylen/4,A=("0000000000"+nt(n.x)).slice(-m),y=("0000000000"+nt(n.y)).slice(-m),f="04"+A+y;return v.setPublicKeyHex(f),v}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d!==void 0){var v=new s({curve:n.crv}),m=v.ecparams.keylen/4,A=("0000000000"+nt(n.x)).slice(-m),y=("0000000000"+nt(n.y)).slice(-m),f="04"+A+y,g=("0000000000"+nt(n.d)).slice(-m);return v.setPublicKeyHex(f),v.setPrivateKeyHex(g),v}if(e==="pkcs5prv"){var b=n,r=ie,w,p;if(w=i(b,0),w.length===9)p=new c,p.readPKCS5PrvKeyHex(b);else if(w.length===6)p=new u,p.readPKCS5PrvKeyHex(b);else if(w.length>2&&b.substr(w[1],2)==="04")p=new s,p.readPKCS5PrvKeyHex(b);else throw"unsupported PKCS#1/5 hexadecimal key";return p}if(e==="pkcs8prv"){var p=h.getKeyFromPlainPrivatePKCS8Hex(n);return p}if(e==="pkcs8pub")return h._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return qe.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return qe.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var E=Xr(n,"PUBLIC KEY");return h._getKeyFromPublicPKCS8Hex(E)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var x=l(n,"RSA PRIVATE KEY");return h.getKey(x,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var M=l(n,"DSA PRIVATE KEY"),C=a(M,0,[1],"02"),I=a(M,0,[2],"02"),P=a(M,0,[3],"02"),S=a(M,0,[4],"02"),F=a(M,0,[5],"02"),p=new u;return p.setPrivate(new ue(C,16),new ue(I,16),new ue(P,16),new ue(S,16),new ue(F,16)),p}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var x=l(n,"EC PRIVATE KEY");return h.getKey(x,null,"pkcs5prv")}if(n.indexOf("-END PRIVATE KEY-")!=-1)return h.getKeyFromPlainPrivatePKCS8PEM(n);if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var k=h.getDecryptedKeyHex(n,t),O=new Ce;return O.readPKCS5PrvKeyHex(k),O}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var M=h.getDecryptedKeyHex(n,t),p=a(M,0,[1],"04"),L=a(M,0,[2,0],"06"),N=a(M,0,[3,0],"03").substr(2),V="";if(ee.crypto.OID.oidhex2name[L]!==void 0)V=ee.crypto.OID.oidhex2name[L];else throw"undefined OID(hex) in KJUR.crypto.OID: "+L;var v=new s({curve:V});return v.setPublicKeyHex(N),v.setPrivateKeyHex(p),v.isPublic=!1,v}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var M=h.getDecryptedKeyHex(n,t),C=a(M,0,[1],"02"),I=a(M,0,[2],"02"),P=a(M,0,[3],"02"),S=a(M,0,[4],"02"),F=a(M,0,[5],"02"),p=new u;return p.setPrivate(new ue(C,16),new ue(I,16),new ue(P,16),new ue(S,16),new ue(F,16)),p}if(n.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return h.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument")};(typeof ee.asn1>"u"||!ee.asn1)&&(ee.asn1={});ee.asn1.ASN1Util={};ee.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),u=("00000000"+s.toString(2)).slice(-8);if(a=a+u.substr(1,7),u.substr(0,1)=="0"){var c=new ue(a,2);i=i+"."+c.toString(10),a=""}}return i};var ie=new function(){};ie.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};ie.getL=function(n,t){var e=ie.getLblen(n,t);return e<1?"":n.substr(t+2,e*2)};ie.getVblen=function(n,t){var e,r;return e=ie.getL(n,t),e==""?-1:(e.substr(0,1)==="8"?r=new ue(e.substr(2),16):r=new ue(e,16),r.intValue())};ie.getVidx=function(n,t){var e=ie.getLblen(n,t);return e<0?e:t+(e+1)*2};ie.getV=function(n,t){var e=ie.getVidx(n,t),r=ie.getVblen(n,t);return n.substr(e,r*2)};ie.getTLV=function(n,t){return n.substr(t,2)+ie.getL(n,t)+ie.getV(n,t)};ie.getTLVblen=function(n,t){return 2+ie.getLblen(n,t)*2+ie.getVblen(n,t)*2};ie.getNextSiblingIdx=function(n,t){var e=ie.getVidx(n,t),r=ie.getVblen(n,t);return e+r*2};ie.getChildIdx=function(n,t){var e=ie,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 u=e.getTLVblen(n,s);if(o+=u,o<=a&&r.push(s),s+=u,o>=a)break}return r};ie.getNthChildIdx=function(n,t,e){var r=ie.getChildIdx(n,t);return r[e]};ie.getIdxbyList=function(n,t,e,r){var i=ie,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))};ie.getIdxbyListEx=function(n,t,e,r){var i=ie,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,u=0;u<o.length;u++){var c=n.substr(o[u],2);if(typeof a=="number"&&!i.isContextTag(c)&&s==a||typeof a=="string"&&i.isContextTag(c,a))return i.getIdxbyListEx(n,o[u],e,r);i.isContextTag(c)||s++}return-1};ie.getTLVbyList=function(n,t,e,r){var i=ie,a=i.getIdxbyList(n,t,e,r);return a==-1||a>=n.length?null:i.getTLV(n,a)};ie.getTLVbyListEx=function(n,t,e,r){var i=ie,a=i.getIdxbyListEx(n,t,e,r);return a==-1?null:i.getTLV(n,a)};ie.getVbyList=function(n,t,e,r,i){var a=ie,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)};ie.getVbyListEx=function(n,t,e,r,i){var a=ie,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)};ie.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=ie.getV(n,t);return r=="02"?parseInt(i,16):Tl(i)}catch{return e}};ie.getOID=function(n,t,e){e==null&&(e=null);try{if(n.substr(t,2)!="06")return e;var r=ie.getV(n,t);return Sl(r)}catch{return e}};ie.getOIDName=function(n,t,e){e==null&&(e=null);try{var r=ie.getOID(n,t,e);if(r==e)return e;var i=ee.asn1.x509.OID.oid2name(r);return i==""?r:i}catch{return e}};ie.getString=function(n,t,e){e==null&&(e=null);try{var r=ie.getV(n,t);return gr(r)}catch{return e}};ie.hextooidstr=function(n){var t=function(h,p){return h.length>=p?h:new Array(p-h.length+1).join("0")+h},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 u=[],c="",s=0;s<o.length;s++)o[s]&128?c=c+t((o[s]&127).toString(2),7):(c=c+t((o[s]&127).toString(2),7),u.push(new String(parseInt(c,2))),c="");var l=e.join(".");return u.length>0&&(l=l+"."+u.join(".")),l};ie.isContextTag=function(n,t){n=n.toLowerCase();var e,r;try{e=parseInt(n,16)}catch{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{return!1}};ie.isASN1HEX=function(n){var t=ie;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};ie.checkStrictDER=function(n,t,e,r,i){var a=ie;if(e===void 0){if(typeof n!="string")throw new Error("not hex string");if(n=n.toLowerCase(),!ee.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 u=a.getTLV(n,t),c=u.length-2-a.getL(n,t).length;if(c!==s*2)throw new Error("V string length and L's value not the same:"+c+"/"+s*2);if(t===0&&n.length!=u.length)throw new Error("total length and TLV length unmatch:"+n.length+"!="+u.length);var l=n.substr(t,2);if(l==="02"){var h=a.getVidx(n,t);if(n.substr(h,2)=="00"&&n.charCodeAt(h+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(l,16)&32){for(var p=a.getVblen(n,t),v=0,m=a.getChildIdx(n,t),A=0;A<m.length;A++){var y=a.getTLV(n,m[A]);v+=y.length,a.checkStrictDER(n,m[A],e,r,i)}if(p*2!=v)throw new Error("sum of children's TLV length and L unmatch: "+p*2+"!="+v)}};ie.oidname=function(n){var t=ee.asn1;ee.lang.String.isHex(n)&&(n=t.ASN1Util.oidHexToInt(n));var e=t.x509.OID.oid2name(n);return e===""&&(e=n),e};(typeof ee.asn1>"u"||!ee.asn1)&&(ee.asn1={});(typeof ee.asn1.x509>"u"||!ee.asn1.x509)&&(ee.asn1.x509={});ee.asn1.x509.AlgorithmIdentifier={};ee.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};ee.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]<"u")return this.objCache[t];if(typeof this.name2oidList[t]>"u")throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],r=new ee.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 ee.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r}};ee.asn1.x509.OID.oid2name=function(n){var t=ee.asn1.x509.OID.name2oidList;for(var e in t)if(t[e]==n)return e;return""};ee.asn1.x509.OID.oid2atype=function(n){var t=ee.asn1.x509.OID.atype2oidList;for(var e in t)if(t[e]==n)return e;return n};ee.asn1.x509.OID.name2oid=function(n){if(n.match(/^[0-9.]+$/))return n;var t=ee.asn1.x509.OID.name2oidList;return t[n]===void 0?"":t[n]};Ce.getPosArrayOfChildrenFromHex=function(n){return ie.getChildIdx(n,0)};Ce.getHexValueArrayOfChildrenFromHex=function(n){var t=ie,e=t.getV,p=Ce.getPosArrayOfChildrenFromHex(n),r=e(n,p[0]),i=e(n,p[1]),a=e(n,p[2]),o=e(n,p[3]),s=e(n,p[4]),u=e(n,p[5]),c=e(n,p[6]),l=e(n,p[7]),h=e(n,p[8]),p=new Array;return p.push(r,i,a,o,s,u,c,l,h),p};Ce.prototype.readPrivateKeyFromPEMString=function(n){var t=Xr(n),e=Ce.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Ce.prototype.readPKCS5PrvKeyHex=function(n){var t=Ce.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};Ce.prototype.readPKCS8PrvKeyHex=function(n){var t,e,r,i,a,o,s,u,c=ie,l=c.getVbyListEx;if(c.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");try{t=l(n,0,[2,0,1],"02"),e=l(n,0,[2,0,2],"02"),r=l(n,0,[2,0,3],"02"),i=l(n,0,[2,0,4],"02"),a=l(n,0,[2,0,5],"02"),o=l(n,0,[2,0,6],"02"),s=l(n,0,[2,0,7],"02"),u=l(n,0,[2,0,8],"02")}catch{throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,e,r,i,a,o,s,u)};Ce.prototype.readPKCS5PubKeyHex=function(n){var t=ie,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)};Ce.prototype.readPKCS8PubKeyHex=function(n){var t=ie;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)};Ce.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new qe,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function Ws(n){for(var t in ee.crypto.Util.DIGESTINFOHEAD){var e=ee.crypto.Util.DIGESTINFOHEAD[t],r=e.length;if(n.substring(0,r)==e){var i=[t,n.substring(r)];return i}}return[]}Ce.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=Ct(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=Ws(o);if(s.length==0)return!1;var u=s[0],c=s[1],l=function(p){return ee.crypto.Util.hashString(p,u)},h=l(n);return c==h};Ce.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=Ct(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),a=Ws(i);if(a.length==0)return!1;a[0];var o=a[1];return o==n};Ce.prototype.verifyPSS=function(n,t,e,r){var i=function(o){return ee.crypto.Util.hashHex(o,e)},a=i(xi(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(a,t,e,r)};Ce.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new ue(t,16),a=function(g){return ee.crypto.Util.hashHex(g,e)},o=gr(n),s=o.length,u=this.n.bitLength()-1,c=Math.ceil(u/8),l;if(r===-1||r===void 0)r=s;else if(r===-2)r=c-s-2;else if(r<-2)throw new Error("invalid salt length");if(c<s+r+2)throw new Error("data too long");var h=this.doPublic(i).toByteArray();for(l=0;l<h.length;l+=1)h[l]&=255;for(;h.length<c;)h.unshift(0);if(h[c-1]!==188)throw new Error("encoded message does not end in 0xbc");h=String.fromCharCode.apply(String,h);var p=h.substr(0,c-s-1),v=h.substr(p.length,s),m=65280>>8*c-u&255;if(p.charCodeAt(0)&m)throw new Error("bits beyond keysize not zero");var A=pss_mgf1_str(v,p.length,a),y=[];for(l=0;l<p.length;l+=1)y[l]=p.charCodeAt(l)^A.charCodeAt(l);y[0]&=~m;var f=c-s-r-2;for(l=0;l<f;l+=1)if(y[l]!==0)throw new Error("leftmost octets not zero");if(y[f]!==1)throw new Error("0x01 marker not found");return v===gr(a(xi("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,y.slice(-r)))))};Ce.SALT_LEN_HLEN=-1;Ce.SALT_LEN_MAX=-2;Ce.SALT_LEN_RECOVER=-2;function qe(n){var t=ie,e=t.getChildIdx,r=t.getV,i=t.getTLV,a=t.getVbyList,o=t.getVbyListEx,s=t.getTLVbyList,u=t.getTLVbyListEx,c=t.getIdxbyList,l=t.getIdxbyListEx,h=t.getVidx,p=t.getInt,v=t.oidname,m=t.hextooidstr,A=Xr,y;try{y=ee.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch{}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 f=s(this.hex,0,[0,0]);if(f.substr(0,2)=="a0"){var g=s(f,0,[0]),b=p(g,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 f=u(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(f)},this.getAlgorithmIdentifierName=function(f){for(var g in y)if(f===y[g])return g;return v(o(f,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 f=this.getIssuer();return f.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 f=this.getSubject();return f.str},this.getNotBefore=function(){var f=a(this.hex,0,[0,4+this.foffset,0]);return f=f.replace(/(..)/g,"%$1"),f=decodeURIComponent(f),f},this.getNotAfter=function(){var f=a(this.hex,0,[0,4+this.foffset,1]);return f=f.replace(/(..)/g,"%$1"),f=decodeURIComponent(f),f},this.getPublicKeyHex=function(){return t.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return c(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var f=this.getPublicKeyIdx();return c(this.hex,f,[1,0],"30")},this.getPublicKey=function(){return Kr.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var f=s(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(f)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(f){var g=this.getSignatureAlgorithmField(),b=this.getSignatureValueHex(),w=s(this.hex,0,[0],"30"),E=new ee.crypto.Signature({alg:g});return E.init(f),E.updateHex(w),E.verify(b)},this.parseExt=function(f){var g,b,w;if(f===void 0){if(w=this.hex,this.version!==3)return-1;g=c(w,0,[0,7,0],"30"),b=e(w,g)}else{w=Xr(f);var E=c(w,0,[0,3,0,0],"06");if(r(w,E)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}g=c(w,0,[0,3,0,1,0],"30"),b=e(w,g),this.hex=w}this.aExtInfo=new Array;for(var x=0;x<b.length;x++){var M={};M.critical=!1;var C=e(w,b[x]),I=0;C.length===3&&(M.critical=!0,I=1),M.oid=t.hextooidstr(a(w,b[x],[0],"06"));var P=c(w,b[x],[1+I]);M.vidx=h(w,P),this.aExtInfo.push(M)}},this.getExtInfo=function(f){var g=this.aExtInfo,b=f;if(f.match(/^[0-9.]+$/)||(b=ee.asn1.x509.OID.name2oid(f)),b!==""){for(var w=0;w<g.length;w++)if(g[w].oid===b)return g[w]}},this.getExtBasicConstraints=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("basicConstraints");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"basicConstraints"};if(g&&(w.critical=!0),f==="3000")return w;if(f==="30030101ff")return w.cA=!0,w;if(f.substr(0,12)==="30060101ff02"){var E=r(f,10),x=parseInt(E,16);return w.cA=!0,w.pathLen=x,w}throw new Error("hExtV parse error: "+f)},this.getExtKeyUsage=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("keyUsage");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"keyUsage"};return g&&(w.critical=!0),w.names=this.getExtKeyUsageString(f).split(","),w},this.getExtKeyUsageBin=function(f){if(f===void 0){var g=this.getExtInfo("keyUsage");if(g===void 0)return"";f=i(this.hex,g.vidx)}if(f.length!=8&&f.length!=10)throw new Error("malformed key usage value: "+f);var b="000000000000000"+parseInt(f.substr(6),16).toString(2);return f.length==8&&(b=b.slice(-8)),f.length==10&&(b=b.slice(-16)),b=b.replace(/0+$/,""),b==""&&(b="0"),b},this.getExtKeyUsageString=function(f){for(var g=this.getExtKeyUsageBin(f),b=new Array,w=0;w<g.length;w++)g.substr(w,1)=="1"&&b.push(qe.KEYUSAGE_NAME[w]);return b.join(",")},this.getExtSubjectKeyIdentifier=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("subjectKeyIdentifier");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"subjectKeyIdentifier"};g&&(w.critical=!0);var E=r(f,0);return w.kid={hex:E},w},this.getExtAuthorityKeyIdentifier=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("authorityKeyIdentifier");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"authorityKeyIdentifier"};g&&(w.critical=!0);for(var E=e(f,0),x=0;x<E.length;x++){var M=f.substr(E[x],2);if(M==="80"&&(w.kid={hex:r(f,E[x])}),M==="a1"){var C=i(f,E[x]),I=this.getGeneralNames(C);w.issuer=I[0].dn}M==="82"&&(w.sn={hex:r(f,E[x])})}return w},this.getExtExtKeyUsage=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("extKeyUsage");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"extKeyUsage",array:[]};g&&(w.critical=!0);for(var E=e(f,0),x=0;x<E.length;x++)w.array.push(v(r(f,E[x])));return w},this.getExtExtKeyUsageName=function(){var f=this.getExtInfo("extKeyUsage");if(f===void 0)return f;var g=new Array,b=i(this.hex,f.vidx);if(b==="")return g;for(var w=e(b,0),E=0;E<w.length;E++)g.push(v(r(b,w[E])));return g},this.getExtSubjectAltName=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("subjectAltName");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"subjectAltName",array:[]};return g&&(w.critical=!0),w.array=this.getGeneralNames(f),w},this.getExtIssuerAltName=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("issuerAltName");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"issuerAltName",array:[]};return g&&(w.critical=!0),w.array=this.getGeneralNames(f),w},this.getGeneralNames=function(f){for(var g=e(f,0),b=[],w=0;w<g.length;w++){var E=this.getGeneralName(i(f,g[w]));E!==void 0&&b.push(E)}return b},this.getGeneralName=function(f){var g=f.substr(0,2),b=r(f,0),w=gr(b);if(g=="81")return{rfc822:w};if(g=="82")return{dns:w};if(g=="86")return{uri:w};if(g=="87")return{ip:yo(b)};if(g=="a4")return{dn:this.getX500Name(b)}},this.getExtSubjectAltName2=function(){var f,g,b,w=this.getExtInfo("subjectAltName");if(w===void 0)return w;for(var E=new Array,x=i(this.hex,w.vidx),M=e(x,0),C=0;C<M.length;C++)b=x.substr(M[C],2),f=r(x,M[C]),b==="81"&&(g=ir(f),E.push(["MAIL",g])),b==="82"&&(g=ir(f),E.push(["DNS",g])),b==="84"&&(g=qe.hex2dn(f,0),E.push(["DN",g])),b==="86"&&(g=ir(f),E.push(["URI",g])),b==="87"&&(g=yo(f),E.push(["IP",g]));return E},this.getExtCRLDistributionPoints=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("cRLDistributionPoints");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"cRLDistributionPoints",array:[]};g&&(w.critical=!0);for(var E=e(f,0),x=0;x<E.length;x++){var M=i(f,E[x]);w.array.push(this.getDistributionPoint(M))}return w},this.getDistributionPoint=function(f){for(var g={},b=e(f,0),w=0;w<b.length;w++){var E=f.substr(b[w],2),x=i(f,b[w]);E=="a0"&&(g.dpname=this.getDistributionPointName(x))}return g},this.getDistributionPointName=function(f){for(var g={},b=e(f,0),w=0;w<b.length;w++){var E=f.substr(b[w],2),x=i(f,b[w]);E=="a0"&&(g.full=this.getGeneralNames(x))}return g},this.getExtCRLDistributionPointsURI=function(){var f=this.getExtInfo("cRLDistributionPoints");if(f===void 0)return f;for(var g=new Array,b=e(this.hex,f.vidx),w=0;w<b.length;w++)try{var E=a(this.hex,b[w],[0,0,0],"86"),x=ir(E);g.push(x)}catch{}return g},this.getExtAIAInfo=function(){var f=this.getExtInfo("authorityInfoAccess");if(f===void 0)return f;for(var g={ocsp:[],caissuer:[]},b=e(this.hex,f.vidx),w=0;w<b.length;w++){var E=a(this.hex,b[w],[0],"06"),x=a(this.hex,b[w],[1],"86");E==="2b06010505073001"&&g.ocsp.push(ir(x)),E==="2b06010505073002"&&g.caissuer.push(ir(x))}return g},this.getExtAuthorityInfoAccess=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("authorityInfoAccess");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"authorityInfoAccess",array:[]};g&&(w.critical=!0);for(var E=e(f,0),x=0;x<E.length;x++){var M=o(f,E[x],[0],"06"),C=a(f,E[x],[1],"86"),I=ir(C);if(M=="2b06010505073001")w.array.push({ocsp:I});else if(M=="2b06010505073002")w.array.push({caissuer:I});else throw new Error("unknown method: "+M)}return w},this.getExtCertificatePolicies=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("certificatePolicies");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"certificatePolicies",array:[]};g&&(w.critical=!0);for(var E=e(f,0),x=0;x<E.length;x++){var M=i(f,E[x]),C=this.getPolicyInformation(M);w.array.push(C)}return w},this.getPolicyInformation=function(f){var g={},b=a(f,0,[0],"06");g.policyoid=v(b);var w=l(f,0,[1],"30");if(w!=-1){g.array=[];for(var E=e(f,w),x=0;x<E.length;x++){var M=i(f,E[x]),C=this.getPolicyQualifierInfo(M);g.array.push(C)}}return g},this.getPolicyQualifierInfo=function(f){var g={},b=a(f,0,[0],"06");if(b==="2b06010505070201"){var w=o(f,0,[1],"16");g.cps=gr(w)}else if(b==="2b06010505070202"){var E=s(f,0,[1],"30");g.unotice=this.getUserNotice(E)}return g},this.getUserNotice=function(f){for(var g={},b=e(f,0),w=0;w<b.length;w++){var E=i(f,b[w]);E.substr(0,2)!="30"&&(g.exptext=this.getDisplayText(E))}return g},this.getDisplayText=function(f){var g={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},b={};return b.type=g[f.substr(0,2)],b.str=gr(r(f,0)),b},this.getExtCRLNumber=function(f,g){var b={extname:"cRLNumber"};if(g&&(b.critical=!0),f.substr(0,2)=="02")return b.num={hex:r(f,0)},b;throw new Error("hExtV parse error: "+f)},this.getExtCRLReason=function(f,g){var b={extname:"cRLReason"};if(g&&(b.critical=!0),f.substr(0,2)=="0a")return b.code=parseInt(r(f,0),16),b;throw new Error("hExtV parse error: "+f)},this.getExtOcspNonce=function(f,g){var b={extname:"ocspNonce"};g&&(b.critical=!0);var w=r(f,0);return b.hex=w,b},this.getExtOcspNoCheck=function(f,g){var b={extname:"ocspNoCheck"};return g&&(b.critical=!0),b},this.getExtAdobeTimeStamp=function(f,g){if(f===void 0&&g===void 0){var b=this.getExtInfo("adobeTimeStamp");if(b===void 0)return;f=i(this.hex,b.vidx),g=b.critical}var w={extname:"adobeTimeStamp"};g&&(w.critical=!0);var E=e(f,0);if(E.length>1){var x=i(f,E[1]),M=this.getGeneralName(x);M.uri!=null&&(w.uri=M.uri)}if(E.length>2){var C=i(f,E[2]);C=="0101ff"&&(w.reqauth=!0),C=="010100"&&(w.reqauth=!1)}return w},this.getX500NameRule=function(f){for(var g=null,b=[],w=0;w<f.length;w++)for(var E=f[w],x=0;x<E.length;x++)b.push(E[x]);for(var w=0;w<b.length;w++){var M=b[w],C=M.ds,I=M.value,P=M.type;if(C!="prn"&&C!="utf8"&&C!="ia5")return"mixed";if(C=="ia5"){if(P!="CN")return"mixed";if(ee.lang.String.isMail(I))continue;return"mixed"}if(P=="C"){if(C=="prn")continue;return"mixed"}if(g==null)g=C;else if(g!==C)return"mixed"}return g??"prn"},this.getX500Name=function(f){var g=this.getX500NameArray(f),b=this.dnarraytostr(g);return{array:g,str:b}},this.getX500NameArray=function(f){for(var g=[],b=e(f,0),w=0;w<b.length;w++)g.push(this.getRDN(i(f,b[w])));return g},this.getRDN=function(f){for(var g=[],b=e(f,0),w=0;w<b.length;w++)g.push(this.getAttrTypeAndValue(i(f,b[w])));return g},this.getAttrTypeAndValue=function(f){var g={type:null,value:null,ds:null},b=e(f,0),w=a(f,b[0],[],"06"),E=a(f,b[1],[]),x=ee.asn1.ASN1Util.oidHexToInt(w);return g.type=ee.asn1.x509.OID.oid2atype(x),g.ds=this.HEX2STAG[f.substr(b[1],2)],g.ds!="bmp"?g.value=ir(E):g.value=Il(E),g},this.readCertPEM=function(f){this.readCertHex(A(f))},this.readCertHex=function(f){this.hex=f,this.getVersion();try{c(this.hex,0,[0,7],"a3"),this.parseExt()}catch{}},this.getParam=function(){var f={};return f.version=this.getVersion(),f.serial={hex:this.getSerialNumberHex()},f.sigalg=this.getSignatureAlgorithmField(),f.issuer=this.getIssuer(),f.notbefore=this.getNotBefore(),f.notafter=this.getNotAfter(),f.subject=this.getSubject(),f.sbjpubkey=xl(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(f.ext=this.getExtParamArray()),f.sighex=this.getSignatureValueHex(),f},this.getExtParamArray=function(f){if(f==null){var g=l(this.hex,0,[0,"[3]"]);g!=-1&&(f=u(this.hex,0,[0,"[3]",0],"30"))}for(var b=[],w=e(f,0),E=0;E<w.length;E++){var x=i(f,w[E]),M=this.getExtParam(x);M!=null&&b.push(M)}return b},this.getExtParam=function(f){var g=e(f,0),b=g.length;if(b!=2&&b!=3)throw new Error("wrong number elements in Extension: "+b+" "+f);var w=m(a(f,0,[0],"06")),E=!1;b==3&&s(f,0,[1])=="0101ff"&&(E=!0);var x=s(f,0,[b-1,0]),M=void 0;if(w=="2.5.29.14"?M=this.getExtSubjectKeyIdentifier(x,E):w=="2.5.29.15"?M=this.getExtKeyUsage(x,E):w=="2.5.29.17"?M=this.getExtSubjectAltName(x,E):w=="2.5.29.18"?M=this.getExtIssuerAltName(x,E):w=="2.5.29.19"?M=this.getExtBasicConstraints(x,E):w=="2.5.29.31"?M=this.getExtCRLDistributionPoints(x,E):w=="2.5.29.32"?M=this.getExtCertificatePolicies(x,E):w=="2.5.29.35"?M=this.getExtAuthorityKeyIdentifier(x,E):w=="2.5.29.37"?M=this.getExtExtKeyUsage(x,E):w=="1.3.6.1.5.5.7.1.1"?M=this.getExtAuthorityInfoAccess(x,E):w=="2.5.29.20"?M=this.getExtCRLNumber(x,E):w=="2.5.29.21"?M=this.getExtCRLReason(x,E):w=="1.3.6.1.5.5.7.48.1.2"?M=this.getExtOcspNonce(x,E):w=="1.3.6.1.5.5.7.48.1.5"?M=this.getExtOcspNoCheck(x,E):w=="1.2.840.113583.1.1.9.1"&&(M=this.getExtAdobeTimeStamp(x,E)),M!=null)return M;var C={extname:w,extn:x};return E&&(C.critical=!0),C},this.findExt=function(f,g){for(var b=0;b<f.length;b++)if(f[b].extname==g)return f[b];return null},this.dnarraytostr=function(f){function g(w){return w.map(function(E){return b(E).replace(/\+/,"\\+")}).join("+")}function b(w){return w.type+"="+w.value}return"/"+f.map(function(w){return g(w).replace(/\//,"\\/")}).join("/")},this.getInfo=function(){var f=function(j){var z=JSON.stringify(j.array).replace(/[\[\]\{\}\"]/g,"");return z},g=function(j){for(var z="",U=j.array,X=0;X<U.length;X++){var G=U[X];if(z+=" policy oid: "+G.policyoid+`
|
|
363
363
|
`,G.array!==void 0)for(var K=0;K<G.array.length;K++){var Y=G.array[K];Y.cps!==void 0&&(z+=" cps: "+Y.cps+`
|
|
364
364
|
`)}}return z},b=function(j){for(var z="",U=j.array,X=0;X<U.length;X++){var G=U[X];try{G.dpname.full[0].uri!==void 0&&(z+=" "+G.dpname.full[0].uri+`
|
|
365
365
|
`)}catch{}try{G.dname.full[0].dn.hex!==void 0&&(z+=" "+qe.hex2dn(G.dpname.full[0].dn.hex)+`
|
|
@@ -374,8 +374,8 @@
|
|
|
374
374
|
`,E+=" subject: "+this.getSubjectString()+`
|
|
375
375
|
`,E+=` subject public key info:
|
|
376
376
|
`,x=this.getPublicKey(),E+=" key algorithm: "+x.type+`
|
|
377
|
-
`,x.type==="RSA"&&(E+=" n="+
|
|
378
|
-
`,E+=" e="+
|
|
377
|
+
`,x.type==="RSA"&&(E+=" n="+bo(x.n.toString(16)).substr(0,16)+`...
|
|
378
|
+
`,E+=" e="+bo(x.e.toString(16))+`
|
|
379
379
|
`),M=this.aExtInfo,M!=null){E+=`X509v3 Extensions:
|
|
380
380
|
`;for(var C=0;C<M.length;C++){var I=M[C],P=ee.asn1.x509.OID.oid2name(I.oid);P===""&&(P=I.oid);var S="";if(I.critical===!0&&(S="CRITICAL"),E+=" "+P+" "+S+`:
|
|
381
381
|
`,P==="basicConstraints"){var F=this.getExtBasicConstraints();F.cA===void 0?E+=` {}
|
|
@@ -387,36 +387,36 @@
|
|
|
387
387
|
`}else if(P==="subjectAltName"){var L=f(this.getExtSubjectAltName());E+=" "+L+`
|
|
388
388
|
`}else if(P==="cRLDistributionPoints"){var N=this.getExtCRLDistributionPoints();E+=b(N)}else if(P==="authorityInfoAccess"){var V=this.getExtAuthorityInfoAccess();E+=w(V)}else P==="certificatePolicies"&&(E+=g(this.getExtCertificatePolicies()))}}return E+="signature algorithm: "+this.getSignatureAlgorithmName()+`
|
|
389
389
|
`,E+="signature: "+this.getSignatureValueHex().substr(0,16)+`...
|
|
390
|
-
`,E},typeof n=="string"&&(n.indexOf("-----BEGIN")!=-1?this.readCertPEM(n):ee.lang.String.isHex(n)&&this.readCertHex(n))}qe.hex2dn=function(n,t){t===void 0&&(t=0);var e=new qe;ie.getTLV(n,t);var r=e.getX500Name(n);return r.str};qe.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=ie.getChildIdx(n,t),i=0;i<r.length;i++)e.push(qe.hex2attrTypeValue(n,r[i]));return e=e.map(function(a){return a.replace("+","\\+")}),e.join("+")};qe.hex2attrTypeValue=function(n,t){var e=ie,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=ee.asn1.ASN1Util.oidHexToInt(a),s=ee.asn1.x509.OID.oid2atype(o),u=r(n,i[1]),c=gr(u);return s+"="+c};qe.getPublicKeyFromCertHex=function(n){var t=new qe;return t.readCertHex(n),t.getPublicKey()};qe.getPublicKeyFromCertPEM=function(n){var t=new qe;return t.readCertPEM(n),t.getPublicKey()};qe.getPublicKeyInfoPropOfCertPEM=function(n){var t=ie,e=t.getVbyList,r={},i,a;return r.algparam=null,i=new qe,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};qe.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function Mo(n){return ge.SHA256(n).toString()}var Js=[function(){var n=new qe;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[bqx=ng? S^w@|XAz|qUTwfzn]Bu<qs_ae\\y<}u`eRAoE`_\\s\0r|b{rp_o<oC@o=x\bw_cUUZPApQevD\\FxFo\x07FgE=<sq[p<coqyn>TEpP@aSC_YDU8\0|8TB?c>r\\=rp`pcwP}c\0PP_\\RS\\EPVSy8x`\0?R|NP P>}A^VP}Ex\bU\x07Za=syDw}>Ya\x078wPp[pRnn\brU^dE8U?a\bcW|<FEbbupn^`ZNr sof[wA}e{\\z}w[YDQ|dt=wC Nv\x07bR\x07Z@@U|ZAYpFsabCBB\\`wrqxsYW8uFyWdaWezeUeA_8VoVup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FY?OsaqbDcVgQbZeFc ovtucxnq|<TnuyXRveYFOegCpAs{YTe|>bE<OXsSqCBWD_SVepfvCCUg]z ZvQ[\0s|U>pFz\b=OwT``fNJJ:::::R[Q-PR_aVSVPNaR:::::")),n}()];function Rl(n,t){for(var e=0,r=t;e<r.length;e++){var i=r[e];if(i.getSubjectHex()===n)return i}}function Zs(n,t){var e=n.getIssuerHex();if(e===n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=Rl(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:Zs(r,t)}function $s(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:Zs(n,Js)}function Fl(n){var t=new qe;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=$s(t);return Js.push(t),e}function Ol(n,t,e){var r=new qe;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),$s(r)===!1)return!1;var i=new Ce;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,Qa(t))}Fl(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`b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X[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 da=function(n,t){return da=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])},da(n,t)};function de(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");da(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var R=function(){return R=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},R.apply(this,arguments)};function Pt(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 Bt(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function Mi(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(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,t||[])).next())})}function Ci(n,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(e=0)),e;)try{if(r=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,i=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){e.label=c[1];break}if(c[0]===6&&e.label<a[1]){e.label=a[1],a=c;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(c);break}a[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(n,e)}catch(l){c=[6,l],i=0}finally{r=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function at(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 kl(n){return typeof Symbol>"u"?"$Symbol<".concat(n,">$"):Symbol(n)}var Tn=kl("$$FIVE_EVENT$$");function bn(n){return n[Tn]||(n[Tn]={}),n[Tn]}function Ll(n){n[Tn]||delete n[Tn]}var Ii=function(){function n(){}return n.prototype.hasListener=function(t){var e=bn(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,a=bn(this);return a[t]||(a[t]={called:[!1],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){Ll(this);return}var r=bn(this);if(r[t]||(r[t]={called:[!1],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=bn(this);a[t]||(a[t]={called:[!1],callbacks:[]}),a[t].called=[!0,e];for(var o=a[t].callbacks.slice(),s=0,u=o;s<u.length;s++){var c=u[s],l=c[0],h=c[1],p=h===void 0?!1:h,v=l.apply(void 0,e);p&&this.off(t,l),v===!1&&(i=!0)}return i},n.prototype.waitUnitl=function(t){var e=this,r=bn(this);r[t]||(r[t]={called:[!1],callbacks:[]});var i=r[t].called,a=i[0],o=i[1];return a?Promise.resolve(o):new Promise(function(s){e.once(t,function(){for(var u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];return s(u),!0})})},n}();function Q(){}var Dl=typeof performance<"u"&&typeof performance.timing<"u"?performance.timing.navigationStart:Date.now(),ve=typeof performance<"u"?function(){return Dl+performance.now()}:function(){return Date.now()};function Gr(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])&&Gr(n[r])}),n}var Co=/^([^.]+)(\.([^.]+))*$/;function Nl(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 Yr(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function kr(n,t){return Co.test(n)&&Co.test(t)&&Nl(n,t)}var Ql=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],ar=Gr(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/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"))),Va=function(n){de(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),li=function(n){de(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){de(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var fa=function(n){de(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),Ua=function(n){de(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 Vl(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 ha(n){for(var t=0,e=Ql;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function Io(n){return ha(n)!==null}function So(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function qa(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 eu=function(n){de(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Ii);function ln(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=ve(),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 u,c=ha(n),l=c?"Script":"XMLHttpRequest",h=new Va(o,l,s&&s.message?String(s.message):String(s));return(u=t.networkSubscribe)===null||u===void 0||u.emit("network",n,l,"proxy-error",h.message),Promise.reject(h)}).then(function(s){return new Promise(function(u,c){var l,h=t.allowHosts?ar.concat(t.allowHosts):ar.slice(),p=qa(s),v=ha(s);if(location.hostname.length!==0&&!Yr(location.hostname)&&ar.filter(function(k){return kr(k,location.hostname)}).length===0&&!Yr(p)&&h.filter(function(k){return kr(k,p)}).length===0){var m=v?"Script":"XMLHttpRequest",A=new Ua(s,m,"request host(".concat(p,") is not allowed"));r(A),c(A),(l=t.networkSubscribe)===null||l===void 0||l.emit("network",s,m,"forbidden",A.message);return}if(v){var y=window,f=null,g=!1,b=document.createElement("script"),w=function(){var k;if(f=null,g!==!0){g=!0;var O=new fa(s,"Script",t.timeout||NaN);r(O),c(O),(k=t.networkSubscribe)===null||k===void 0||k.emit("network",s,"Script","timeout",O.message)}},E=function(k){var O,L,N=ve(),V=N-a;if(delete y[v],b.parentNode&&b.parentNode.removeChild(b),f!==null&&(window.clearTimeout(f),f=null),g!==!0){if(k.indexOf("data:")!==0){var j=new li(s,"Script",500);r(j),c(j),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"Script","error",j.message);return}var z=k.split(","),U=(z[0].match(/:(.*?);/)||[])[1],X=z[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var G=atob(z[1]),K=G.length,Y=new Uint8Array(K),H=0;H<K;H++)Y[H]=G.charCodeAt(H);t.responseType==="arraybuffer"?X=Y.buffer:X=new Blob([Y],{type:U})}var J={},ne={body:X,meta:{origin:o,source:s,requestTime:a,responseTime:N,costs:V,headers:J}};e(ne),u(ne),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"Script","ok",JSON.stringify(ne.meta)),g=!0}};y[v]=E,b.src=s,document.body.appendChild(b),typeof t.timeout=="number"&&(f=window.setTimeout(w,t.timeout))}else{var x=!1,M=new XMLHttpRequest,C=function(){M&&(M.removeEventListener("timeout",I,!1),M.removeEventListener("progress",P,!1),M.removeEventListener("load",S,!1),M.removeEventListener("error",F,!1)),M=null,C=Q},I=function(){var k;if(x!==!0){x=!0,C();var O=new fa(s,"XMLHttpRequest",t.timeout||NaN);r(O),c(O),(k=t.networkSubscribe)===null||k===void 0||k.emit("network",s,"XMLHttpRequest","timeout",O.message)}},P=function(k){x!==!0&&k.lengthComputable&&(k.total<=0||i(k.loaded/k.total))},S=function(k){var O;if(x!==!0){var L=this.status;if(L===0||L>=200&&L<400){x=!0,C();var N=ve(),V=N-a,j=Vl(this.getAllResponseHeaders()),z=k.total,U={body:this.response,meta:{origin:o,source:s,requestTime:a,responseTime:N,costs:V,headers:j,size:z}};e(U),u(U),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"XMLHttpRequest","ok",JSON.stringify(U.meta))}else F.call(this)}},F=function(){var k;if(x!==!0){x=!0,C();var O=new li(s,"XMLHttpRequest",this.status);r(O),c(O),(k=t.networkSubscribe)===null||k===void 0||k.emit("network",s,"XMLHttpRequest","error",O.message)}};M.addEventListener("timeout",I,!1),M.addEventListener("progress",P,!1),M.addEventListener("load",S,!1),M.addEventListener("error",F,!1),t.responseType&&(M.responseType=t.responseType),typeof t.timeout=="number"&&(M.timeout=t.timeout),M.open("GET",s,!0),M.send(null)}})})}var Qi={};function Ul(n,t){t===void 0&&(t={});var e=ve(),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 Va(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 Qi?Qi[i]:Qi[i]=new Promise(function(a,o){var s,u=t.allowHosts?ar.concat(t.allowHosts):ar.slice(),c=qa(i);if(location.hostname.length!==0&&!Yr(location.hostname)&&ar.filter(function(m){return kr(m,location.hostname)}).length===0&&!Yr(c)&&u.filter(function(m){return kr(m,c)}).length===0){var l=new Ua(i,"Link","request host(".concat(c,") is not allowed"));o(l),(s=t.networkSubscribe)===null||s===void 0||s.emit("network",i,"Link","forbidden",l.message);return}var h=document.createElement("link");h.href=i,h.rel=h.relList&&h.relList.supports("prefetch")?"prefetch":"preload",h.as="fetch",h.crossOrigin="";var p=document.head||document.getElementsByTagName("head")[0];p&&p.appendChild(h);var v=!1;h.onload=function(){var m;if(v!==!0){v=!0,a();var A=ve(),y=A-e,f={},g={origin:r,source:i,requestTime:e,responseTime:A,costs:y,headers:f};(m=t.networkSubscribe)===null||m===void 0||m.emit("network",i,"Link","preload",JSON.stringify(g))}},h.onerror=function(m){var A;if(v!==!0){v=!0;var y=new li(i,"Link",0);o(y),(A=t.networkSubscribe)===null||A===void 0||A.emit("network",i,"Link","error",y.message)}}})})}function ql(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=ve(),s=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(u){return/^https\:/.test(location.href)&&/^http\:/.test(u)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(u,"'. This request was automatically upgraded to HTTPS")),u.replace(/^http\:/,"https:")):u}).catch(function(u){var c,l=new Va(s,"Image",u&&u.message?String(u.message):String(u));return(c=t.networkSubscribe)===null||c===void 0||c.emit("network",n,"Image","proxy-error",l.message),Promise.reject(l)}).then(function(u){return new Promise(function(c,l){var h,p=t.allowHosts?ar.concat(t.allowHosts):ar.slice(),v=qa(u);if(location.hostname.length!==0&&!Yr(location.hostname)&&ar.filter(function(w){return kr(w,location.hostname)}).length===0&&!Yr(v)&&p.filter(function(w){return kr(w,v)}).length===0){var m=new Ua(u,"Image","request host(".concat(v,") is not allowed"));r(m),l(m),(h=t.networkSubscribe)===null||h===void 0||h.emit("network",u,"Image","forbidden",m.message);return}var A=a??new Image,y=!1,f=null,g=function(){var w;if(A.onload=Q,A.onerror=Q,f!==null&&(clearTimeout(f),f=null),y!==!0){var E=ve(),x={headers:{},origin:s,source:u,requestTime:o,responseTime:E,costs:E-o};y=!0;var M={body:A,meta:x};i(1),e(M),c(M),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",u,"Image","ok",JSON.stringify(M.meta))}},b=function(){var w;if(A.onload=Q,A.onerror=Q,f!==null&&(clearTimeout(f),f=null),y!==!0){y=!0;var E=new li(u,"Image",0);r(E),l(E),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",u,"Image","ok",E.message)}};typeof t.timeout=="number"&&(f=window.setTimeout(function(){var w;if(A.onload=Q,A.onerror=Q,f=null,y!==!0){y=!0;var E=new fa(u,"Image",t.timeout);r(E),l(E),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",u,"Image","timeout",E.message)}},t.timeout)),A.onload=g,A.onerror=b,i(0),A.src=u})})}var za=function(){function n(t){t===void 0&&(t={}),this.options=Gr(t)}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,u={responseType:e.responseType,timeout:(o=e.timeout)!==null&&o!==void 0?o:s.timeout,get allowHosts(){var c;return(c=e.allowHosts)!==null&&c!==void 0?c:s.allowHosts},get requestProxy(){var c;return(c=e.requestProxy)!==null&&c!==void 0?c:s.requestProxy},get networkSubscribe(){var c;return(c=e.networkSubscribe)!==null&&c!==void 0?c:s.networkSubscribe}};return ln(t,u,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 u=this.options,c={timeout:(s=e.timeout)!==null&&s!==void 0?s:u.timeout,get allowHosts(){var l;return(l=e.allowHosts)!==null&&l!==void 0?l:u.allowHosts},get requestProxy(){var l;return(l=e.requestProxy)!==null&&l!==void 0?l:u.requestProxy},get networkSubscribe(){var l;return(l=e.networkSubscribe)!==null&&l!==void 0?l:u.networkSubscribe}};return ql(t,c,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 Ul(t,a)},n}(),ci=new za,zl=function(){if(typeof window<"u"){var n=window;return n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||n.msRequestAnimationFrame||function(t){return setTimeout(t,16)}}else return function(t){return setTimeout(t,16)}}(),Hl=function(n){var t;if(typeof window<"u"){var e=window;t=e.cancelAnimationFrame||e.mozCancelAnimationFrame||e.webkitCancelAnimationFrame||e.msCancelAnimationFrame||function(r){return window.clearTimeout(r)}}else t=function(r){return window.clearTimeout(r)};t(n)},jl=5,To=16,it=function(){function n(){this.frames=[],this.stoped=!1,this.time=ve(),this.context=null,this.loop=this.loop.bind(this),this.loop()}return Object.defineProperty(n,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new n),this.sharedInstance},enumerable:!1,configurable:!0}),n.getFrameTime=function(){return To},n.prototype.loop=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!this.stoped){var r=ve(),i=r-this.time;this.time=r;var a=[];To=i;for(var o=0,s=this.frames;o<s.length;o++){var u=s[o];if(u.delay>0){u.delay=u.delay-1;continue}try{u.callback.apply(u,at([r,i],t,!1))}catch(c){console.error(c)}u.once&&a.push(u)}a.length>0&&(this.frames=this.frames.filter(function(c){return a.indexOf(c)===-1})),this.requestAnimationFrame(this.loop)}},n.prototype.setContext=function(t){this.cancelAnimationFrame(this.requestId),this.context=t,this.requestId=this.requestAnimationFrame(this.loop)},n.prototype.getContext=function(){return this.context},n.prototype.requestAnimationFrame=function(t){return this.context?this.context.requestAnimationFrame(t):zl(t)},n.prototype.cancelAnimationFrame=function(t){this.context?this.context.cancelAnimationFrame(t):Hl(this.loop),this.requestId=null},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=jl);var o={callback:t,once:e,delay:r,order:i};return this.frames.push(o),this.frames.sort(function(s,u){return s.order-u.order}),function(){return a.remove(o)}},n.prototype.disponse=function(){this.stoped=!0,this.frames.length=0},n}(),_l={"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"]}},tu=/^https?\:\/\/?([^\/]+)/;function Gl(n){var t=n.match(tu);return t===null?null:t[1]}function $r(n,t){return n.replace(tu,function(e,r){return e.slice(0,e.length-r.length)+t})}function Kl(n,t,e){var r=t.split("."),i=r[0],a=r.slice(1);if(i==="texture")return $r(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 $r(n,e.pano[0]);case"down":case"right":case"back":return $r(n,e.pano[1])}}else if(i==="pano_tile"||i==="pano_tile_luminance"){a[0],a[1];var s=a[2],u=a[3],c=a[4],l=Math.pow(2,Number(s))*Number(u)+Number(c);if(!isNaN(l))return $r(n,e.tile[l%2])}else if(i==="model"){var h=a[0],l=Number(h);if(!isNaN(l))return $r(n,e.model[l%2])}return $r(n,e.default[0])}var Wl=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+)\//),u=s?Number(s[1]):NaN;u!==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},Xl=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,u=t.quality,c=t.size;if(s!==void 0&&s!==i&&o.push("format,".concat(s==="heif"?"heic":s)),t.cut!==void 0){var l=t.cut,h=l[0],p=l[1],v=l[2],m=l[3];o.push("crop,x_".concat(h,",y_").concat(p,",w_").concat(v,",h_").concat(m,",g_nw"))}if(u!==void 0&&u!==100){var A=(e=t.format)!==null&&e!==void 0?e:i;A&&["jpg","webp"].indexOf(A)>=0&&o.push("quality,Q_".concat(u))}return c&&c!==2048&&o.push("resize,w_".concat(c)),t.sharpen!==void 0&&o.push("sharpen,".concat(t.sharpen)),o.length&&(a="?x-oss-process=image/"+o.join("/")),r+a};function qt(n,t){var e=R(R({},_l),t.mappings),r=Gl(n);if(r===null)return n;var i=e[r];return i?(n=Kl(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?Wl(n,t):i.type==="aliyun"?Xl(n,t):n):n}function di(n,t,e){t===void 0&&(t=qt);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var Yl="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",Jl="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",Zl="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function Vi(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 Ui=null;function ru(){return Ui||(Ui=Promise.all([Vi(Yl),Vi(Jl),Vi(Zl)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var nu=/^(.*)\[(\d+)\]$/;function Be(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function Ye(n){var t=n.match(nu);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 Ft(n,t){return Be(n)===Be(t)}function iu(n){return typeof n=="string"&&nu.test(n)}var $l=function(n){de(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(d.Group),_t=function(n){de(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=ec,i}return t}(d.Mesh);function ec(n,t,e){for(var r=0,i=this.material;r<i.length;r++){var a=i[r];this.model&&a.syncModel(this.model),a.update(n,e)}}var Nn=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=");Nn.minFilter=d.NearestFilter;Nn.magFilter=d.NearestFilter;Nn.wrapS=d.RepeatWrapping;Nn.wrapT=d.RepeatWrapping;var be={pano0:null,pano1:null,shownFloorIndex:-1,modelAlpha:1,opacity:1,progress:0,useBlackTransition:!1,clippers:null,constantColor:null,useEDL:!1,useHQWeight:!1,useHQDepth:!1,pointColor:"RGB",pointSize:"ATTENUATION",pointBack:"DARK",pointShape:"SQUARE",pointScale:.03,pointMaxPixel:40,pointMinPixel:.5,gradientTexture:Nn};function tc(n,t){var e=n??[],r=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 rc(n,t){return n&&t?n.luminanceMap===t.luminanceMap&&n.map===t.map&&n.matrix.equals(t.matrix):!n&&!t}function au(n,t){var e=!1;for(var r in t)switch(r){case"clippers":tc(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":rc(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}var Lr=function(n){de(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=nc,i}return t}(d.Points);function nc(n,t,e){this.model&&this.material.syncModel(this.model),this.material.update(n,e)}var en=new Set,ou=function(n){de(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=R({},be),e}return t.prototype.getMaterial=function(){return R({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),en.clear(),this.traverse(function(i){if(i instanceof _t)for(var a=0,o=i.material;a<o.length;a++){var s=o[a];en.has(s)||(Object.assign(s,r.materialParameters),en.add(s))}i instanceof Lr&&(en.has(i.material)||(Object.assign(i.material,r.materialParameters),en.add(i.material)))}),en.clear(),this.needsRender=!0},t}(d.Group),ic=["right","left","up","down","front","back"];function su(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 uu=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],u={face:n.face,level:e,size:r,position:s,box:su(n.face,s.x,s.y,r),children:[]};n.children.push(u),uu(u,t)}};function ac(n,t){var e={level:0,face:n,position:new d.Vector2(0,0),size:1,box:su(n,0,0,1),children:[]};return uu(e,t),e}function pa(n){var t=ic.map(function(e){return ac(e,n)});return{children:t}}function Ha(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],a=t(i);a!==!1&&Ha(i,t)}}var Qn=new d.BoxBufferGeometry(1,1,1,1,1);Qn.deleteAttribute("uv");Qn.deleteAttribute("normal");Qn.groups=[];Qn.scale(-1,1,1);var oc=`
|
|
390
|
+
`,E},typeof n=="string"&&(n.indexOf("-----BEGIN")!=-1?this.readCertPEM(n):ee.lang.String.isHex(n)&&this.readCertHex(n))}qe.hex2dn=function(n,t){t===void 0&&(t=0);var e=new qe;ie.getTLV(n,t);var r=e.getX500Name(n);return r.str};qe.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=ie.getChildIdx(n,t),i=0;i<r.length;i++)e.push(qe.hex2attrTypeValue(n,r[i]));return e=e.map(function(a){return a.replace("+","\\+")}),e.join("+")};qe.hex2attrTypeValue=function(n,t){var e=ie,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=ee.asn1.ASN1Util.oidHexToInt(a),s=ee.asn1.x509.OID.oid2atype(o),u=r(n,i[1]),c=gr(u);return s+"="+c};qe.getPublicKeyFromCertHex=function(n){var t=new qe;return t.readCertHex(n),t.getPublicKey()};qe.getPublicKeyFromCertPEM=function(n){var t=new qe;return t.readCertPEM(n),t.getPublicKey()};qe.getPublicKeyInfoPropOfCertPEM=function(n){var t=ie,e=t.getVbyList,r={},i,a;return r.algparam=null,i=new qe,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};qe.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function Eo(n){return ge.SHA256(n).toString()}var Xs=[function(){var n=new qe;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^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?x\bf>V OUwY=>X[\\E`tW[8}VwpF\x07BQcnrPF}yUtd8<Doe_\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 Pl(n,t){for(var e=0,r=t;e<r.length;e++){var i=r[e];if(i.getSubjectHex()===n)return i}}function Ys(n,t){var e=n.getIssuerHex();if(e===n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=Pl(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:Ys(r,t)}function Js(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:Ys(n,Xs)}function Bl(n){var t=new qe;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=Js(t);return Xs.push(t),e}function Rl(n,t,e){var r=new qe;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),Js(r)===!1)return!1;var i=new Ce;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,Qa(t))}Bl(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`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Sr>QBxO d_D}eBb?Uq^b [y}x]}{?P|BQtecTB[pQBW>|p|nfv\0zU\x07xOO}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 da=function(n,t){return da=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])},da(n,t)};function de(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");da(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var R=function(){return R=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},R.apply(this,arguments)};function Pt(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 Bt(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function Mi(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(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,t||[])).next())})}function Ci(n,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(e=0)),e;)try{if(r=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,i=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){e.label=c[1];break}if(c[0]===6&&e.label<a[1]){e.label=a[1],a=c;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(c);break}a[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(n,e)}catch(l){c=[6,l],i=0}finally{r=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function at(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 Fl(n){return typeof Symbol>"u"?"$Symbol<".concat(n,">$"):Symbol(n)}var Tn=Fl("$$FIVE_EVENT$$");function bn(n){return n[Tn]||(n[Tn]={}),n[Tn]}function Ol(n){n[Tn]||delete n[Tn]}var Ii=function(){function n(){}return n.prototype.hasListener=function(t){var e=bn(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,a=bn(this);return a[t]||(a[t]={called:[!1],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){Ol(this);return}var r=bn(this);if(r[t]||(r[t]={called:[!1],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=bn(this);a[t]||(a[t]={called:[!1],callbacks:[]}),a[t].called=[!0,e];for(var o=a[t].callbacks.slice(),s=0,u=o;s<u.length;s++){var c=u[s],l=c[0],h=c[1],p=h===void 0?!1:h,v=l.apply(void 0,e);p&&this.off(t,l),v===!1&&(i=!0)}return i},n.prototype.waitUnitl=function(t){var e=this,r=bn(this);r[t]||(r[t]={called:[!1],callbacks:[]});var i=r[t].called,a=i[0],o=i[1];return a?Promise.resolve(o):new Promise(function(s){e.once(t,function(){for(var u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];return s(u),!0})})},n}();function Q(){}var kl=typeof performance<"u"&&typeof performance.timing<"u"?performance.timing.navigationStart:Date.now(),ve=typeof performance<"u"?function(){return kl+performance.now()}:function(){return Date.now()};function Gr(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])&&Gr(n[r])}),n}var xo=/^([^.]+)(\.([^.]+))*$/;function Ll(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 Yr(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function kr(n,t){return xo.test(n)&&xo.test(t)&&Ll(n,t)}var Dl=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],ar=Gr(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/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"))),Va=function(n){de(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),li=function(n){de(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){de(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var fa=function(n){de(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),Ua=function(n){de(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 Nl(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 ha(n){for(var t=0,e=Dl;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function Mo(n){return ha(n)!==null}function Co(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function qa(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 Zs=function(n){de(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Ii);function ln(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=ve(),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 u,c=ha(n),l=c?"Script":"XMLHttpRequest",h=new Va(o,l,s&&s.message?String(s.message):String(s));return(u=t.networkSubscribe)===null||u===void 0||u.emit("network",n,l,"proxy-error",h.message),Promise.reject(h)}).then(function(s){return new Promise(function(u,c){var l,h=t.allowHosts?ar.concat(t.allowHosts):ar.slice(),p=qa(s),v=ha(s);if(location.hostname.length!==0&&!Yr(location.hostname)&&ar.filter(function(k){return kr(k,location.hostname)}).length===0&&!Yr(p)&&h.filter(function(k){return kr(k,p)}).length===0){var m=v?"Script":"XMLHttpRequest",A=new Ua(s,m,"request host(".concat(p,") is not allowed"));r(A),c(A),(l=t.networkSubscribe)===null||l===void 0||l.emit("network",s,m,"forbidden",A.message);return}if(v){var y=window,f=null,g=!1,b=document.createElement("script"),w=function(){var k;if(f=null,g!==!0){g=!0;var O=new fa(s,"Script",t.timeout||NaN);r(O),c(O),(k=t.networkSubscribe)===null||k===void 0||k.emit("network",s,"Script","timeout",O.message)}},E=function(k){var O,L,N=ve(),V=N-a;if(delete y[v],b.parentNode&&b.parentNode.removeChild(b),f!==null&&(window.clearTimeout(f),f=null),g!==!0){if(k.indexOf("data:")!==0){var j=new li(s,"Script",500);r(j),c(j),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"Script","error",j.message);return}var z=k.split(","),U=(z[0].match(/:(.*?);/)||[])[1],X=z[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var G=atob(z[1]),K=G.length,Y=new Uint8Array(K),H=0;H<K;H++)Y[H]=G.charCodeAt(H);t.responseType==="arraybuffer"?X=Y.buffer:X=new Blob([Y],{type:U})}var J={},ne={body:X,meta:{origin:o,source:s,requestTime:a,responseTime:N,costs:V,headers:J}};e(ne),u(ne),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"Script","ok",JSON.stringify(ne.meta)),g=!0}};y[v]=E,b.src=s,document.body.appendChild(b),typeof t.timeout=="number"&&(f=window.setTimeout(w,t.timeout))}else{var x=!1,M=new XMLHttpRequest,C=function(){M&&(M.removeEventListener("timeout",I,!1),M.removeEventListener("progress",P,!1),M.removeEventListener("load",S,!1),M.removeEventListener("error",F,!1)),M=null,C=Q},I=function(){var k;if(x!==!0){x=!0,C();var O=new fa(s,"XMLHttpRequest",t.timeout||NaN);r(O),c(O),(k=t.networkSubscribe)===null||k===void 0||k.emit("network",s,"XMLHttpRequest","timeout",O.message)}},P=function(k){x!==!0&&k.lengthComputable&&(k.total<=0||i(k.loaded/k.total))},S=function(k){var O;if(x!==!0){var L=this.status;if(L===0||L>=200&&L<400){x=!0,C();var N=ve(),V=N-a,j=Nl(this.getAllResponseHeaders()),z=k.total,U={body:this.response,meta:{origin:o,source:s,requestTime:a,responseTime:N,costs:V,headers:j,size:z}};e(U),u(U),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"XMLHttpRequest","ok",JSON.stringify(U.meta))}else F.call(this)}},F=function(){var k;if(x!==!0){x=!0,C();var O=new li(s,"XMLHttpRequest",this.status);r(O),c(O),(k=t.networkSubscribe)===null||k===void 0||k.emit("network",s,"XMLHttpRequest","error",O.message)}};M.addEventListener("timeout",I,!1),M.addEventListener("progress",P,!1),M.addEventListener("load",S,!1),M.addEventListener("error",F,!1),t.responseType&&(M.responseType=t.responseType),typeof t.timeout=="number"&&(M.timeout=t.timeout),M.open("GET",s,!0),M.send(null)}})})}var Qi={};function Ql(n,t){t===void 0&&(t={});var e=ve(),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 Va(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 Qi?Qi[i]:Qi[i]=new Promise(function(a,o){var s,u=t.allowHosts?ar.concat(t.allowHosts):ar.slice(),c=qa(i);if(location.hostname.length!==0&&!Yr(location.hostname)&&ar.filter(function(m){return kr(m,location.hostname)}).length===0&&!Yr(c)&&u.filter(function(m){return kr(m,c)}).length===0){var l=new Ua(i,"Link","request host(".concat(c,") is not allowed"));o(l),(s=t.networkSubscribe)===null||s===void 0||s.emit("network",i,"Link","forbidden",l.message);return}var h=document.createElement("link");h.href=i,h.rel=h.relList&&h.relList.supports("prefetch")?"prefetch":"preload",h.as="fetch",h.crossOrigin="";var p=document.head||document.getElementsByTagName("head")[0];p&&p.appendChild(h);var v=!1;h.onload=function(){var m;if(v!==!0){v=!0,a();var A=ve(),y=A-e,f={},g={origin:r,source:i,requestTime:e,responseTime:A,costs:y,headers:f};(m=t.networkSubscribe)===null||m===void 0||m.emit("network",i,"Link","preload",JSON.stringify(g))}},h.onerror=function(m){var A;if(v!==!0){v=!0;var y=new li(i,"Link",0);o(y),(A=t.networkSubscribe)===null||A===void 0||A.emit("network",i,"Link","error",y.message)}}})})}function Vl(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=ve(),s=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(u){return/^https\:/.test(location.href)&&/^http\:/.test(u)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(u,"'. This request was automatically upgraded to HTTPS")),u.replace(/^http\:/,"https:")):u}).catch(function(u){var c,l=new Va(s,"Image",u&&u.message?String(u.message):String(u));return(c=t.networkSubscribe)===null||c===void 0||c.emit("network",n,"Image","proxy-error",l.message),Promise.reject(l)}).then(function(u){return new Promise(function(c,l){var h,p=t.allowHosts?ar.concat(t.allowHosts):ar.slice(),v=qa(u);if(location.hostname.length!==0&&!Yr(location.hostname)&&ar.filter(function(w){return kr(w,location.hostname)}).length===0&&!Yr(v)&&p.filter(function(w){return kr(w,v)}).length===0){var m=new Ua(u,"Image","request host(".concat(v,") is not allowed"));r(m),l(m),(h=t.networkSubscribe)===null||h===void 0||h.emit("network",u,"Image","forbidden",m.message);return}var A=a??new Image,y=!1,f=null,g=function(){var w;if(A.onload=Q,A.onerror=Q,f!==null&&(clearTimeout(f),f=null),y!==!0){var E=ve(),x={headers:{},origin:s,source:u,requestTime:o,responseTime:E,costs:E-o};y=!0;var M={body:A,meta:x};i(1),e(M),c(M),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",u,"Image","ok",JSON.stringify(M.meta))}},b=function(){var w;if(A.onload=Q,A.onerror=Q,f!==null&&(clearTimeout(f),f=null),y!==!0){y=!0;var E=new li(u,"Image",0);r(E),l(E),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",u,"Image","ok",E.message)}};typeof t.timeout=="number"&&(f=window.setTimeout(function(){var w;if(A.onload=Q,A.onerror=Q,f=null,y!==!0){y=!0;var E=new fa(u,"Image",t.timeout);r(E),l(E),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",u,"Image","timeout",E.message)}},t.timeout)),A.onload=g,A.onerror=b,i(0),A.src=u})})}var za=function(){function n(t){t===void 0&&(t={}),this.options=Gr(t)}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,u={responseType:e.responseType,timeout:(o=e.timeout)!==null&&o!==void 0?o:s.timeout,get allowHosts(){var c;return(c=e.allowHosts)!==null&&c!==void 0?c:s.allowHosts},get requestProxy(){var c;return(c=e.requestProxy)!==null&&c!==void 0?c:s.requestProxy},get networkSubscribe(){var c;return(c=e.networkSubscribe)!==null&&c!==void 0?c:s.networkSubscribe}};return ln(t,u,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 u=this.options,c={timeout:(s=e.timeout)!==null&&s!==void 0?s:u.timeout,get allowHosts(){var l;return(l=e.allowHosts)!==null&&l!==void 0?l:u.allowHosts},get requestProxy(){var l;return(l=e.requestProxy)!==null&&l!==void 0?l:u.requestProxy},get networkSubscribe(){var l;return(l=e.networkSubscribe)!==null&&l!==void 0?l:u.networkSubscribe}};return Vl(t,c,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 Ql(t,a)},n}(),ci=new za,Ul=function(){if(typeof window<"u"){var n=window;return n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||n.msRequestAnimationFrame||function(t){return setTimeout(t,16)}}else return function(t){return setTimeout(t,16)}}(),ql=function(n){var t;if(typeof window<"u"){var e=window;t=e.cancelAnimationFrame||e.mozCancelAnimationFrame||e.webkitCancelAnimationFrame||e.msCancelAnimationFrame||function(r){return window.clearTimeout(r)}}else t=function(r){return window.clearTimeout(r)};t(n)},zl=5,Io=16,it=function(){function n(){this.frames=[],this.stoped=!1,this.time=ve(),this.context=null,this.loop=this.loop.bind(this),this.loop()}return Object.defineProperty(n,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new n),this.sharedInstance},enumerable:!1,configurable:!0}),n.getFrameTime=function(){return Io},n.prototype.loop=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!this.stoped){var r=ve(),i=r-this.time;this.time=r;var a=[];Io=i;for(var o=0,s=this.frames;o<s.length;o++){var u=s[o];if(u.delay>0){u.delay=u.delay-1;continue}try{u.callback.apply(u,at([r,i],t,!1))}catch(c){console.error(c)}u.once&&a.push(u)}a.length>0&&(this.frames=this.frames.filter(function(c){return a.indexOf(c)===-1})),this.requestAnimationFrame(this.loop)}},n.prototype.setContext=function(t){this.cancelAnimationFrame(this.requestId),this.context=t,this.requestId=this.requestAnimationFrame(this.loop)},n.prototype.getContext=function(){return this.context},n.prototype.requestAnimationFrame=function(t){return this.context?this.context.requestAnimationFrame(t):Ul(t)},n.prototype.cancelAnimationFrame=function(t){this.context?this.context.cancelAnimationFrame(t):ql(this.loop),this.requestId=null},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=zl);var o={callback:t,once:e,delay:r,order:i};return this.frames.push(o),this.frames.sort(function(s,u){return s.order-u.order}),function(){return a.remove(o)}},n.prototype.disponse=function(){this.stoped=!0,this.frames.length=0},n}(),Hl={"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"]}},$s=/^https?\:\/\/?([^\/]+)/;function jl(n){var t=n.match($s);return t===null?null:t[1]}function $r(n,t){return n.replace($s,function(e,r){return e.slice(0,e.length-r.length)+t})}function _l(n,t,e){var r=t.split("."),i=r[0],a=r.slice(1);if(i==="texture")return $r(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 $r(n,e.pano[0]);case"down":case"right":case"back":return $r(n,e.pano[1])}}else if(i==="pano_tile"||i==="pano_tile_luminance"){a[0],a[1];var s=a[2],u=a[3],c=a[4],l=Math.pow(2,Number(s))*Number(u)+Number(c);if(!isNaN(l))return $r(n,e.tile[l%2])}else if(i==="model"){var h=a[0],l=Number(h);if(!isNaN(l))return $r(n,e.model[l%2])}return $r(n,e.default[0])}var Gl=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+)\//),u=s?Number(s[1]):NaN;u!==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},Kl=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,u=t.quality,c=t.size;if(s!==void 0&&s!==i&&o.push("format,".concat(s==="heif"?"heic":s)),t.cut!==void 0){var l=t.cut,h=l[0],p=l[1],v=l[2],m=l[3];o.push("crop,x_".concat(h,",y_").concat(p,",w_").concat(v,",h_").concat(m,",g_nw"))}if(u!==void 0&&u!==100){var A=(e=t.format)!==null&&e!==void 0?e:i;A&&["jpg","webp"].indexOf(A)>=0&&o.push("quality,Q_".concat(u))}return c&&c!==2048&&o.push("resize,w_".concat(c)),t.sharpen!==void 0&&o.push("sharpen,".concat(t.sharpen)),o.length&&(a="?x-oss-process=image/"+o.join("/")),r+a};function qt(n,t){var e=R(R({},Hl),t.mappings),r=jl(n);if(r===null)return n;var i=e[r];return i?(n=_l(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?Gl(n,t):i.type==="aliyun"?Kl(n,t):n):n}function di(n,t,e){t===void 0&&(t=qt);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var Wl="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",Xl="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",Yl="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function Vi(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 Ui=null;function eu(){return Ui||(Ui=Promise.all([Vi(Wl),Vi(Xl),Vi(Yl)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var tu=/^(.*)\[(\d+)\]$/;function Be(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function Ye(n){var t=n.match(tu);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 Ft(n,t){return Be(n)===Be(t)}function ru(n){return typeof n=="string"&&tu.test(n)}var Jl=function(n){de(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(d.Group),_t=function(n){de(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=Zl,i}return t}(d.Mesh);function Zl(n,t,e){for(var r=0,i=this.material;r<i.length;r++){var a=i[r];this.model&&a.syncModel(this.model),a.update(n,e)}}var Nn=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=");Nn.minFilter=d.NearestFilter;Nn.magFilter=d.NearestFilter;Nn.wrapS=d.RepeatWrapping;Nn.wrapT=d.RepeatWrapping;var be={pano0:null,pano1:null,shownFloorIndex:-1,modelAlpha:1,opacity:1,progress:0,useBlackTransition:!1,clippers:null,constantColor:null,useEDL:!1,useHQWeight:!1,useHQDepth:!1,pointColor:"RGB",pointSize:"ATTENUATION",pointBack:"DARK",pointShape:"SQUARE",pointScale:.03,pointMaxPixel:40,pointMinPixel:.5,gradientTexture:Nn};function $l(n,t){var e=n??[],r=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 ec(n,t){return n&&t?n.luminanceMap===t.luminanceMap&&n.map===t.map&&n.matrix.equals(t.matrix):!n&&!t}function nu(n,t){var e=!1;for(var r in t)switch(r){case"clippers":$l(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":ec(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}var Lr=function(n){de(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=tc,i}return t}(d.Points);function tc(n,t,e){this.model&&this.material.syncModel(this.model),this.material.update(n,e)}var en=new Set,iu=function(n){de(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=R({},be),e}return t.prototype.getMaterial=function(){return R({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),en.clear(),this.traverse(function(i){if(i instanceof _t)for(var a=0,o=i.material;a<o.length;a++){var s=o[a];en.has(s)||(Object.assign(s,r.materialParameters),en.add(s))}i instanceof Lr&&(en.has(i.material)||(Object.assign(i.material,r.materialParameters),en.add(i.material)))}),en.clear(),this.needsRender=!0},t}(d.Group),rc=["right","left","up","down","front","back"];function au(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 ou=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],u={face:n.face,level:e,size:r,position:s,box:au(n.face,s.x,s.y,r),children:[]};n.children.push(u),ou(u,t)}};function nc(n,t){var e={level:0,face:n,position:new d.Vector2(0,0),size:1,box:au(n,0,0,1),children:[]};return ou(e,t),e}function pa(n){var t=rc.map(function(e){return nc(e,n)});return{children:t}}function Ha(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],a=t(i);a!==!1&&Ha(i,t)}}var Qn=new d.BoxBufferGeometry(1,1,1,1,1);Qn.deleteAttribute("uv");Qn.deleteAttribute("normal");Qn.groups=[];Qn.scale(-1,1,1);var ic=`
|
|
392
392
|
varying vec3 worldPosition;
|
|
393
393
|
void main() {
|
|
394
394
|
vec4 transform = vec4(position, 1.0);
|
|
395
395
|
worldPosition = (modelMatrix * transform).xyz;
|
|
396
396
|
gl_Position = projectionMatrix * modelViewMatrix * transform;
|
|
397
397
|
}
|
|
398
|
-
`,
|
|
398
|
+
`,ac=`
|
|
399
399
|
uniform samplerCube map;
|
|
400
400
|
varying vec3 worldPosition;
|
|
401
401
|
void main() {
|
|
402
402
|
gl_FragColor = textureCube(map, worldPosition);
|
|
403
403
|
}
|
|
404
|
-
`,va=new d.ShaderMaterial({uniforms:{map:{value:null}},vertexShader:
|
|
404
|
+
`,va=new d.ShaderMaterial({uniforms:{map:{value:null}},vertexShader:ic,fragmentShader:ac,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1,fog:!1}),ja=new d.Scene;ja.matrixAutoUpdate=!1;var su=new d.Mesh(Qn,va);su.matrixAutoUpdate=!1;ja.add(su);function Aa(n,t,e){va.uniforms.map.value=n;var r=e.autoClear;e.autoClear=!1;var i=new d.CubeCamera(.1,2,t);i.matrixAutoUpdate=!1,i.update(e,ja),e.autoClear=r,va.uniforms.map.value=null}var qi,xr=(qi=Math.SQRT1_2)!==null&&qi!==void 0?qi:Math.sqrt(2),oc={up:new d.Quaternion(xr,0,0,xr),down:new d.Quaternion(-xr,0,0,xr),left:new d.Quaternion(0,xr,0,xr),right:new d.Quaternion(0,-xr,0,xr),front:new d.Quaternion(0,0,0,1),back:new d.Quaternion(0,1,0,0)},sc=function(){var n=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),t=new Float32Array([0,0,1,0,0,1,1,1]),e=new Uint8Array([0,1,2,1,3,2]),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}(),uc=`
|
|
405
405
|
varying vec2 vUv;
|
|
406
406
|
uniform float flipY;
|
|
407
407
|
void main() {
|
|
408
408
|
vUv = vec2(uv.x, mix(uv.y, (1.0 - uv.y), flipY));
|
|
409
409
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
410
410
|
}
|
|
411
|
-
`,
|
|
411
|
+
`,lc=`
|
|
412
412
|
uniform sampler2D map;
|
|
413
413
|
varying vec2 vUv;
|
|
414
414
|
void main() {
|
|
415
415
|
gl_FragColor = texture2D(map, vUv);
|
|
416
416
|
}
|
|
417
|
-
`,cu=[];function fc(){var n=cu.pop();return n||new d.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:cc,fragmentShader:dc,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function hc(n){n.uniforms.map.value=null,cu.push(n)}function pc(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=0,s=n;o<s.length;o++){var u=s[o],c=fc();a.push(c),c.uniforms.map.value=u.texture,c.uniforms.flipY.value=u.flipY?1:0;var l=new d.Group,h=new d.Mesh(lc,c);h.position.set(u.position.x+u.size.x/2-.5,1-(u.position.y+u.size.y/2)-.5,-.5),h.scale.set(u.size.x,u.size.y,1),l.quaternion.copy(uc[u.face]),l.add(h),i.add(l)}var p=e.autoClear;e.autoClear=!1;var v=new d.CubeCamera(.1,2,t);v.matrixAutoUpdate=!1,v.update(e,r),e.autoClear=p;for(var m=0,A=a;m<A.length;m++){var c=A[m];hc(c)}}var ma=[],vc=6,zi=0;it.shared.add(function(){if(zi=vc,ma.length)for(var n=ma.splice(0,zi),t=0,e=n;t<e.length;t++){var r=e[t];zi--,r()}});var Ac=!!window.ImageBitmap,ga=function(){return!1}();function fi(){var n=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onerror=n.onload=n.close=Q,n.removeAttribute("src"),/^blob\:/.test(n.src)&&URL.revokeObjectURL(n.src)}});return n}function du(n){return new Promise(function(t,e){var r=fi();r.onload=function(){/^blob\:/.test(r.src)&&URL.revokeObjectURL(r.src),r.onload=r.onerror=Q,setTimeout(function(){t(r)},0)},r.onerror=function(){var i=r.src;r.onload=r.onerror=Q,r.close(),e(new Error("image load error: ".concat(i)))},r.src=URL.createObjectURL(n)})}function Po(n){return new Promise(function(t){ma.push(function(){t(du(n))})})}var Bo=[];function mc(n,t){var e=Bo.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,Bo.push(r)}});return r}function Ro(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=mc(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,Ac&&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 gc(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 Hr=["right","left","up","down","front","back"],yc=4,Qe=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.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.textures=[],this.baseCubeTexture=t}return Object.defineProperty(n.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(t){var e,r,i,a,o;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,this.baseCubeTexture&&(Aa(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&Aa(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,u,c=this.tileSources.filter(function(A){return A.level===t.level})[0];if(!c){this.loadedCubeNodes.add(t);return}var l=c.size,h=Math.pow(2,t.level)*t.position.y,p=Math.pow(2,t.level)*t.position.x,v="".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(h,".").concat(p),m=R(R({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:v,size:l*t.size===this.options.tileImageSize?void 0:this.options.tileImageSize,quality:void 0,cut:[l*t.position.x,l*t.position.y,l*t.size,l*t.size]});this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(c[t.face],{imageURL:{transform:(u=this.options.imageURL)===null||u===void 0?void 0:u.transform,options:R({},m)},format:d.RGBAFormat,viaAjax:ga,timeout:this.options.timeout,fetcher:this.options.fetcher}).then(function(A){if(e.disposed){A.body.dispose();return}e.textures.push({face:t.face,level:t.level,position:t.position,size:new d.Vector2(t.size,t.size),texture:A.body,flipY:!A.body.flipY}),e.loadedCubeNodes.add(t)}).catch(Q).then(function(){e.disposed||e.loadingCubeNodes.delete(t)})},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=[];Ha(this.tileTree,function(p){if(r.loadingCubeNodes.has(p)||p.level>e||!t.intersectsBox(p.box))return!1;if(!r.loadedCubeNodes.has(p))return i.push(p),!1});for(var a=0,o=i;a<o.length;a++){var s=o[a];this.requestTile(s)}if(this.cubeRenderTarget&&this.textures.length){var u=this.textures.splice(0,yc);pc(u,this.cubeRenderTarget,this.renderer),this.needsRender=!0;for(var c=0,l=u;c<l.length;c++){var h=l[c];h.texture.dispose()}}}},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.textures;t<e.length;t++){var r=e[t];r.texture.dispose()}this.textures.length=0}},n}(),An=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,u,c,l;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.flipY<"u"&&(h.flipY=e.flipY),typeof e.format<"u"&&(h.format=e.format),typeof e.minFilter<"u"&&(h.minFilter=e.minFilter),typeof e.magFilter<"u"&&(h.magFilter=e.magFilter);var p=(u=(s=e.imageURL)===null||s===void 0?void 0:s.options)!==null&&u!==void 0?u:{key:"unknown"};t=di(t,(c=e.imageURL)===null||c===void 0?void 0:c.transform,p);var v=So(t),m=(l=e.viaAjax)!==null&&l!==void 0?l:!1,A=Io(t),y=/^https?:/.test(v);if(A?m=!0:y||(m=!1),m){var f=null,g="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:g},void 0,void 0,a).then(function(E){return Po(E.body)}).then(function(E){return Ro(E,e.maxSize)}).then(function(E){return Object.assign(E,h),E}).then(function(E){var x={meta:f,body:E};return r(x),x}).catch(function(E){return i(E),Promise.reject(E)})}else{var b=null,w;return Promise.resolve().then(function(){return fi()}).then(function(E){return w=E,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,E)}).then(function(E){return b=E.meta,Ro(E.body,e.maxSize)}).then(function(E){return Object.assign(E,h),E}).then(function(E){var x={meta:b,body:E};return r(x),x}).catch(function(E){return w&&w.close(),i(E),Promise.reject(E)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,u,c,l;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q),typeof e.format<"u"&&e.format,typeof e.minFilter<"u"&&e.minFilter,typeof e.magFilter<"u"&&e.magFilter;for(var h=[t[Hr[0]],t[Hr[1]],t[Hr[2]],t[Hr[3]],t[Hr[4]],t[Hr[5]]],p=[],v=[0,0,0,0,0,0],m=[],A=function(f){var g=(u=(s=e.imageURL)===null||s===void 0?void 0:s.options)!==null&&u!==void 0?u:{key:"unknown"},b=di(h[f],(c=e.imageURL)===null||c===void 0?void 0:c.transform,R(R({},g),{key:g.key+"."+Hr[f]})),w=So(b),E=function(F){v[f]=F,a(v.reduce(function(k,O){return k+O},0)/6)},x=(l=e.viaAjax)!==null&&l!==void 0?l:!1,M=/^https?:$/.test(w),C=Io(b);if(C?x=!0:M||(x=!1),x){var I="blob",P=e.fetcher.ajax(b,{timeout:e.timeout,responseType:I},void 0,void 0,E).then(function(F){return m[f]=F.meta,Po(F.body)});p.push(P)}else{var S,P=Promise.resolve().then(function(){return fi()}).then(function(k){return S=k,e.fetcher.loadImage(b,{timeout:e.timeout},void 0,void 0,E,k)}).then(function(k){return m[f]=k.meta,k.body}).catch(function(k){return S&&S.close(),Promise.reject(k)});p.push(P)}},y=0;y<6;y++)A(y);return Promise.all(p).then(function(f){return gc(f)}).then(function(f){return Object.assign(f,R({encoding:d.sRGBEncoding},e)),f}).then(function(f){var g={body:f,meta:m};return r(g),g}).catch(function(f){for(var g=0,b=p;g<b.length;g++){var w=b[g];w.then(function(E){return E.close()}).catch(Q)}return i(f),Promise.reject(f)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var u=this;return i===void 0&&(i=Q),a===void 0&&(a=Q),o===void 0&&(o=Q),new Promise(function(c,l){var h,p;u.loadCubeTexture(t,{imageURL:{transform:(h=r.imageURL)===null||h===void 0?void 0:h.transform,options:(p=r.imageURL)===null||p===void 0?void 0:p.options},format:d.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher},function(v){var m,A,y=v.meta,f=v.body,g=(m=r.tileImageSize)!==null&&m!==void 0?m:512,b=(A=r.tileMaxLevel)!==null&&A!==void 0?A:2,w=Math.max(1024*b,512),E=pa(b),x=new Qe(f,E,e,{textureSize:w,tileImageSize:g,textureLoader:u,imageURL:r.imageURL,timeout:r.timeout,fetcher:r.fetcher},s),M={meta:y,body:x};i(M),c(M)},function(v){a(v),l(v)},o,s).catch(Q)})},n}();const bc=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`RlcR_aRelSY\\\\_6--nvor-sy|n-sy||H--n\bv{t-sy|n-Sy||H0r{qvsnvor-sy|n-v_||sZnxHn\bv{t-sy|n-V_||sZnxHn\bv{t-rp@-[|znyHn\bv{t-rp@-cvr]|vv|{Hn\bv{t-rpA-|yq]|vv|{Hn\bv{t-sy|n-Y|tQr}uHn\bv{t-znA-cvrZnv\x07H0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrr\x07K0v{pyqr-I?l}nlrr\x07K0v{pyqr-Ip|y|l}nlrr\x07K0v{pyqr-Iunq|zn}l}nlrr\x07K|vq-znv{56-\n--0v{pyqr-Ilrr\x07K--0v{pyqr-I?lrr\x07K--0v{pyqr-Ip|y|lrr\x07K--0v{pyqr-Iortv{{|znylrr\x07K--0v{pyqr-Iqrsny{|znylrr\x07K--rpA-n{s|zrq-J-rpA5}|vv|{9->;=6H--rpA-z]|vv|{-J-z|qrycvrZnv\x07-7-n{s|zrqH--[|zny-J-{|znyv r5n{s|zrq[|zny6H--0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6----Sy||-J-sy||H--0r{qvs--cvr]|vv|{-J-:z]|vv|{;\x07\b H--|yq]|vv|{-J-z|qryZnv\x07-7-n{s|zrqH--tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-n{s|zrqH--0v{pyqr-Iunq|zn}lrr\x07K--Y|tQr}u-J-y|t?5:z]|vv|{; 6H--cvrZnv\x07-J-vrZnv\x07H--V_||sZnx-J-v_||sZnxH\f"),wc=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->;=60qrsv{r-aNb-C;?E@>EB?{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H0vs-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\x07H0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-rp@-qvssrH{vs|z-rp@-rzvvrH{vs|z-rp@-}rpynH{vs|z-sy|n-uv{v{rH{vs|z-sy|n-r\x07}|rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH{vs|z-sy|n-u|{Sy||V{qr\x07Hn\bv{t-sy|n-V_||sZnxH0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\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r----ory|{tv{tSY||-J-sy||H--0r{qvs--zn@-pnzrn_|nv|{Znv\x07-J-zn@5cvrZnv\x07h=jh=j9-cvrZnv\x07h>jh=j9-cvrZnv\x07h?jh=j9cvrZnv\x07h=jh>j9-cvrZnv\x07h>jh>j9-cvrZnv\x07h?jh>j9cvrZnv\x07h=jh?j9-cvrZnv\x07h>jh?j9-cvrZnv\x07h?jh?j6H--rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9=;=9>;=66H--vs5pnzrnQvrpv|{;\b-K-=;E-33-V_||sZnx-JJ->;=6-\n----qvpnqH--\f--<<前置裁切计算--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-|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5ory|{tv{tSY||-:-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--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->;=6H----r{H--0r{qvs--<<楼层选择计算--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-KJ-=;=-33-no5ory|{tv{tSY||-:-u|{Sy||V{qr\x076-KJ->;=6-\n----sy||\\}npv\b-J-=;>H--\f--rpA-qvssrP|y|-J-rpA5qvssr;to9-|}npv\b6H--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5rp@5=;=69-rp@5=;=69-rp@5=;=69-rp@5=;=66H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--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--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--<<-调整曝光值--vnqvn{pr-J-vnqvn{pr-7-r\x07}|rH--0v{pyqr-Iyvtulsntzr{lzn}K--0v{pyqr-Iyvtulsntzr{lr{qK--0v{pyqr-In|zn}lsntzr{K--<<-减少方向光对模型的影响--rp@-|t|v{tYvtu-J-5rsyrprqYvtu;qvrpQvssr-7-=;?6-8----rsyrprqYvtu;v{qvrpQvssr-8----rsyrprqYvtu;v{qvrp`}rpyn-8----|nyRzvvr_nqvn{prH--<<-修复黑色面片的问题--vs-5|t|v{tYvtu;-K-=;=-\v\v-|t|v{tYvtu;t-K-=;=-\v\v-|t|v{tYvtu;o-K-=;=6-\n----tylSntP|y|-J-rpA5|t|v{tYvtu9-qvssrP|y|;n6H--\f-ryr-\n----tylSntP|y|-J-rpA5OYNPXlP\\Y\\_;\x07\b 9-qvssrP|y|;n6H--\f--rp@-}n{|=a|crr\x07-J-5|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-5|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6-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-:-?;=66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--0vs-qrsv{rq5b`Rl]N[\\lcVQR\\6----rp@-pnzrna|crr\x07-J-|yq]|vv|{;\x07\b -:-pnzrn]|vv|{H----rpA-zn}P||q-J-rpA5pnzrna|crr\x079->;=6-7-}n{|cvqr|lznv\x07H----rp?--J-rp?5------=;B-8-zn}P||q;\x07-<-zn}P||q; -<-}n{|cvqr|lv r;\x079------=;B-:-zn}P||q;\b-<-zn}P||q; -<-}n{|cvqr|lv r;\b----6H----rpA-vqr|P|y|-J-r\x07r?Q5}n{|cvqr|lzn}9-6H----sy|n-znpu-J-5>;=-:-r}5=;=9-zn}P||q; 66-7-5>;=-:-r}5=;B9-no5;\x07-:-=;B666-7-5>;=-:-r}5=;B9-no5;\b-:-=;B666H----sy|n-ny}un-J-pynz}5=;=9->;=9-B;=-7-5>;=-:-pynz}5qvn{pr59-rp?5=;B9-=;B66-<-=;BB-9-=;=9->;=666H----}n{|P|y|-J-zv\x075}n{|P|y|9-vqr|P|y|9-znpu-7-ny}un-7-}n{|cvqr|lny}un6H--0r{qvs--0vs-qrsv{rq5b`Rl]N[\\l\\]NPVaf6----tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H----tylSntP|y|;n-J-|}npv\bH--0ryr----tylSntP|y|-J-rpA5tylSntP|y|;to9-|}npv\b-7-sy||\\}npv\b6H----tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs\f");var Ln=new d.WebGLCubeRenderTarget(1).texture;Ln.name="EMPTY_TEXTURE";var Ec=Object.assign({modelAlpha:new d.Uniform(0),progress:new d.Uniform(0),pano0_map:new d.Uniform(Ln),pano0_luminanceMap:new d.Uniform(null),pano0_matrix:new d.Uniform(new d.Matrix4),pano1_map:new d.Uniform(Ln),pano1_luminanceMap:new d.Uniform(null),pano1_matrix:new d.Uniform(new d.Matrix4),clippers:new d.Uniform([]),shownFloorIndex:new d.Uniform(-1),constantColor:new d.Uniform(null),floor:new d.Uniform(0)},{exposure:new d.Uniform(1),emissive:new d.Uniform(new d.Color(0)),emissiveMap:new d.Uniform(null),specular:new d.Uniform(new d.Color(1118481)),specularMap:new d.Uniform(null),normalMap:new d.Uniform(null),bumpMap:new d.Uniform(null),shininess:new d.Uniform(30)},d.UniformsUtils.clone(d.UniformsLib.common),d.UniformsUtils.clone(d.UniformsLib.lights)),Vn=function(n){de(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,c,l,h,p,v,m,A,y,f,g,b,w,E,x,M=n.call(this,{vertexShader:bc,fragmentShader:wc,uniforms:d.UniformsUtils.clone(Ec),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_FLOOR:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_PANO_VIDEO:!1,USE_POINT_NORMAL:!1,USE_POINT_CIRCLE:!1,USE_POINT_ADAPTIVE_SIZE:!1,USE_POINT_COLOR_ALTITUDE:!1},lights:!0})||this,C,I=null,P=null;return Object.defineProperties(M,{pano0:{get:function(){return I},set:function(S){if(I!==S){I=S,S===null?(this.uniforms.pano0_map.value=Ln,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity()):(this.uniforms.pano0_map.value=S.map instanceof Qe?S.map.texture:S.map,this.uniforms.pano0_luminanceMap.value=S.luminanceMap instanceof Qe?S.luminanceMap.texture:S.luminanceMap,this.uniforms.pano0_matrix.value.copy(S.matrix));var F=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,k=this.defines.USE_LUMINANCE;k!==F&&(this.defines.USE_LUMINANCE=F,this.needsUpdate=!0)}}},pano1:{get:function(){return P},set:function(S){if(P!==S){P=S,S===null?(this.uniforms.pano1_map.value=Ln,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity()):(this.uniforms.pano1_map.value=S.map instanceof Qe?S.map.texture:S.map,this.uniforms.pano1_luminanceMap.value=S.luminanceMap instanceof Qe?S.luminanceMap.texture:S.luminanceMap,this.uniforms.pano1_matrix.value.copy(S.matrix));var F=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,k=this.defines.USE_LUMINANCE;k!==F&&(this.defines.USE_LUMINANCE=F,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(S){this.uniforms.modelAlpha.value=S}},progress:{get:function(){return this.uniforms.progress.value},set:function(S){this.uniforms.progress.value=S}},useBlackTransition:{get:function(){return this.defines.USE_BLACK_TRANSITION},set:function(S){var F=this.defines.USE_BLACK_TRANSITION;F!==S&&(this.defines.USE_BLACK_TRANSITION=S,this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(S){this.uniforms.constantColor.value=S;var F=this.defines.USE_CONSTANT_COLOR,k=S!==null;F!==k&&(this.defines.USE_CONSTANT_COLOR=k,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(S){this.uniforms.opacity.value=S}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(S){this.uniforms.shownFloorIndex.value=S}},clippers:{get:function(){return C},set:function(S){C!==S&&(C=S,this.uniforms.clippers.value=(C||[]).map(function(F){var k=typeof F.floorIndex=="number"?F.floorIndex:-1,O=new d.Matrix4().getInverse(F.clippingBoxMatrix);return{matrixInverse:O,floorIndex:k}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(S){S!==this.defines.USE_EDL&&(this.defines.USE_EDL=S,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(S){S!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=S,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(S){S!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=S,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(S){this.uniforms.floor.value=S}}}),M.pano0=(r=e.pano0)!==null&&r!==void 0?r:be.pano0,M.pano1=(i=e.pano1)!==null&&i!==void 0?i:be.pano1,M.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:be.modelAlpha,M.progress=(o=e.progress)!==null&&o!==void 0?o:be.progress,M.useBlackTransition=(s=e.useBlackTransition)!==null&&s!==void 0?s:be.useBlackTransition,M.constantColor=(u=e.constantColor)!==null&&u!==void 0?u:be.constantColor,M.opacity=(c=e.opacity)!==null&&c!==void 0?c:be.opacity,M.shownFloorIndex=(l=e.shownFloorIndex)!==null&&l!==void 0?l:be.shownFloorIndex,M.clippers=(h=e.clippers)!==null&&h!==void 0?h:be.clippers,M.useEDL=(p=e.useEDL)!==null&&p!==void 0?p:be.useEDL,M.useHQWeight=(v=e.useHQWeight)!==null&&v!==void 0?v:be.useHQWeight,M.useHQDepth=(m=e.useHQDepth)!==null&&m!==void 0?m:be.useHQDepth,M.pointSize=(A=e.pointSize)!==null&&A!==void 0?A:be.pointSize,M.pointColor=(y=e.pointColor)!==null&&y!==void 0?y:be.pointColor,M.pointShape=(f=e.pointShape)!==null&&f!==void 0?f:be.pointShape,M.pointScale=(g=e.pointScale)!==null&&g!==void 0?g:be.pointScale,M.pointBack=(b=e.pointBack)!==null&&b!==void 0?b:be.pointBack,M.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:be.pointMinPixel,M.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:be.pointMaxPixel,M.gradientTexture=(x=e.gradientTexture)!==null&&x!==void 0?x:be.gradientTexture,M.floor=0,M}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=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,o),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,o)},t.prototype.update=function(e,r){this.transparent=this.shownFloorIndex>-1||this.opacity<1,this.blending=this.transparent?d.NormalBlending:d.NoBlending},t.prototype.syncModel=function(e){var r="".concat(e.id,":").concat(e.materialVersion);r!==this.syncModelVersion&&(Object.assign(this,e.getMaterial()),this.syncModelVersion=r)},t}(d.ShaderMaterial),_r=function(n){de(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.backgroundColor,o=a===void 0?1579548:a,s=e.backgroundAlpha,u=s===void 0?1:s,c=e.pixelRatio,l=c===void 0?1:c,h=e.antialias,p=h===void 0?!1:h,v=e.webgl2,m=v===void 0?!1:v,A=this,y=u<1;if(m){var f=document.createElement("canvas"),g=f.getContext("webgl2");g?A=n.call(this,{antialias:p,preserveDrawingBuffer:i,alpha:y,canvas:f,context:g})||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),A=n.call(this,{antialias:p,preserveDrawingBuffer:i,alpha:y})||this)}else A=n.call(this,{antialias:p,preserveDrawingBuffer:i,alpha:y})||this;return A.setPixelRatio(l),A.setClearColor(o,u),A.outputEncoding=d.sRGBEncoding,A.autoClear=!0,A}return t}(d.WebGLRenderer),fu=function(n){de(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 Rr(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 xc=1,Mc=.1,Cc=1e3,Gn=Math.PI*2,Fo=Math.PI/2;function Oo(n){return n>0&&n<=Gn?n:(n%Gn+Gn)%Gn}function Ic(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 hi=function(n){de(t,n);function t(e,r,i,a,o,s,u){r===void 0&&(r=xc),i===void 0&&(i=Mc),a===void 0&&(a=Cc),o===void 0&&(o=new d.Vector2),s===void 0&&(s=512),u===void 0&&(u=1);var c=n.call(this)||this;c.fov=e,c.aspect=r,c.near=i,c.far=a,c.perspToOrtho=o,c.screenHeight=s,c.pixelRatio=u,c.needsRender=!0,c.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new d.Vector3},c.computePose(),c.perspectiveCamera=new d.PerspectiveCamera(c.fov,c.aspect,.001,c.far);var l=Math.max(c.orthoDistance,.01)*Math.tan(.5*c.fov/180*Math.PI),h=-.5*c.aspect*2*l;return c.orthographicCamera=new d.OrthographicCamera(h,-h,l,-l,.001,c.far),c.computeProjectionMatrix(),c.lastValues={position:c.position.clone(),quaternion:c.quaternion.clone(),scale:c.scale.clone(),fov:c.fov,aspect:c.aspect,near:c.near,far:c.far,perspToOrtho:c.perspToOrtho.clone()},c.type=c.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",c}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 Rr(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0);var r=this.getDirection(new d.Vector3);this.pose.longitude=Oo(-Math.atan2(r.x,-r.z)),this.pose.latitude=-Math.asin(r.y/1),this.pose.fov=this.fov,this.pose.distance=e;var i=new d.Vector3().add(this.position).add(r.clone().setLength(this.pose.distance));return this.pose.offset.copy(i),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,u=Oo((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),c=Math.max(-Fo+1e-4,Math.min(Fo-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),l=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,h=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,p=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,v=Rr({longitude:u,latitude:c}).normalize();return this.position.set(0,0,0),this.lookAt(v),this.position.add(p).sub(v.clone().setLength(h)),this.fov!==l&&(this.fov=l,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=u,this.pose.latitude=c,this.pose.fov=l,this.pose.distance=h,this.pose.offset.copy(p),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(){Ic(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){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.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.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.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(ve(),0),this},t}(d.Camera),bt;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(bt||(bt={}));var hu=1e-6,Ne=new d.Vector3,Br=new d.Matrix4,Mr=new d.Vector3,Cr=new d.Vector3,Ir=new d.Vector3,ya=new d.Vector3,ko=new d.Box3,Lo=new d.Sphere,Do=new d.Matrix4,No=new d.Ray,gt=new d.Object3D,Qo=new d.Frustum;function pu(n,t){var e=n.elements;return t.setFromRotationMatrix(Br.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 Pn=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 Br.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Qo.setFromProjectionMatrix(Br),this.setFromFrustum(Qo),this},n.prototype.computeVisibility=function(t){for(var e=bt.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case bt.Outside:return bt.Outside;case bt.Intersecting:e=bt.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],u=t.intersectPlane(s);if(u===bt.Outside)return n.MASK_OUTSIDE;u===bt.Intersecting&&(r|=o)}}return r},n}(),vu=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],u=e[8],c=e[9],l=e[10],h=e[11],p=Math.sqrt(r*r+i*i+a*a),v=Math.sqrt(o*o+s*s+u*u),m=Math.sqrt(c*c+l*l+h*h);this.halfSize.set(p,v,m);var A=this.halfSize.toArray().reduce(function(y,f){return y+f},0);return(isNaN(A)||A<=0)&&this.halfSize.setScalar(hu),this.rotation.fromArray([r/p,i/p,a/p,o/v,s/v,u/v,c/m,l/m,h/m]),isNaN(this.rotation.toArray().reduce(function(y,f){return y+f},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(Mr,Cr,Ir),{box:at(at(at(at([],this.center.toArray(),!0),Mr.multiplyScalar(this.halfSize.x).toArray(),!0),Cr.multiplyScalar(this.halfSize.y).toArray(),!0),Ir.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 gt.position.copy(this.center),pu(this.rotation,gt.quaternion),gt.scale.copy(this.halfSize),gt.matrix.compose(gt.position,gt.quaternion,gt.scale),gt.matrix.premultiply(t),gt.matrix.decompose(gt.position,gt.quaternion,gt.scale),this.center.copy(gt.position),this.rotation.setFromMatrix4(Br.makeRotationFromQuaternion(gt.quaternion)),this.halfSize.copy(gt.scale),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredTo=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.distanceTo=function(t){return Math.sqrt(this.distanceSquaredTo(t))},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(Mr,Cr,Ir),Mr.setLength(this.halfSize.x),Cr.setLength(this.halfSize.y),Ir.setLength(this.halfSize.z),t.expandByPoint(Ne.copy(this.center).add(Mr)),t.expandByPoint(Ne.copy(this.center).sub(Mr)),t.expandByPoint(Ne.copy(this.center).add(Cr)),t.expandByPoint(Ne.copy(this.center).sub(Cr)),t.expandByPoint(Ne.copy(this.center).add(Ir)),t.expandByPoint(Ne.copy(this.center).sub(Ir)),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);Ne.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),Ne.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),Ne.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),Ne.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),Ne.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),Ne.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),Ne.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),Ne.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,u=r.z,c=Math.abs(o*i[0]*a.x+s*i[1]*a.x+u*i[2]*a.x)+Math.abs(o*i[3]*a.y+s*i[4]*a.y+u*i[5]*a.y)+Math.abs(o*i[6]*a.z+s*i[7]*a.z+u*i[8]*a.z),l=r.dot(e)+t.constant;return l<=-c?bt.Outside:l>=c?bt.Inside:bt.Intersecting},n.prototype.intersectRay=function(t,e){ya.copy(this.halfSize).multiplyScalar(2),ko.setFromCenterAndSize(Ne.set(0,0,0),ya),this.rotation.extractBasis(Mr,Cr,Ir),Br.makeBasis(Mr,Cr,Ir),Br.setPosition(this.center),Do.getInverse(Br),No.copy(t).applyMatrix4(Do);var r=No.intersectBox(ko,Ne);return r?e!==void 0?r.applyMatrix4(Br).distanceTo(t.origin)<e:!0:!1},n}(),Au=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],hu),this},n.prototype.toJson=function(){return{sphere:at(at([],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,ya.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.distanceSquaredTo=function(t){var e=this.distanceTo(t);return e*e},n.prototype.distanceTo=function(t){var e=this.center.distanceTo(t)-this.radius;return e<=0?0:e},n.prototype.intersectPlane=function(t){var e=this.center,r=this.radius,i=t.normal,a=i.dot(e)+t.constant;return a<-r?bt.Outside:a<r?bt.Intersecting:bt.Inside},n.prototype.intersectRay=function(t,e){Lo.set(this.center,this.radius);var r=t.intersectSphere(Lo,Ne);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),Sc=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.distanceTo=function(t){throw new Error("not implemented")},n.prototype.distanceSquaredTo=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 Bn(n){if("box"in n)return new vu().fromJson(n);if("sphere"in n)return new Au().fromJson(n);if("region"in n)return new Sc().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var Kn=[2621517,3801199,4915345,5963950,7274706,8782079,9575167,10434047,11623423,12482559,13274879,13870335,14464511,15125247,15852031,16446719].map(function(n){return new d.LineBasicMaterial({color:n,depthWrite:!1,transparent:!0})}),Tc=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);Ne.set(1,1,1).toArray(t,0),Ne.set(-1,1,1).toArray(t,3),Ne.set(-1,-1,1).toArray(t,6),Ne.set(1,-1,1).toArray(t,9),Ne.set(1,1,-1).toArray(t,12),Ne.set(-1,1,-1).toArray(t,15),Ne.set(-1,-1,-1).toArray(t,18),Ne.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}(),Pc=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 Bc(n,t){if(n instanceof vu){var e=new d.LineSegments(Tc,Kn[Math.min(t,Kn.length-1)]);return e.position.copy(n.center),pu(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 Au){var e=new d.LineSegments(Pc,Kn[Math.min(t,Kn.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 _a=function(){function n(t,e,r,i){var a=this,o,s,u;this.parent=null,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,selectionDepth:0,shouldRefine:!1,distanceToCamera:0,screenSpaceError:0,visibilityPlaneMask:0,inRequestVolume:!1},this.parent=i??null,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=(u=(s=this.parent)===null||s===void 0?void 0:s.geometricError)!==null&&u!==void 0?u:0,e.content&&e.content.uri?(this.content={uri:e.content.uri,loadState:"UNLOADED",byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=Bn(e.content.boundingVolume).applyMatrix4(this.transform)),/\.json$/.test(this.content.uri)?this.type="TILESET":this.type="SCENEGRAPH"):(this.content=null,this.type="EMPTY"),e.boundingVolume&&(this.boundingVolume=Bn(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=Bn(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=e.extras||{},e.children?this.children=e.children.map(function(c,l){return new n("".concat(a.id,".").concat(l),c,r,a)}):this.children=[]}return 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;this.state.distanceToCamera=r.distanceTo(t.camera.position);var i=this.parent?this.parent.state.visibilityPlaneMask:Pn.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,i),this.state.visible=this.state.visibilityPlaneMask!==Pn.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.visibilityPlaneMask=Pn.MASK_INDETERMINATE,this.state.visible=!0;if(this.viewerRequestVolume){var a=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=a.distanceSquaredTo(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==="MESH"||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.loadContent=function(){var t=this,e;if(this.hasEmptyContent||!(!((e=this.content)===null||e===void 0)&&e.uri))return Promise.resolve(!1);var r=this.content;return r.data?Promise.resolve(!0):(r.loadState="LOADING",this.tileset.requestScheduler.scheduleRequest(this.id,function(){return t.getPriority()}).then(function(i){return i?t.tileset.options.contentLoader(t).then(function(a){return i.done(),r.loadState=a?"READY":"UNLOADED",a}).catch(function(a){return r.loadState="FAILED",i.done(),Promise.reject(a)}):(r.loadState="UNLOADED",Promise.resolve(!1))}))},n.prototype.unloadContent=function(){return this.content&&(this.content.loadState="UNLOADED",this.content.byteLength=0),!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),u=o*t.height/(s*t.sseDenominator);return u},n.prototype.getPriority=function(){var t=this.refine==="ADD"||this.tileset.skipLevelOfDetail;if(t&&!this.state.visible||this.tileset.frameNumber-this.state.touchedFrameNumber>=1||this.content.loadState==="UNLOADED")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}(),ba=function(){function n(){this.maxRequests=n.DEFAULT_MAX_REQUESTS,this.activeRequests=0,this.requestQueue=[],this.requestMap=new Map,this.deferred=null}return n.prototype.scheduleRequest=function(t,e){var r=this.requestMap.get(t);if(r)return r;var i={identiy:t,priority:0,getPriority:e,resolve:function(){}},a=new Promise(function(o){return i.resolve=o});return this.requestQueue.push(i),this.requestMap.set(t,a),this.issueNewRequests(),a},n.prototype.reset=function(){for(var t=0,e=this.requestQueue;t<e.length;t++){var r=e[t];r.resolve(null)}this.requestQueue.length=0,this.requestMap.clear(),this.activeRequests=0},n.prototype.issueRequest=function(t){var e=this,r=t.identiy,i=t.resolve,a=!1,o=function(){a||(a=!0,e.requestMap.delete(r),e.activeRequests--,e.issueNewRequests())};this.activeRequests++,i({done:o})},n.prototype.issueNewRequests=function(){var t=this;this.deferred||(this.deferred=setTimeout(function(){return t.issueNewRequestsAsync()},0))},n.prototype.issueNewRequestsAsync=function(){this.deferred=null;var t=Math.max(this.maxRequests-this.activeRequests,0);if(t!==0){this.updateAllRequests();for(var e=0;e<t;e++){var r=this.requestQueue.shift();if(r)this.issueRequest(r);else break}}},n.prototype.updateAllRequests=function(){for(var t=this.requestQueue,e=0;e<t.length;e++){var r=t[e];this.updateRequest(r)===!1&&(t.splice(e,1),this.requestMap.delete(r.identiy),e--)}t.sort(function(i,a){return i.priority-a.priority})},n.prototype.updateRequest=function(t){return t.priority=t.getPriority(t.identiy),t.priority<0?(t.resolve(null),!1):!0},n.DEFAULT_MAX_REQUESTS=6,n}(),Rc=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Fc=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 Rc(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}(),mu=function(){function n(){this.cacheNodeMap=new Map,this.list=new Fc,this.sentinel=this.list.add("sentinel")}return n.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},n.prototype.touch=function(t){var e=this.cacheNodeMap.get(t);e&&this.list.splice(this.sentinel,e)},n.prototype.add=function(t,e){if(!this.cacheNodeMap.has(t)){var r=this.list.add(t);this.cacheNodeMap.set(t,r),e&&e(t)}},n.prototype.unloadTile=function(t,e){var r=this.cacheNodeMap.get(t);r&&(this.list.remove(r),this.cacheNodeMap.delete(t),e&&e(t))},n.prototype.unloadTiles=function(t,e){for(var r=this.list.head;r!==this.sentinel&&t();){var i=r.item;r=r.next,this.unloadTile(i,e)}},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}(),Vo=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),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}(),wa=function(){function n(){this.loadSiblings=n.DEFAULT_LOAD_SIBLINGS,this.skipLevelOfDetail=n.DEFAULT_SKIP_LEVEL_OF_DETAIL,this.maxScreenSpaceError=n.DEFAULT_MAX_SCREEN_SPACE_ERROR,this._canSelectTile=!0,this._traversalStack=new Vo,this._emptyTraversalStack=new Vo,this.root=null,this.selectedTiles=new Map,this.requestedTiles=new Map,this.needsRefinedTiles=new Map,this.emptyTiles=new Map}return n.prototype.traverse=function(t,e,r){r===void 0&&(r=[]),this.root=t,this.reset();for(var i=0,a=r;i<a.length;i++){var o=a[i];this._traversalStack.reset(),this._emptyTraversalStack.reset(),this._canSelectTile=o.camera.visible,this.updateTile(t,o),this.executeTraversal(t,o)}this._traversalStack.reset(),this._emptyTraversalStack.reset(),this._canSelectTile=!0,this.updateTile(t,e),this.executeTraversal(t,e)},n.prototype.reset=function(){this.needsRefinedTiles.clear(),this.requestedTiles.clear(),this.selectedTiles.clear(),this.emptyTiles.clear(),this._traversalStack.reset(),this._emptyTraversalStack.reset()},n.prototype.executeTraversal=function(t,e){var r=this._traversalStack;if(t.state.selectionDepth=0,e.maxLevelOfDetail>=0)for(t.state.visible&&t.state.inRequestVolume&&r.push(t);r.length>0;){var i=r.pop(),a=!1;if(this.canTraverse(i,e,!1,!1)){var o=i.hasRenderContent?i.state.selectionDepth+1:i.state.selectionDepth;this.updateChildTiles(i,e,o),a=this.updateAndPushChildren(i,e,r)}var s=i.parent,u=!s||s.state.shouldRefine,c=!a;i.hasRenderContent?i.refine==="ADD"?(this.loadTile(i,e.frameNumber),this.selectTile(i,e)):i.refine==="REPLACE"&&(this.loadTile(i,e.frameNumber),c&&this.selectTile(i,e)):(this.emptyTiles.set(i.id,i),this.loadTile(i,e.frameNumber),c&&this.selectTile(i,e)),this.touchTile(i,e),i.state.shouldRefine=a&&u}},n.prototype.updateChildTiles=function(t,e,r){for(var i=t.children,a=0,o=i;a<o.length;a++){var s=o[a];s.state.selectionDepth=r,this.updateTile(s,e)}return!0},n.prototype.updateAndPushChildren=function(t,e,r){for(var i=t.children,a=t.refine==="REPLACE"&&t.hasRenderContent&&!this.skipLevelOfDetail,o=!1,s=!0,u=0,c=i;u<c.length;u++){var l=c[u];if(l.state.visible&&l.state.inRequestVolume?(r.find(l)&&r.delete(l),r.push(l),o=!0):(a||this.loadSiblings)&&(this.loadTile(l,e.frameNumber),this.touchTile(l,e)),a){var h=void 0;l.state.inRequestVolume?l.hasRenderContent?h=l.contentAvailable:h=this.executeEmptyTraversal(l,e):h=!1,s=s&&h}}return o||(s=!1),s},n.prototype.updateTile=function(t,e){this.updateTileVisibility(t,e)},n.prototype.selectTile=function(t,e){this.shouldSelectTile(t)&&(t.state.selectedFrameNumber=e.frameNumber,this.selectedTiles.set(t.id,t)),this.needsRefinedTiles.set(t.id,t)},n.prototype.loadTile=function(t,e){this.shouldLoadTile(t)&&(t.state.requestedFrameNumber=e,this.requestedTiles.set(t.id,t)),this.needsRefinedTiles.set(t.id,t)},n.prototype.touchTile=function(t,e){t.tileset.cache.touch(t),t.state.touchedFrameNumber=e.frameNumber},n.prototype.canTraverse=function(t,e,r,i){return t.hasChildren?t.hasTilesetContent?!0:!i&&!t.state.visible?!1:this.shouldRefine(t,e,r):!1},n.prototype.shouldLoadTile=function(t){return t.hasUnloadedContent},n.prototype.shouldSelectTile=function(t){return t.contentAvailable&&!this.skipLevelOfDetail&&this._canSelectTile},n.prototype.shouldRefine=function(t,e,r){if(t.hasEmptyContent)return!0;if(t.hasRenderContent){if(t.state.selectionDepth>=e.maxLevelOfDetail)return!1;if(t.state.selectionDepth<e.minLevelOfDetail)return!0}var i=t.state.screenSpaceError;return r&&(i=t.getScreenSpaceError(e,t.state.distanceToCamera,!0)),i>this.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}}},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"?!1:!this.shouldRefine(t,e,!0)},n.prototype.compareDistanceToCamera=function(t,e){return e.state.distanceToCamera-t.state.distanceToCamera},n.prototype.executeEmptyTraversal=function(t,e){var r=!0,i=this._emptyTraversalStack;for(i.push(t);i.length>0&&r;){var a=i.pop();this.updateTile(a,e),a.state.visible||this.loadTile(a,e.frameNumber),this.touchTile(a,e);var o=!a.hasRenderContent&&this.canTraverse(a,e,!1,!0);if(o)for(var s=a.children,u=0,c=s;u<c.length;u++){var l=c[u];i.find(l)&&i.delete(l),i.push(l)}else a.contentAvailable||(r=!1)}return r},n.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,n.DEFAULT_LOAD_SIBLINGS=!1,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=4,n}(),Oc=new d.Matrix4,ii=function(){function n(t,e,r){var i,a;this.id=t,this.transform=new d.Matrix4,this.transformIsIdentity=!0,this.asset={version:e.asset.version,tilesetVersion:e.asset.tilesetVersion||"",gltfUpAxis:(i=e.asset.gltfUpAxis)!==null&&i!==void 0?i:"Y",overview:e.asset.overview},this.properties=(a=e.properties)!==null&&a!==void 0?a:{},this.options=r,this.traverser=new wa,this.cache=new mu,this.requestScheduler=new ba,this.frameNumber=0,this.pendingCount=0,this.tiles=new Map,this.memoryUsageInBytes=0,this.root=new _a("".concat(this.id,".0"),e.root,this),this.geometricError=e.geometricError,this.maxMemoryUsage=n.DEFAULT_MAX_MEMORY_USAGE}return Object.defineProperty(n.prototype,"maxRequests",{get:function(){return this.requestScheduler.maxRequests},set:function(t){this.requestScheduler.maxRequests=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"skipLevelOfDetail",{get:function(){return this.traverser.skipLevelOfDetail},set:function(t){this.traverser.skipLevelOfDetail=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"maxScreenSpaceError",{get:function(){return this.traverser.maxScreenSpaceError},set:function(t){this.traverser.maxScreenSpaceError=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectedTiles",{get:function(){return this.traverser.selectedTiles},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"needsRefinedTiles",{get:function(){return this.traverser.needsRefinedTiles},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,function(o){return t.unloadTile(o)})}this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.tiles.clear()},n.prototype.isLoaded=function(){return this.pendingCount===0&&this.frameNumber!==0},n.prototype.traverse=function(t,e){var r=this;e===void 0&&(e=[]),this.transformIsIdentity=this.transform.equals(Oc),this.traverser.traverse(this.root,t,e),this.selectedTiles.forEach(function(i){r.tiles.set(i.id,i)}),this.traverser.requestedTiles.forEach(function(i){i.hasUnloadedContent&&r.loadTile(i)}),this.cache.unloadTiles(function(){var i=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return i},function(i){r.unloadTile(i),r.tiles.delete(i.id)})},n.prototype.loadTile=function(t){var e=this;this.pendingCount++,t.loadContent().catch(function(r){return e.options.onTileError(t,r),!1}).then(function(r){var i;e.pendingCount--,r&&(!((i=t.content)===null||i===void 0)&&i.data&&e.cache.add(t,function(){e.memoryUsageInBytes+=t.contentByteLength}),e.options.onTileLoad(t))})},n.prototype.unloadTile=function(t){this.memoryUsageInBytes-=t.contentByteLength,this.options.onTileUnload(t),t.unloadContent()},n.DEFAULT_VIEW_DISTANCE_SCALE=1,n.DEFAULT_MAX_MEMORY_USAGE=16,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=wa.DEFAULT_MAX_SCREEN_SPACE_ERROR,n.DEFAULT_MAX_REQUESTS=ba.DEFAULT_MAX_REQUESTS,n}(),cn=function(){function n(t,e,r,i){this.extents=t,this.startIndex=e,this.endIndex=r,this.deepth=i}return n}();function gu(n,t,e,r){r===void 0&&(r=0);var i=e.extents[0]-r,a=e.extents[1]-r,o=e.extents[2]-r,s=e.extents[3]+r,u=e.extents[4]+r,c=e.extents[5]+r,l={min:0,max:0};t.x>=0?(l.min=(i-n.x)*t.x,l.max=(s-n.x)*t.x):(l.min=(s-n.x)*t.x,l.max=(i-n.x)*t.x);var h={min:0,max:0};if(t.y>=0?(h.min=(a-n.y)*t.y,h.max=(u-n.y)*t.y):(h.min=(u-n.y)*t.y,h.max=(a-n.y)*t.y),l.min>h.max||h.min>l.max)return!1;h.min>l.min&&(l.min=h.min),h.max<l.max&&(l.max=h.max);var p={min:0,max:0};return t.z>=0?(p.min=(o-n.z)*t.z,p.max=(c-n.z)*t.z):(p.min=(c-n.z)*t.z,p.max=(o-n.z)*t.z),!(l.min>p.max||p.min>l.max||(p.min>l.min&&(l.min=p.min),p.max<l.max&&(l.max=p.max),l.max<0))}var yu=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,u=e.z;return this.x=i*u-a*s,this.y=a*o-r*u,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}(),bu=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),Uo=1e-6,kc=function(){function n(t,e){if(this.positionArray=t,e)this.indicesArray=e;else{for(var r=t.length/3,i=new Uint32Array(r),a=0;a<r;a++)i[a]=a;this.indicesArray=i}}return n.prototype.createTree=function(t,e,r){var i=this.positionArray,a=this.indicesArray,o=a.length/3,s=new Uint32Array(o),u=new Float32Array(o*6),c=[],l=0;if(r)for(var h=0,p=0,v=0,m=void 0,A=void 0,y=void 0,f=void 0,g=void 0,b=void 0,w=void 0;h<o;h+=1,p+=3,v+=6)s[h]=h,m=f=i[a[p]*3],w=i[a[p+1]*3],w<m&&(m=w),w>f&&(f=w),w=i[a[p+2]*3],w<m&&(m=w),w>f&&(f=w),A=g=i[a[p]*3+1],w=i[a[p+1]*3+1],w<A&&(A=w),w>g&&(g=w),w=i[a[p+2]*3+1],w<A&&(A=w),w>g&&(g=w),y=b=i[a[p]*3+2],w=i[a[p+1]*3+2],w<y&&(y=w),w>b&&(b=w),w=i[a[p+2]*3+2],w<y&&(y=w),w>b&&(b=w),u[v]=m,u[v+1]=A,u[v+2]=y,u[v+3]=f,u[v+4]=g,u[v+5]=b;else{for(var E=1/0,x=1/0,M=1/0,C=-1/0,I=-1/0,P=-1/0,h=0,p=0,v=0,m=void 0,A=void 0,y=void 0,f=void 0,g=void 0,b=void 0,w=void 0;h<o;h+=1,p+=3,v+=6)s[h]=h,m=f=i[a[p]*3],w=i[a[p+1]*3],w<m&&(m=w),w>f&&(f=w),w=i[a[p+2]*3],w<m&&(m=w),w>f&&(f=w),A=g=i[a[p]*3+1],w=i[a[p+1]*3+1],w<A&&(A=w),w>g&&(g=w),w=i[a[p+2]*3+1],w<A&&(A=w),w>g&&(g=w),y=b=i[a[p]*3+2],w=i[a[p+1]*3+2],w<y&&(y=w),w>b&&(b=w),w=i[a[p+2]*3+2],w<y&&(y=w),w>b&&(b=w),u[v]=m,u[v+1]=A,u[v+2]=y,u[v+3]=f,u[v+4]=g,u[v+5]=b,m<E&&(E=m),f>C&&(C=f),A<x&&(x=A),g>I&&(I=g),y<M&&(M=y),b>P&&(P=b);r=[E,x,M,C,I,P]}var S=new cn(r,0,o,0);c[l++]=S;function F(k){for(var O=k.startIndex,L=k.endIndex,N=k.extents,V=[N[3]-N[0],N[4]-N[1],N[5]-N[2]],j=[0,1,2].sort(function($,te){return V[te]-V[$]}),z=0;z<3;z++){for(var U=j[z],X=N[U]+N[U+3],G=O,K=L-1,Y=-1,H=void 0;G<=K;)Y===-1?(H=s[G],u[H*6+U]+u[H*6+U+3]<X?G++:Y=H):(H=s[K],u[H*6+U]+u[H*6+U+3]>=X||(s[G]=H,s[K]=Y,Y=-1,G++),K--);if(G>O&&G<L){var J=new cn(qo(s,u,O,G,Uo),O,G,k.deepth+1);J.deepth<e&&J.endIndex-J.startIndex>t&&(c[l++]=J);var ne=new cn(qo(s,u,G,L,Uo),G,L,k.deepth+1);ne.deepth<e&&ne.endIndex-ne.startIndex>t&&(c[l++]=ne),k.node0=J,k.node1=ne,k.startIndex=0,k.endIndex=0;break}}}for(;l;)F(c[--l]);return this.offsetArray=s,this.rootNode=S,c.length=0,this},n.prototype.trianglesInSphere=function(t,e){for(var r=this.positionArray,i=this.indicesArray,a=this.offsetArray,o=this.rootNode,s=[o],u=[],c;c=s.pop();){var l=Hi(t.x,c.extents[0],c.extents[3])-t.x,h=Hi(t.y,c.extents[1],c.extents[4])-t.y,p=Hi(t.z,c.extents[2],c.extents[5])-t.z;if(l*l+h*h+p*p<=e*e){c.node0&&s.push(c.node0),c.node1&&s.push(c.node1);for(var v=c.startIndex;v<c.endIndex;v++)u.push(a[v])}}for(var m=u.length,A=new Float32Array(m*9),v=0;v<m;v++){var y=u[v];A[v*9]=r[i[y]*3],A[v*9+1]=r[i[y]*3+1],A[v*9+2]=r[i[y]*3+2],A[v*9+3]=r[i[y+1]*3],A[v*9+4]=r[i[y+1]*3+1],A[v*9+5]=r[i[y+1]*3+2],A[v*9+6]=r[i[y+2]*3],A[v*9+7]=r[i[y+2]*3+1],A[v*9+8]=r[i[y+2]*3+2]}return A},n.prototype.intersectRay=function(t,e,r){for(var i=this.positionArray,a=this.indicesArray,o=this.offsetArray,s=this.rootNode,u=new yu(1/e.x,1/e.y,1/e.z),c=[s],l;l=c.pop();)if(gu(t,u,l)){for(var h=l.startIndex,p=l.endIndex,v=void 0,m=void 0,A=void 0,y=t.x,f=t.y,g=t.z,b=e.x,w=e.y,E=e.z,x=void 0,M=void 0,C=void 0,I=void 0,P=void 0,S=void 0,F=void 0,k=void 0,O=void 0,L=void 0,N=void 0,V=void 0,j=void 0,z=void 0,U=void 0,X=void 0,G=void 0,K=void 0,Y=void 0,H=void 0,J=void 0,ne=void 0,$=void 0,te=void 0,ae=void 0,ce=void 0,oe=void 0;h<p;h++){if(v=o[h],m=v*3,A=a[m]*3,x=i[A],M=i[++A],C=i[++A],A=a[m+1]*3,I=i[A],P=i[++A],S=i[++A],A=a[m+2]*3,F=i[A],k=i[++A],O=i[++A],L=I-x,N=P-M,V=S-C,j=F-x,z=k-M,U=O-C,X=N*U-V*z,G=V*j-L*U,K=L*z-N*j,$=b*X+w*G+E*K,$>0)ne=1;else if($<0)ne=-1,$=-$;else continue;Y=y-x,H=f-M,J=g-C,te=ne*(b*(H*U-J*z)+w*(J*j-Y*U)+E*(Y*z-H*j)),!(te<0)&&(ae=ne*(b*(N*J-V*H)+w*(V*Y-L*J)+E*(L*H-N*Y)),!(ae<0)&&(te+ae>$||(ce=-ne*(Y*X+H*G+J*K),!(ce<0)&&(oe=ce/$,r.push(new bu([x,M,C,I,P,S,F,k,O],[y+b*oe,f+w*oe,g+E*oe],v))))))}l.node0&&c.push(l.node0),l.node1&&c.push(l.node1)}return r},n}();function Hi(n,t,e){return n<t?t:n>e?e:n}function qo(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,u=-1/0,c=-1/0,l=-1/0,h=e,p=void 0,v=void 0;h<r;h++)p=n[h]*6,v=t[p],v<a&&(a=v),v=t[p+1],v<o&&(o=v),v=t[p+2],v<s&&(s=v),v=t[p+3],v>u&&(u=v),v=t[p+4],v>c&&(c=v),v=t[p+5],v>l&&(l=v);return[a-i,o-i,s-i,u+i,c+i,l+i]}var zo=1e-6,Lc=function(){function n(t,e){if(this.positionArray=t,e)this.indicesArray=e;else{for(var r=t.length/3,i=new Uint32Array(r),a=0;a<r;a++)i[a]=a;this.indicesArray=i}}return n.prototype.createTree=function(t,e,r){var i=this.positionArray,a=this.indicesArray,o=a.length,s=new Uint32Array(o),u=[],c=0;if(r)for(var l=0;l<o;l+=1)s[l]=l;else{for(var h=a[0]*3,p=i[h],v=i[h+1],m=i[h+2],A=p,y=v,f=m,l=0,g=0,b=void 0,w=void 0,E=void 0;l<o;l+=1,g+=3)s[l]=l,h=a[g]*3,b=i[h],w=i[h+1],E=i[h+2],b<p?p=b:b>A&&(A=b),w<v?v=w:w>y&&(y=w),E<m?m=E:E>f&&(f=E);r=[p,v,m,A,y,f]}var x=new cn(r,0,o,0);u[c++]=x;function M(C){for(var I=C.startIndex,P=C.endIndex,S=C.extents,F=[S[3]-S[0],S[4]-S[1],S[5]-S[2]],k=[0,1,2].sort(function(K,Y){return F[Y]-F[K]})[0],O=(S[k]+S[k+3])/2,L=I,N=P-1,V=-1,j;L<=N;)V===-1?(j=s[L],i[a[j]*3+k]<O?L++:V=j):(j=s[N],i[a[j]*3+k]>=O||(s[L]=j,s[N]=V,V=-1,L++),N--);if(L>I){var z=S.slice();z[k+3]=O+zo;var U=new cn(z,I,L,C.deepth+1);U.deepth<e&&U.endIndex-U.startIndex>t&&(u[c++]=U),C.node0=U}if(P>L){var X=S.slice();X[k]=O-zo;var G=new cn(X,L,P,C.deepth+1);G.deepth<e&&G.endIndex-G.startIndex>t&&(u[c++]=G),C.node1=G}C.startIndex=0,C.endIndex=0}for(;c;)M(u[--c]);return this.offsetArray=s,this.rootNode=x,u.length=0,this},n.prototype.intersectRay=function(t,e,r,i){for(var a=this.positionArray,o=this.indicesArray,s=this.offsetArray,u=this.rootNode,c=r*r,l=new yu(1/e.x,1/e.y,1/e.z),h=[u],p;p=h.pop();)if(gu(t,l,p,r)){for(var v=p.startIndex,m=p.endIndex,A=void 0,y=void 0,f=void 0,g=void 0,b=void 0,w=void 0,E=void 0,x=void 0,M=void 0,C=void 0,I=void 0,P=void 0,S=void 0;v<m;v++)A=s[v],y=o[A]*3,f=a[y],g=a[++y],b=a[++y],w=t.x,E=t.y,x=t.z,M=e.x,C=e.y,I=e.z,P=M*(f-w)+C*(g-E)+I*(b-x),P>0&&(w+=M*P,E+=C*P,x+=I*P),M=f-w,C=g-E,I=b-x,P=M*M+C*C+I*I,P<=c&&i.push(new bu([f,g,b,f,g,b,f,g,b],[w,E,x],A));p.node0&&h.push(p.node0),p.node1&&h.push(p.node1)}return i},n}(),ai=new Map,ji=new Map,dn=new d.Ray,Ho=new d.Matrix3,Rn=new d.Matrix4,wu=new d.Vector3,Dc=new d.Vector3,Nc=new d.Vector3,Qc=new d.Triangle;function Vc(n,t,e,r){var i,a=n.matrixWorld;Rn.getInverse(a),dn.copy(e.ray).applyMatrix4(Rn);for(var o=t.intersectRay(dn.origin,dn.direction,[]),s=n.geometry,u=n.material,c=s.groups,l=s.index,h=0,p=o.length;h<p;h++){var v=o[h],m=v.triangle,A=v.index,y=v.intersectionPoint,f=new d.Vector3(y[0],y[1],y[2]).applyMatrix4(a),g=e.ray.origin.distanceTo(f);if(!(g<e.near||g>e.far)){var b=void 0;if(Array.isArray(u)){if(c)for(var w=A*3,E=0,x=c;E<x.length;E++){var M=x[E];if(w>=M.start&&w-M.start<M.count){b=u[(i=M.materialIndex)!==null&&i!==void 0?i:0];break}}}else b=u;if(b){var C=Qc.set(wu.set(m[0],m[1],m[2]).applyMatrix4(a),Dc.set(m[3],m[4],m[5]).applyMatrix4(a),Nc.set(m[6],m[7],m[8]).applyMatrix4(a)).getNormal(new d.Vector3),I=A*3,P=new d.Face3(l?l.array[I]:I,l?l.array[I+1]:I+1,l?l.array[I+2]:I+2,C),S=e.ray.direction.dot(C);b.side===d.FrontSide&&S>=0||b.side===d.BackSide&&S<=0||r.push({distance:g,object:n,face:P,point:f,distanceToRay:0,faceIndex:A})}}}}function Uc(n,t,e,r){var i,a,o=n.matrixWorld;Ho.getNormalMatrix(o),Rn.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*Rn.getMaxScaleOnAxis();dn.copy(e.ray).applyMatrix4(Rn);for(var u=t.intersectRay(dn.origin,dn.direction,s,[]),c=n.geometry,l=c.index,h=c.getAttribute("normal"),p=0,v=u.length;p<v;p++){var m=u[p],A=m.triangle,y=m.index,f=m.intersectionPoint,g=new d.Vector3(f[0],f[1],f[2]).applyMatrix4(o),b=e.ray.origin.distanceTo(g);if(!(b<e.near||b>e.far)){var w=wu.set(A[0],A[1],A[2]).applyMatrix4(o),E=l?l.array[y]:y,x=void 0;h instanceof d.BufferAttribute&&(x=new d.Vector3().fromBufferAttribute(h,E).applyNormalMatrix(Ho));var M=new d.Face3(E,E,E,x);r.push({distance:b,object:n,face:M,point:g,distanceToRay:g.distanceTo(w),index:y})}}}function qc(n,t,e){var r;if(t===void 0&&(t=100),e===void 0&&(e=10),n.geometry instanceof d.BufferGeometry){var i=n.geometry.getAttribute("position");if(i instanceof d.BufferAttribute){var a=n.raycast,o=function(p,v){var m=ai.get(this);m?Vc(this,m,p,v):a.call(this,p,v)};n.raycast=o;var s=i.array,u=(r=n.geometry.getIndex())===null||r===void 0?void 0:r.array,c=n.geometry.boundingBox,l=c?[c.min.x,c.min.y,c.min.z,c.max.x,c.max.y,c.max.z]:void 0,h=new kc(s,u);return h.createTree(t,e,l),ai.set(n,h),function(){ai.delete(n),n.raycast===o&&(n.raycast=a)}}}return function(){}}function zc(n,t,e){var r;if(t===void 0&&(t=100),e===void 0&&(e=10),n.geometry instanceof d.BufferGeometry){var i=n.geometry.getAttribute("position");if(i instanceof d.BufferAttribute){var a=n.raycast,o=function(p,v){var m=ji.get(this);m?Uc(this,m,p,v):a.call(this,p,v)};n.raycast=o;var s=i.array,u=(r=n.geometry.getIndex())===null||r===void 0?void 0:r.array,c=n.geometry.boundingBox,l=c?[c.min.x,c.min.y,c.min.z,c.max.x,c.max.y,c.max.z]:void 0,h=new Lc(s,u);return h.createTree(t,e,l),ji.set(n,h),function(){ji.delete(n),n.raycast===o&&(n.raycast=a)}}}return function(){}}function Hc(n,t,e){t===void 0&&(t=100),e===void 0&&(e=10);var r=[];return n.traverse(function(i){if(i instanceof d.Mesh){var a=qc(i,t,e);r.push(a)}else if(i instanceof d.Points){var a=zc(i,t,e);r.push(a)}}),function(){for(var i=0,a=r;i<a.length;i++){var o=a[i];o()}}}var jc=new d.Vector3,_c=new d.Vector3,Gc=new d.Vector3,Eu=function(n){de(t,n);function t(e,r){var i=n.call(this)||this;i.renderOrder=-4;var a=Hc(e,200,10);return i.disposers=[r,a],i.add(e),i}return t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=this.children.slice(),s;s=o.pop();)if(s.visible){s.raycast(e,i);for(var u=0,c=s.children.length;u<c;u++)o.push(s.children[u])}return i.forEach(function(l){var h,p,v=0;if((l.object instanceof _t||l.object instanceof Lr)&&l.face){var m=Array.isArray(l.object.material)?l.object.material[l.face.materialIndex]:l.object.material;if(m)if(m.defines.USE_VERTEX_FLOOR){var A=(h=l.object.geometry.attributes.position)===null||h===void 0?void 0:h.array,y=(p=l.object.geometry.attributes.floor)===null||p===void 0?void 0:p.array;if(A&&y){var f=jc.set(A[l.face.a*3],A[l.face.a*3+1],A[l.face.a*3+2]).applyMatrix4(a.matrixWorld),g=_c.set(A[l.face.b*3],A[l.face.b*3+1],A[l.face.b*3+2]).applyMatrix4(a.matrixWorld),b=Gc.set(A[l.face.c*3],A[l.face.c*3+1],A[l.face.c*3+2]).applyMatrix4(a.matrixWorld),w=l.point.distanceTo(f),E=l.point.distanceTo(g),x=l.point.distanceTo(b);v=Math.round((w*y[l.face.a]+E*y[l.face.b]+x*y[l.face.c])/(w+E+x))}}else v=m.floor}l.floor=v}),r&&i.sort(function(l,h){return l.distance-h.distance}),i},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}},t}(d.Group);function It(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(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 yr(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function xu(n,t){if(n.content&&n.content.uri&&(yr(n.content.uri)||(n.content.uri=It(t,n.content.uri))),n.children)for(var e=0,r=n.children;e<r.length;e++){var i=r[e];xu(i,t)}return n}function jo(n,t){return n.asset.overview={imageFile:"overview.png",worldFile:"overview.pgw",imageWidth:1024,imageHeight:1024},n.asset.overview&&(yr(n.asset.overview.imageFile)||(n.asset.overview.imageFile=It(t,n.asset.overview.imageFile)),yr(n.asset.overview.worldFile)||(n.asset.overview.worldFile=It(t,n.asset.overview.worldFile))),xu(n.root,t),n}function Mu(n,t){return(t[0]==="?"||t[0]==="&")&&(t=t.slice(1)),t?((n[n.length-1]==="?"||n[n.length-1]==="&")&&(n=n.slice(0,-1)),n.indexOf("?")>=0?"".concat(n,"&").concat(t):"".concat(n,"?").concat(t)):n}var _i=4;function Cu(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=_i,n.version=r.getUint32(e,!0),e+=_i,n.byteLength=r.getUint32(e,!0),e+=_i,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var nr,xe;(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"})(xe||(xe={}));var Kc=(nr={},nr[xe.DOUBLE]=Float64Array,nr[xe.FLOAT]=Float32Array,nr[xe.UNSIGNED_SHORT]=Uint16Array,nr[xe.UNSIGNED_INT]=Uint32Array,nr[xe.UNSIGNED_BYTE]=Uint8Array,nr[xe.BYTE]=Int8Array,nr[xe.SHORT]=Int16Array,nr[xe.INT]=Int32Array,nr),Wc={DOUBLE:xe.DOUBLE,FLOAT:xe.FLOAT,UNSIGNED_SHORT:xe.UNSIGNED_SHORT,UNSIGNED_INT:xe.UNSIGNED_INT,UNSIGNED_BYTE:xe.UNSIGNED_BYTE,BYTE:xe.BYTE,SHORT:xe.SHORT,INT:xe.INT};function pi(n){var t=Kc[n];if(!t)throw new Error("Failed to convert GL type");return t}function Gi(n){var t=pi(n);return t.BYTES_PER_ELEMENT}function _o(n,t,e,r){e===void 0&&(e=0);var i=pi(n);if(e%Gi(n)!==0){var a=r?t.slice(e,e+r*Gi(n)):t.slice(e);return new i(a)}else return new i(t,e,r??(t.byteLength-e)/Gi(n))}function Xc(n){var t=Wc[n];if(!t)throw new Error("Failed to convert GL type");return t}var Iu=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",xe.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=pi(e);return new a([i])}else if(Array.isArray(i)){var a=pi(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=Xc(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 u=0;u<r;++u)a[u]=s[r*i+u];return a},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,a){var o=this.cachedTypedArrays,s=o[t];return s||(s=_o(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=_o(e,r),i[t]=a),a},n}(),tn=4,Go="b3dm tile in legacy format.";function Su(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function Tu(n,t,e){return e=Yc(n,t,e),e=Jc(n,t,e),e=Zc(n,t,e),e}function Yc(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=tn;var o=r.getUint32(e,!0);e+=tn;var s=r.getUint32(e,!0);e+=tn;var u=r.getUint32(e,!0);return e+=tn,s>=570425344?(e-=tn*2,i=a,s=o,u=0,a=0,o=0,console.warn(Go)):u>=570425344&&(e-=tn,i=s,s=a,u=o,a=0,o=0,console.warn(Go)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=u,n.header.batchLength=i,e}function Jc(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=Su(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=new d.Vector3;var u=new Iu(n.featureTableJson,n.featureTableBinary);if(Array.isArray(u.json.RTC_CENTER))n.rtcCenter.fromArray(u.json.RTC_CENTER);else{var c=u.getGlobalProperty("RTC_CENTER",xe.FLOAT,3);c&&n.rtcCenter.fromArray(c)}return e}function Zc(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=Su(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 $c(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 ed(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=$c(t,e,r),n.byteLength}function Ea(n){if(typeof TextDecoder<"u")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{return t}}var Re={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},wn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},vi={9728:d.NearestFilter,9729:d.LinearFilter,9984:d.NearestMipmapNearestFilter,9985:d.LinearMipmapNearestFilter,9986:d.NearestMipmapLinearFilter,9987:d.LinearMipmapLinearFilter},Ai={33071:d.ClampToEdgeWrapping,33648:d.MirroredRepeatWrapping,10497:d.RepeatWrapping},Ko={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Rt={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Sr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},td={CUBICSPLINE:void 0,LINEAR:d.InterpolateLinear,STEP:d.InterpolateDiscrete},pr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function yt(n){var t=[];for(var e in n)t.push(n[e]);return t}var rd=function(){function n(t,e,r){this.json=t,this.extensions=e,this.options=r,this.cache=new Map,this.disposeSet=new Set,this.nodeNamesUsed={}}return n.prototype.dispose=function(){this.cache.clear(),this.disposeSet.forEach(function(t){t.dispose()}),this.disposeSet.clear()},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,u=o.length;s<u;s++)t[o[s]].isBone=!0;for(var c=0,l=t.length;c<l;c++){var h=t[c];h.mesh!==void 0&&h.skin!==void 0&&(r[h.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.dispose(),this.markDefs();for(var i=0,a=yt(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(yt(r).map(function(s){return s.prepare(t)})).then(function(){var s,u,c;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(l,h){return t.loadScene(h)})),Promise.all(((u=e.animations)!==null&&u!==void 0?u:[]).map(function(l,h){return t.loadAnimation(h)})),Promise.all(((c=e.cameras)!==null&&c!==void 0?c:[]).map(function(l,h){return t.loadCamera(h)}))])}).then(function(s){var u=s[0],c=s[1],l=s[2],h={json:t.json,scene:u[e.scene||0],scenes:u,animations:c,cameras:l,dispose:function(){return t.dispose()}};return Promise.all(yt(r).map(function(p){return p.emitResult(h,t)})).then(function(){return h})})},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=yt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var u=void 0,c=this.json.cameras[t],l=c[c.type];l?c.type==="perspective"?u=new d.PerspectiveCamera(d.MathUtils.radToDeg(l.yfov),l.aspectRatio||1,l.znear||1,l.zfar||2e6):c.type==="orthographic"?u=new d.OrthographicCamera(-l.xmag,l.xmag,l.ymag,-l.ymag,l.znear,l.zfar):(console.warn("glTF: Invalid camera type ".concat(c.type,".")),u=new d.Camera):(console.warn("glTF: Missing camera parameters."),u=new d.Camera),c.name&&(u.name=this.createUniqueName(c.name)),i=Promise.resolve(u)}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=yt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadAnimation(t,this),i)break}if(!i){for(var u=this.json,c=u.animations[t],l=[],h=[],p=[],v=[],m=[],A=0,y=c.channels.length;A<y;A++){var f=c.channels[A],g=c.samplers[f.sampler],b=f.target,w=b.node!==void 0?b.node:b.id,E=c.parameters!==void 0?c.parameters[g.input]:g.input,x=c.parameters!==void 0?c.parameters[g.output]:g.output;l.push(this.loadNode(w)),h.push(this.loadAccessor(E)),p.push(this.loadAccessor(x)),v.push(g),m.push(b)}i=Promise.all([Promise.all(l),Promise.all(h),Promise.all(p),Promise.all(v),Promise.all(m)]).then(function(M){for(var C=M[0],I=M[1],P=M[2],S=M[3],F=M[4],k=[],O=function(j,z){var U=C[j],X=I[j],G=P[j],K=S[j],Y=F[j];if(U===void 0)return"continue";U.updateMatrix(),U.matrixAutoUpdate=!0;var H=void 0;switch(Sr[Y.path]){case Sr.weights:H=d.NumberKeyframeTrack;break;case Sr.rotation:H=d.QuaternionKeyframeTrack;break;case Sr.position:case Sr.scale:default:H=d.VectorKeyframeTrack;break}var J=U.name?U.name:U.uuid,ne=K.interpolation!==void 0?td[K.interpolation]:d.InterpolateLinear,$=[];Sr[Y.path]===Sr.weights?U.traverse(function(Ae){Ae.morphTargetInfluences&&$.push(Ae.name?Ae.name:Ae.uuid)}):$.push(J);var te=G.array;if(G.normalized){for(var ae=Ki(te.constructor),ce=new Float32Array(te.length),oe=0,fe=te.length;oe<fe;oe++)ce[oe]=te[oe]*ae;te=ce}for(var oe=0,fe=$.length;oe<fe;oe++){var Ie=new H($[oe]+"."+Sr[Y.path],X.array,te,ne);k.push(Ie)}},L=0,N=C.length;L<N;L++)O(L);var V=c.name?c.name:"animation_"+t;return new d.AnimationClip(V,void 0,k)})}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=yt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadBuffer(t,this),a)break}if(!a){var c=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(c.uri),{responseType:"arraybuffer"}).then(function(l){return l.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=yt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadBufferView(t,this),i)break}if(!i){var u=this.json.bufferViews[t];i=this.loadBuffer(u.buffer).then(function(c){var l=u.byteLength||0,h=u.byteOffset||0;return c.slice(h,h+l)})}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(u){var c=u[0],l=Ko[o.type],h=wn[o.componentType],p=h.BYTES_PER_ELEMENT,v=p*l,m=o.byteOffset||0,A=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,y=o.normalized===!0,f,g;if(A&&A!==v){var b=Math.floor(m/A),w="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,E=e.cache.get(w);E||(f=new h(c,b*A,o.count*A/p),E=new d.InterleavedBuffer(f,A/p),e.cache.set(w,E)),g=new d.InterleavedBufferAttribute(E,l,m%A/p,y)}else c===null?f=new h(o.count*l):f=new h(c,m,o.count*l),g=new d.BufferAttribute(f,l,y);if(o.sparse!==void 0){var x=Ko.SCALAR,M=wn[o.sparse.indices.componentType],C=o.sparse.indices.byteOffset||0,I=o.sparse.values.byteOffset||0,P=new M(u[1],C,o.sparse.count*x),S=new h(u[2],I,o.sparse.count*l);c!==null&&(g=new d.BufferAttribute(g.array.slice(),g.itemSize,g.normalized));for(var F=0,k=P.length;F<k;F++){var O=P[F];if(g.setX(O,S[F*l]),l>=2&&g.setY(O,S[F*l+1]),l>=3&&g.setZ(O,S[F*l+2]),l>=4&&g.setW(O,S[F*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return g})}}return this.cache.set(r,a),a},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=yt(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(),u=0,c=s.length;u<c;u++)o+=s[u]+":"+t.attributes[s[u]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){var e=this,r="geometry:"+this.createPrimitiveKey(t),i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=yt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadGeometry(t,this),a)break}return a||(a=this.addGeometryPrimitiveAttributes(new d.BufferGeometry,t)),a=a.then(function(c){return e.disposeSet.add(c),c}),this.cache.set(r,a),a},n.prototype.loadImage=function(t){var e="image:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=yt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadImage(t,this),i)break}if(!i){var u=this.json.images[t];if(u.bufferView)i=this.loadBufferView(u.bufferView).then(function(l){var h=new Blob([l],{type:u.mimeType});return du(h)});else if(u.uri){var c=this.resolveResouce(u.uri);i=this.options.fetcher.loadImage(c,{},void 0,void 0,void 0,fi()).then(function(l){return l.body})}else throw new Error("glTF: Invalid image defs.")}return this.cache.set(e,i),i},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(l){return Rt[l]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return Rt[l]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(l){return Rt[l]==="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(l){l.encoding=d.sRGBEncoding,i.map=l,e.disposeSet.add(l)})),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(l){l.encoding=d.sRGBEncoding,i.metalnessMap=l,i.roughnessMap=l,e.disposeSet.add(l)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var u=a.alphaMode||pr.OPAQUE;if(u===pr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===pr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(l){i.normalMap=l,e.disposeSet.add(l)})),i.normalScale=new d.Vector2(1,1),a.normalTexture.scale!==void 0)){var c=a.normalTexture.scale;i.normalScale.set(c,c)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(l){i.aoMap=l,e.disposeSet.add(l)})),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(l){i.emissiveMap=l,e.disposeSet.add(l)}))}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(u){return Rt[u]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return Rt[u]==="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||pr.OPAQUE;s===pr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===pr.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(c){return Rt[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return Rt[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)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var u=a.alphaMode||pr.OPAQUE;u===pr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===pr.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=this,r,i=(r=t.mode)!==null&&r!==void 0?r:Re.TRIANGLES,a="material:"+this.createPrimitiveKey(t),o=this.cache.get(a);if(o)return o;for(var s=null,u=0,c=yt(this.extensions);u<c.length;u++){var l=c[u];if(s=l.loadMaterial(t,this),s)break}if(i===Re.TRIANGLES||i===Re.TRIANGLE_STRIP||i===Re.TRIANGLE_FAN)s=this.loadMaterialAsMeshStandardMaterial(t);else if(i===Re.LINES||i===Re.LINE_STRIP||i===Re.LINE_LOOP)s=this.loadMaterialAsLineBasicMaterial(t);else if(i===Re.POINTS)s=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+i);return s=s.then(function(h){return e.disposeSet.add(h),h}),this.cache.set(a,s),s},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=yt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadTexture(t,this),a)break}if(!a){var c=this.json.textures[t];a=this.loadImage(c.source).then(function(l){var h=new d.Texture(l);h.needsUpdate=!0,h.flipY=!1,c.name&&(h.name=c.name);var p=e.json.samplers||{},v=p[c.sampler]||{};h.magFilter=vi[v.magFilter]||d.LinearFilter,h.minFilter=vi[v.minFilter]||d.LinearMipmapLinearFilter,h.wrapS=Ai[v.wrapS]||d.RepeatWrapping,h.wrapT=Ai[v.wrapT]||d.RepeatWrapping;var m=h.dispose;return h.dispose=function(){return h.dispose=m,l.close(),m.call(this)},h})}return a=a.then(function(l){return e.disposeSet.add(l),l}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=yt(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],u=s.primitives,c=Promise.all(u.map(function(h){return e.loadGeometry(h)})),l=Promise.all(u.map(function(h){return e.loadMaterial(h)}));r=Promise.all([c,l]).then(function(h){for(var p=h[0],v=h[1],m=[],A=0;A<u.length;A++){var y=u[A],f=p[A],g=v[A],b=y.mode||Re.TRIANGLES,w=void 0;if(b===Re.TRIANGLES||b===Re.TRIANGLE_STRIP||b===Re.TRIANGLE_FAN)if(b===Re.TRIANGLE_STRIP?f=e.toGeometryTrianglesDrawMode(f,d.TriangleStripDrawMode):b===Re.TRIANGLE_FAN&&(f=e.toGeometryTrianglesDrawMode(f,d.TriangleFanDrawMode)),s.isSkinnedMesh){var E=new d.SkinnedMesh(f,g);f.attributes.skinWeight.normalized||E.normalizeSkinWeights(),w=E}else w=new d.Mesh(f,g);else if(b===Re.POINTS)w=new d.Points(f,g);else if(b===Re.LINES)w=new d.LineSegments(f,g);else if(b===Re.LINE_STRIP)w=new d.Line(f,g);else if(b===Re.LINE_LOOP)w=new d.LineLoop(f,g);else throw new Error("glTF: Primitive mode unsupported: "+b);if(Object.keys(f.morphAttributes).length>0){if(s.weights!==void 0)for(var x=0,M=s.weights.length;x<M;x++)w.morphTargetInfluences[x]=s.weights[x];if(s.extras&&Array.isArray(s.extras.targetNames)){var C=s.extras.targetNames;if(w.morphTargetInfluences.length===C.length){w.morphTargetDictionary={};for(var x=0,M=C.length;x<M;x++)w.morphTargetDictionary[C[x]]=x}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}w.name=e.createUniqueName(s.name||"mesh_"+t),m.push(w)}if(m.length===1)return m[0];for(var I=new d.Group,P=0,S=m;P<S.length;P++){var w=S[P];I.add(w)}return I})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=yt(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(p){if(a.weights!==void 0){var v=a.weights;p.traverse(function(m){if(m instanceof d.Mesh||m instanceof d.Line||m instanceof d.Points)for(var A=0,y=v.length;A<y;A++)m.morphTargetInfluences[A]=v[A]})}return p})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var u=this.loadNodeAttachments(t),c=0,l=u;c<l.length;c++){var h=l[c];s.push(h)}return Promise.all(s).then(function(p){var v;if(a.isBone===!0?v=new d.Bone:p.length>1?v=new d.Group:p.length===1?v=p[0]:v=new d.Object3D,v!==p[0])for(var m=0,A=p.length;m<A;m++)v.add(p[m]);if(a.name&&(v.name=o),a.matrix!==void 0){var y=new d.Matrix4;y.fromArray(a.matrix),v.applyMatrix4(y)}else a.translation!==void 0&&v.position.fromArray(a.translation),a.rotation!==void 0&&v.quaternion.fromArray(a.rotation),a.scale!==void 0&&v.scale.fromArray(a.scale);return v})},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,u=a.length;s<u;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=yt(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s)}return r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(E){var x=Rt[E]||E.toLowerCase();if(x in t.attributes)return"continue";a.push(s.loadAccessor(i[E]).then(function(M){M&&t.setAttribute(x,M)}))},s=this;for(var u in i)o(u);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(E){E&&t.setIndex(E)}));var c=new d.Box3;if(i.POSITION!==void 0){var l=this.json.accessors[i.POSITION],h=l.min,p=l.max;if(h!==void 0&&p!==void 0){if(c.set(new d.Vector3(h[0],h[1],h[2]),new d.Vector3(p[0],p[1],p[2])),l.normalized){var v=Ki(wn[l.componentType]);c.min.multiplyScalar(v),c.max.multiplyScalar(v)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var m=e.targets;if(m!==void 0){for(var A=new d.Vector3,y=new d.Vector3,f=0,g=m.length;f<g;f++){var b=m[f];if(b.POSITION!==void 0){var l=this.json.accessors[b.POSITION],h=l.min,p=l.max;if(h!==void 0&&p!==void 0){if(y.setX(Math.max(Math.abs(h[0]),Math.abs(p[0]))),y.setY(Math.max(Math.abs(h[1]),Math.abs(p[1]))),y.setZ(Math.max(Math.abs(h[2]),Math.abs(p[2]))),l.normalized){var v=Ki(wn[l.componentType]);y.multiplyScalar(v)}A.max(y)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}c.expandByVector(A)}t.boundingBox=c;var w=new d.Sphere;return c.getCenter(w.center),w.radius=c.min.distanceTo(c.max)/2,t.boundingSphere=w,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 E=!1,x=!1,M=0,C=e.targets.length;M<C;M++){var I=e.targets[M];if(I.POSITION!==void 0&&(E=!0),I.NORMAL!==void 0&&(x=!0),E&&x)break}if(!E&&!x)return t;var P=[];t.morphTargetsRelative=!0;for(var S=function(F,k){var O=e.targets[F];E?P.push(r.loadAccessor(O.POSITION).then(function(L){L&&(t.morphAttributes.position[F]=L)})):t.morphAttributes.position[F]=t.attributes.position,x?P.push(r.loadAccessor(O.NORMAL).then(function(L){L&&(t.morphAttributes.normal[F]=L)})):t.morphAttributes.normal[F]=t.attributes.normal},M=0,C=e.targets.length;M<C;M++)S(M,C);return Promise.all(P).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 u=[],c=0,l=o.joints.length;c<l;c++)u.push(r.loadNode(o.joints[c]));return Promise.all(u)}).then(function(s){return a.traverse(function(u){if(u instanceof d.SkinnedMesh){for(var c=[],l=[],h=0,p=s.length;h<p;h++){var v=s[h];if(v instanceof d.Bone){c.push(v);var m=new d.Matrix4;o.inverseBindMatrices!==void 0&&m.fromArray(o.inverseBindMatrices.array,h*16),l.push(m)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[h])}u.bind(new d.Skeleton(c,l),u.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,u=0,c=s.length;u<c;u++){var l=s[u];o.push(r.buildNodeHierarchy(l,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 It(this.options.resourcePath,Mu(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,u=[];if(e===d.TriangleFanDrawMode)for(var o=1;o<=s;o++)u.push(r.getX(0)),u.push(r.getX(o)),u.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2===0?(u.push(r.getX(o)),u.push(r.getX(o+1)),u.push(r.getX(o+2))):(u.push(r.getX(o+2)),u.push(r.getX(o+1)),u.push(r.getX(o)));u.length/3!==s&&console.error("glTF: Unable to generate correct amount of triangles.");var c=t.clone();return c.setIndex(u),c},n}();function Ki(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 br=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}(),nd=function(n){de(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 Ea(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 u=i.getUint32(a,!0);a+=4;var c=i.getUint32(a,!0);if(a+=4,c===t.CHUNK_TYPES.JSON){var l=new Uint8Array(e,t.HEADER_LENGTH+a,u);o=Ea(l)}else if(c===t.CHUNK_TYPES.BIN){var h=t.HEADER_LENGTH+a;s=e.slice(h,h+u)}a+=u}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.HEADER_MAGIC="glTF",t.HEADER_LENGTH=12,t.CHUNK_TYPES={JSON:1313821514,BIN:5130562},t}(br),id="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",Wo={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},Xo={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},ad=function(){function n(){this.decoderPath=id,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||Wo,attributeTypes:i||Xo,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:Wo,attributeTypes:Xo,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++,u=t.byteLength,c=this._getWorker(s,u).then(function(l){return o=l,new Promise(function(h,p){o._callbacks[s]={resolve:h,reject:p},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(l){return r._createGeometry(l.geometry)});return c.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),c},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=ln(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 */",Yo].join(`
|
|
418
|
-
`);t.workerSourceURL=URL.createObjectURL(new Blob([o]))})}else{var r=ln(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(o){return o.body}),i=ln(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],u=o[1];t.decoderConfig.wasmBinary=u;var c=["/* draco decoder */",s,"","/* worker */",
|
|
419
|
-
`);t.workerSourceURL=URL.createObjectURL(new Blob([c]))})}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}(),mi=new
|
|
417
|
+
`,uu=[];function cc(){var n=uu.pop();return n||new d.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:uc,fragmentShader:lc,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function dc(n){n.uniforms.map.value=null,uu.push(n)}function fc(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=0,s=n;o<s.length;o++){var u=s[o],c=cc();a.push(c),c.uniforms.map.value=u.texture,c.uniforms.flipY.value=u.flipY?1:0;var l=new d.Group,h=new d.Mesh(sc,c);h.position.set(u.position.x+u.size.x/2-.5,1-(u.position.y+u.size.y/2)-.5,-.5),h.scale.set(u.size.x,u.size.y,1),l.quaternion.copy(oc[u.face]),l.add(h),i.add(l)}var p=e.autoClear;e.autoClear=!1;var v=new d.CubeCamera(.1,2,t);v.matrixAutoUpdate=!1,v.update(e,r),e.autoClear=p;for(var m=0,A=a;m<A.length;m++){var c=A[m];dc(c)}}var ma=[],hc=6,zi=0;it.shared.add(function(){if(zi=hc,ma.length)for(var n=ma.splice(0,zi),t=0,e=n;t<e.length;t++){var r=e[t];zi--,r()}});var ga=function(){return!1}();function fi(){var n=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onerror=n.onload=n.close=Q;var t=n.src;n.removeAttribute("src"),/^blob\:/.test(t)&&URL.revokeObjectURL(t)}});return n}function lu(n){return new Promise(function(t,e){var r=fi();r.onload=function(){/^blob\:/.test(r.src)&&URL.revokeObjectURL(r.src),r.onload=r.onerror=Q,setTimeout(function(){t(r)},0)},r.onerror=function(){var i=r.src;r.onload=r.onerror=Q,r.close(),e(new Error("image load error: ".concat(i)))},r.src=URL.createObjectURL(n)})}function So(n){return new Promise(function(t){ma.push(function(){t(lu(n))})})}var To=[];function pc(n,t){var e=To.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,To.push(r)}});return r}function Po(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=pc(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<"u"&&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 vc(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 Hr=["right","left","up","down","front","back"],Ac=4,Qe=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.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.textures=[],this.baseCubeTexture=t}return Object.defineProperty(n.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(t){var e,r,i,a,o;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,this.baseCubeTexture&&(Aa(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&Aa(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,u,c=this.tileSources.filter(function(A){return A.level===t.level})[0];if(!c){this.loadedCubeNodes.add(t);return}var l=c.size,h=Math.pow(2,t.level)*t.position.y,p=Math.pow(2,t.level)*t.position.x,v="".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(h,".").concat(p),m=R(R({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:v,size:l*t.size===this.options.tileImageSize?void 0:this.options.tileImageSize,quality:void 0,cut:[l*t.position.x,l*t.position.y,l*t.size,l*t.size]});this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(c[t.face],{imageURL:{transform:(u=this.options.imageURL)===null||u===void 0?void 0:u.transform,options:R({},m)},format:d.RGBAFormat,viaAjax:ga,timeout:this.options.timeout,fetcher:this.options.fetcher}).then(function(A){if(e.disposed){A.body.dispose();return}e.textures.push({face:t.face,level:t.level,position:t.position,size:new d.Vector2(t.size,t.size),texture:A.body,flipY:!A.body.flipY}),e.loadedCubeNodes.add(t)}).catch(Q).then(function(){e.disposed||e.loadingCubeNodes.delete(t)})},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=[];Ha(this.tileTree,function(p){if(r.loadingCubeNodes.has(p)||p.level>e||!t.intersectsBox(p.box))return!1;if(!r.loadedCubeNodes.has(p))return i.push(p),!1});for(var a=0,o=i;a<o.length;a++){var s=o[a];this.requestTile(s)}if(this.cubeRenderTarget&&this.textures.length){var u=this.textures.splice(0,Ac);fc(u,this.cubeRenderTarget,this.renderer),this.needsRender=!0;for(var c=0,l=u;c<l.length;c++){var h=l[c];h.texture.dispose()}}}},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.textures;t<e.length;t++){var r=e[t];r.texture.dispose()}this.textures.length=0}},n}(),An=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,u,c,l;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var h={};typeof e.flipY<"u"&&(h.flipY=e.flipY),typeof e.format<"u"&&(h.format=e.format),typeof e.minFilter<"u"&&(h.minFilter=e.minFilter),typeof e.magFilter<"u"&&(h.magFilter=e.magFilter);var p=(u=(s=e.imageURL)===null||s===void 0?void 0:s.options)!==null&&u!==void 0?u:{key:"unknown"};t=di(t,(c=e.imageURL)===null||c===void 0?void 0:c.transform,p);var v=Co(t),m=(l=e.viaAjax)!==null&&l!==void 0?l:!1,A=Mo(t),y=/^https?:/.test(v);if(A?m=!0:y||(m=!1),m){var f=null,g="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:g},void 0,void 0,a).then(function(E){return So(E.body)}).then(function(E){return Po(E,e.maxSize)}).then(function(E){return Object.assign(E,h),E}).then(function(E){var x={meta:f,body:E};return r(x),x}).catch(function(E){return i(E),Promise.reject(E)})}else{var b=null,w;return Promise.resolve().then(function(){return fi()}).then(function(E){return w=E,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,E)}).then(function(E){return b=E.meta,Po(E.body,e.maxSize)}).then(function(E){return Object.assign(E,h),E}).then(function(E){var x={meta:b,body:E};return r(x),x}).catch(function(E){return w&&w.close(),i(E),Promise.reject(E)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,u,c,l;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q),typeof e.format<"u"&&e.format,typeof e.minFilter<"u"&&e.minFilter,typeof e.magFilter<"u"&&e.magFilter;for(var h=[t[Hr[0]],t[Hr[1]],t[Hr[2]],t[Hr[3]],t[Hr[4]],t[Hr[5]]],p=[],v=[0,0,0,0,0,0],m=[],A=function(f){var g=(u=(s=e.imageURL)===null||s===void 0?void 0:s.options)!==null&&u!==void 0?u:{key:"unknown"},b=di(h[f],(c=e.imageURL)===null||c===void 0?void 0:c.transform,R(R({},g),{key:g.key+"."+Hr[f]})),w=Co(b),E=function(F){v[f]=F,a(v.reduce(function(k,O){return k+O},0)/6)},x=(l=e.viaAjax)!==null&&l!==void 0?l:!1,M=/^https?:$/.test(w),C=Mo(b);if(C?x=!0:M||(x=!1),x){var I="blob",P=e.fetcher.ajax(b,{timeout:e.timeout,responseType:I},void 0,void 0,E).then(function(F){return m[f]=F.meta,So(F.body)});p.push(P)}else{var S,P=Promise.resolve().then(function(){return fi()}).then(function(k){return S=k,e.fetcher.loadImage(b,{timeout:e.timeout},void 0,void 0,E,k)}).then(function(k){return m[f]=k.meta,k.body}).catch(function(k){return S&&S.close(),Promise.reject(k)});p.push(P)}},y=0;y<6;y++)A(y);return Promise.all(p).then(function(f){return vc(f)}).then(function(f){return Object.assign(f,R({encoding:d.sRGBEncoding},e)),f}).then(function(f){var g={body:f,meta:m};return r(g),g}).catch(function(f){for(var g=0,b=p;g<b.length;g++){var w=b[g];w.then(function(E){return E.close()}).catch(Q)}return i(f),Promise.reject(f)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var u=this;return i===void 0&&(i=Q),a===void 0&&(a=Q),o===void 0&&(o=Q),new Promise(function(c,l){var h,p;u.loadCubeTexture(t,{imageURL:{transform:(h=r.imageURL)===null||h===void 0?void 0:h.transform,options:(p=r.imageURL)===null||p===void 0?void 0:p.options},format:d.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher},function(v){var m,A,y=v.meta,f=v.body,g=(m=r.tileImageSize)!==null&&m!==void 0?m:512,b=(A=r.tileMaxLevel)!==null&&A!==void 0?A:2,w=Math.max(1024*b,512),E=pa(b),x=new Qe(f,E,e,{textureSize:w,tileImageSize:g,textureLoader:u,imageURL:r.imageURL,timeout:r.timeout,fetcher:r.fetcher},s),M={meta:y,body:x};i(M),c(M)},function(v){a(v),l(v)},o,s).catch(Q)})},n}();const mc=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`RlcR_aRelSY\\\\_6--nvor-sy|n-sy||H--n\bv{t-sy|n-Sy||H0r{qvsnvor-sy|n-v_||sZnxHn\bv{t-sy|n-V_||sZnxHn\bv{t-rp@-[|znyHn\bv{t-rp@-cvr]|vv|{Hn\bv{t-rpA-|yq]|vv|{Hn\bv{t-sy|n-Y|tQr}uHn\bv{t-znA-cvrZnv\x07H0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrr\x07K0v{pyqr-I?l}nlrr\x07K0v{pyqr-Ip|y|l}nlrr\x07K0v{pyqr-Iunq|zn}l}nlrr\x07K|vq-znv{56-\n--0v{pyqr-Ilrr\x07K--0v{pyqr-I?lrr\x07K--0v{pyqr-Ip|y|lrr\x07K--0v{pyqr-Iortv{{|znylrr\x07K--0v{pyqr-Iqrsny{|znylrr\x07K--rpA-n{s|zrq-J-rpA5}|vv|{9->;=6H--rpA-z]|vv|{-J-z|qrycvrZnv\x07-7-n{s|zrqH--[|zny-J-{|znyv r5n{s|zrq[|zny6H--0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6----Sy||-J-sy||H--0r{qvs--cvr]|vv|{-J-:z]|vv|{;\x07\b H--|yq]|vv|{-J-z|qryZnv\x07-7-n{s|zrqH--tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-n{s|zrqH--0v{pyqr-Iunq|zn}lrr\x07K--Y|tQr}u-J-y|t?5:z]|vv|{; 6H--cvrZnv\x07-J-vrZnv\x07H--V_||sZnx-J-v_||sZnxH\f"),gc=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->;=60qrsv{r-aNb-C;?E@>EB?{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznv\x07H0vs-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\x07H0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-rp@-qvssrH{vs|z-rp@-rzvvrH{vs|z-rp@-}rpynH{vs|z-sy|n-uv{v{rH{vs|z-sy|n-r\x07}|rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH{vs|z-sy|n-u|{Sy||V{qr\x07Hn\bv{t-sy|n-V_||sZnxH0vs-qrsv{rq5b`RlP\\[`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-Sy||H--0ryr----ory|{tv{tSY||-J-sy||H--0r{qvs--zn@-pnzrn_|nv|{Znv\x07-J-zn@5cvrZnv\x07h=jh=j9-cvrZnv\x07h>jh=j9-cvrZnv\x07h?jh=j9cvrZnv\x07h=jh>j9-cvrZnv\x07h>jh>j9-cvrZnv\x07h?jh>j9cvrZnv\x07h=jh?j9-cvrZnv\x07h>jh?j9-cvrZnv\x07h?jh?j6H--rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn_|nv|{Znv\x07-7-rp@5=;=9=;=9>;=66H--vs5pnzrnQvrpv|{;\b-K-=;E-33-V_||sZnx-JJ->;=6-\n----qvpnqH--\f--<<前置裁切计算--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-|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5ory|{tv{tSY||-:-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--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->;=6H----r{H--0r{qvs--<<楼层选择计算--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-KJ-=;=-33-no5ory|{tv{tSY||-:-u|{Sy||V{qr\x076-KJ->;=6-\n----sy||\\}npv\b-J-=;>H--\f--rpA-qvssrP|y|-J-rpA5qvssr;to9-|}npv\b6H--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5rp@5=;=69-rp@5=;=69-rp@5=;=69-rp@5=;=66H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--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--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--<<-调整曝光值--vnqvn{pr-J-vnqvn{pr-7-r\x07}|rH--0v{pyqr-Iyvtulsntzr{lzn}K--0v{pyqr-Iyvtulsntzr{lr{qK--0v{pyqr-In|zn}lsntzr{K--<<-减少方向光对模型的影响--rp@-|t|v{tYvtu-J-5rsyrprqYvtu;qvrpQvssr-7-=;?6-8----rsyrprqYvtu;v{qvrpQvssr-8----rsyrprqYvtu;v{qvrp`}rpyn-8----|nyRzvvr_nqvn{prH--<<-修复黑色面片的问题--vs-5|t|v{tYvtu;-K-=;=-\v\v-|t|v{tYvtu;t-K-=;=-\v\v-|t|v{tYvtu;o-K-=;=6-\n----tylSntP|y|-J-rpA5|t|v{tYvtu9-qvssrP|y|;n6H--\f-ryr-\n----tylSntP|y|-J-rpA5OYNPXlP\\Y\\_;\x07\b 9-qvssrP|y|;n6H--\f--rp@-}n{|=a|crr\x07-J-5|yq]|vv|{;\x07\b -:-}n{|=lznv\x07h@j;\x07\b 6-7-zn@5}n{|=lznv\x076H--rp@-}n{|>a|crr\x07-J-5|yq]|vv|{;\x07\b -:-}n{|>lznv\x07h@j;\x07\b 6-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-:-?;=66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--0vs-qrsv{rq5b`Rl]N[\\lcVQR\\6----rp@-pnzrna|crr\x07-J-|yq]|vv|{;\x07\b -:-pnzrn]|vv|{H----rpA-zn}P||q-J-rpA5pnzrna|crr\x079->;=6-7-}n{|cvqr|lznv\x07H----rp?--J-rp?5------=;B-8-zn}P||q;\x07-<-zn}P||q; -<-}n{|cvqr|lv r;\x079------=;B-:-zn}P||q;\b-<-zn}P||q; -<-}n{|cvqr|lv r;\b----6H----rpA-vqr|P|y|-J-r\x07r?Q5}n{|cvqr|lzn}9-6H----sy|n-znpu-J-5>;=-:-r}5=;=9-zn}P||q; 66-7-5>;=-:-r}5=;B9-no5;\x07-:-=;B666-7-5>;=-:-r}5=;B9-no5;\b-:-=;B666H----sy|n-ny}un-J-pynz}5=;=9->;=9-B;=-7-5>;=-:-pynz}5qvn{pr59-rp?5=;B9-=;B66-<-=;BB-9-=;=9->;=666H----}n{|P|y|-J-zv\x075}n{|P|y|9-vqr|P|y|9-znpu-7-ny}un-7-}n{|cvqr|lny}un6H--0r{qvs--0vs-qrsv{rq5b`Rl]N[\\l\\]NPVaf6----tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H----tylSntP|y|;n-J-|}npv\bH--0ryr----tylSntP|y|-J-rpA5tylSntP|y|;to9-|}npv\b-7-sy||\\}npv\b6H----tylSntP|y|-J-zv\x075}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs\f");var Ln=new d.WebGLCubeRenderTarget(1).texture;Ln.name="EMPTY_TEXTURE";var yc=Object.assign({modelAlpha:new d.Uniform(0),progress:new d.Uniform(0),pano0_map:new d.Uniform(Ln),pano0_luminanceMap:new d.Uniform(null),pano0_matrix:new d.Uniform(new d.Matrix4),pano1_map:new d.Uniform(Ln),pano1_luminanceMap:new d.Uniform(null),pano1_matrix:new d.Uniform(new d.Matrix4),clippers:new d.Uniform([]),shownFloorIndex:new d.Uniform(-1),constantColor:new d.Uniform(null),floor:new d.Uniform(0)},{exposure:new d.Uniform(1),emissive:new d.Uniform(new d.Color(0)),emissiveMap:new d.Uniform(null),specular:new d.Uniform(new d.Color(1118481)),specularMap:new d.Uniform(null),normalMap:new d.Uniform(null),bumpMap:new d.Uniform(null),shininess:new d.Uniform(30)},d.UniformsUtils.clone(d.UniformsLib.common),d.UniformsUtils.clone(d.UniformsLib.lights)),Vn=function(n){de(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,c,l,h,p,v,m,A,y,f,g,b,w,E,x,M=n.call(this,{vertexShader:mc,fragmentShader:gc,uniforms:d.UniformsUtils.clone(yc),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_FLOOR:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_PANO_VIDEO:!1,USE_POINT_NORMAL:!1,USE_POINT_CIRCLE:!1,USE_POINT_ADAPTIVE_SIZE:!1,USE_POINT_COLOR_ALTITUDE:!1},lights:!0})||this,C,I=null,P=null;return Object.defineProperties(M,{pano0:{get:function(){return I},set:function(S){if(I!==S){I=S,S===null?(this.uniforms.pano0_map.value=Ln,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity()):(this.uniforms.pano0_map.value=S.map instanceof Qe?S.map.texture:S.map,this.uniforms.pano0_luminanceMap.value=S.luminanceMap instanceof Qe?S.luminanceMap.texture:S.luminanceMap,this.uniforms.pano0_matrix.value.copy(S.matrix));var F=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,k=this.defines.USE_LUMINANCE;k!==F&&(this.defines.USE_LUMINANCE=F,this.needsUpdate=!0)}}},pano1:{get:function(){return P},set:function(S){if(P!==S){P=S,S===null?(this.uniforms.pano1_map.value=Ln,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity()):(this.uniforms.pano1_map.value=S.map instanceof Qe?S.map.texture:S.map,this.uniforms.pano1_luminanceMap.value=S.luminanceMap instanceof Qe?S.luminanceMap.texture:S.luminanceMap,this.uniforms.pano1_matrix.value.copy(S.matrix));var F=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,k=this.defines.USE_LUMINANCE;k!==F&&(this.defines.USE_LUMINANCE=F,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(S){this.uniforms.modelAlpha.value=S}},progress:{get:function(){return this.uniforms.progress.value},set:function(S){this.uniforms.progress.value=S}},useBlackTransition:{get:function(){return this.defines.USE_BLACK_TRANSITION},set:function(S){var F=this.defines.USE_BLACK_TRANSITION;F!==S&&(this.defines.USE_BLACK_TRANSITION=S,this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(S){this.uniforms.constantColor.value=S;var F=this.defines.USE_CONSTANT_COLOR,k=S!==null;F!==k&&(this.defines.USE_CONSTANT_COLOR=k,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(S){this.uniforms.opacity.value=S}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(S){this.uniforms.shownFloorIndex.value=S}},clippers:{get:function(){return C},set:function(S){C!==S&&(C=S,this.uniforms.clippers.value=(C||[]).map(function(F){var k=typeof F.floorIndex=="number"?F.floorIndex:-1,O=new d.Matrix4().getInverse(F.clippingBoxMatrix);return{matrixInverse:O,floorIndex:k}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(S){S!==this.defines.USE_EDL&&(this.defines.USE_EDL=S,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(S){S!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=S,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(S){S!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=S,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(S){this.uniforms.floor.value=S}}}),M.pano0=(r=e.pano0)!==null&&r!==void 0?r:be.pano0,M.pano1=(i=e.pano1)!==null&&i!==void 0?i:be.pano1,M.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:be.modelAlpha,M.progress=(o=e.progress)!==null&&o!==void 0?o:be.progress,M.useBlackTransition=(s=e.useBlackTransition)!==null&&s!==void 0?s:be.useBlackTransition,M.constantColor=(u=e.constantColor)!==null&&u!==void 0?u:be.constantColor,M.opacity=(c=e.opacity)!==null&&c!==void 0?c:be.opacity,M.shownFloorIndex=(l=e.shownFloorIndex)!==null&&l!==void 0?l:be.shownFloorIndex,M.clippers=(h=e.clippers)!==null&&h!==void 0?h:be.clippers,M.useEDL=(p=e.useEDL)!==null&&p!==void 0?p:be.useEDL,M.useHQWeight=(v=e.useHQWeight)!==null&&v!==void 0?v:be.useHQWeight,M.useHQDepth=(m=e.useHQDepth)!==null&&m!==void 0?m:be.useHQDepth,M.pointSize=(A=e.pointSize)!==null&&A!==void 0?A:be.pointSize,M.pointColor=(y=e.pointColor)!==null&&y!==void 0?y:be.pointColor,M.pointShape=(f=e.pointShape)!==null&&f!==void 0?f:be.pointShape,M.pointScale=(g=e.pointScale)!==null&&g!==void 0?g:be.pointScale,M.pointBack=(b=e.pointBack)!==null&&b!==void 0?b:be.pointBack,M.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:be.pointMinPixel,M.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:be.pointMaxPixel,M.gradientTexture=(x=e.gradientTexture)!==null&&x!==void 0?x:be.gradientTexture,M.floor=0,M}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=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,o),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,o)},t.prototype.update=function(e,r){this.transparent=this.shownFloorIndex>-1||this.opacity<1,this.blending=this.transparent?d.NormalBlending:d.NoBlending},t.prototype.syncModel=function(e){var r="".concat(e.id,":").concat(e.materialVersion);r!==this.syncModelVersion&&(Object.assign(this,e.getMaterial()),this.syncModelVersion=r)},t}(d.ShaderMaterial),_r=function(n){de(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.backgroundColor,o=a===void 0?1579548:a,s=e.backgroundAlpha,u=s===void 0?1:s,c=e.pixelRatio,l=c===void 0?1:c,h=e.antialias,p=h===void 0?!1:h,v=e.webgl2,m=v===void 0?!1:v,A=this,y=u<1;if(m){var f=document.createElement("canvas"),g=f.getContext("webgl2");g?A=n.call(this,{antialias:p,preserveDrawingBuffer:i,alpha:y,canvas:f,context:g})||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),A=n.call(this,{antialias:p,preserveDrawingBuffer:i,alpha:y})||this)}else A=n.call(this,{antialias:p,preserveDrawingBuffer:i,alpha:y})||this;return A.setPixelRatio(l),A.setClearColor(o,u),A.outputEncoding=d.sRGBEncoding,A.autoClear=!0,A}return t}(d.WebGLRenderer),cu=function(n){de(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 Rr(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 bc=1,wc=.1,Ec=1e3,Gn=Math.PI*2,Bo=Math.PI/2;function Ro(n){return n>0&&n<=Gn?n:(n%Gn+Gn)%Gn}function xc(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 hi=function(n){de(t,n);function t(e,r,i,a,o,s,u){r===void 0&&(r=bc),i===void 0&&(i=wc),a===void 0&&(a=Ec),o===void 0&&(o=new d.Vector2),s===void 0&&(s=512),u===void 0&&(u=1);var c=n.call(this)||this;c.fov=e,c.aspect=r,c.near=i,c.far=a,c.perspToOrtho=o,c.screenHeight=s,c.pixelRatio=u,c.needsRender=!0,c.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new d.Vector3},c.computePose(),c.perspectiveCamera=new d.PerspectiveCamera(c.fov,c.aspect,.001,c.far);var l=Math.max(c.orthoDistance,.01)*Math.tan(.5*c.fov/180*Math.PI),h=-.5*c.aspect*2*l;return c.orthographicCamera=new d.OrthographicCamera(h,-h,l,-l,.001,c.far),c.computeProjectionMatrix(),c.lastValues={position:c.position.clone(),quaternion:c.quaternion.clone(),scale:c.scale.clone(),fov:c.fov,aspect:c.aspect,near:c.near,far:c.far,perspToOrtho:c.perspToOrtho.clone()},c.type=c.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",c}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 Rr(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0);var r=this.getDirection(new d.Vector3);this.pose.longitude=Ro(-Math.atan2(r.x,-r.z)),this.pose.latitude=-Math.asin(r.y/1),this.pose.fov=this.fov,this.pose.distance=e;var i=new d.Vector3().add(this.position).add(r.clone().setLength(this.pose.distance));return this.pose.offset.copy(i),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,u=Ro((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),c=Math.max(-Bo+1e-4,Math.min(Bo-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),l=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,h=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,p=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,v=Rr({longitude:u,latitude:c}).normalize();return this.position.set(0,0,0),this.lookAt(v),this.position.add(p).sub(v.clone().setLength(h)),this.fov!==l&&(this.fov=l,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=u,this.pose.latitude=c,this.pose.fov=l,this.pose.distance=h,this.pose.offset.copy(p),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(){xc(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){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.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.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.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(ve(),0),this},t}(d.Camera),bt;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(bt||(bt={}));var du=1e-6,Ne=new d.Vector3,Br=new d.Matrix4,Mr=new d.Vector3,Cr=new d.Vector3,Ir=new d.Vector3,ya=new d.Vector3,Fo=new d.Box3,Oo=new d.Sphere,ko=new d.Matrix4,Lo=new d.Ray,gt=new d.Object3D,Do=new d.Frustum;function fu(n,t){var e=n.elements;return t.setFromRotationMatrix(Br.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 Pn=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 Br.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Do.setFromProjectionMatrix(Br),this.setFromFrustum(Do),this},n.prototype.computeVisibility=function(t){for(var e=bt.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case bt.Outside:return bt.Outside;case bt.Intersecting:e=bt.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],u=t.intersectPlane(s);if(u===bt.Outside)return n.MASK_OUTSIDE;u===bt.Intersecting&&(r|=o)}}return r},n}(),hu=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],u=e[8],c=e[9],l=e[10],h=e[11],p=Math.sqrt(r*r+i*i+a*a),v=Math.sqrt(o*o+s*s+u*u),m=Math.sqrt(c*c+l*l+h*h);this.halfSize.set(p,v,m);var A=this.halfSize.toArray().reduce(function(y,f){return y+f},0);return(isNaN(A)||A<=0)&&this.halfSize.setScalar(du),this.rotation.fromArray([r/p,i/p,a/p,o/v,s/v,u/v,c/m,l/m,h/m]),isNaN(this.rotation.toArray().reduce(function(y,f){return y+f},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(Mr,Cr,Ir),{box:at(at(at(at([],this.center.toArray(),!0),Mr.multiplyScalar(this.halfSize.x).toArray(),!0),Cr.multiplyScalar(this.halfSize.y).toArray(),!0),Ir.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 gt.position.copy(this.center),fu(this.rotation,gt.quaternion),gt.scale.copy(this.halfSize),gt.matrix.compose(gt.position,gt.quaternion,gt.scale),gt.matrix.premultiply(t),gt.matrix.decompose(gt.position,gt.quaternion,gt.scale),this.center.copy(gt.position),this.rotation.setFromMatrix4(Br.makeRotationFromQuaternion(gt.quaternion)),this.halfSize.copy(gt.scale),this},n.prototype.getCenter=function(t){return t.copy(this.center)},n.prototype.distanceSquaredTo=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.distanceTo=function(t){return Math.sqrt(this.distanceSquaredTo(t))},n.prototype.getBoundingBox=function(t){return t.makeEmpty(),this.rotation.extractBasis(Mr,Cr,Ir),Mr.setLength(this.halfSize.x),Cr.setLength(this.halfSize.y),Ir.setLength(this.halfSize.z),t.expandByPoint(Ne.copy(this.center).add(Mr)),t.expandByPoint(Ne.copy(this.center).sub(Mr)),t.expandByPoint(Ne.copy(this.center).add(Cr)),t.expandByPoint(Ne.copy(this.center).sub(Cr)),t.expandByPoint(Ne.copy(this.center).add(Ir)),t.expandByPoint(Ne.copy(this.center).sub(Ir)),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);Ne.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),Ne.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),Ne.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),Ne.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),Ne.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),Ne.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),Ne.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),Ne.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,u=r.z,c=Math.abs(o*i[0]*a.x+s*i[1]*a.x+u*i[2]*a.x)+Math.abs(o*i[3]*a.y+s*i[4]*a.y+u*i[5]*a.y)+Math.abs(o*i[6]*a.z+s*i[7]*a.z+u*i[8]*a.z),l=r.dot(e)+t.constant;return l<=-c?bt.Outside:l>=c?bt.Inside:bt.Intersecting},n.prototype.intersectRay=function(t,e){ya.copy(this.halfSize).multiplyScalar(2),Fo.setFromCenterAndSize(Ne.set(0,0,0),ya),this.rotation.extractBasis(Mr,Cr,Ir),Br.makeBasis(Mr,Cr,Ir),Br.setPosition(this.center),ko.getInverse(Br),Lo.copy(t).applyMatrix4(ko);var r=Lo.intersectBox(Fo,Ne);return r?e!==void 0?r.applyMatrix4(Br).distanceTo(t.origin)<e:!0:!1},n}(),pu=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],du),this},n.prototype.toJson=function(){return{sphere:at(at([],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,ya.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.distanceSquaredTo=function(t){var e=this.distanceTo(t);return e*e},n.prototype.distanceTo=function(t){var e=this.center.distanceTo(t)-this.radius;return e<=0?0:e},n.prototype.intersectPlane=function(t){var e=this.center,r=this.radius,i=t.normal,a=i.dot(e)+t.constant;return a<-r?bt.Outside:a<r?bt.Intersecting:bt.Inside},n.prototype.intersectRay=function(t,e){Oo.set(this.center,this.radius);var r=t.intersectSphere(Oo,Ne);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),Mc=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.distanceTo=function(t){throw new Error("not implemented")},n.prototype.distanceSquaredTo=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 Bn(n){if("box"in n)return new hu().fromJson(n);if("sphere"in n)return new pu().fromJson(n);if("region"in n)return new Mc().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var Kn=[2621517,3801199,4915345,5963950,7274706,8782079,9575167,10434047,11623423,12482559,13274879,13870335,14464511,15125247,15852031,16446719].map(function(n){return new d.LineBasicMaterial({color:n,depthWrite:!1,transparent:!0})}),Cc=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);Ne.set(1,1,1).toArray(t,0),Ne.set(-1,1,1).toArray(t,3),Ne.set(-1,-1,1).toArray(t,6),Ne.set(1,-1,1).toArray(t,9),Ne.set(1,1,-1).toArray(t,12),Ne.set(-1,1,-1).toArray(t,15),Ne.set(-1,-1,-1).toArray(t,18),Ne.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}(),Ic=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 Sc(n,t){if(n instanceof hu){var e=new d.LineSegments(Cc,Kn[Math.min(t,Kn.length-1)]);return e.position.copy(n.center),fu(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 pu){var e=new d.LineSegments(Ic,Kn[Math.min(t,Kn.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 _a=function(){function n(t,e,r,i){var a=this,o,s,u;this.parent=null,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,selectionDepth:0,shouldRefine:!1,distanceToCamera:0,screenSpaceError:0,visibilityPlaneMask:0,inRequestVolume:!1},this.parent=i??null,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=(u=(s=this.parent)===null||s===void 0?void 0:s.geometricError)!==null&&u!==void 0?u:0,e.content&&e.content.uri?(this.content={uri:e.content.uri,loadState:"UNLOADED",byteLength:0},e.content.group!==void 0&&(this.content.group=e.content.group),e.content.boundingVolume&&(this.content.boundingVolume=Bn(e.content.boundingVolume).applyMatrix4(this.transform)),/\.json$/.test(this.content.uri)?this.type="TILESET":this.type="SCENEGRAPH"):(this.content=null,this.type="EMPTY"),e.boundingVolume&&(this.boundingVolume=Bn(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=Bn(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=e.extras||{},e.children?this.children=e.children.map(function(c,l){return new n("".concat(a.id,".").concat(l),c,r,a)}):this.children=[]}return 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;this.state.distanceToCamera=r.distanceTo(t.camera.position);var i=this.parent?this.parent.state.visibilityPlaneMask:Pn.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,i),this.state.visible=this.state.visibilityPlaneMask!==Pn.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.visibilityPlaneMask=Pn.MASK_INDETERMINATE,this.state.visible=!0;if(this.viewerRequestVolume){var a=e?this.viewerRequestVolume.clone().applyMatrix4(e):this.viewerRequestVolume;this.state.inRequestVolume=a.distanceSquaredTo(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==="MESH"||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.loadContent=function(){var t=this,e;if(this.hasEmptyContent||!(!((e=this.content)===null||e===void 0)&&e.uri))return Promise.resolve(!1);var r=this.content;return r.data?Promise.resolve(!0):(r.loadState="LOADING",this.tileset.requestScheduler.scheduleRequest(this.id,function(){return t.getPriority()}).then(function(i){return i?t.tileset.options.contentLoader(t).then(function(a){return i.done(),r.loadState=a?"READY":"UNLOADED",a}).catch(function(a){return r.loadState="FAILED",i.done(),Promise.reject(a)}):(r.loadState="UNLOADED",Promise.resolve(!1))}))},n.prototype.unloadContent=function(){return this.content&&(this.content.loadState="UNLOADED",this.content.byteLength=0),!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),u=o*t.height/(s*t.sseDenominator);return u},n.prototype.getPriority=function(){var t=this.refine==="ADD"||this.tileset.skipLevelOfDetail;if(t&&!this.state.visible||this.tileset.frameNumber-this.state.touchedFrameNumber>=1||this.content.loadState==="UNLOADED")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}(),ba=function(){function n(){this.maxRequests=n.DEFAULT_MAX_REQUESTS,this.activeRequests=0,this.requestQueue=[],this.requestMap=new Map,this.deferred=null}return n.prototype.scheduleRequest=function(t,e){var r=this.requestMap.get(t);if(r)return r;var i={identiy:t,priority:0,getPriority:e,resolve:function(){}},a=new Promise(function(o){return i.resolve=o});return this.requestQueue.push(i),this.requestMap.set(t,a),this.issueNewRequests(),a},n.prototype.reset=function(){for(var t=0,e=this.requestQueue;t<e.length;t++){var r=e[t];r.resolve(null)}this.requestQueue.length=0,this.requestMap.clear(),this.activeRequests=0},n.prototype.issueRequest=function(t){var e=this,r=t.identiy,i=t.resolve,a=!1,o=function(){a||(a=!0,e.requestMap.delete(r),e.activeRequests--,e.issueNewRequests())};this.activeRequests++,i({done:o})},n.prototype.issueNewRequests=function(){var t=this;this.deferred||(this.deferred=setTimeout(function(){return t.issueNewRequestsAsync()},0))},n.prototype.issueNewRequestsAsync=function(){this.deferred=null;var t=Math.max(this.maxRequests-this.activeRequests,0);if(t!==0){this.updateAllRequests();for(var e=0;e<t;e++){var r=this.requestQueue.shift();if(r)this.issueRequest(r);else break}}},n.prototype.updateAllRequests=function(){for(var t=this.requestQueue,e=0;e<t.length;e++){var r=t[e];this.updateRequest(r)===!1&&(t.splice(e,1),this.requestMap.delete(r.identiy),e--)}t.sort(function(i,a){return i.priority-a.priority})},n.prototype.updateRequest=function(t){return t.priority=t.getPriority(t.identiy),t.priority<0?(t.resolve(null),!1):!0},n.DEFAULT_MAX_REQUESTS=6,n}(),Tc=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Pc=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 Tc(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}(),vu=function(){function n(){this.cacheNodeMap=new Map,this.list=new Pc,this.sentinel=this.list.add("sentinel")}return n.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},n.prototype.touch=function(t){var e=this.cacheNodeMap.get(t);e&&this.list.splice(this.sentinel,e)},n.prototype.add=function(t,e){if(!this.cacheNodeMap.has(t)){var r=this.list.add(t);this.cacheNodeMap.set(t,r),e&&e(t)}},n.prototype.unloadTile=function(t,e){var r=this.cacheNodeMap.get(t);r&&(this.list.remove(r),this.cacheNodeMap.delete(t),e&&e(t))},n.prototype.unloadTiles=function(t,e){for(var r=this.list.head;r!==this.sentinel&&t();){var i=r.item;r=r.next,this.unloadTile(i,e)}},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}(),No=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),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}(),wa=function(){function n(){this.loadSiblings=n.DEFAULT_LOAD_SIBLINGS,this.skipLevelOfDetail=n.DEFAULT_SKIP_LEVEL_OF_DETAIL,this.maxScreenSpaceError=n.DEFAULT_MAX_SCREEN_SPACE_ERROR,this._canSelectTile=!0,this._traversalStack=new No,this._emptyTraversalStack=new No,this.root=null,this.selectedTiles=new Map,this.requestedTiles=new Map,this.needsRefinedTiles=new Map,this.emptyTiles=new Map}return n.prototype.traverse=function(t,e,r){r===void 0&&(r=[]),this.root=t,this.reset();for(var i=0,a=r;i<a.length;i++){var o=a[i];this._traversalStack.reset(),this._emptyTraversalStack.reset(),this._canSelectTile=o.camera.visible,this.updateTile(t,o),this.executeTraversal(t,o)}this._traversalStack.reset(),this._emptyTraversalStack.reset(),this._canSelectTile=!0,this.updateTile(t,e),this.executeTraversal(t,e)},n.prototype.reset=function(){this.needsRefinedTiles.clear(),this.requestedTiles.clear(),this.selectedTiles.clear(),this.emptyTiles.clear(),this._traversalStack.reset(),this._emptyTraversalStack.reset()},n.prototype.executeTraversal=function(t,e){var r=this._traversalStack;if(t.state.selectionDepth=0,e.maxLevelOfDetail>=0)for(t.state.visible&&t.state.inRequestVolume&&r.push(t);r.length>0;){var i=r.pop(),a=!1;if(this.canTraverse(i,e,!1,!1)){var o=i.hasRenderContent?i.state.selectionDepth+1:i.state.selectionDepth;this.updateChildTiles(i,e,o),a=this.updateAndPushChildren(i,e,r)}var s=i.parent,u=!s||s.state.shouldRefine,c=!a;i.hasRenderContent?i.refine==="ADD"?(this.loadTile(i,e.frameNumber),this.selectTile(i,e)):i.refine==="REPLACE"&&(this.loadTile(i,e.frameNumber),c&&this.selectTile(i,e)):(this.emptyTiles.set(i.id,i),this.loadTile(i,e.frameNumber),c&&this.selectTile(i,e)),this.touchTile(i,e),i.state.shouldRefine=a&&u}},n.prototype.updateChildTiles=function(t,e,r){for(var i=t.children,a=0,o=i;a<o.length;a++){var s=o[a];s.state.selectionDepth=r,this.updateTile(s,e)}return!0},n.prototype.updateAndPushChildren=function(t,e,r){for(var i=t.children,a=t.refine==="REPLACE"&&t.hasRenderContent&&!this.skipLevelOfDetail,o=!1,s=!0,u=0,c=i;u<c.length;u++){var l=c[u];if(l.state.visible&&l.state.inRequestVolume?(r.find(l)&&r.delete(l),r.push(l),o=!0):(a||this.loadSiblings)&&(this.loadTile(l,e.frameNumber),this.touchTile(l,e)),a){var h=void 0;l.state.inRequestVolume?l.hasRenderContent?h=l.contentAvailable:h=this.executeEmptyTraversal(l,e):h=!1,s=s&&h}}return o||(s=!1),s},n.prototype.updateTile=function(t,e){this.updateTileVisibility(t,e)},n.prototype.selectTile=function(t,e){this.shouldSelectTile(t)&&(t.state.selectedFrameNumber=e.frameNumber,this.selectedTiles.set(t.id,t)),this.needsRefinedTiles.set(t.id,t)},n.prototype.loadTile=function(t,e){this.shouldLoadTile(t)&&(t.state.requestedFrameNumber=e,this.requestedTiles.set(t.id,t)),this.needsRefinedTiles.set(t.id,t)},n.prototype.touchTile=function(t,e){t.tileset.cache.touch(t),t.state.touchedFrameNumber=e.frameNumber},n.prototype.canTraverse=function(t,e,r,i){return t.hasChildren?t.hasTilesetContent?!0:!i&&!t.state.visible?!1:this.shouldRefine(t,e,r):!1},n.prototype.shouldLoadTile=function(t){return t.hasUnloadedContent},n.prototype.shouldSelectTile=function(t){return t.contentAvailable&&!this.skipLevelOfDetail&&this._canSelectTile},n.prototype.shouldRefine=function(t,e,r){if(t.hasEmptyContent)return!0;if(t.hasRenderContent){if(t.state.selectionDepth>=e.maxLevelOfDetail)return!1;if(t.state.selectionDepth<e.minLevelOfDetail)return!0}var i=t.state.screenSpaceError;return r&&(i=t.getScreenSpaceError(e,t.state.distanceToCamera,!0)),i>this.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}}},n.prototype.meetsScreenSpaceErrorEarly=function(t,e){var r=t.parent;return!r||r.refine!=="ADD"?!1:!this.shouldRefine(t,e,!0)},n.prototype.compareDistanceToCamera=function(t,e){return e.state.distanceToCamera-t.state.distanceToCamera},n.prototype.executeEmptyTraversal=function(t,e){var r=!0,i=this._emptyTraversalStack;for(i.push(t);i.length>0&&r;){var a=i.pop();this.updateTile(a,e),a.state.visible||this.loadTile(a,e.frameNumber),this.touchTile(a,e);var o=!a.hasRenderContent&&this.canTraverse(a,e,!1,!0);if(o)for(var s=a.children,u=0,c=s;u<c.length;u++){var l=c[u];i.find(l)&&i.delete(l),i.push(l)}else a.contentAvailable||(r=!1)}return r},n.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,n.DEFAULT_LOAD_SIBLINGS=!1,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=4,n}(),Bc=new d.Matrix4,ii=function(){function n(t,e,r){var i,a;this.id=t,this.transform=new d.Matrix4,this.transformIsIdentity=!0,this.asset={version:e.asset.version,tilesetVersion:e.asset.tilesetVersion||"",gltfUpAxis:(i=e.asset.gltfUpAxis)!==null&&i!==void 0?i:"Y",overview:e.asset.overview},this.properties=(a=e.properties)!==null&&a!==void 0?a:{},this.options=r,this.traverser=new wa,this.cache=new vu,this.requestScheduler=new ba,this.frameNumber=0,this.pendingCount=0,this.tiles=new Map,this.memoryUsageInBytes=0,this.root=new _a("".concat(this.id,".0"),e.root,this),this.geometricError=e.geometricError,this.maxMemoryUsage=n.DEFAULT_MAX_MEMORY_USAGE}return Object.defineProperty(n.prototype,"maxRequests",{get:function(){return this.requestScheduler.maxRequests},set:function(t){this.requestScheduler.maxRequests=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"skipLevelOfDetail",{get:function(){return this.traverser.skipLevelOfDetail},set:function(t){this.traverser.skipLevelOfDetail=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"maxScreenSpaceError",{get:function(){return this.traverser.maxScreenSpaceError},set:function(t){this.traverser.maxScreenSpaceError=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectedTiles",{get:function(){return this.traverser.selectedTiles},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"needsRefinedTiles",{get:function(){return this.traverser.needsRefinedTiles},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,function(o){return t.unloadTile(o)})}this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.tiles.clear()},n.prototype.isLoaded=function(){return this.pendingCount===0&&this.frameNumber!==0},n.prototype.traverse=function(t,e){var r=this;e===void 0&&(e=[]),this.transformIsIdentity=this.transform.equals(Bc),this.traverser.traverse(this.root,t,e),this.selectedTiles.forEach(function(i){r.tiles.set(i.id,i)}),this.traverser.requestedTiles.forEach(function(i){i.hasUnloadedContent&&r.loadTile(i)}),this.cache.unloadTiles(function(){var i=r.memoryUsageInBytes>r.maxMemoryUsage*1024*1024;return i},function(i){r.unloadTile(i),r.tiles.delete(i.id)})},n.prototype.loadTile=function(t){var e=this;this.pendingCount++,t.loadContent().catch(function(r){return e.options.onTileError(t,r),!1}).then(function(r){var i;e.pendingCount--,r&&(!((i=t.content)===null||i===void 0)&&i.data&&e.cache.add(t,function(){e.memoryUsageInBytes+=t.contentByteLength}),e.options.onTileLoad(t))})},n.prototype.unloadTile=function(t){this.memoryUsageInBytes-=t.contentByteLength,this.options.onTileUnload(t),t.unloadContent()},n.DEFAULT_VIEW_DISTANCE_SCALE=1,n.DEFAULT_MAX_MEMORY_USAGE=16,n.DEFAULT_MAX_SCREEN_SPACE_ERROR=wa.DEFAULT_MAX_SCREEN_SPACE_ERROR,n.DEFAULT_MAX_REQUESTS=ba.DEFAULT_MAX_REQUESTS,n}(),cn=function(){function n(t,e,r,i){this.extents=t,this.startIndex=e,this.endIndex=r,this.deepth=i}return n}();function Au(n,t,e,r){r===void 0&&(r=0);var i=e.extents[0]-r,a=e.extents[1]-r,o=e.extents[2]-r,s=e.extents[3]+r,u=e.extents[4]+r,c=e.extents[5]+r,l={min:0,max:0};t.x>=0?(l.min=(i-n.x)*t.x,l.max=(s-n.x)*t.x):(l.min=(s-n.x)*t.x,l.max=(i-n.x)*t.x);var h={min:0,max:0};if(t.y>=0?(h.min=(a-n.y)*t.y,h.max=(u-n.y)*t.y):(h.min=(u-n.y)*t.y,h.max=(a-n.y)*t.y),l.min>h.max||h.min>l.max)return!1;h.min>l.min&&(l.min=h.min),h.max<l.max&&(l.max=h.max);var p={min:0,max:0};return t.z>=0?(p.min=(o-n.z)*t.z,p.max=(c-n.z)*t.z):(p.min=(c-n.z)*t.z,p.max=(o-n.z)*t.z),!(l.min>p.max||p.min>l.max||(p.min>l.min&&(l.min=p.min),p.max<l.max&&(l.max=p.max),l.max<0))}var mu=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,u=e.z;return this.x=i*u-a*s,this.y=a*o-r*u,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}(),gu=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),Qo=1e-6,Rc=function(){function n(t,e){if(this.positionArray=t,e)this.indicesArray=e;else{for(var r=t.length/3,i=new Uint32Array(r),a=0;a<r;a++)i[a]=a;this.indicesArray=i}}return n.prototype.createTree=function(t,e,r){var i=this.positionArray,a=this.indicesArray,o=a.length/3,s=new Uint32Array(o),u=new Float32Array(o*6),c=[],l=0;if(r)for(var h=0,p=0,v=0,m=void 0,A=void 0,y=void 0,f=void 0,g=void 0,b=void 0,w=void 0;h<o;h+=1,p+=3,v+=6)s[h]=h,m=f=i[a[p]*3],w=i[a[p+1]*3],w<m&&(m=w),w>f&&(f=w),w=i[a[p+2]*3],w<m&&(m=w),w>f&&(f=w),A=g=i[a[p]*3+1],w=i[a[p+1]*3+1],w<A&&(A=w),w>g&&(g=w),w=i[a[p+2]*3+1],w<A&&(A=w),w>g&&(g=w),y=b=i[a[p]*3+2],w=i[a[p+1]*3+2],w<y&&(y=w),w>b&&(b=w),w=i[a[p+2]*3+2],w<y&&(y=w),w>b&&(b=w),u[v]=m,u[v+1]=A,u[v+2]=y,u[v+3]=f,u[v+4]=g,u[v+5]=b;else{for(var E=1/0,x=1/0,M=1/0,C=-1/0,I=-1/0,P=-1/0,h=0,p=0,v=0,m=void 0,A=void 0,y=void 0,f=void 0,g=void 0,b=void 0,w=void 0;h<o;h+=1,p+=3,v+=6)s[h]=h,m=f=i[a[p]*3],w=i[a[p+1]*3],w<m&&(m=w),w>f&&(f=w),w=i[a[p+2]*3],w<m&&(m=w),w>f&&(f=w),A=g=i[a[p]*3+1],w=i[a[p+1]*3+1],w<A&&(A=w),w>g&&(g=w),w=i[a[p+2]*3+1],w<A&&(A=w),w>g&&(g=w),y=b=i[a[p]*3+2],w=i[a[p+1]*3+2],w<y&&(y=w),w>b&&(b=w),w=i[a[p+2]*3+2],w<y&&(y=w),w>b&&(b=w),u[v]=m,u[v+1]=A,u[v+2]=y,u[v+3]=f,u[v+4]=g,u[v+5]=b,m<E&&(E=m),f>C&&(C=f),A<x&&(x=A),g>I&&(I=g),y<M&&(M=y),b>P&&(P=b);r=[E,x,M,C,I,P]}var S=new cn(r,0,o,0);c[l++]=S;function F(k){for(var O=k.startIndex,L=k.endIndex,N=k.extents,V=[N[3]-N[0],N[4]-N[1],N[5]-N[2]],j=[0,1,2].sort(function($,te){return V[te]-V[$]}),z=0;z<3;z++){for(var U=j[z],X=N[U]+N[U+3],G=O,K=L-1,Y=-1,H=void 0;G<=K;)Y===-1?(H=s[G],u[H*6+U]+u[H*6+U+3]<X?G++:Y=H):(H=s[K],u[H*6+U]+u[H*6+U+3]>=X||(s[G]=H,s[K]=Y,Y=-1,G++),K--);if(G>O&&G<L){var J=new cn(Vo(s,u,O,G,Qo),O,G,k.deepth+1);J.deepth<e&&J.endIndex-J.startIndex>t&&(c[l++]=J);var ne=new cn(Vo(s,u,G,L,Qo),G,L,k.deepth+1);ne.deepth<e&&ne.endIndex-ne.startIndex>t&&(c[l++]=ne),k.node0=J,k.node1=ne,k.startIndex=0,k.endIndex=0;break}}}for(;l;)F(c[--l]);return this.offsetArray=s,this.rootNode=S,c.length=0,this},n.prototype.trianglesInSphere=function(t,e){for(var r=this.positionArray,i=this.indicesArray,a=this.offsetArray,o=this.rootNode,s=[o],u=[],c;c=s.pop();){var l=Hi(t.x,c.extents[0],c.extents[3])-t.x,h=Hi(t.y,c.extents[1],c.extents[4])-t.y,p=Hi(t.z,c.extents[2],c.extents[5])-t.z;if(l*l+h*h+p*p<=e*e){c.node0&&s.push(c.node0),c.node1&&s.push(c.node1);for(var v=c.startIndex;v<c.endIndex;v++)u.push(a[v])}}for(var m=u.length,A=new Float32Array(m*9),v=0;v<m;v++){var y=u[v];A[v*9]=r[i[y]*3],A[v*9+1]=r[i[y]*3+1],A[v*9+2]=r[i[y]*3+2],A[v*9+3]=r[i[y+1]*3],A[v*9+4]=r[i[y+1]*3+1],A[v*9+5]=r[i[y+1]*3+2],A[v*9+6]=r[i[y+2]*3],A[v*9+7]=r[i[y+2]*3+1],A[v*9+8]=r[i[y+2]*3+2]}return A},n.prototype.intersectRay=function(t,e,r){for(var i=this.positionArray,a=this.indicesArray,o=this.offsetArray,s=this.rootNode,u=new mu(1/e.x,1/e.y,1/e.z),c=[s],l;l=c.pop();)if(Au(t,u,l)){for(var h=l.startIndex,p=l.endIndex,v=void 0,m=void 0,A=void 0,y=t.x,f=t.y,g=t.z,b=e.x,w=e.y,E=e.z,x=void 0,M=void 0,C=void 0,I=void 0,P=void 0,S=void 0,F=void 0,k=void 0,O=void 0,L=void 0,N=void 0,V=void 0,j=void 0,z=void 0,U=void 0,X=void 0,G=void 0,K=void 0,Y=void 0,H=void 0,J=void 0,ne=void 0,$=void 0,te=void 0,ae=void 0,ce=void 0,oe=void 0;h<p;h++){if(v=o[h],m=v*3,A=a[m]*3,x=i[A],M=i[++A],C=i[++A],A=a[m+1]*3,I=i[A],P=i[++A],S=i[++A],A=a[m+2]*3,F=i[A],k=i[++A],O=i[++A],L=I-x,N=P-M,V=S-C,j=F-x,z=k-M,U=O-C,X=N*U-V*z,G=V*j-L*U,K=L*z-N*j,$=b*X+w*G+E*K,$>0)ne=1;else if($<0)ne=-1,$=-$;else continue;Y=y-x,H=f-M,J=g-C,te=ne*(b*(H*U-J*z)+w*(J*j-Y*U)+E*(Y*z-H*j)),!(te<0)&&(ae=ne*(b*(N*J-V*H)+w*(V*Y-L*J)+E*(L*H-N*Y)),!(ae<0)&&(te+ae>$||(ce=-ne*(Y*X+H*G+J*K),!(ce<0)&&(oe=ce/$,r.push(new gu([x,M,C,I,P,S,F,k,O],[y+b*oe,f+w*oe,g+E*oe],v))))))}l.node0&&c.push(l.node0),l.node1&&c.push(l.node1)}return r},n}();function Hi(n,t,e){return n<t?t:n>e?e:n}function Vo(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,u=-1/0,c=-1/0,l=-1/0,h=e,p=void 0,v=void 0;h<r;h++)p=n[h]*6,v=t[p],v<a&&(a=v),v=t[p+1],v<o&&(o=v),v=t[p+2],v<s&&(s=v),v=t[p+3],v>u&&(u=v),v=t[p+4],v>c&&(c=v),v=t[p+5],v>l&&(l=v);return[a-i,o-i,s-i,u+i,c+i,l+i]}var Uo=1e-6,Fc=function(){function n(t,e){if(this.positionArray=t,e)this.indicesArray=e;else{for(var r=t.length/3,i=new Uint32Array(r),a=0;a<r;a++)i[a]=a;this.indicesArray=i}}return n.prototype.createTree=function(t,e,r){var i=this.positionArray,a=this.indicesArray,o=a.length,s=new Uint32Array(o),u=[],c=0;if(r)for(var l=0;l<o;l+=1)s[l]=l;else{for(var h=a[0]*3,p=i[h],v=i[h+1],m=i[h+2],A=p,y=v,f=m,l=0,g=0,b=void 0,w=void 0,E=void 0;l<o;l+=1,g+=3)s[l]=l,h=a[g]*3,b=i[h],w=i[h+1],E=i[h+2],b<p?p=b:b>A&&(A=b),w<v?v=w:w>y&&(y=w),E<m?m=E:E>f&&(f=E);r=[p,v,m,A,y,f]}var x=new cn(r,0,o,0);u[c++]=x;function M(C){for(var I=C.startIndex,P=C.endIndex,S=C.extents,F=[S[3]-S[0],S[4]-S[1],S[5]-S[2]],k=[0,1,2].sort(function(K,Y){return F[Y]-F[K]})[0],O=(S[k]+S[k+3])/2,L=I,N=P-1,V=-1,j;L<=N;)V===-1?(j=s[L],i[a[j]*3+k]<O?L++:V=j):(j=s[N],i[a[j]*3+k]>=O||(s[L]=j,s[N]=V,V=-1,L++),N--);if(L>I){var z=S.slice();z[k+3]=O+Uo;var U=new cn(z,I,L,C.deepth+1);U.deepth<e&&U.endIndex-U.startIndex>t&&(u[c++]=U),C.node0=U}if(P>L){var X=S.slice();X[k]=O-Uo;var G=new cn(X,L,P,C.deepth+1);G.deepth<e&&G.endIndex-G.startIndex>t&&(u[c++]=G),C.node1=G}C.startIndex=0,C.endIndex=0}for(;c;)M(u[--c]);return this.offsetArray=s,this.rootNode=x,u.length=0,this},n.prototype.intersectRay=function(t,e,r,i){for(var a=this.positionArray,o=this.indicesArray,s=this.offsetArray,u=this.rootNode,c=r*r,l=new mu(1/e.x,1/e.y,1/e.z),h=[u],p;p=h.pop();)if(Au(t,l,p,r)){for(var v=p.startIndex,m=p.endIndex,A=void 0,y=void 0,f=void 0,g=void 0,b=void 0,w=void 0,E=void 0,x=void 0,M=void 0,C=void 0,I=void 0,P=void 0,S=void 0;v<m;v++)A=s[v],y=o[A]*3,f=a[y],g=a[++y],b=a[++y],w=t.x,E=t.y,x=t.z,M=e.x,C=e.y,I=e.z,P=M*(f-w)+C*(g-E)+I*(b-x),P>0&&(w+=M*P,E+=C*P,x+=I*P),M=f-w,C=g-E,I=b-x,P=M*M+C*C+I*I,P<=c&&i.push(new gu([f,g,b,f,g,b,f,g,b],[w,E,x],A));p.node0&&h.push(p.node0),p.node1&&h.push(p.node1)}return i},n}(),ai=new Map,ji=new Map,dn=new d.Ray,qo=new d.Matrix3,Rn=new d.Matrix4,yu=new d.Vector3,Oc=new d.Vector3,kc=new d.Vector3,Lc=new d.Triangle;function Dc(n,t,e,r){var i,a=n.matrixWorld;Rn.getInverse(a),dn.copy(e.ray).applyMatrix4(Rn);for(var o=t.intersectRay(dn.origin,dn.direction,[]),s=n.geometry,u=n.material,c=s.groups,l=s.index,h=0,p=o.length;h<p;h++){var v=o[h],m=v.triangle,A=v.index,y=v.intersectionPoint,f=new d.Vector3(y[0],y[1],y[2]).applyMatrix4(a),g=e.ray.origin.distanceTo(f);if(!(g<e.near||g>e.far)){var b=void 0;if(Array.isArray(u)){if(c)for(var w=A*3,E=0,x=c;E<x.length;E++){var M=x[E];if(w>=M.start&&w-M.start<M.count){b=u[(i=M.materialIndex)!==null&&i!==void 0?i:0];break}}}else b=u;if(b){var C=Lc.set(yu.set(m[0],m[1],m[2]).applyMatrix4(a),Oc.set(m[3],m[4],m[5]).applyMatrix4(a),kc.set(m[6],m[7],m[8]).applyMatrix4(a)).getNormal(new d.Vector3),I=A*3,P=new d.Face3(l?l.array[I]:I,l?l.array[I+1]:I+1,l?l.array[I+2]:I+2,C),S=e.ray.direction.dot(C);b.side===d.FrontSide&&S>=0||b.side===d.BackSide&&S<=0||r.push({distance:g,object:n,face:P,point:f,distanceToRay:0,faceIndex:A})}}}}function Nc(n,t,e,r){var i,a,o=n.matrixWorld;qo.getNormalMatrix(o),Rn.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*Rn.getMaxScaleOnAxis();dn.copy(e.ray).applyMatrix4(Rn);for(var u=t.intersectRay(dn.origin,dn.direction,s,[]),c=n.geometry,l=c.index,h=c.getAttribute("normal"),p=0,v=u.length;p<v;p++){var m=u[p],A=m.triangle,y=m.index,f=m.intersectionPoint,g=new d.Vector3(f[0],f[1],f[2]).applyMatrix4(o),b=e.ray.origin.distanceTo(g);if(!(b<e.near||b>e.far)){var w=yu.set(A[0],A[1],A[2]).applyMatrix4(o),E=l?l.array[y]:y,x=void 0;h instanceof d.BufferAttribute&&(x=new d.Vector3().fromBufferAttribute(h,E).applyNormalMatrix(qo));var M=new d.Face3(E,E,E,x);r.push({distance:b,object:n,face:M,point:g,distanceToRay:g.distanceTo(w),index:y})}}}function Qc(n,t,e){var r;if(t===void 0&&(t=100),e===void 0&&(e=10),n.geometry instanceof d.BufferGeometry){var i=n.geometry.getAttribute("position");if(i instanceof d.BufferAttribute){var a=n.raycast,o=function(p,v){var m=ai.get(this);m?Dc(this,m,p,v):a.call(this,p,v)};n.raycast=o;var s=i.array,u=(r=n.geometry.getIndex())===null||r===void 0?void 0:r.array,c=n.geometry.boundingBox,l=c?[c.min.x,c.min.y,c.min.z,c.max.x,c.max.y,c.max.z]:void 0,h=new Rc(s,u);return h.createTree(t,e,l),ai.set(n,h),function(){ai.delete(n),n.raycast===o&&(n.raycast=a)}}}return function(){}}function Vc(n,t,e){var r;if(t===void 0&&(t=100),e===void 0&&(e=10),n.geometry instanceof d.BufferGeometry){var i=n.geometry.getAttribute("position");if(i instanceof d.BufferAttribute){var a=n.raycast,o=function(p,v){var m=ji.get(this);m?Nc(this,m,p,v):a.call(this,p,v)};n.raycast=o;var s=i.array,u=(r=n.geometry.getIndex())===null||r===void 0?void 0:r.array,c=n.geometry.boundingBox,l=c?[c.min.x,c.min.y,c.min.z,c.max.x,c.max.y,c.max.z]:void 0,h=new Fc(s,u);return h.createTree(t,e,l),ji.set(n,h),function(){ji.delete(n),n.raycast===o&&(n.raycast=a)}}}return function(){}}function Uc(n,t,e){t===void 0&&(t=100),e===void 0&&(e=10);var r=[];return n.traverse(function(i){if(i instanceof d.Mesh){var a=Qc(i,t,e);r.push(a)}else if(i instanceof d.Points){var a=Vc(i,t,e);r.push(a)}}),function(){for(var i=0,a=r;i<a.length;i++){var o=a[i];o()}}}var qc=new d.Vector3,zc=new d.Vector3,Hc=new d.Vector3,bu=function(n){de(t,n);function t(e,r){var i=n.call(this)||this;i.renderOrder=-4;var a=Uc(e,200,10);return i.disposers=[r,a],i.add(e),i}return t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=this.children.slice(),s;s=o.pop();)if(s.visible){s.raycast(e,i);for(var u=0,c=s.children.length;u<c;u++)o.push(s.children[u])}return i.forEach(function(l){var h,p,v=0;if((l.object instanceof _t||l.object instanceof Lr)&&l.face){var m=Array.isArray(l.object.material)?l.object.material[l.face.materialIndex]:l.object.material;if(m)if(m.defines.USE_VERTEX_FLOOR){var A=(h=l.object.geometry.attributes.position)===null||h===void 0?void 0:h.array,y=(p=l.object.geometry.attributes.floor)===null||p===void 0?void 0:p.array;if(A&&y){var f=qc.set(A[l.face.a*3],A[l.face.a*3+1],A[l.face.a*3+2]).applyMatrix4(a.matrixWorld),g=zc.set(A[l.face.b*3],A[l.face.b*3+1],A[l.face.b*3+2]).applyMatrix4(a.matrixWorld),b=Hc.set(A[l.face.c*3],A[l.face.c*3+1],A[l.face.c*3+2]).applyMatrix4(a.matrixWorld),w=l.point.distanceTo(f),E=l.point.distanceTo(g),x=l.point.distanceTo(b);v=Math.round((w*y[l.face.a]+E*y[l.face.b]+x*y[l.face.c])/(w+E+x))}}else v=m.floor}l.floor=v}),r&&i.sort(function(l,h){return l.distance-h.distance}),i},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}},t}(d.Group);function It(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(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 yr(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function wu(n,t){if(n.content&&n.content.uri&&(yr(n.content.uri)||(n.content.uri=It(t,n.content.uri))),n.children)for(var e=0,r=n.children;e<r.length;e++){var i=r[e];wu(i,t)}return n}function zo(n,t){return n.asset.overview&&(yr(n.asset.overview.imageFile)||(n.asset.overview.imageFile=It(t,n.asset.overview.imageFile)),yr(n.asset.overview.worldFile)||(n.asset.overview.worldFile=It(t,n.asset.overview.worldFile))),wu(n.root,t),n}function Eu(n,t){return(t[0]==="?"||t[0]==="&")&&(t=t.slice(1)),t?((n[n.length-1]==="?"||n[n.length-1]==="&")&&(n=n.slice(0,-1)),n.indexOf("?")>=0?"".concat(n,"&").concat(t):"".concat(n,"?").concat(t)):n}var _i=4;function xu(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=_i,n.version=r.getUint32(e,!0),e+=_i,n.byteLength=r.getUint32(e,!0),e+=_i,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var nr,xe;(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"})(xe||(xe={}));var jc=(nr={},nr[xe.DOUBLE]=Float64Array,nr[xe.FLOAT]=Float32Array,nr[xe.UNSIGNED_SHORT]=Uint16Array,nr[xe.UNSIGNED_INT]=Uint32Array,nr[xe.UNSIGNED_BYTE]=Uint8Array,nr[xe.BYTE]=Int8Array,nr[xe.SHORT]=Int16Array,nr[xe.INT]=Int32Array,nr),_c={DOUBLE:xe.DOUBLE,FLOAT:xe.FLOAT,UNSIGNED_SHORT:xe.UNSIGNED_SHORT,UNSIGNED_INT:xe.UNSIGNED_INT,UNSIGNED_BYTE:xe.UNSIGNED_BYTE,BYTE:xe.BYTE,SHORT:xe.SHORT,INT:xe.INT};function pi(n){var t=jc[n];if(!t)throw new Error("Failed to convert GL type");return t}function Gi(n){var t=pi(n);return t.BYTES_PER_ELEMENT}function Ho(n,t,e,r){e===void 0&&(e=0);var i=pi(n);if(e%Gi(n)!==0){var a=r?t.slice(e,e+r*Gi(n)):t.slice(e);return new i(a)}else return new i(t,e,r??(t.byteLength-e)/Gi(n))}function Gc(n){var t=_c[n];if(!t)throw new Error("Failed to convert GL type");return t}var Mu=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",xe.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=pi(e);return new a([i])}else if(Array.isArray(i)){var a=pi(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=Gc(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 u=0;u<r;++u)a[u]=s[r*i+u];return a},n.prototype.getTypedArrayFromBinary=function(t,e,r,i,a){var o=this.cachedTypedArrays,s=o[t];return s||(s=Ho(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=Ho(e,r),i[t]=a),a},n}(),tn=4,jo="b3dm tile in legacy format.";function Cu(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function Iu(n,t,e){return e=Kc(n,t,e),e=Wc(n,t,e),e=Xc(n,t,e),e}function Kc(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=tn;var o=r.getUint32(e,!0);e+=tn;var s=r.getUint32(e,!0);e+=tn;var u=r.getUint32(e,!0);return e+=tn,s>=570425344?(e-=tn*2,i=a,s=o,u=0,a=0,o=0,console.warn(jo)):u>=570425344&&(e-=tn,i=s,s=a,u=o,a=0,o=0,console.warn(jo)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=u,n.header.batchLength=i,e}function Wc(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=Cu(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=new d.Vector3;var u=new Mu(n.featureTableJson,n.featureTableBinary);if(Array.isArray(u.json.RTC_CENTER))n.rtcCenter.fromArray(u.json.RTC_CENTER);else{var c=u.getGlobalProperty("RTC_CENTER",xe.FLOAT,3);c&&n.rtcCenter.fromArray(c)}return e}function Xc(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=Cu(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 Yc(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 Jc(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=Yc(t,e,r),n.byteLength}function Ea(n){if(typeof TextDecoder<"u")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{return t}}var Re={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},wn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},vi={9728:d.NearestFilter,9729:d.LinearFilter,9984:d.NearestMipmapNearestFilter,9985:d.LinearMipmapNearestFilter,9986:d.NearestMipmapLinearFilter,9987:d.LinearMipmapLinearFilter},Ai={33071:d.ClampToEdgeWrapping,33648:d.MirroredRepeatWrapping,10497:d.RepeatWrapping},_o={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Rt={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Sr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Zc={CUBICSPLINE:void 0,LINEAR:d.InterpolateLinear,STEP:d.InterpolateDiscrete},pr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function yt(n){var t=[];for(var e in n)t.push(n[e]);return t}var $c=function(){function n(t,e,r){this.json=t,this.extensions=e,this.options=r,this.cache=new Map,this.disposeSet=new Set,this.nodeNamesUsed={}}return n.prototype.dispose=function(){this.cache.clear(),this.disposeSet.forEach(function(t){t.dispose()}),this.disposeSet.clear()},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,u=o.length;s<u;s++)t[o[s]].isBone=!0;for(var c=0,l=t.length;c<l;c++){var h=t[c];h.mesh!==void 0&&h.skin!==void 0&&(r[h.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.dispose(),this.markDefs();for(var i=0,a=yt(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(yt(r).map(function(s){return s.prepare(t)})).then(function(){var s,u,c;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(l,h){return t.loadScene(h)})),Promise.all(((u=e.animations)!==null&&u!==void 0?u:[]).map(function(l,h){return t.loadAnimation(h)})),Promise.all(((c=e.cameras)!==null&&c!==void 0?c:[]).map(function(l,h){return t.loadCamera(h)}))])}).then(function(s){var u=s[0],c=s[1],l=s[2],h={json:t.json,scene:u[e.scene||0],scenes:u,animations:c,cameras:l,dispose:function(){return t.dispose()}};return Promise.all(yt(r).map(function(p){return p.emitResult(h,t)})).then(function(){return h})})},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=yt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var u=void 0,c=this.json.cameras[t],l=c[c.type];l?c.type==="perspective"?u=new d.PerspectiveCamera(d.MathUtils.radToDeg(l.yfov),l.aspectRatio||1,l.znear||1,l.zfar||2e6):c.type==="orthographic"?u=new d.OrthographicCamera(-l.xmag,l.xmag,l.ymag,-l.ymag,l.znear,l.zfar):(console.warn("glTF: Invalid camera type ".concat(c.type,".")),u=new d.Camera):(console.warn("glTF: Missing camera parameters."),u=new d.Camera),c.name&&(u.name=this.createUniqueName(c.name)),i=Promise.resolve(u)}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=yt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadAnimation(t,this),i)break}if(!i){for(var u=this.json,c=u.animations[t],l=[],h=[],p=[],v=[],m=[],A=0,y=c.channels.length;A<y;A++){var f=c.channels[A],g=c.samplers[f.sampler],b=f.target,w=b.node!==void 0?b.node:b.id,E=c.parameters!==void 0?c.parameters[g.input]:g.input,x=c.parameters!==void 0?c.parameters[g.output]:g.output;l.push(this.loadNode(w)),h.push(this.loadAccessor(E)),p.push(this.loadAccessor(x)),v.push(g),m.push(b)}i=Promise.all([Promise.all(l),Promise.all(h),Promise.all(p),Promise.all(v),Promise.all(m)]).then(function(M){for(var C=M[0],I=M[1],P=M[2],S=M[3],F=M[4],k=[],O=function(j,z){var U=C[j],X=I[j],G=P[j],K=S[j],Y=F[j];if(U===void 0)return"continue";U.updateMatrix(),U.matrixAutoUpdate=!0;var H=void 0;switch(Sr[Y.path]){case Sr.weights:H=d.NumberKeyframeTrack;break;case Sr.rotation:H=d.QuaternionKeyframeTrack;break;case Sr.position:case Sr.scale:default:H=d.VectorKeyframeTrack;break}var J=U.name?U.name:U.uuid,ne=K.interpolation!==void 0?Zc[K.interpolation]:d.InterpolateLinear,$=[];Sr[Y.path]===Sr.weights?U.traverse(function(Ae){Ae.morphTargetInfluences&&$.push(Ae.name?Ae.name:Ae.uuid)}):$.push(J);var te=G.array;if(G.normalized){for(var ae=Ki(te.constructor),ce=new Float32Array(te.length),oe=0,fe=te.length;oe<fe;oe++)ce[oe]=te[oe]*ae;te=ce}for(var oe=0,fe=$.length;oe<fe;oe++){var Ie=new H($[oe]+"."+Sr[Y.path],X.array,te,ne);k.push(Ie)}},L=0,N=C.length;L<N;L++)O(L);var V=c.name?c.name:"animation_"+t;return new d.AnimationClip(V,void 0,k)})}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=yt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadBuffer(t,this),a)break}if(!a){var c=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(c.uri),{responseType:"arraybuffer"}).then(function(l){return l.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=yt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadBufferView(t,this),i)break}if(!i){var u=this.json.bufferViews[t];i=this.loadBuffer(u.buffer).then(function(c){var l=u.byteLength||0,h=u.byteOffset||0;return c.slice(h,h+l)})}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(u){var c=u[0],l=_o[o.type],h=wn[o.componentType],p=h.BYTES_PER_ELEMENT,v=p*l,m=o.byteOffset||0,A=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,y=o.normalized===!0,f,g;if(A&&A!==v){var b=Math.floor(m/A),w="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,E=e.cache.get(w);E||(f=new h(c,b*A,o.count*A/p),E=new d.InterleavedBuffer(f,A/p),e.cache.set(w,E)),g=new d.InterleavedBufferAttribute(E,l,m%A/p,y)}else c===null?f=new h(o.count*l):f=new h(c,m,o.count*l),g=new d.BufferAttribute(f,l,y);if(o.sparse!==void 0){var x=_o.SCALAR,M=wn[o.sparse.indices.componentType],C=o.sparse.indices.byteOffset||0,I=o.sparse.values.byteOffset||0,P=new M(u[1],C,o.sparse.count*x),S=new h(u[2],I,o.sparse.count*l);c!==null&&(g=new d.BufferAttribute(g.array.slice(),g.itemSize,g.normalized));for(var F=0,k=P.length;F<k;F++){var O=P[F];if(g.setX(O,S[F*l]),l>=2&&g.setY(O,S[F*l+1]),l>=3&&g.setZ(O,S[F*l+2]),l>=4&&g.setW(O,S[F*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return g})}}return this.cache.set(r,a),a},n.prototype.createPrimitiveKey=function(t){for(var e=0,r=yt(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(),u=0,c=s.length;u<c;u++)o+=s[u]+":"+t.attributes[s[u]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){var e=this,r="geometry:"+this.createPrimitiveKey(t),i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=yt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadGeometry(t,this),a)break}return a||(a=this.addGeometryPrimitiveAttributes(new d.BufferGeometry,t)),a=a.then(function(c){return e.disposeSet.add(c),c}),this.cache.set(r,a),a},n.prototype.loadImage=function(t){var e="image:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=yt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadImage(t,this),i)break}if(!i){var u=this.json.images[t];if(u.bufferView)i=this.loadBufferView(u.bufferView).then(function(l){var h=new Blob([l],{type:u.mimeType});return lu(h)});else if(u.uri){var c=this.resolveResouce(u.uri);i=this.options.fetcher.loadImage(c,{},void 0,void 0,void 0,fi()).then(function(l){return l.body})}else throw new Error("glTF: Invalid image defs.")}return this.cache.set(e,i),i},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(l){return Rt[l]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return Rt[l]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(l){return Rt[l]==="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(l){l.encoding=d.sRGBEncoding,i.map=l,e.disposeSet.add(l)})),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(l){l.encoding=d.sRGBEncoding,i.metalnessMap=l,i.roughnessMap=l,e.disposeSet.add(l)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var u=a.alphaMode||pr.OPAQUE;if(u===pr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===pr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(l){i.normalMap=l,e.disposeSet.add(l)})),i.normalScale=new d.Vector2(1,1),a.normalTexture.scale!==void 0)){var c=a.normalTexture.scale;i.normalScale.set(c,c)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(l){i.aoMap=l,e.disposeSet.add(l)})),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(l){i.emissiveMap=l,e.disposeSet.add(l)}))}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(u){return Rt[u]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return Rt[u]==="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||pr.OPAQUE;s===pr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===pr.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(c){return Rt[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return Rt[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)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var u=a.alphaMode||pr.OPAQUE;u===pr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===pr.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=this,r,i=(r=t.mode)!==null&&r!==void 0?r:Re.TRIANGLES,a="material:"+this.createPrimitiveKey(t),o=this.cache.get(a);if(o)return o;for(var s=null,u=0,c=yt(this.extensions);u<c.length;u++){var l=c[u];if(s=l.loadMaterial(t,this),s)break}if(i===Re.TRIANGLES||i===Re.TRIANGLE_STRIP||i===Re.TRIANGLE_FAN)s=this.loadMaterialAsMeshStandardMaterial(t);else if(i===Re.LINES||i===Re.LINE_STRIP||i===Re.LINE_LOOP)s=this.loadMaterialAsLineBasicMaterial(t);else if(i===Re.POINTS)s=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+i);return s=s.then(function(h){return e.disposeSet.add(h),h}),this.cache.set(a,s),s},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=yt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadTexture(t,this),a)break}if(!a){var c=this.json.textures[t];a=this.loadImage(c.source).then(function(l){var h=new d.Texture(l);h.needsUpdate=!0,h.flipY=!1,c.name&&(h.name=c.name);var p=e.json.samplers||{},v=p[c.sampler]||{};h.magFilter=vi[v.magFilter]||d.LinearFilter,h.minFilter=vi[v.minFilter]||d.LinearMipmapLinearFilter,h.wrapS=Ai[v.wrapS]||d.RepeatWrapping,h.wrapT=Ai[v.wrapT]||d.RepeatWrapping;var m=h.dispose;return h.dispose=function(){return h.dispose=m,l.close(),m.call(this)},h})}return a=a.then(function(l){return e.disposeSet.add(l),l}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=yt(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],u=s.primitives,c=Promise.all(u.map(function(h){return e.loadGeometry(h)})),l=Promise.all(u.map(function(h){return e.loadMaterial(h)}));r=Promise.all([c,l]).then(function(h){for(var p=h[0],v=h[1],m=[],A=0;A<u.length;A++){var y=u[A],f=p[A],g=v[A],b=y.mode||Re.TRIANGLES,w=void 0;if(b===Re.TRIANGLES||b===Re.TRIANGLE_STRIP||b===Re.TRIANGLE_FAN)if(b===Re.TRIANGLE_STRIP?f=e.toGeometryTrianglesDrawMode(f,d.TriangleStripDrawMode):b===Re.TRIANGLE_FAN&&(f=e.toGeometryTrianglesDrawMode(f,d.TriangleFanDrawMode)),s.isSkinnedMesh){var E=new d.SkinnedMesh(f,g);f.attributes.skinWeight.normalized||E.normalizeSkinWeights(),w=E}else w=new d.Mesh(f,g);else if(b===Re.POINTS)w=new d.Points(f,g);else if(b===Re.LINES)w=new d.LineSegments(f,g);else if(b===Re.LINE_STRIP)w=new d.Line(f,g);else if(b===Re.LINE_LOOP)w=new d.LineLoop(f,g);else throw new Error("glTF: Primitive mode unsupported: "+b);if(Object.keys(f.morphAttributes).length>0){if(s.weights!==void 0)for(var x=0,M=s.weights.length;x<M;x++)w.morphTargetInfluences[x]=s.weights[x];if(s.extras&&Array.isArray(s.extras.targetNames)){var C=s.extras.targetNames;if(w.morphTargetInfluences.length===C.length){w.morphTargetDictionary={};for(var x=0,M=C.length;x<M;x++)w.morphTargetDictionary[C[x]]=x}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}w.name=e.createUniqueName(s.name||"mesh_"+t),m.push(w)}if(m.length===1)return m[0];for(var I=new d.Group,P=0,S=m;P<S.length;P++){var w=S[P];I.add(w)}return I})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=yt(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(p){if(a.weights!==void 0){var v=a.weights;p.traverse(function(m){if(m instanceof d.Mesh||m instanceof d.Line||m instanceof d.Points)for(var A=0,y=v.length;A<y;A++)m.morphTargetInfluences[A]=v[A]})}return p})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var u=this.loadNodeAttachments(t),c=0,l=u;c<l.length;c++){var h=l[c];s.push(h)}return Promise.all(s).then(function(p){var v;if(a.isBone===!0?v=new d.Bone:p.length>1?v=new d.Group:p.length===1?v=p[0]:v=new d.Object3D,v!==p[0])for(var m=0,A=p.length;m<A;m++)v.add(p[m]);if(a.name&&(v.name=o),a.matrix!==void 0){var y=new d.Matrix4;y.fromArray(a.matrix),v.applyMatrix4(y)}else a.translation!==void 0&&v.position.fromArray(a.translation),a.rotation!==void 0&&v.quaternion.fromArray(a.rotation),a.scale!==void 0&&v.scale.fromArray(a.scale);return v})},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,u=a.length;s<u;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=yt(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s)}return r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(E){var x=Rt[E]||E.toLowerCase();if(x in t.attributes)return"continue";a.push(s.loadAccessor(i[E]).then(function(M){M&&t.setAttribute(x,M)}))},s=this;for(var u in i)o(u);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(E){E&&t.setIndex(E)}));var c=new d.Box3;if(i.POSITION!==void 0){var l=this.json.accessors[i.POSITION],h=l.min,p=l.max;if(h!==void 0&&p!==void 0){if(c.set(new d.Vector3(h[0],h[1],h[2]),new d.Vector3(p[0],p[1],p[2])),l.normalized){var v=Ki(wn[l.componentType]);c.min.multiplyScalar(v),c.max.multiplyScalar(v)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var m=e.targets;if(m!==void 0){for(var A=new d.Vector3,y=new d.Vector3,f=0,g=m.length;f<g;f++){var b=m[f];if(b.POSITION!==void 0){var l=this.json.accessors[b.POSITION],h=l.min,p=l.max;if(h!==void 0&&p!==void 0){if(y.setX(Math.max(Math.abs(h[0]),Math.abs(p[0]))),y.setY(Math.max(Math.abs(h[1]),Math.abs(p[1]))),y.setZ(Math.max(Math.abs(h[2]),Math.abs(p[2]))),l.normalized){var v=Ki(wn[l.componentType]);y.multiplyScalar(v)}A.max(y)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}c.expandByVector(A)}t.boundingBox=c;var w=new d.Sphere;return c.getCenter(w.center),w.radius=c.min.distanceTo(c.max)/2,t.boundingSphere=w,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 E=!1,x=!1,M=0,C=e.targets.length;M<C;M++){var I=e.targets[M];if(I.POSITION!==void 0&&(E=!0),I.NORMAL!==void 0&&(x=!0),E&&x)break}if(!E&&!x)return t;var P=[];t.morphTargetsRelative=!0;for(var S=function(F,k){var O=e.targets[F];E?P.push(r.loadAccessor(O.POSITION).then(function(L){L&&(t.morphAttributes.position[F]=L)})):t.morphAttributes.position[F]=t.attributes.position,x?P.push(r.loadAccessor(O.NORMAL).then(function(L){L&&(t.morphAttributes.normal[F]=L)})):t.morphAttributes.normal[F]=t.attributes.normal},M=0,C=e.targets.length;M<C;M++)S(M,C);return Promise.all(P).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 u=[],c=0,l=o.joints.length;c<l;c++)u.push(r.loadNode(o.joints[c]));return Promise.all(u)}).then(function(s){return a.traverse(function(u){if(u instanceof d.SkinnedMesh){for(var c=[],l=[],h=0,p=s.length;h<p;h++){var v=s[h];if(v instanceof d.Bone){c.push(v);var m=new d.Matrix4;o.inverseBindMatrices!==void 0&&m.fromArray(o.inverseBindMatrices.array,h*16),l.push(m)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[h])}u.bind(new d.Skeleton(c,l),u.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,u=0,c=s.length;u<c;u++){var l=s[u];o.push(r.buildNodeHierarchy(l,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 It(this.options.resourcePath,Eu(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,u=[];if(e===d.TriangleFanDrawMode)for(var o=1;o<=s;o++)u.push(r.getX(0)),u.push(r.getX(o)),u.push(r.getX(o+1));else for(var o=0;o<s;o++)o%2===0?(u.push(r.getX(o)),u.push(r.getX(o+1)),u.push(r.getX(o+2))):(u.push(r.getX(o+2)),u.push(r.getX(o+1)),u.push(r.getX(o)));u.length/3!==s&&console.error("glTF: Unable to generate correct amount of triangles.");var c=t.clone();return c.setIndex(u),c},n}();function Ki(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 br=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}(),ed=function(n){de(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 Ea(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 u=i.getUint32(a,!0);a+=4;var c=i.getUint32(a,!0);if(a+=4,c===t.CHUNK_TYPES.JSON){var l=new Uint8Array(e,t.HEADER_LENGTH+a,u);o=Ea(l)}else if(c===t.CHUNK_TYPES.BIN){var h=t.HEADER_LENGTH+a;s=e.slice(h,h+u)}a+=u}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.HEADER_MAGIC="glTF",t.HEADER_LENGTH=12,t.CHUNK_TYPES={JSON:1313821514,BIN:5130562},t}(br),td="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",Go={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},Ko={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},rd=function(){function n(){this.decoderPath=td,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||Go,attributeTypes:i||Ko,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:Go,attributeTypes:Ko,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++,u=t.byteLength,c=this._getWorker(s,u).then(function(l){return o=l,new Promise(function(h,p){o._callbacks[s]={resolve:h,reject:p},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(l){return r._createGeometry(l.geometry)});return c.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),c},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=ln(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 */",Wo].join(`
|
|
418
|
+
`);t.workerSourceURL=URL.createObjectURL(new Blob([o]))})}else{var r=ln(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(o){return o.body}),i=ln(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],u=o[1];t.decoderConfig.wasmBinary=u;var c=["/* draco decoder */",s,"","/* worker */",Wo].join(`
|
|
419
|
+
`);t.workerSourceURL=URL.createObjectURL(new Blob([c]))})}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}(),mi=new rd,Wo=`
|
|
420
420
|
let decoderConfig;
|
|
421
421
|
let decoderPending;
|
|
422
422
|
|
|
@@ -611,8 +611,8 @@ void main() {
|
|
|
611
611
|
}
|
|
612
612
|
|
|
613
613
|
}
|
|
614
|
-
`,Wi="KHR_draco_mesh_compression",
|
|
615
|
-
`);t.workerSourceURL=URL.createObjectURL(new Blob([s])),t.transcoderBinary=o,t.workerPool.setWorkerCreator(function(){var u=new Worker(t.workerSourceURL),c=t.transcoderBinary.slice(0);return u.postMessage({type:"init",config:t.workerConfig,transcoderBinary:c},[c]),u})})}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,u=t.dfdTransferFn,c=t.dfdFlags;if(o==="error")return Promise.reject(s);var l=new d.CompressedTexture(e,r,i,a,d.UnsignedByteType);return l.minFilter=e.length===1?d.LinearFilter:d.LinearMipmapLinearFilter,l.magFilter=d.LinearFilter,l.generateMipmaps=!1,l.needsUpdate=!0,l.encoding=u===
|
|
614
|
+
`,Wi="KHR_draco_mesh_compression",nd=function(n){de(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadGeometry=function(e,r){return e.extensions&&e.extensions[Wi]?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[Wi].bufferView,o=e.extensions[Wi].attributes,s={},u={},c={};for(var l in o){var h=Rt[l]||l.toLowerCase();s[h]=o[l]}for(var l in e.attributes){var h=Rt[l]||l.toLowerCase();if(o[l]!==void 0){var p=i.accessors[e.attributes[l]],v=wn[p.componentType];c[h]=v,u[h]=p.normalized===!0}}return r.loadBufferView(a).then(function(m){return new Promise(function(A){mi.decodeDracoFile(m,function(y){for(var f in y.attributes){var g=y.attributes[f],b=u[f];b!==void 0&&(g.normalized=b)}A(y)},s,c)})})},t}(br),id=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}(),ad="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/basis/1.16/",od=2,sd=1,ud=function(){function n(){this.transcoderPath=ad,this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new id(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=ln(this.transcoderPath+"basis_transcoder.js",{responseType:"text"}).then(function(i){return i.body}),r=ln(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(dd),"let _TranscoderFormat = "+JSON.stringify(cd),"let _BasisFormat = "+JSON.stringify(ld),"/* basis_transcoder.js */",a,"/* worker */",fd].join(`
|
|
615
|
+
`);t.workerSourceURL=URL.createObjectURL(new Blob([s])),t.transcoderBinary=o,t.workerPool.setWorkerCreator(function(){var u=new Worker(t.workerSourceURL),c=t.transcoderBinary.slice(0);return u.postMessage({type:"init",config:t.workerConfig,transcoderBinary:c},[c]),u})})}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,u=t.dfdTransferFn,c=t.dfdFlags;if(o==="error")return Promise.reject(s);var l=new d.CompressedTexture(e,r,i,a,d.UnsignedByteType);return l.minFilter=e.length===1?d.LinearFilter:d.LinearMipmapLinearFilter,l.magFilter=d.LinearFilter,l.generateMipmaps=!1,l.needsUpdate=!0,l.encoding=u===od?d.sRGBEncoding:d.LinearEncoding,l.premultiplyAlpha=!!(c&sd),Promise.resolve(l)},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}(),Fn=new ud,ld={ETC1S:0,UASTC_4x4:1},cd={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},dd={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},fd=`
|
|
616
616
|
|
|
617
617
|
let config;
|
|
618
618
|
let transcoderPending;
|
|
@@ -880,18 +880,18 @@ void main() {
|
|
|
880
880
|
return ( value & ( value - 1 ) ) === 0 && value !== 0;
|
|
881
881
|
|
|
882
882
|
}
|
|
883
|
-
`,Jo="KHR_texture_basisu",Ad=function(n){de(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[Jo])return null;var a=i.extensions[Jo],o=r.json.images[a.source],s=null;if(o.bufferView)s=r.loadBufferView(o.bufferView).then(function(u){return Fn.parse(u)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(u){return Fn.parse(u.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(br),Zo="KHR_texture_transform",md=function(n){de(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[Zo]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+Zo+'" 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}(br),gd=function(n){de(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(br),Xi=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:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklb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QaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;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(f){a=f.instance,a.exports.__wasm_call_ctors()});function s(f){for(var g=new Uint8Array(f.length),b=0;b<f.length;++b){var w=f.charCodeAt(b);g[b]=w>96?w-97:w>64?w-39:w+4}for(var E=0,b=0;b<f.length;++b)g[E++]=g[b]<60?r[g[b]]:(g[b]-60)*64+g[++b];return g.buffer.slice(0,E)}function u(f,g,b,w,E,x){var M=a.exports.sbrk,C=b+3&-4,I=M(C*w),P=M(E.length),S=new Uint8Array(a.exports.memory.buffer);S.set(E,P);var F=f(I,b,w,P,E.length);if(F==0&&x&&x(I,C,w),g.set(S.subarray(I,I+b*w)),M(I-M(0)),F!=0)throw new Error("Malformed buffer data: "+F)}var c={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],p=0;function v(f){var g={object:new Worker(f),pending:0,requests:{}};return g.object.onmessage=function(b){var w=b.data;g.pending-=w.count,g.requests[w.id][w.action](w.value),delete g.requests[w.id]},g}function m(f){for(var g="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;"+u.toString()+y.toString(),b=new Blob([g],{type:"text/javascript"}),w=URL.createObjectURL(b),E=0;E<f;++E)h[E]=v(w);URL.revokeObjectURL(w)}function A(f,g,b,w,E){for(var x=h[0],M=1;M<h.length;++M)h[M].pending<x.pending&&(x=h[M]);return new Promise(function(C,I){var P=new Uint8Array(b),S=p++;x.pending+=f,x.requests[S]={resolve:C,reject:I},x.object.postMessage({id:S,count:f,size:g,source:P,mode:w,filter:E},[P.buffer])})}function y(f){o.then(function(){var g=f.data;try{var b=new Uint8Array(g.count*g.size);u(a.exports[g.mode],b,g.count,g.size,g.source,a.exports[g.filter]),self.postMessage({id:g.id,count:g.count,action:"resolve",value:b},[b.buffer])}catch(w){self.postMessage({id:g.id,count:g.count,action:"reject",value:w})}})}return{ready:o,supported:!0,useWorkers:function(f){m(f)},decodeVertexBuffer:function(f,g,b,w,E){u(a.exports.meshopt_decodeVertexBuffer,f,g,b,w,a.exports[c[E]])},decodeIndexBuffer:function(f,g,b,w){u(a.exports.meshopt_decodeIndexBuffer,f,g,b,w)},decodeIndexSequence:function(f,g,b,w){u(a.exports.meshopt_decodeIndexSequence,f,g,b,w)},decodeGltfBuffer:function(f,g,b,w,E,x){u(a.exports[l[E]],f,g,b,w,a.exports[c[x]])},decodeGltfBufferAsync:function(f,g,b,w,E){return h.length>0?A(f,g,b,l[w],c[E]):o.then(function(){var x=new Uint8Array(f*g);return u(a.exports[l[w]],x,f,g,b,a.exports[c[E]]),x})}}}(),Yi="EXT_meshopt_compression",yd=function(n){de(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[Yi]){var o=a.extensions[Yi],s=r.loadBuffer(o.buffer);if(!Xi.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(Yi)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,Xi.ready]).then(function(u){var c=u[0],l=o.byteOffset||0,h=o.byteLength||0,p=o.count,v=o.byteStride,m=new ArrayBuffer(p*v),A=new Uint8Array(c,l,h);return Xi.decodeGltfBuffer(new Uint8Array(m),p,v,A,o.mode,o.filter),m})}else return null},t}(br),$o="EXT_texture_webp",bd=function(n){de(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 ru().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[$o]||!this.supportsWep)return null;var o=a.extensions[$o];return r.loadImage(o.source).then(function(s){var u=new d.Texture(s);u.needsUpdate=!0,u.flipY=!1,a.name&&(u.name=a.name);var c=r.json.samplers||{},l=c[a.sampler]||{};return u.magFilter=vi[l.magFilter]||d.LinearFilter,u.minFilter=vi[l.minFilter]||d.LinearMipmapLinearFilter,u.wrapS=Ai[l.wrapS]||d.RepeatWrapping,u.wrapT=Ai[l.wrapT]||d.RepeatWrapping,u})},t}(br),Ji="CESIUM_RTC",wd=function(n){de(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[Ji]&&r.json.extensions[Ji].center){var i=r.json.extensions[Ji].center;e.CESIUM_RTC={center:new d.Vector3().fromArray(i)}}},t}(br);const 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)}("{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-u|{Sy||V{qr\x07H0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6--n\bv{t-sy|n-Sy||H0ryr--{vs|z-sy|n-sy||H0r{qvsn\bv{t-rpA-|yq]|vv|{Hn\bv{t-rp@-cvr]|vv|{Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-Y|tQr}uHn\bv{t-sy|n-]|v{`v rHp-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{qvs|vq-znv{56-\n--sy|n-ory|{tv{tSY||-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6----ory|{tv{tSY||-J-Sy||H--0ryr----ory|{tv{tSY||-J-sy||H--0r{qvs--<<前置裁切计算--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-|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5ory|{tv{tSY||-:-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---<<楼层选择计算--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-KJ-=;=-33-no5ory|{tv{tSY||-:-u|{Sy||V{qr\x076-KJ->;=6-\n----sy||\\}npv\b-J-=;>H--\f--rp@-sv{nyP|y|-J-P|y|H--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----0vs-qrsv{rq5b`Rl]\\V[alONPXlUVQQR[6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-|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|{-:-|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------sv{nyP|y|-J-sv{nyP|y|-7-=;DBH------\f----0r{qvs--0r{qvs--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-E;=-33-pp-K->;=6-\n------qvpnqH----\f--0r{qvs--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->;=6H--0ryr----tylSntP|y|-J-rpA5sv{nyP|y|9-z|qryNy}un-7-|}npv\b-7-sy||\\}npv\b6H--0r{qvs--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\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)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6--nvor-sy|n-sy||H--n\bv{t-sy|n-Sy||H0r{qvs{vs|z-sy|n-prr{UrvtuH{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|H0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?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\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-prr{Urvtu-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-prr{Urvtu-7-rny]|v{`v r-<-urvtuH--0r{qvs--]|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--tyl]|v{`v r-J-]|v{`v rH--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-|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-prr{Urvtu-<-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|{H0r{qvs\f");var Md=new d.Vector4,Cd=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),screenHeight:new d.Uniform(512),floor:new d.Uniform(0)},d.UniformsUtils.clone(d.UniformsLib.common)),Ga=function(n){de(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,c,l,h,p,v,m,A,y,f,g,b,w,E,x,M=n.call(this,{vertexShader:xd,fragmentShader:Ed,uniforms:d.UniformsUtils.clone(Cd),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_FLOOR:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_PANO_VIDEO:!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,C;return Object.defineProperties(M,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(I){this.uniforms.constantColor.value=I;var P=this.defines.USE_CONSTANT_COLOR,S=I!==null;P!==S&&(this.defines.USE_CONSTANT_COLOR=S,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(I){this.uniforms.opacity.value=I}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(I){this.uniforms.modelAlpha.value=I}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(I){this.uniforms.shownFloorIndex.value=I}},clippers:{get:function(){return C},set:function(I){C!==I&&(C=I,this.uniforms.clippers.value=(C||[]).map(function(P){var S=typeof P.floorIndex=="number"?P.floorIndex:-1,F=new d.Matrix4().getInverse(P.clippingBoxMatrix);return{matrixInverse:F,floorIndex:S}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(I){var P=I==="ALTITUDE";this.defines.USE_POINT_COLOR_ALTITUDE!==P&&(this.defines.USE_POINT_COLOR_ALTITUDE=P,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(I){var P=I==="ATTENUATION",S=I==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==S&&(this.defines.USE_POINT_SIZE_GEOMETRIC=S,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==P&&(this.defines.USE_POINT_SIZE_ATTENUATION=P,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(I){var P=I==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==P&&(this.defines.USE_POINT_SHAPE_CIRCLE=P,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(I){this.uniforms.pointScale.value=I}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(I){var P=I==="HIDDEN",S=I==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==P&&(this.defines.USE_POINT_BACK_HIDDEN=P,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==S&&(this.defines.USE_POINT_BACK_DARK=S,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(I){this.uniforms.pointMinPixel.value=I}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(I){this.uniforms.pointMaxPixel.value=I}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(I){I!==this.defines.USE_EDL&&(this.defines.USE_EDL=I,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(I){I!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=I,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(I){I!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=I,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(I){this.uniforms.gradientTexture.value=I}},floor:{get:function(){return this.uniforms.floor.value},set:function(I){this.uniforms.floor.value=I}}}),M.pano0=(r=e.pano0)!==null&&r!==void 0?r:be.pano0,M.pano1=(i=e.pano1)!==null&&i!==void 0?i:be.pano1,M.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:be.modelAlpha,M.progress=(o=e.progress)!==null&&o!==void 0?o:be.progress,M.useBlackTransition=(s=e.useBlackTransition)!==null&&s!==void 0?s:be.useBlackTransition,M.constantColor=(u=e.constantColor)!==null&&u!==void 0?u:be.constantColor,M.opacity=(c=e.opacity)!==null&&c!==void 0?c:be.opacity,M.shownFloorIndex=(l=e.shownFloorIndex)!==null&&l!==void 0?l:be.shownFloorIndex,M.clippers=(h=e.clippers)!==null&&h!==void 0?h:be.clippers,M.useEDL=(p=e.useEDL)!==null&&p!==void 0?p:be.useEDL,M.useHQWeight=(v=e.useHQWeight)!==null&&v!==void 0?v:be.useHQWeight,M.useHQDepth=(m=e.useHQDepth)!==null&&m!==void 0?m:be.useHQDepth,M.pointColor=(A=e.pointColor)!==null&&A!==void 0?A:be.pointColor,M.pointShape=(y=e.pointShape)!==null&&y!==void 0?y:be.pointShape,M.pointSize=(f=e.pointSize)!==null&&f!==void 0?f:be.pointSize,M.pointScale=(g=e.pointScale)!==null&&g!==void 0?g:be.pointScale,M.pointBack=(b=e.pointBack)!==null&&b!==void 0?b:be.pointBack,M.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:be.pointMinPixel,M.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:be.pointMaxPixel,M.gradientTexture=(x=e.gradientTexture)!==null&&x!==void 0?x:be.gradientTexture,M.floor=0,M.transparent=!1,M}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=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,o),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,o)},t.prototype.update=function(e,r){var i=r instanceof hi?r.pixelRatio:e.getPixelRatio(),a=r instanceof hi?r.screenHeight:e.getViewport(Md).z;this.uniforms.pixelRatio.value=i,this.uniforms.screenHeight.value=a,this.transparent=this.shownFloorIndex>-1||this.opacity<1||this.modelAlpha<1,this.useEDL&&(this.transparent=!1),this.useHQDepth&&(this.depthTest=!0,this.depthWrite=!0),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.depthWrite=!0,this.transparent=this.shownFloorIndex>-1||this.opacity<1||this.modelAlpha<1,this.blendDst=d.OneMinusSrcAlphaFactor,this.blendEquation=d.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blending=d.NormalBlending)},t.prototype.syncModel=function(e){var r="".concat(e.id,":").concat(e.materialVersion);r!==this.syncModelVersion&&(Object.assign(this,e.getMaterial()),this.syncModelVersion=r)},t}(d.ShaderMaterial),Pu=new Ga;Pu.dispose=function(){};var Ka=new Ga;Ka.defines.USE_POINT_NORMAL=!0;Ka.dispose=function(){};var Id=function(n){de(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(l){return r.loadGeometry(l)})),u=Promise.all(o.map(function(l){return i.loadPBMMaterial(l,r)})),c=Promise.all([s,u]).then(function(l){for(var h=l[0],p=l[1],v=[],m=0;m<o.length;m++){var A=o[m],y=h[m],f=p[m];y.attributes.normal===void 0&&(f.flatShading=!0),y.attributes.tangent===void 0&&f.normalScale&&(f.normalScale.y*=-1);var g=A.mode||Re.TRIANGLES,b=void 0;if(g===Re.TRIANGLES||g===Re.TRIANGLE_STRIP||g===Re.TRIANGLE_FAN)g===Re.TRIANGLE_STRIP?y=r.toGeometryTrianglesDrawMode(y,d.TriangleStripDrawMode):g===Re.TRIANGLE_FAN&&(y=r.toGeometryTrianglesDrawMode(y,d.TriangleFanDrawMode)),y=y.clone(),y.clearGroups(),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,0),y.attributes.normal||y.computeVertexNormals(),b=new _t(y,[f]);else if(g===Re.POINTS)b=new Lr(y,f);else throw new Error("glTF: Primitive mode unsupported: "+g);b.name=r.createUniqueName(a.name||"mesh_"+e),v.push(b)}if(v.length===1)return v[0];for(var w=new d.Group,E=0,x=v;E<x.length;E++){var b=x[E];w.add(b)}return w});return c},t.prototype.loadPBMMaterial=function(e,r){var i=e.mode,a=null;if(i===Re.TRIANGLES||i===Re.TRIANGLE_STRIP||i===Re.TRIANGLE_FAN)a=this.loadPBMMeshMaterial(e,r);else if(i===Re.POINTS)a=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+i);return a},t.prototype.loadPBMPointCloudMaterial=function(e,r){return Object.keys(e.attributes).filter(function(i){return Rt[i]==="normal"}).length>0?Promise.resolve(Ka):Promise.resolve(Pu)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],a=new Vn;if(a.uniforms.diffuse.value=new d.Color(1,1,1),a.uniforms.exposure.value=3.3,a.defines.USE_MAP=!1,Object.keys(e.attributes).filter(function(l){return Rt[l]==="color"}).length>0&&(a.vertexColors=!0),Object.keys(e.attributes).filter(function(l){return Rt[l]==="tangent"}).length===0&&(a.normalScale&&(a.normalScale.y*=-1),a.clearcoatNormalScale&&(a.clearcoatNormalScale.y*=-1)),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 u=s.baseColorFactor;a.uniforms.diffuse.value.fromArray(u)}if(s.baseColorTexture!==void 0&&i.push(r.createMaterialTexture(s.baseColorTexture).then(function(l){a.uniforms.map.value=l,a.defines.USE_MAP=!0})),o.doubleSided===!0&&(a.side=d.DoubleSide),o.normalTexture!==void 0&&(i.push(r.createMaterialTexture(o.normalTexture).then(function(l){a.uniforms.normalMap.value=l})),a.uniforms.normalScale.value=new d.Vector2(1,1),o.normalTexture.scale!==void 0)){var c=o.normalTexture.scale;a.uniforms.normalScale.value.set(c,c)}}return Promise.all(i).then(function(){return a})},t}(br),rn={KHR_binary_glTF:nd,KHR_draco_mesh_compression:od,KHR_texture_basisu:Ad,KHR_texture_transform:md,KHR_mesh_quantization:gd,EXT_meshopt_compression:yd,EXT_texture_webp:bd,CESIUM_RTC:wd,PBM_mesh:Id};function Wa(n,t){var e,r,i,a={};if(t.addonExtensions)for(var o=0,s=t.addonExtensions;o<s.length;o++){var u=s[o];a[u]=new rn[u]}var c;if(typeof n=="string")c=n;else{var l=rn.KHR_binary_glTF.getMagic(n);if(l===rn.KHR_binary_glTF.HEADER_MAGIC){var h=new rn.KHR_binary_glTF;try{h.loadGlbBinary(n)}catch(f){return Promise.reject(f)}a.KHR_binary_glTF=h,c=h.content}else c=Ea(new Uint8Array(n))}var p=JSON.parse(c);if(p.asset===void 0||Number(p.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(p.extensionsUsed)for(var v=p.extensionsRequired||[],m=0;m<p.extensionsUsed.length;m++){var A=p.extensionsUsed[m];a[A]||(rn[A]?a[A]=new rn[A]:v.indexOf(A)>=0&&console.warn('glTF: Unknown extension "'+A+'".'))}var y=new rd(p,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 y.parse()}var Sd=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={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 Cu(e,r,i)}).then(function(i){return Tu(e,r,i)}).then(function(i){return ed(e,r,i)})}).then(function(){var r;return Wa(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(Sd);var o=new d.Matrix4().setPosition(e.rtcCenter);if(a.premultiply(o),i.CESIUM_RTC){var s=new d.Matrix4().setPosition(i.CESIUM_RTC.center);a.premultiply(s)}var u=i.scene;return u.applyMatrix4(a),{type:"b3dm",uri:e.uri,byteLength:e.byteLength,object:u,dispose:function(){return i.dispose()}}})})}function Td(n,t,e){var r=new Iu(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");if(i)return Od(i,r);var a=[Pd(r),Bd(r),Fd(r)];return Promise.all(a).then(function(o){var s=o[0],u=o[1],c=o[2];return{position:s,color:u,normal:c}})}).then(function(i){return n.attributes=i,e})}function or(n,t,e){return{type:n,array:t,size:e}}var Zi=65535;function Pd(n){if(n.hasProperty("POSITION")){var t=n.getPropertyArray("POSITION",xe.FLOAT,3);return or(xe.FLOAT,t,3)}else if(n.hasProperty("POSITION_QUANTIZED")){var e=n.getPropertyArray("POSITION_QUANTIZED",xe.UNSIGNED_SHORT,3),r=n.getGlobalProperty("QUANTIZED_VOLUME_SCALE",xe.FLOAT,3),i=n.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",xe.FLOAT,3);if(!r||!i)throw new Error("QUANTIZED_VOLUME_SCALE or QUANTIZED_VOLUME_OFFSET never found.");for(var a=new Float32Array(e.length),o=e.length/3,s=r[0]/Zi,u=r[1]/Zi,c=r[2]/Zi,l=i[0],h=i[1],p=i[2],v=0,m=void 0;v<o;v++)m=v*3,a[m]=e[m]*s+l,a[++m]=e[m]*u+h,a[++m]=e[m]*c+p;return or(xe.FLOAT,a,3)}return null}function Bd(n){if(n.hasProperty("RGB")){var t=n.getPropertyArray("RGB",xe.UNSIGNED_BYTE,3);return or(xe.UNSIGNED_BYTE,t,3)}else if(n.hasProperty("RGBA")){for(var t=n.getPropertyArray("RGBA",xe.UNSIGNED_BYTE,4),e=t.length,r=new Uint8Array(e*3),i=0,a=void 0,o=void 0;i<e;i++)a=i*3,o=i*4,r[a]=t[o],r[++a]=t[++o],r[++a]=t[++o];return or(xe.UNSIGNED_BYTE,t,4)}else if(n.hasProperty("RGB565")){for(var t=n.getPropertyArray("RGB565",xe.UNSIGNED_SHORT,1),e=t.length,r=new Uint8Array(e*3),i=0,s=void 0,u=void 0;i<e;i++)u=t[i],s=i*3,r[s]=(u>>11&31)<<3,r[++s]=(u>>5&63)<<2,r[++s]=(u&31)<<3;return or(xe.UNSIGNED_BYTE,r,3)}return null}var Rd=255,es=2/Rd;function Fd(n){if(n.hasProperty("NORMAL")){var t=n.getPropertyArray("NORMAL",xe.FLOAT,3);return or(xe.FLOAT,t,3)}else if(n.hasProperty("NORMAL_OCT16P")){for(var t=n.getPropertyArray("NORMAL_OCT16P",xe.UNSIGNED_BYTE,2),e=t.length/2,r=new Float32Array(e*3),i=0,a=void 0,o=void 0,s=void 0,u=void 0,c=void 0,l=void 0,h=void 0;i<e;i++)a=i*2,o=t[a]*es-1,s=t[++a]*es-1,c=o<0?-o:o,l=s<0?-s:s,u=1-(c+l),u<0&&(o=(1-l)*(o<0?-1:1),s=(1-c)*(s<0?-1:1)),h=Math.sqrt(o*o+s*s+u*u),a=i*3,r[a]=o/h,r[++a]=s/h,r[++a]=u/h;return or(xe.FLOAT,r,3)}return null}function Od(n,t){return Mi(this,void 0,void 0,function(){var e,r,i,a,o,s;return Ci(this,function(u){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"},[2,mi.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(c){var l=c.getAttribute("POSITION"),h=c.getAttribute("RGB"),p=c.getAttribute("NORMAL");return{position:l?or(xe.FLOAT,l.array,l.itemSize):null,color:h?or(xe.UNSIGNED_BYTE,h.array,h.itemSize):null,normal:p?or(xe.FLOAT,p.array,p.itemSize):null}})]})})}function Ru(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 Cu(e,r,i)}).then(function(i){return Tu(e,r,i)}).then(function(i){return Td(e,r,i)})}).then(function(){var r;return kd(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);return i.premultiply(a),r.object.applyMatrix4(i),{type:"pnts",uri:e.uri,byteLength:e.byteLength,object:r.object,dispose:function(){return r.dispose()}}})}function kd(n,t){var e=new Set,r=new d.BufferGeometry;e.add(r);var i=new Ga;e.add(i),n.position&&r.setAttribute("position",new d.BufferAttribute(n.position.array,n.position.size,!1)),n.color&&r.setAttribute("color",new d.BufferAttribute(n.color.array,n.color.size,!0)),n.normal&&(r.setAttribute("normal",new d.BufferAttribute(n.normal.array,n.normal.size,!1)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var a=new Lr(r,i);return a.matrix.compose(a.position,a.quaternion,a.scale),a.matrixAutoUpdate=!1,a.frustumCulled=!1,a.renderOrder=-1e3,Promise.resolve({object:a,dispose:function(){e.forEach(function(o){o.dispose()}),e.clear()}})}function Fu(){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,u;s<i;++s)u=r.decodeBit(t,e+a),a=a<<1|u,o|=u<<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,u=0,c=0,l=0,h,p,v,m,A,y;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||c<r;)if(h=c&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+h)===0)p=this._literalDecoder.getDecoder(c++,l),i>=7?l=p.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):l=p.decodeNormal(this._rangeDecoder),this._outWindow.putByte(l),i=i<4?0:i-(i<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,i)===1)v=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,i)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(i<<4)+h)===0&&(i=i<7?9:11,v=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?m=o:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?m=s:(m=u,u=s),s=o),o=a,a=m),v===0&&(v=2+this._repLenDecoder.decode(this._rangeDecoder,h),i=i<7?8:11);else if(u=s,s=o,o=a,v=2+this._lenDecoder.decode(this._rangeDecoder,h),i=i<7?7:10,A=this._posSlotDecoder[v<=5?v-2:3].decode(this._rangeDecoder),A>=4){if(y=(A>>1)-1,a=(2|A&1)<<y,A<14)a+=n.reverseDecode2(this._posDecoders,a-A-1,this._rangeDecoder,y);else if(a+=this._rangeDecoder.decodeDirectBits(y-4)<<4,a+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),a<0){if(a===-1)break;return!1}}else a=A;if(a>=c||a>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(a,v),c+=v,l=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 Ld=Fu();function Dd(){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,u,c=0,l,h,p,v;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var m=new ArrayBuffer(o),A=new Uint8Array(m);for(u=0;u<s;u+=4)l=i[e.charCodeAt(u)],h=i[e.charCodeAt(u+1)],p=i[e.charCodeAt(u+2)],v=i[e.charCodeAt(u+3)],A[c++]=l<<2|h>>4,A[c++]=(h&15)<<4|p>>2,A[c++]=(p&3)<<6|v&63;return m}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///wNLBEBBAEHAAEE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hAgNAIAJBBEkEQCACIAEoAiQoAgAiAygCAEECdkkEfyACQQJ0IANqKAIIBQALKAIAQQEkBBAYGiACQQFqIQIMAQsLIAEoAigoAgBBASQEEBgaIAEoAixBASQEEBgaIAAoAjBBASQEEBgaIAAoAjRBASQEEBgaIAAoAjhBASQEEBgaIAAoAjxBASQEEBgaIAAoAkBBASQEEBgaIAAoAkRBASQEEBgaIAAoAkgQGSAAKAJMEBkLyAwBA38DQCABQQNxIAIgAhsEQCAAIgRBAWohACABIgNBAWohASAEIAMtAAA6AAAgAkEBayECDAELCyAAQQNxRQRAA0AgAkEQTwRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAEEIaiABQQhqKAIANgIAIABBDGogAUEMaigCADYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsgAkEIcQRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAUEIaiEBIABBCGohAAsgAkEEcQRAIAAgASgCADYCACABQQRqIQEgAEEEaiEACyACQQJxBEAgACABLwEAOwEAIAFBAmohASAAQQJqIQALIAJBAXEEQCAAIAEtAAA6AAALDwsgAkEgTwRAAkACQAJAIABBA3EiA0EBRwRAIANBAkYNASADQQNGDQIMAwsgASgCACEFIAAgASIDLQAAOgAAIABBAWoiASABIANBAWoiAS0AADoAAEEBaiIEQQFqIQAgAUEBaiIDQQFqIQEgBCADLQAAOgAAIAJBA2shAgNAIAJBEU8EQCAAIAFBAWooAgAiA0EIdCAFQRh2cjYCACAAQQRqIAFBBWooAgAiBUEIdCADQRh2cjYCACAAQQhqIAFBCWooAgAiA0EIdCAFQRh2cjYCACAAQQxqIAFBDWooAgAiBUEIdCADQRh2cjYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsMAgsgASgCACEFIAAgAS0AADoAACAAQQFqIgRBAWohACABQQFqIgNBAWohASAEIAMtAAA6AAAgAkECayECA0AgAkESTwRAIAAgAUECaigCACIDQRB0IAVBEHZyNgIAIABBBGogAUEGaigCACIFQRB0IANB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sgAigCBCACKAIAQQFqaiADQf8BcUEJcCIHOgAIIAIoAgQgAigCAGogA0H/AXFBCW4iAzoACCADQQVwIQUgAigCBCACKAIAQQJqaiADQQVuIgM6AAggAigCBCACKAIAQQNqaiAFOgAIIAQgBzYCDCAEIAM2AhAgBCAFOgAUIARBADYCHEEAIQIDQAJAIAJBBE8NACAEIAQoAhwgBigCBCAGKAIAIAJBAWpqai0ACCACQQN0dHI2AhwgAkEBaiECDAELCyAEIAQoAhw2AhggBCgCGEGAIEkEQCAEQYAgNgIYC0EAIQJBACEFQQAhAwNAAkAgA0EITg0AIAYgA0EFahARQf8BcSIEQf8BRwRAQQEhBQsgBCADQQN0dCACciECIANBAWohAwwBCwsgACgCACAFRToAACAAKAIAKAIEIAE2AgAgACgCABAWAkAgACgCACAFIAIQICIBQQFGDQAgAUEDRwRAIAFBAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function Nd(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(u){var c=Math.floor(this.offset/i);this.data[c]||(this.data[c]=new Uint8Array(i)),this.data[c][this.offset%i]=u,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(u){e(u)}}function Qd(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,u=s.newU8Array(t.length),c=new Uint8Array(i.buffer,u+r,t.length);c.set(t);var l=s.decode(u),h=new Uint32Array(i.buffer,l,4),p=h[0],v=h[2],m=h[3];p?e(null,new Uint8Array(i.buffer,m+r,v).slice(0,v)):e(new Error("lzma deocder error"))}catch(A){e(A)}}var Vd=`
|
|
883
|
+
`,Xo="KHR_texture_basisu",hd=function(n){de(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[Xo])return null;var a=i.extensions[Xo],o=r.json.images[a.source],s=null;if(o.bufferView)s=r.loadBufferView(o.bufferView).then(function(u){return Fn.parse(u)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(u){return Fn.parse(u.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(br),Yo="KHR_texture_transform",pd=function(n){de(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[Yo]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+Yo+'" 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}(br),vd=function(n){de(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(br),Xi=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(f){a=f.instance,a.exports.__wasm_call_ctors()});function s(f){for(var g=new Uint8Array(f.length),b=0;b<f.length;++b){var w=f.charCodeAt(b);g[b]=w>96?w-97:w>64?w-39:w+4}for(var E=0,b=0;b<f.length;++b)g[E++]=g[b]<60?r[g[b]]:(g[b]-60)*64+g[++b];return g.buffer.slice(0,E)}function u(f,g,b,w,E,x){var M=a.exports.sbrk,C=b+3&-4,I=M(C*w),P=M(E.length),S=new Uint8Array(a.exports.memory.buffer);S.set(E,P);var F=f(I,b,w,P,E.length);if(F==0&&x&&x(I,C,w),g.set(S.subarray(I,I+b*w)),M(I-M(0)),F!=0)throw new Error("Malformed buffer data: "+F)}var c={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],p=0;function v(f){var g={object:new Worker(f),pending:0,requests:{}};return g.object.onmessage=function(b){var w=b.data;g.pending-=w.count,g.requests[w.id][w.action](w.value),delete g.requests[w.id]},g}function m(f){for(var g="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;"+u.toString()+y.toString(),b=new Blob([g],{type:"text/javascript"}),w=URL.createObjectURL(b),E=0;E<f;++E)h[E]=v(w);URL.revokeObjectURL(w)}function A(f,g,b,w,E){for(var x=h[0],M=1;M<h.length;++M)h[M].pending<x.pending&&(x=h[M]);return new Promise(function(C,I){var P=new Uint8Array(b),S=p++;x.pending+=f,x.requests[S]={resolve:C,reject:I},x.object.postMessage({id:S,count:f,size:g,source:P,mode:w,filter:E},[P.buffer])})}function y(f){o.then(function(){var g=f.data;try{var b=new Uint8Array(g.count*g.size);u(a.exports[g.mode],b,g.count,g.size,g.source,a.exports[g.filter]),self.postMessage({id:g.id,count:g.count,action:"resolve",value:b},[b.buffer])}catch(w){self.postMessage({id:g.id,count:g.count,action:"reject",value:w})}})}return{ready:o,supported:!0,useWorkers:function(f){m(f)},decodeVertexBuffer:function(f,g,b,w,E){u(a.exports.meshopt_decodeVertexBuffer,f,g,b,w,a.exports[c[E]])},decodeIndexBuffer:function(f,g,b,w){u(a.exports.meshopt_decodeIndexBuffer,f,g,b,w)},decodeIndexSequence:function(f,g,b,w){u(a.exports.meshopt_decodeIndexSequence,f,g,b,w)},decodeGltfBuffer:function(f,g,b,w,E,x){u(a.exports[l[E]],f,g,b,w,a.exports[c[x]])},decodeGltfBufferAsync:function(f,g,b,w,E){return h.length>0?A(f,g,b,l[w],c[E]):o.then(function(){var x=new Uint8Array(f*g);return u(a.exports[l[w]],x,f,g,b,a.exports[c[E]]),x})}}}(),Yi="EXT_meshopt_compression",Ad=function(n){de(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[Yi]){var o=a.extensions[Yi],s=r.loadBuffer(o.buffer);if(!Xi.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(Yi)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,Xi.ready]).then(function(u){var c=u[0],l=o.byteOffset||0,h=o.byteLength||0,p=o.count,v=o.byteStride,m=new ArrayBuffer(p*v),A=new Uint8Array(c,l,h);return Xi.decodeGltfBuffer(new Uint8Array(m),p,v,A,o.mode,o.filter),m})}else return null},t}(br),Jo="EXT_texture_webp",md=function(n){de(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 eu().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[Jo]||!this.supportsWep)return null;var o=a.extensions[Jo];return r.loadImage(o.source).then(function(s){var u=new d.Texture(s);u.needsUpdate=!0,u.flipY=!1,a.name&&(u.name=a.name);var c=r.json.samplers||{},l=c[a.sampler]||{};return u.magFilter=vi[l.magFilter]||d.LinearFilter,u.minFilter=vi[l.minFilter]||d.LinearMipmapLinearFilter,u.wrapS=Ai[l.wrapS]||d.RepeatWrapping,u.wrapT=Ai[l.wrapT]||d.RepeatWrapping,u})},t}(br),Ji="CESIUM_RTC",gd=function(n){de(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[Ji]&&r.json.extensions[Ji].center){var i=r.json.extensions[Ji].center;e.CESIUM_RTC={center:new d.Vector3().fromArray(i)}}},t}(br);const 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)}("{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-u|{Sy||V{qr\x07H0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6--n\bv{t-sy|n-Sy||H0ryr--{vs|z-sy|n-sy||H0r{qvsn\bv{t-rpA-|yq]|vv|{Hn\bv{t-rp@-cvr]|vv|{Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-Y|tQr}uHn\bv{t-sy|n-]|v{`v rHp-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{qvs|vq-znv{56-\n--sy|n-ory|{tv{tSY||-J-=;=H--0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6----ory|{tv{tSY||-J-Sy||H--0ryr----ory|{tv{tSY||-J-sy||H--0r{qvs--<<前置裁切计算--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-|yq]|vv|{H------pyv}}rq-J-5pyv}}rh-v-j;sy||V{qr\x07-I-=;=-\v\v-no5ory|{tv{tSY||-:-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---<<楼层选择计算--sy|n-sy||\\}npv\b-J->;=H--vs-5u|{Sy||V{qr\x07-KJ-=;=-33-no5ory|{tv{tSY||-:-u|{Sy||V{qr\x076-KJ->;=6-\n----sy||\\}npv\b-J-=;>H--\f--rp@-sv{nyP|y|-J-P|y|H--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----0vs-qrsv{rq5b`Rl]\\V[alONPXlUVQQR[6------rp@-pnzrnQvrpv|{-J-{|znyv r5pnzrn]|vv|{-:-|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|{-:-|yq]|vv|{;\x07\b 6H------vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n--------sv{nyP|y|-J-sv{nyP|y|-7-=;DBH------\f----0r{qvs--0r{qvs--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-E;=-33-pp-K->;=6-\n------qvpnqH----\f--0r{qvs--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->;=6H--0ryr----tylSntP|y|-J-rpA5sv{nyP|y|9-z|qryNy}un-7-|}npv\b-7-sy||\\}npv\b6H--0r{qvs--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\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)}("nvor-rp@-p|y|H0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6--nvor-sy|n-sy||H--n\bv{t-sy|n-Sy||H0r{qvs{vs|z-sy|n-prr{UrvtuH{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|H0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{ar\x07rH0r{qvsn\bv{t-rpA-|yq]|vv|{Hn\bv{t-rp@-P|y|H0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsn\bv{t-sy|n-]|v{`v rHn\bv{t-rp@-cvr]|vv|{H0qrsv{r-]V-@;>A>BF?CB@BEFDF@rp@-_TOa|Yv{rn5-rp@-nyr-6-\n--r{-rp@5-zv\x075-}|5-nyr;to-7-=;FADECD?FEC-8-rp@5-=;=B?>@?D=>A-69-rp@5-?;A-6-69-nyr;to-7-=;=DD@FF@E=E9-rp@5-yraun{R\0ny5-nyr;to9-rp@5-=;=A=AB-6-6-6-66H\frp@-Yv{rna|_TO5-rp@-nyr-6-\nr{-rp@5-zv\x075-}|5-nyr;to9-rp@5-=;A>CCC-6-6-7->;=BB-:-rp@5-=;=BB-69-nyr;to-7->?;F?9-rp@5-yraun{R\0ny5-nyr;to9-rp@5-=;==@>@=E-6-6-6-66H\frp@-trP|y|O\bUrvtu5nz}yr?Q-tnqvr{ar\x07r9-rpA-|yq]|vv|{6-\n--rp@-p|y|-J-r\x07r?Q5tnqvr{ar\x07r9-rp?5|yq]|vv|{;\b-<->=;=9-=;B66;toH--r{-p|y|H\f|vq-znv{56-\n--rpA-n{s|zrq-J-rpA5}|vv|{9->;=6H--rpA-z]|vv|{-J-z|qrycvrZnv\x07-7-n{s|zrqH--|yq]|vv|{-J-z|qryZnv\x07-7-n{s|zrqH--0vs-qrsv{rq5b`RlcR_aRelSY\\\\_6----Sy||-J-sy||H--0r{qvs--cvr]|vv|{-J-:z]|vv|{;\x07\b H--tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H--<<传递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-prr{Urvtu-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-prr{Urvtu-7-rny]|v{`v r-<-urvtuH--0r{qvs--]|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--tyl]|v{`v r-J-]|v{`v rH--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-|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-prr{Urvtu-<-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|{H0r{qvs\f");var wd=new d.Vector4,Ed=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),screenHeight:new d.Uniform(512),floor:new d.Uniform(0)},d.UniformsUtils.clone(d.UniformsLib.common)),Su=function(n){de(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,c,l,h,p,v,m,A,y,f,g,b,w,E,x,M=n.call(this,{vertexShader:bd,fragmentShader:yd,uniforms:d.UniformsUtils.clone(Ed),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_FLOOR:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_PANO_VIDEO:!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,C;return Object.defineProperties(M,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(I){this.uniforms.constantColor.value=I;var P=this.defines.USE_CONSTANT_COLOR,S=I!==null;P!==S&&(this.defines.USE_CONSTANT_COLOR=S,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(I){this.uniforms.opacity.value=I}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(I){this.uniforms.modelAlpha.value=I}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(I){this.uniforms.shownFloorIndex.value=I}},clippers:{get:function(){return C},set:function(I){C!==I&&(C=I,this.uniforms.clippers.value=(C||[]).map(function(P){var S=typeof P.floorIndex=="number"?P.floorIndex:-1,F=new d.Matrix4().getInverse(P.clippingBoxMatrix);return{matrixInverse:F,floorIndex:S}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(I){var P=I==="ALTITUDE";this.defines.USE_POINT_COLOR_ALTITUDE!==P&&(this.defines.USE_POINT_COLOR_ALTITUDE=P,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(I){var P=I==="ATTENUATION",S=I==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==S&&(this.defines.USE_POINT_SIZE_GEOMETRIC=S,this.needsUpdate=!0),this.defines.USE_POINT_SIZE_ATTENUATION!==P&&(this.defines.USE_POINT_SIZE_ATTENUATION=P,this.needsUpdate=!0)}},pointShape:{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(I){var P=I==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==P&&(this.defines.USE_POINT_SHAPE_CIRCLE=P,this.needsUpdate=!0)}},pointScale:{get:function(){return this.uniforms.pointScale.value},set:function(I){this.uniforms.pointScale.value=I}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(I){var P=I==="HIDDEN",S=I==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==P&&(this.defines.USE_POINT_BACK_HIDDEN=P,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==S&&(this.defines.USE_POINT_BACK_DARK=S,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(I){this.uniforms.pointMinPixel.value=I}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(I){this.uniforms.pointMaxPixel.value=I}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(I){I!==this.defines.USE_EDL&&(this.defines.USE_EDL=I,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(I){I!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=I,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(I){I!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=I,this.needsUpdate=!0)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(I){this.uniforms.gradientTexture.value=I}},floor:{get:function(){return this.uniforms.floor.value},set:function(I){this.uniforms.floor.value=I}}}),M.pano0=(r=e.pano0)!==null&&r!==void 0?r:be.pano0,M.pano1=(i=e.pano1)!==null&&i!==void 0?i:be.pano1,M.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:be.modelAlpha,M.progress=(o=e.progress)!==null&&o!==void 0?o:be.progress,M.useBlackTransition=(s=e.useBlackTransition)!==null&&s!==void 0?s:be.useBlackTransition,M.constantColor=(u=e.constantColor)!==null&&u!==void 0?u:be.constantColor,M.opacity=(c=e.opacity)!==null&&c!==void 0?c:be.opacity,M.shownFloorIndex=(l=e.shownFloorIndex)!==null&&l!==void 0?l:be.shownFloorIndex,M.clippers=(h=e.clippers)!==null&&h!==void 0?h:be.clippers,M.useEDL=(p=e.useEDL)!==null&&p!==void 0?p:be.useEDL,M.useHQWeight=(v=e.useHQWeight)!==null&&v!==void 0?v:be.useHQWeight,M.useHQDepth=(m=e.useHQDepth)!==null&&m!==void 0?m:be.useHQDepth,M.pointColor=(A=e.pointColor)!==null&&A!==void 0?A:be.pointColor,M.pointShape=(y=e.pointShape)!==null&&y!==void 0?y:be.pointShape,M.pointSize=(f=e.pointSize)!==null&&f!==void 0?f:be.pointSize,M.pointScale=(g=e.pointScale)!==null&&g!==void 0?g:be.pointScale,M.pointBack=(b=e.pointBack)!==null&&b!==void 0?b:be.pointBack,M.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:be.pointMinPixel,M.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:be.pointMaxPixel,M.gradientTexture=(x=e.gradientTexture)!==null&&x!==void 0?x:be.gradientTexture,M.floor=0,M.transparent=!1,M}return t.prototype.onBeforeCompile=function(e,r){var i,a,o=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,o),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,o)},t.prototype.update=function(e,r){var i=r instanceof hi?r.pixelRatio:e.getPixelRatio(),a=r instanceof hi?r.screenHeight:e.getViewport(wd).z;this.uniforms.pixelRatio.value=i,this.uniforms.screenHeight.value=a,this.transparent=this.shownFloorIndex>-1||this.opacity<1||this.modelAlpha<1,this.useEDL&&(this.transparent=!1),this.useHQDepth&&(this.depthTest=!0,this.depthWrite=!0),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.depthWrite=!0,this.transparent=this.shownFloorIndex>-1||this.opacity<1||this.modelAlpha<1,this.blendDst=d.OneMinusSrcAlphaFactor,this.blendEquation=d.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blending=d.NormalBlending)},t.prototype.syncModel=function(e){var r="".concat(e.id,":").concat(e.materialVersion);r!==this.syncModelVersion&&(Object.assign(this,e.getMaterial()),this.syncModelVersion=r)},t}(d.ShaderMaterial),xd=function(n){de(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(l){return r.loadGeometry(l)})),u=Promise.all(o.map(function(l){return i.loadPBMMaterial(l,r)})),c=Promise.all([s,u]).then(function(l){for(var h=l[0],p=l[1],v=[],m=0;m<o.length;m++){var A=o[m],y=h[m],f=p[m];y.attributes.normal===void 0&&(f.flatShading=!0),y.attributes.tangent===void 0&&f.normalScale&&(f.normalScale.y*=-1);var g=A.mode||Re.TRIANGLES,b=void 0;if(g===Re.TRIANGLES||g===Re.TRIANGLE_STRIP||g===Re.TRIANGLE_FAN)g===Re.TRIANGLE_STRIP?y=r.toGeometryTrianglesDrawMode(y,d.TriangleStripDrawMode):g===Re.TRIANGLE_FAN&&(y=r.toGeometryTrianglesDrawMode(y,d.TriangleFanDrawMode)),y=y.clone(),y.clearGroups(),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,0),y.attributes.normal||y.computeVertexNormals(),b=new _t(y,[f]);else if(g===Re.POINTS)b=new Lr(y,f);else throw new Error("glTF: Primitive mode unsupported: "+g);b.name=r.createUniqueName(a.name||"mesh_"+e),v.push(b)}if(v.length===1)return v[0];for(var w=new d.Group,E=0,x=v;E<x.length;E++){var b=x[E];w.add(b)}return w});return c},t.prototype.loadPBMMaterial=function(e,r){var i=e.mode,a=null;if(i===Re.TRIANGLES||i===Re.TRIANGLE_STRIP||i===Re.TRIANGLE_FAN)a=this.loadPBMMeshMaterial(e,r);else if(i===Re.POINTS)a=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+i);return a},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 Su;return Object.keys(e.attributes).filter(function(a){return Rt[a]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],a=new Vn;if(a.uniforms.diffuse.value=new d.Color(1,1,1),a.uniforms.exposure.value=3.3,a.defines.USE_MAP=!1,Object.keys(e.attributes).filter(function(l){return Rt[l]==="color"}).length>0&&(a.vertexColors=!0),Object.keys(e.attributes).filter(function(l){return Rt[l]==="tangent"}).length===0&&(a.normalScale&&(a.normalScale.y*=-1),a.clearcoatNormalScale&&(a.clearcoatNormalScale.y*=-1)),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 u=s.baseColorFactor;a.uniforms.diffuse.value.fromArray(u)}if(s.baseColorTexture!==void 0&&i.push(r.createMaterialTexture(s.baseColorTexture).then(function(l){a.uniforms.map.value=l,a.defines.USE_MAP=!0})),o.doubleSided===!0&&(a.side=d.DoubleSide),o.normalTexture!==void 0&&(i.push(r.createMaterialTexture(o.normalTexture).then(function(l){a.uniforms.normalMap.value=l})),a.uniforms.normalScale.value=new d.Vector2(1,1),o.normalTexture.scale!==void 0)){var c=o.normalTexture.scale;a.uniforms.normalScale.value.set(c,c)}}return Promise.all(i).then(function(){return a})},t}(br),rn={KHR_binary_glTF:ed,KHR_draco_mesh_compression:nd,KHR_texture_basisu:hd,KHR_texture_transform:pd,KHR_mesh_quantization:vd,EXT_meshopt_compression:Ad,EXT_texture_webp:md,CESIUM_RTC:gd,PBM_mesh:xd};function Ga(n,t){var e,r,i,a={};if(t.addonExtensions)for(var o=0,s=t.addonExtensions;o<s.length;o++){var u=s[o];a[u]=new rn[u]}var c;if(typeof n=="string")c=n;else{var l=rn.KHR_binary_glTF.getMagic(n);if(l===rn.KHR_binary_glTF.HEADER_MAGIC){var h=new rn.KHR_binary_glTF;try{h.loadGlbBinary(n)}catch(f){return Promise.reject(f)}a.KHR_binary_glTF=h,c=h.content}else c=Ea(new Uint8Array(n))}var p=JSON.parse(c);if(p.asset===void 0||Number(p.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(p.extensionsUsed)for(var v=p.extensionsRequired||[],m=0;m<p.extensionsUsed.length;m++){var A=p.extensionsUsed[m];a[A]||(rn[A]?a[A]=new rn[A]:v.indexOf(A)>=0&&console.warn('glTF: Unknown extension "'+A+'".'))}var y=new $c(p,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 y.parse()}var Md=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Tu(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 xu(e,r,i)}).then(function(i){return Iu(e,r,i)}).then(function(i){return Jc(e,r,i)})}).then(function(){var r;return Ga(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(Md);var o=new d.Matrix4().setPosition(e.rtcCenter);if(a.premultiply(o),i.CESIUM_RTC){var s=new d.Matrix4().setPosition(i.CESIUM_RTC.center);a.premultiply(s)}var u=i.scene;return u.applyMatrix4(a),{type:"b3dm",uri:e.uri,byteLength:e.byteLength,object:u,dispose:function(){return i.dispose()}}})})}function Cd(n,t,e){var r=new Mu(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");if(i)return Bd(i,r);var a=[Id(r),Sd(r),Pd(r)];return Promise.all(a).then(function(o){var s=o[0],u=o[1],c=o[2];return{position:s,color:u,normal:c}})}).then(function(i){return n.attributes=i,e})}function or(n,t,e){return{type:n,array:t,size:e}}var Zi=65535;function Id(n){if(n.hasProperty("POSITION")){var t=n.getPropertyArray("POSITION",xe.FLOAT,3);return or(xe.FLOAT,t,3)}else if(n.hasProperty("POSITION_QUANTIZED")){var e=n.getPropertyArray("POSITION_QUANTIZED",xe.UNSIGNED_SHORT,3),r=n.getGlobalProperty("QUANTIZED_VOLUME_SCALE",xe.FLOAT,3),i=n.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",xe.FLOAT,3);if(!r||!i)throw new Error("QUANTIZED_VOLUME_SCALE or QUANTIZED_VOLUME_OFFSET never found.");for(var a=new Float32Array(e.length),o=e.length/3,s=r[0]/Zi,u=r[1]/Zi,c=r[2]/Zi,l=i[0],h=i[1],p=i[2],v=0,m=void 0;v<o;v++)m=v*3,a[m]=e[m]*s+l,a[++m]=e[m]*u+h,a[++m]=e[m]*c+p;return or(xe.FLOAT,a,3)}return null}function Sd(n){if(n.hasProperty("RGB")){var t=n.getPropertyArray("RGB",xe.UNSIGNED_BYTE,3);return or(xe.UNSIGNED_BYTE,t,3)}else if(n.hasProperty("RGBA")){for(var t=n.getPropertyArray("RGBA",xe.UNSIGNED_BYTE,4),e=t.length,r=new Uint8Array(e*3),i=0,a=void 0,o=void 0;i<e;i++)a=i*3,o=i*4,r[a]=t[o],r[++a]=t[++o],r[++a]=t[++o];return or(xe.UNSIGNED_BYTE,t,4)}else if(n.hasProperty("RGB565")){for(var t=n.getPropertyArray("RGB565",xe.UNSIGNED_SHORT,1),e=t.length,r=new Uint8Array(e*3),i=0,s=void 0,u=void 0;i<e;i++)u=t[i],s=i*3,r[s]=(u>>11&31)<<3,r[++s]=(u>>5&63)<<2,r[++s]=(u&31)<<3;return or(xe.UNSIGNED_BYTE,r,3)}return null}var Td=255,Zo=2/Td;function Pd(n){if(n.hasProperty("NORMAL")){var t=n.getPropertyArray("NORMAL",xe.FLOAT,3);return or(xe.FLOAT,t,3)}else if(n.hasProperty("NORMAL_OCT16P")){for(var t=n.getPropertyArray("NORMAL_OCT16P",xe.UNSIGNED_BYTE,2),e=t.length/2,r=new Float32Array(e*3),i=0,a=void 0,o=void 0,s=void 0,u=void 0,c=void 0,l=void 0,h=void 0;i<e;i++)a=i*2,o=t[a]*Zo-1,s=t[++a]*Zo-1,c=o<0?-o:o,l=s<0?-s:s,u=1-(c+l),u<0&&(o=(1-l)*(o<0?-1:1),s=(1-c)*(s<0?-1:1)),h=Math.sqrt(o*o+s*s+u*u),a=i*3,r[a]=o/h,r[++a]=s/h,r[++a]=u/h;return or(xe.FLOAT,r,3)}return null}function Bd(n,t){return Mi(this,void 0,void 0,function(){var e,r,i,a,o,s;return Ci(this,function(u){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"},[2,mi.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(c){var l=c.getAttribute("POSITION"),h=c.getAttribute("RGB"),p=c.getAttribute("NORMAL");return{position:l?or(xe.FLOAT,l.array,l.itemSize):null,color:h?or(xe.UNSIGNED_BYTE,h.array,h.itemSize):null,normal:p?or(xe.FLOAT,p.array,p.itemSize):null}})]})})}function Pu(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 xu(e,r,i)}).then(function(i){return Iu(e,r,i)}).then(function(i){return Cd(e,r,i)})}).then(function(){var r;return Rd(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);return i.premultiply(a),r.object.applyMatrix4(i),{type:"pnts",uri:e.uri,byteLength:e.byteLength,object:r.object,dispose:function(){return r.dispose()}}})}function Rd(n,t){var e=new Set,r=new d.BufferGeometry;e.add(r);var i=new Su;e.add(i),n.position&&r.setAttribute("position",new d.BufferAttribute(n.position.array,n.position.size,!1)),n.color&&r.setAttribute("color",new d.BufferAttribute(n.color.array,n.color.size,!0)),n.normal&&(r.setAttribute("normal",new d.BufferAttribute(n.normal.array,n.normal.size,!1)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var a=new Lr(r,i);return a.matrix.compose(a.position,a.quaternion,a.scale),a.matrixAutoUpdate=!1,a.frustumCulled=!1,a.renderOrder=-1e3,Promise.resolve({object:a,dispose:function(){e.forEach(function(o){o.dispose()}),e.clear()}})}function Bu(){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,u;s<i;++s)u=r.decodeBit(t,e+a),a=a<<1|u,o|=u<<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,u=0,c=0,l=0,h,p,v,m,A,y;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||c<r;)if(h=c&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+h)===0)p=this._literalDecoder.getDecoder(c++,l),i>=7?l=p.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):l=p.decodeNormal(this._rangeDecoder),this._outWindow.putByte(l),i=i<4?0:i-(i<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,i)===1)v=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,i)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(i<<4)+h)===0&&(i=i<7?9:11,v=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?m=o:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?m=s:(m=u,u=s),s=o),o=a,a=m),v===0&&(v=2+this._repLenDecoder.decode(this._rangeDecoder,h),i=i<7?8:11);else if(u=s,s=o,o=a,v=2+this._lenDecoder.decode(this._rangeDecoder,h),i=i<7?7:10,A=this._posSlotDecoder[v<=5?v-2:3].decode(this._rangeDecoder),A>=4){if(y=(A>>1)-1,a=(2|A&1)<<y,A<14)a+=n.reverseDecode2(this._posDecoders,a-A-1,this._rangeDecoder,y);else if(a+=this._rangeDecoder.decodeDirectBits(y-4)<<4,a+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),a<0){if(a===-1)break;return!1}}else a=A;if(a>=c||a>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(a,v),c+=v,l=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 Fd=Bu();function Od(){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,u,c=0,l,h,p,v;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var m=new ArrayBuffer(o),A=new Uint8Array(m);for(u=0;u<s;u+=4)l=i[e.charCodeAt(u)],h=i[e.charCodeAt(u+1)],p=i[e.charCodeAt(u+2)],v=i[e.charCodeAt(u+3)],A[c++]=l<<2|h>>4,A[c++]=(h&15)<<4|p>>2,A[c++]=(p&3)<<6|v&63;return m}var t="AGFzbQEAAAABSg1gAABgAX8Bf2ACf38Bf2AEf39/fwBgA39/fwBgAX8AYAJ/fwBgA39/fwF/YAR/f39/AX9gAn9/AGABfwF/YAABf2AEf39/fwF/AhsCA2VudgVhYm9ydAADA2VudgZtZW1vcnkCAAEDJiUBAQkKAgoKCwsLCwsAAgoBAgQKAQYFCAoFBQQEBwgCBwwCAQAABAQBcAABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwc9BgZtZW1vcnkCAAV0YWJsZQEABXJlc2V0AA0KbmV3VThBcnJheQAQCnVucGFja1NpemUAFAZkZWNvZGUAIwgBJAkHAQBBAAsBJQqAViVoAQN/IABBgICAgARLBEAACyMBIgEgAEEBIABBAUsbakEHakF4cSICPwAiA0EQdEsEQCADIAIgAWtB//8DakGAgHxxQRB2IgAgAyAAShtAAEEASARAIABAAEEASARAAAsLCyACJAEgAQsbAQF/QQFBICAAQQdqZ2t0EAEiASAANgIAIAELkQMBAX8gAUUEQA8LIABBADoAACAAIAFqQQFrQQA6AAAgAUECTQRADwsgAEEBakEAOgAAIABBAmpBADoAACAAIAFqIgJBAmtBADoAACACQQNrQQA6AAAgAUEGTQRADwsgAEEDakEAOgAAIAAgAWpBBGtBADoAACABQQhNBEAPC0EAIABrQQNxIgIgAGoiAEEANgIAIAEgAmtBfHEiASAAakEEa0EANgIAIAFBCE0EQA8LIABBBGpBADYCACAAQQhqQQA2AgAgACABaiICQQxrQQA2AgAgAkEIa0EANgIAIAFBGE0EQA8LIABBDGpBADYCACAAQRBqQQA2AgAgAEEUakEANgIAIABBGGpBADYCACAAIAFqIgJBHGtBADYCACACQRhrQQA2AgAgAkEUa0EANgIAIAJBEGtBADYCACAAQQRxQRhqIgIgAGohACABIAJrIQEDQCABQSBPBEAgAEIANwMAIABBCGpCADcDACAAQRBqQgA3AwAgAEEYakIANwMAIAFBIGshASAAQSBqIQAMAQsLC1EBA38gAEH+////AEsEQEEAQSBBLUEnEAAACyAAQQJ0IgMQAiECQQgQASIBQQA2AgAgAUEANgIEIAEgAjYCACABIAA2AgQgAkEIaiADEAMgAQtmAQF/IAFB/P///wFLBEBBAEHAAEEXQSIQAAALIAFBAXQiARACIgJBCGogARADIABFBEBBDBABIQALIABBADYCACAAQQA2AgQgAEEANgIIIAAgAjYCACAAQQA2AgQgACABNgIIIAALCgBBDBABIAAQBQsuAQF/QQgQASIBQQA2AgAgAUEANgIEIAEgADYCBCABQQEgASgCBHQQBjYCACABC6EBAQR/QRAQASIBQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgxBEBAEIQIDQCAAQRBIBEBBAxAHIQMgAigCACAAQQJ0aiADNgIIIABBAWohAAwBCwsgASACNgIEQRAQBCECQQAhAANAIABBEEgEQEEDEAchAyACKAIAIABBAnRqIAM2AgggAEEBaiEADAELCyAB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AgACgCACAFIAIQICIBQQFGDQAgAUEDRwRAIAFBAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function kd(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(u){var c=Math.floor(this.offset/i);this.data[c]||(this.data[c]=new Uint8Array(i)),this.data[c][this.offset%i]=u,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(u){e(u)}}function Ld(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,u=s.newU8Array(t.length),c=new Uint8Array(i.buffer,u+r,t.length);c.set(t);var l=s.decode(u),h=new Uint32Array(i.buffer,l,4),p=h[0],v=h[2],m=h[3];p?e(null,new Uint8Array(i.buffer,m+r,v).slice(0,v)):e(new Error("lzma deocder error"))}catch(A){e(A)}}var Dd=`
|
|
884
884
|
var decodeLZMA = (function() {
|
|
885
|
-
var LZMA = (`.concat(
|
|
885
|
+
var LZMA = (`.concat(Bu.toString(),`)();
|
|
886
886
|
return function(data, callback) {
|
|
887
|
-
return (`).concat(
|
|
887
|
+
return (`).concat(kd.toString(),`)(LZMA, data, callback);
|
|
888
888
|
}
|
|
889
889
|
})();
|
|
890
890
|
|
|
891
891
|
var decodeLZMAWithWASM = (function() {
|
|
892
|
-
var LZMA_WASM = (`).concat(
|
|
892
|
+
var LZMA_WASM = (`).concat(Od.toString(),`)();
|
|
893
893
|
return function(data, callback) {
|
|
894
|
-
return (`).concat(
|
|
894
|
+
return (`).concat(Ld.toString(),`)(LZMA_WASM, data, callback);
|
|
895
895
|
}
|
|
896
896
|
})();
|
|
897
897
|
|
|
@@ -925,7 +925,7 @@ self.onmessage = function(event) {
|
|
|
925
925
|
}
|
|
926
926
|
postMessage({ id: packet.id, error: "type never matched." });
|
|
927
927
|
};
|
|
928
|
-
`),xa=typeof Worker<"u"&&typeof Blob<"u",
|
|
928
|
+
`),xa=typeof Worker<"u"&&typeof Blob<"u",Ru="";if(xa)try{var Nd=new Blob([Dd],{type:"text/javascript"});Ru=URL.createObjectURL(Nd)}catch{}var Fu=function(){function n(){var t=this;if(!xa)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(Ru);e.onmessage=function(r){var i=r.data,a=i.id,o=i.result,s=i.error,u=t.getKey(a);t.requests[u]&&(s?t.requests[u](new Error(s)):t.requests[u](null,o),delete t.requests[u])},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=xa,n}();function $o(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function Qd(n){for(var t=[],e=n.length,r=function(o){var s={data:n[o],offset:0,readByte:function(){return this.data[this.offset++]}},u=s.data.length,c={data:[],offset:0,writeByte:function(h){var p=Math.floor(this.offset/u);this.data[p]||(this.data[p]=new Uint8Array(u)),this.data[p][this.offset%u]=h,this.offset++}};Fd.decompressFile(s,c),i=new Uint8Array(c.offset);for(var l=0;l<c.offset;l++)i[l]=c.data[Math.floor(l/u)][l%u];t.push(i)},i,a=0;a<e;a++)r(a);return t}function Vd(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var u=new Fu;u.decompress(n[a],function(c,l){if(u.terminate(),c)return s(c);o(l)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function Ou(n){var t=new Uint8Array(n),e=$o(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]=$o(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 Fu.support?Vd(r):Promise.resolve(Qd(r))}var $i=!1,ku=[];function Lu(n){if(n===void 0&&(n=!1),!(!n&&$i)){$i=!0;var t=ku.shift();if(t){try{t()}catch{}it.shared.add(function(){return Lu(!0)},!0,2,-100)}else $i=!1}}function gi(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};ku.push(r),it.shared.add(function(){return Lu()},!0,2,-100)})}function sr(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 Ud(n,t){for(var e=R({},n),r=0,i=t;r<i.length;r++){var a=i[r];a in e&&delete e[a]}return e}function En(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+=En(n[a],!1)+",";return i>-1&&(r+=En(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return En(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],c=En(n[u],!0);c!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+c),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 fn(n){return"hash::".concat(En(n,!1))}var qd=new d.WebGLRenderTarget(1,1),Ma=new d.OrthographicCamera(-1,1,1,-1,0,1);Ma.matrixAutoUpdate=!1;var Du=new d.BufferGeometry;Du.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));var yi=new d.Mesh(Du);yi.matrixAutoUpdate=!1;var bi=new d.Scene;bi.add(yi);bi.matrixAutoUpdate=!1;var es=new d.RawShaderMaterial({uniforms:{map:{value:null}},vertexShader:`
|
|
929
929
|
void main() {
|
|
930
930
|
gl_Position = vec4(0, 0, 0, 0);
|
|
931
931
|
}
|
|
@@ -943,17 +943,17 @@ self.onmessage = function(event) {
|
|
|
943
943
|
void main() {
|
|
944
944
|
gl_FragColor = textureCube(map, vec3(0, 0, 0));
|
|
945
945
|
}
|
|
946
|
-
`,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1}),ns=Promise.resolve();function _d(n,t){if(!t)return Promise.resolve(n);var e=t.getRenderTarget();t.setRenderTarget(jd),n instanceof d.CubeTexture?(yi.material=Wn,Wn.uniforms.map.value=n,t.render(bi,Ma),Wn.uniforms.map.value=null):(yi.material=rs,rs.uniforms.map.value=n,t.render(bi,Ma),Wn.uniforms.map.value=null),t.setRenderTarget(e);var r=ns.then(function(){return new Promise(function(i){it.shared.add(function(){i(n)},!0)})});return ns=r.catch(function(){}),r}const Dr=Or.Reader,Zt=Or.util,Ht=Or.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(Or.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Vu=Ht.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=Zt.emptyArray,n.prototype.createAt=Zt.Long?Zt.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof Dr||(e=Dr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Ht.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})();Ht.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 Dr||(e=Dr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=Ht.Vertices.decode(e,e.uint32());break}case 2:{a.faces=Ht.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 Zt.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw Zt.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw Zt.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Ht.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=Zt.emptyArray,n.prototype.uvs=Zt.emptyArray,n.prototype.marks=Zt.emptyArray,n.decode=function(e,r){e instanceof Dr||(e=Dr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.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})();Ht.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=Zt.emptyArray,n.prototype.normals=Zt.emptyArray,n.decode=function(e,r){e instanceof Dr||(e=Dr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.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})();Ht.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function Uu(n,t){var e,r,i,a={byteLength:0},o=Ya((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 u=0,c=t.textureArray;u<c.length;u++){var l=c[u];s[l]=Xa(l,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(h){return a.byteLength=h.body.byteLength,gi(function(){var p=new Uint8Array(h.body);return Vu.decode(p)})}).then(function(h){return gi(function(){var p,v;return zu(h,(p=t.textureBaseUri)!==null&&p!==void 0?p:function(){var m=n.lastIndexOf("/");if(m>=0){var A=n.slice(0,m)+"/";return/\/model\/$/.test(A)&&(A=A.replace(/\/model\/$/,"/materials/")),A}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),o,s,t.fetcher)})}).then(function(h){var p=new d.Group;p.renderOrder=-4,p.matrixAutoUpdate=!1,p.matrix.compose(p.position,p.quaternion,p.scale),p.name=n;for(var v=0,m=h.objects;v<m.length;v++){var A=m[v];p.add(A)}return h.texturePromise.then(function(){return{type:"pbm",uri:n,byteLength:a.byteLength,object:p,dispose:function(){return h.dispose()}}})})}var Gd=new d.Matrix4().set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),pe=Gd.elements;function qu(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function Ca(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function Kd(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function is(n){var t=qu(n.name),e=Ca(n.name),r=Kd(n.name);return t*1e6+e*1e3+r}function Wd(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,u=!0,c=0,l=n.chunks;c<l.length;c++){var h=l[c];if(!h.vertices.marks||h.vertices.marks.length===0){u=!1;break}}for(var p=0,v=n.chunks;p<v.length;p++){var h=v[p];if(!h.faces.normals||h.faces.normals.length===0){s=!1;break}}for(var m=n.chunks.sort(function(wt,Tt){return is(wt)-is(Tt)}),A=[],y=0,f=m;y<f.length;y++){var h=f[y],g=qu(h.name);A[g]||(A[g]=[]),A[g].push(h)}for(var b=0;b<A.length;b++){var w=A[b];if(w)if(s){for(var E=0,x=0;x<w.length;x++){var h=w[x];E+=h.faces.indices.length}for(var M=new Float32Array(E*3),C=new Float32Array(E),I=new Float32Array(E*2),P=new Float32Array(E*3),S=[],F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],k=0,O=0;O<w.length;O++){for(var L=[1/0,1/0,1/0,-1/0,-1/0,-1/0],h=w[O],N=h.vertices.xyz,V=h.vertices.uvs,j=h.faces.indices,z=h.faces.normals,U=h.vertices.marks,X=j.length,x=0;x<X;x++){var G=j[x],K=N[G*3],Y=N[G*3+1],H=N[G*3+2],J=1/(pe[3]*K+pe[7]*Y+pe[11]*H+pe[15]),ne=(pe[0]*K+pe[4]*Y+pe[8]*H+pe[12])*J,$=(pe[1]*K+pe[5]*Y+pe[9]*H+pe[13])*J,te=(pe[2]*K+pe[6]*Y+pe[10]*H+pe[14])*J;M[k*3+x*3]=ne,M[k*3+x*3+1]=$,M[k*3+x*3+2]=te,C[k+x]=u?U[G]:0,I[k*2+x*2]=V[G*2],I[k*2+x*2+1]=V[G*2+1];var ae=Math.floor(x/3)*3,ce=z[ae],oe=z[ae+1],fe=z[ae+2],Ie=1/(pe[3]*ce+pe[7]*oe+pe[11]*fe+pe[15]),Ae=(pe[0]*ce+pe[4]*oe+pe[8]*fe+pe[12])*Ie,Fe=(pe[1]*ce+pe[5]*oe+pe[9]*fe+pe[13])*Ie,re=(pe[2]*ce+pe[6]*oe+pe[10]*fe+pe[14])*Ie;P[k*3+x*3]=Ae,P[k*3+x*3+1]=Fe,P[k*3+x*3+2]=re,ne<L[0]&&(L[0]=ne),$<L[1]&&(L[1]=$),te<L[2]&&(L[2]=te),ne>L[3]&&(L[3]=ne),$>L[4]&&(L[4]=$),te>L[5]&&(L[5]=te)}L[0]<F[0]&&(F[0]=L[0]),L[1]<F[1]&&(F[1]=L[1]),L[2]<F[2]&&(F[2]=L[2]),L[3]>F[3]&&(F[3]=L[3]),L[4]>F[4]&&(F[4]=L[4]),L[5]>F[5]&&(F[5]=L[5]),S.push({materialIndex:O,name:h.name,chunkName:Ca(h.name),start:k,count:h.faces.indices.length,texture:(e=h.texture)!==null&&e!==void 0?e:void 0}),k+=X}var he={createAt:i,description:a,vertices:M,uvs:I,normals:P,indices:null,floorIndex:b,groups:S,extents:F,vertexMarks:C};o.push(he)}else{for(var E=0,W=0,x=0;x<w.length;x++){var h=w[x];W+=h.vertices.xyz.length/3,E+=h.faces.indices.length}for(var M=new Float32Array(W*3),I=new Float32Array(W*2),P=new Float32Array(W*3),Oe=new Float32Array(W),ke=new Uint32Array(E),C=new Float32Array(E),S=[],F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],Je=0,k=0,O=0;O<w.length;O++){for(var L=[1/0,1/0,1/0,-1/0,-1/0,-1/0],h=w[O],N=h.vertices.xyz,U=h.vertices.marks,V=h.vertices.uvs,j=h.faces.indices,Ze=N.length/3,X=j.length,x=0;x<Ze;x++){var K=N[x*3],Y=N[x*3+1],H=N[x*3+2],J=1/(pe[3]*K+pe[7]*Y+pe[11]*H+pe[15]),ne=(pe[0]*K+pe[4]*Y+pe[8]*H+pe[12])*J,$=(pe[1]*K+pe[5]*Y+pe[9]*H+pe[13])*J,te=(pe[2]*K+pe[6]*Y+pe[10]*H+pe[14])*J;M[k*3+x*3]=ne,M[k*3+x*3+1]=$,M[k*3+x*3+2]=te,C[k+x]=u?U[x]:0,I[k*2+x*2]=V[x*2],I[k*2+x*2+1]=V[x*2+1],Oe[k+x]=b,ne<L[0]&&(L[0]=ne),$<L[1]&&(L[1]=$),te<L[2]&&(L[2]=te),ne>L[3]&&(L[3]=ne),$>L[4]&&(L[4]=$),te>L[5]&&(L[5]=te)}L[0]<F[0]&&(F[0]=L[0]),L[1]<F[1]&&(F[1]=L[1]),L[2]<F[2]&&(F[2]=L[2]),L[3]>F[3]&&(F[3]=L[3]),L[4]>F[4]&&(F[4]=L[4]),L[5]>F[5]&&(F[5]=L[5]);for(var x=0;x<X;x++)ke[Je+x]=k+j[x];S.push({materialIndex:O,name:h.name,chunkName:Ca(h.name),start:Je,count:h.faces.indices.length,texture:(r=h.texture)!==null&&r!==void 0?r:void 0}),k+=Ze,Je+=X}for(var x=0;x<E;x+=3){var De=void 0,We=void 0,Le=void 0,ye=void 0,me=void 0,lt=void 0,Se=void 0,$e=void 0,Ue=void 0,At=void 0,Ke=void 0,Gt=void 0,Kt=void 0,ze=void 0,ot=void 0,$t=void 0,He=void 0,ct=void 0,ce=void 0,oe=void 0,fe=void 0;De=ke[x]*3,We=ke[x+1]*3,Le=ke[x+2]*3,ye=M[De],me=M[De+1],lt=M[De+2],Se=M[We],$e=M[We+1],Ue=M[We+2],At=M[Le],Ke=M[Le+1],Gt=M[Le+2],Kt=At-Se,ze=Ke-$e,ot=Gt-Ue,$t=ye-Se,He=me-$e,ct=lt-Ue,ce=ze*ct-ot*He,oe=ot*$t-Kt*ct,fe=Kt*He-ze*$t,P[De]+=ce,P[De+1]+=oe,P[De+2]+=fe,P[We]+=ce,P[We+1]+=oe,P[We+2]+=fe,P[Le]+=ce,P[Le+1]+=oe,P[Le+2]+=fe}var he={createAt:i,description:a,vertices:M,uvs:I,normals:P,indices:ke,floorIndex:b,groups:S,extents:F,vertexMarks:C};o.push(he)}}return o}function Xa(n,t,e,r){var i=R({key:"texture.pbm"},sr(t,["format","quality","size","sharpen","mappings"])),a=new An,o=a.loadTexture(n,{imageURL:{transform:t.transform,options:i},wrapS:d.ClampToEdgeWrapping,wrapT:d.ClampToEdgeWrapping,minFilter:d.LinearFilter,maxSize:typeof i.size=="number"?new d.Vector2(i.size,i.size):void 0,fetcher:e}).then(function(s){var u=s.body;return u.needsUpdate=!0,_d(u,r)});return Object.assign(o,{url:n,textureOptions:t})}function zu(n,t,e,r,i,a,o){i===void 0&&(i={});for(var s=Wd(n),u=0,c="",l=[],h={},p=new Set,v=0,m=s;v<m.length;v++){var A=m[v],y=A.createAt,f=A.description,g=A.vertices,b=A.vertexMarks,w=A.uvs,E=A.normals,x=A.indices,M=A.floorIndex,C=A.groups,I=A.extents,P=new d.Box3;P.min.x=I[0],P.min.y=I[1],P.min.z=I[2],P.max.x=I[3],P.max.y=I[4],P.max.z=I[5];var S=new d.BufferGeometry;S.setAttribute("position",new d.BufferAttribute(g,3)),S.setAttribute("uv",new d.BufferAttribute(w,2)),S.setAttribute("normal",new d.BufferAttribute(E,3)),S.setAttribute("isRoofMark",new d.BufferAttribute(b,1)),x&&S.setIndex(new d.BufferAttribute(x,1)),S.boundingBox=P,S.boundingSphere=P.getBoundingSphere(new d.Sphere);for(var F=0,k=C;F<k.length;F++){var O=k[F];S.addGroup(O.start,O.count,O.materialIndex)}p.add(S);for(var L=[],N=0,V=C;N<V.length;N++){var O=V[N],j=e[O.chunkName]||(O.texture?It(t||"",O.texture):void 0),z=new Vn;z.defines.USE_VERTEX_FLOOR=!1,z.floor=M,L.push(z),j?h[j]?h[j].push(z):h[j]=[z]:(z.defines.USE_MAP=!1,z.uniforms.diffuse.value=new d.Color(16777215)),p.add(z)}var U=new _t(S,L);U.name="model_floor_"+M,U.userData.createAt=y,U.userData.description=f,U.matrix.compose(U.position,U.quaternion,U.scale),U.matrixAutoUpdate=!1,U.frustumCulled=!1,U.renderOrder=-1e3+M,u=y,c=f,l.push(U)}var X="",G=function(Y){Y=Ya(Y,e.length);var H=[],J=fn(Y);if(X===J)return Promise.resolve();X=J;for(var ne=function(ce){var oe=null;ce in i&&(fn(i[ce].textureOptions)===fn(Y)?oe=i[ce]:i[ce].then(function(fe){return fe.dispose()})),oe||(oe=Xa(ce,Y,a,o)),H.push(oe.then(function(fe){if(X!==J){fe.dispose();return}for(var Ie=0,Ae=h[ce];Ie<Ae.length;Ie++){var Fe=Ae[Ie];Fe.uniforms.map.value&&(p.delete(Fe.uniforms.map.value),Fe.uniforms.map.value.dispose()),Fe.uniforms.map.value=fe,p.add(fe),Fe.uniforms.exposure.value=3.3}}).catch(function(){if(X===J)for(var fe=0,Ie=h[ce];fe<Ie.length;fe++){var Ae=Ie[fe];Ae.uniforms.map.value&&(p.delete(Ae.uniforms.map.value),Ae.uniforms.map.value.dispose()),Ae.uniforms.map.value=null,Ae.defines.USE_MAP=!1,Ae.uniforms.diffuse.value=new d.Color(16777215)}}))},$=0,te=Object.keys(h);$<te.length;$++){var ae=te[$];ne(ae)}for(var ae in i)delete i[ae];return Promise.all(H).then(function(){})},K=G(r);return{createAt:u,description:c,objects:l,texturePromise:K,updateTexture:G,dispose:function(){p.forEach(function(Y){Y.dispose()}),p.clear()}}}function Ya(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 Hu(n,t){var e,r,i,a={byteLength:0},o=Ya((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 u=0,c=t.textureArray;u<c.length;u++){var l=c[u];s[l]=Xa(l,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(h){return Lu(h.body)}).then(function(h){return gi(function(){for(var p,v={chunks:[],createAt:void 0,description:void 0},m=0,A=h;m<A.length;m++){var y=A[m],f=Vu.decode(y);f.chunks.length&&((p=v.chunks).push.apply(p,f.chunks),v.createAt=f.createAt,v.description=f.description)}return v})}).then(function(h){return gi(function(){var p,v,m;return zu(h,(p=t.textureBaseUri)!==null&&p!==void 0?p:function(){var A=n.lastIndexOf("/");if(A>=0){var y=n.slice(0,A)+"/";return/\/model\/$/.test(y)&&(y=y.replace(/\/model\/$/,"/materials/")),y}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),(m=t.textureOptions)!==null&&m!==void 0?m:{},s,t.fetcher)})}).then(function(h){var p=new d.Group;p.renderOrder=-4,p.name=n;for(var v=0,m=h.objects;v<m.length;v++){var A=m[v];p.add(A)}return h.texturePromise.then(function(){return{type:"at3d",uri:n,byteLength:a.byteLength,object:p,dispose:function(){return h.dispose()}}})})}const Ge=Or.Reader,ut=Or.util,Me=Or.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(Or.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),Xd=Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(Me.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})();Me.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=ut.emptyArray,n.prototype.matrix=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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(Me.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(Me.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw ut.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=Me.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(Me.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw ut.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=Me.Position.decode(e,e.uint32());break}case 2:{a.uv=Me.UV.decode(e,e.uint32());break}case 3:{a.uv2=Me.UV.decode(e,e.uint32());break}case 4:{a.normal=Me.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(Me.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw ut.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw ut.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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})();Me.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 Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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 ut.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw ut.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw ut.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();Me.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 Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=Me.Color.decode(e,e.uint32());break}case 2:{a.ks=Me.Color.decode(e,e.uint32());break}case 3:{a.ke=Me.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})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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 ju(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,_u(new Uint8Array(r.body),t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new d.Group;i.renderOrder=-4,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 r.texturePromise.then(function(){return{type:"dome",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}function Yd(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 Jd(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,u=a;s<u.length;s++){var c=u[s];o.addGroup(c.start,c.count,c.materialIndex)}return o}function nn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],yr(n)||(n=It(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=R({key:"texture.dome",size:64},sr(e,["quality","format","sharpen","mappings"])),u=o[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:s},wrapS:d.RepeatWrapping,wrapT:d.RepeatWrapping,fetcher:a}).then(function(c){var l=c.body;return r&&l.repeat.copy(r),l.needsUpdate=!0,l.updateMatrix(),l});return u}function Zd(n,t,e,r,i,a,o){var s=[],u=new Vn;o.add(u);var c=u.uniforms;c.exposure.value=4.3;var l=u.defines;if(l.USE_MAP=!1,l.USE_UV=!1,n.kd&&(c.diffuse.value=new d.Color().fromArray(n.kd.rgb)),n.mapkd){var h=null;if(n.mapkdrepeat){var p=n.mapkdrepeat.split(/\s+/).map(function(y){return Number(y)}),v=p[0],m=p[1];h=new d.Vector2(v,m)}s.push(nn(n.mapkd,t,e,h,r,i,a).then(function(y){l.USE_MAP=!0,l.USE_UV=!0,c.map.value=y,o.add(y),c.uvTransform.value=y.matrix,u.needsUpdate=!0}).catch(Q))}if(n.ks&&(c.specular.value=new d.Color().fromArray(n.ks.rgb)),n.mapks&&s.push(nn(n.mapks,t,e,null,r,i,a).then(function(y){c.specularMap.value=y,o.add(y)}).catch(Q)),n.ke&&(c.emissive.value=new d.Color().fromArray(n.ke.rgb)),n.mapke&&s.push(nn(n.mapke,t,e,null,r,i,a).then(function(y){c.emissiveMap.value=y,o.add(y)}).catch(Q)),n.norm&&s.push(nn(n.norm,t,e,null,r,i,a).then(function(y){c.normalMap.value=y,o.add(y)}).catch(Q)),n.mapbump&&s.push(nn(n.mapbump,t,e,null,r,i,a).then(function(y){c.bumpMap.value=y,o.add(y)}).catch(Q)),n.bump&&s.push(nn(n.bump,t,e,null,r,i,a).then(function(y){c.bumpMap.value=y,o.add(y)}).catch(Q)),typeof n.ns=="number"&&(c.shininess.value=n.ns),typeof n.d=="number"){var A=n.d;A>0&&A<1&&(u.opacity=A)}return u.floor=0,u.defines.USE_VERTEX_FLOOR=!1,{material:u,textureReady:Promise.all(s).then(Q)}}function $d(n){return Xd.decode(n).meshes}function _u(n,t,e,r){for(var i=[],a=[],o=new Set,s=$d(n),u=new An,c=new d.Matrix4,l=new d.Vector3,h=new d.Quaternion,p=new d.Vector3,v={},m=0,A=s;m<A.length;m++){var y=A[m],f=y.name,g=y.chunks,b=y.matrix;if(!(f==="Ceiling"||f==="CeilingDrop"))for(var w=0,E=b;w<E.length;w++){var x=E[w];c.elements=x.elements;var M=new d.Group;M.renderOrder=-4;for(var C=0;C<g.length;C++){var I=Jd(g[C].geometry);I.applyMatrix4(c),c.decompose(l,h,p),p.x*p.y*p.z<0&&I.attributes.normal&&I.attributes.position&&I.attributes.uv&&Yd(I),o.add(I);for(var P=[],S=0,F=g[C].material;S<F.length;S++){var k=F[S],O=Zd(k,t||"",e,u,r,v,o),L=O.material,N=O.textureReady;a.push(N),P.push(L)}var V=new _t(I,P);V.name="chunk_"+C,V.matrix.compose(V.position,V.quaternion,V.scale),V.matrixAutoUpdate=!1,V.frustumCulled=!1,V.renderOrder=-1e3,M.add(V)}M.name=f,i.push(M)}}var j=Promise.all(a).catch(Q),z=function(U){return Promise.resolve()};return{createAt:0,description:"",objects:i,texturePromise:j,updateTexture:z,dispose:function(){o.forEach(function(U){U.dispose()}),o.clear()}}}function Gu(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,Lu(r.body)}).then(function(r){var i=r.reduce(function(s,u){return s+u.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 _u(r,t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new d.Group;i.renderOrder=-4,i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return r.texturePromise.then(function(){return{type:"domez",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}var ef=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function tf(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 Wa(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(ef),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,object:o,dispose:function(){return r.dispose()}}})}var an=new d.Vector3,as=new d.Matrix4,rf=30;function os(n,t){var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras)r instanceof _t?(r.material.forEach(function(g){g.floor=t.extras.floor}),r.renderOrder=-1e3+t.extras.floor):r instanceof Lr&&(r.material.floor=t.extras.floor,r.renderOrder=-1e3+t.extras.floor);else if((r instanceof _t||r instanceof Lr)&&e){var i=r.geometry.index,a=r.geometry.getAttribute("position"),o=0,s=new Float32Array(a.count);if(e)if(i){for(var u=0,c=i.count,l=0;l<c;l++){var y=i.array[l];an.set(a.array[y*3+0],a.array[y*3+1],a.array[y*3+2]),an.applyMatrix4(r.matrixWorld);var h=an.y;s[y]=0;for(var p=0;p<e.length;p++){var f=e[p],m=f.ground,A=f.height;if(h<m+A){s[y]=p;break}}u+=s[y]}o=u/c}else{for(var u=0,c=a.count,l=0;l<c;l++){an.set(a.array[l*3+0],a.array[l*3+1],a.array[l*3+2]),an.applyMatrix4(r.matrixWorld);var h=an.y;s[l]=0;for(var p=0;p<e.length;p++){var v=e[p],m=v.ground,A=v.height;if(h<m+A){s[l]=p;break}}u+=s[l]}o=u/c}r.renderOrder=-1e3+o,r.geometry.setAttribute("floor",new d.BufferAttribute(s,1)),Array.isArray(r.material)?r.material.forEach(function(g){g.defines.USE_VERTEX_FLOOR=!0,g.needsUpdate=!0}):(r.material.defines.USE_VERTEX_FLOOR=!0,r.material.needsUpdate=!0)}})}var Ut=function(n){de(t,n);function t(e,r,i,a){var o,s,u,c,l=n.call(this)||this;l.model=e,l.objType=r,l.search=(o=a.search)!==null&&o!==void 0?o:"",l.unloadTileQueue=[],l.boundingBox=new d.Box3,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.matrixAutoUpdate=!1,l.renderOrder=-4,l.lastRefineTime=-1,l.nodes=new Map,l.nodeGroup=new d.Group,l.nodeGroup.matrixAutoUpdate=!1,l.nodeGroup.renderOrder=-4,l.add(l.nodeGroup),l.debugBoundings=new Map,l.debugBoundingGroup=new d.Group,l.debugBoundingGroup.visible=!1,l.debugBoundingGroup.matrixAutoUpdate=!1,l.debugBoundingGroup.renderOrder=-4,l.add(l.debugBoundingGroup),l.cacheCameras=[];var h=jo(i,(s=a.resourcePath)!==null&&s!==void 0?s:"");return l.tileset=new ii((c=(u=l.model.work)===null||u===void 0?void 0:u.workCode)!==null&&c!==void 0?c:"",h,{contentLoader:function(p){return l.loadContent(p,{fetcher:a.fetcher})},onTileLoad:function(){},onTileUnload:function(p){l.unloadTileQueue.push(p)},onTileError:function(p,v){a.onError&&a.onError(Object.assign(v,{error:v})),console.error("Tile error",p.id,v)}}),l.tileset.root.boundingVolume&&l.tileset.root.boundingVolume.getBoundingBox(l.boundingBox),l}return Object.defineProperty(t.prototype,"debug",{get:function(){return this.debugBoundingGroup.visible},set:function(e){this.debugBoundingGroup.visible!==e&&(this.debugBoundingGroup.visible=e,this.needsRender=!0)},enumerable:!1,configurable:!0}),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,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),t.prototype.loadContent=function(e,r){var i=this;if(!e.content)return Promise.resolve(!1);var a=e.content,o=Mu(a.uri,this.search);if(e.type==="TILESET"){var s=qt(o,{key:"model.".concat(e.siblingIndex)});return r.fetcher.ajax(s,{responseType:"text"}).then(function(u){return u.body}).then(function(u){var c=s.slice(0,s.lastIndexOf("/")+1);return jo(JSON.parse(u),c)}).then(function(u){return e.geometricError=u.geometricError,e.children.length===0&&(e.children=[new _a("".concat(e.id,".0"),u.root,e.tileset,e)]),!0})}return e.type==="SCENEGRAPH"?Promise.resolve().then(function(){var u,c,l,h,p,v,m,A,y,f,g="",b=o.split("#"),w=b[0],E=b[1],x=(E||w).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(x&&(g=x[1]),g==="b3dm"){var M=qt(o,{key:"model.".concat(e.siblingIndex)});return Bu(M,{upAxis:e.tileset.asset.gltfUpAxis,fetcher:r.fetcher}).then(function(C){return C.object.applyMatrix4(e.transform),C.object.updateWorldMatrix(!1,!0),C.object.matrixAutoUpdate=!1,os(C.object,e),C})}if(g==="pnts"){var M=qt(o,{key:"model.".concat(e.siblingIndex)});return Ru(M,{fetcher:r.fetcher,computeBoundingBox:!1}).then(function(I){if(I.object.applyMatrix4(e.transform),I.object.updateWorldMatrix(!1,!0),I.object.matrixAutoUpdate=!1,e.boundingVolume){var P=e.boundingVolume;I.object.traverse(function(S){if(S instanceof Lr){as.getInverse(S.matrixWorld);var F=new d.Box3;P.getBoundingBox(F),F.applyMatrix4(as),S.geometry.boundingBox=F}})}return I})}if(g==="glb"){var M=qt(o,{key:"model.".concat(e.siblingIndex)});return tf(M,{upAxis:e.tileset.asset.gltfUpAxis,fetcher:r.fetcher}).then(function(I){return I.object.applyMatrix4(e.transform),I.object.updateWorldMatrix(!1,!0),I.object.matrixAutoUpdate=!1,os(I.object,e),I})}if(g==="at3d"){var M=e.extras.at3d?o:qt(o,{key:"model.".concat(e.siblingIndex)});return Hu(M,{textureBaseUri:(u=e.extras.at3d)===null||u===void 0?void 0:u.textureBaseUri,textureArray:(c=e.extras.at3d)===null||c===void 0?void 0:c.textureArray,textureOptions:(l=e.extras.at3d)===null||l===void 0?void 0:l.textureOptions,fetcher:r.fetcher}).then(function(I){return I.object.applyMatrix4(e.transform),I.object.updateWorldMatrix(!1,!0),I.object.matrixAutoUpdate=!1,I})}if(g==="pbm"){var M=e.extras.pbm?o:qt(o,{key:"model.".concat(e.siblingIndex)});return Uu(M,{textureBaseUri:(h=e.extras.pbm)===null||h===void 0?void 0:h.textureBaseUri,textureArray:(p=e.extras.pbm)===null||p===void 0?void 0:p.textureArray,textureOptions:(v=e.extras.pbm)===null||v===void 0?void 0:v.textureOptions,fetcher:r.fetcher}).then(function(I){return I.object.applyMatrix4(e.transform),I.object.updateWorldMatrix(!1,!0),I.object.matrixAutoUpdate=!1,I})}if(g==="dome"){var M=e.extras.dome?o:qt(o,{key:"model.".concat(e.siblingIndex)});return ju(M,{textureBaseUri:(m=e.extras.dome)===null||m===void 0?void 0:m.textureBaseUri,textureOptions:(A=e.extras.dome)===null||A===void 0?void 0:A.textureOptions,fetcher:r.fetcher}).then(function(I){return I.object.applyMatrix4(e.transform),I.object.updateWorldMatrix(!1,!0),I.object.matrixAutoUpdate=!1,I})}if(g==="domez"){var M=e.extras.domez?o:qt(o,{key:"model.".concat(e.siblingIndex)});return Gu(M,{textureBaseUri:(y=e.extras.domez)===null||y===void 0?void 0:y.textureBaseUri,textureOptions:(f=e.extras.domez)===null||f===void 0?void 0:f.textureOptions,fetcher:r.fetcher}).then(function(I){return I.object.applyMatrix4(e.transform),I.object.updateWorldMatrix(!1,!0),I.object.matrixAutoUpdate=!1,I})}}).then(function(u){if(!u)return!1;var c={type:u.type,uri:u.uri,byteLength:u.byteLength,object:new Eu(u.object,u.dispose)};if(i.disposed)return c.object.dispose(),a.data=void 0,a.byteLength=0,!1;if(c.object.traverse(function(v){(v instanceof Lr||v instanceof _t)&&(v.model=i.model)}),u.type==="pnts"){var l=u.object,h=l.material;h.uniforms.geometricError.value=e.geometricError}if(a.data=c,a.byteLength=c.byteLength,c.object.traverse(function(v){v.renderOrder>-4&&(v.renderOrder=-4)}),c.object.visible=!1,i.boundingBox.expandByObject(c.object),i.nodes.set(e.id,c.object),i.nodeGroup.add(c.object),e.boundingVolume){var p=Bc(e.boundingVolume,e.state.selectionDepth);p.matrixWorldNeedsUpdate=!0,p.matrixAutoUpdate=!1,p.frustumCulled=!1,p.visible=!0,i.debugBoundings.set(e.id,p),i.debugBoundingGroup.add(p)}return!0}):Promise.resolve(!1)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var a=[this.tileset.root],o=this.tileset.transform,s;s=a.pop();){var u=void 0;if(s.boundingVolume){var c=s.boundingVolume.clone().applyMatrix4(o);u=c.intersectRay(e.ray,e.far)}else u=!0;if(u){for(var l=0,h=s.children.length;l<h;l++)a.push(s.children[l]);s.selected&&s.content&&s.content.data&&s.content.data.object.intersectRaycaster(e,!1,i)}}return r&&i.sort(function(p,v){return p.distance-v.distance}),i},t.prototype.update=function(e,r){var i=this;this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld);var a=ve();if(this.needsRefined&&a-this.lastRefineTime>rf){this.lastRefineTime=a,this.tileset.cache.reset(),this.tileset.frameNumber++;var o={camera:{position:new d.Vector3().copy(r.position),direction:r.getDirection(new d.Vector3),up:new d.Vector3().copy(r.up),visible:r.visible},minLevelOfDetail:this.visible?this.minLevelOfDetail:-1,maxLevelOfDetail:this.visible?this.maxLevelOfDetail:-1,height:r.screenHeight,pixelRatio:r.pixelRatio,frameNumber:this.tileset.frameNumber,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new Pn().setFromCamera(r)},s=this.cacheCameras.map(function(p){return R(R({},o),{camera:{position:new d.Vector3().copy(p.position),direction:p.getWorldDirection(new d.Vector3),up:new d.Vector3().copy(p.up),visible:p.visible},cullingVolume:new Pn().setFromCamera(p)})});this.tileset.traverse(o,s),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(p){if(i.refineProgress[1]++,p.content&&p.state.visible){var v=p.content.loadState;if(v==="UNLOADED"||v==="LOADING"){i.refined=!1;return}}i.refineProgress[0]++}),this.loaded===!1&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(p){if(i.loaded!==!1&&p.content&&p.state.visible&&p.state.selectionDepth===0){var v=p.content.loadState;(v==="UNLOADED"||v==="LOADING")&&(i.loaded=!1)}}))}var u;this.tileset.tiles.forEach(function(p){var v=p.selected,m=p.id;u=i.nodes.get(m),u&&u.visible!==v&&(u.visible=v,i.needsRender=!0),u=i.debugBoundings.get(m),u&&u.visible!==v&&(u.visible=v,i.needsRender=!0)});for(var c;c=this.unloadTileQueue.pop();){var l=c.id,h=c.content;h&&h.data&&(h.data.object.dispose(),h.data=void 0,h.byteLength=0),u=this.nodes.get(l),u&&(this.nodeGroup.remove(u),this.nodes.delete(l),this.needsRender=!0),u=this.debugBoundings.get(l),u&&(this.debugBoundingGroup.remove(u),this.debugBoundings.delete(l),this.needsRender=!0)}},t.prototype.dispose=function(){var e=this;this.disposed=!0,this.tileset.reset();for(var r,i;r=this.unloadTileQueue.pop();){var a=r.id,o=r.content;o&&o.data&&(o.data.object.dispose(),o.data=void 0,o.byteLength=0),i=this.nodes.get(a),i&&(this.nodeGroup.remove(i),this.nodes.delete(a),this.needsRender=!0),i=this.debugBoundings.get(a),i&&(this.debugBoundingGroup.remove(i),this.debugBoundings.delete(a),this.needsRender=!0)}this.nodes.forEach(function(s,u,c){e.nodeGroup.remove(s),s.dispose(),c.delete(u)})},t.DEFAULT_MIN_LEVEL_OF_DETAIL=-1,t.DEFAULT_MAX_LEVEL_OF_DETAIL=20,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=ii.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_MAX_REQUESTS=ii.DEFAULT_MAX_REQUESTS,t}(d.Object3D);function le(n,t,e){return n<t?t:n>e?e:n}function nf(n){return-((n-.25)*360+90)/180*Math.PI}function Ia(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(!Ia(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(!Ia(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Xt(n){return typeof n=="number"}function af(n){return(n&n-1)===0&&n!==0}var ss=function(){return new Error("Invalid input.")},us=function(){return new Error("Invalid certificate.")},ls=function(){return new Error("Invalid signature.")},of=function(n){return new Error("date(".concat(n.toString(),") expired."))},sf=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function uf(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 xn(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+=xn(n[a],!1)+",";return i>-1&&(r+=xn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return xn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],c=xn(n[u],!0);c!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+c),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 lf(n){return String(xn(n,!1))}function Ku(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return ss();for(var s=function(E){var x=Ku(n[E]);if(x instanceof Error)return{value:x};if(!i)i=x.issuer;else if(i!==x.issuer)return{value:us()};a?x.expire.getTime()<a.getTime()&&(a=x.expire):a=x.expire,o?o=o.filter(function(M){return x.allowHosts.indexOf(M)!==-1}):o=x.allowHosts},u=0;u<n.length;u++){var c=s(u);if(typeof c=="object")return c.value}return Gr({issuer:i,expire:a,allowHosts:o})}var l=JSON.parse(n),h=typeof location<"u"?location.hostname:"",p=Date.now();if(typeof l!="object")return ss();var v=new Date(typeof l.expire_at=="string"&&/^\d+$/.test(l.expire_at)?Number(l.expire_at):l.expire_at),m=Array.isArray(l.allow_hosts)?l.allow_hosts:[];if(h.length===0||Yr(h)||ar.filter(function(E){return kr(E,h)}).length>0){var A=String((t=l.certificate)!==null&&t!==void 0?t:"");if(A){var y=new qe;return y.readCertPEM(A),Gr({issuer:y.getSubjectString(),expire:v,allowHosts:m})}return Gr({issuer:"none",expire:v,allowHosts:m})}var f=String((e=l.certificate)!==null&&e!==void 0?e:"");if(!f)return us();var g=new qe;g.readCertPEM(f);var b=String((r=l._signature)!==null&&r!==void 0?r:"");if(!b)return ls();var w=lf(uf(l,["_signature"]));return Ol(w,b,g)===!1?ls():p<v.getTime()?m.filter(function(E){return kr(E,h)}).length===0?sf(h):Gr({issuer:g.getSubjectString(),expire:v,allowHosts:m}):of(v)}var cs=new d.Matrix4,Ja=new WeakMap,Za=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.options={transform:new d.Matrix4};var r=cf(t,e,this);if(r instanceof Error)throw new Error("[PARSE FAILED]: "+r.message+`
|
|
946
|
+
`,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1}),ts=Promise.resolve();function zd(n,t){if(!t)return Promise.resolve(n);var e=t.getRenderTarget();t.setRenderTarget(qd),n instanceof d.CubeTexture?(yi.material=Wn,Wn.uniforms.map.value=n,t.render(bi,Ma),Wn.uniforms.map.value=null):(yi.material=es,es.uniforms.map.value=n,t.render(bi,Ma),Wn.uniforms.map.value=null),t.setRenderTarget(e);var r=ts.then(function(){return new Promise(function(i){it.shared.add(function(){i(n)},!0)})});return ts=r.catch(function(){}),r}const Dr=Or.Reader,Zt=Or.util,Ht=Or.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(Or.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Nu=Ht.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=Zt.emptyArray,n.prototype.createAt=Zt.Long?Zt.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof Dr||(e=Dr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Ht.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})();Ht.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 Dr||(e=Dr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=Ht.Vertices.decode(e,e.uint32());break}case 2:{a.faces=Ht.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 Zt.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw Zt.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw Zt.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Ht.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=Zt.emptyArray,n.prototype.uvs=Zt.emptyArray,n.prototype.marks=Zt.emptyArray,n.decode=function(e,r){e instanceof Dr||(e=Dr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.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})();Ht.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=Zt.emptyArray,n.prototype.normals=Zt.emptyArray,n.decode=function(e,r){e instanceof Dr||(e=Dr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ht.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})();Ht.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function Qu(n,t){var e,r,i,a={byteLength:0},o=Wa((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 u=0,c=t.textureArray;u<c.length;u++){var l=c[u];s[l]=Ka(l,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(h){return a.byteLength=h.body.byteLength,gi(function(){var p=new Uint8Array(h.body);return Nu.decode(p)})}).then(function(h){return gi(function(){var p,v;return Uu(h,(p=t.textureBaseUri)!==null&&p!==void 0?p:function(){var m=n.lastIndexOf("/");if(m>=0){var A=n.slice(0,m)+"/";return/\/model\/$/.test(A)&&(A=A.replace(/\/model\/$/,"/materials/")),A}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),o,s,t.fetcher)})}).then(function(h){var p=new d.Group;p.renderOrder=-4,p.matrixAutoUpdate=!1,p.matrix.compose(p.position,p.quaternion,p.scale),p.name=n;for(var v=0,m=h.objects;v<m.length;v++){var A=m[v];p.add(A)}return h.texturePromise.then(function(){return{type:"pbm",uri:n,byteLength:a.byteLength,object:p,dispose:function(){return h.dispose()}}})})}var Hd=new d.Matrix4().set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),pe=Hd.elements;function Vu(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function Ca(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function jd(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function rs(n){var t=Vu(n.name),e=Ca(n.name),r=jd(n.name);return t*1e6+e*1e3+r}function _d(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,u=!0,c=0,l=n.chunks;c<l.length;c++){var h=l[c];if(!h.vertices.marks||h.vertices.marks.length===0){u=!1;break}}for(var p=0,v=n.chunks;p<v.length;p++){var h=v[p];if(!h.faces.normals||h.faces.normals.length===0){s=!1;break}}for(var m=n.chunks.sort(function(wt,Tt){return rs(wt)-rs(Tt)}),A=[],y=0,f=m;y<f.length;y++){var h=f[y],g=Vu(h.name);A[g]||(A[g]=[]),A[g].push(h)}for(var b=0;b<A.length;b++){var w=A[b];if(w)if(s){for(var E=0,x=0;x<w.length;x++){var h=w[x];E+=h.faces.indices.length}for(var M=new Float32Array(E*3),C=new Float32Array(E),I=new Float32Array(E*2),P=new Float32Array(E*3),S=[],F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],k=0,O=0;O<w.length;O++){for(var L=[1/0,1/0,1/0,-1/0,-1/0,-1/0],h=w[O],N=h.vertices.xyz,V=h.vertices.uvs,j=h.faces.indices,z=h.faces.normals,U=h.vertices.marks,X=j.length,x=0;x<X;x++){var G=j[x],K=N[G*3],Y=N[G*3+1],H=N[G*3+2],J=1/(pe[3]*K+pe[7]*Y+pe[11]*H+pe[15]),ne=(pe[0]*K+pe[4]*Y+pe[8]*H+pe[12])*J,$=(pe[1]*K+pe[5]*Y+pe[9]*H+pe[13])*J,te=(pe[2]*K+pe[6]*Y+pe[10]*H+pe[14])*J;M[k*3+x*3]=ne,M[k*3+x*3+1]=$,M[k*3+x*3+2]=te,C[k+x]=u?U[G]:0,I[k*2+x*2]=V[G*2],I[k*2+x*2+1]=V[G*2+1];var ae=Math.floor(x/3)*3,ce=z[ae],oe=z[ae+1],fe=z[ae+2],Ie=1/(pe[3]*ce+pe[7]*oe+pe[11]*fe+pe[15]),Ae=(pe[0]*ce+pe[4]*oe+pe[8]*fe+pe[12])*Ie,Fe=(pe[1]*ce+pe[5]*oe+pe[9]*fe+pe[13])*Ie,re=(pe[2]*ce+pe[6]*oe+pe[10]*fe+pe[14])*Ie;P[k*3+x*3]=Ae,P[k*3+x*3+1]=Fe,P[k*3+x*3+2]=re,ne<L[0]&&(L[0]=ne),$<L[1]&&(L[1]=$),te<L[2]&&(L[2]=te),ne>L[3]&&(L[3]=ne),$>L[4]&&(L[4]=$),te>L[5]&&(L[5]=te)}L[0]<F[0]&&(F[0]=L[0]),L[1]<F[1]&&(F[1]=L[1]),L[2]<F[2]&&(F[2]=L[2]),L[3]>F[3]&&(F[3]=L[3]),L[4]>F[4]&&(F[4]=L[4]),L[5]>F[5]&&(F[5]=L[5]),S.push({materialIndex:O,name:h.name,chunkName:Ca(h.name),start:k,count:h.faces.indices.length,texture:(e=h.texture)!==null&&e!==void 0?e:void 0}),k+=X}var he={createAt:i,description:a,vertices:M,uvs:I,normals:P,indices:null,floorIndex:b,groups:S,extents:F,vertexMarks:C};o.push(he)}else{for(var E=0,W=0,x=0;x<w.length;x++){var h=w[x];W+=h.vertices.xyz.length/3,E+=h.faces.indices.length}for(var M=new Float32Array(W*3),I=new Float32Array(W*2),P=new Float32Array(W*3),Oe=new Float32Array(W),ke=new Uint32Array(E),C=new Float32Array(E),S=[],F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],Je=0,k=0,O=0;O<w.length;O++){for(var L=[1/0,1/0,1/0,-1/0,-1/0,-1/0],h=w[O],N=h.vertices.xyz,U=h.vertices.marks,V=h.vertices.uvs,j=h.faces.indices,Ze=N.length/3,X=j.length,x=0;x<Ze;x++){var K=N[x*3],Y=N[x*3+1],H=N[x*3+2],J=1/(pe[3]*K+pe[7]*Y+pe[11]*H+pe[15]),ne=(pe[0]*K+pe[4]*Y+pe[8]*H+pe[12])*J,$=(pe[1]*K+pe[5]*Y+pe[9]*H+pe[13])*J,te=(pe[2]*K+pe[6]*Y+pe[10]*H+pe[14])*J;M[k*3+x*3]=ne,M[k*3+x*3+1]=$,M[k*3+x*3+2]=te,C[k+x]=u?U[x]:0,I[k*2+x*2]=V[x*2],I[k*2+x*2+1]=V[x*2+1],Oe[k+x]=b,ne<L[0]&&(L[0]=ne),$<L[1]&&(L[1]=$),te<L[2]&&(L[2]=te),ne>L[3]&&(L[3]=ne),$>L[4]&&(L[4]=$),te>L[5]&&(L[5]=te)}L[0]<F[0]&&(F[0]=L[0]),L[1]<F[1]&&(F[1]=L[1]),L[2]<F[2]&&(F[2]=L[2]),L[3]>F[3]&&(F[3]=L[3]),L[4]>F[4]&&(F[4]=L[4]),L[5]>F[5]&&(F[5]=L[5]);for(var x=0;x<X;x++)ke[Je+x]=k+j[x];S.push({materialIndex:O,name:h.name,chunkName:Ca(h.name),start:Je,count:h.faces.indices.length,texture:(r=h.texture)!==null&&r!==void 0?r:void 0}),k+=Ze,Je+=X}for(var x=0;x<E;x+=3){var De=void 0,We=void 0,Le=void 0,ye=void 0,me=void 0,lt=void 0,Se=void 0,$e=void 0,Ue=void 0,At=void 0,Ke=void 0,Gt=void 0,Kt=void 0,ze=void 0,ot=void 0,$t=void 0,He=void 0,ct=void 0,ce=void 0,oe=void 0,fe=void 0;De=ke[x]*3,We=ke[x+1]*3,Le=ke[x+2]*3,ye=M[De],me=M[De+1],lt=M[De+2],Se=M[We],$e=M[We+1],Ue=M[We+2],At=M[Le],Ke=M[Le+1],Gt=M[Le+2],Kt=At-Se,ze=Ke-$e,ot=Gt-Ue,$t=ye-Se,He=me-$e,ct=lt-Ue,ce=ze*ct-ot*He,oe=ot*$t-Kt*ct,fe=Kt*He-ze*$t,P[De]+=ce,P[De+1]+=oe,P[De+2]+=fe,P[We]+=ce,P[We+1]+=oe,P[We+2]+=fe,P[Le]+=ce,P[Le+1]+=oe,P[Le+2]+=fe}var he={createAt:i,description:a,vertices:M,uvs:I,normals:P,indices:ke,floorIndex:b,groups:S,extents:F,vertexMarks:C};o.push(he)}}return o}function Ka(n,t,e,r){var i=R({key:"texture.pbm"},sr(t,["format","quality","size","sharpen","mappings"])),a=new An,o=a.loadTexture(n,{imageURL:{transform:t.transform,options:i},wrapS:d.ClampToEdgeWrapping,wrapT:d.ClampToEdgeWrapping,minFilter:d.LinearFilter,maxSize:typeof i.size=="number"?new d.Vector2(i.size,i.size):void 0,fetcher:e}).then(function(s){var u=s.body;return u.needsUpdate=!0,zd(u,r)});return Object.assign(o,{url:n,textureOptions:t})}function Uu(n,t,e,r,i,a,o){i===void 0&&(i={});for(var s=_d(n),u=0,c="",l=[],h={},p=new Set,v=0,m=s;v<m.length;v++){var A=m[v],y=A.createAt,f=A.description,g=A.vertices,b=A.vertexMarks,w=A.uvs,E=A.normals,x=A.indices,M=A.floorIndex,C=A.groups,I=A.extents,P=new d.Box3;P.min.x=I[0],P.min.y=I[1],P.min.z=I[2],P.max.x=I[3],P.max.y=I[4],P.max.z=I[5];var S=new d.BufferGeometry;S.setAttribute("position",new d.BufferAttribute(g,3)),S.setAttribute("uv",new d.BufferAttribute(w,2)),S.setAttribute("normal",new d.BufferAttribute(E,3)),S.setAttribute("isRoofMark",new d.BufferAttribute(b,1)),x&&S.setIndex(new d.BufferAttribute(x,1)),S.boundingBox=P,S.boundingSphere=P.getBoundingSphere(new d.Sphere);for(var F=0,k=C;F<k.length;F++){var O=k[F];S.addGroup(O.start,O.count,O.materialIndex)}p.add(S);for(var L=[],N=0,V=C;N<V.length;N++){var O=V[N],j=e[O.chunkName]||(O.texture?It(t||"",O.texture):void 0),z=new Vn;z.defines.USE_VERTEX_FLOOR=!1,z.floor=M,L.push(z),j?h[j]?h[j].push(z):h[j]=[z]:(z.defines.USE_MAP=!1,z.uniforms.diffuse.value=new d.Color(16777215)),p.add(z)}var U=new _t(S,L);U.name="model_floor_"+M,U.userData.createAt=y,U.userData.description=f,U.matrix.compose(U.position,U.quaternion,U.scale),U.matrixAutoUpdate=!1,U.frustumCulled=!1,U.renderOrder=-1e3+M,u=y,c=f,l.push(U)}var X="",G=function(Y){Y=Wa(Y,e.length);var H=[],J=fn(Y);if(X===J)return Promise.resolve();X=J;for(var ne=function(ce){var oe=null;ce in i&&(fn(i[ce].textureOptions)===fn(Y)?oe=i[ce]:i[ce].then(function(fe){return fe.dispose()})),oe||(oe=Ka(ce,Y,a,o)),H.push(oe.then(function(fe){if(X!==J){fe.dispose();return}for(var Ie=0,Ae=h[ce];Ie<Ae.length;Ie++){var Fe=Ae[Ie];Fe.uniforms.map.value&&(p.delete(Fe.uniforms.map.value),Fe.uniforms.map.value.dispose()),Fe.uniforms.map.value=fe,p.add(fe),Fe.uniforms.exposure.value=3.3}}).catch(function(){if(X===J)for(var fe=0,Ie=h[ce];fe<Ie.length;fe++){var Ae=Ie[fe];Ae.uniforms.map.value&&(p.delete(Ae.uniforms.map.value),Ae.uniforms.map.value.dispose()),Ae.uniforms.map.value=null,Ae.defines.USE_MAP=!1,Ae.uniforms.diffuse.value=new d.Color(16777215)}}))},$=0,te=Object.keys(h);$<te.length;$++){var ae=te[$];ne(ae)}for(var ae in i)delete i[ae];return Promise.all(H).then(function(){})},K=G(r);return{createAt:u,description:c,objects:l,texturePromise:K,updateTexture:G,dispose:function(){p.forEach(function(Y){Y.dispose()}),p.clear()}}}function Wa(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 qu(n,t){var e,r,i,a={byteLength:0},o=Wa((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 u=0,c=t.textureArray;u<c.length;u++){var l=c[u];s[l]=Ka(l,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(h){return Ou(h.body)}).then(function(h){return gi(function(){for(var p,v={chunks:[],createAt:void 0,description:void 0},m=0,A=h;m<A.length;m++){var y=A[m],f=Nu.decode(y);f.chunks.length&&((p=v.chunks).push.apply(p,f.chunks),v.createAt=f.createAt,v.description=f.description)}return v})}).then(function(h){return gi(function(){var p,v,m;return Uu(h,(p=t.textureBaseUri)!==null&&p!==void 0?p:function(){var A=n.lastIndexOf("/");if(A>=0){var y=n.slice(0,A)+"/";return/\/model\/$/.test(y)&&(y=y.replace(/\/model\/$/,"/materials/")),y}return""}(),((v=t.textureArray)!==null&&v!==void 0?v:[]).slice(),(m=t.textureOptions)!==null&&m!==void 0?m:{},s,t.fetcher)})}).then(function(h){var p=new d.Group;p.renderOrder=-4,p.name=n;for(var v=0,m=h.objects;v<m.length;v++){var A=m[v];p.add(A)}return h.texturePromise.then(function(){return{type:"at3d",uri:n,byteLength:a.byteLength,object:p,dispose:function(){return h.dispose()}}})})}const Ge=Or.Reader,ut=Or.util,Me=Or.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(Or.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),Gd=Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(Me.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})();Me.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=ut.emptyArray,n.prototype.matrix=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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(Me.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(Me.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw ut.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=Me.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(Me.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw ut.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=Me.Position.decode(e,e.uint32());break}case 2:{a.uv=Me.UV.decode(e,e.uint32());break}case 3:{a.uv2=Me.UV.decode(e,e.uint32());break}case 4:{a.normal=Me.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(Me.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw ut.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw ut.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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})();Me.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 Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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 ut.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw ut.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw ut.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();Me.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 Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=Me.Color.decode(e,e.uint32());break}case 2:{a.ks=Me.Color.decode(e,e.uint32());break}case 3:{a.ke=Me.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})();Me.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=ut.emptyArray,n.decode=function(e,r){e instanceof Ge||(e=Ge.create(e));let i=r===void 0?e.len:e.pos+r,a=new Me.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 zu(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,Hu(new Uint8Array(r.body),t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new d.Group;i.renderOrder=-4,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 r.texturePromise.then(function(){return{type:"dome",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}function Kd(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 Wd(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,u=a;s<u.length;s++){var c=u[s];o.addGroup(c.start,c.count,c.materialIndex)}return o}function nn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],yr(n)||(n=It(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=R({key:"texture.dome",size:64},sr(e,["quality","format","sharpen","mappings"])),u=o[n]=i.loadTexture(n,{imageURL:{transform:e.transform,options:s},wrapS:d.RepeatWrapping,wrapT:d.RepeatWrapping,fetcher:a}).then(function(c){var l=c.body;return r&&l.repeat.copy(r),l.needsUpdate=!0,l.updateMatrix(),l});return u}function Xd(n,t,e,r,i,a,o){var s=[],u=new Vn;o.add(u);var c=u.uniforms;c.exposure.value=4.3;var l=u.defines;if(l.USE_MAP=!1,l.USE_UV=!1,n.kd&&(c.diffuse.value=new d.Color().fromArray(n.kd.rgb)),n.mapkd){var h=null;if(n.mapkdrepeat){var p=n.mapkdrepeat.split(/\s+/).map(function(y){return Number(y)}),v=p[0],m=p[1];h=new d.Vector2(v,m)}s.push(nn(n.mapkd,t,e,h,r,i,a).then(function(y){l.USE_MAP=!0,l.USE_UV=!0,c.map.value=y,o.add(y),c.uvTransform.value=y.matrix,u.needsUpdate=!0}).catch(Q))}if(n.ks&&(c.specular.value=new d.Color().fromArray(n.ks.rgb)),n.mapks&&s.push(nn(n.mapks,t,e,null,r,i,a).then(function(y){c.specularMap.value=y,o.add(y)}).catch(Q)),n.ke&&(c.emissive.value=new d.Color().fromArray(n.ke.rgb)),n.mapke&&s.push(nn(n.mapke,t,e,null,r,i,a).then(function(y){c.emissiveMap.value=y,o.add(y)}).catch(Q)),n.norm&&s.push(nn(n.norm,t,e,null,r,i,a).then(function(y){c.normalMap.value=y,o.add(y)}).catch(Q)),n.mapbump&&s.push(nn(n.mapbump,t,e,null,r,i,a).then(function(y){c.bumpMap.value=y,o.add(y)}).catch(Q)),n.bump&&s.push(nn(n.bump,t,e,null,r,i,a).then(function(y){c.bumpMap.value=y,o.add(y)}).catch(Q)),typeof n.ns=="number"&&(c.shininess.value=n.ns),typeof n.d=="number"){var A=n.d;A>0&&A<1&&(u.opacity=A)}return u.floor=0,u.defines.USE_VERTEX_FLOOR=!1,{material:u,textureReady:Promise.all(s).then(Q)}}function Yd(n){return Gd.decode(n).meshes}function Hu(n,t,e,r){for(var i=[],a=[],o=new Set,s=Yd(n),u=new An,c=new d.Matrix4,l=new d.Vector3,h=new d.Quaternion,p=new d.Vector3,v={},m=0,A=s;m<A.length;m++){var y=A[m],f=y.name,g=y.chunks,b=y.matrix;if(!(f==="Ceiling"||f==="CeilingDrop"))for(var w=0,E=b;w<E.length;w++){var x=E[w];c.elements=x.elements;var M=new d.Group;M.renderOrder=-4;for(var C=0;C<g.length;C++){var I=Wd(g[C].geometry);I.applyMatrix4(c),c.decompose(l,h,p),p.x*p.y*p.z<0&&I.attributes.normal&&I.attributes.position&&I.attributes.uv&&Kd(I),o.add(I);for(var P=[],S=0,F=g[C].material;S<F.length;S++){var k=F[S],O=Xd(k,t||"",e,u,r,v,o),L=O.material,N=O.textureReady;a.push(N),P.push(L)}var V=new _t(I,P);V.name="chunk_"+C,V.matrix.compose(V.position,V.quaternion,V.scale),V.matrixAutoUpdate=!1,V.frustumCulled=!1,V.renderOrder=-1e3,M.add(V)}M.name=f,i.push(M)}}var j=Promise.all(a).catch(Q),z=function(U){return Promise.resolve()};return{createAt:0,description:"",objects:i,texturePromise:j,updateTexture:z,dispose:function(){o.forEach(function(U){U.dispose()}),o.clear()}}}function ju(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,Ou(r.body)}).then(function(r){var i=r.reduce(function(s,u){return s+u.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 Hu(r,t.textureBaseUri||"",t.textureOptions,t.fetcher)}).then(function(r){var i=new d.Group;i.renderOrder=-4,i.name=n;for(var a=0,o=r.objects;a<o.length;a++){var s=o[a];i.add(s)}return r.texturePromise.then(function(){return{type:"domez",uri:n,byteLength:e.byteLength,object:i,dispose:function(){return r.dispose()}}})})}var Jd=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Zd(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 Ga(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(Jd),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,object:o,dispose:function(){return r.dispose()}}})}var an=new d.Vector3,ns=new d.Matrix4,$d=30;function is(n,t){var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras)r instanceof _t?(r.material.forEach(function(g){g.floor=t.extras.floor}),r.renderOrder=-1e3+t.extras.floor):r instanceof Lr&&(r.material.floor=t.extras.floor,r.renderOrder=-1e3+t.extras.floor);else if((r instanceof _t||r instanceof Lr)&&e){var i=r.geometry.index,a=r.geometry.getAttribute("position"),o=0,s=new Float32Array(a.count);if(e)if(i){for(var u=0,c=i.count,l=0;l<c;l++){var y=i.array[l];an.set(a.array[y*3+0],a.array[y*3+1],a.array[y*3+2]),an.applyMatrix4(r.matrixWorld);var h=an.y;s[y]=0;for(var p=0;p<e.length;p++){var f=e[p],m=f.ground,A=f.height;if(h<m+A){s[y]=p;break}}u+=s[y]}o=u/c}else{for(var u=0,c=a.count,l=0;l<c;l++){an.set(a.array[l*3+0],a.array[l*3+1],a.array[l*3+2]),an.applyMatrix4(r.matrixWorld);var h=an.y;s[l]=0;for(var p=0;p<e.length;p++){var v=e[p],m=v.ground,A=v.height;if(h<m+A){s[l]=p;break}}u+=s[l]}o=u/c}r.renderOrder=-1e3+o,r.geometry.setAttribute("floor",new d.BufferAttribute(s,1)),Array.isArray(r.material)?r.material.forEach(function(g){g.defines.USE_VERTEX_FLOOR=!0,g.needsUpdate=!0}):(r.material.defines.USE_VERTEX_FLOOR=!0,r.material.needsUpdate=!0)}})}var Ut=function(n){de(t,n);function t(e,r,i,a){var o,s,u,c,l=n.call(this)||this;l.model=e,l.objType=r,l.search=(o=a.search)!==null&&o!==void 0?o:"",l.unloadTileQueue=[],l.boundingBox=new d.Box3,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.matrixAutoUpdate=!1,l.renderOrder=-4,l.lastRefineTime=-1,l.nodes=new Map,l.nodeGroup=new d.Group,l.nodeGroup.matrixAutoUpdate=!1,l.nodeGroup.renderOrder=-4,l.add(l.nodeGroup),l.debugBoundings=new Map,l.debugBoundingGroup=new d.Group,l.debugBoundingGroup.visible=!1,l.debugBoundingGroup.matrixAutoUpdate=!1,l.debugBoundingGroup.renderOrder=-4,l.add(l.debugBoundingGroup),l.cacheCameras=[];var h=zo(i,(s=a.resourcePath)!==null&&s!==void 0?s:"");return l.tileset=new ii((c=(u=l.model.work)===null||u===void 0?void 0:u.workCode)!==null&&c!==void 0?c:"",h,{contentLoader:function(p){return l.loadContent(p,{fetcher:a.fetcher})},onTileLoad:function(){},onTileUnload:function(p){l.unloadTileQueue.push(p)},onTileError:function(p,v){a.onError&&a.onError(Object.assign(v,{error:v})),console.error("Tile error",p.id,v)}}),l.tileset.root.boundingVolume&&l.tileset.root.boundingVolume.getBoundingBox(l.boundingBox),l}return Object.defineProperty(t.prototype,"debug",{get:function(){return this.debugBoundingGroup.visible},set:function(e){this.debugBoundingGroup.visible!==e&&(this.debugBoundingGroup.visible=e,this.needsRender=!0)},enumerable:!1,configurable:!0}),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,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),t.prototype.loadContent=function(e,r){var i=this;if(!e.content)return Promise.resolve(!1);var a=e.content,o=Eu(a.uri,this.search);if(e.type==="TILESET"){var s=qt(o,{key:"model.".concat(e.siblingIndex)});return r.fetcher.ajax(s,{responseType:"text"}).then(function(u){return u.body}).then(function(u){var c=s.slice(0,s.lastIndexOf("/")+1);return zo(JSON.parse(u),c)}).then(function(u){return e.geometricError=u.geometricError,e.children.length===0&&(e.children=[new _a("".concat(e.id,".0"),u.root,e.tileset,e)]),!0})}return e.type==="SCENEGRAPH"?Promise.resolve().then(function(){var u,c,l,h,p,v,m,A,y,f,g="",b=o.split("#"),w=b[0],E=b[1],x=(E||w).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(x&&(g=x[1]),g==="b3dm"){var M=qt(o,{key:"model.".concat(e.siblingIndex)});return Tu(M,{upAxis:e.tileset.asset.gltfUpAxis,fetcher:r.fetcher}).then(function(C){return C.object.applyMatrix4(e.transform),C.object.updateWorldMatrix(!1,!0),C.object.matrixAutoUpdate=!1,is(C.object,e),C})}if(g==="pnts"){var M=qt(o,{key:"model.".concat(e.siblingIndex)});return Pu(M,{fetcher:r.fetcher,computeBoundingBox:!1}).then(function(I){if(I.object.applyMatrix4(e.transform),I.object.updateWorldMatrix(!1,!0),I.object.matrixAutoUpdate=!1,e.boundingVolume){var P=e.boundingVolume;I.object.traverse(function(S){if(S instanceof Lr){ns.getInverse(S.matrixWorld);var F=new d.Box3;P.getBoundingBox(F),F.applyMatrix4(ns),S.geometry.boundingBox=F}})}return I})}if(g==="glb"){var M=qt(o,{key:"model.".concat(e.siblingIndex)});return Zd(M,{upAxis:e.tileset.asset.gltfUpAxis,fetcher:r.fetcher}).then(function(I){return I.object.applyMatrix4(e.transform),I.object.updateWorldMatrix(!1,!0),I.object.matrixAutoUpdate=!1,is(I.object,e),I})}if(g==="at3d"){var M=e.extras.at3d?o:qt(o,{key:"model.".concat(e.siblingIndex)});return qu(M,{textureBaseUri:(u=e.extras.at3d)===null||u===void 0?void 0:u.textureBaseUri,textureArray:(c=e.extras.at3d)===null||c===void 0?void 0:c.textureArray,textureOptions:(l=e.extras.at3d)===null||l===void 0?void 0:l.textureOptions,fetcher:r.fetcher}).then(function(I){return I.object.applyMatrix4(e.transform),I.object.updateWorldMatrix(!1,!0),I.object.matrixAutoUpdate=!1,I})}if(g==="pbm"){var M=e.extras.pbm?o:qt(o,{key:"model.".concat(e.siblingIndex)});return Qu(M,{textureBaseUri:(h=e.extras.pbm)===null||h===void 0?void 0:h.textureBaseUri,textureArray:(p=e.extras.pbm)===null||p===void 0?void 0:p.textureArray,textureOptions:(v=e.extras.pbm)===null||v===void 0?void 0:v.textureOptions,fetcher:r.fetcher}).then(function(I){return I.object.applyMatrix4(e.transform),I.object.updateWorldMatrix(!1,!0),I.object.matrixAutoUpdate=!1,I})}if(g==="dome"){var M=e.extras.dome?o:qt(o,{key:"model.".concat(e.siblingIndex)});return zu(M,{textureBaseUri:(m=e.extras.dome)===null||m===void 0?void 0:m.textureBaseUri,textureOptions:(A=e.extras.dome)===null||A===void 0?void 0:A.textureOptions,fetcher:r.fetcher}).then(function(I){return I.object.applyMatrix4(e.transform),I.object.updateWorldMatrix(!1,!0),I.object.matrixAutoUpdate=!1,I})}if(g==="domez"){var M=e.extras.domez?o:qt(o,{key:"model.".concat(e.siblingIndex)});return ju(M,{textureBaseUri:(y=e.extras.domez)===null||y===void 0?void 0:y.textureBaseUri,textureOptions:(f=e.extras.domez)===null||f===void 0?void 0:f.textureOptions,fetcher:r.fetcher}).then(function(I){return I.object.applyMatrix4(e.transform),I.object.updateWorldMatrix(!1,!0),I.object.matrixAutoUpdate=!1,I})}}).then(function(u){if(!u)return!1;var c={type:u.type,uri:u.uri,byteLength:u.byteLength,object:new bu(u.object,u.dispose)};if(i.disposed)return c.object.dispose(),a.data=void 0,a.byteLength=0,!1;if(c.object.traverse(function(v){(v instanceof Lr||v instanceof _t)&&(v.model=i.model)}),u.type==="pnts"){var l=u.object,h=l.material;h.uniforms.geometricError.value=e.geometricError}if(a.data=c,a.byteLength=c.byteLength,c.object.traverse(function(v){v.renderOrder>-4&&(v.renderOrder=-4)}),c.object.visible=!1,i.boundingBox.expandByObject(c.object),i.nodes.set(e.id,c.object),i.nodeGroup.add(c.object),e.boundingVolume){var p=Sc(e.boundingVolume,e.state.selectionDepth);p.matrixWorldNeedsUpdate=!0,p.matrixAutoUpdate=!1,p.frustumCulled=!1,p.visible=!0,i.debugBoundings.set(e.id,p),i.debugBoundingGroup.add(p)}return!0}):Promise.resolve(!1)},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=!0),i===void 0&&(i=[]);for(var a=[this.tileset.root],o=this.tileset.transform,s;s=a.pop();){var u=void 0;if(s.boundingVolume){var c=s.boundingVolume.clone().applyMatrix4(o);u=c.intersectRay(e.ray,e.far)}else u=!0;if(u){for(var l=0,h=s.children.length;l<h;l++)a.push(s.children[l]);s.selected&&s.content&&s.content.data&&s.content.data.object.intersectRaycaster(e,!1,i)}}return r&&i.sort(function(p,v){return p.distance-v.distance}),i},t.prototype.update=function(e,r){var i=this;this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld);var a=ve();if(this.needsRefined&&a-this.lastRefineTime>$d){this.lastRefineTime=a,this.tileset.cache.reset(),this.tileset.frameNumber++;var o={camera:{position:new d.Vector3().copy(r.position),direction:r.getDirection(new d.Vector3),up:new d.Vector3().copy(r.up),visible:r.visible},minLevelOfDetail:this.visible?this.minLevelOfDetail:-1,maxLevelOfDetail:this.visible?this.maxLevelOfDetail:-1,height:r.screenHeight,pixelRatio:r.pixelRatio,frameNumber:this.tileset.frameNumber,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new Pn().setFromCamera(r)},s=this.cacheCameras.map(function(p){return R(R({},o),{camera:{position:new d.Vector3().copy(p.position),direction:p.getWorldDirection(new d.Vector3),up:new d.Vector3().copy(p.up),visible:p.visible},cullingVolume:new Pn().setFromCamera(p)})});this.tileset.traverse(o,s),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(p){if(i.refineProgress[1]++,p.content&&p.state.visible){var v=p.content.loadState;if(v==="UNLOADED"||v==="LOADING"){i.refined=!1;return}}i.refineProgress[0]++}),this.loaded===!1&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(p){if(i.loaded!==!1&&p.content&&p.state.visible&&p.state.selectionDepth===0){var v=p.content.loadState;(v==="UNLOADED"||v==="LOADING")&&(i.loaded=!1)}}))}var u;this.tileset.tiles.forEach(function(p){var v=p.selected,m=p.id;u=i.nodes.get(m),u&&u.visible!==v&&(u.visible=v,i.needsRender=!0),u=i.debugBoundings.get(m),u&&u.visible!==v&&(u.visible=v,i.needsRender=!0)});for(var c;c=this.unloadTileQueue.pop();){var l=c.id,h=c.content;h&&h.data&&(h.data.object.dispose(),h.data=void 0,h.byteLength=0),u=this.nodes.get(l),u&&(this.nodeGroup.remove(u),this.nodes.delete(l),this.needsRender=!0),u=this.debugBoundings.get(l),u&&(this.debugBoundingGroup.remove(u),this.debugBoundings.delete(l),this.needsRender=!0)}},t.prototype.dispose=function(){var e=this;this.disposed=!0,this.tileset.reset();for(var r,i;r=this.unloadTileQueue.pop();){var a=r.id,o=r.content;o&&o.data&&(o.data.object.dispose(),o.data=void 0,o.byteLength=0),i=this.nodes.get(a),i&&(this.nodeGroup.remove(i),this.nodes.delete(a),this.needsRender=!0),i=this.debugBoundings.get(a),i&&(this.debugBoundingGroup.remove(i),this.debugBoundings.delete(a),this.needsRender=!0)}this.nodes.forEach(function(s,u,c){e.nodeGroup.remove(s),s.dispose(),c.delete(u)})},t.DEFAULT_MIN_LEVEL_OF_DETAIL=-1,t.DEFAULT_MAX_LEVEL_OF_DETAIL=20,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=ii.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_MAX_REQUESTS=ii.DEFAULT_MAX_REQUESTS,t}(d.Object3D);function le(n,t,e){return n<t?t:n>e?e:n}function ef(n){return-((n-.25)*360+90)/180*Math.PI}function Ia(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(!Ia(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(!Ia(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Xt(n){return typeof n=="number"}function tf(n){return(n&n-1)===0&&n!==0}var as=function(){return new Error("Invalid input.")},os=function(){return new Error("Invalid certificate.")},ss=function(){return new Error("Invalid signature.")},rf=function(n){return new Error("date(".concat(n.toString(),") expired."))},nf=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function af(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 xn(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+=xn(n[a],!1)+",";return i>-1&&(r+=xn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return xn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],c=xn(n[u],!0);c!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+c),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 of(n){return String(xn(n,!1))}function _u(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return as();for(var s=function(E){var x=_u(n[E]);if(x instanceof Error)return{value:x};if(!i)i=x.issuer;else if(i!==x.issuer)return{value:os()};a?x.expire.getTime()<a.getTime()&&(a=x.expire):a=x.expire,o?o=o.filter(function(M){return x.allowHosts.indexOf(M)!==-1}):o=x.allowHosts},u=0;u<n.length;u++){var c=s(u);if(typeof c=="object")return c.value}return Gr({issuer:i,expire:a,allowHosts:o})}var l=JSON.parse(n),h=typeof location<"u"?location.hostname:"",p=Date.now();if(typeof l!="object")return as();var v=new Date(typeof l.expire_at=="string"&&/^\d+$/.test(l.expire_at)?Number(l.expire_at):l.expire_at),m=Array.isArray(l.allow_hosts)?l.allow_hosts:[];if(h.length===0||Yr(h)||ar.filter(function(E){return kr(E,h)}).length>0){var A=String((t=l.certificate)!==null&&t!==void 0?t:"");if(A){var y=new qe;return y.readCertPEM(A),Gr({issuer:y.getSubjectString(),expire:v,allowHosts:m})}return Gr({issuer:"none",expire:v,allowHosts:m})}var f=String((e=l.certificate)!==null&&e!==void 0?e:"");if(!f)return os();var g=new qe;g.readCertPEM(f);var b=String((r=l._signature)!==null&&r!==void 0?r:"");if(!b)return ss();var w=of(af(l,["_signature"]));return Rl(w,b,g)===!1?ss():p<v.getTime()?m.filter(function(E){return kr(E,h)}).length===0?nf(h):Gr({issuer:g.getSubjectString(),expire:v,allowHosts:m}):rf(v)}var us=new d.Matrix4,Xa=new WeakMap,Ya=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.options={transform:new d.Matrix4};var r=sf(t,e,this);if(r instanceof Error)throw new Error("[PARSE FAILED]: "+r.message+`
|
|
947
947
|
Error work input:
|
|
948
|
-
`+JSON.stringify(t))}return n.prototype.toJSON=function(){return this.raw},n.parse=On,n}();function ds(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Sa(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]=Sa(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Sa(n[a],t[a]);return n}function $a(n,t){return n.indexOf(t)===0}function eo(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=Mo("".concat(a)).slice(0,7);a="".concat(a,".").concat(o,".jsonp")}if(r.shortPath===!0){var s=a.replace(n,"").split("."),u=(i=s.shift())!==null&&i!==void 0?i:"",c=s.join(".");a=It(n,Mo(u))+(c?"."+c:"")}var l=a.replace(n,"");return r.baseURL&&(a=It(r.baseURL,l)),a}function tt(n,t,e,r,i){var a=e;return yr(e)||(t&&(t=It(t,String(r))),a=It(t,a)),yr(a)||(a=It(n,a)),$a(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),eo(n,a,"panorama",i)}function fs(n,t,e){var r=t;return yr(r)||(r=It(n,t)),$a(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),eo(n,r,"model",e)}function Xn(n,t,e,r){var i=t;return yr(i)||(i=It(e,i)),yr(i)||(i=It(n,i)),$a(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),eo(n,i,"texture",r)}function cf(n,t,e){for(var r,i,a,o,s,u,c,l,h,p,v,m,A,y,f,g,b,w,E=JSON.stringify(t),x=[],M=0,C=[].concat(n);M<C.length;M++){var I=C[M];I instanceof Za?x.push.apply(x,I.raw.works):typeof I=="string"?x.push(I):x.push(JSON.stringify(I))}var P=Ku(x);if(P instanceof Error)return P;t=JSON.parse(E);var S={transform:new d.Matrix4};typeof t.debug<"u"&&(S.debug=t.debug),t.transform&&(Array.isArray(t.transform)?S.transform.fromArray(t.transform):S.transform.copy(t.transform)),t.viewerRequestVolume&&("clone"in t.viewerRequestVolume?S.viewerRequestVolume=t.viewerRequestVolume.clone():S.viewerRequestVolume=Bn(t.viewerRequestVolume)),typeof t.modelMinLevelOfDetail<"u"&&t.modelMinLevelOfDetail>=0&&(S.modelMinLevelOfDetail=t.modelMinLevelOfDetail),typeof t.modelMaxLevelOfDetail<"u"&&t.modelMaxLevelOfDetail>=0&&(S.modelMaxLevelOfDetail=t.modelMaxLevelOfDetail),typeof t.modelMaxRequests<"u"&&t.modelMaxRequests>=0&&(S.modelMaxRequests=t.modelMaxRequests),typeof t.modelMaxMemoryUsage<"u"&&t.modelMaxMemoryUsage>=0&&(S.modelMaxMemoryUsage=t.modelMaxMemoryUsage),typeof t.modelMaxScreenSpaceError<"u"&&t.modelMaxScreenSpaceError>=0&&(S.modelMaxScreenSpaceError=t.modelMaxScreenSpaceError),Object.defineProperty(e,"options",{configurable:!1,get:function(){return S}}),n=x.map(function(re){return JSON.parse(re)}).reduce(function(re,he){return Sa(re,he)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:x,options:E}}});{var F;if(t.workCode&&(typeof t.workCode=="string"?F=t.workCode:typeof t.workCode=="function"&&(F=t.workCode(n))),typeof F>"u"&&(F=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof F>"u")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return F}})}{var k=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return k}})}if(P instanceof Error)return P;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return P.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return P.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return P.allowHosts}});var O=(r=n.base_url)!==null&&r!==void 0?r:"";if(O&&O[O.length-1]!=="/"&&(O+="/"),P instanceof Error)return P;if(n.model){var L={work:e,layers:[]},N;n.model.file?N=fs(O,n.model.file,t):n.model.file_url&&(N=fs(O,n.model.file_url,t)),Object.defineProperty(L,"file",{configurable:!1,get:function(){return N}});var V;n.model.textureBase?V=Xn(O,"",n.model.textureBase,t):n.model.material_base_url?V=Xn(O,"",n.model.material_base_url,t):L.file&&(V=L.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(L,"textureBase",{configurable:!1,get:function(){return V}});var j;Array.isArray(n.model.textures)?(j=n.model.textures.map(function(re){var he,W;return Xn(O,re,(W=(he=n.model.textureBase)!==null&&he!==void 0?he:n.model.material_base_url)!==null&&W!==void 0?W:"",t)}),Object.freeze(j)):Array.isArray(n.model.material_textures)&&(j=n.model.material_textures.map(function(re){var he,W;return Xn(O,re,(W=(he=n.model.textureBase)!==null&&he!==void 0?he:n.model.material_base_url)!==null&&W!==void 0?W:"",t)}),Object.freeze(j)),Object.defineProperty(L,"textures",{configurable:!1,get:function(){return j}});var z=[];if(Array.isArray(n.model.tiles))for(var U=0,X=n.model.tiles;U<X.length;U++){var G=X[U];G&&(G.tileset||G.tileset_url)&&z.push(Object.freeze({type:(i=G.type)!==null&&i!==void 0?i:"mesh",name:(a=G.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=G.upAxis)!==null&&o!==void 0?o:G.up_axis)!==null&&s!==void 0?s:"-Y",tileset:G.tileset||G.tileset_url}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&z.push(Object.freeze({type:(u=n.model.tiles.type)!==null&&u!==void 0?u:"mesh",name:(c=n.model.tiles.name)!==null&&c!==void 0?c:"lod",upAxis:(h=(l=n.model.tiles.upAxis)!==null&&l!==void 0?l:n.model.tiles.up_axis)!==null&&h!==void 0?h:"-Y",tileset:n.model.tiles.tileset||n.model.tiles.tileset_url}));if(Array.isArray(n.model.layers))for(var K=0,Y=n.model.layers;K<Y.length;K++){var H=Y[K];H&&(H.tileset||H.tileset_url)&&z.push(Object.freeze({type:(p=H.type)!==null&&p!==void 0?p:"mesh",name:(v=H.name)!==null&&v!==void 0?v:"",upAxis:(m=H.upAxis)!==null&&m!==void 0?m:H.up_axis,tileset:H.tileset||H.tileset_url}))}Object.freeze(z),Object.defineProperty(L,"layers",{configurable:!1,get:function(){return z}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(L.file||L.layers.length)return L}})}if(P instanceof Error)return P;{var J=[];if(n.observers&&Array.isArray(n.observers)){var ne=[];n.panorama&&(Array.isArray(n.panorama)?ne=n.panorama:Array.isArray(n.panorama.list)?ne=n.panorama.list:Array.isArray(n.panorama.info)&&(ne=n.panorama.info));for(var $=function(re){var he={},W=n.observers[re];if(!W)return"break";var Oe=ne[re];if(!Oe)return"break";W=Object.assign({},W,Oe,{active:W.active!==!1&&Oe.active!==!1}),Object.defineProperty(he,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(he,"index",{configurable:!1,get:function(){return re}}),Object.defineProperty(he,"panoIndex",{configurable:!1,get:function(){return re}});var ke=Be({workCode:e.workCode,panoIndex:re});Object.defineProperty(he,"panoId",{configurable:!1,get:function(){return ke}});var Je=Object.freeze({workCode:e.workCode,panoIndex:re});Object.defineProperty(he,"pano",{configurable:!1,get:function(){return Je}});var Ze=W.active!==!1;Object.defineProperty(he,"active",{configurable:!1,get:function(){return Ze}});var De=W.loadable===!0;Object.defineProperty(he,"loadable",{configurable:!1,get:function(){return De}});var We=W.derived_id;Object.defineProperty(he,"derivedId",{configurable:!1,get:function(){return We}});var Le=W.derived_id_str;Object.defineProperty(he,"derivedIdStr",{configurable:!1,get:function(){return Le}});var ye=(w=(g=(y=(A=n.panorama)===null||A===void 0?void 0:A.pano_high_cube_base_url)!==null&&y!==void 0?y:(f=n.panorama)===null||f===void 0?void 0:f.pano_cube_base_url)!==null&&g!==void 0?g:(b=n.panorama)===null||b===void 0?void 0:b.base_url)!==null&&w!==void 0?w:"",me={up:tt(O,ye,W.images?W.images.up:W.up,re,t),down:tt(O,ye,W.images?W.images.down:W.down,re,t),right:tt(O,ye,W.images?W.images.right:W.right,re,t),left:tt(O,ye,W.images?W.images.left:W.left,re,t),front:tt(O,ye,W.images?W.images.front:W.front,re,t),back:tt(O,ye,W.images?W.images.back:W.back,re,t)},lt=W.images?W.images.depth:W.depth;lt&&(me.depth=tt(O,ye,lt,re,t));var Se=W.images?W.images.luminance:W.luminance;Se&&(me.luminance=Object.freeze({up:tt(O,ye,Se.up,re,t),down:tt(O,ye,Se.down,re,t),right:tt(O,ye,Se.right,re,t),left:tt(O,ye,Se.left,re,t),front:tt(O,ye,Se.front,re,t),back:tt(O,ye,Se.back,re,t)}));var $e=W.images?W.images.tiles:W.tiles;if($e){for(var Ue=[],At=function(Xe){var Dt=Xe.match(/\/cube_(\d+)\//);if(Dt){var dr=Number(Dt[1]);if(af(dr))return dr}return!1},Ke=function(Xe,Dt){return Xe.replace(/\/cube_(\d+)\//,function(){return"/cube_".concat(Dt,"/")})},Gt=0,Kt=$e;Gt<Kt.length;Gt++){var ze=Kt[Gt];if(typeof ze=="number"){var ot=ze,$t=At(me.front);if($t===!1)continue;var He=Math.max($t,Math.pow(2,ot)*512);if(He>2048){var ct=Ke(me.up,He),wt=Ke(me.down,He),Tt=Ke(me.right,He),er=Ke(me.left,He),mt=Ke(me.front,He),Te=Ke(me.back,He);Ue.push(Object.freeze({level:ot,size:He,up:ct,down:wt,right:Tt,left:er,front:mt,back:Te}))}else{var ct=me.up,wt=me.down,Tt=me.right,er=me.left,mt=me.front,Te=me.back;Ue.push(Object.freeze({level:ot,size:He,up:ct,down:wt,right:Tt,left:er,front:mt,back:Te}))}}else{var ot=ze.level;if(typeof ot!="number")continue;var He=ze.size;if(typeof He!="number")continue;var ct=tt(O,ye,ze.up,re,t),wt=tt(O,ye,ze.down,re,t),Tt=tt(O,ye,ze.right,re,t),er=tt(O,ye,ze.left,re,t),mt=tt(O,ye,ze.front,re,t),Te=tt(O,ye,ze.back,re,t);Ue.push(Object.freeze({level:ot,size:He,up:ct,down:wt,right:Tt,left:er,front:mt,back:Te}))}}Ue.sort(function(Xe,Dt){return Xe.level-Dt.level}),Object.freeze(Ue),Object.defineProperty(me,"tiles",{configurable:!1,get:function(){return Ue}})}Object.freeze(me),Object.defineProperty(he,"images",{configurable:!1,get:function(){return me}});var wr=new d.Vector3;if(W.position instanceof d.Vector3)wr.copy(W.position);else if(Array.isArray(W.position))wr.fromArray(W.position);else return"break";Object.freeze(wr),Object.defineProperty(he,"position",{configurable:!1,get:function(){return wr}});var kt=new d.Vector3;if(W.standingPosition instanceof d.Vector3)kt.copy(W.standingPosition);else if(Array.isArray(W.standingPosition))kt.fromArray(W.standingPosition);else if(W.standing_position instanceof d.Vector3)kt.copy(W.standing_position);else if(Array.isArray(W.standing_position))kt.fromArray(W.standing_position);else return"break";Object.freeze(kt),Object.defineProperty(he,"standingPosition",{configurable:!1,get:function(){return kt}});var ur=new d.Quaternion;if(W.quaternion instanceof d.Quaternion)ur.copy(W.quaternion);else if(Array.isArray(W.quaternion))ur.fromArray(W.quaternion);else if(W.quaternion){var Lt=W.quaternion,mn=Lt.x,Qr=Lt.y,Vr=Lt.z,lr=Lt.w;ur.set(mn,Qr,Vr,lr)}else return"break";Object.freeze(ur),Object.defineProperty(he,"quaternion",{configurable:!1,get:function(){return ur}});var cr=0;Xt(W.floorIndex)?cr=W.floorIndex:Xt(W.floor_index)?cr=W.floor_index:Xt(W.floor)&&(cr=W.floor),Object.defineProperty(he,"floorIndex",{configurable:!1,get:function(){return cr}});var rt;W.video&&(rt={},typeof W.video.source=="string"&&(rt.source=W.video.source),W.video.matrix instanceof d.Matrix4?rt.matrix=W.video.matrix.clone():Array.isArray(W.video.matrix)&&(rt.matrix=new d.Matrix4().fromArray(W.video.matrix)),W.video.size instanceof d.Vector2?rt.size=W.video.size.clone():Array.isArray(W.video.size)&&(rt.size=new d.Vector2().fromArray(W.video.size)),rt.source&&rt.matrix&&rt.size&&(he.video=rt)),Object.freeze(rt),Object.defineProperty(he,"video",{configurable:!1,get:function(){return rt}}),Array.isArray(W.accessibleNodes)?(he.accessibleNodes=W.accessibleNodes.slice(),he.accessibleIds=W.accessibleNodes.map(function(Xe){return Be({workCode:e.workCode,panoIndex:Xe})})):Array.isArray(W.accessible_nodes)&&(he.accessibleNodes=W.accessible_nodes.slice(),he.accessibleIds=W.accessible_nodes.map(function(Xe){return Be({workCode:e.workCode,panoIndex:Xe})})),Array.isArray(W.visibleNodes)?(he.visibleNodes=W.visibleNodes.slice(),he.visibleIds=W.visibleNodes.map(function(Xe){return Be({workCode:e.workCode,panoIndex:Xe})})):Array.isArray(W.visible_nodes)&&(he.visibleNodes=W.visible_nodes.slice(),he.visibleIds=W.visible_nodes.map(function(Xe){return Be({workCode:e.workCode,panoIndex:Xe})})),J[re]=he},te=0;te<n.observers.length;te++){var ae=$(te);if(ae==="break")break}}for(var ce=function(re){if(re.accessibleIds){var Oe=re.accessibleIds.filter(function(ye){return!!J.find(function(me){return me.panoId===ye})});Object.freeze(Oe),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return Oe}})}else{for(var he=[],W=0;W<J.length;W++)J[W]!==re&&(Math.abs(J[W].position.y-re.position.y)>3||J[W].position.distanceTo(re.position)>10||he.push(J[W].panoId));Object.freeze(he),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return he}})}if(re.accessibleNodes){var Je=re.accessibleNodes.filter(function(ye){return!!J.find(function(me){return me.panoIndex===ye})});Object.freeze(Je),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return Je}})}else{for(var ke=[],W=0;W<J.length;W++)J[W]!==re&&(Math.abs(J[W].position.y-re.position.y)>3||J[W].position.distanceTo(re.position)>10||ke.push(J[W].panoIndex));Object.freeze(ke),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return ke}})}if(re.visibleIds){var De=re.visibleIds.filter(function(ye){return!!J.find(function(me){return me.panoId===ye})});Object.freeze(De),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return De}})}else{var Ze=re.accessibleIds.slice();Object.freeze(Ze),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return Ze}})}if(re.visibleNodes){var Le=re.visibleNodes.filter(function(ye){return!!J.find(function(me){return me.panoIndex===ye})});Object.freeze(Le),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return Le}})}else{var We=re.accessibleNodes.slice();Object.freeze(We),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return We}})}},oe=0,fe=J;oe<fe.length;oe++){var Ie=fe[oe];ce(Ie)}Object.freeze(J),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return J}})}if(P instanceof Error)return P;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),Xt(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),Xt(n.initial.longitude)?e.initial.longitude=n.initial.longitude:Xt(n.initial.heading)&&(e.initial.longitude=nf(n.initial.heading)),Xt(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var Ae=void 0;Xt(n.initial.panoIndex)?Ae=n.initial.panoIndex:Xt(n.initial.pano_index)?Ae=n.initial.pano_index:Xt(n.initial.pano)&&(Ae=n.initial.pano),typeof Ae=="number"&&(Ae=le(Ae,0,e.observers.length-1),e.initial.panoIndex=Ae)}if(Xt(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Fe=[0,0,0].map(function(re,he){var W=Number(n.initial.offset[he]);return isNaN(W)||!isFinite(W)?0:W});e.initial.offset=new d.Vector3().fromArray(Fe)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return P instanceof Error?P:(Ja.set(e,{works:x,options:E}),e)}function On(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=Ja.get(n);if(e){if(t&&!Ia(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new Za(n,t??{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
|
|
948
|
+
`+JSON.stringify(t))}return n.prototype.toJSON=function(){return this.raw},n.parse=On,n}();function ls(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Sa(n,t){var e=ls(n),r=ls(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]=Sa(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Sa(n[a],t[a]);return n}function Ja(n,t){return n.indexOf(t)===0}function Za(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=Eo("".concat(a)).slice(0,7);a="".concat(a,".").concat(o,".jsonp")}if(r.shortPath===!0){var s=a.replace(n,"").split("."),u=(i=s.shift())!==null&&i!==void 0?i:"",c=s.join(".");a=It(n,Eo(u))+(c?"."+c:"")}var l=a.replace(n,"");return r.baseURL&&(a=It(r.baseURL,l)),a}function tt(n,t,e,r,i){var a=e;return yr(e)||(t&&(t=It(t,String(r))),a=It(t,a)),yr(a)||(a=It(n,a)),Ja(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),Za(n,a,"panorama",i)}function cs(n,t,e){var r=t;return yr(r)||(r=It(n,t)),Ja(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),Za(n,r,"model",e)}function Xn(n,t,e,r){var i=t;return yr(i)||(i=It(e,i)),yr(i)||(i=It(n,i)),Ja(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),Za(n,i,"texture",r)}function sf(n,t,e){for(var r,i,a,o,s,u,c,l,h,p,v,m,A,y,f,g,b,w,E=JSON.stringify(t),x=[],M=0,C=[].concat(n);M<C.length;M++){var I=C[M];I instanceof Ya?x.push.apply(x,I.raw.works):typeof I=="string"?x.push(I):x.push(JSON.stringify(I))}var P=_u(x);if(P instanceof Error)return P;t=JSON.parse(E);var S={transform:new d.Matrix4};typeof t.debug<"u"&&(S.debug=t.debug),t.transform&&(Array.isArray(t.transform)?S.transform.fromArray(t.transform):S.transform.copy(t.transform)),t.viewerRequestVolume&&("clone"in t.viewerRequestVolume?S.viewerRequestVolume=t.viewerRequestVolume.clone():S.viewerRequestVolume=Bn(t.viewerRequestVolume)),typeof t.modelMinLevelOfDetail<"u"&&t.modelMinLevelOfDetail>=0&&(S.modelMinLevelOfDetail=t.modelMinLevelOfDetail),typeof t.modelMaxLevelOfDetail<"u"&&t.modelMaxLevelOfDetail>=0&&(S.modelMaxLevelOfDetail=t.modelMaxLevelOfDetail),typeof t.modelMaxRequests<"u"&&t.modelMaxRequests>=0&&(S.modelMaxRequests=t.modelMaxRequests),typeof t.modelMaxMemoryUsage<"u"&&t.modelMaxMemoryUsage>=0&&(S.modelMaxMemoryUsage=t.modelMaxMemoryUsage),typeof t.modelMaxScreenSpaceError<"u"&&t.modelMaxScreenSpaceError>=0&&(S.modelMaxScreenSpaceError=t.modelMaxScreenSpaceError),Object.defineProperty(e,"options",{configurable:!1,get:function(){return S}}),n=x.map(function(re){return JSON.parse(re)}).reduce(function(re,he){return Sa(re,he)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:x,options:E}}});{var F;if(t.workCode&&(typeof t.workCode=="string"?F=t.workCode:typeof t.workCode=="function"&&(F=t.workCode(n))),typeof F>"u"&&(F=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof F>"u")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return F}})}{var k=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return k}})}if(P instanceof Error)return P;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return P.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return P.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return P.allowHosts}});var O=(r=n.base_url)!==null&&r!==void 0?r:"";if(O&&O[O.length-1]!=="/"&&(O+="/"),P instanceof Error)return P;if(n.model){var L={work:e,layers:[]},N;n.model.file?N=cs(O,n.model.file,t):n.model.file_url&&(N=cs(O,n.model.file_url,t)),Object.defineProperty(L,"file",{configurable:!1,get:function(){return N}});var V;n.model.textureBase?V=Xn(O,"",n.model.textureBase,t):n.model.material_base_url?V=Xn(O,"",n.model.material_base_url,t):L.file&&(V=L.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(L,"textureBase",{configurable:!1,get:function(){return V}});var j;Array.isArray(n.model.textures)?(j=n.model.textures.map(function(re){var he,W;return Xn(O,re,(W=(he=n.model.textureBase)!==null&&he!==void 0?he:n.model.material_base_url)!==null&&W!==void 0?W:"",t)}),Object.freeze(j)):Array.isArray(n.model.material_textures)&&(j=n.model.material_textures.map(function(re){var he,W;return Xn(O,re,(W=(he=n.model.textureBase)!==null&&he!==void 0?he:n.model.material_base_url)!==null&&W!==void 0?W:"",t)}),Object.freeze(j)),Object.defineProperty(L,"textures",{configurable:!1,get:function(){return j}});var z=[];if(Array.isArray(n.model.tiles))for(var U=0,X=n.model.tiles;U<X.length;U++){var G=X[U];G&&(G.tileset||G.tileset_url)&&z.push(Object.freeze({type:(i=G.type)!==null&&i!==void 0?i:"mesh",name:(a=G.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=G.upAxis)!==null&&o!==void 0?o:G.up_axis)!==null&&s!==void 0?s:"-Y",tileset:G.tileset||G.tileset_url}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&z.push(Object.freeze({type:(u=n.model.tiles.type)!==null&&u!==void 0?u:"mesh",name:(c=n.model.tiles.name)!==null&&c!==void 0?c:"lod",upAxis:(h=(l=n.model.tiles.upAxis)!==null&&l!==void 0?l:n.model.tiles.up_axis)!==null&&h!==void 0?h:"-Y",tileset:n.model.tiles.tileset||n.model.tiles.tileset_url}));if(Array.isArray(n.model.layers))for(var K=0,Y=n.model.layers;K<Y.length;K++){var H=Y[K];H&&(H.tileset||H.tileset_url)&&z.push(Object.freeze({type:(p=H.type)!==null&&p!==void 0?p:"mesh",name:(v=H.name)!==null&&v!==void 0?v:"",upAxis:(m=H.upAxis)!==null&&m!==void 0?m:H.up_axis,tileset:H.tileset||H.tileset_url}))}Object.freeze(z),Object.defineProperty(L,"layers",{configurable:!1,get:function(){return z}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(L.file||L.layers.length)return L}})}if(P instanceof Error)return P;{var J=[];if(n.observers&&Array.isArray(n.observers)){var ne=[];n.panorama&&(Array.isArray(n.panorama)?ne=n.panorama:Array.isArray(n.panorama.list)?ne=n.panorama.list:Array.isArray(n.panorama.info)&&(ne=n.panorama.info));for(var $=function(re){var he={},W=n.observers[re];if(!W)return"break";var Oe=ne[re];if(!Oe)return"break";W=Object.assign({},W,Oe,{active:W.active!==!1&&Oe.active!==!1}),Object.defineProperty(he,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(he,"index",{configurable:!1,get:function(){return re}}),Object.defineProperty(he,"panoIndex",{configurable:!1,get:function(){return re}});var ke=Be({workCode:e.workCode,panoIndex:re});Object.defineProperty(he,"panoId",{configurable:!1,get:function(){return ke}});var Je=Object.freeze({workCode:e.workCode,panoIndex:re});Object.defineProperty(he,"pano",{configurable:!1,get:function(){return Je}});var Ze=W.active!==!1;Object.defineProperty(he,"active",{configurable:!1,get:function(){return Ze}});var De=W.loadable===!0;Object.defineProperty(he,"loadable",{configurable:!1,get:function(){return De}});var We=W.derived_id;Object.defineProperty(he,"derivedId",{configurable:!1,get:function(){return We}});var Le=W.derived_id_str;Object.defineProperty(he,"derivedIdStr",{configurable:!1,get:function(){return Le}});var ye=(w=(g=(y=(A=n.panorama)===null||A===void 0?void 0:A.pano_high_cube_base_url)!==null&&y!==void 0?y:(f=n.panorama)===null||f===void 0?void 0:f.pano_cube_base_url)!==null&&g!==void 0?g:(b=n.panorama)===null||b===void 0?void 0:b.base_url)!==null&&w!==void 0?w:"",me={up:tt(O,ye,W.images?W.images.up:W.up,re,t),down:tt(O,ye,W.images?W.images.down:W.down,re,t),right:tt(O,ye,W.images?W.images.right:W.right,re,t),left:tt(O,ye,W.images?W.images.left:W.left,re,t),front:tt(O,ye,W.images?W.images.front:W.front,re,t),back:tt(O,ye,W.images?W.images.back:W.back,re,t)},lt=W.images?W.images.depth:W.depth;lt&&(me.depth=tt(O,ye,lt,re,t));var Se=W.images?W.images.luminance:W.luminance;Se&&(me.luminance=Object.freeze({up:tt(O,ye,Se.up,re,t),down:tt(O,ye,Se.down,re,t),right:tt(O,ye,Se.right,re,t),left:tt(O,ye,Se.left,re,t),front:tt(O,ye,Se.front,re,t),back:tt(O,ye,Se.back,re,t)}));var $e=W.images?W.images.tiles:W.tiles;if($e){for(var Ue=[],At=function(Xe){var Dt=Xe.match(/\/cube_(\d+)\//);if(Dt){var dr=Number(Dt[1]);if(tf(dr))return dr}return!1},Ke=function(Xe,Dt){return Xe.replace(/\/cube_(\d+)\//,function(){return"/cube_".concat(Dt,"/")})},Gt=0,Kt=$e;Gt<Kt.length;Gt++){var ze=Kt[Gt];if(typeof ze=="number"){var ot=ze,$t=At(me.front);if($t===!1)continue;var He=Math.max($t,Math.pow(2,ot)*512);if(He>2048){var ct=Ke(me.up,He),wt=Ke(me.down,He),Tt=Ke(me.right,He),er=Ke(me.left,He),mt=Ke(me.front,He),Te=Ke(me.back,He);Ue.push(Object.freeze({level:ot,size:He,up:ct,down:wt,right:Tt,left:er,front:mt,back:Te}))}else{var ct=me.up,wt=me.down,Tt=me.right,er=me.left,mt=me.front,Te=me.back;Ue.push(Object.freeze({level:ot,size:He,up:ct,down:wt,right:Tt,left:er,front:mt,back:Te}))}}else{var ot=ze.level;if(typeof ot!="number")continue;var He=ze.size;if(typeof He!="number")continue;var ct=tt(O,ye,ze.up,re,t),wt=tt(O,ye,ze.down,re,t),Tt=tt(O,ye,ze.right,re,t),er=tt(O,ye,ze.left,re,t),mt=tt(O,ye,ze.front,re,t),Te=tt(O,ye,ze.back,re,t);Ue.push(Object.freeze({level:ot,size:He,up:ct,down:wt,right:Tt,left:er,front:mt,back:Te}))}}Ue.sort(function(Xe,Dt){return Xe.level-Dt.level}),Object.freeze(Ue),Object.defineProperty(me,"tiles",{configurable:!1,get:function(){return Ue}})}Object.freeze(me),Object.defineProperty(he,"images",{configurable:!1,get:function(){return me}});var wr=new d.Vector3;if(W.position instanceof d.Vector3)wr.copy(W.position);else if(Array.isArray(W.position))wr.fromArray(W.position);else return"break";Object.freeze(wr),Object.defineProperty(he,"position",{configurable:!1,get:function(){return wr}});var kt=new d.Vector3;if(W.standingPosition instanceof d.Vector3)kt.copy(W.standingPosition);else if(Array.isArray(W.standingPosition))kt.fromArray(W.standingPosition);else if(W.standing_position instanceof d.Vector3)kt.copy(W.standing_position);else if(Array.isArray(W.standing_position))kt.fromArray(W.standing_position);else return"break";Object.freeze(kt),Object.defineProperty(he,"standingPosition",{configurable:!1,get:function(){return kt}});var ur=new d.Quaternion;if(W.quaternion instanceof d.Quaternion)ur.copy(W.quaternion);else if(Array.isArray(W.quaternion))ur.fromArray(W.quaternion);else if(W.quaternion){var Lt=W.quaternion,mn=Lt.x,Qr=Lt.y,Vr=Lt.z,lr=Lt.w;ur.set(mn,Qr,Vr,lr)}else return"break";Object.freeze(ur),Object.defineProperty(he,"quaternion",{configurable:!1,get:function(){return ur}});var cr=0;Xt(W.floorIndex)?cr=W.floorIndex:Xt(W.floor_index)?cr=W.floor_index:Xt(W.floor)&&(cr=W.floor),Object.defineProperty(he,"floorIndex",{configurable:!1,get:function(){return cr}});var rt;W.video&&(rt={},typeof W.video.source=="string"&&(rt.source=W.video.source),W.video.matrix instanceof d.Matrix4?rt.matrix=W.video.matrix.clone():Array.isArray(W.video.matrix)&&(rt.matrix=new d.Matrix4().fromArray(W.video.matrix)),W.video.size instanceof d.Vector2?rt.size=W.video.size.clone():Array.isArray(W.video.size)&&(rt.size=new d.Vector2().fromArray(W.video.size)),rt.source&&rt.matrix&&rt.size&&(he.video=rt)),Object.freeze(rt),Object.defineProperty(he,"video",{configurable:!1,get:function(){return rt}}),Array.isArray(W.accessibleNodes)?(he.accessibleNodes=W.accessibleNodes.slice(),he.accessibleIds=W.accessibleNodes.map(function(Xe){return Be({workCode:e.workCode,panoIndex:Xe})})):Array.isArray(W.accessible_nodes)&&(he.accessibleNodes=W.accessible_nodes.slice(),he.accessibleIds=W.accessible_nodes.map(function(Xe){return Be({workCode:e.workCode,panoIndex:Xe})})),Array.isArray(W.visibleNodes)?(he.visibleNodes=W.visibleNodes.slice(),he.visibleIds=W.visibleNodes.map(function(Xe){return Be({workCode:e.workCode,panoIndex:Xe})})):Array.isArray(W.visible_nodes)&&(he.visibleNodes=W.visible_nodes.slice(),he.visibleIds=W.visible_nodes.map(function(Xe){return Be({workCode:e.workCode,panoIndex:Xe})})),J[re]=he},te=0;te<n.observers.length;te++){var ae=$(te);if(ae==="break")break}}for(var ce=function(re){if(re.accessibleIds){var Oe=re.accessibleIds.filter(function(ye){return!!J.find(function(me){return me.panoId===ye})});Object.freeze(Oe),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return Oe}})}else{for(var he=[],W=0;W<J.length;W++)J[W]!==re&&(Math.abs(J[W].position.y-re.position.y)>3||J[W].position.distanceTo(re.position)>10||he.push(J[W].panoId));Object.freeze(he),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return he}})}if(re.accessibleNodes){var Je=re.accessibleNodes.filter(function(ye){return!!J.find(function(me){return me.panoIndex===ye})});Object.freeze(Je),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return Je}})}else{for(var ke=[],W=0;W<J.length;W++)J[W]!==re&&(Math.abs(J[W].position.y-re.position.y)>3||J[W].position.distanceTo(re.position)>10||ke.push(J[W].panoIndex));Object.freeze(ke),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return ke}})}if(re.visibleIds){var De=re.visibleIds.filter(function(ye){return!!J.find(function(me){return me.panoId===ye})});Object.freeze(De),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return De}})}else{var Ze=re.accessibleIds.slice();Object.freeze(Ze),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return Ze}})}if(re.visibleNodes){var Le=re.visibleNodes.filter(function(ye){return!!J.find(function(me){return me.panoIndex===ye})});Object.freeze(Le),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return Le}})}else{var We=re.accessibleNodes.slice();Object.freeze(We),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return We}})}},oe=0,fe=J;oe<fe.length;oe++){var Ie=fe[oe];ce(Ie)}Object.freeze(J),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return J}})}if(P instanceof Error)return P;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),Xt(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),Xt(n.initial.longitude)?e.initial.longitude=n.initial.longitude:Xt(n.initial.heading)&&(e.initial.longitude=ef(n.initial.heading)),Xt(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var Ae=void 0;Xt(n.initial.panoIndex)?Ae=n.initial.panoIndex:Xt(n.initial.pano_index)?Ae=n.initial.pano_index:Xt(n.initial.pano)&&(Ae=n.initial.pano),typeof Ae=="number"&&(Ae=le(Ae,0,e.observers.length-1),e.initial.panoIndex=Ae)}if(Xt(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Fe=[0,0,0].map(function(re,he){var W=Number(n.initial.offset[he]);return isNaN(W)||!isFinite(W)?0:W});e.initial.offset=new d.Vector3().fromArray(Fe)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return P instanceof Error?P:(Xa.set(e,{works:x,options:E}),e)}function On(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=Xa.get(n);if(e){if(t&&!Ia(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new Ya(n,t??{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
|
|
949
949
|
Error work input:
|
|
950
|
-
`+JSON.stringify(n))}}function Wu(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.options.transform));for(var u=0,c=o.observers;u<c.length;u++){var l=c[u],h={isResolved:!0,active:l.active,accessibleIds:l.accessibleIds,visibleIds:l.visibleIds,accessibleNodes:l.accessibleNodes,visibleNodes:l.visibleNodes,floorIndex:l.floorIndex,images:l.images,index:l.index,panoIndex:l.panoIndex,loadable:l.loadable,panoId:l.panoId,pano:l.pano,work:l.work,derivedId:l.derivedId,video:l.video,position:new d.Vector3().copy(l.position).applyMatrix4(s),standingPosition:new d.Vector3().copy(l.standingPosition).applyMatrix4(s),quaternion:new d.Quaternion().setFromRotationMatrix(cs.makeRotationFromQuaternion(l.quaternion).premultiply(s))};Object.freeze(h),e.push(h),r[h.panoId]=h}}Object.freeze(e);for(var p=n.slice(),v={},m=0,A=p;m<A.length;m++){var o=A[m];v[o.workCode]=o}return Object.freeze(Object.assign(p,{get initial(){return p.length>0?p[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(y){return v[y]},getResolvedObserver:function(y){var f,g;return iu(y)?r[y]:typeof y=="number"?r[Be({workCode:(g=(f=n[0])===null||f===void 0?void 0:f.workCode)!==null&&g!==void 0?g:"",panoIndex:y})]:r[Be(y)]},update:function(){for(var y={},f=0,g=p;f<g.length;f++){var b=g[f],w=b.options.transform,E=t[b.workCode];E?E.equals(w)||(E.copy(w),y[b.workCode]=!0):(t[b.workCode]=new d.Matrix4().copy(w),y[b.workCode]=!0)}for(var x=0,M=e;x<M.length;x++){var C=M[x];if(y[C.work.workCode]===!0){var I=C.work.observers[C.index],P=C.work.options.transform;C.position.copy(I.position).applyMatrix4(P),C.standingPosition.copy(I.standingPosition).applyMatrix4(P),C.quaternion.setFromRotationMatrix(cs.makeRotationFromQuaternion(I.quaternion).premultiply(P))}}}}))}var Xu=new Map;function pt(n){var t=Xu.get(n);if(t)return t;throw new Error("fetcher never registered.")}function df(n,t){return Xu.set(n,t)}var ff=new d.Vector3,hf=new d.Matrix3,ht=6378137,Yu=298.257223563;function Ta(n){for(var t=ht-ht/Yu,e=(ht*ht-t*t)/(ht*ht),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,a=1e3,o=0,s=Math.atan2(n.z,r),u=0;o++<a;){var c=Math.sin(s),l=ht/Math.sqrt(1-e*c*c);u=r/Math.cos(s)-l;var h=Math.atan2(n.z/(l*(1-e)+u),r/(l+u)),p=Math.abs(h-s);if(p<i)break;s=h}return{longitude:Math.atan2(n.y,n.x),latitude:s,altitude:u}}function pf(n){var t=ht-ht/Yu,e=(ht*ht-t*t)/(ht*ht),r=Math.sin(n.latitude),i=Math.cos(n.latitude),a=Math.sin(n.longitude),o=Math.cos(n.longitude),s=ht/Math.sqrt(1-e*r*r),u=(s+n.altitude)*i*o,c=(s+n.altitude)*i*a,l=(t*t/(ht*ht)*s+n.altitude)*r;return new d.Vector3(u,c,l)}function vf(n,t){var e=Ta(n),r=e.longitude,i=e.latitude,a=e.altitude,o=Math.sin(i),s=Math.sin(r),u=Math.cos(i),c=Math.cos(r),l=t.fromArray([-s,-o*c,u*c,0,+c,-o*s,u*s,0,0,u,o,0,0,0,0,1]),h=hf.setFromMatrix4(l),p=ff.copy(n).applyMatrix3(h).multiplyScalar(-1);l.setPosition(p);var v=new d.Matrix4().fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return l.premultiply(v),l}var hs={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 u=e.tangent.array,c=[],l=[],h=0;h<s;h++)c[h]=new d.Vector3,l[h]=new d.Vector3;var p=new d.Vector3,v=new d.Vector3,m=new d.Vector3,A=new d.Vector2,y=new d.Vector2,f=new d.Vector2,g=new d.Vector3,b=new d.Vector3;function w(U,X,G){p.fromArray(i,U*3),v.fromArray(i,X*3),m.fromArray(i,G*3),A.fromArray(o,U*2),y.fromArray(o,X*2),f.fromArray(o,G*2);var K=v.x-p.x,Y=m.x-p.x,H=v.y-p.y,J=m.y-p.y,ne=v.z-p.z,$=m.z-p.z,te=y.x-A.x,ae=f.x-A.x,ce=y.y-A.y,oe=f.y-A.y,fe=1/(te*oe-ae*ce);g.set((oe*K-ce*Y)*fe,(oe*H-ce*J)*fe,(oe*ne-ce*$)*fe),b.set((te*Y-ae*K)*fe,(te*J-ae*H)*fe,(te*$-ae*ne)*fe),c[U].add(g),c[X].add(g),c[G].add(g),l[U].add(b),l[X].add(b),l[G].add(b)}var E=n.groups;E.length===0&&(E=[{start:0,count:r.length}]);for(var h=0,x=E.length;h<x;++h)for(var M=E[h],C=M.start,I=M.count,P=C,S=C+I;P<S;P+=3)w(r[P+0],r[P+1],r[P+2]);var F=new d.Vector3,k=new d.Vector3,O=new d.Vector3,L=new d.Vector3,N,V,j;function z(U){O.fromArray(a,U*3),L.copy(O),V=c[U],F.copy(V),F.sub(O.multiplyScalar(O.dot(V))).normalize(),k.crossVectors(L,V),j=k.dot(l[U]),N=j<0?-1:1,u[U*4]=F.x,u[U*4+1]=F.y,u[U*4+2]=F.z,u[U*4+3]=N}for(var h=0,x=E.length;h<x;++h)for(var M=E[h],C=M.start,I=M.count,P=C,S=C+I;P<S;P+=3)z(r[P+0]),z(r[P+1]),z(r[P+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,u=0,c=0;c<n.length;++c){var l=n[c];if(e!==(l.index!==null))return null;for(var h in l.attributes){if(!r.has(h))return null;a[h]===void 0&&(a[h]=[]),a[h].push(l.attributes[h])}for(var h in l.morphAttributes){if(!i.has(h))return null;o[h]===void 0&&(o[h]=[]),o[h].push(l.morphAttributes[h])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(l.userData),t){var p;if(e)p=l.index.count;else if(l.attributes.position!==void 0)p=l.attributes.position.count;else return null;s.addGroup(u,p,c),u+=p}}if(e){for(var v=0,m=[],c=0;c<n.length;++c){for(var A=n[c].index,y=0;y<A.count;++y)m.push(A.getX(y)+v);v+=n[c].attributes.position.count}s.setIndex(m)}for(var h in a){var f=this.mergeBufferAttributes(a[h]);if(!f)return null;s.setAttribute(h,f)}for(var h in o){var g=o[h][0].length;if(g===0)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[h]=[];for(var c=0;c<g;++c){for(var b=[],y=0;y<o[h].length;++y)b.push(o[h][y][c]);var w=this.mergeBufferAttributes(b);if(!w)return null;s.morphAttributes[h].push(w)}}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),u=0,a=0;a<n.length;++a)s.set(n[a].array,u),u+=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),u=0,c=[],l=["getX","getY","getZ","getW"],h=["setX","setY","setZ","setW"],p=0,a=n.length;p<a;p++){var o=n[p],v=o.itemSize,m=o.count,A=new d.InterleavedBufferAttribute(s,v,u,o.normalized);c.push(A),u+=v;for(var y=0;y<m;y++)for(var f=0;f<v;f++)A[h[f]](y,o[l[f]](y))}return c},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),u={},c={},l=[],h=["getX","getY","getZ","getW"],p=0,v=s.length;p<v;p++){var m=s[p];u[m]=[];var A=n.morphAttributes[m];A&&(c[m]=new Array(A.length).fill().map(function(){return[]}))}for(var y=Math.log10(1/t),f=Math.pow(10,y),p=0;p<a;p++){for(var g=r?r.getX(p):p,b="",w=0,v=s.length;w<v;w++)for(var m=s[w],E=n.getAttribute(m),x=E.itemSize,M=0;M<x;M++)b+="".concat(~~(E[h[M]](g)*f),",");if(b in e)l.push(e[b]);else{for(var w=0,v=s.length;w<v;w++)for(var m=s[w],E=n.getAttribute(m),A=n.morphAttributes[m],x=E.itemSize,C=u[m],I=c[m],M=0;M<x;M++){var P=h[M];if(C.push(E[P](g)),A)for(var S=0,F=A.length;S<F;S++)I[S].push(A[S][P](g))}e[b]=o,l.push(o),o++}}for(var k=n.clone(),p=0,v=s.length;p<v;p++){var m=s[p],O=n.getAttribute(m),L=new O.array.constructor(u[m]),E=new d.BufferAttribute(L,O.itemSize,O.normalized);if(k.setAttribute(m,E),m in c)for(var w=0;w<c[m].length;w++){var N=n.morphAttributes[m][w],L=new N.array.constructor(c[m][w]),V=new d.BufferAttribute(L,N.itemSize,N.normalized);k.morphAttributes[m][w]=V}}return k.setIndex(l),k}};function Pa(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function Dn(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;case"DepthPanorama":return!0;default:return!1}}var Yn=new d.Vector3,ea=new d.Sphere,Jn=new d.Matrix4,ps=new d.Matrix4,vs=new d.Box3,As=new d.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Ju=new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5));function Af(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 Ba=function(n){de(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s=n.call(this)||this;return s.name="",s.coordinatesSystemTransformers=(r=e.coordinatesSystemTransformers)!==null&&r!==void 0?r:[],s.onError=(i=e.onError)!==null&&i!==void 0?i:Q,s.onShownFloorChange=(a=e.onShownFloorChange)!==null&&a!==void 0?a:Q,s.onLoad=(o=e.onLoad)!==null&&o!==void 0?o:Q,s.work=null,s.viewLayers=[],s.bounding=new d.Box3(new d.Vector3,new d.Vector3),s.floorLength=0,s.textureOptions={},s.refined=!1,s.refineProgress=[0,0],s.loaded=!1,s.matrixAutoUpdate=!1,s.renderOrder=-4,s.needsRender=!0,s.autoRefine=!0,s.materialVersion=0,s.materialParameters=R({},be),s.cacheCameras=[],s.disposed=!1,s}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.viewLayers.length===0},enumerable:!1,configurable:!0}),t.prototype.getMaterial=function(){return R({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=au(this.materialParameters,e);if(i){var a=this.materialParameters.shownFloorIndex;r!==a&&this.onShownFloorChange(a),this.materialVersion++,this.needsRender=!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},Object.defineProperty(t.prototype,"clippers",{get:function(){return this.materialParameters.clippers},set:function(e){this.setMaterial({clippers: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 u=s[o];if(u instanceof Ut){var c=u.tileset.selectedTiles;c.forEach(function(l){var h,p,v;if(!(l.boundingVolume&&l.boundingVolume.distanceTo(e.center)>e.radius)){var m=(p=(h=l.content)===null||h===void 0?void 0:h.data)===null||p===void 0?void 0:p.object;if(m&&m.visible){var A=[];if(m.traverseVisible(function(K){if(K instanceof d.Mesh){var Y=ai.get(K);if(Y){Jn.copy(K.matrixWorld),ps.getInverse(Jn),ea.copy(e).applyMatrix4(ps);var H=Y.trianglesInSphere(ea.center,ea.radius),J=new d.BufferGeometry;J.setAttribute("position",new d.BufferAttribute(H,3)),J.applyMatrix4(K.matrixWorld),J=hs.mergeVertices(J,.01),A.push(J)}}}),A.length===0)return;for(var y=["a","b","c"],f=hs.mergeBufferGeometries(A,!1),g=f.getAttribute("position").array,b=((v=f.getIndex())===null||v===void 0?void 0:v.array)||[],w=[],E=[],x=0,M=g.length;x<M;x+=3){var C=new d.Vector3(g[x],g[x+1],g[x+2]);w.push(C)}for(var x=0,M=b.length;x<M;x+=3){var I=b[x],P=b[x+1],S=b[x+2],F=new d.Vector3().crossVectors(w[P].clone().sub(w[I]),w[S].clone().sub(w[I])).normalize();E.push({a:I,b:P,c:S,normal:F})}for(var k={},x=0,M=E.length;x<M;x++)for(var O=E[x],L=0;L<3;L++){var N=O[y[L]],V=O[y[(L+1)%3]],j=[Math.min(N,V),Math.max(N,V)],z=j[0]+"-"+j[1];k[z]===void 0?k[z]={index1:j[0],index2:j[1],face1:x}:k[z].face2=x}for(var z in k){var U=k[z];if(U.face2===void 0||E[U.face1].normal.dot(E[U.face2].normal)<=i){var X=w[U.index1],G=w[U.index2];a.push(new d.Line3(X,G))}}w.length=0,E.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 u=this.children[o];u.visible&&u instanceof Ut&&u.intersectRaycaster(e,!1,a)}return r!=null&&(a=a.filter(function(c){return c.floor===r})),i&&a.sort(function(c,l){return c.distance-l.distance}),a},t.prototype.load=function(e,r){var i,a=this,o,s;if(r===void 0&&(r={}),this.work=e,this.name=this.work.workCode,!e.model)return Promise.resolve();for(var u=e.model,c=e.options,l=0,h=0,p=e.observers;h<p.length;h++){var v=p[h];l=Math.max(l,v.floorIndex)}this.floorLength=l+1;for(var m=!1,A=[],y=function(k){var O=k.tileset,L=k.upAxis,N=k.name,V=k.type;V==="mesh"&&(m=!0);var j=O.split("#"),z=j[0],U=j[1],X=(o=(U||z).split("?")[1])!==null&&o!==void 0?o:"",G=pt(e).ajax(qt(O,{key:"model.0"}),{responseType:"text"}).then(function(K){var Y=JSON.parse(K.body),H=Y.root;"lodVersion"in Y&&(L="-Y","floorInfo"in Y&&(Y.properties=Y.properties||{},Y.properties.floorInfo=Y.floorInfo.map(function(te){return{ground:-te.ground,height:te.height}}),delete Y.floorInfo),Y.asset.tilesetVersion=String(Y.lodVersion),delete Y.lodVersion);var J=H.boundingVolume?Bn(H.boundingVolume):void 0;J&&H.transform&&J.applyMatrix4(Jn.fromArray(H.transform));var ne=a.coordinatesSystemTransformers.find(function(te){return te.name===L});if(!ne)return Promise.reject(new Error("CoordinatesSystemTransformers: ".concat(L," not found.")));var $=new d.Vector3;return J&&J.getCenter($),"transformToEarthCentered"in ne?Promise.resolve().then(function(){return ne.transformToEarthCentered($)}).then(function(te){var ae,ce=new d.Matrix4,oe="";if(J){J.getCenter(Yn),Yn.applyMatrix4(te),ce.premultiply(te).premultiply(vf(Yn,Jn)).premultiply(As);var fe=Ta(Yn),Ie=fe.longitude,Ae=fe.latitude;oe=[Ae,Ie].map(function(Fe){return(Fe/Math.PI*180).toFixed(6)}).join(",")}return Y.root={refine:(ae=H.refine)!==null&&ae!==void 0?ae:"REPLACE",geometricError:Y.geometricError,transform:ce.toArray(),boundingVolume:J?J.toJson():void 0,viewerRequestVolume:c.viewerRequestVolume?c.viewerRequestVolume.toJson():void 0,children:[H]},{tilesetHeader:Y,coordinates:oe,worldToLocalTransform:ce}}):Promise.resolve().then(function(){return ne.transformToUpAxisZ($)}).then(function(te){var ae,ce=new d.Matrix4;ce.premultiply(te).premultiply(As);var oe="";return Y.root={refine:(ae=H.refine)!==null&&ae!==void 0?ae:"REPLACE",geometricError:Y.geometricError,transform:ce.toArray(),boundingVolume:J?J.toJson():void 0,viewerRequestVolume:c.viewerRequestVolume?c.viewerRequestVolume.toJson():void 0,children:[H]},{tilesetHeader:Y,coordinates:oe,worldToLocalTransform:ce}})}).then(function(K){var Y=K.tilesetHeader,H=K.coordinates,J=K.worldToLocalTransform,ne=O?O.slice(0,O.lastIndexOf("/")+1):"",$=new Ut(a,V,Y,{resourcePath:ne,search:X,fetcher:pt(e)});$.name=O,$.matrix.copy(c.transform),$.matrix.decompose($.position,$.quaternion,$.scale),$.matrixWorldNeedsUpdate=!0;var te=function(ce){var oe=pf(ce);return oe.applyMatrix4(J).applyMatrix4($.matrix)},ae=function(ce){var oe=new d.Matrix4().premultiply(J).premultiply($.matrix),fe=new d.Matrix4().getInverse(oe);return Ta(ce.clone().applyMatrix4(fe))};return{name:N,type:V,upAxis:L,coordinates:H,scene:$,error:null,coordinatesToWorldPoint:te,worldPointToCoordinates:ae}});A.push(G.catch(function(K){a.onError(K);var Y=function(J){throw new Error("coordinatesToWorldPoint require World Coordinates upAxis.")},H=function(J){throw new Error("worldPointToCoordinates require World Coordinates upAxis.")};return{name:N,type:V,scene:null,error:K,upAxis:L,coordinates:"",coordinatesToWorldPoint:Y,worldPointToCoordinates:H}}))},f=0,g=u.layers;f<g.length;f++){var b=g[f];y(b)}if(!m&&u.file){var w=u.file,E=u.textureBase,x=u.textures,M={asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{content:{uri:w},refine:"REPLACE",geometricError:0,viewerRequestVolume:c.viewerRequestVolume?c.viewerRequestVolume.toJson():void 0,extras:(i={},i[Af(w)||"at3d"]={textureBaseUri:E,textureArray:x,textureOptions:(s=r.textureOptions)!==null&&s!==void 0?s:{}},i)}},C=w.slice(0,w.lastIndexOf("/")+1),I=new Ut(this,"mesh",M,{resourcePath:C,fetcher:pt(e)});I.name=w,I.matrix.copy(c.transform),I.matrix.decompose(I.position,I.quaternion,I.scale),I.matrixWorldNeedsUpdate=!0;var P=function(k){throw new Error("coordinatesToWorldPoint require WGS84 upAxis.")},S=function(k){throw new Error("worldPointToCoordinates require WGS84 upAxis.")},F=Promise.resolve({scene:I,error:null,coordinates:"",name:"fallback",type:"mesh",upAxis:"Y",coordinatesToWorldPoint:P,worldPointToCoordinates:S});A.push(F)}return Promise.all(A).then(function(k){for(var O=[],L=[],N=[],V=0,j=k;V<j.length;V++){var z=j[V];if(a.viewLayers.push(z),z.scene){if(a.disposed){z.scene.dispose();continue}switch(a.add(z.scene),z.scene.visible=!1,z.type){case"lod":O.push(z.scene);break;case"point_cloud":L.push(z.scene);break;default:N.push(z.scene);break}}}O.length?O[0].visible=!0:L.length?L[0].visible=!0:N.length&&(N[0].visible=!0)})},t.prototype.update=function(e,r,i){var a,o,s,u,c,l;if(this.children.length){var h=this.loaded;this.refined=this.work!==null,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=this.work!==null,this.bounding.makeEmpty();for(var p=0,v=this.children;p<v.length;p++){var m=v[p];m instanceof Ut&&(this.work&&(m.minLevelOfDetail=(a=this.work.options.modelMinLevelOfDetail)!==null&&a!==void 0?a:Ut.DEFAULT_MIN_LEVEL_OF_DETAIL,m.maxLevelOfDetail=this.materialParameters.modelAlpha===0||!m.loaded?0:(o=this.work.options.modelMaxLevelOfDetail)!==null&&o!==void 0?o:Ut.DEFAULT_MAX_LEVEL_OF_DETAIL,m.maxScreenSpaceError=(s=this.work.options.modelMaxScreenSpaceError)!==null&&s!==void 0?s:Ut.DEFAULT_MAX_SCREEN_SPACE_ERROR,m.maxRequests=(u=this.work.options.modelMaxRequests)!==null&&u!==void 0?u:Ut.DEFAULT_MAX_REQUESTS,m.maxMemoryUsage=(c=this.work.options.modelMaxMemoryUsage)!==null&&c!==void 0?c:Ut.DEFAULT_MAX_MEMORY_USAGE,m.debug=(l=this.work.options.debug)!==null&&l!==void 0?l:!1,m.cacheCameras=this.cacheCameras,this.autoRefine===!1?m.needsRefined=!1:Dn(i)?m.needsRefined=this.materialParameters.modelAlpha===0||this.materialParameters.modelAlpha===1:m.needsRefined=!0,this.work.options.transform.equals(m.matrix)||(m.matrix.copy(this.work.options.transform),m.matrix.decompose(m.position,m.quaternion,m.scale),m.matrixWorldNeedsUpdate=!0)),m.update(e,r),m.boundingBox.isEmpty()||(vs.copy(m.boundingBox).applyMatrix4(m.matrix),this.bounding.union(vs)),m.needsRender===!0&&(m.needsRender=!1,this.needsRender=!0),m.refined===!1&&(this.refined=!1),this.refineProgress[0]+=m.refineProgress[0],this.refineProgress[1]+=m.refineProgress[1],m.loaded===!1&&(this.loaded=!1))}this.bounding.isEmpty()&&this.bounding.copy(Ju),h===!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 Ut&&e.dispose(),this.remove(e)},t}(d.Object3D);function ms(){var n=new d.Box3,t=Hd(be,["clippers","shownFloorIndex"]),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,u=e;s<u.length;s++){var c=u[s];if(c.visible){var l=c.intersectRaycaster(r,i,!1);l.length&&o.push.apply(o,l)}}a&&o.sort(function(h,p){return h.distance-p.distance})}return o},setMaterial:function(r){var i=au(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return R({},t)},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 u=s[o];u.updateMatrixWorld(!0),u.updateProjectionMatrix()}for(var c=0,l=e;c<l.length;c++){var h=l[c];h.setMaterial(t),h.cacheCameras=e.cacheCameras,h.update(r,i,a),h.needsRender===!0&&(e.needsRender=!0,h.needsRender=!1),h.refined===!1&&(e.refined=!1),e.refineProgress[0]+=h.refineProgress[0],e.refineProgress[1]+=h.refineProgress[1],h.loaded===!1&&(e.loaded=!1),n.union(h.bounding)}n.isEmpty()&&n.copy(Ju)}}});return e}function oi(n,t,e){return n+(t-n)*e}function mf(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 gf(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 yf(n,t,e,r){var i=r[1]-r[0];return n=wi(n,r),t=wi(t,r),t-n>i/2?oi(n+i,t,e):n-t>i/2?oi(n-i,t,e):oi(n,t,e)}function wi(n,t){var e=t[1]-t[0];return n<t[0]?wi(n+e,t):n>=t[1]?wi(n-e,t):n}function bf(n,t,e,r){return r?yf(n,t,e,r):oi(n,t,e)}var we=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=ve(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var e in t){var r=t[e];typeof r=="number"?(this.value[e]=r,this.config[e]={circle:!1}):(this.value[e]=r.value,this.config[e]={circle:r.circle})}this.keyframes=[{progress:0,value:R({},this.value)},{progress:1,value:R({},this.value)}]}return n.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-mf(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]=bf(r.value[o],i.value[o],s,this.config[o].circle)}return a}return R({},this.keyframes[this.keyframes.length-1].value)},n.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:gf(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??ve();var o=this.getProgress(i),s=this.getValue(o),u={};for(var c in this.config)u[c]=(a=t[c])!==null&&a!==void 0?a:s[c];var l=[{progress:0,value:s},{progress:1,value:u}];return this.setKeyframes(l,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??ve(),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=R({},t[t.length-1].value)):a.value=R({},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}(),gs=function(n){return n*(2-n)},wf=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}(),Ef=`
|
|
950
|
+
`+JSON.stringify(n))}}function Gu(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.options.transform));for(var u=0,c=o.observers;u<c.length;u++){var l=c[u],h={isResolved:!0,active:l.active,accessibleIds:l.accessibleIds,visibleIds:l.visibleIds,accessibleNodes:l.accessibleNodes,visibleNodes:l.visibleNodes,floorIndex:l.floorIndex,images:l.images,index:l.index,panoIndex:l.panoIndex,loadable:l.loadable,panoId:l.panoId,pano:l.pano,work:l.work,derivedId:l.derivedId,video:l.video,position:new d.Vector3().copy(l.position).applyMatrix4(s),standingPosition:new d.Vector3().copy(l.standingPosition).applyMatrix4(s),quaternion:new d.Quaternion().setFromRotationMatrix(us.makeRotationFromQuaternion(l.quaternion).premultiply(s))};Object.freeze(h),e.push(h),r[h.panoId]=h}}Object.freeze(e);for(var p=n.slice(),v={},m=0,A=p;m<A.length;m++){var o=A[m];v[o.workCode]=o}return Object.freeze(Object.assign(p,{get initial(){return p.length>0?p[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(y){return v[y]},getResolvedObserver:function(y){var f,g;return ru(y)?r[y]:typeof y=="number"?r[Be({workCode:(g=(f=n[0])===null||f===void 0?void 0:f.workCode)!==null&&g!==void 0?g:"",panoIndex:y})]:r[Be(y)]},update:function(){for(var y={},f=0,g=p;f<g.length;f++){var b=g[f],w=b.options.transform,E=t[b.workCode];E?E.equals(w)||(E.copy(w),y[b.workCode]=!0):(t[b.workCode]=new d.Matrix4().copy(w),y[b.workCode]=!0)}for(var x=0,M=e;x<M.length;x++){var C=M[x];if(y[C.work.workCode]===!0){var I=C.work.observers[C.index],P=C.work.options.transform;C.position.copy(I.position).applyMatrix4(P),C.standingPosition.copy(I.standingPosition).applyMatrix4(P),C.quaternion.setFromRotationMatrix(us.makeRotationFromQuaternion(I.quaternion).premultiply(P))}}}}))}var Ku=new Map;function pt(n){var t=Ku.get(n);if(t)return t;throw new Error("fetcher never registered.")}function uf(n,t){return Ku.set(n,t)}var lf=new d.Vector3,cf=new d.Matrix3,ht=6378137,Wu=298.257223563;function Ta(n){for(var t=ht-ht/Wu,e=(ht*ht-t*t)/(ht*ht),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,a=1e3,o=0,s=Math.atan2(n.z,r),u=0;o++<a;){var c=Math.sin(s),l=ht/Math.sqrt(1-e*c*c);u=r/Math.cos(s)-l;var h=Math.atan2(n.z/(l*(1-e)+u),r/(l+u)),p=Math.abs(h-s);if(p<i)break;s=h}return{longitude:Math.atan2(n.y,n.x),latitude:s,altitude:u}}function df(n){var t=ht-ht/Wu,e=(ht*ht-t*t)/(ht*ht),r=Math.sin(n.latitude),i=Math.cos(n.latitude),a=Math.sin(n.longitude),o=Math.cos(n.longitude),s=ht/Math.sqrt(1-e*r*r),u=(s+n.altitude)*i*o,c=(s+n.altitude)*i*a,l=(t*t/(ht*ht)*s+n.altitude)*r;return new d.Vector3(u,c,l)}function ff(n,t){var e=Ta(n),r=e.longitude,i=e.latitude,a=e.altitude,o=Math.sin(i),s=Math.sin(r),u=Math.cos(i),c=Math.cos(r),l=t.fromArray([-s,-o*c,u*c,0,+c,-o*s,u*s,0,0,u,o,0,0,0,0,1]),h=cf.setFromMatrix4(l),p=lf.copy(n).applyMatrix3(h).multiplyScalar(-1);l.setPosition(p);var v=new d.Matrix4().fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return l.premultiply(v),l}var ds={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 u=e.tangent.array,c=[],l=[],h=0;h<s;h++)c[h]=new d.Vector3,l[h]=new d.Vector3;var p=new d.Vector3,v=new d.Vector3,m=new d.Vector3,A=new d.Vector2,y=new d.Vector2,f=new d.Vector2,g=new d.Vector3,b=new d.Vector3;function w(U,X,G){p.fromArray(i,U*3),v.fromArray(i,X*3),m.fromArray(i,G*3),A.fromArray(o,U*2),y.fromArray(o,X*2),f.fromArray(o,G*2);var K=v.x-p.x,Y=m.x-p.x,H=v.y-p.y,J=m.y-p.y,ne=v.z-p.z,$=m.z-p.z,te=y.x-A.x,ae=f.x-A.x,ce=y.y-A.y,oe=f.y-A.y,fe=1/(te*oe-ae*ce);g.set((oe*K-ce*Y)*fe,(oe*H-ce*J)*fe,(oe*ne-ce*$)*fe),b.set((te*Y-ae*K)*fe,(te*J-ae*H)*fe,(te*$-ae*ne)*fe),c[U].add(g),c[X].add(g),c[G].add(g),l[U].add(b),l[X].add(b),l[G].add(b)}var E=n.groups;E.length===0&&(E=[{start:0,count:r.length}]);for(var h=0,x=E.length;h<x;++h)for(var M=E[h],C=M.start,I=M.count,P=C,S=C+I;P<S;P+=3)w(r[P+0],r[P+1],r[P+2]);var F=new d.Vector3,k=new d.Vector3,O=new d.Vector3,L=new d.Vector3,N,V,j;function z(U){O.fromArray(a,U*3),L.copy(O),V=c[U],F.copy(V),F.sub(O.multiplyScalar(O.dot(V))).normalize(),k.crossVectors(L,V),j=k.dot(l[U]),N=j<0?-1:1,u[U*4]=F.x,u[U*4+1]=F.y,u[U*4+2]=F.z,u[U*4+3]=N}for(var h=0,x=E.length;h<x;++h)for(var M=E[h],C=M.start,I=M.count,P=C,S=C+I;P<S;P+=3)z(r[P+0]),z(r[P+1]),z(r[P+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,u=0,c=0;c<n.length;++c){var l=n[c];if(e!==(l.index!==null))return null;for(var h in l.attributes){if(!r.has(h))return null;a[h]===void 0&&(a[h]=[]),a[h].push(l.attributes[h])}for(var h in l.morphAttributes){if(!i.has(h))return null;o[h]===void 0&&(o[h]=[]),o[h].push(l.morphAttributes[h])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(l.userData),t){var p;if(e)p=l.index.count;else if(l.attributes.position!==void 0)p=l.attributes.position.count;else return null;s.addGroup(u,p,c),u+=p}}if(e){for(var v=0,m=[],c=0;c<n.length;++c){for(var A=n[c].index,y=0;y<A.count;++y)m.push(A.getX(y)+v);v+=n[c].attributes.position.count}s.setIndex(m)}for(var h in a){var f=this.mergeBufferAttributes(a[h]);if(!f)return null;s.setAttribute(h,f)}for(var h in o){var g=o[h][0].length;if(g===0)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[h]=[];for(var c=0;c<g;++c){for(var b=[],y=0;y<o[h].length;++y)b.push(o[h][y][c]);var w=this.mergeBufferAttributes(b);if(!w)return null;s.morphAttributes[h].push(w)}}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),u=0,a=0;a<n.length;++a)s.set(n[a].array,u),u+=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),u=0,c=[],l=["getX","getY","getZ","getW"],h=["setX","setY","setZ","setW"],p=0,a=n.length;p<a;p++){var o=n[p],v=o.itemSize,m=o.count,A=new d.InterleavedBufferAttribute(s,v,u,o.normalized);c.push(A),u+=v;for(var y=0;y<m;y++)for(var f=0;f<v;f++)A[h[f]](y,o[l[f]](y))}return c},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),u={},c={},l=[],h=["getX","getY","getZ","getW"],p=0,v=s.length;p<v;p++){var m=s[p];u[m]=[];var A=n.morphAttributes[m];A&&(c[m]=new Array(A.length).fill().map(function(){return[]}))}for(var y=Math.log10(1/t),f=Math.pow(10,y),p=0;p<a;p++){for(var g=r?r.getX(p):p,b="",w=0,v=s.length;w<v;w++)for(var m=s[w],E=n.getAttribute(m),x=E.itemSize,M=0;M<x;M++)b+="".concat(~~(E[h[M]](g)*f),",");if(b in e)l.push(e[b]);else{for(var w=0,v=s.length;w<v;w++)for(var m=s[w],E=n.getAttribute(m),A=n.morphAttributes[m],x=E.itemSize,C=u[m],I=c[m],M=0;M<x;M++){var P=h[M];if(C.push(E[P](g)),A)for(var S=0,F=A.length;S<F;S++)I[S].push(A[S][P](g))}e[b]=o,l.push(o),o++}}for(var k=n.clone(),p=0,v=s.length;p<v;p++){var m=s[p],O=n.getAttribute(m),L=new O.array.constructor(u[m]),E=new d.BufferAttribute(L,O.itemSize,O.normalized);if(k.setAttribute(m,E),m in c)for(var w=0;w<c[m].length;w++){var N=n.morphAttributes[m][w],L=new N.array.constructor(c[m][w]),V=new d.BufferAttribute(L,N.itemSize,N.normalized);k.morphAttributes[m][w]=V}}return k.setIndex(l),k}};function Pa(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function Dn(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;case"DepthPanorama":return!0;default:return!1}}var Yn=new d.Vector3,ea=new d.Sphere,Jn=new d.Matrix4,fs=new d.Matrix4,hs=new d.Box3,ps=new d.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Xu=new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5));function hf(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 Ba=function(n){de(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s=n.call(this)||this;return s.name="",s.coordinatesSystemTransformers=(r=e.coordinatesSystemTransformers)!==null&&r!==void 0?r:[],s.onError=(i=e.onError)!==null&&i!==void 0?i:Q,s.onShownFloorChange=(a=e.onShownFloorChange)!==null&&a!==void 0?a:Q,s.onLoad=(o=e.onLoad)!==null&&o!==void 0?o:Q,s.work=null,s.viewLayers=[],s.bounding=new d.Box3(new d.Vector3,new d.Vector3),s.floorLength=0,s.textureOptions={},s.refined=!1,s.refineProgress=[0,0],s.loaded=!1,s.matrixAutoUpdate=!1,s.renderOrder=-4,s.needsRender=!0,s.autoRefine=!0,s.materialVersion=0,s.materialParameters=R({},be),s.cacheCameras=[],s.disposed=!1,s}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.viewLayers.length===0},enumerable:!1,configurable:!0}),t.prototype.getMaterial=function(){return R({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=nu(this.materialParameters,e);if(i){var a=this.materialParameters.shownFloorIndex;r!==a&&this.onShownFloorChange(a),this.materialVersion++,this.needsRender=!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},Object.defineProperty(t.prototype,"clippers",{get:function(){return this.materialParameters.clippers},set:function(e){this.setMaterial({clippers: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 u=s[o];if(u instanceof Ut){var c=u.tileset.selectedTiles;c.forEach(function(l){var h,p,v;if(!(l.boundingVolume&&l.boundingVolume.distanceTo(e.center)>e.radius)){var m=(p=(h=l.content)===null||h===void 0?void 0:h.data)===null||p===void 0?void 0:p.object;if(m&&m.visible){var A=[];if(m.traverseVisible(function(K){if(K instanceof d.Mesh){var Y=ai.get(K);if(Y){Jn.copy(K.matrixWorld),fs.getInverse(Jn),ea.copy(e).applyMatrix4(fs);var H=Y.trianglesInSphere(ea.center,ea.radius),J=new d.BufferGeometry;J.setAttribute("position",new d.BufferAttribute(H,3)),J.applyMatrix4(K.matrixWorld),J=ds.mergeVertices(J,.01),A.push(J)}}}),A.length===0)return;for(var y=["a","b","c"],f=ds.mergeBufferGeometries(A,!1),g=f.getAttribute("position").array,b=((v=f.getIndex())===null||v===void 0?void 0:v.array)||[],w=[],E=[],x=0,M=g.length;x<M;x+=3){var C=new d.Vector3(g[x],g[x+1],g[x+2]);w.push(C)}for(var x=0,M=b.length;x<M;x+=3){var I=b[x],P=b[x+1],S=b[x+2],F=new d.Vector3().crossVectors(w[P].clone().sub(w[I]),w[S].clone().sub(w[I])).normalize();E.push({a:I,b:P,c:S,normal:F})}for(var k={},x=0,M=E.length;x<M;x++)for(var O=E[x],L=0;L<3;L++){var N=O[y[L]],V=O[y[(L+1)%3]],j=[Math.min(N,V),Math.max(N,V)],z=j[0]+"-"+j[1];k[z]===void 0?k[z]={index1:j[0],index2:j[1],face1:x}:k[z].face2=x}for(var z in k){var U=k[z];if(U.face2===void 0||E[U.face1].normal.dot(E[U.face2].normal)<=i){var X=w[U.index1],G=w[U.index2];a.push(new d.Line3(X,G))}}w.length=0,E.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 u=this.children[o];u.visible&&u instanceof Ut&&u.intersectRaycaster(e,!1,a)}return r!=null&&(a=a.filter(function(c){return c.floor===r})),i&&a.sort(function(c,l){return c.distance-l.distance}),a},t.prototype.load=function(e,r){var i,a=this,o,s;if(r===void 0&&(r={}),this.work=e,this.name=this.work.workCode,!e.model)return Promise.resolve();for(var u=e.model,c=e.options,l=0,h=0,p=e.observers;h<p.length;h++){var v=p[h];l=Math.max(l,v.floorIndex)}this.floorLength=l+1;for(var m=!1,A=[],y=function(k){var O=k.tileset,L=k.upAxis,N=k.name,V=k.type;V==="mesh"&&(m=!0);var j=O.split("#"),z=j[0],U=j[1],X=(o=(U||z).split("?")[1])!==null&&o!==void 0?o:"",G=pt(e).ajax(qt(O,{key:"model.0"}),{responseType:"text"}).then(function(K){var Y=JSON.parse(K.body),H=Y.root;"lodVersion"in Y&&(L="-Y","floorInfo"in Y&&(Y.properties=Y.properties||{},Y.properties.floorInfo=Y.floorInfo.map(function(te){return{ground:-te.ground,height:te.height}}),delete Y.floorInfo),Y.asset.tilesetVersion=String(Y.lodVersion),delete Y.lodVersion);var J=H.boundingVolume?Bn(H.boundingVolume):void 0;J&&H.transform&&J.applyMatrix4(Jn.fromArray(H.transform));var ne=a.coordinatesSystemTransformers.find(function(te){return te.name===L});if(!ne)return Promise.reject(new Error("CoordinatesSystemTransformers: ".concat(L," not found.")));var $=new d.Vector3;return J&&J.getCenter($),"transformToEarthCentered"in ne?Promise.resolve().then(function(){return ne.transformToEarthCentered($)}).then(function(te){var ae,ce=new d.Matrix4,oe="";if(J){J.getCenter(Yn),Yn.applyMatrix4(te),ce.premultiply(te).premultiply(ff(Yn,Jn)).premultiply(ps);var fe=Ta(Yn),Ie=fe.longitude,Ae=fe.latitude;oe=[Ae,Ie].map(function(Fe){return(Fe/Math.PI*180).toFixed(6)}).join(",")}return Y.root={refine:(ae=H.refine)!==null&&ae!==void 0?ae:"REPLACE",geometricError:Y.geometricError,transform:ce.toArray(),boundingVolume:J?J.toJson():void 0,viewerRequestVolume:c.viewerRequestVolume?c.viewerRequestVolume.toJson():void 0,children:[H]},{tilesetHeader:Y,coordinates:oe,worldToLocalTransform:ce}}):Promise.resolve().then(function(){return ne.transformToUpAxisZ($)}).then(function(te){var ae,ce=new d.Matrix4;ce.premultiply(te).premultiply(ps);var oe="";return Y.root={refine:(ae=H.refine)!==null&&ae!==void 0?ae:"REPLACE",geometricError:Y.geometricError,transform:ce.toArray(),boundingVolume:J?J.toJson():void 0,viewerRequestVolume:c.viewerRequestVolume?c.viewerRequestVolume.toJson():void 0,children:[H]},{tilesetHeader:Y,coordinates:oe,worldToLocalTransform:ce}})}).then(function(K){var Y=K.tilesetHeader,H=K.coordinates,J=K.worldToLocalTransform,ne=O?O.slice(0,O.lastIndexOf("/")+1):"",$=new Ut(a,V,Y,{resourcePath:ne,search:X,fetcher:pt(e)});$.name=O,$.matrix.copy(c.transform),$.matrix.decompose($.position,$.quaternion,$.scale),$.matrixWorldNeedsUpdate=!0;var te=function(ce){var oe=df(ce);return oe.applyMatrix4(J).applyMatrix4($.matrix)},ae=function(ce){var oe=new d.Matrix4().premultiply(J).premultiply($.matrix),fe=new d.Matrix4().getInverse(oe);return Ta(ce.clone().applyMatrix4(fe))};return{name:N,type:V,upAxis:L,coordinates:H,scene:$,error:null,coordinatesToWorldPoint:te,worldPointToCoordinates:ae}});A.push(G.catch(function(K){a.onError(K);var Y=function(J){throw new Error("coordinatesToWorldPoint require World Coordinates upAxis.")},H=function(J){throw new Error("worldPointToCoordinates require World Coordinates upAxis.")};return{name:N,type:V,scene:null,error:K,upAxis:L,coordinates:"",coordinatesToWorldPoint:Y,worldPointToCoordinates:H}}))},f=0,g=u.layers;f<g.length;f++){var b=g[f];y(b)}if(!m&&u.file){var w=u.file,E=u.textureBase,x=u.textures,M={asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{content:{uri:w},refine:"REPLACE",geometricError:0,viewerRequestVolume:c.viewerRequestVolume?c.viewerRequestVolume.toJson():void 0,extras:(i={},i[hf(w)||"at3d"]={textureBaseUri:E,textureArray:x,textureOptions:(s=r.textureOptions)!==null&&s!==void 0?s:{}},i)}},C=w.slice(0,w.lastIndexOf("/")+1),I=new Ut(this,"mesh",M,{resourcePath:C,fetcher:pt(e)});I.name=w,I.matrix.copy(c.transform),I.matrix.decompose(I.position,I.quaternion,I.scale),I.matrixWorldNeedsUpdate=!0;var P=function(k){throw new Error("coordinatesToWorldPoint require WGS84 upAxis.")},S=function(k){throw new Error("worldPointToCoordinates require WGS84 upAxis.")},F=Promise.resolve({scene:I,error:null,coordinates:"",name:"fallback",type:"mesh",upAxis:"Y",coordinatesToWorldPoint:P,worldPointToCoordinates:S});A.push(F)}return Promise.all(A).then(function(k){for(var O=[],L=[],N=[],V=0,j=k;V<j.length;V++){var z=j[V];if(a.viewLayers.push(z),z.scene){if(a.disposed){z.scene.dispose();continue}switch(a.add(z.scene),z.scene.visible=!1,z.type){case"lod":O.push(z.scene);break;case"point_cloud":L.push(z.scene);break;default:N.push(z.scene);break}}}O.length?O[0].visible=!0:L.length?L[0].visible=!0:N.length&&(N[0].visible=!0)})},t.prototype.update=function(e,r,i){var a,o,s,u,c,l;if(this.children.length){var h=this.loaded;this.refined=this.work!==null,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=this.work!==null,this.bounding.makeEmpty();for(var p=0,v=this.children;p<v.length;p++){var m=v[p];m instanceof Ut&&(this.work&&(m.minLevelOfDetail=(a=this.work.options.modelMinLevelOfDetail)!==null&&a!==void 0?a:Ut.DEFAULT_MIN_LEVEL_OF_DETAIL,m.maxLevelOfDetail=this.materialParameters.modelAlpha===0||!m.loaded?0:(o=this.work.options.modelMaxLevelOfDetail)!==null&&o!==void 0?o:Ut.DEFAULT_MAX_LEVEL_OF_DETAIL,m.maxScreenSpaceError=(s=this.work.options.modelMaxScreenSpaceError)!==null&&s!==void 0?s:Ut.DEFAULT_MAX_SCREEN_SPACE_ERROR,m.maxRequests=(u=this.work.options.modelMaxRequests)!==null&&u!==void 0?u:Ut.DEFAULT_MAX_REQUESTS,m.maxMemoryUsage=(c=this.work.options.modelMaxMemoryUsage)!==null&&c!==void 0?c:Ut.DEFAULT_MAX_MEMORY_USAGE,m.debug=(l=this.work.options.debug)!==null&&l!==void 0?l:!1,m.cacheCameras=this.cacheCameras,this.autoRefine===!1?m.needsRefined=!1:Dn(i)?m.needsRefined=this.materialParameters.modelAlpha===0||this.materialParameters.modelAlpha===1:m.needsRefined=!0,this.work.options.transform.equals(m.matrix)||(m.matrix.copy(this.work.options.transform),m.matrix.decompose(m.position,m.quaternion,m.scale),m.matrixWorldNeedsUpdate=!0)),m.update(e,r),m.boundingBox.isEmpty()||(hs.copy(m.boundingBox).applyMatrix4(m.matrix),this.bounding.union(hs)),m.needsRender===!0&&(m.needsRender=!1,this.needsRender=!0),m.refined===!1&&(this.refined=!1),this.refineProgress[0]+=m.refineProgress[0],this.refineProgress[1]+=m.refineProgress[1],m.loaded===!1&&(this.loaded=!1))}this.bounding.isEmpty()&&this.bounding.copy(Xu),h===!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 Ut&&e.dispose(),this.remove(e)},t}(d.Object3D);function vs(){var n=new d.Box3,t=Ud(be,["clippers","shownFloorIndex"]),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,u=e;s<u.length;s++){var c=u[s];if(c.visible){var l=c.intersectRaycaster(r,i,!1);l.length&&o.push.apply(o,l)}}a&&o.sort(function(h,p){return h.distance-p.distance})}return o},setMaterial:function(r){var i=nu(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return R({},t)},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 u=s[o];u.updateMatrixWorld(!0),u.updateProjectionMatrix()}for(var c=0,l=e;c<l.length;c++){var h=l[c];h.setMaterial(t),h.cacheCameras=e.cacheCameras,h.update(r,i,a),h.needsRender===!0&&(e.needsRender=!0,h.needsRender=!1),h.refined===!1&&(e.refined=!1),e.refineProgress[0]+=h.refineProgress[0],e.refineProgress[1]+=h.refineProgress[1],h.loaded===!1&&(e.loaded=!1),n.union(h.bounding)}n.isEmpty()&&n.copy(Xu)}}});return e}function oi(n,t,e){return n+(t-n)*e}function pf(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 vf(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 Af(n,t,e,r){var i=r[1]-r[0];return n=wi(n,r),t=wi(t,r),t-n>i/2?oi(n+i,t,e):n-t>i/2?oi(n-i,t,e):oi(n,t,e)}function wi(n,t){var e=t[1]-t[0];return n<t[0]?wi(n+e,t):n>=t[1]?wi(n-e,t):n}function mf(n,t,e,r){return r?Af(n,t,e,r):oi(n,t,e)}var we=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=ve(),this.startVelocity=0,this.duration=0,this.keyframes=[];for(var e in t){var r=t[e];typeof r=="number"?(this.value[e]=r,this.config[e]={circle:!1}):(this.value[e]=r.value,this.config[e]={circle:r.circle})}this.keyframes=[{progress:0,value:R({},this.value)},{progress:1,value:R({},this.value)}]}return n.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-pf(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]=mf(r.value[o],i.value[o],s,this.config[o].circle)}return a}return R({},this.keyframes[this.keyframes.length-1].value)},n.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:vf(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??ve();var o=this.getProgress(i),s=this.getValue(o),u={};for(var c in this.config)u[c]=(a=t[c])!==null&&a!==void 0?a:s[c];var l=[{progress:0,value:s},{progress:1,value:u}];return this.setKeyframes(l,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??ve(),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=R({},t[t.length-1].value)):a.value=R({},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}(),As=function(n){return n*(2-n)},gf=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}(),yf=`
|
|
951
951
|
varying vec2 vUv;
|
|
952
952
|
void main() {
|
|
953
953
|
vUv = uv;
|
|
954
954
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
955
955
|
}
|
|
956
|
-
`,
|
|
956
|
+
`,bf=`
|
|
957
957
|
uniform vec3 baseColor;
|
|
958
958
|
uniform float circleScale;
|
|
959
959
|
uniform float ringScale;
|
|
@@ -1055,13 +1055,13 @@ void main() {
|
|
|
1055
1055
|
|
|
1056
1056
|
gl_FragColor = vec4(gl_FragColor.rgb * baseColor, gl_FragColor.a * opacity * opacity);
|
|
1057
1057
|
}
|
|
1058
|
-
|
|
1058
|
+
`,$a=function(n){de(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 we({progress:0}),a.ringMotion=new we({scale:1,opacity:1}),a.tapMotion=new we({scale:1,opacity:1}),a.loadingOpacityMotion=new we({opacity:0}),a.progressMotion=new we({progress:0}),a.progressOpacityMotion=new we({opacity:0}),a.opacityMotion=new we({opacity:0}),a.disableMotion=new we({progress:0}),a.panoMesh=new d.Mesh(gf,new d.ShaderMaterial({blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:yf,fragmentShader:bf,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=ve(),a.needsRender=!0,a}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=le(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:le(e*1.2,0,1)},100).catch(Q)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=le(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=ve()))},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 u=(e-this.currentStartTime-1500)/2e3;if(u%5<2){var c=u%1;this.panoMesh.material.uniforms.expand0.value=As(c)*this.currentMotion.value.progress,this.needsRender=!0}}{var l=(e-this.currentStartTime-1e3)/2e3;if(l%5<2){var c=l%1;this.panoMesh.material.uniforms.expand1.value=As(c)*this.currentMotion.value.progress,this.needsRender=!0}}}if(this.currentMotion.value.progress>.2&&this.progress===0&&this.loading===!1){var h=(e-this.currentStartTime-1e3)/2e3;h%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 p=this.ringMotion.value,s=p.scale,a=p.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),ms=function(n){return n*(2-n)},wf=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}(),Ef=`
|
|
1059
1059
|
varying vec2 vUv;
|
|
1060
1060
|
void main() {
|
|
1061
1061
|
vUv = uv;
|
|
1062
1062
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1063
1063
|
}
|
|
1064
|
-
`,
|
|
1064
|
+
`,xf=`
|
|
1065
1065
|
uniform vec3 baseColor;
|
|
1066
1066
|
uniform float circleScale;
|
|
1067
1067
|
uniform float circleOpacity;
|
|
@@ -1153,13 +1153,13 @@ void main() {
|
|
|
1153
1153
|
|
|
1154
1154
|
gl_FragColor = vec4(gl_FragColor.rgb * baseColor, gl_FragColor.a * opacity * opacity);
|
|
1155
1155
|
}
|
|
1156
|
-
`,
|
|
1156
|
+
`,Mf=function(n){de(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 we({progress:0}),a.tapMotion=new we({scale:1,opacity:1}),a.loadingOpacityMotion=new we({opacity:0}),a.progressMotion=new we({progress:0}),a.progressOpacityMotion=new we({opacity:0}),a.opacityMotion=new we({opacity:0}),a.disableMotion=new we({progress:0}),a.panoMesh=new d.Mesh(wf,new d.ShaderMaterial({blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:Ef,fragmentShader:xf,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=ve(),a.needsRender=!0,a}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=le(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:le(e*1.2,0,1)},100).catch(Q)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=le(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=ve()))},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 u=(e-this.currentStartTime-1500)/2e3;if(u%5<2){var c=u%1;this.panoMesh.material.uniforms.expand0.value=ms(c)*this.currentMotion.value.progress,this.needsRender=!0}}{var l=(e-this.currentStartTime-1e3)/2e3;if(l%5<2){var c=l%1;this.panoMesh.material.uniforms.expand1.value=ms(c)*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),gs=function(n){return n*(2-n)},Cf=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}(),If=`
|
|
1157
1157
|
varying vec2 vUv;
|
|
1158
1158
|
void main() {
|
|
1159
1159
|
vUv = uv;
|
|
1160
1160
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1161
1161
|
}
|
|
1162
|
-
`,
|
|
1162
|
+
`,Sf=`
|
|
1163
1163
|
#if defined(USE_MAP)
|
|
1164
1164
|
uniform sampler2D map;
|
|
1165
1165
|
uniform float mapAlpha;
|
|
@@ -1292,13 +1292,13 @@ void main() {
|
|
|
1292
1292
|
|
|
1293
1293
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);
|
|
1294
1294
|
}
|
|
1295
|
-
`,
|
|
1295
|
+
`,Tf=function(n){de(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,c,l=n.call(this)||this,h=(r=e.color)!==null&&r!==void 0?r:16777215,p=(i=e.scale)!==null&&i!==void 0?i:1,v=e.map,m=(a=e.mapAlpha)!==null&&a!==void 0?a:1,A=(o=e.mapUseColor)!==null&&o!==void 0?o:!1,y=(s=e.mapUseReverse)!==null&&s!==void 0?s:!1,f=(u=e.borderWidth)!==null&&u!==void 0?u:.1,g=(c=e.borderColor)!==null&&c!==void 0?c:16777215;return l.progress=0,l.opacity=0,l.loading=!1,l.current=!1,l.disabled=!1,l.currentMotion=new we({progress:0}),l.tapMotion=new we({scale:1,opacity:1}),l.loadingOpacityMotion=new we({opacity:0}),l.progressMotion=new we({progress:0}),l.progressOpacityMotion=new we({opacity:0}),l.opacityMotion=new we({opacity:0}),l.disableMotion=new we({progress:0}),l.panoMesh=new d.Mesh(Cf,new d.ShaderMaterial({blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:If,fragmentShader:Sf,defines:{USE_COLOR:A,USE_MAP:v!==void 0,USE_BORDER:f>0,USE_REVERSE:y},uniforms:{baseColor:{value:new d.Color(h)},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:v},mapAlpha:{value:m},borderWidth:{value:f},borderColor:{value:new d.Color(g)}}})),l.renderOrder=-2,l.panoMesh.renderOrder=-2,l.panoMesh.position.y=.004,l.panoMesh.scale.set(p,1,p),l.add(l.panoMesh),l.currentStartTime=ve(),l.needsRender=!0,l}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=le(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:le(e*1.2,0,1)},100).catch(Q)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=le(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=ve()))},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=gs(s)*this.currentMotion.value.progress,this.needsRender=!0}}{var u=(e-this.currentStartTime-1e3)/2e3;if(u%5<2){var s=u%1;this.panoMesh.material.uniforms.expand1.value=gs(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),Pf=new d.CircleBufferGeometry(.1,16),Bf=`
|
|
1296
1296
|
varying vec2 vUv;
|
|
1297
1297
|
void main() {
|
|
1298
1298
|
vUv = uv;
|
|
1299
1299
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1300
1300
|
}
|
|
1301
|
-
`,
|
|
1301
|
+
`,Rf=`
|
|
1302
1302
|
varying vec2 vUv;
|
|
1303
1303
|
|
|
1304
1304
|
float smoothDist = 0.01;
|
|
@@ -1319,28 +1319,28 @@ void main() {
|
|
|
1319
1319
|
|
|
1320
1320
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * outside * inside);
|
|
1321
1321
|
}
|
|
1322
|
-
`,
|
|
1322
|
+
`,Ff=new d.ShaderMaterial({vertexShader:Bf,fragmentShader:Rf,transparent:!0}),Si=function(n){de(t,n);function t(){var e=n.call(this)||this;return e.ringMesh=new d.Mesh(Pf,Ff),e.ringMesh.renderOrder=-2,e.add(e.ringMesh),e}return t.prototype.dispose=function(){this.remove(this.ringMesh)},t}(d.Object3D);function Tr(){return((1+Math.random())*65536|0).toString(16).substring(1)}function vt(){return(Tr()+Tr()+"-"+Tr()+"-4"+Tr().substr(0,3)+"-"+Tr()+"-"+Tr()+Tr()+Tr()).toLowerCase()}function Mn(n,t,e){var r=Math.abs(n-t);return r<.001||typeof e<"u"&&Math.abs(e-r)<.001}function Jt(n,t,e){return!Mn(n,t,e)}function Ti(n,t){return n.distanceTo(t)<.001}function Ra(n,t){return!Ti(n,t)}var Yu=new d.Vector3(0,0,0),Of=function(n){de(t,n);function t(e,r){r===void 0&&(r=Yu);var i=n.call(this)||this,a=new d.BoxBufferGeometry(e.max.x-e.min.x+r.x*2,e.max.y-e.min.y+r.y*2,e.max.z-e.min.z+r.z*2,1,1);a.clearGroups(),a.addGroup(0,a.index?a.index.count:a.attributes.position.count,0),a.applyMatrix4(new d.Matrix4().makeScale(-1,1,1)),a.computeVertexNormals();var o=new Vn;o.defines.USE_MAP=!1,o.defines.USE_UV=!1,o.defines.USE_PANO_OPACITY=!0,o.uniforms.diffuse.value=new d.Color(10066329),o.depthWrite=!1;var s=new _t(a,[o]);return s.position.copy(e.getCenter(new d.Vector3)),s.frustumCulled=!1,i.add(s),i.boundingBox=new d.Box3,i.boundingBox.setFromObject(i),i.renderOrder=s.renderOrder=-1001,i}return t}(iu);function kf(n,t){return t===void 0&&(t=Yu),new Of(n,t)}function Lf(n,t){var e=new d.Vector3(0,0,-1);e.applyQuaternion(n.quaternion);var r=t.quaternion.clone().inverse();e.applyQuaternion(r);var i=Math.atan2(e.x,-e.z),a=-Math.asin(e.y);return{theta:i,phi:a,lookAtVector:e}}var Zn=Math.PI*2;function Nr(n){return n>=0&&n<Zn?n:(n%Zn+Zn)%Zn}var Fa=Math.PI,ys=Fa*2;function ta(n,t,e){if(n===t)return t;var r=t-n,i=Math.abs(r);if(i<=e)return t;var a=r>0?1:-1;return n+a*e}function Df(n,t,e){if(n.equals(t))return new d.Vector3().copy(t);var r=new d.Vector3().subVectors(t,n);return r.lengthSq()<e*e?r.copy(t):r.setLength(e).add(n)}function bs(n,t,e){if(n.longitude===t.longitude&&n.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var r=Nr(n.longitude),i=n.latitude,a=Nr(t.longitude),o=t.latitude;a-r>Fa?r+=ys:r-a>Fa&&(r-=ys);var s=Math.sqrt(Math.pow(a-r,2)+Math.pow(o-i,2)),u=e/s;return u>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:r+(a-r)*u,latitude:i+(o-i)*u}}function Nf(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}(function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch{return!1}})();var Cn=function(){var n=typeof navigator<"u"?navigator.userAgent.toLowerCase():"node";return/android/i.test(n)||/webos/i.test(n)||/ipad|iphone|ipod/i.test(n)||/iemobile/i.test(n)||/opera mini/i.test(n)||/blackberry/i.test(n)||/windows phone/i.test(n)};function _(n,t){for(var e=!1,r={type:n,timeStamp:ve(),get defaultPrevented(){return e},preventDefault:function(){e=!0}},i=0,a=Object.keys(t);i<a.length;i++){var o=a[i];o in r||(r[o]=t[o])}return r}function Qf(){return typeof location>"u"||location.protocol!=="https:"?Promise.reject(new Error("Request DeviceOrientation Permission denied.")):typeof DeviceOrientationEvent<"u"&&typeof DeviceOrientationEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(function(n){if(n=="granted")return Promise.resolve();var t=new Error("Request DeviceOrientation Permission denied.");return Promise.reject(t)}):Promise.resolve()}function Vf(){if("xr"in navigator)return navigator.xr.isSessionSupported("immersive-vr").then(function(t){return t?Promise.resolve():Promise.reject()}).then(function(){var t={optionalFeatures:["local-floor","bounded-floor"]};return navigator.xr.requestSession("immersive-vr",t).then(function(e){return Promise.resolve(e)})});var n=new Error("Request XR Permission denied.");return Promise.reject(n)}function vr(n,t){n.mode=t.mode,n.workCode=t.workCode,n.panoIndex=t.panoIndex,n.longitude=t.longitude,n.latitude=t.latitude,n.fov=t.fov,n.offset.copy(t.offset),n.distance=t.distance}function jr(n,t){return n.workCode===t.workCode&&n.mode===t.mode&&n.panoIndex===t.panoIndex&&Mn(n.longitude,t.longitude,Math.PI*2)&&Mn(n.latitude,t.latitude)&&Mn(n.fov,t.fov)&&Ti(n.offset,t.offset)&&Mn(n.distance,t.distance)}var Uf=function(n){return Number(n)};function Ot(n,t,e){var r;t===void 0&&(t=Uf),e===void 0&&(e=!1);for(var i,a=1/0,o=0,s=n;o<s.length;o++){var u=s[o],c=t(u);c<=a&&(r=[u,c],i=r[0],a=r[1])}return isFinite(a)||(a=0),e?[i,a]:i}function St(n){for(var t in n)return!1;return!0}function Ve(n){return{longitude:n.longitude,latitude:n.latitude,fov:n.fov,offset:n.offset.clone(),distance:n.distance}}/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
1323
1323
|
* http://hammerjs.github.io/
|
|
1324
1324
|
*
|
|
1325
1325
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
1326
1326
|
* Licensed under the MIT license */var In=function(n,t,e,r){var i=["","webkit","Moz","MS","ms","o"],a=t.createElement?t.createElement("div"):r,o="function",s=Math.round,u=Math.abs,c=Date.now;function l(T,B,D){return setTimeout(g(T,D),B)}function h(T,B,D){return Array.isArray(T)?(p(T,D[B],D),!0):!1}function p(T,B,D){var q;if(T)if(T.forEach)T.forEach(B,D);else if(T.length!==r)for(q=0;q<T.length;)B.call(D,T[q],q,T),q++;else for(q in T)T.hasOwnProperty(q)&&B.call(D,T[q],q,T)}function v(T,B,D){var q="DEPRECATED METHOD: "+B+`
|
|
1327
1327
|
`+D+` AT
|
|
1328
|
-
`;return function(){var Z=new Error("get-stack-trace"),se=Z&&Z.stack?Z.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Ee=n.console&&(n.console.warn||n.console.log);return Ee&&Ee.call(n.console,q,se),T.apply(this,arguments)}}var m;typeof Object.assign!="function"?m=function(B){if(B===r||B===null)throw new TypeError("Cannot convert undefined or null to object");for(var D=Object(B),q=1;q<arguments.length;q++){var Z=arguments[q];if(Z!==r&&Z!==null)for(var se in Z)Z.hasOwnProperty(se)&&(D[se]=Z[se])}return D}:m=Object.assign;var A=v(function(B,D,q){for(var Z=Object.keys(D),se=0;se<Z.length;)(!q||q&&B[Z[se]]===r)&&(B[Z[se]]=D[Z[se]]),se++;return B},"extend","Use `assign`."),y=v(function(B,D){return A(B,D,!0)},"merge","Use `assign`.");function f(T,B,D){var q=B.prototype,Z;Z=T.prototype=Object.create(q),Z.constructor=T,Z._super=q,D&&m(Z,D)}function g(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 w(T,B){return T===r?B:T}function E(T,B,D){p(I(B),function(q){T.addEventListener(q,D,!1)})}function x(T,B,D){p(I(B),function(q){T.removeEventListener(q,D,!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 I(T){return T.trim().split(/\s+/g)}function P(T,B,D){if(T.indexOf&&!D)return T.indexOf(B);for(var q=0;q<T.length;){if(D&&T[q][D]==B||!D&&T[q]===B)return q;q++}return-1}function S(T){return Array.prototype.slice.call(T,0)}function F(T,B,D){for(var q=[],Z=[],se=0;se<T.length;){var Ee=B?T[se][B]:T[se];P(Z,Ee)<0&&q.push(T[se]),Z[se]=Ee,se++}return D&&(B?q=q.sort(function(Mt,je){return Mt[B]>je[B]}):q=q.sort()),q}function k(T,B){for(var D,q,Z=B[0].toUpperCase()+B.slice(1),se=0;se<i.length;){if(D=i[se],q=D?D+Z:B,q in T)return q;se++}return r}var O=1;function L(){return O++}function N(T){var B=T.ownerDocument||T;return B.defaultView||B.parentWindow||n}var V=/mobile|tablet|ip(ad|hone|od)|android/i,j="ontouchstart"in n,z=k(n,"PointerEvent")!==r,U=j&&V.test(navigator.userAgent),X="touch",G="pen",K="mouse",Y="kinect",H=25,J=1,ne=2,$=4,te=8,ae=1,ce=2,oe=4,fe=8,Ie=16,Ae=ce|oe,Fe=fe|Ie,re=Ae|Fe,he=["x","y"],W=["clientX","clientY"];function Oe(T,B){var D=this;this.manager=T,this.callback=B,this.element=T.element,this.target=T.options.inputTarget,this.domHandler=function(q){b(T.options.enable,[T])&&D.handler(q)},this.init()}Oe.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(N(this.element),this.evWin,this.domHandler)}};function ke(T){var B,D=T.options.inputClass;return D?B=D:z?B=wt:U?B=Lt:j?B=lr:B=ze,new B(T,Je)}function Je(T,B,D){var q=D.pointers.length,Z=D.changedPointers.length,se=B&J&&q-Z===0,Ee=B&($|te)&&q-Z===0;D.isFirst=!!se,D.isFinal=!!Ee,se&&(T.session={}),D.eventType=B,Ze(T,D),T.emit("hammer.input",D),T.recognize(D),T.session.prevInput=D}function Ze(T,B){var D=T.session,q=B.pointers,Z=q.length;D.firstInput||(D.firstInput=Le(B)),Z>1&&!D.firstMultiple?D.firstMultiple=Le(B):Z===1&&(D.firstMultiple=!1);var se=D.firstInput,Ee=D.firstMultiple,et=Ee?Ee.center:se.center,Mt=B.center=ye(q);B.timeStamp=c(),B.deltaTime=B.timeStamp-se.timeStamp,B.angle=$e(et,Mt),B.distance=Se(et,Mt),De(D,B),B.offsetDirection=lt(B.deltaX,B.deltaY);var je=me(B.deltaTime,B.deltaX,B.deltaY);B.overallVelocityX=je.x,B.overallVelocityY=je.y,B.overallVelocity=u(je.x)>u(je.y)?je.x:je.y,B.scale=Ee?At(Ee.pointers,q):1,B.rotation=Ee?Ue(Ee.pointers,q):0,B.maxPointers=D.prevInput?B.pointers.length>D.prevInput.maxPointers?B.pointers.length:D.prevInput.maxPointers:B.pointers.length,We(D,B);var rr=T.element;M(B.srcEvent.target,rr)&&(rr=B.srcEvent.target),B.target=rr}function De(T,B){var D=B.center,q=T.offsetDelta||{},Z=T.prevDelta||{},se=T.prevInput||{};(B.eventType===J||se.eventType===$)&&(Z=T.prevDelta={x:se.deltaX||0,y:se.deltaY||0},q=T.offsetDelta={x:D.x,y:D.y}),B.deltaX=Z.x+(D.x-q.x),B.deltaY=Z.y+(D.y-q.y)}function We(T,B){var D=T.lastInterval||B,q=B.timeStamp-D.timeStamp,Z,se,Ee,et;if(B.eventType!=te&&(q>H||D.velocity===r)){var Mt=B.deltaX-D.deltaX,je=B.deltaY-D.deltaY,rr=me(q,Mt,je);se=rr.x,Ee=rr.y,Z=u(rr.x)>u(rr.y)?rr.x:rr.y,et=lt(Mt,je),T.lastInterval=B}else Z=D.velocity,se=D.velocityX,Ee=D.velocityY,et=D.direction;B.velocity=Z,B.velocityX=se,B.velocityY=Ee,B.direction=et}function Le(T){for(var B=[],D=0;D<T.pointers.length;)B[D]={clientX:s(T.pointers[D].clientX),clientY:s(T.pointers[D].clientY)},D++;return{timeStamp:c(),pointers:B,center:ye(B),deltaX:T.deltaX,deltaY:T.deltaY}}function ye(T){var B=T.length;if(B===1)return{x:s(T[0].clientX),y:s(T[0].clientY)};for(var D=0,q=0,Z=0;Z<B;)D+=T[Z].clientX,q+=T[Z].clientY,Z++;return{x:s(D/B),y:s(q/B)}}function me(T,B,D){return{x:B/T||0,y:D/T||0}}function lt(T,B){return T===B?ae:u(T)>=u(B)?T<0?ce:oe:B<0?fe:Ie}function Se(T,B,D){D||(D=he);var q=B[D[0]]-T[D[0]],Z=B[D[1]]-T[D[1]];return Math.sqrt(q*q+Z*Z)}function $e(T,B,D){D||(D=he);var q=B[D[0]]-T[D[0]],Z=B[D[1]]-T[D[1]];return Math.atan2(Z,q)*180/Math.PI}function Ue(T,B){return $e(B[1],B[0],W)+$e(T[1],T[0],W)}function At(T,B){return Se(B[0],B[1],W)/Se(T[0],T[1],W)}var Ke={mousedown:J,mousemove:ne,mouseup:$},Gt="mousedown",Kt="mousemove mouseup";function ze(){this.evEl=Gt,this.evWin=Kt,this.pressed=!1,Oe.apply(this,arguments)}f(ze,Oe,{handler:function(B){var D=Ke[B.type];D&J&&(B.button===0||B.button===2)&&(this.pressed=!0),D&ne&&B.which!==1&&(D=$),this.pressed&&(D&$&&(this.pressed=!1),this.callback(this.manager,D,{pointers:[B],changedPointers:[B],pointerType:K,srcEvent:B}))}});var ot={pointerdown:J,pointermove:ne,pointerup:$,pointercancel:te,pointerout:te},$t={2:X,3:G,4:K,5:Y},He="pointerdown",ct="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(He="MSPointerDown",ct="MSPointerMove MSPointerUp MSPointerCancel");function wt(){this.evEl=He,this.evWin=ct,Oe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}f(wt,Oe,{handler:function(B){var D=this.store,q=!1,Z=!1,se=B.type.toLowerCase().replace("ms",""),Ee=ot[se],et=$t[B.pointerType]||B.pointerType,Mt=et==X,je=P(D,B.pointerId,"pointerId");Ee&J&&(B.button===0||B.button===2||Mt)?je<0&&(D.push(B),je=D.length-1):Ee&($|te)?q=!0:!Mt&&B.buttons===0&&(q=!0,Z=!0,Ee=ot.pointerup),!(je<0)&&(Z||(D[je]=B),this.callback(this.manager,Ee,{pointers:D,changedPointers:[B],pointerType:et,srcEvent:D[je]}),q&&D.splice(je,1))}});var Tt={touchstart:J,touchmove:ne,touchend:$,touchcancel:te},er="touchstart",mt="touchstart touchmove touchend touchcancel";function Te(){this.evTarget=er,this.evWin=mt,this.started=!1,Oe.apply(this,arguments)}f(Te,Oe,{handler:function(B){var D=Tt[B.type];if(D===J&&(this.started=!0),!!this.started){var q=wr.call(this,B,D);D&($|te)&&q[0].length-q[1].length===0&&(this.started=!1),this.callback(this.manager,D,{pointers:q[0],changedPointers:q[1],pointerType:X,srcEvent:B})}}});function wr(T,B){var D=S(T.touches),q=S(T.changedTouches);return B&($|te)&&(D=F(D.concat(q),"identifier",!0)),[D,q]}var kt={touchstart:J,touchmove:ne,touchend:$,touchcancel:te},ur="touchstart touchmove touchend touchcancel";function Lt(){this.evTarget=ur,this.targetIds={},Oe.apply(this,arguments)}f(Lt,Oe,{handler:function(B){var D=kt[B.type],q=mn.call(this,B,D);q&&this.callback(this.manager,D,{pointers:q[0],changedPointers:q[1],pointerType:X,srcEvent:B})}});function mn(T,B){var D=S(T.touches),q=this.targetIds;if(B&(J|ne)&&D.length===1)return q[D[0].identifier]=!0,[D,D];var Z,se,Ee=S(T.changedTouches),et=[],Mt=this.target;if(se=D.filter(function(je){return M(je.target,Mt)}),B===J)for(Z=0;Z<se.length;)q[se[Z].identifier]=!0,Z++;for(Z=0;Z<Ee.length;)q[Ee[Z].identifier]&&et.push(Ee[Z]),B&($|te)&&delete q[Ee[Z].identifier],Z++;if(et.length)return[F(se.concat(et),"identifier",!0),et]}var Qr=2500,Vr=25;function lr(){Oe.apply(this,arguments);var T=g(this.handler,this);this.touch=new Lt(this.manager,T),this.mouse=new ze(this.manager,T),this.primaryTouch=null,this.lastTouches=[]}f(lr,Oe,{handler:function(B,D,q){var Z=q.pointerType==X,se=q.pointerType==K;if(!(se&&q.sourceCapabilities&&q.sourceCapabilities.firesTouchEvents)){if(Z)cr.call(this,D,q);else if(se&&Xe.call(this,q))return;this.callback(B,D,q)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function cr(T,B){T&J?(this.primaryTouch=B.changedPointers[0].identifier,rt.call(this,B)):T&($|te)&&rt.call(this,B)}function rt(T){var B=T.changedPointers[0];if(B.identifier===this.primaryTouch){var D={x:B.clientX,y:B.clientY};this.lastTouches.push(D);var q=this.lastTouches,Z=function(){var se=q.indexOf(D);se>-1&&q.splice(se,1)};setTimeout(Z,Qr)}}function Xe(T){for(var B=T.srcEvent.clientX,D=T.srcEvent.clientY,q=0;q<this.lastTouches.length;q++){var Z=this.lastTouches[q],se=Math.abs(B-Z.x),Ee=Math.abs(D-Z.y);if(se<=Vr&&Ee<=Vr)return!0}return!1}var Dt=a?k(a.style,"touchAction"):r,dr=Dt!==r,gn="compute",qn="auto",Ur="manipulation",dt="none",st="pan-x",ft="pan-y",Et=qr();function xt(T,B){this.manager=T,this.set(B)}xt.prototype={set:function(T){T==gn&&(T=this.compute()),dr&&this.manager.element.style&&Et[T]&&(this.manager.element.style[Dt]=T),this.actions=T.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var T=[];return p(this.manager.recognizers,function(B){b(B.options.enable,[B])&&(T=T.concat(B.getTouchAction()))}),zn(T.join(" "))},preventDefaults:function(T){var B=T.srcEvent,D=T.offsetDirection;if(this.manager.session.prevented){B.preventDefault();return}var q=this.actions,Z=C(q,dt)&&!Et[dt],se=C(q,ft)&&!Et[ft],Ee=C(q,st)&&!Et[st];if(Z){var et=T.pointers.length===1,Mt=T.distance<2,je=T.deltaTime<250;if(et&&Mt&&je)return}if(!(Ee&&se)&&(Z||se&&D&Ae||Ee&&D&Fe))return this.preventSrc(B)},preventSrc:function(T){this.manager.session.prevented=!0,T.preventDefault()}};function zn(T){if(C(T,dt))return dt;var B=C(T,st),D=C(T,ft);return B&&D?dt:B||D?B?st:ft:C(T,Ur)?Ur:qn}function qr(){if(!dr)return!1;var T={},B=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(D){T[D]=B?n.CSS.supports("touch-action",D):!0}),T}var zr=1,Nt=2,Jr=4,Er=8,fr=Er,yn=16,tr=32;function hr(T){this.options=m({},this.defaults,T||{}),this.id=L(),this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=zr,this.simultaneous={},this.requireFail=[]}hr.prototype={defaults:{},set:function(T){return m(this.options,T),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(T){if(h(T,"recognizeWith",this))return this;var B=this.simultaneous;return T=Hn(T,this),B[T.id]||(B[T.id]=T,T.recognizeWith(this)),this},dropRecognizeWith:function(T){return h(T,"dropRecognizeWith",this)?this:(T=Hn(T,this),delete this.simultaneous[T.id],this)},requireFailure:function(T){if(h(T,"requireFailure",this))return this;var B=this.requireFail;return T=Hn(T,this),P(B,T)===-1&&(B.push(T),T.requireFailure(this)),this},dropRequireFailure:function(T){if(h(T,"dropRequireFailure",this))return this;T=Hn(T,this);var B=P(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,D=this.state;function q(Z){B.manager.emit(Z,T)}D<Er&&q(B.options.event+po(D)),q(B.options.event),T.additionalEvent&&q(T.additionalEvent),D>=Er&&q(B.options.event+po(D))},tryEmit:function(T){if(this.canEmit())return this.emit(T);this.state=tr},canEmit:function(){for(var T=0;T<this.requireFail.length;){if(!(this.requireFail[T].state&(tr|zr)))return!1;T++}return!0},recognize:function(T){var B=m({},T);if(!b(this.options.enable,[this,B])){this.reset(),this.state=tr;return}this.state&(fr|yn|tr)&&(this.state=zr),this.state=this.process(B),this.state&(Nt|Jr|Er|yn)&&this.tryEmit(B)},process:function(T){},getTouchAction:function(){},reset:function(){}};function po(T){return T&yn?"cancel":T&Er?"end":T&Jr?"move":T&Nt?"start":""}function vo(T){return T==Ie?"down":T==fe?"up":T==ce?"left":T==oe?"right":""}function Hn(T,B){var D=B.manager;return D?D.get(T):T}function Wt(){hr.apply(this,arguments)}f(Wt,hr,{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,D=T.eventType,q=B&(Nt|Jr),Z=this.attrTest(T);return q&&(D&te||!Z)?B|yn:q||Z?D&$?B|Er:B&Nt?B|Jr:Nt:tr}});function jn(){Wt.apply(this,arguments),this.pX=null,this.pY=null}f(jn,Wt,{defaults:{event:"pan",threshold:10,pointers:1,direction:re},getTouchAction:function(){var T=this.options.direction,B=[];return T&Ae&&B.push(ft),T&Fe&&B.push(st),B},directionTest:function(T){var B=this.options,D=!0,q=T.distance,Z=T.direction,se=T.deltaX,Ee=T.deltaY;return Z&B.direction||(B.direction&Ae?(Z=se===0?ae:se<0?ce:oe,D=se!=this.pX,q=Math.abs(T.deltaX)):(Z=Ee===0?ae:Ee<0?fe:Ie,D=Ee!=this.pY,q=Math.abs(T.deltaY))),T.direction=Z,D&&q>B.threshold&&Z&B.direction},attrTest:function(T){return Wt.prototype.attrTest.call(this,T)&&(this.state&Nt||!(this.state&Nt)&&this.directionTest(T))},emit:function(T){this.pX=T.deltaX,this.pY=T.deltaY;var B=vo(T.direction);B&&(T.additionalEvent=this.options.event+B),this._super.emit.call(this,T)}});function Oi(){Wt.apply(this,arguments)}f(Oi,Wt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[dt]},attrTest:function(T){return this._super.attrTest.call(this,T)&&(Math.abs(T.scale-1)>this.options.threshold||this.state&Nt)},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 ki(){hr.apply(this,arguments),this._timer=null,this._input=null}f(ki,hr,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[qn]},process:function(T){var B=this.options,D=T.pointers.length===B.pointers,q=T.distance<B.threshold,Z=T.deltaTime>B.time;if(this._input=T,!q||!D||T.eventType&($|te)&&!Z)this.reset();else if(T.eventType&J)this.reset(),this._timer=l(function(){this.state=fr,this.tryEmit()},B.time,this);else if(T.eventType&$)return fr;return tr},reset:function(){clearTimeout(this._timer)},emit:function(T){this.state===fr&&(T&&T.eventType&$?this.manager.emit(this.options.event+"up",T):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}});function Li(){Wt.apply(this,arguments)}f(Li,Wt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[dt]},attrTest:function(T){return this._super.attrTest.call(this,T)&&(Math.abs(T.rotation)>this.options.threshold||this.state&Nt)}});function Di(){Wt.apply(this,arguments)}f(Di,Wt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ae|Fe,pointers:1},getTouchAction:function(){return jn.prototype.getTouchAction.call(this)},attrTest:function(T){var B=this.options.direction,D;return B&(Ae|Fe)?D=T.overallVelocity:B&Ae?D=T.overallVelocityX:B&Fe&&(D=T.overallVelocityY),this._super.attrTest.call(this,T)&&B&T.offsetDirection&&T.distance>this.options.threshold&&T.maxPointers==this.options.pointers&&u(D)>this.options.velocity&&T.eventType&$},emit:function(T){var B=vo(T.offsetDirection);B&&this.manager.emit(this.options.event+B,T),this.manager.emit(this.options.event,T)}});function _n(){hr.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}f(_n,hr,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ur]},process:function(T){var B=this.options,D=T.pointers.length===B.pointers,q=T.distance<B.threshold,Z=T.deltaTime<B.time;if(this.reset(),T.eventType&J&&this.count===0)return this.failTimeout();if(q&&Z&&D){if(T.eventType!=$)return this.failTimeout();var se=this.pTime?T.timeStamp-this.pTime<B.interval:!0,Ee=!this.pCenter||Se(this.pCenter,T.center)<B.posThreshold;this.pTime=T.timeStamp,this.pCenter=T.center,!Ee||!se?this.count=1:this.count+=1,this._input=T;var et=this.count%B.taps;if(et===0)return this.hasRequireFailures()?(this._timer=l(function(){this.state=fr,this.tryEmit()},B.interval,this),Nt):fr}return tr},failTimeout:function(){return this._timer=l(function(){this.state=tr},this.options.interval,this),tr},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==fr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Zr(T,B){return B=B||{},B.recognizers=w(B.recognizers,Zr.defaults.preset),new Ni(T,B)}Zr.VERSION="2.0.7",Zr.defaults={domEvents:!1,touchAction:gn,enable:!0,inputTarget:null,inputClass:null,preset:[[Li,{enable:!1}],[Oi,{enable:!1},["rotate"]],[Di,{direction:Ae}],[jn,{direction:Ae},["swipe"]],[_n],[_n,{event:"doubletap",taps:2},["tap"]],[ki]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var m0=1,Ao=2;function Ni(T,B){this.options=m({},Zr.defaults,B||{}),this.options.inputTarget=this.options.inputTarget||T,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=T,this.input=ke(this),this.touchAction=new xt(this,this.options.touchAction),mo(this,!0),p(this.options.recognizers,function(D){var q=this.add(new D[0](D[1]));D[2]&&q.recognizeWith(D[2]),D[3]&&q.requireFailure(D[3])},this)}Ni.prototype={set:function(T){return m(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?Ao:m0},recognize:function(T){var B=this.session;if(!B.stopped){this.touchAction.preventDefaults(T);var D,q=this.recognizers,Z=B.curRecognizer;(!Z||Z&&Z.state&fr)&&(Z=B.curRecognizer=null);for(var se=0;se<q.length;)D=q[se],B.stopped!==Ao&&(!Z||D==Z||D.canRecognizeWith(Z))?D.recognize(T):D.reset(),!Z&&D.state&(Nt|Jr|Er)&&(Z=B.curRecognizer=D),se++}},get:function(T){if(T instanceof hr)return T;for(var B=this.recognizers,D=0;D<B.length;D++)if(B[D].options.event==T)return B[D];return null},add:function(T){if(h(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(h(T,"remove",this))return this;if(T=this.get(T),T){var B=this.recognizers,D=P(B,T);D!==-1&&(B.splice(D,1),this.touchAction.update())}return this},on:function(T,B){if(T!==r&&B!==r){var D=this.handlers;return p(I(T),function(q){D[q]=D[q]||[],D[q].push(B)}),this}},off:function(T,B){if(T!==r){var D=this.handlers;return p(I(T),function(q){B?D[q]&&D[q].splice(P(D[q],B),1):delete D[q]}),this}},emit:function(T,B){this.options.domEvents&&g0(T,B);var D=this.handlers[T]&&this.handlers[T].slice();if(!(!D||!D.length)){B.type=T,B.preventDefault=function(){B.srcEvent.preventDefault()};for(var q=0;q<D.length;)D[q](B),q++}},destroy:function(){this.element&&mo(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function mo(T,B){var D=T.element;if(D.style){var q;p(T.options.cssProps,function(Z,se){q=k(D.style,se),B?(T.oldCssProps[q]=D.style[q],D.style[q]=Z):D.style[q]=T.oldCssProps[q]||""}),B||(T.oldCssProps={})}}function g0(T,B){var D=t.createEvent("Event");D.initEvent(T,!0,!0),D.gesture=B,B.target.dispatchEvent(D)}return m(Zr,{INPUT_START:J,INPUT_MOVE:ne,INPUT_END:$,INPUT_CANCEL:te,STATE_POSSIBLE:zr,STATE_BEGAN:Nt,STATE_CHANGED:Jr,STATE_ENDED:Er,STATE_RECOGNIZED:fr,STATE_CANCELLED:yn,STATE_FAILED:tr,DIRECTION_NONE:ae,DIRECTION_LEFT:ce,DIRECTION_RIGHT:oe,DIRECTION_UP:fe,DIRECTION_DOWN:Ie,DIRECTION_HORIZONTAL:Ae,DIRECTION_VERTICAL:Fe,DIRECTION_ALL:re,Manager:Ni,Input:Oe,TouchAction:xt,TouchInput:Lt,MouseInput:ze,PointerEventInput:wt,TouchMouseInput:lr,SingleTouchInput:Te,Recognizer:hr,AttrRecognizer:Wt,Tap:_n,Pan:jn,Swipe:Di,Pinch:Oi,Rotate:Li,Press:ki,on:E,off:x,each:p,merge:y,extend:A,assign:m,inherit:f,bindFn:g,prefixed:k}),Zr}(typeof window<"u"?window:{},typeof document<"u"?document:{});function xs(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 ro=function(n){de(t,n);function t(e){var r,i,a,o,s,u,c=n.call(this)||this,l=t.parseArgs(e);return c.mode="",c.pending=new Set,c.userAction=l.initial.userAction,c.destroyed=!1,c.ident=l.ident,c.scene=l.scene,c.xrCustomObjectsScene=l.xrCustomObjectsScene,c.helper=l.helper,c.boundingMesh=l.boundingMesh,c.camera=l.camera,c.renderer=l.renderer,c.scissor=l.scissor,c.element=l.element,c.models=l.models,c.enableWheel=l.enableWheel,c.enableIOSEDR=(r=l.enableIOSEDR)!==null&&r!==void 0?r:!1,c.enableEDL=(i=l.enableEDL)!==null&&i!==void 0?i:!0,c.enableHQ=(a=l.enableHQ)!==null&&a!==void 0?a:!0,c.works=l.works,c.imageOptions=l.imageOptions,c.videoTexture=l.videoTexture,c.extraElements=l.extraElements,c.initial=l.initial,c.currentPano=typeof c.initial.state.panoIndex=="number"?{workCode:(u=(o=c.initial.state.workCode)!==null&&o!==void 0?o:(s=l.works[0])===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",panoIndex:c.initial.state.panoIndex}:{workCode:c.initial.currentState.workCode,panoIndex:c.initial.currentState.panoIndex},c.needsRender=!0,c.cameraMotion=new we({longitude:{value:c.camera.pose.longitude,circle:[0,Math.PI*2]},latitude:c.camera.pose.latitude,fov:c.camera.pose.fov}),c.inMomentumMovement=null,c.eventUnbinds=[l.element].concat(l.extraElements||[]).map(function(h){return c.bindEvents(h)}),c.pending.add("init-animation"),c.initAnimationReady=new Promise(function(h){it.shared.add(function(){c.initAnimation().then(function(){c.pending.delete("init-animation"),h()})},!0)}),c}return t.parseArgs=function(e){return e instanceof t?e:R({},e)},t.initAnimationEndState=function(e){var r,i,a,o,s,u,c,l,h=this.parseArgs(e),p=h.initial,v=p.state,m=p.currentState,A=typeof v.panoIndex=="number"?{workCode:(a=(r=v.workCode)!==null&&r!==void 0?r:(i=h.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:v.panoIndex}:{workCode:m.workCode,panoIndex:m.panoIndex};return R(R({},A),{mode:"",longitude:(o=v.longitude)!==null&&o!==void 0?o:m.longitude,latitude:(s=v.latitude)!==null&&s!==void 0?s:m.latitude,fov:(u=v.fov)!==null&&u!==void 0?u:m.fov,offset:(c=v.offset)!==null&&c!==void 0?c:m.offset,distance:(l=v.distance)!==null&&l!==void 0?l:m.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(){this.needsRender=!0},t.prototype.updateModel=function(e){this.needsRender=!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),St(i)&&this.setCamera(i)}},t.prototype.render=function(){this.renderer.render(this.scene,this.camera)},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,u=e;s<u.length;s++){var c=u[s];o.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.cameraMotion.setKeyframes(o,r)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1];return R(R({},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 u=(r=e.longitude)!==null&&r!==void 0?r:this.camera.pose.longitude,c=(i=e.latitude)!==null&&i!==void 0?i:this.camera.pose.latitude,l=(a=e.fov)!==null&&a!==void 0?a:this.camera.pose.fov,h=(o=e.distance)!==null&&o!==void 0?o:this.camera.pose.distance,p=(s=e.offset)!==null&&s!==void 0?s:this.camera.pose.offset,v=Jt(u,this.camera.pose.longitude,Math.PI*2)||Jt(c,this.camera.pose.latitude),m=Jt(l,this.camera.pose.fov),A=Jt(h,this.camera.pose.distance),y=Ra(p,this.camera.pose.offset);(m||v||y||A)&&(this.camera.setFromPose({longitude:u,latitude:c,fov:l,distance:h,offset:p}),this.emit("camera.update",_("camera.update",{userAction:this.userAction,state:R(R({},this.currentPano),{mode:this.mode,longitude:u,latitude:c,fov:l,offset:p,distance:h})})),this.needsRender=!0)},t.prototype.stopMomentumMovement=function(){if(this.inMomentumMovement&&this.inMomentumMovement.event&&!this.inMomentumMovement.event.defaultPrevented&&!this.inMomentumMovement.event.isFinal){var e=_("gesture.momentum",R(R({},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.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 xs(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(C){var I=xs(C,r.element,r.scissor);return!(Math.abs(I.x)>1||Math.abs(I.y)>1)},a=new In.Manager(e),o=function(C){var I=C.session;return I.firstInput||null};a.add(new In.Pan({threshold:10,pointers:0})),a.add(new In.Tap({interval:410})),a.add(new In.Pinch({threshold:0,pointers:2})),a.on("panstart pan",function(C){var I=o(a);if(!(I&&!i(I.center))){var P=_("gesture.pan",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(S){var F=r.relativeClientPosition(S),k=new d.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(F,r.camera),{x:S.x,y:S.y,delta:0,buttons:0,coords:F,raycaster:k}}),isFirst:C.isFirst,isFinal:C.isFinal,scale:C.scale,center:function(S){var F=r.relativeClientPosition(S),k=new d.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(F,r.camera),{x:S.x,y:S.y,delta:0,buttons:0,coords:F,raycaster:k}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onPanGesture(P),y()}}),a.on("tap",function(C){if(!(C.pointerType==="mouse"&&C.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var P=_("gesture.tap",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(S){var F=r.relativeClientPosition(S),k=new d.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(F,r.camera),{x:S.x,y:S.y,delta:0,buttons:0,coords:F,raycaster:k}}),isFirst:!0,isFinal:!0,scale:C.scale,center:function(S){var F=r.relativeClientPosition(S),k=new d.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(F,r.camera),{x:S.x,y:S.y,delta:0,buttons:0,coords:F,raycaster:k}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onTapGesture(P),y()}}}),a.on("pinchstart pinch pinchend",function(C){var I=o(a);if(!(I&&!i(I.center))){var P=_("gesture.pinch",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(S){var F,k=r.relativeClientPosition(S),O=new d.Raycaster;return O.params.Points={threshold:.1},O.setFromCamera(k,r.camera),{x:S.x,y:S.y,delta:(F=S.delta)!==null&&F!==void 0?F:0,buttons:0,coords:k,raycaster:O}}),isFirst:C.type==="pinchstart",isFinal:C.type==="pinchend",scale:C.scale,center:function(S){var F=r.relativeClientPosition(S),k=new d.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(F,r.camera),{x:S.x,y:S.y,delta:0,buttons:0,coords:F,raycaster:k}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onPinchGesture(P),y()}});var s=null,u=null,c=function(C,I,P){var S={x:P.clientX,y:P.clientY},F=r.relativeClientPosition(S),k=new d.Raycaster;k.params.Points={threshold:.1},k.setFromCamera(F,r.camera);var O=R(R({},S),{coords:F,raycaster:k,buttons:P.buttons,delta:0}),L=C==="pinchend"?I:I-P.deltaY/280,N=_("gesture.pinch",{target:P.target,pointerType:"mouse",srcEvent:P,pointers:[R({},O)],isFirst:C==="pinchstart",isFinal:C==="pinchend",scale:le(L,.1,10),center:R({},O),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});return N},l=function(C){var I,P={x:C.clientX,y:C.clientY};if(i(P)){if(C.preventDefault(),C.ctrlKey){var S=(I=s==null?void 0:s.prevEvent.scale)!==null&&I!==void 0?I:1,F=c(s?"pinch":"pinchstart",S,C);s===null?s={firstEvent:F,prevEvent:F}:s.prevEvent=F,r.onPinchGesture(F),u!==null&&window.clearTimeout(u),u=window.setTimeout(function(){var z;u=null;var U=(z=s==null?void 0:s.prevEvent.scale)!==null&&z!==void 0?z:1,X=c("pinchend",U,C);s=null,r.onPinchGesture(X)},200)}else{var k=(Math.abs(C.deltaY)>Math.abs(C.deltaX)?C.deltaY:C.deltaX)/-60,O=r.mouseWheelState!==void 0,L={x:C.clientX,y:C.clientY},N=r.relativeClientPosition(L),V=new d.Raycaster;V.params.Points={threshold:.1},V.setFromCamera(N,r.camera);var j=R(R({},L),{coords:N,raycaster:V,buttons:C.buttons,delta:k}),F=_("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[R({},j)],isFirst:O,isFinal:!1,scale:0,center:R({},j),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onMouseWheel(F),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var U=_("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[R(R({},j),{delta:0})],isFirst:!1,isFinal:!0,scale:0,center:R(R({},j),{delta:0}),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onMouseWheel(U)},100)}}y()}},h=function(C){if(!Cn()){if(!i({x:C.clientX,y:C.clientY})){p();return}var I=!1;r.mouseMoveState||(I=!0);var P={x:C.clientX,y:C.clientY},S=r.relativeClientPosition(P),F=new d.Raycaster;F.params.Points={threshold:.1},F.setFromCamera(S,r.camera);var k=R(R({},P),{coords:S,raycaster:F,buttons:C.buttons,delta:0}),O=_("gesture.mousemove",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[R({},k)],isFirst:I,isFinal:!1,scale:0,center:R({},k),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.mouseMoveState||(r.mouseMoveState={timeStamp:ve(),event:O}),r.onMouseMove(O),r.pressState&&Math.abs(C.clientX-r.pressState.event.center.y)>10&&Math.abs(C.clientY-r.pressState.event.center.y)>10&&y()}},p=function(){if(r.mouseMoveState){var C=_(r.mouseMoveState.event.type,R(R({},r.mouseMoveState.event),{isFinal:!0}));r.onMouseMove(C)}y()},v=function(C){if(!i(C.center)){y();return}var I=!1;r.pressState||(I=!0,r.pressState={event:C,timeStamp:ve(),stop:Q});var P=ve()-r.pressState.timeStamp,S=_(r.pressState.event.type,R(R({},r.pressState.event),{isFirst:I,isFinal:!1,center:R(R({},r.pressState.event.center),{delta:P}),pointers:r.pressState.event.pointers.map(function(F){return R(R({},F),{delta:P})})}));r.onPressGesture(S),r.pressState&&(r.pressState.stop=it.shared.add(function(F){v(C)},!0,1))},m=function(C){if(y(),!(C.touches.length>1||C.changedTouches.length<=0)){var I={x:C.changedTouches[0].clientX,y:C.changedTouches[0].clientY},P=r.relativeClientPosition(I),S=new d.Raycaster;S.params.Points={threshold:.1},S.setFromCamera(P,r.camera);var F=R(R({},I),{coords:P,raycaster:S,buttons:0,delta:0}),k=_("gesture.press",{target:C.target,pointerType:"touch",srcEvent:C,pointers:[R({},F)],isFirst:!1,isFinal:!1,scale:0,center:F,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});v(k)}},A=function(C){y();var I={x:C.clientX,y:C.clientY},P=r.relativeClientPosition(I),S=new d.Raycaster;S.params.Points={threshold:.1},S.setFromCamera(P,r.camera);var F=R(R({},I),{coords:P,raycaster:S,buttons:C.buttons,delta:0}),k=_("gesture.press",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[R({},F)],isFirst:!1,isFinal:!1,scale:0,center:F,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});v(k)},y=function(){var C;if(r.pressState){var I=ve()-r.pressState.timeStamp,P=_(r.pressState.event.type,R(R({},r.pressState.event),{center:R(R({},r.pressState.event.center),{delta:I}),isFirst:!1,isFinal:!0,pointers:r.pressState.event.pointers.map(function(S){return R(R({},S),{delta:I})})}));r.onPressGesture(P),(C=r.pressState)===null||C===void 0||C.stop(),delete r.pressState}},f=null,g=function(C){var I,P=!1,S=!1;switch(C.type){case"gesturestart":P=!0;break;case"gestureend":S=!0;break}var F={x:C.clientX,y:C.clientY},k=r.relativeClientPosition(F),O=new d.Raycaster;O.params.Points={threshold:.1},O.setFromCamera(k,r.camera);var L=R(R({},F),{coords:k,raycaster:O,buttons:0,delta:0}),N=_("gesture.pinch",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[R({},L)],isFirst:P,isFinal:S,scale:(I=C.scale)!==null&&I!==void 0?I:1,center:R({},L),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});return N},b=function(C){if(C.preventDefault(),!Cn()){var I=g(C);f={firstEvent:I};var P=f.firstEvent;P&&!i(P.center)||r.onPinchGesture(I)}},w=function(C){if(C.preventDefault(),!Cn()&&f){var I=g(C),P=f.firstEvent;P&&!i(P.center)||r.onPinchGesture(I)}},E=function(C){if(C.preventDefault(),!Cn()&&f){var I=g(C),P=f.firstEvent;f=null,!(P&&!i(P.center))&&r.onPinchGesture(I)}},x=function(C){if(C&&typeof C.preventDefault=="function"&&C.currentTarget===e&&C.preventDefault(),typeof getSelection=="function"){var I=getSelection();I&&I.focusNode&&(I.removeAllRanges&&I.removeAllRanges(),I.empty&&I.empty())}};this.enableWheel&&e.addEventListener("wheel",l,{passive:!1}),e.addEventListener("mousemove",h,!1),e.addEventListener("mouseout",p,!1),e.addEventListener("touchstart",m,{passive:!0}),e.addEventListener("touchend",y,!1),e.addEventListener("touchcancel",y,!1),e.addEventListener("mousedown",A,!1),e.addEventListener("mouseup",y,!1),e.addEventListener("gesturestart",b,{passive:!1}),e.addEventListener("gesturechange",w,{passive:!1}),e.addEventListener("gestureend",E,{passive:!1}),e.addEventListener("touchstart",x,{passive:!1}),e.addEventListener("contextmenu",x,!1);var M=function(){a.destroy(),e.removeEventListener("wheel",l,!1),e.removeEventListener("mousemove",h,!1),e.removeEventListener("mouseout",p,!1),e.removeEventListener("touchstart",m,!1),e.removeEventListener("touchend",y,!1),e.removeEventListener("touchcancel",y,!1),e.removeEventListener("mousedown",A,!1),e.removeEventListener("mouseup",y,!1),e.removeEventListener("gesturestart",b,!1),e.removeEventListener("gesturechange",w,!1),e.removeEventListener("gestureend",E,!1),e.removeEventListener("touchstart",x,!1),e.removeEventListener("contextmenu",x,!1)};return Object.assign(M,{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 u=R({key:"pano.".concat(Be(e),".").concat(s)},sr(i.imageOptions,["size","format","quality","mappings"])),c=a.images[s],l=di(c,i.imageOptions.transform,u);return pt(a.work).preload(l)})).then(function(){return r(e),e})},t}(Ii),si=function(n){de(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.locationMotion=new we({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 we({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new we({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,u,c,l;if(e instanceof t)return e;var h=n.parseArgs.call(this,e);return R(R({},h),{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:(u=e.maxLatitude)!==null&&u!==void 0?u:+Math.PI/2,minLatitude:(c=e.minLatitude)!==null&&c!==void 0?c:-Math.PI/2,intersectMeshCreator:(l=e.intersectMeshCreator)!==null&&l!==void 0?l:function(){return new Si}})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,c=this.parseArgs(e),l=e.initial,h=l.state,p=l.currentState,v=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},m=R(R({},v),{mode:"Floorplan",longitude:(o=h.longitude)!==null&&o!==void 0?o:Pa(p.mode)?p.longitude:c.defaultLongitude,latitude:le((s=h.latitude)!==null&&s!==void 0?s:p.mode==="Floorplan"?p.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),fov:(u=h.fov)!==null&&u!==void 0?u:c.defaultFov,offset:e.models.bounding.getCenter(new d.Vector3),distance:t.distanceFromModel(c.models,c.defaultFov,c.camera.aspect)});return m},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){return this.works=e,this.updateCamera(r,i??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=[],u=0,c=e;u<c.length;u++){var l=c[u];o.push({key:l.key,progress:l.progress,value:{distance:l.value.distance,x:l.value.offset.x,y:l.value.offset.x,z:l.value.offset.x}}),s.push({key:l.key,progress:l.progress,value:{longitude:l.value.longitude,latitude:l.value.latitude,fov:l.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(le(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),St(i)||this.models.setMaterial(i),St(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return R(R({},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),u=sr(s,["longitude","latitude","fov"]),c={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},l={modelAlpha:1},h={perspToOrtho:0};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(l,a/3).catch(Q),e.perspToOrthoMotion.set(h,a).catch(Q),e.cameraMotion.set(u,a).catch(Q),e.locationMotion.set(c,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var v=R(R(R({},e.currentPano),{mode:e.mode}),Ve(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:v,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.updateRenderSize=function(){this.locationMotion.set({distance:t.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(Q)},t.prototype.getForwardObserverOrNot=function(e){var r=this.models.intersectRaycaster(e)[0];if(!r)return null;var i=this.works.resolvedObservers,a=Ot(i,function(u){return u.standingPosition.distanceTo(r.point)},!0),o=a[0],s=a[1];return o&&s<10?o: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=R({},i),u={longitude:0,latitude:0},c=0;c<a;c++)s.longitude*=.996,s.latitude*=.996*.998,u.longitude+=s.longitude,u.latitude+=s.latitude;var l=Nr(this.cameraMotion.value.longitude+u.longitude),h=le(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=R(R({},this.currentPano),{mode:this.mode,longitude:l,latitude:h,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),v=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),m=_("gesture.momentum",R(R({},e),{isFirst:r,isFinal:v,state:p}));if(this.inMomentumMovement.event=m,this.emit("gesture.momentum",m),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:l,latitude:h},0).catch(Q),v?this.inMomentumMovement=null:it.shared.add(function(A,y){o.requestMomentumMovement(e,!1,s,y|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>"u"||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 u=this.coordinatesForOffset(a),c=Nr(this.cameraMotion.value.longitude+u.longitude),l=le(this.cameraMotion.value.latitude+u.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 h=R(R({},this.currentPano),{mode:this.mode,longitude:c,latitude:l,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.state=h,this.emit("gesture.pan",e),!e.defaultPrevented&&(this.cameraMotion.set({longitude:h.longitude,latitude:h.latitude},0).catch(Q),e.isFinal)){var p=e.velocityX*s,v=e.velocityY;this.inMomentumMovement={uuid:vt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:p,y:v}),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;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>"u")){var a=le(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,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(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),c=u.clone().multiplyScalar(.05),l=o.point.clone().add(c);this.intersectMesh.position.copy(l);var h=l.clone().add(c);if(this.intersectMesh.lookAt(h),Math.abs(u.y)>.99){var p=this.camera.position.clone().sub(l);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){this.userAction=e.userAction,this.stopMomentumMovement();var r=this,i=r.minFov,a=r.maxFov,o=le(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=R(R({},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 u=this.currentTapId=vt();this.preloadPano(a.pano).then(function(c){r.currentTapId===u&&r.emit("pano.request",_("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t}(ro),Pe={Top:{longitude:0,latitude:Math.PI/2},FrontSide:{longitude:0,latitude:0},LeftSide:{longitude:Math.PI/2,latitude:0},BackSide:{longitude:Math.PI,latitude:0},RightSide:{longitude:Math.PI*1.5,latitude:0}};function jf(n,t){var e=new d.Vector3().copy(t);return e.multiplyScalar(-n),e}function _f(n,t){var e=new d.Vector3().copy(t);return e.multiplyScalar(n),e}var Gf=function(n){de(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=R(R({},e.initial),{state:R(R({},e.initial.state),{longitude:0,latitude:Math.PI/2})}),i=R(R({},e),{initial:r,maxLatitude:Math.PI/2,minLatitude:Math.PI/2,defaultLongitude:0,defaultLatitude:Math.PI/2});return n.parseArgs.call(this,i)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return R(R({},i),{mode:"Topview"})},t.prototype.updateModel=function(e){this.needsRender=!0;var r=this.models.bounding.getCenter(new d.Vector3);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:si.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=[],u=0,c=e;u<c.length;u++){var l=c[u];o.push({key:l.key,progress:l.progress,value:{distance:l.value.distance,x:l.value.offset.x,y:l.value.offset.x,z:l.value.offset.x}}),s.push({key:l.key,progress:l.progress,value:{longitude:l.value.longitude,latitude:l.value.latitude,fov:l.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),u={longitude:s.longitude,latitude:s.latitude,fov:s.fov},c={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},l={modelAlpha:1},h={perspToOrtho:1};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(l,a/3).catch(Q),e.perspToOrthoMotion.set(h,a).catch(Q),e.cameraMotion.set(u,a).catch(Q),e.locationMotion.set(c,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var v=R(R(R({},e.currentPano),{mode:e.mode}),Ve(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:v,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getZoomOffsetFromFov=function(e,r,i){var a=this.camera.getDirection(new d.Vector3),o=Math.tan(i/2*Math.PI/180),s=Math.tan(r.fov/2*Math.PI/180),u=(s-o)/s,c=new d.Raycaster;c.params.Points={threshold:.1},c.setFromCamera(e,r);var l=c.ray.direction,h=l.angleTo(a),p=si.distanceFromModel(this.models,this.defaultFov,this.camera.aspect),v=p*Math.tan(h),m=l.clone().setLength(p*Math.cos(h)).projectOnPlane(a),A=m.length(),y=u/A*m.x*v,f=u/A*m.z*v,g=u/A*m.y*v;return new d.Vector3(y,g,f)},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>"u"||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.models.bounding,u={left:new d.Vector3,up:new d.Vector3,cameraDirection:"y"};this.cameraMotion.value.longitude===Pe.Top.longitude&&this.cameraMotion.value.latitude===Pe.Top.latitude?(u.left.set(1,0,0),u.up.set(0,0,-1),u.cameraDirection="y"):this.cameraMotion.value.longitude===Pe.FrontSide.longitude&&this.cameraMotion.value.latitude===Pe.FrontSide.latitude?(u.left.set(1,0,0),u.up.set(0,1,0),u.cameraDirection="z"):this.cameraMotion.value.longitude===Pe.BackSide.longitude&&this.cameraMotion.value.latitude===Pe.BackSide.latitude?(u.left.set(1,0,0),u.up.set(0,-1,0),u.cameraDirection="z"):this.cameraMotion.value.longitude===Pe.RightSide.longitude&&this.cameraMotion.value.latitude===Pe.RightSide.latitude?(u.left.set(0,0,-1),u.up.set(0,-1,0),u.cameraDirection="x"):this.cameraMotion.value.longitude===Pe.LeftSide.longitude&&this.cameraMotion.value.latitude===Pe.LeftSide.latitude&&(u.left.set(0,0,-1),u.up.set(0,1,0),u.cameraDirection="x");var c=(this.camera.position[u.cameraDirection]-s.min[u.cameraDirection])*Math.tan(this.camera.fov/2*Math.PI/180),l=this.renderer.getSize(new d.Vector2);o.add(jf(2*a.x*c/l.y,u.left)),o.add(_f(2*a.y*c/l.y,u.up)),o.clamp(this.models.bounding.min,this.models.bounding.max);var h=R(R({},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=h,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;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>"u")){var a=le(i/e.scale,this.minFov,this.maxFov),o=this.relativeClientPosition({x:e.center.x,y:e.center.y}),s=this.getZoomOffsetFromFov(o,this.camera,a);this.cameraMotion.value.longitude===Pe.Top.longitude&&this.cameraMotion.value.latitude===Pe.Top.latitude?s.y=0:this.cameraMotion.value.longitude===Pe.FrontSide.longitude&&this.cameraMotion.value.latitude===Pe.FrontSide.latitude||this.cameraMotion.value.longitude===Pe.BackSide.longitude&&this.cameraMotion.value.latitude===Pe.BackSide.latitude?s.z=0:(this.cameraMotion.value.longitude===Pe.RightSide.longitude&&this.cameraMotion.value.latitude===Pe.RightSide.latitude||this.cameraMotion.value.longitude===Pe.LeftSide.longitude&&this.cameraMotion.value.latitude===Pe.LeftSide.latitude)&&(s.x=0);var u=this.camera.pose.offset.clone().add(s);e.state.offset.copy(u),e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({x:u.x,y:u.y,z:u.z},0).catch(Q),this.cameraMotion.set({fov:a},0).catch(Q),e.type="gesture.pan",this.onPanGesture(e))}},t.prototype.onMouseWheel=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=le(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov),i=e.center.coords,a=this.getZoomOffsetFromFov(i,this.camera,r);this.cameraMotion.value.longitude===Pe.Top.longitude&&this.cameraMotion.value.latitude===Pe.Top.latitude?a.y=0:this.cameraMotion.value.longitude===Pe.FrontSide.longitude&&this.cameraMotion.value.latitude===Pe.FrontSide.latitude||this.cameraMotion.value.longitude===Pe.BackSide.longitude&&this.cameraMotion.value.latitude===Pe.BackSide.latitude?a.z=0:(this.cameraMotion.value.longitude===Pe.RightSide.longitude&&this.cameraMotion.value.latitude===Pe.RightSide.latitude||this.cameraMotion.value.longitude===Pe.LeftSide.longitude&&this.cameraMotion.value.latitude===Pe.LeftSide.latitude)&&(a.x=0);var o=this.camera.pose.offset.clone().add(a);e.state.offset.copy(o),e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&(this.locationMotion.set({x:o.x,y:o.y,z:o.z},0).catch(Q),this.cameraMotion.set({fov:r},0).catch(Q))},t}(si),no=function(n){de(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,u,c,l;if(e instanceof t)return e;var h=n.parseArgs.call(this,e);return R(R({},h),{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:40,maxLatitude:(s=e.maxLatitude)!==null&&s!==void 0?s:+Math.PI/2,minLatitude:(u=e.minLatitude)!==null&&u!==void 0?u:-Math.PI/2,moveSpeed:(c=e.moveSpeed)!==null&&c!==void 0?c:3.4,intersectMeshCreator:(l=e.intersectMeshCreator)!==null&&l!==void 0?l:function(){return new Si}})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,c=this.parseArgs(e),l=c.works,h=e.initial,p=h.state,v=h.currentState,m=typeof p.panoIndex=="number"?{workCode:(a=(r=p.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:p.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},A=l.getResolvedObserver(m),y=(o=p.longitude)!==null&&o!==void 0?o:v.longitude,f=le((s=p.latitude)!==null&&s!==void 0?s:Dn(v.mode)?v.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),g=le((u=p.fov)!==null&&u!==void 0?u:Dn(v.mode)?v.fov:c.defaultFov,c.minFov,c.maxFov),b=A?A.position.clone():new d.Vector3;return{workCode:m.workCode,panoIndex:m.panoIndex,mode:"PanoramaLike",longitude:y,latitude:f,fov:g,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 le(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=R({},i),u={longitude:0,latitude:0},c=0;c<a;c++)s.longitude*=.996,s.latitude*=.996*.99,u.longitude+=s.longitude,u.latitude+=s.latitude;var l=Nr(this.cameraMotion.value.longitude+u.longitude),h=le(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=R(R({},this.currentPano),{mode:this.mode,longitude:l,latitude:h,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),v=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),m=_("gesture.momentum",R(R({},e),{isFirst:r,isFinal:v,state:p}));if(this.inMomentumMovement.event=m,this.emit("gesture.momentum",m),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:l,latitude:h},0).catch(Q),v?this.inMomentumMovement=null:it.shared.add(function(A,y){o.requestMomentumMovement(e,!1,s,y|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>"u"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.coordinatesForOffset(a),s=Nr(this.cameraMotion.value.longitude+o.longitude),u=le(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&&(u=this.cameraMotion.value.latitude);var c=R(R({},this.currentPano),{mode:this.mode,longitude:s,latitude:u,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance});if(e.state=c,this.emit("gesture.pan",e),!e.defaultPrevented){var l={longitude:c.longitude,latitude:c.latitude,fov:c.fov};if(this.cameraMotion.set(l,0).catch(Q),e.isFinal){var h=e.velocityX,p=e.velocityY*.6;Math.abs(p)>.5&&Math.abs(h)<.5&&(h=0),this.inMomentumMovement={uuid:vt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:h,y:p}),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>"u")){var o=le(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=le(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.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.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=_("intersect.update",{raycaster:a,intersection:o??null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(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),c=u.clone().multiplyScalar(.05),l=o.point.clone().add(c);this.intersectMesh.position.copy(l);var h=l.clone().add(c);if(this.intersectMesh.lookAt(h),Math.abs(u.y)>.99){var p=this.camera.position.clone().sub(l);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t}(ro),Kf="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAA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AAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",ra;function $u(){return ra||(ra=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=Kf,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 e0=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 Wr=new d.Mesh(io),ao=new d.Scene;ao.add(Wr);var Wf=`
|
|
1328
|
+
`;return function(){var Z=new Error("get-stack-trace"),se=Z&&Z.stack?Z.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Ee=n.console&&(n.console.warn||n.console.log);return Ee&&Ee.call(n.console,q,se),T.apply(this,arguments)}}var m;typeof Object.assign!="function"?m=function(B){if(B===r||B===null)throw new TypeError("Cannot convert undefined or null to object");for(var D=Object(B),q=1;q<arguments.length;q++){var Z=arguments[q];if(Z!==r&&Z!==null)for(var se in Z)Z.hasOwnProperty(se)&&(D[se]=Z[se])}return D}:m=Object.assign;var A=v(function(B,D,q){for(var Z=Object.keys(D),se=0;se<Z.length;)(!q||q&&B[Z[se]]===r)&&(B[Z[se]]=D[Z[se]]),se++;return B},"extend","Use `assign`."),y=v(function(B,D){return A(B,D,!0)},"merge","Use `assign`.");function f(T,B,D){var q=B.prototype,Z;Z=T.prototype=Object.create(q),Z.constructor=T,Z._super=q,D&&m(Z,D)}function g(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 w(T,B){return T===r?B:T}function E(T,B,D){p(I(B),function(q){T.addEventListener(q,D,!1)})}function x(T,B,D){p(I(B),function(q){T.removeEventListener(q,D,!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 I(T){return T.trim().split(/\s+/g)}function P(T,B,D){if(T.indexOf&&!D)return T.indexOf(B);for(var q=0;q<T.length;){if(D&&T[q][D]==B||!D&&T[q]===B)return q;q++}return-1}function S(T){return Array.prototype.slice.call(T,0)}function F(T,B,D){for(var q=[],Z=[],se=0;se<T.length;){var Ee=B?T[se][B]:T[se];P(Z,Ee)<0&&q.push(T[se]),Z[se]=Ee,se++}return D&&(B?q=q.sort(function(Mt,je){return Mt[B]>je[B]}):q=q.sort()),q}function k(T,B){for(var D,q,Z=B[0].toUpperCase()+B.slice(1),se=0;se<i.length;){if(D=i[se],q=D?D+Z:B,q in T)return q;se++}return r}var O=1;function L(){return O++}function N(T){var B=T.ownerDocument||T;return B.defaultView||B.parentWindow||n}var V=/mobile|tablet|ip(ad|hone|od)|android/i,j="ontouchstart"in n,z=k(n,"PointerEvent")!==r,U=j&&V.test(navigator.userAgent),X="touch",G="pen",K="mouse",Y="kinect",H=25,J=1,ne=2,$=4,te=8,ae=1,ce=2,oe=4,fe=8,Ie=16,Ae=ce|oe,Fe=fe|Ie,re=Ae|Fe,he=["x","y"],W=["clientX","clientY"];function Oe(T,B){var D=this;this.manager=T,this.callback=B,this.element=T.element,this.target=T.options.inputTarget,this.domHandler=function(q){b(T.options.enable,[T])&&D.handler(q)},this.init()}Oe.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(N(this.element),this.evWin,this.domHandler)}};function ke(T){var B,D=T.options.inputClass;return D?B=D:z?B=wt:U?B=Lt:j?B=lr:B=ze,new B(T,Je)}function Je(T,B,D){var q=D.pointers.length,Z=D.changedPointers.length,se=B&J&&q-Z===0,Ee=B&($|te)&&q-Z===0;D.isFirst=!!se,D.isFinal=!!Ee,se&&(T.session={}),D.eventType=B,Ze(T,D),T.emit("hammer.input",D),T.recognize(D),T.session.prevInput=D}function Ze(T,B){var D=T.session,q=B.pointers,Z=q.length;D.firstInput||(D.firstInput=Le(B)),Z>1&&!D.firstMultiple?D.firstMultiple=Le(B):Z===1&&(D.firstMultiple=!1);var se=D.firstInput,Ee=D.firstMultiple,et=Ee?Ee.center:se.center,Mt=B.center=ye(q);B.timeStamp=c(),B.deltaTime=B.timeStamp-se.timeStamp,B.angle=$e(et,Mt),B.distance=Se(et,Mt),De(D,B),B.offsetDirection=lt(B.deltaX,B.deltaY);var je=me(B.deltaTime,B.deltaX,B.deltaY);B.overallVelocityX=je.x,B.overallVelocityY=je.y,B.overallVelocity=u(je.x)>u(je.y)?je.x:je.y,B.scale=Ee?At(Ee.pointers,q):1,B.rotation=Ee?Ue(Ee.pointers,q):0,B.maxPointers=D.prevInput?B.pointers.length>D.prevInput.maxPointers?B.pointers.length:D.prevInput.maxPointers:B.pointers.length,We(D,B);var rr=T.element;M(B.srcEvent.target,rr)&&(rr=B.srcEvent.target),B.target=rr}function De(T,B){var D=B.center,q=T.offsetDelta||{},Z=T.prevDelta||{},se=T.prevInput||{};(B.eventType===J||se.eventType===$)&&(Z=T.prevDelta={x:se.deltaX||0,y:se.deltaY||0},q=T.offsetDelta={x:D.x,y:D.y}),B.deltaX=Z.x+(D.x-q.x),B.deltaY=Z.y+(D.y-q.y)}function We(T,B){var D=T.lastInterval||B,q=B.timeStamp-D.timeStamp,Z,se,Ee,et;if(B.eventType!=te&&(q>H||D.velocity===r)){var Mt=B.deltaX-D.deltaX,je=B.deltaY-D.deltaY,rr=me(q,Mt,je);se=rr.x,Ee=rr.y,Z=u(rr.x)>u(rr.y)?rr.x:rr.y,et=lt(Mt,je),T.lastInterval=B}else Z=D.velocity,se=D.velocityX,Ee=D.velocityY,et=D.direction;B.velocity=Z,B.velocityX=se,B.velocityY=Ee,B.direction=et}function Le(T){for(var B=[],D=0;D<T.pointers.length;)B[D]={clientX:s(T.pointers[D].clientX),clientY:s(T.pointers[D].clientY)},D++;return{timeStamp:c(),pointers:B,center:ye(B),deltaX:T.deltaX,deltaY:T.deltaY}}function ye(T){var B=T.length;if(B===1)return{x:s(T[0].clientX),y:s(T[0].clientY)};for(var D=0,q=0,Z=0;Z<B;)D+=T[Z].clientX,q+=T[Z].clientY,Z++;return{x:s(D/B),y:s(q/B)}}function me(T,B,D){return{x:B/T||0,y:D/T||0}}function lt(T,B){return T===B?ae:u(T)>=u(B)?T<0?ce:oe:B<0?fe:Ie}function Se(T,B,D){D||(D=he);var q=B[D[0]]-T[D[0]],Z=B[D[1]]-T[D[1]];return Math.sqrt(q*q+Z*Z)}function $e(T,B,D){D||(D=he);var q=B[D[0]]-T[D[0]],Z=B[D[1]]-T[D[1]];return Math.atan2(Z,q)*180/Math.PI}function Ue(T,B){return $e(B[1],B[0],W)+$e(T[1],T[0],W)}function At(T,B){return Se(B[0],B[1],W)/Se(T[0],T[1],W)}var Ke={mousedown:J,mousemove:ne,mouseup:$},Gt="mousedown",Kt="mousemove mouseup";function ze(){this.evEl=Gt,this.evWin=Kt,this.pressed=!1,Oe.apply(this,arguments)}f(ze,Oe,{handler:function(B){var D=Ke[B.type];D&J&&(B.button===0||B.button===2)&&(this.pressed=!0),D&ne&&B.which!==1&&(D=$),this.pressed&&(D&$&&(this.pressed=!1),this.callback(this.manager,D,{pointers:[B],changedPointers:[B],pointerType:K,srcEvent:B}))}});var ot={pointerdown:J,pointermove:ne,pointerup:$,pointercancel:te,pointerout:te},$t={2:X,3:G,4:K,5:Y},He="pointerdown",ct="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(He="MSPointerDown",ct="MSPointerMove MSPointerUp MSPointerCancel");function wt(){this.evEl=He,this.evWin=ct,Oe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}f(wt,Oe,{handler:function(B){var D=this.store,q=!1,Z=!1,se=B.type.toLowerCase().replace("ms",""),Ee=ot[se],et=$t[B.pointerType]||B.pointerType,Mt=et==X,je=P(D,B.pointerId,"pointerId");Ee&J&&(B.button===0||B.button===2||Mt)?je<0&&(D.push(B),je=D.length-1):Ee&($|te)?q=!0:!Mt&&B.buttons===0&&(q=!0,Z=!0,Ee=ot.pointerup),!(je<0)&&(Z||(D[je]=B),this.callback(this.manager,Ee,{pointers:D,changedPointers:[B],pointerType:et,srcEvent:D[je]}),q&&D.splice(je,1))}});var Tt={touchstart:J,touchmove:ne,touchend:$,touchcancel:te},er="touchstart",mt="touchstart touchmove touchend touchcancel";function Te(){this.evTarget=er,this.evWin=mt,this.started=!1,Oe.apply(this,arguments)}f(Te,Oe,{handler:function(B){var D=Tt[B.type];if(D===J&&(this.started=!0),!!this.started){var q=wr.call(this,B,D);D&($|te)&&q[0].length-q[1].length===0&&(this.started=!1),this.callback(this.manager,D,{pointers:q[0],changedPointers:q[1],pointerType:X,srcEvent:B})}}});function wr(T,B){var D=S(T.touches),q=S(T.changedTouches);return B&($|te)&&(D=F(D.concat(q),"identifier",!0)),[D,q]}var kt={touchstart:J,touchmove:ne,touchend:$,touchcancel:te},ur="touchstart touchmove touchend touchcancel";function Lt(){this.evTarget=ur,this.targetIds={},Oe.apply(this,arguments)}f(Lt,Oe,{handler:function(B){var D=kt[B.type],q=mn.call(this,B,D);q&&this.callback(this.manager,D,{pointers:q[0],changedPointers:q[1],pointerType:X,srcEvent:B})}});function mn(T,B){var D=S(T.touches),q=this.targetIds;if(B&(J|ne)&&D.length===1)return q[D[0].identifier]=!0,[D,D];var Z,se,Ee=S(T.changedTouches),et=[],Mt=this.target;if(se=D.filter(function(je){return M(je.target,Mt)}),B===J)for(Z=0;Z<se.length;)q[se[Z].identifier]=!0,Z++;for(Z=0;Z<Ee.length;)q[Ee[Z].identifier]&&et.push(Ee[Z]),B&($|te)&&delete q[Ee[Z].identifier],Z++;if(et.length)return[F(se.concat(et),"identifier",!0),et]}var Qr=2500,Vr=25;function lr(){Oe.apply(this,arguments);var T=g(this.handler,this);this.touch=new Lt(this.manager,T),this.mouse=new ze(this.manager,T),this.primaryTouch=null,this.lastTouches=[]}f(lr,Oe,{handler:function(B,D,q){var Z=q.pointerType==X,se=q.pointerType==K;if(!(se&&q.sourceCapabilities&&q.sourceCapabilities.firesTouchEvents)){if(Z)cr.call(this,D,q);else if(se&&Xe.call(this,q))return;this.callback(B,D,q)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function cr(T,B){T&J?(this.primaryTouch=B.changedPointers[0].identifier,rt.call(this,B)):T&($|te)&&rt.call(this,B)}function rt(T){var B=T.changedPointers[0];if(B.identifier===this.primaryTouch){var D={x:B.clientX,y:B.clientY};this.lastTouches.push(D);var q=this.lastTouches,Z=function(){var se=q.indexOf(D);se>-1&&q.splice(se,1)};setTimeout(Z,Qr)}}function Xe(T){for(var B=T.srcEvent.clientX,D=T.srcEvent.clientY,q=0;q<this.lastTouches.length;q++){var Z=this.lastTouches[q],se=Math.abs(B-Z.x),Ee=Math.abs(D-Z.y);if(se<=Vr&&Ee<=Vr)return!0}return!1}var Dt=a?k(a.style,"touchAction"):r,dr=Dt!==r,gn="compute",qn="auto",Ur="manipulation",dt="none",st="pan-x",ft="pan-y",Et=qr();function xt(T,B){this.manager=T,this.set(B)}xt.prototype={set:function(T){T==gn&&(T=this.compute()),dr&&this.manager.element.style&&Et[T]&&(this.manager.element.style[Dt]=T),this.actions=T.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var T=[];return p(this.manager.recognizers,function(B){b(B.options.enable,[B])&&(T=T.concat(B.getTouchAction()))}),zn(T.join(" "))},preventDefaults:function(T){var B=T.srcEvent,D=T.offsetDirection;if(this.manager.session.prevented){B.preventDefault();return}var q=this.actions,Z=C(q,dt)&&!Et[dt],se=C(q,ft)&&!Et[ft],Ee=C(q,st)&&!Et[st];if(Z){var et=T.pointers.length===1,Mt=T.distance<2,je=T.deltaTime<250;if(et&&Mt&&je)return}if(!(Ee&&se)&&(Z||se&&D&Ae||Ee&&D&Fe))return this.preventSrc(B)},preventSrc:function(T){this.manager.session.prevented=!0,T.preventDefault()}};function zn(T){if(C(T,dt))return dt;var B=C(T,st),D=C(T,ft);return B&&D?dt:B||D?B?st:ft:C(T,Ur)?Ur:qn}function qr(){if(!dr)return!1;var T={},B=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(D){T[D]=B?n.CSS.supports("touch-action",D):!0}),T}var zr=1,Nt=2,Jr=4,Er=8,fr=Er,yn=16,tr=32;function hr(T){this.options=m({},this.defaults,T||{}),this.id=L(),this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=zr,this.simultaneous={},this.requireFail=[]}hr.prototype={defaults:{},set:function(T){return m(this.options,T),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(T){if(h(T,"recognizeWith",this))return this;var B=this.simultaneous;return T=Hn(T,this),B[T.id]||(B[T.id]=T,T.recognizeWith(this)),this},dropRecognizeWith:function(T){return h(T,"dropRecognizeWith",this)?this:(T=Hn(T,this),delete this.simultaneous[T.id],this)},requireFailure:function(T){if(h(T,"requireFailure",this))return this;var B=this.requireFail;return T=Hn(T,this),P(B,T)===-1&&(B.push(T),T.requireFailure(this)),this},dropRequireFailure:function(T){if(h(T,"dropRequireFailure",this))return this;T=Hn(T,this);var B=P(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,D=this.state;function q(Z){B.manager.emit(Z,T)}D<Er&&q(B.options.event+fo(D)),q(B.options.event),T.additionalEvent&&q(T.additionalEvent),D>=Er&&q(B.options.event+fo(D))},tryEmit:function(T){if(this.canEmit())return this.emit(T);this.state=tr},canEmit:function(){for(var T=0;T<this.requireFail.length;){if(!(this.requireFail[T].state&(tr|zr)))return!1;T++}return!0},recognize:function(T){var B=m({},T);if(!b(this.options.enable,[this,B])){this.reset(),this.state=tr;return}this.state&(fr|yn|tr)&&(this.state=zr),this.state=this.process(B),this.state&(Nt|Jr|Er|yn)&&this.tryEmit(B)},process:function(T){},getTouchAction:function(){},reset:function(){}};function fo(T){return T&yn?"cancel":T&Er?"end":T&Jr?"move":T&Nt?"start":""}function ho(T){return T==Ie?"down":T==fe?"up":T==ce?"left":T==oe?"right":""}function Hn(T,B){var D=B.manager;return D?D.get(T):T}function Wt(){hr.apply(this,arguments)}f(Wt,hr,{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,D=T.eventType,q=B&(Nt|Jr),Z=this.attrTest(T);return q&&(D&te||!Z)?B|yn:q||Z?D&$?B|Er:B&Nt?B|Jr:Nt:tr}});function jn(){Wt.apply(this,arguments),this.pX=null,this.pY=null}f(jn,Wt,{defaults:{event:"pan",threshold:10,pointers:1,direction:re},getTouchAction:function(){var T=this.options.direction,B=[];return T&Ae&&B.push(ft),T&Fe&&B.push(st),B},directionTest:function(T){var B=this.options,D=!0,q=T.distance,Z=T.direction,se=T.deltaX,Ee=T.deltaY;return Z&B.direction||(B.direction&Ae?(Z=se===0?ae:se<0?ce:oe,D=se!=this.pX,q=Math.abs(T.deltaX)):(Z=Ee===0?ae:Ee<0?fe:Ie,D=Ee!=this.pY,q=Math.abs(T.deltaY))),T.direction=Z,D&&q>B.threshold&&Z&B.direction},attrTest:function(T){return Wt.prototype.attrTest.call(this,T)&&(this.state&Nt||!(this.state&Nt)&&this.directionTest(T))},emit:function(T){this.pX=T.deltaX,this.pY=T.deltaY;var B=ho(T.direction);B&&(T.additionalEvent=this.options.event+B),this._super.emit.call(this,T)}});function Oi(){Wt.apply(this,arguments)}f(Oi,Wt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[dt]},attrTest:function(T){return this._super.attrTest.call(this,T)&&(Math.abs(T.scale-1)>this.options.threshold||this.state&Nt)},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 ki(){hr.apply(this,arguments),this._timer=null,this._input=null}f(ki,hr,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[qn]},process:function(T){var B=this.options,D=T.pointers.length===B.pointers,q=T.distance<B.threshold,Z=T.deltaTime>B.time;if(this._input=T,!q||!D||T.eventType&($|te)&&!Z)this.reset();else if(T.eventType&J)this.reset(),this._timer=l(function(){this.state=fr,this.tryEmit()},B.time,this);else if(T.eventType&$)return fr;return tr},reset:function(){clearTimeout(this._timer)},emit:function(T){this.state===fr&&(T&&T.eventType&$?this.manager.emit(this.options.event+"up",T):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}});function Li(){Wt.apply(this,arguments)}f(Li,Wt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[dt]},attrTest:function(T){return this._super.attrTest.call(this,T)&&(Math.abs(T.rotation)>this.options.threshold||this.state&Nt)}});function Di(){Wt.apply(this,arguments)}f(Di,Wt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ae|Fe,pointers:1},getTouchAction:function(){return jn.prototype.getTouchAction.call(this)},attrTest:function(T){var B=this.options.direction,D;return B&(Ae|Fe)?D=T.overallVelocity:B&Ae?D=T.overallVelocityX:B&Fe&&(D=T.overallVelocityY),this._super.attrTest.call(this,T)&&B&T.offsetDirection&&T.distance>this.options.threshold&&T.maxPointers==this.options.pointers&&u(D)>this.options.velocity&&T.eventType&$},emit:function(T){var B=ho(T.offsetDirection);B&&this.manager.emit(this.options.event+B,T),this.manager.emit(this.options.event,T)}});function _n(){hr.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}f(_n,hr,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ur]},process:function(T){var B=this.options,D=T.pointers.length===B.pointers,q=T.distance<B.threshold,Z=T.deltaTime<B.time;if(this.reset(),T.eventType&J&&this.count===0)return this.failTimeout();if(q&&Z&&D){if(T.eventType!=$)return this.failTimeout();var se=this.pTime?T.timeStamp-this.pTime<B.interval:!0,Ee=!this.pCenter||Se(this.pCenter,T.center)<B.posThreshold;this.pTime=T.timeStamp,this.pCenter=T.center,!Ee||!se?this.count=1:this.count+=1,this._input=T;var et=this.count%B.taps;if(et===0)return this.hasRequireFailures()?(this._timer=l(function(){this.state=fr,this.tryEmit()},B.interval,this),Nt):fr}return tr},failTimeout:function(){return this._timer=l(function(){this.state=tr},this.options.interval,this),tr},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==fr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Zr(T,B){return B=B||{},B.recognizers=w(B.recognizers,Zr.defaults.preset),new Ni(T,B)}Zr.VERSION="2.0.7",Zr.defaults={domEvents:!1,touchAction:gn,enable:!0,inputTarget:null,inputClass:null,preset:[[Li,{enable:!1}],[Oi,{enable:!1},["rotate"]],[Di,{direction:Ae}],[jn,{direction:Ae},["swipe"]],[_n],[_n,{event:"doubletap",taps:2},["tap"]],[ki]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var v0=1,po=2;function Ni(T,B){this.options=m({},Zr.defaults,B||{}),this.options.inputTarget=this.options.inputTarget||T,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=T,this.input=ke(this),this.touchAction=new xt(this,this.options.touchAction),vo(this,!0),p(this.options.recognizers,function(D){var q=this.add(new D[0](D[1]));D[2]&&q.recognizeWith(D[2]),D[3]&&q.requireFailure(D[3])},this)}Ni.prototype={set:function(T){return m(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?po:v0},recognize:function(T){var B=this.session;if(!B.stopped){this.touchAction.preventDefaults(T);var D,q=this.recognizers,Z=B.curRecognizer;(!Z||Z&&Z.state&fr)&&(Z=B.curRecognizer=null);for(var se=0;se<q.length;)D=q[se],B.stopped!==po&&(!Z||D==Z||D.canRecognizeWith(Z))?D.recognize(T):D.reset(),!Z&&D.state&(Nt|Jr|Er)&&(Z=B.curRecognizer=D),se++}},get:function(T){if(T instanceof hr)return T;for(var B=this.recognizers,D=0;D<B.length;D++)if(B[D].options.event==T)return B[D];return null},add:function(T){if(h(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(h(T,"remove",this))return this;if(T=this.get(T),T){var B=this.recognizers,D=P(B,T);D!==-1&&(B.splice(D,1),this.touchAction.update())}return this},on:function(T,B){if(T!==r&&B!==r){var D=this.handlers;return p(I(T),function(q){D[q]=D[q]||[],D[q].push(B)}),this}},off:function(T,B){if(T!==r){var D=this.handlers;return p(I(T),function(q){B?D[q]&&D[q].splice(P(D[q],B),1):delete D[q]}),this}},emit:function(T,B){this.options.domEvents&&A0(T,B);var D=this.handlers[T]&&this.handlers[T].slice();if(!(!D||!D.length)){B.type=T,B.preventDefault=function(){B.srcEvent.preventDefault()};for(var q=0;q<D.length;)D[q](B),q++}},destroy:function(){this.element&&vo(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function vo(T,B){var D=T.element;if(D.style){var q;p(T.options.cssProps,function(Z,se){q=k(D.style,se),B?(T.oldCssProps[q]=D.style[q],D.style[q]=Z):D.style[q]=T.oldCssProps[q]||""}),B||(T.oldCssProps={})}}function A0(T,B){var D=t.createEvent("Event");D.initEvent(T,!0,!0),D.gesture=B,B.target.dispatchEvent(D)}return m(Zr,{INPUT_START:J,INPUT_MOVE:ne,INPUT_END:$,INPUT_CANCEL:te,STATE_POSSIBLE:zr,STATE_BEGAN:Nt,STATE_CHANGED:Jr,STATE_ENDED:Er,STATE_RECOGNIZED:fr,STATE_CANCELLED:yn,STATE_FAILED:tr,DIRECTION_NONE:ae,DIRECTION_LEFT:ce,DIRECTION_RIGHT:oe,DIRECTION_UP:fe,DIRECTION_DOWN:Ie,DIRECTION_HORIZONTAL:Ae,DIRECTION_VERTICAL:Fe,DIRECTION_ALL:re,Manager:Ni,Input:Oe,TouchAction:xt,TouchInput:Lt,MouseInput:ze,PointerEventInput:wt,TouchMouseInput:lr,SingleTouchInput:Te,Recognizer:hr,AttrRecognizer:Wt,Tap:_n,Pan:jn,Swipe:Di,Pinch:Oi,Rotate:Li,Press:ki,on:E,off:x,each:p,merge:y,extend:A,assign:m,inherit:f,bindFn:g,prefixed:k}),Zr}(typeof window<"u"?window:{},typeof document<"u"?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 eo=function(n){de(t,n);function t(e){var r,i,a,o,s,u,c=n.call(this)||this,l=t.parseArgs(e);return c.mode="",c.pending=new Set,c.userAction=l.initial.userAction,c.destroyed=!1,c.ident=l.ident,c.scene=l.scene,c.xrCustomObjectsScene=l.xrCustomObjectsScene,c.helper=l.helper,c.boundingMesh=l.boundingMesh,c.camera=l.camera,c.renderer=l.renderer,c.scissor=l.scissor,c.element=l.element,c.models=l.models,c.enableWheel=l.enableWheel,c.enableIOSEDR=(r=l.enableIOSEDR)!==null&&r!==void 0?r:!1,c.enableEDL=(i=l.enableEDL)!==null&&i!==void 0?i:!0,c.enableHQ=(a=l.enableHQ)!==null&&a!==void 0?a:!0,c.works=l.works,c.imageOptions=l.imageOptions,c.videoTexture=l.videoTexture,c.extraElements=l.extraElements,c.initial=l.initial,c.currentPano=typeof c.initial.state.panoIndex=="number"?{workCode:(u=(o=c.initial.state.workCode)!==null&&o!==void 0?o:(s=l.works[0])===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",panoIndex:c.initial.state.panoIndex}:{workCode:c.initial.currentState.workCode,panoIndex:c.initial.currentState.panoIndex},c.needsRender=!0,c.cameraMotion=new we({longitude:{value:c.camera.pose.longitude,circle:[0,Math.PI*2]},latitude:c.camera.pose.latitude,fov:c.camera.pose.fov}),c.inMomentumMovement=null,c.eventUnbinds=[l.element].concat(l.extraElements||[]).map(function(h){return c.bindEvents(h)}),c.pending.add("init-animation"),c.initAnimationReady=new Promise(function(h){it.shared.add(function(){c.initAnimation().then(function(){c.pending.delete("init-animation"),h()})},!0)}),c}return t.parseArgs=function(e){return e instanceof t?e:R({},e)},t.initAnimationEndState=function(e){var r,i,a,o,s,u,c,l,h=this.parseArgs(e),p=h.initial,v=p.state,m=p.currentState,A=typeof v.panoIndex=="number"?{workCode:(a=(r=v.workCode)!==null&&r!==void 0?r:(i=h.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:v.panoIndex}:{workCode:m.workCode,panoIndex:m.panoIndex};return R(R({},A),{mode:"",longitude:(o=v.longitude)!==null&&o!==void 0?o:m.longitude,latitude:(s=v.latitude)!==null&&s!==void 0?s:m.latitude,fov:(u=v.fov)!==null&&u!==void 0?u:m.fov,offset:(c=v.offset)!==null&&c!==void 0?c:m.offset,distance:(l=v.distance)!==null&&l!==void 0?l:m.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(){this.needsRender=!0},t.prototype.updateModel=function(e){this.needsRender=!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),St(i)&&this.setCamera(i)}},t.prototype.render=function(){this.renderer.render(this.scene,this.camera)},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,u=e;s<u.length;s++){var c=u[s];o.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.cameraMotion.setKeyframes(o,r)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1];return R(R({},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 u=(r=e.longitude)!==null&&r!==void 0?r:this.camera.pose.longitude,c=(i=e.latitude)!==null&&i!==void 0?i:this.camera.pose.latitude,l=(a=e.fov)!==null&&a!==void 0?a:this.camera.pose.fov,h=(o=e.distance)!==null&&o!==void 0?o:this.camera.pose.distance,p=(s=e.offset)!==null&&s!==void 0?s:this.camera.pose.offset,v=Jt(u,this.camera.pose.longitude,Math.PI*2)||Jt(c,this.camera.pose.latitude),m=Jt(l,this.camera.pose.fov),A=Jt(h,this.camera.pose.distance),y=Ra(p,this.camera.pose.offset);(m||v||y||A)&&(this.camera.setFromPose({longitude:u,latitude:c,fov:l,distance:h,offset:p}),this.emit("camera.update",_("camera.update",{userAction:this.userAction,state:R(R({},this.currentPano),{mode:this.mode,longitude:u,latitude:c,fov:l,offset:p,distance:h})})),this.needsRender=!0)},t.prototype.stopMomentumMovement=function(){if(this.inMomentumMovement&&this.inMomentumMovement.event&&!this.inMomentumMovement.event.defaultPrevented&&!this.inMomentumMovement.event.isFinal){var e=_("gesture.momentum",R(R({},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.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(C){var I=ws(C,r.element,r.scissor);return!(Math.abs(I.x)>1||Math.abs(I.y)>1)},a=new In.Manager(e),o=function(C){var I=C.session;return I.firstInput||null};a.add(new In.Pan({threshold:10,pointers:0})),a.add(new In.Tap({interval:410})),a.add(new In.Pinch({threshold:0,pointers:2})),a.on("panstart pan",function(C){var I=o(a);if(!(I&&!i(I.center))){var P=_("gesture.pan",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(S){var F=r.relativeClientPosition(S),k=new d.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(F,r.camera),{x:S.x,y:S.y,delta:0,buttons:0,coords:F,raycaster:k}}),isFirst:C.isFirst,isFinal:C.isFinal,scale:C.scale,center:function(S){var F=r.relativeClientPosition(S),k=new d.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(F,r.camera),{x:S.x,y:S.y,delta:0,buttons:0,coords:F,raycaster:k}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onPanGesture(P),y()}}),a.on("tap",function(C){if(!(C.pointerType==="mouse"&&C.srcEvent.button!==0)){var I=o(a);if(!(I&&!i(I.center))){var P=_("gesture.tap",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(S){var F=r.relativeClientPosition(S),k=new d.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(F,r.camera),{x:S.x,y:S.y,delta:0,buttons:0,coords:F,raycaster:k}}),isFirst:!0,isFinal:!0,scale:C.scale,center:function(S){var F=r.relativeClientPosition(S),k=new d.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(F,r.camera),{x:S.x,y:S.y,delta:0,buttons:0,coords:F,raycaster:k}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onTapGesture(P),y()}}}),a.on("pinchstart pinch pinchend",function(C){var I=o(a);if(!(I&&!i(I.center))){var P=_("gesture.pinch",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(S){var F,k=r.relativeClientPosition(S),O=new d.Raycaster;return O.params.Points={threshold:.1},O.setFromCamera(k,r.camera),{x:S.x,y:S.y,delta:(F=S.delta)!==null&&F!==void 0?F:0,buttons:0,coords:k,raycaster:O}}),isFirst:C.type==="pinchstart",isFinal:C.type==="pinchend",scale:C.scale,center:function(S){var F=r.relativeClientPosition(S),k=new d.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(F,r.camera),{x:S.x,y:S.y,delta:0,buttons:0,coords:F,raycaster:k}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onPinchGesture(P),y()}});var s=null,u=null,c=function(C,I,P){var S={x:P.clientX,y:P.clientY},F=r.relativeClientPosition(S),k=new d.Raycaster;k.params.Points={threshold:.1},k.setFromCamera(F,r.camera);var O=R(R({},S),{coords:F,raycaster:k,buttons:P.buttons,delta:0}),L=C==="pinchend"?I:I-P.deltaY/280,N=_("gesture.pinch",{target:P.target,pointerType:"mouse",srcEvent:P,pointers:[R({},O)],isFirst:C==="pinchstart",isFinal:C==="pinchend",scale:le(L,.1,10),center:R({},O),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});return N},l=function(C){var I,P={x:C.clientX,y:C.clientY};if(i(P)){if(C.preventDefault(),C.ctrlKey){var S=(I=s==null?void 0:s.prevEvent.scale)!==null&&I!==void 0?I:1,F=c(s?"pinch":"pinchstart",S,C);s===null?s={firstEvent:F,prevEvent:F}:s.prevEvent=F,r.onPinchGesture(F),u!==null&&window.clearTimeout(u),u=window.setTimeout(function(){var z;u=null;var U=(z=s==null?void 0:s.prevEvent.scale)!==null&&z!==void 0?z:1,X=c("pinchend",U,C);s=null,r.onPinchGesture(X)},200)}else{var k=(Math.abs(C.deltaY)>Math.abs(C.deltaX)?C.deltaY:C.deltaX)/-60,O=r.mouseWheelState!==void 0,L={x:C.clientX,y:C.clientY},N=r.relativeClientPosition(L),V=new d.Raycaster;V.params.Points={threshold:.1},V.setFromCamera(N,r.camera);var j=R(R({},L),{coords:N,raycaster:V,buttons:C.buttons,delta:k}),F=_("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[R({},j)],isFirst:O,isFinal:!1,scale:0,center:R({},j),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onMouseWheel(F),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var U=_("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[R(R({},j),{delta:0})],isFirst:!1,isFinal:!0,scale:0,center:R(R({},j),{delta:0}),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onMouseWheel(U)},100)}}y()}},h=function(C){if(!Cn()){if(!i({x:C.clientX,y:C.clientY})){p();return}var I=!1;r.mouseMoveState||(I=!0);var P={x:C.clientX,y:C.clientY},S=r.relativeClientPosition(P),F=new d.Raycaster;F.params.Points={threshold:.1},F.setFromCamera(S,r.camera);var k=R(R({},P),{coords:S,raycaster:F,buttons:C.buttons,delta:0}),O=_("gesture.mousemove",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[R({},k)],isFirst:I,isFinal:!1,scale:0,center:R({},k),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.mouseMoveState||(r.mouseMoveState={timeStamp:ve(),event:O}),r.onMouseMove(O),r.pressState&&Math.abs(C.clientX-r.pressState.event.center.y)>10&&Math.abs(C.clientY-r.pressState.event.center.y)>10&&y()}},p=function(){if(r.mouseMoveState){var C=_(r.mouseMoveState.event.type,R(R({},r.mouseMoveState.event),{isFinal:!0}));r.onMouseMove(C)}y()},v=function(C){if(!i(C.center)){y();return}var I=!1;r.pressState||(I=!0,r.pressState={event:C,timeStamp:ve(),stop:Q});var P=ve()-r.pressState.timeStamp,S=_(r.pressState.event.type,R(R({},r.pressState.event),{isFirst:I,isFinal:!1,center:R(R({},r.pressState.event.center),{delta:P}),pointers:r.pressState.event.pointers.map(function(F){return R(R({},F),{delta:P})})}));r.onPressGesture(S),r.pressState&&(r.pressState.stop=it.shared.add(function(F){v(C)},!0,1))},m=function(C){if(y(),!(C.touches.length>1||C.changedTouches.length<=0)){var I={x:C.changedTouches[0].clientX,y:C.changedTouches[0].clientY},P=r.relativeClientPosition(I),S=new d.Raycaster;S.params.Points={threshold:.1},S.setFromCamera(P,r.camera);var F=R(R({},I),{coords:P,raycaster:S,buttons:0,delta:0}),k=_("gesture.press",{target:C.target,pointerType:"touch",srcEvent:C,pointers:[R({},F)],isFirst:!1,isFinal:!1,scale:0,center:F,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});v(k)}},A=function(C){y();var I={x:C.clientX,y:C.clientY},P=r.relativeClientPosition(I),S=new d.Raycaster;S.params.Points={threshold:.1},S.setFromCamera(P,r.camera);var F=R(R({},I),{coords:P,raycaster:S,buttons:C.buttons,delta:0}),k=_("gesture.press",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[R({},F)],isFirst:!1,isFinal:!1,scale:0,center:F,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});v(k)},y=function(){var C;if(r.pressState){var I=ve()-r.pressState.timeStamp,P=_(r.pressState.event.type,R(R({},r.pressState.event),{center:R(R({},r.pressState.event.center),{delta:I}),isFirst:!1,isFinal:!0,pointers:r.pressState.event.pointers.map(function(S){return R(R({},S),{delta:I})})}));r.onPressGesture(P),(C=r.pressState)===null||C===void 0||C.stop(),delete r.pressState}},f=null,g=function(C){var I,P=!1,S=!1;switch(C.type){case"gesturestart":P=!0;break;case"gestureend":S=!0;break}var F={x:C.clientX,y:C.clientY},k=r.relativeClientPosition(F),O=new d.Raycaster;O.params.Points={threshold:.1},O.setFromCamera(k,r.camera);var L=R(R({},F),{coords:k,raycaster:O,buttons:0,delta:0}),N=_("gesture.pinch",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[R({},L)],isFirst:P,isFinal:S,scale:(I=C.scale)!==null&&I!==void 0?I:1,center:R({},L),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:R(R({mode:r.mode},r.currentPano),Ve(r.camera.pose))});return N},b=function(C){if(C.preventDefault(),!Cn()){var I=g(C);f={firstEvent:I};var P=f.firstEvent;P&&!i(P.center)||r.onPinchGesture(I)}},w=function(C){if(C.preventDefault(),!Cn()&&f){var I=g(C),P=f.firstEvent;P&&!i(P.center)||r.onPinchGesture(I)}},E=function(C){if(C.preventDefault(),!Cn()&&f){var I=g(C),P=f.firstEvent;f=null,!(P&&!i(P.center))&&r.onPinchGesture(I)}},x=function(C){if(C&&typeof C.preventDefault=="function"&&C.currentTarget===e&&C.preventDefault(),typeof getSelection=="function"){var I=getSelection();I&&I.focusNode&&(I.removeAllRanges&&I.removeAllRanges(),I.empty&&I.empty())}};this.enableWheel&&e.addEventListener("wheel",l,{passive:!1}),e.addEventListener("mousemove",h,!1),e.addEventListener("mouseout",p,!1),e.addEventListener("touchstart",m,{passive:!0}),e.addEventListener("touchend",y,!1),e.addEventListener("touchcancel",y,!1),e.addEventListener("mousedown",A,!1),e.addEventListener("mouseup",y,!1),e.addEventListener("gesturestart",b,{passive:!1}),e.addEventListener("gesturechange",w,{passive:!1}),e.addEventListener("gestureend",E,{passive:!1}),e.addEventListener("touchstart",x,{passive:!1}),e.addEventListener("contextmenu",x,!1);var M=function(){a.destroy(),e.removeEventListener("wheel",l,!1),e.removeEventListener("mousemove",h,!1),e.removeEventListener("mouseout",p,!1),e.removeEventListener("touchstart",m,!1),e.removeEventListener("touchend",y,!1),e.removeEventListener("touchcancel",y,!1),e.removeEventListener("mousedown",A,!1),e.removeEventListener("mouseup",y,!1),e.removeEventListener("gesturestart",b,!1),e.removeEventListener("gesturechange",w,!1),e.removeEventListener("gestureend",E,!1),e.removeEventListener("touchstart",x,!1),e.removeEventListener("contextmenu",x,!1)};return Object.assign(M,{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 u=R({key:"pano.".concat(Be(e),".").concat(s)},sr(i.imageOptions,["size","format","quality","mappings"])),c=a.images[s],l=di(c,i.imageOptions.transform,u);return pt(a.work).preload(l)})).then(function(){return r(e),e})},t}(Ii),si=function(n){de(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.locationMotion=new we({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 we({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new we({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,u,c,l;if(e instanceof t)return e;var h=n.parseArgs.call(this,e);return R(R({},h),{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:(u=e.maxLatitude)!==null&&u!==void 0?u:+Math.PI/2,minLatitude:(c=e.minLatitude)!==null&&c!==void 0?c:-Math.PI/2,intersectMeshCreator:(l=e.intersectMeshCreator)!==null&&l!==void 0?l:function(){return new Si}})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,c=this.parseArgs(e),l=e.initial,h=l.state,p=l.currentState,v=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},m=R(R({},v),{mode:"Floorplan",longitude:(o=h.longitude)!==null&&o!==void 0?o:Pa(p.mode)?p.longitude:c.defaultLongitude,latitude:le((s=h.latitude)!==null&&s!==void 0?s:p.mode==="Floorplan"?p.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),fov:(u=h.fov)!==null&&u!==void 0?u:c.defaultFov,offset:e.models.bounding.getCenter(new d.Vector3),distance:t.distanceFromModel(c.models,c.defaultFov,c.camera.aspect)});return m},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){return this.works=e,this.updateCamera(r,i??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=[],u=0,c=e;u<c.length;u++){var l=c[u];o.push({key:l.key,progress:l.progress,value:{distance:l.value.distance,x:l.value.offset.x,y:l.value.offset.x,z:l.value.offset.x}}),s.push({key:l.key,progress:l.progress,value:{longitude:l.value.longitude,latitude:l.value.latitude,fov:l.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(le(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),St(i)||this.models.setMaterial(i),St(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return R(R({},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),u=sr(s,["longitude","latitude","fov"]),c={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},l={modelAlpha:1},h={perspToOrtho:0};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(l,a/3).catch(Q),e.perspToOrthoMotion.set(h,a).catch(Q),e.cameraMotion.set(u,a).catch(Q),e.locationMotion.set(c,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var v=R(R(R({},e.currentPano),{mode:e.mode}),Ve(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:v,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.updateRenderSize=function(){this.locationMotion.set({distance:t.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(Q)},t.prototype.getForwardObserverOrNot=function(e){var r=this.models.intersectRaycaster(e)[0];if(!r)return null;var i=this.works.resolvedObservers,a=Ot(i,function(u){return u.standingPosition.distanceTo(r.point)},!0),o=a[0],s=a[1];return o&&s<10?o: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=R({},i),u={longitude:0,latitude:0},c=0;c<a;c++)s.longitude*=.996,s.latitude*=.996*.998,u.longitude+=s.longitude,u.latitude+=s.latitude;var l=Nr(this.cameraMotion.value.longitude+u.longitude),h=le(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=R(R({},this.currentPano),{mode:this.mode,longitude:l,latitude:h,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),v=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),m=_("gesture.momentum",R(R({},e),{isFirst:r,isFinal:v,state:p}));if(this.inMomentumMovement.event=m,this.emit("gesture.momentum",m),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:l,latitude:h},0).catch(Q),v?this.inMomentumMovement=null:it.shared.add(function(A,y){o.requestMomentumMovement(e,!1,s,y|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>"u"||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 u=this.coordinatesForOffset(a),c=Nr(this.cameraMotion.value.longitude+u.longitude),l=le(this.cameraMotion.value.latitude+u.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 h=R(R({},this.currentPano),{mode:this.mode,longitude:c,latitude:l,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.state=h,this.emit("gesture.pan",e),!e.defaultPrevented&&(this.cameraMotion.set({longitude:h.longitude,latitude:h.latitude},0).catch(Q),e.isFinal)){var p=e.velocityX*s,v=e.velocityY;this.inMomentumMovement={uuid:vt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:p,y:v}),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;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>"u")){var a=le(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,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(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),c=u.clone().multiplyScalar(.05),l=o.point.clone().add(c);this.intersectMesh.position.copy(l);var h=l.clone().add(c);if(this.intersectMesh.lookAt(h),Math.abs(u.y)>.99){var p=this.camera.position.clone().sub(l);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){this.userAction=e.userAction,this.stopMomentumMovement();var r=this,i=r.minFov,a=r.maxFov,o=le(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=R(R({},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 u=this.currentTapId=vt();this.preloadPano(a.pano).then(function(c){r.currentTapId===u&&r.emit("pano.request",_("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t}(eo),Pe={Top:{longitude:0,latitude:Math.PI/2},FrontSide:{longitude:0,latitude:0},LeftSide:{longitude:Math.PI/2,latitude:0},BackSide:{longitude:Math.PI,latitude:0},RightSide:{longitude:Math.PI*1.5,latitude:0}};function qf(n,t){var e=new d.Vector3().copy(t);return e.multiplyScalar(-n),e}function zf(n,t){var e=new d.Vector3().copy(t);return e.multiplyScalar(n),e}var Hf=function(n){de(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=R(R({},e.initial),{state:R(R({},e.initial.state),{longitude:0,latitude:Math.PI/2})}),i=R(R({},e),{initial:r,maxLatitude:Math.PI/2,minLatitude:Math.PI/2,defaultLongitude:0,defaultLatitude:Math.PI/2});return n.parseArgs.call(this,i)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return R(R({},i),{mode:"Topview"})},t.prototype.updateModel=function(e){this.needsRender=!0;var r=this.models.bounding.getCenter(new d.Vector3);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:si.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=[],u=0,c=e;u<c.length;u++){var l=c[u];o.push({key:l.key,progress:l.progress,value:{distance:l.value.distance,x:l.value.offset.x,y:l.value.offset.x,z:l.value.offset.x}}),s.push({key:l.key,progress:l.progress,value:{longitude:l.value.longitude,latitude:l.value.latitude,fov:l.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),u={longitude:s.longitude,latitude:s.latitude,fov:s.fov},c={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},l={modelAlpha:1},h={perspToOrtho:1};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(l,a/3).catch(Q),e.perspToOrthoMotion.set(h,a).catch(Q),e.cameraMotion.set(u,a).catch(Q),e.locationMotion.set(c,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var v=R(R(R({},e.currentPano),{mode:e.mode}),Ve(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:v,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getZoomOffsetFromFov=function(e,r,i){var a=this.camera.getDirection(new d.Vector3),o=Math.tan(i/2*Math.PI/180),s=Math.tan(r.fov/2*Math.PI/180),u=(s-o)/s,c=new d.Raycaster;c.params.Points={threshold:.1},c.setFromCamera(e,r);var l=c.ray.direction,h=l.angleTo(a),p=si.distanceFromModel(this.models,this.defaultFov,this.camera.aspect),v=p*Math.tan(h),m=l.clone().setLength(p*Math.cos(h)).projectOnPlane(a),A=m.length(),y=u/A*m.x*v,f=u/A*m.z*v,g=u/A*m.y*v;return new d.Vector3(y,g,f)},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>"u"||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.models.bounding,u={left:new d.Vector3,up:new d.Vector3,cameraDirection:"y"};this.cameraMotion.value.longitude===Pe.Top.longitude&&this.cameraMotion.value.latitude===Pe.Top.latitude?(u.left.set(1,0,0),u.up.set(0,0,-1),u.cameraDirection="y"):this.cameraMotion.value.longitude===Pe.FrontSide.longitude&&this.cameraMotion.value.latitude===Pe.FrontSide.latitude?(u.left.set(1,0,0),u.up.set(0,1,0),u.cameraDirection="z"):this.cameraMotion.value.longitude===Pe.BackSide.longitude&&this.cameraMotion.value.latitude===Pe.BackSide.latitude?(u.left.set(1,0,0),u.up.set(0,-1,0),u.cameraDirection="z"):this.cameraMotion.value.longitude===Pe.RightSide.longitude&&this.cameraMotion.value.latitude===Pe.RightSide.latitude?(u.left.set(0,0,-1),u.up.set(0,-1,0),u.cameraDirection="x"):this.cameraMotion.value.longitude===Pe.LeftSide.longitude&&this.cameraMotion.value.latitude===Pe.LeftSide.latitude&&(u.left.set(0,0,-1),u.up.set(0,1,0),u.cameraDirection="x");var c=(this.camera.position[u.cameraDirection]-s.min[u.cameraDirection])*Math.tan(this.camera.fov/2*Math.PI/180),l=this.renderer.getSize(new d.Vector2);o.add(qf(2*a.x*c/l.y,u.left)),o.add(zf(2*a.y*c/l.y,u.up)),o.clamp(this.models.bounding.min,this.models.bounding.max);var h=R(R({},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=h,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;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>"u")){var a=le(i/e.scale,this.minFov,this.maxFov),o=this.relativeClientPosition({x:e.center.x,y:e.center.y}),s=this.getZoomOffsetFromFov(o,this.camera,a);this.cameraMotion.value.longitude===Pe.Top.longitude&&this.cameraMotion.value.latitude===Pe.Top.latitude?s.y=0:this.cameraMotion.value.longitude===Pe.FrontSide.longitude&&this.cameraMotion.value.latitude===Pe.FrontSide.latitude||this.cameraMotion.value.longitude===Pe.BackSide.longitude&&this.cameraMotion.value.latitude===Pe.BackSide.latitude?s.z=0:(this.cameraMotion.value.longitude===Pe.RightSide.longitude&&this.cameraMotion.value.latitude===Pe.RightSide.latitude||this.cameraMotion.value.longitude===Pe.LeftSide.longitude&&this.cameraMotion.value.latitude===Pe.LeftSide.latitude)&&(s.x=0);var u=this.camera.pose.offset.clone().add(s);e.state.offset.copy(u),e.state.fov=a,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({x:u.x,y:u.y,z:u.z},0).catch(Q),this.cameraMotion.set({fov:a},0).catch(Q),e.type="gesture.pan",this.onPanGesture(e))}},t.prototype.onMouseWheel=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=le(this.cameraMotion.value.fov-e.center.delta,this.minFov,this.maxFov),i=e.center.coords,a=this.getZoomOffsetFromFov(i,this.camera,r);this.cameraMotion.value.longitude===Pe.Top.longitude&&this.cameraMotion.value.latitude===Pe.Top.latitude?a.y=0:this.cameraMotion.value.longitude===Pe.FrontSide.longitude&&this.cameraMotion.value.latitude===Pe.FrontSide.latitude||this.cameraMotion.value.longitude===Pe.BackSide.longitude&&this.cameraMotion.value.latitude===Pe.BackSide.latitude?a.z=0:(this.cameraMotion.value.longitude===Pe.RightSide.longitude&&this.cameraMotion.value.latitude===Pe.RightSide.latitude||this.cameraMotion.value.longitude===Pe.LeftSide.longitude&&this.cameraMotion.value.latitude===Pe.LeftSide.latitude)&&(a.x=0);var o=this.camera.pose.offset.clone().add(a);e.state.offset.copy(o),e.state.fov=r,this.emit("gesture.mousewheel",e),!e.defaultPrevented&&(this.locationMotion.set({x:o.x,y:o.y,z:o.z},0).catch(Q),this.cameraMotion.set({fov:r},0).catch(Q))},t}(si),to=function(n){de(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,u,c,l;if(e instanceof t)return e;var h=n.parseArgs.call(this,e);return R(R({},h),{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:40,maxLatitude:(s=e.maxLatitude)!==null&&s!==void 0?s:+Math.PI/2,minLatitude:(u=e.minLatitude)!==null&&u!==void 0?u:-Math.PI/2,moveSpeed:(c=e.moveSpeed)!==null&&c!==void 0?c:3.4,intersectMeshCreator:(l=e.intersectMeshCreator)!==null&&l!==void 0?l:function(){return new Si}})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,c=this.parseArgs(e),l=c.works,h=e.initial,p=h.state,v=h.currentState,m=typeof p.panoIndex=="number"?{workCode:(a=(r=p.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:p.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},A=l.getResolvedObserver(m),y=(o=p.longitude)!==null&&o!==void 0?o:v.longitude,f=le((s=p.latitude)!==null&&s!==void 0?s:Dn(v.mode)?v.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),g=le((u=p.fov)!==null&&u!==void 0?u:Dn(v.mode)?v.fov:c.defaultFov,c.minFov,c.maxFov),b=A?A.position.clone():new d.Vector3;return{workCode:m.workCode,panoIndex:m.panoIndex,mode:"PanoramaLike",longitude:y,latitude:f,fov:g,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 le(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=R({},i),u={longitude:0,latitude:0},c=0;c<a;c++)s.longitude*=.996,s.latitude*=.996*.99,u.longitude+=s.longitude,u.latitude+=s.latitude;var l=Nr(this.cameraMotion.value.longitude+u.longitude),h=le(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=R(R({},this.currentPano),{mode:this.mode,longitude:l,latitude:h,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),v=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),m=_("gesture.momentum",R(R({},e),{isFirst:r,isFinal:v,state:p}));if(this.inMomentumMovement.event=m,this.emit("gesture.momentum",m),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:l,latitude:h},0).catch(Q),v?this.inMomentumMovement=null:it.shared.add(function(A,y){o.requestMomentumMovement(e,!1,s,y|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>"u"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.coordinatesForOffset(a),s=Nr(this.cameraMotion.value.longitude+o.longitude),u=le(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&&(u=this.cameraMotion.value.latitude);var c=R(R({},this.currentPano),{mode:this.mode,longitude:s,latitude:u,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance});if(e.state=c,this.emit("gesture.pan",e),!e.defaultPrevented){var l={longitude:c.longitude,latitude:c.latitude,fov:c.fov};if(this.cameraMotion.set(l,0).catch(Q),e.isFinal){var h=e.velocityX,p=e.velocityY*.6;Math.abs(p)>.5&&Math.abs(h)<.5&&(h=0),this.inMomentumMovement={uuid:vt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:h,y:p}),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>"u")){var o=le(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=le(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.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.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=_("intersect.update",{raycaster:a,intersection:o??null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(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),c=u.clone().multiplyScalar(.05),l=o.point.clone().add(c);this.intersectMesh.position.copy(l);var h=l.clone().add(c);if(this.intersectMesh.lookAt(h),Math.abs(u.y)>.99){var p=this.camera.position.clone().sub(l);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t}(eo),jf="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGB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AAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",ra;function Ju(){return ra||(ra=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=jf,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 Zu=new d.OrthographicCamera(-1,1,1,-1,0,1),ro=new d.BufferGeometry;ro.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));ro.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var Wr=new d.Mesh(ro),no=new d.Scene;no.add(Wr);var _f=`
|
|
1329
1329
|
varying vec2 vUv;
|
|
1330
1330
|
void main() {
|
|
1331
1331
|
vUv = uv;
|
|
1332
1332
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1333
1333
|
}
|
|
1334
|
-
`,Pi=function(){function n(t,e){var r;this.renderer=t,this.material=new d.ShaderMaterial({vertexShader:(r=e.vertex)!==null&&r!==void 0?r:
|
|
1334
|
+
`,Pi=function(){function n(t,e){var r;this.renderer=t,this.material=new d.ShaderMaterial({vertexShader:(r=e.vertex)!==null&&r!==void 0?r:_f,fragmentShader:e.fragment,uniforms:Object.assign({inputBuffer:new d.Uniform(null)},e.uniforms),defines:Object.assign({},e.defines),blending:d.NoBlending,depthWrite:!1,depthTest:!1})}return n.prototype.render=function(t,e){var r=this.renderer.getRenderTarget(),i=Wr.material;this.material.uniforms.inputBuffer.value=t.texture,Wr.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(no,Zu),this.renderer.setRenderTarget(r),Wr.material=i},n.prototype.dispose=function(){this.material.dispose()},n}(),Gf=`
|
|
1335
1335
|
void main() {
|
|
1336
1336
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1337
1337
|
}
|
|
1338
|
-
`,
|
|
1338
|
+
`,Kf=`
|
|
1339
1339
|
uniform vec3 inputValue;
|
|
1340
1340
|
void main() {
|
|
1341
1341
|
gl_FragColor = vec4(inputValue, 1.0);
|
|
1342
1342
|
}
|
|
1343
|
-
`,
|
|
1343
|
+
`,Wf=function(){function n(t){this.renderer=t,this.material=new d.ShaderMaterial({vertexShader:Gf,fragmentShader:Kf,uniforms:Object.assign({inputValue:new d.Uniform(new d.Vector3)}),blending:d.NoBlending,depthWrite:!1,depthTest:!1})}return n.prototype.render=function(t,e){var r=this.renderer.getRenderTarget(),i=Wr.material;this.material.uniforms.inputValue.value.copy(t),Wr.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(no,Zu),this.renderer.setRenderTarget(r),Wr.material=i},n.prototype.dispose=function(){this.material.dispose()},n}(),Xf=`
|
|
1344
1344
|
#include <common>
|
|
1345
1345
|
uniform sampler2D inputBuffer;
|
|
1346
1346
|
uniform float scale;
|
|
@@ -1353,13 +1353,13 @@ void main() {
|
|
|
1353
1353
|
float luminance = clamp(linearToRelativeLuminance(rgb), 0.1, 0.9);
|
|
1354
1354
|
gl_FragColor = vec4(luminance);
|
|
1355
1355
|
}
|
|
1356
|
-
|
|
1356
|
+
`,Yf=function(n){de(t,n);function t(e,r){return r===void 0&&(r=.5),n.call(this,e,{uniforms:{inputBuffer:new d.Uniform(null),scale:new d.Uniform(r)},fragment:Xf})||this}return t}(Pi),Jf=`
|
|
1357
1357
|
uniform sampler2D inputBuffer;
|
|
1358
1358
|
varying vec2 vUv;
|
|
1359
1359
|
void main() {
|
|
1360
1360
|
gl_FragColor = texture2D(inputBuffer, vUv);
|
|
1361
1361
|
}
|
|
1362
|
-
`,
|
|
1362
|
+
`,Zf=function(n){de(t,n);function t(e){return n.call(this,e,{fragment:Jf})||this}return t}(Pi),Bi=function(){function n(t,e,r,i){this.enable=!0,this.renderer=t,this.scene=e,this.camera=r,this.models=i,this.copyPass=new Zf(this.renderer)}return n.prototype.render=function(t,e){},n.prototype.dispose=function(){this.copyPass.dispose()},n}(),$f=function(n){de(t,n);function t(e,r){r===void 0&&(r=.002);var i=n.call(this,e,{uniforms:{targetBuffer:new d.Uniform(null),inputBuffer:new d.Uniform(null),step:new d.Uniform(r)},fragment:`
|
|
1363
1363
|
uniform sampler2D targetBuffer;
|
|
1364
1364
|
uniform sampler2D inputBuffer;
|
|
1365
1365
|
uniform float step;
|
|
@@ -1387,7 +1387,7 @@ void main() {
|
|
|
1387
1387
|
}
|
|
1388
1388
|
gl_FragColor = vec4(result, result, result, 1.0);
|
|
1389
1389
|
}
|
|
1390
|
-
`})||this;return i.material.extensions.shaderTextureLOD=!0,i}return Object.defineProperty(t.prototype,"targetBuffer",{get:function(){return this.material.uniforms.targetBuffer.value},set:function(e){this.material.uniforms.targetBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"step",{get:function(){return this.material.uniforms.step.value},set:function(e){this.material.uniforms.step.value=e},enumerable:!1,configurable:!0}),t}(Pi),
|
|
1390
|
+
`})||this;return i.material.extensions.shaderTextureLOD=!0,i}return Object.defineProperty(t.prototype,"targetBuffer",{get:function(){return this.material.uniforms.targetBuffer.value},set:function(e){this.material.uniforms.targetBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"step",{get:function(){return this.material.uniforms.step.value},set:function(e){this.material.uniforms.step.value=e},enumerable:!1,configurable:!0}),t}(Pi),eh=function(n){de(t,n);function t(e){var r=n.call(this,e,{uniforms:{inputBuffer:new d.Uniform(null),luminanceAdaptiveBuffer:new d.Uniform(null),progress:new d.Uniform(0)},fragment:`
|
|
1391
1391
|
#include <common>
|
|
1392
1392
|
uniform sampler2D inputBuffer;
|
|
1393
1393
|
uniform sampler2D luminanceAdaptiveBuffer;
|
|
@@ -1409,14 +1409,14 @@ void main() {
|
|
|
1409
1409
|
rgb = clamp(lumCompressed * rgb, 0.0, 1.0);
|
|
1410
1410
|
gl_FragColor = mix(inputColor, vec4(rgb, alpha), progress * 0.9);
|
|
1411
1411
|
}
|
|
1412
|
-
`})||this;return r.material.transparent=!0,r}return Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t}(Pi),
|
|
1412
|
+
`})||this;return r.material.transparent=!0,r}return Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t}(Pi),th=function(n){de(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.enableTime=ve(),o.renderer=e,o.valuePass=new Wf(o.renderer),o.luminancePass=new Yf(o.renderer,Math.sqrt(1/3)),o.nextStepPass=new $f(o.renderer,.01),o.luminanceAdaptivePass=new eh(o.renderer),o}return t.prototype.render=function(e){if(!this.enable){this.enableTime=null,this.copyPass.render(e[0],e[1]);return}this.enableTime===null&&(this.enableTime=ve()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new d.WebGLRenderTarget(128,128,{minFilter:d.LinearMipmapLinearFilter,magFilter:d.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:d.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e[0],this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new d.WebGLRenderTarget(1,1,{minFilter:d.NearestFilter,magFilter:d.NearestFilter,type:d.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new d.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new d.WebGLRenderTarget(1,1,{minFilter:d.NearestFilter,magFilter:d.NearestFilter,type:d.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new d.Vector3(.5,.5,.5),this.luminanceNextBuffer),this.luminanceAdaptivePass.luminanceAdaptiveBuffer=this.luminanceNextBuffer.texture),this.copyPass.render(this.luminanceNextBuffer,this.luminancePrevBuffer),this.nextStepPass.render(this.luminancePrevBuffer,this.luminanceNextBuffer),this.luminanceAdaptivePass.progress=Math.min((ve()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e[0])},t.prototype.dispose=function(){var e,r,i;(e=this.luminanceTargetBuffer)===null||e===void 0||e.dispose(),(r=this.luminancePrevBuffer)===null||r===void 0||r.dispose(),(i=this.luminanceNextBuffer)===null||i===void 0||i.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t}(Bi),na,$n=512,rh=32,Pr=(na=Math.SQRT1_2)!==null&&na!==void 0?na:Math.sqrt(2),nh={up:new d.Quaternion(Pr,0,0,Pr),down:new d.Quaternion(-Pr,0,0,Pr),left:new d.Quaternion(0,Pr,0,Pr),right:new d.Quaternion(0,-Pr,0,Pr),front:new d.Quaternion(0,0,0,1),back:new d.Quaternion(0,1,0,0)},ih=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),ah=new Float32Array([0,0,1,0,0,1,1,1]),oh=new Uint8Array([0,1,2,1,3,2]),Ri=new d.BufferGeometry;Ri.setAttribute("position",new d.BufferAttribute(ih,3));Ri.setAttribute("uv",new d.BufferAttribute(ah,2));Ri.setIndex(new d.BufferAttribute(oh,1));var sh=`
|
|
1413
1413
|
uniform float flipY;
|
|
1414
1414
|
varying vec2 vUv;
|
|
1415
1415
|
void main() {
|
|
1416
1416
|
vUv = vec2(uv.x, mix(uv.y, (1.0 - uv.y), flipY));
|
|
1417
1417
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1418
1418
|
}
|
|
1419
|
-
`,
|
|
1419
|
+
`,uh=`
|
|
1420
1420
|
#if defined(USE_LUMINANCE)
|
|
1421
1421
|
uniform sampler2D luminanceMap;
|
|
1422
1422
|
#endif
|
|
@@ -1429,7 +1429,7 @@ void main() {
|
|
|
1429
1429
|
gl_FragColor.a = 1.0 - texture2D(luminanceMap, vUv).r;
|
|
1430
1430
|
#endif
|
|
1431
1431
|
}
|
|
1432
|
-
`,
|
|
1432
|
+
`,lh=function(n){de(t,n);function t(){var e=n.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null},flipY:{value:0}},vertexShader:sh,fragmentShader:uh})||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,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}}}),e}return t}(d.ShaderMaterial),ch=function(n){de(t,n);function t(e,r){var i=n.call(this,Ri,new lh)||this;return e.box.getCenter(i.position),i.quaternion.multiplyQuaternions(new d.Quaternion().setFromAxisAngle(new d.Vector3(0,1,0),-Math.PI),nh[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.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),dh=function(n){de(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!1,e.name="tiling",e}return t}(d.Group),fh=function(){function n(t,e,r){this.disposed=!1,this.textureLoader=new An,this.minLevel=e,this.level=0,this.panoId="[0]",this.pedding=0,this.tileTree=pa(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=r,this.fetcher=t,this.object=new dh,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=pa(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&&Ha(this.tileTree,function(b){if(!(b.level<i.minLevel)){if(b.level>e||!t.intersectsBox(b.box))return!1;o.push(b)}});var s=new d.Vector3;o.sort(function(b,w){return b.level!==w.level?b.level-w.level:b.box.getCenter(s).angleTo(a)-w.box.getCenter(s).angleTo(a)});for(var u=new Set,c=function(b){var w=l.resource.filter(function(z){return z.level===b.level})[0];if(!w)return"continue";if(u.add(b),l.tileMeshes.has(b))return l.tileMeshes.get(b).activeTime=r,"continue";var E=w.size,x=l.imageOptions.transform,M=Math.pow(2,b.level)*b.position.y,C=Math.pow(2,b.level)*b.position.x,I="".concat(l.panoId,".").concat(b.face,".").concat(b.level,".").concat(M,".").concat(C),P=R(R({key:"pano_tile.".concat(I)},sr(l.imageOptions,["format","size","quality","sharpen","mappings"])),{size:E*b.size===$n?void 0:$n,cut:[E*b.position.x,E*b.position.y,E*b.size,E*b.size]}),S=l.textureLoader.loadTexture(w[b.face],{imageURL:{transform:x,options:P},viaAjax:ga,fetcher:l.fetcher}).then(function(z){return z.body}),F=null;if(l.luminance){var k=l.luminance[b.face],O=k.match(/\/cube_(\d+)\//),L=O?Number(O[1]):!1;if(L!==!1){var N=R(R({},P),{size:L*b.size===$n/2?void 0:$n/2,cut:[L*b.position.x,L*b.position.y,L*b.size,L*b.size],key:"pano_tile_luminance.".concat(I)});F=l.textureLoader.loadTexture(k,{imageURL:{transform:l.imageOptions.transform,options:N},viaAjax:ga,fetcher:l.fetcher}).then(function(z){return z.body}).catch(function(){return null})}}l.pedding++;var V=Promise.all([S,F]).then(function(z){return i.pedding--,z},function(z){return i.pedding--,Promise.reject(z)}),j=new ch(b,V);j.name="tiling:tile-".concat(I),j.activeTime=r,j.renderOrder=b.level,l.tileMeshes.set(b,j),l.object.needsRender=!0,l.object.add(j)},l=this,h=0,p=o;h<p.length;h++){var v=p[h];c(v)}var m=[];this.tileMeshes.forEach(function(b,w){u.has(w)||m.push(w),b.visible=w.level<=e});for(var A=m.sort(function(b,w){var E,x,M,C;return((x=(E=i.tileMeshes.get(w))===null||E===void 0?void 0:E.activeTime)!==null&&x!==void 0?x:0)-((C=(M=i.tileMeshes.get(b))===null||M===void 0?void 0:M.activeTime)!==null&&C!==void 0?C:0)}).slice(Math.max(0,rh-u.size)),y=0,f=A;y<f.length;y++){var v=f[y],g=this.tileMeshes.get(v);g&&(g.dispose(),this.object.remove(g),this.object.needsRender=!0),this.tileMeshes.delete(v)}}},n.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},n}(),hh=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]),ph=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]),io=new d.BufferGeometry;io.setAttribute("position",new d.BufferAttribute(hh,3));io.setIndex(new d.BufferAttribute(ph,1));var vh=`
|
|
1433
1433
|
#if defined(USE_PANO_VIDEO)
|
|
1434
1434
|
varying vec3 worldPosition;
|
|
1435
1435
|
#endif
|
|
@@ -1440,7 +1440,7 @@ void main() {
|
|
|
1440
1440
|
#endif
|
|
1441
1441
|
gl_Position = projectionMatrix * modelViewMatrix * transformed;
|
|
1442
1442
|
}
|
|
1443
|
-
`,
|
|
1443
|
+
`,Ah=`
|
|
1444
1444
|
uniform vec2 size;
|
|
1445
1445
|
uniform mat4 matrix;
|
|
1446
1446
|
uniform float alpha;
|
|
@@ -1464,7 +1464,7 @@ void main() {
|
|
|
1464
1464
|
gl_FragColor = vec4(videoColor.rgb, match * blendAlpha * alpha);
|
|
1465
1465
|
#endif
|
|
1466
1466
|
}
|
|
1467
|
-
`,bh=function(){function n(){this.material=new d.ShaderMaterial({vertexShader:gh,fragmentShader:yh,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(oo,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new we({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}(),wh=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),Ms=new d.Vector3(-1,1,1),Cs=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}(),so=function(n){de(t,n);function t(e){var r=this,i,a,o,s,u=t.parseArgs(e);r=n.call(this,u)||this,r.TILED_CUBE_TEXTURE_LEVEL=2,r.mode="Panorama",r.tileLevel=0,r.initAnimationed=!1,r.maxAccessibleDistance=u.maxAccessibleDistance,r.panoTapTriggerRadius=u.panoTapTriggerRadius,r.panoCircleMeshCreator=u.panoCircleMeshCreator,r.tileLevelForFov=u.tileLevelForFov,r.luminanceAdaptiveEffectEnable=u.luminanceAdaptiveEffectEnable,r.colorCubeRenderTargetPool=new Cs,r.luminanceCubeRenderTargetPool=new Cs;var c=r.models.getMaterial()||{},l=c.pano0,h=c.pano1;l&&(h==null?void 0:h.map)!==l.map&&(r.models.setMaterial({pano0:h}),l.map.dispose(),l.map instanceof Qe&&l.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(l.map.cubeRenderTarget),l.luminanceMap&&(l.luminanceMap.dispose(),l.luminanceMap instanceof Qe&&l.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(l.luminanceMap.cubeRenderTarget)));for(var p=r.colorCubeRenderTargetPool.size;p<2;p++){var v=Math.max(1024*r.TILED_CUBE_TEXTURE_LEVEL,512),m=r.colorCubeRenderTargetPool.create();m.setSize(v,v),Aa(null,m,r.renderer),r.colorCubeRenderTargetPool.push(m)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new we({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new we({modelAlpha:(a=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&a!==void 0?a:0}),r.perspToOrthoMotion=new we({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=vt()]={panoId:Be(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"};var A=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new An,r.tiling=new vh(A?pt(A.work):ci,r.TILED_CUBE_TEXTURE_LEVEL+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new bh,r.scene.add(r.panoVideo.object),r}return t.parseArgs=function(e){var r,i,a,o,s;if(e instanceof t)return e;var u=n.parseArgs.call(this,e);return R(R({},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 to},tileLevelForFov:(o=e.tileLevelForFov)!==null&&o!==void 0?o:function(c,l){var h=function(y){return y/Math.PI*180},p=function(y){return y/180*Math.PI},v=l.height/2/Math.tan(p(c/2)),m=l.width>l.height?c:h(Math.atan(Math.tan(p(c/2))*(l.width/l.height))*2),A=v*(Math.tan(p(m/2))-Math.tan(p(m/2-1)));return A>60?4:A>30?3:A>18?2:A>12?1:0},luminanceAdaptiveEffectEnable:(s=e.luminanceAdaptiveEffectEnable)!==null&&s!==void 0?s:!0})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return R(R({},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],u=this.panoMeshes[s];this.helper.remove(u),u.dispose(),delete this.panoMeshes[s]}var c=this.videoTexture.image;c.pause(),c.oncanplay=function(){},c.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var l=(e=this.models.getMaterial())!==null&&e!==void 0?e:{},h=l.pano0,p=l.pano1,v=0,m=Object.keys(this.panoResources);v<m.length;v++){var A=m[v],y=this.panoResources[A];if(y.panoPicture){var f=y.panoPicture.map;f&&f!==(h==null?void 0:h.map)&&f!==(p==null?void 0:p.map)&&(f.dispose(),(r=y.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),y.panoPicture=null)}delete this.panoResources[A]}this.luminanceAdaptiveEffect&&(this.luminanceAdaptiveEffect.dispose(),delete this.luminanceAdaptiveEffect)},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 Qe&&(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(R(R({},this),{initial:{currentState:R(R({},this.currentPano),this.camera.pose),duration:i,state:r,userAction:a}})),u={workCode:s.workCode,panoIndex:s.panoIndex},c=this.works.getWork(u.workCode);return this.tiling.setFetcher(c?pt(c):ci),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(u,{effect:"fade",duration:i,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,u,c,l,h,p,v,m;if(!this.destroyed){var A={},y={},f=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),y.longitude=this.cameraMotion.value.longitude,y.latitude=this.cameraMotion.value.latitude,y.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),A.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(le(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),E=w[0],x=w[1],M=this.panoResourceFromLocationMotionKeyframe(E),C=this.panoResourceFromLocationMotionKeyframe(x),I=new d.Vector3().copy(M.position),P=new d.Vector3().copy(C.position),S=this.locationMotion.value.count-x.value.count+1;A.progress=S,C.panoPicture&&(S<1?M.panoPicture&&(A.pano0=M.panoPicture):A.pano0=C.panoPicture,A.pano1=C.panoPicture),b=A.useBlackTransition=C.effect==="instant"||C.effect==="montage",(C.effect==="fade"||C.effect==="montage")&&(A.pano0&&M.panoPicture&&(A.pano0={map:A.pano0.map,luminanceMap:A.pano0.luminanceMap,matrix:M.panoPicture.matrix.clone().setPosition(C.position)}),I.copy(P)),y.distance=this.locationMotion.value.distance,y.offset=new d.Vector3(I.x+(P.x-I.x)*S,I.y+(P.y-I.y)*S,I.z+(P.z-I.z)*S);for(var F=[],k=[],O=0,L=this.locationMotion.keyframes;O<L.length;O++){var N=L[O],V=N.key,j=N.progress;V!==void 0&&(F.push(V),j>=this.locationMotion.progress&&k.push(V))}for(var z=0,U=Object.keys(this.panoResources);z<U.length;z++){var X=U[z];if(!(k.indexOf(X)>=0)){var G=this.panoResources[X];if(G.panoPicture){var K=G.panoPicture.map,Y=G.panoPicture.luminanceMap;if(K){if(K===((a=A.pano0)===null||a===void 0?void 0:a.map)||K===((o=A.pano1)===null||o===void 0?void 0:o.map))continue;K instanceof Qe&&K.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(K.cubeRenderTarget),K.dispose(),Y&&(Y instanceof Qe&&Y.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(Y.cubeRenderTarget),Y.dispose()),G.panoPicture=null}}F.indexOf(X)>=0||delete this.panoResources[X]}}this.currentPano=Ye(C.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:Ye(f.panoId),state:R(R(R(R({},Ye(g.panoId)),{mode:this.mode}),Ve(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}St(A)===!1&&(!((s=A.pano0)===null||s===void 0)&&s.map&&A.pano0.map instanceof Qe&&!A.pano0.map.cubeRenderTarget&&(A.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=A.pano0)===null||u===void 0)&&u.luminanceMap&&A.pano0.luminanceMap instanceof Qe&&!A.pano0.luminanceMap.cubeRenderTarget&&(A.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((c=A.pano1)===null||c===void 0)&&c.map&&A.pano1.map instanceof Qe&&!A.pano1.map.cubeRenderTarget&&(A.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=A.pano1)===null||l===void 0)&&l.luminanceMap&&A.pano1.luminanceMap instanceof Qe&&!A.pano1.luminanceMap.cubeRenderTarget&&(A.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(A)),St(y)===!1&&this.setCamera(y);var H=this.works.getResolvedObserver(this.currentPano),J=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||b){if(H)for(var ne=0,$=Object.keys(this.panoMeshes);ne<$.length;ne++){var te=$[ne],ae=this.panoMeshes[te];ae.setOpacity(0),ae.setCurrent(!1),ae.updateTime&&ae.updateTime(e,r)}}else if(H){var ce=Ot(H.visibleIds,function(ye){var me=i.works.getResolvedObserver(ye);return me?H.standingPosition.distanceTo(me.standingPosition):1/0},!0),oe=ce[1];oe=le(oe,2.5,1/0);for(var fe=H.visibleIds.concat(Be(this.currentPano)),Ie=this.camera.getDirection(new d.Vector3),Ae=0,Fe=Object.keys(this.panoMeshes);Ae<Fe.length;Ae++){var te=Fe[Ae],ae=this.panoMeshes[te],re=this.works.getResolvedObserver(te);if(fe.indexOf(te)===-1)ae.setCurrent(!1),ae.setOpacity(0);else if(!re)ae.setCurrent(!1),ae.setOpacity(0);else if(!re.loadable&&!re.active)ae.setCurrent(!1),ae.setOpacity(0);else{var he=ae.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ae.setCurrent(!ae.loading&&ae.progress===0&&J!==null&&J.panoId===te),ae.setOpacity(he<.01?0:le(oe/he*1.2,.4,.85));var W=this.camera.position.clone().setY(ae.position.y),Oe=new d.Vector3().copy(ae.position).sub(W).normalize();if(te===Be(this.currentPano)){var ke=le((.5-W.distanceTo(ae.position))/.5,0,1);Oe.multiplyScalar(1-ke).add(Ie.clone().multiplyScalar(ke))}Oe.length()>0&&ae.quaternion.setFromEuler(new d.Euler(0,Math.atan2(Oe.x,Oe.z),0))}ae.updateTime&&ae.updateTime(e,r)}}var Je=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ye=i.renderer.getDrawingBufferSize(new d.Vector2);ye.width*=i.scissor.width,ye.height*=i.scissor.height;var me=g.panoId,lt=i.works.getResolvedObserver(me),Se=i.imageOptions.size;if(typeof Se>"u"&<){var $e=lt.images.up.match(/\/cube_(\d+)\//);$e&&(Se=Number($e[1]))}typeof Se>"u"&&(Se=2048);var Ue=0;Se>=1024&&(Ue=1),Se>=2048&&(Ue=2),Se>=4096&&(Ue=3),Se>=8192&&(Ue=4);var At=i.tileLevelForFov(i.camera.fov,ye);return At>Ue?At:0}(),Ze=function(){var ye=i.camera.quaternion.clone(),me=i.works.getResolvedObserver(g.panoId),lt=me??H;lt&&ye.premultiply(lt.quaternion.clone().inverse());var Se=new d.Matrix4().makeRotationFromQuaternion(ye),$e=new d.Matrix4().getInverse(Se),Ue=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(i.camera.projectionMatrix,$e));return Ue}();g.panoId===Be(this.currentPano)&&(((h=g.panoPicture)===null||h===void 0?void 0:h.map)instanceof Qe&&(g.panoPicture.map.update(Ze,Je),g.panoPicture.map.needsRender===!0&&(g.panoPicture.map.needsRender=!1,this.needsRender=!0)),((p=g.panoPicture)===null||p===void 0?void 0:p.luminanceMap)instanceof Qe&&(g.panoPicture.luminanceMap.update(Ze,Je),g.panoPicture.luminanceMap.needsRender===!0&&(g.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0)));{var De=this.tiling.object.visible;if(this.initAnimationed){var We=g.panoId,Le=this.works.getResolvedObserver(We);Le?Ti(this.camera.position,Le.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==We&&this.tiling.cleanup(),this.tiling.panoId=We,this.tiling.setResource((m=(v=Le.images)===null||v===void 0?void 0:v.tiles)!==null&&m!==void 0?m:[],this.enableIOSEDR&&Le.images.luminance?Le.images.luminance:null),this.tiling.setFetcher(pt(Le.work)),this.tiling.setRotation(Le.quaternion),this.tiling.setPosition(Le.position),Je>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ze,Je,e):this.tiling.update(Ze,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;De!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},t.prototype.render=function(){var e=this.works.getResolvedObserver(this.currentPano);e&&e.video&&(this.needsRender=!0),n.prototype.render.call(this)},t.prototype.postProcessing=function(e,r){if(!this.destroyed&&r==="luminance")return this.luminanceAdaptiveEffect||(this.luminanceAdaptiveEffect=new ih(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(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[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,u,c;this.userAction=i,this.stopMomentumMovement();var l=this.works.getResolvedObserver(e);if(!l)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));var h=this.imageOptions.size;if(typeof h>"u"&&l){var p=l.images.up.match(/\/cube_(\d+)\//);p&&(h=Number(p[1]))}typeof h>"u"&&(h=2048);var v=this.imageOptions.transform,m=R({key:"pano.".concat(l.panoId)},sr(this.imageOptions,["format","size","quality","sharpen","mappings"])),A=l.images,y=(s=(o=l.images.tiles)===null||o===void 0?void 0:o.filter(function(O){return O.size>h}))!==null&&s!==void 0?s:null,f=v,g={key:"pano_luminance.".concat(l.panoId),size:m.size?m.size/2:1024},b=this.enableIOSEDR&&l.images.luminance?l.images.luminance:null,w=function(){if(!l.images.tiles||!b)return null;var O=b.up.match(/\/cube_(\d+)\//),L=O?Number(O[1]):!1;return L===!1?null:y==null?void 0:y.map(function(N){return{level:N.level,size:L,back:b.back,front:b.front,left:b.left,right:b.right,up:b.up,down:b.down}})}(),E="pano:"+fn([A,m,v]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===E)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:l.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var M="move-to-pano-"+l.panoId;this.pending.add(M);var C=this.models.getMaterial()||{},I=C.pano0,P=C.pano1,S;if(I&&I.map.name===E&&I.luminanceMap!==null===this.enableIOSEDR?S=I:(P==null?void 0:P.map.name)===E&&P.luminanceMap!==null===this.enableIOSEDR&&(S=P),S){var F={panoId:l.panoId,effect:(c=r.effect)!==null&&c!==void 0?c:"fly",panoPicture:{map:S.map,luminanceMap:S.luminanceMap,matrix:new d.Matrix4().compose(l.position,l.quaternion,Ms)},position:l.position.clone()};it.shared.add(function(){a.pending.delete(M),a.doMoveToPano(l.pano,F,r)},!0,1);return}this.pendingTextureTask={panoId:l.panoId,hash:E,onLoad:function(O,L){var N,V;if(a.pending.delete(M),a.destroyed)O.body.dispose();else{O.body.name=E;var j={panoId:l.panoId,effect:(N=r.effect)!==null&&N!==void 0?N:"fly",panoPicture:{map:O.body,luminanceMap:(V=L==null?void 0:L.body)!==null&&V!==void 0?V:null,matrix:new d.Matrix4().compose(l.position,l.quaternion,Ms)},position:l.position.clone()};a.doMoveToPano(l.pano,j,r)}},onError:function(O){a.pending.delete(M);var L=R(R(R({},l.pano),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.error",_("pano.error",{error:O,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:L})),a.emit("pano.cancel",_("pano.cancel",{error:O,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:L})),a.emit("error",O),r.moveCancelCallback&&r.moveCancelCallback()}};var k=this.panoMeshes[l.panoId];k&&k.tap&&k.tap(),Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(A,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:m},format:d.RGBAFormat,viaAjax:!0,fetcher:pt(l.work)},void 0,void 0,function(O){var L,N;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:O,meta:null,pano:l.pano})),((L=a.pendingTextureTask)===null||L===void 0?void 0:L.hash)===E&&((N=a.panoMeshes[l.panoId])===null||N===void 0||N.setProgress(O))},this.renderer):this.textureLoader.loadCubeTexture(A,{imageURL:{transform:v,options:m},format:d.RGBAFormat,viaAjax:!0,fetcher:pt(l.work)},void 0,void 0,function(O){var L,N;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:O,meta:null,pano:l.pano})),((L=a.pendingTextureTask)===null||L===void 0?void 0:L.hash)===E&&((N=a.panoMeshes[l.panoId])===null||N===void 0||N.setProgress(O))},this.renderer),b?this.tileLevelForFov&&w&&w.length?this.textureLoader.loadTiledCubeTexture(b,w,{tileImageSize:256,tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:f,options:g},fetcher:pt(l.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(b,{imageURL:{transform:f,options:g},fetcher:pt(l.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(O){var L,N,V=O[0],j=O[1];((L=a.pendingTextureTask)===null||L===void 0?void 0:L.hash)===E?(a.pendingTextureTask.onLoad(V,j),(N=a.panoMeshes[l.panoId])===null||N===void 0||N.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:V.meta,pano:l.pano}))):(V.body.dispose(),j==null||j.body.dispose())}).catch(function(O){var L,N;((L=a.pendingTextureTask)===null||L===void 0?void 0:L.hash)===E&&(a.pendingTextureTask.onError(O),(N=a.panoMeshes[l.panoId])===null||N===void 0||N.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:O,progress:0,meta:null,pano:l.pano})),a.emit("error",O))}),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:l.pano}))},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),u={workCode:s.workCode,panoIndex:s.panoIndex},c={modelAlpha:0},l={perspToOrtho:0},h=!1;e.moveToPano(u,{longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(p){h=!0,e.perspToOrthoMotion.set(l,a).catch(Q),e.modelAlphaMotion.setKeyframes([{progress:0,value:R({},e.modelAlphaMotion.value)},{progress:.6,value:R({},e.modelAlphaMotion.value)},{progress:1,value:c}],a).catch(Q),e.emit("initAnimation.start",_("initAnimation.start",{state:p,userAction:e.userAction}))},moveEndCallback:function(p){e.emit("initAnimation.end",_("initAnimation.end",{state:p,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var p=R(R(R({},u),{mode:e.mode}),Ve(e.camera.pose));h===!1&&e.emit("initAnimation.start",_("initAnimation.start",{state:p,userAction:e.userAction})),e.emit("initAnimation.end",_("initAnimation.end",{state:p,userAction:e.userAction})),e.initAnimationed=!0,r()}},o)})},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],u=this.panoMeshes[s];r[s]=u,delete this.panoMeshes[s]}for(var c=1,l={},h=function(x){var M=Ot(x.accessibleIds,function(I){var P=e.works.getResolvedObserver(I);if(!P)return 1/0;var S=P.standingPosition.distanceTo(x.standingPosition);return le(S,1,1/0)},!0),C=M[1];l[x.panoId]===void 0&&(l[x.panoId]=C)},p=0,v=this.works.resolvedObservers;p<v.length;p++){var m=v[p];h(m)}var A=Object.keys(l).map(function(x){return l[x]});if(A.length){var y=A.reduce(function(x,M){return x+M},0)/A.length;c=le(y*.6,1,3)}for(var f=0,g=this.works.resolvedObservers;f<g.length;f++){var m=g[f],u=void 0;r[m.panoId]?(u=r[m.panoId],u.loading===!0&&m.loadable===!1&&u.setLoading(!1),delete r[m.panoId]):(u=this.panoCircleMeshCreator(m.pano),u.name="PanoCircleMesh_"+m.panoId,this.helper.add(u)),u.scale.set(c,1,c),u.position.copy(m.standingPosition),this.panoMeshes[m.panoId]=u}for(var b=0,w=Object.keys(r);b<w.length;b++){var E=w[b];this.helper.remove(r[E]),r[E].dispose(),delete r[E]}},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,c;i===void 0&&(i={});var l=ve(),h=vt();this.tiling.cleanup(),this.panoResources[h]=r;var p=1,v,m,A;if(this.locationMotion.ended){var y=this.locationMotion.getKeyFrameSegment(l);y[0];var f=y[1],g=this.locationMotion.value,b=((o=this.panoResourceFromLocationMotionKeyframe(f))!==null&&o!==void 0?o:this.camera).position,w=r.position;v=Math.max(b.distanceTo(w),p),m=[{key:f.key,progress:0,value:R(R({},g),{count:0})},{key:h,progress:1,value:{distance:0,count:1}}],A=0}else{var E=this.locationMotion.getKeyFrameSegment(l),x=E[0],f=E[1],g=this.locationMotion.value,M=this.panoResourceFromLocationMotionKeyframe(x).position,b=this.panoResourceFromLocationMotionKeyframe(f).position,w=r.position,C=f.value.count-g.count,I=Math.max(M.distanceTo(b),p)*C,P=Math.max(b.distanceTo(w),p);v=I+P,m=[{key:x.key,progress:0,value:R({},g)},{key:f.key,progress:I/v,value:f.value},{key:h,progress:1,value:{count:f.value.count+1,distance:0}}];var S=this.locationMotionKeyframesLength(this.locationMotion.keyframes),F=this.locationMotionKeyframesLength(m);S===0||S===0?A=0:A=this.locationMotion.getProgressVelocity(l)*S/F}var k=this.calculateMovingDuration(i.duration,i.effect==="fade"||i.effect==="montage"?0:v),O={longitude:i.longitude,latitude:i.latitude,fov:i.fov},L=R(R({},e),{mode:this.mode,longitude:(s=O.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(u=O.latitude)!==null&&u!==void 0?u:this.camera.pose.latitude,fov:(c=O.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),N=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:N,progress:0,state:L,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(L),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),this.cameraMotion.set(O,k).catch(Q);var V=this.locationMotion.setKeyframes(m,k,A);V.then(function(){var j,z,U=R(R({},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:N,progress:1,state:U,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(U);var X=a.works.getResolvedObserver(e);if(X&&X.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var G=wh.clone().multiply((z=(j=a.models.getMaterial().pano1)===null||j===void 0?void 0:j.matrix)!==null&&z!==void 0?z:new d.Matrix4).multiply(X.video.matrix),K={map:a.videoTexture,size:X.video.size,matrix:G,alpha:1},Y=vt(),H=a.videoTexture.image;H.setAttribute("uuid",Y),$u().then(function(J){J&&X.video&&H.getAttribute("uuid")===Y&&(H.oncanplay=function(){H.oncanplay=Q,H.play()},H.ontimeupdate=function(){H.currentTime>.5&&(H.ontimeupdate=Q,a.panoVideo.setMaterial(K))},H.src=X.video.source)}).catch(function(){H.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:N,progress:0,state:L,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??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 u=this.models.intersectRaycaster(a)[0],c=u?u.point:a.ray.origin.clone().add(a.ray.direction.clone().normalize().multiplyScalar(3)),l=c.clone().sub(o).normalize();if(l.length()===0)return null;for(var h=i.accessibleIds.filter(function(E){if(E===Be(r.currentPano))return!1;var x=r.works.getResolvedObserver(E);if(!x)return!1;var M=x.standingPosition.clone().project(r.camera);return Math.abs(M.z)>1||Math.abs(M.x)>1||Math.abs(M.y)>1?!1:x.loadable||x.active}),p=h.slice().sort(function(E,x){var M=r.works.getResolvedObserver(E).standingPosition.clone().distanceTo(o),C=r.works.getResolvedObserver(x).standingPosition.clone().distanceTo(o);return M-C}),v=0,m=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];v<m.length;v++)for(var A=m[v],y=0,f=p;y<f.length;y++){var g=f[y],b=this.works.getResolvedObserver(g);if(b){var w=b.standingPosition.clone().sub(o);if(w&&w.length()!==0&&l.angleTo(w)<A)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!==Be(this.currentPano))return}var o=e.center.raycaster,s=this.camera.getDirection(new d.Vector3).setY(0),u=null,c=this.works.getResolvedObserver(this.currentPano);if(c){var l=c.accessibleIds.filter(function(z){if(z===Be(r.currentPano))return!1;var U=r.works.getResolvedObserver(z);return!U||U.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:U.loadable||U.active}),h=this.models.intersectRaycaster(o)[0];if(h){var p=Ot(l,function(z){var U=r.works.getResolvedObserver(z);if(!U)return 1/0;var X=U.standingPosition.clone();return X.distanceTo(h.point)},!0),v=p[0],m=p[1];v&&m<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(v))!==null&&i!==void 0?i:null)}u||(u=this.getForwardObserverOrNot(o));for(var A=0,y=this.locationMotion.keyframes;A<y.length;A++){var f=y[A],g=this.panoResourceFromLocationMotionKeyframe(f);if(!(f.progress<this.locationMotion.progress)&&u&&g.panoId===u.panoId){u=null;break}}if(!u)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var b={},w=Math.PI/6,E=Math.PI/12,x=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),M=[],C=[],I=[],P=0,S=u.accessibleIds;P<S.length;P++){var v=S[P],F=Ye(v);if(!(Ft(F,this.currentPano)||Ft(F,u.pano))){var k=this.works.getResolvedObserver(v);if(k){var O=k.position.clone().sub(u.position).setY(0);x.angleTo(O)<w&&I.push(O)}}}var L=I.length>0?I:at(at([],M,!0),C,!0),N=L.slice().sort(function(z,U){return z.angleTo(x)-U.angleTo(x)})[0];N&&N.angleTo(s)>E&&(b.longitude=Math.atan2(-N.x,-N.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(b.latitude=le(0,this.minLatitude,this.maxLatitude));var V=R({},e.state);if(V.workCode=u.pano.workCode,V.panoIndex=u.pano.panoIndex,b.longitude!==void 0&&(V.longitude=b.longitude),b.latitude!==void 0&&(V.latitude=b.latitude),b.fov!==void 0&&(V.fov=b.fov),V.distance=0,V.offset=u.position.clone(),e.state=V,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:V,userAction:e.userAction,options:b,progress:0,error:null})),u&&!u.active){var j=u.panoId;this.panoMeshes[j]&&(this.panoMeshes[j].setDisabled(!1),this.panoMeshes[j].setLoading(!0))}u&&u.active&&this.emit("pano.request",_("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:V,options:b,error:null}))}}}}},t}(no),Ar=Math.PI/180,un=180/Math.PI,t0=.001,r0=1,kn=function(){var n=typeof navigator<"u"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),Eh=function(){var n=typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),xh=function(){var n=typeof navigator<"u"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),n0=function(){var n=typeof navigator<"u"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),Mh=function(){var n=!1;if(n0()===65){var t=typeof navigator<"u"?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}}(),Ch=function(){var n=kn()&&Eh()&&typeof navigator<"u"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),i0=function(){var n=typeof navigator<"u"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function Is(){var n=typeof window<"u"&&(window.orientation==90||window.orientation==-90);return i0()?!n:n}function Ih(n){return!(isNaN(n)||n<=t0||n>r0)}function Sh(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var Ss=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function Ts(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 Th(){if(typeof window>"u"||typeof document>"u")return!1;var n=window.self!==window.top,t=Ts(document.referrer),e=Ts(window.location.href);return n&&t!==e}var Ps=function(){function n(r,i,a){var o=i?i[0]:0,s=i?i[1]:0,u=i?i[2]:0,c=i?i[3]:1,l=o+o,h=s+s,p=u+u,v=o*l,m=o*h,A=o*p,y=s*h,f=s*p,g=u*p,b=c*l,w=c*h,E=c*p;return r[0]=1-(y+g),r[1]=m+E,r[2]=A-w,r[3]=0,r[4]=m-E,r[5]=1-(v+g),r[6]=f+b,r[7]=0,r[8]=A+w,r[9]=f-b,r[10]=1-(v+y),r[11]=0,r[12]=a?a[0]:0,r[13]=a?a[1]:0,r[14]=a?a[2]:0,r[15]=1,r}function t(r,i,a){var o=a[0],s=a[1],u=a[2],c,l,h,p,v,m,A,y,f,g,b,w;return i===r?(r[12]=i[0]*o+i[4]*s+i[8]*u+i[12],r[13]=i[1]*o+i[5]*s+i[9]*u+i[13],r[14]=i[2]*o+i[6]*s+i[10]*u+i[14],r[15]=i[3]*o+i[7]*s+i[11]*u+i[15]):(c=i[0],l=i[1],h=i[2],p=i[3],v=i[4],m=i[5],A=i[6],y=i[7],f=i[8],g=i[9],b=i[10],w=i[11],r[0]=c,r[1]=l,r[2]=h,r[3]=p,r[4]=v,r[5]=m,r[6]=A,r[7]=y,r[8]=f,r[9]=g,r[10]=b,r[11]=w,r[12]=c*o+v*s+f*u+i[12],r[13]=l*o+m*s+g*u+i[13],r[14]=h*o+A*s+b*u+i[14],r[15]=p*o+y*s+w*u+i[15]),r}function e(r,i){var a=i[0],o=i[1],s=i[2],u=i[3],c=i[4],l=i[5],h=i[6],p=i[7],v=i[8],m=i[9],A=i[10],y=i[11],f=i[12],g=i[13],b=i[14],w=i[15],E=a*l-o*c,x=a*h-s*c,M=a*p-u*c,C=o*h-s*l,I=o*p-u*l,P=s*p-u*h,S=v*g-m*f,F=v*b-A*f,k=v*w-y*f,O=m*b-A*g,L=m*w-y*g,N=A*w-y*b,V=E*N-x*L+M*O+C*k-I*F+P*S;return V?(V=1/V,r[0]=(l*N-h*L+p*O)*V,r[1]=(s*L-o*N-u*O)*V,r[2]=(g*P-b*I+w*C)*V,r[3]=(A*I-m*P-y*C)*V,r[4]=(h*k-c*N-p*F)*V,r[5]=(a*N-s*k+u*F)*V,r[6]=(b*M-f*P-w*x)*V,r[7]=(v*P-A*M+y*x)*V,r[8]=(c*L-l*k+p*S)*V,r[9]=(o*k-a*L-u*S)*V,r[10]=(f*I-g*M+w*E)*V,r[11]=(m*M-v*I-y*E)*V,r[12]=(l*F-c*O-h*S)*V,r[13]=(a*O-o*F+s*S)*V,r[14]=(g*x-f*C-b*E)*V,r[15]=(v*C-m*x+A*E)*V,r):null}return function(r,i,a){n(r,i),a&&t(r,r,a),e(r,r)}}(),ia=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}(),Ph=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new ia,this.currentGyroMeasurement=new ia,this.previousGyroMeasurement=new ia,kn()?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;Ih(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)",un*Sh(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}(),Bh=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<Ar*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(un*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}(),Rh=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}(),Fh=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),Bs=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),Oh=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 Ph(t,i),this.posePredictor=new Bh(e,i),this.isFirefoxAndroid=xh(),this.isIOS=kn();var a=n0();this.isDeviceMotionInRadians=!this.isIOS&&a!==null&&a<66,this.isWithoutDeviceMotion=Mh()||Ch(),this.filterToWorldQ=new d.Quaternion,kn()?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<"u"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new d.Vector3(0,0,1),o),this.setScreenTransform_(),Is()&&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<"u"&&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 Fh;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(),Is()&&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),Ps(t.leftViewMatrix,e,r.left),Ps(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window>"u")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),i=this.onDeviceOrientation_.bind(this);return kn()&&Th()&&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*Ar,o=t.left.downDegrees*Ar,s=t.left.leftDegrees*Ar,u=t.left.rightDegrees*Ar,c=2/(s+u),l=2/(a+o);i.left[0]=c,i.left[1]=0,i.left[2]=0,i.left[3]=0,i.left[4]=0,i.left[5]=l,i.left[6]=0,i.left[7]=0,i.left[8]=-((s-u)*c*.5),i.left[9]=(a-o)*l*.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*Ar,o=t.right.downDegrees*Ar,s=t.right.leftDegrees*Ar,u=t.right.rightDegrees*Ar,c=2/(s+u),l=2/(a+o);i.right[0]=c,i.right[1]=0,i.right[2]=0,i.right[3]=0,i.right[4]=0,i.right[5]=l,i.right[6]=0,i.right[7]=0,i.right[8]=-((s-u)*c*.5),i.right[9]=(a-o)*l*.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 Rh(t.distortionCoefficients),i=t.screenLensDistance,a=(e.widthMeters-t.interLensDistance)/2,o=t.interLensDistance/2,s=t.baselineLensDistance-e.bevelMeters,u=e.heightMeters-s,c=un*Math.atan(r.distort(a/i)),l=un*Math.atan(r.distort(o/i)),h=un*Math.atan(r.distort(s/i)),p=un*Math.atan(r.distort(u/i)),v=new Bs,m=new Bs;return v.leftDegrees=Math.min(c,t.fov),v.rightDegrees=Math.min(l,t.fov),v.downDegrees=Math.min(h,t.fov),v.upDegrees=Math.min(p,t.fov),m.leftDegrees=v.rightDegrees,m.rightDegrees=v.leftDegrees,m.upDegrees=v.upDegrees,m.downDegrees=v.downDegrees,{left:v,right:m}},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){Ss("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(a<=t0||a>r0){Ss("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&&(i0()?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<"u"?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}(),ei=[0,0,.5,1],ti=[.5,0,.5,1],kh=function(){function n(t){var e=this;this.renderer=t,this.sensor=new Oh(.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*ei[0]),y:Math.round(r.height*ei[1]),width:Math.round(r.width*ei[2]),height:Math.round(r.height*ei[3])},o={x:Math.round(r.width*ti[0]),y:Math.round(r.height*ti[1]),width:Math.round(r.width*ti[2]),height:Math.round(r.height*ti[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 u=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=u.left.slice(),this.cameraR.projectionMatrix.elements=u.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 Lh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6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dLqyWo6RekTZ2XNCsD6rgpTK/4p3WcrrPH1ghWJGhONC3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var aa,oa={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},Rs=typeof navigator<"u"&&(aa=oa[navigator.language.split("-")[0]])!==null&&aa!==void 0?aa:oa.zh,Nh=`
|
|
1467
|
+
`,mh=function(){function n(){this.material=new d.ShaderMaterial({vertexShader:vh,fragmentShader:Ah,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(io,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new we({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}(),gh=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),Es=new d.Vector3(-1,1,1),xs=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}(),ao=function(n){de(t,n);function t(e){var r=this,i,a,o,s,u=t.parseArgs(e);r=n.call(this,u)||this,r.TILED_CUBE_TEXTURE_LEVEL=2,r.mode="Panorama",r.tileLevel=0,r.initAnimationed=!1,r.maxAccessibleDistance=u.maxAccessibleDistance,r.panoTapTriggerRadius=u.panoTapTriggerRadius,r.panoCircleMeshCreator=u.panoCircleMeshCreator,r.tileLevelForFov=u.tileLevelForFov,r.luminanceAdaptiveEffectEnable=u.luminanceAdaptiveEffectEnable,r.colorCubeRenderTargetPool=new xs,r.luminanceCubeRenderTargetPool=new xs;var c=r.models.getMaterial()||{},l=c.pano0,h=c.pano1;l&&(h==null?void 0:h.map)!==l.map&&(r.models.setMaterial({pano0:h}),l.map.dispose(),l.map instanceof Qe&&l.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(l.map.cubeRenderTarget),l.luminanceMap&&(l.luminanceMap.dispose(),l.luminanceMap instanceof Qe&&l.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(l.luminanceMap.cubeRenderTarget)));for(var p=r.colorCubeRenderTargetPool.size;p<2;p++){var v=Math.max(1024*r.TILED_CUBE_TEXTURE_LEVEL,512),m=r.colorCubeRenderTargetPool.create();m.setSize(v,v),Aa(null,m,r.renderer),r.colorCubeRenderTargetPool.push(m)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new we({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new we({modelAlpha:(a=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&a!==void 0?a:0}),r.perspToOrthoMotion=new we({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=vt()]={panoId:Be(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"};var A=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new An,r.tiling=new fh(A?pt(A.work):ci,r.TILED_CUBE_TEXTURE_LEVEL+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new mh,r.scene.add(r.panoVideo.object),r}return t.parseArgs=function(e){var r,i,a,o,s;if(e instanceof t)return e;var u=n.parseArgs.call(this,e);return R(R({},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 $a},tileLevelForFov:(o=e.tileLevelForFov)!==null&&o!==void 0?o:function(c,l){var h=function(y){return y/Math.PI*180},p=function(y){return y/180*Math.PI},v=l.height/2/Math.tan(p(c/2)),m=l.width>l.height?c:h(Math.atan(Math.tan(p(c/2))*(l.width/l.height))*2),A=v*(Math.tan(p(m/2))-Math.tan(p(m/2-1)));return A>60?4:A>30?3:A>18?2:A>12?1:0},luminanceAdaptiveEffectEnable:(s=e.luminanceAdaptiveEffectEnable)!==null&&s!==void 0?s:!0})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return R(R({},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],u=this.panoMeshes[s];this.helper.remove(u),u.dispose(),delete this.panoMeshes[s]}var c=this.videoTexture.image;c.pause(),c.oncanplay=function(){},c.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var l=(e=this.models.getMaterial())!==null&&e!==void 0?e:{},h=l.pano0,p=l.pano1,v=0,m=Object.keys(this.panoResources);v<m.length;v++){var A=m[v],y=this.panoResources[A];if(y.panoPicture){var f=y.panoPicture.map;f&&f!==(h==null?void 0:h.map)&&f!==(p==null?void 0:p.map)&&(f.dispose(),(r=y.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),y.panoPicture=null)}delete this.panoResources[A]}this.luminanceAdaptiveEffect&&(this.luminanceAdaptiveEffect.dispose(),delete this.luminanceAdaptiveEffect)},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 Qe&&(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(R(R({},this),{initial:{currentState:R(R({},this.currentPano),this.camera.pose),duration:i,state:r,userAction:a}})),u={workCode:s.workCode,panoIndex:s.panoIndex},c=this.works.getWork(u.workCode);return this.tiling.setFetcher(c?pt(c):ci),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(u,{effect:"fade",duration:i,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,u,c,l,h,p,v,m;if(!this.destroyed){var A={},y={},f=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),y.longitude=this.cameraMotion.value.longitude,y.latitude=this.cameraMotion.value.latitude,y.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),A.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(le(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),E=w[0],x=w[1],M=this.panoResourceFromLocationMotionKeyframe(E),C=this.panoResourceFromLocationMotionKeyframe(x),I=new d.Vector3().copy(M.position),P=new d.Vector3().copy(C.position),S=this.locationMotion.value.count-x.value.count+1;A.progress=S,C.panoPicture&&(S<1?M.panoPicture&&(A.pano0=M.panoPicture):A.pano0=C.panoPicture,A.pano1=C.panoPicture),b=A.useBlackTransition=C.effect==="instant"||C.effect==="montage",(C.effect==="fade"||C.effect==="montage")&&(A.pano0&&M.panoPicture&&(A.pano0={map:A.pano0.map,luminanceMap:A.pano0.luminanceMap,matrix:M.panoPicture.matrix.clone().setPosition(C.position)}),I.copy(P)),y.distance=this.locationMotion.value.distance,y.offset=new d.Vector3(I.x+(P.x-I.x)*S,I.y+(P.y-I.y)*S,I.z+(P.z-I.z)*S);for(var F=[],k=[],O=0,L=this.locationMotion.keyframes;O<L.length;O++){var N=L[O],V=N.key,j=N.progress;V!==void 0&&(F.push(V),j>=this.locationMotion.progress&&k.push(V))}for(var z=0,U=Object.keys(this.panoResources);z<U.length;z++){var X=U[z];if(!(k.indexOf(X)>=0)){var G=this.panoResources[X];if(G.panoPicture){var K=G.panoPicture.map,Y=G.panoPicture.luminanceMap;if(K){if(K===((a=A.pano0)===null||a===void 0?void 0:a.map)||K===((o=A.pano1)===null||o===void 0?void 0:o.map))continue;K instanceof Qe&&K.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(K.cubeRenderTarget),K.dispose(),Y&&(Y instanceof Qe&&Y.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(Y.cubeRenderTarget),Y.dispose()),G.panoPicture=null}}F.indexOf(X)>=0||delete this.panoResources[X]}}this.currentPano=Ye(C.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:Ye(f.panoId),state:R(R(R(R({},Ye(g.panoId)),{mode:this.mode}),Ve(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}St(A)===!1&&(!((s=A.pano0)===null||s===void 0)&&s.map&&A.pano0.map instanceof Qe&&!A.pano0.map.cubeRenderTarget&&(A.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=A.pano0)===null||u===void 0)&&u.luminanceMap&&A.pano0.luminanceMap instanceof Qe&&!A.pano0.luminanceMap.cubeRenderTarget&&(A.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((c=A.pano1)===null||c===void 0)&&c.map&&A.pano1.map instanceof Qe&&!A.pano1.map.cubeRenderTarget&&(A.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=A.pano1)===null||l===void 0)&&l.luminanceMap&&A.pano1.luminanceMap instanceof Qe&&!A.pano1.luminanceMap.cubeRenderTarget&&(A.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(A)),St(y)===!1&&this.setCamera(y);var H=this.works.getResolvedObserver(this.currentPano),J=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||b){if(H)for(var ne=0,$=Object.keys(this.panoMeshes);ne<$.length;ne++){var te=$[ne],ae=this.panoMeshes[te];ae.setOpacity(0),ae.setCurrent(!1),ae.updateTime&&ae.updateTime(e,r)}}else if(H){var ce=Ot(H.visibleIds,function(ye){var me=i.works.getResolvedObserver(ye);return me?H.standingPosition.distanceTo(me.standingPosition):1/0},!0),oe=ce[1];oe=le(oe,2.5,1/0);for(var fe=H.visibleIds.concat(Be(this.currentPano)),Ie=this.camera.getDirection(new d.Vector3),Ae=0,Fe=Object.keys(this.panoMeshes);Ae<Fe.length;Ae++){var te=Fe[Ae],ae=this.panoMeshes[te],re=this.works.getResolvedObserver(te);if(fe.indexOf(te)===-1)ae.setCurrent(!1),ae.setOpacity(0);else if(!re)ae.setCurrent(!1),ae.setOpacity(0);else if(!re.loadable&&!re.active)ae.setCurrent(!1),ae.setOpacity(0);else{var he=ae.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ae.setCurrent(!ae.loading&&ae.progress===0&&J!==null&&J.panoId===te),ae.setOpacity(he<.01?0:le(oe/he*1.2,.4,.85));var W=this.camera.position.clone().setY(ae.position.y),Oe=new d.Vector3().copy(ae.position).sub(W).normalize();if(te===Be(this.currentPano)){var ke=le((.5-W.distanceTo(ae.position))/.5,0,1);Oe.multiplyScalar(1-ke).add(Ie.clone().multiplyScalar(ke))}Oe.length()>0&&ae.quaternion.setFromEuler(new d.Euler(0,Math.atan2(Oe.x,Oe.z),0))}ae.updateTime&&ae.updateTime(e,r)}}var Je=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var ye=i.renderer.getDrawingBufferSize(new d.Vector2);ye.width*=i.scissor.width,ye.height*=i.scissor.height;var me=g.panoId,lt=i.works.getResolvedObserver(me),Se=i.imageOptions.size;if(typeof Se>"u"&<){var $e=lt.images.up.match(/\/cube_(\d+)\//);$e&&(Se=Number($e[1]))}typeof Se>"u"&&(Se=2048);var Ue=0;Se>=1024&&(Ue=1),Se>=2048&&(Ue=2),Se>=4096&&(Ue=3),Se>=8192&&(Ue=4);var At=i.tileLevelForFov(i.camera.fov,ye);return At>Ue?At:0}(),Ze=function(){var ye=i.camera.quaternion.clone(),me=i.works.getResolvedObserver(g.panoId),lt=me??H;lt&&ye.premultiply(lt.quaternion.clone().inverse());var Se=new d.Matrix4().makeRotationFromQuaternion(ye),$e=new d.Matrix4().getInverse(Se),Ue=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(i.camera.projectionMatrix,$e));return Ue}();g.panoId===Be(this.currentPano)&&(((h=g.panoPicture)===null||h===void 0?void 0:h.map)instanceof Qe&&(g.panoPicture.map.update(Ze,Je),g.panoPicture.map.needsRender===!0&&(g.panoPicture.map.needsRender=!1,this.needsRender=!0)),((p=g.panoPicture)===null||p===void 0?void 0:p.luminanceMap)instanceof Qe&&(g.panoPicture.luminanceMap.update(Ze,Je),g.panoPicture.luminanceMap.needsRender===!0&&(g.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0)));{var De=this.tiling.object.visible;if(this.initAnimationed){var We=g.panoId,Le=this.works.getResolvedObserver(We);Le?Ti(this.camera.position,Le.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==We&&this.tiling.cleanup(),this.tiling.panoId=We,this.tiling.setResource((m=(v=Le.images)===null||v===void 0?void 0:v.tiles)!==null&&m!==void 0?m:[],this.enableIOSEDR&&Le.images.luminance?Le.images.luminance:null),this.tiling.setFetcher(pt(Le.work)),this.tiling.setRotation(Le.quaternion),this.tiling.setPosition(Le.position),Je>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ze,Je,e):this.tiling.update(Ze,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;De!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},t.prototype.render=function(){var e=this.works.getResolvedObserver(this.currentPano);e&&e.video&&(this.needsRender=!0),n.prototype.render.call(this)},t.prototype.postProcessing=function(e,r){if(!this.destroyed&&r==="luminance")return this.luminanceAdaptiveEffect||(this.luminanceAdaptiveEffect=new th(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(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[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,u,c;this.userAction=i,this.stopMomentumMovement();var l=this.works.getResolvedObserver(e);if(!l)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));var h=this.imageOptions.size;if(typeof h>"u"&&l){var p=l.images.up.match(/\/cube_(\d+)\//);p&&(h=Number(p[1]))}typeof h>"u"&&(h=2048);var v=this.imageOptions.transform,m=R({key:"pano.".concat(l.panoId)},sr(this.imageOptions,["format","size","quality","sharpen","mappings"])),A=l.images,y=(s=(o=l.images.tiles)===null||o===void 0?void 0:o.filter(function(O){return O.size>h}))!==null&&s!==void 0?s:null,f=v,g={key:"pano_luminance.".concat(l.panoId),size:m.size?m.size/2:1024},b=this.enableIOSEDR&&l.images.luminance?l.images.luminance:null,w=function(){if(!l.images.tiles||!b)return null;var O=b.up.match(/\/cube_(\d+)\//),L=O?Number(O[1]):!1;return L===!1?null:y==null?void 0:y.map(function(N){return{level:N.level,size:L,back:b.back,front:b.front,left:b.left,right:b.right,up:b.up,down:b.down}})}(),E="pano:"+fn([A,m,v]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===E)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:l.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var M="move-to-pano-"+l.panoId;this.pending.add(M);var C=this.models.getMaterial()||{},I=C.pano0,P=C.pano1,S;if(I&&I.map.name===E&&I.luminanceMap!==null===this.enableIOSEDR?S=I:(P==null?void 0:P.map.name)===E&&P.luminanceMap!==null===this.enableIOSEDR&&(S=P),S){var F={panoId:l.panoId,effect:(c=r.effect)!==null&&c!==void 0?c:"fly",panoPicture:{map:S.map,luminanceMap:S.luminanceMap,matrix:new d.Matrix4().compose(l.position,l.quaternion,Es)},position:l.position.clone()};it.shared.add(function(){a.pending.delete(M),a.doMoveToPano(l.pano,F,r)},!0,1);return}this.pendingTextureTask={panoId:l.panoId,hash:E,onLoad:function(O,L){var N,V;if(a.pending.delete(M),a.destroyed)O.body.dispose();else{O.body.name=E;var j={panoId:l.panoId,effect:(N=r.effect)!==null&&N!==void 0?N:"fly",panoPicture:{map:O.body,luminanceMap:(V=L==null?void 0:L.body)!==null&&V!==void 0?V:null,matrix:new d.Matrix4().compose(l.position,l.quaternion,Es)},position:l.position.clone()};a.doMoveToPano(l.pano,j,r)}},onError:function(O){a.pending.delete(M);var L=R(R(R({},l.pano),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.error",_("pano.error",{error:O,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:L})),a.emit("pano.cancel",_("pano.cancel",{error:O,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:L})),a.emit("error",O),r.moveCancelCallback&&r.moveCancelCallback()}};var k=this.panoMeshes[l.panoId];k&&k.tap&&k.tap(),Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(A,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:m},format:d.RGBAFormat,viaAjax:!0,fetcher:pt(l.work)},void 0,void 0,function(O){var L,N;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:O,meta:null,pano:l.pano})),((L=a.pendingTextureTask)===null||L===void 0?void 0:L.hash)===E&&((N=a.panoMeshes[l.panoId])===null||N===void 0||N.setProgress(O))},this.renderer):this.textureLoader.loadCubeTexture(A,{imageURL:{transform:v,options:m},format:d.RGBAFormat,viaAjax:!0,fetcher:pt(l.work)},void 0,void 0,function(O){var L,N;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:O,meta:null,pano:l.pano})),((L=a.pendingTextureTask)===null||L===void 0?void 0:L.hash)===E&&((N=a.panoMeshes[l.panoId])===null||N===void 0||N.setProgress(O))},this.renderer),b?this.tileLevelForFov&&w&&w.length?this.textureLoader.loadTiledCubeTexture(b,w,{tileImageSize:256,tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:f,options:g},fetcher:pt(l.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(b,{imageURL:{transform:f,options:g},fetcher:pt(l.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(O){var L,N,V=O[0],j=O[1];((L=a.pendingTextureTask)===null||L===void 0?void 0:L.hash)===E?(a.pendingTextureTask.onLoad(V,j),(N=a.panoMeshes[l.panoId])===null||N===void 0||N.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:V.meta,pano:l.pano}))):(V.body.dispose(),j==null||j.body.dispose())}).catch(function(O){var L,N;((L=a.pendingTextureTask)===null||L===void 0?void 0:L.hash)===E&&(a.pendingTextureTask.onError(O),(N=a.panoMeshes[l.panoId])===null||N===void 0||N.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:O,progress:0,meta:null,pano:l.pano})),a.emit("error",O))}),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:l.pano}))},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),u={workCode:s.workCode,panoIndex:s.panoIndex},c={modelAlpha:0},l={perspToOrtho:0},h=!1;e.moveToPano(u,{longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(p){h=!0,e.perspToOrthoMotion.set(l,a).catch(Q),e.modelAlphaMotion.setKeyframes([{progress:0,value:R({},e.modelAlphaMotion.value)},{progress:.6,value:R({},e.modelAlphaMotion.value)},{progress:1,value:c}],a).catch(Q),e.emit("initAnimation.start",_("initAnimation.start",{state:p,userAction:e.userAction}))},moveEndCallback:function(p){e.emit("initAnimation.end",_("initAnimation.end",{state:p,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var p=R(R(R({},u),{mode:e.mode}),Ve(e.camera.pose));h===!1&&e.emit("initAnimation.start",_("initAnimation.start",{state:p,userAction:e.userAction})),e.emit("initAnimation.end",_("initAnimation.end",{state:p,userAction:e.userAction})),e.initAnimationed=!0,r()}},o)})},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],u=this.panoMeshes[s];r[s]=u,delete this.panoMeshes[s]}for(var c=1,l={},h=function(x){var M=Ot(x.accessibleIds,function(I){var P=e.works.getResolvedObserver(I);if(!P)return 1/0;var S=P.standingPosition.distanceTo(x.standingPosition);return le(S,1,1/0)},!0),C=M[1];l[x.panoId]===void 0&&(l[x.panoId]=C)},p=0,v=this.works.resolvedObservers;p<v.length;p++){var m=v[p];h(m)}var A=Object.keys(l).map(function(x){return l[x]});if(A.length){var y=A.reduce(function(x,M){return x+M},0)/A.length;c=le(y*.6,1,3)}for(var f=0,g=this.works.resolvedObservers;f<g.length;f++){var m=g[f],u=void 0;r[m.panoId]?(u=r[m.panoId],u.loading===!0&&m.loadable===!1&&u.setLoading(!1),delete r[m.panoId]):(u=this.panoCircleMeshCreator(m.pano),u.name="PanoCircleMesh_"+m.panoId,this.helper.add(u)),u.scale.set(c,1,c),u.position.copy(m.standingPosition),this.panoMeshes[m.panoId]=u}for(var b=0,w=Object.keys(r);b<w.length;b++){var E=w[b];this.helper.remove(r[E]),r[E].dispose(),delete r[E]}},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,c;i===void 0&&(i={});var l=ve(),h=vt();this.tiling.cleanup(),this.panoResources[h]=r;var p=1,v,m,A;if(this.locationMotion.ended){var y=this.locationMotion.getKeyFrameSegment(l);y[0];var f=y[1],g=this.locationMotion.value,b=((o=this.panoResourceFromLocationMotionKeyframe(f))!==null&&o!==void 0?o:this.camera).position,w=r.position;v=Math.max(b.distanceTo(w),p),m=[{key:f.key,progress:0,value:R(R({},g),{count:0})},{key:h,progress:1,value:{distance:0,count:1}}],A=0}else{var E=this.locationMotion.getKeyFrameSegment(l),x=E[0],f=E[1],g=this.locationMotion.value,M=this.panoResourceFromLocationMotionKeyframe(x).position,b=this.panoResourceFromLocationMotionKeyframe(f).position,w=r.position,C=f.value.count-g.count,I=Math.max(M.distanceTo(b),p)*C,P=Math.max(b.distanceTo(w),p);v=I+P,m=[{key:x.key,progress:0,value:R({},g)},{key:f.key,progress:I/v,value:f.value},{key:h,progress:1,value:{count:f.value.count+1,distance:0}}];var S=this.locationMotionKeyframesLength(this.locationMotion.keyframes),F=this.locationMotionKeyframesLength(m);S===0||S===0?A=0:A=this.locationMotion.getProgressVelocity(l)*S/F}var k=this.calculateMovingDuration(i.duration,i.effect==="fade"||i.effect==="montage"?0:v),O={longitude:i.longitude,latitude:i.latitude,fov:i.fov},L=R(R({},e),{mode:this.mode,longitude:(s=O.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(u=O.latitude)!==null&&u!==void 0?u:this.camera.pose.latitude,fov:(c=O.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),N=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:N,progress:0,state:L,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(L),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),this.cameraMotion.set(O,k).catch(Q);var V=this.locationMotion.setKeyframes(m,k,A);V.then(function(){var j,z,U=R(R({},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:N,progress:1,state:U,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(U);var X=a.works.getResolvedObserver(e);if(X&&X.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var G=gh.clone().multiply((z=(j=a.models.getMaterial().pano1)===null||j===void 0?void 0:j.matrix)!==null&&z!==void 0?z:new d.Matrix4).multiply(X.video.matrix),K={map:a.videoTexture,size:X.video.size,matrix:G,alpha:1},Y=vt(),H=a.videoTexture.image;H.setAttribute("uuid",Y),Ju().then(function(J){J&&X.video&&H.getAttribute("uuid")===Y&&(H.oncanplay=function(){H.oncanplay=Q,H.play()},H.ontimeupdate=function(){H.currentTime>.5&&(H.ontimeupdate=Q,a.panoVideo.setMaterial(K))},H.src=X.video.source)}).catch(function(){H.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:N,progress:0,state:L,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??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 u=this.models.intersectRaycaster(a)[0],c=u?u.point:a.ray.origin.clone().add(a.ray.direction.clone().normalize().multiplyScalar(3)),l=c.clone().sub(o).normalize();if(l.length()===0)return null;for(var h=i.accessibleIds.filter(function(E){if(E===Be(r.currentPano))return!1;var x=r.works.getResolvedObserver(E);if(!x)return!1;var M=x.standingPosition.clone().project(r.camera);return Math.abs(M.z)>1||Math.abs(M.x)>1||Math.abs(M.y)>1?!1:x.loadable||x.active}),p=h.slice().sort(function(E,x){var M=r.works.getResolvedObserver(E).standingPosition.clone().distanceTo(o),C=r.works.getResolvedObserver(x).standingPosition.clone().distanceTo(o);return M-C}),v=0,m=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];v<m.length;v++)for(var A=m[v],y=0,f=p;y<f.length;y++){var g=f[y],b=this.works.getResolvedObserver(g);if(b){var w=b.standingPosition.clone().sub(o);if(w&&w.length()!==0&&l.angleTo(w)<A)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!==Be(this.currentPano))return}var o=e.center.raycaster,s=this.camera.getDirection(new d.Vector3).setY(0),u=null,c=this.works.getResolvedObserver(this.currentPano);if(c){var l=c.accessibleIds.filter(function(z){if(z===Be(r.currentPano))return!1;var U=r.works.getResolvedObserver(z);return!U||U.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:U.loadable||U.active}),h=this.models.intersectRaycaster(o)[0];if(h){var p=Ot(l,function(z){var U=r.works.getResolvedObserver(z);if(!U)return 1/0;var X=U.standingPosition.clone();return X.distanceTo(h.point)},!0),v=p[0],m=p[1];v&&m<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(v))!==null&&i!==void 0?i:null)}u||(u=this.getForwardObserverOrNot(o));for(var A=0,y=this.locationMotion.keyframes;A<y.length;A++){var f=y[A],g=this.panoResourceFromLocationMotionKeyframe(f);if(!(f.progress<this.locationMotion.progress)&&u&&g.panoId===u.panoId){u=null;break}}if(!u)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var b={},w=Math.PI/6,E=Math.PI/12,x=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),M=[],C=[],I=[],P=0,S=u.accessibleIds;P<S.length;P++){var v=S[P],F=Ye(v);if(!(Ft(F,this.currentPano)||Ft(F,u.pano))){var k=this.works.getResolvedObserver(v);if(k){var O=k.position.clone().sub(u.position).setY(0);x.angleTo(O)<w&&I.push(O)}}}var L=I.length>0?I:at(at([],M,!0),C,!0),N=L.slice().sort(function(z,U){return z.angleTo(x)-U.angleTo(x)})[0];N&&N.angleTo(s)>E&&(b.longitude=Math.atan2(-N.x,-N.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(b.latitude=le(0,this.minLatitude,this.maxLatitude));var V=R({},e.state);if(V.workCode=u.pano.workCode,V.panoIndex=u.pano.panoIndex,b.longitude!==void 0&&(V.longitude=b.longitude),b.latitude!==void 0&&(V.latitude=b.latitude),b.fov!==void 0&&(V.fov=b.fov),V.distance=0,V.offset=u.position.clone(),e.state=V,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:V,userAction:e.userAction,options:b,progress:0,error:null})),u&&!u.active){var j=u.panoId;this.panoMeshes[j]&&(this.panoMeshes[j].setDisabled(!1),this.panoMeshes[j].setLoading(!0))}u&&u.active&&this.emit("pano.request",_("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:V,options:b,error:null}))}}}}},t}(to),Ar=Math.PI/180,un=180/Math.PI,$u=.001,e0=1,kn=function(){var n=typeof navigator<"u"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),yh=function(){var n=typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),bh=function(){var n=typeof navigator<"u"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),t0=function(){var n=typeof navigator<"u"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),wh=function(){var n=!1;if(t0()===65){var t=typeof navigator<"u"?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}}(),Eh=function(){var n=kn()&&yh()&&typeof navigator<"u"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),r0=function(){var n=typeof navigator<"u"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function Ms(){var n=typeof window<"u"&&(window.orientation==90||window.orientation==-90);return r0()?!n:n}function xh(n){return!(isNaN(n)||n<=$u||n>e0)}function Mh(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var Cs=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function Is(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 Ch(){if(typeof window>"u"||typeof document>"u")return!1;var n=window.self!==window.top,t=Is(document.referrer),e=Is(window.location.href);return n&&t!==e}var Ss=function(){function n(r,i,a){var o=i?i[0]:0,s=i?i[1]:0,u=i?i[2]:0,c=i?i[3]:1,l=o+o,h=s+s,p=u+u,v=o*l,m=o*h,A=o*p,y=s*h,f=s*p,g=u*p,b=c*l,w=c*h,E=c*p;return r[0]=1-(y+g),r[1]=m+E,r[2]=A-w,r[3]=0,r[4]=m-E,r[5]=1-(v+g),r[6]=f+b,r[7]=0,r[8]=A+w,r[9]=f-b,r[10]=1-(v+y),r[11]=0,r[12]=a?a[0]:0,r[13]=a?a[1]:0,r[14]=a?a[2]:0,r[15]=1,r}function t(r,i,a){var o=a[0],s=a[1],u=a[2],c,l,h,p,v,m,A,y,f,g,b,w;return i===r?(r[12]=i[0]*o+i[4]*s+i[8]*u+i[12],r[13]=i[1]*o+i[5]*s+i[9]*u+i[13],r[14]=i[2]*o+i[6]*s+i[10]*u+i[14],r[15]=i[3]*o+i[7]*s+i[11]*u+i[15]):(c=i[0],l=i[1],h=i[2],p=i[3],v=i[4],m=i[5],A=i[6],y=i[7],f=i[8],g=i[9],b=i[10],w=i[11],r[0]=c,r[1]=l,r[2]=h,r[3]=p,r[4]=v,r[5]=m,r[6]=A,r[7]=y,r[8]=f,r[9]=g,r[10]=b,r[11]=w,r[12]=c*o+v*s+f*u+i[12],r[13]=l*o+m*s+g*u+i[13],r[14]=h*o+A*s+b*u+i[14],r[15]=p*o+y*s+w*u+i[15]),r}function e(r,i){var a=i[0],o=i[1],s=i[2],u=i[3],c=i[4],l=i[5],h=i[6],p=i[7],v=i[8],m=i[9],A=i[10],y=i[11],f=i[12],g=i[13],b=i[14],w=i[15],E=a*l-o*c,x=a*h-s*c,M=a*p-u*c,C=o*h-s*l,I=o*p-u*l,P=s*p-u*h,S=v*g-m*f,F=v*b-A*f,k=v*w-y*f,O=m*b-A*g,L=m*w-y*g,N=A*w-y*b,V=E*N-x*L+M*O+C*k-I*F+P*S;return V?(V=1/V,r[0]=(l*N-h*L+p*O)*V,r[1]=(s*L-o*N-u*O)*V,r[2]=(g*P-b*I+w*C)*V,r[3]=(A*I-m*P-y*C)*V,r[4]=(h*k-c*N-p*F)*V,r[5]=(a*N-s*k+u*F)*V,r[6]=(b*M-f*P-w*x)*V,r[7]=(v*P-A*M+y*x)*V,r[8]=(c*L-l*k+p*S)*V,r[9]=(o*k-a*L-u*S)*V,r[10]=(f*I-g*M+w*E)*V,r[11]=(m*M-v*I-y*E)*V,r[12]=(l*F-c*O-h*S)*V,r[13]=(a*O-o*F+s*S)*V,r[14]=(g*x-f*C-b*E)*V,r[15]=(v*C-m*x+A*E)*V,r):null}return function(r,i,a){n(r,i),a&&t(r,r,a),e(r,r)}}(),ia=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}(),Ih=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new ia,this.currentGyroMeasurement=new ia,this.previousGyroMeasurement=new ia,kn()?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;xh(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)",un*Mh(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}(),Sh=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<Ar*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(un*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}(),Th=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}(),Ph=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),Ts=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),Bh=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 Ih(t,i),this.posePredictor=new Sh(e,i),this.isFirefoxAndroid=bh(),this.isIOS=kn();var a=t0();this.isDeviceMotionInRadians=!this.isIOS&&a!==null&&a<66,this.isWithoutDeviceMotion=wh()||Eh(),this.filterToWorldQ=new d.Quaternion,kn()?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<"u"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new d.Vector3(0,0,1),o),this.setScreenTransform_(),Ms()&&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<"u"&&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 Ph;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(),Ms()&&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),Ss(t.leftViewMatrix,e,r.left),Ss(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window>"u")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),i=this.onDeviceOrientation_.bind(this);return kn()&&Ch()&&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*Ar,o=t.left.downDegrees*Ar,s=t.left.leftDegrees*Ar,u=t.left.rightDegrees*Ar,c=2/(s+u),l=2/(a+o);i.left[0]=c,i.left[1]=0,i.left[2]=0,i.left[3]=0,i.left[4]=0,i.left[5]=l,i.left[6]=0,i.left[7]=0,i.left[8]=-((s-u)*c*.5),i.left[9]=(a-o)*l*.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*Ar,o=t.right.downDegrees*Ar,s=t.right.leftDegrees*Ar,u=t.right.rightDegrees*Ar,c=2/(s+u),l=2/(a+o);i.right[0]=c,i.right[1]=0,i.right[2]=0,i.right[3]=0,i.right[4]=0,i.right[5]=l,i.right[6]=0,i.right[7]=0,i.right[8]=-((s-u)*c*.5),i.right[9]=(a-o)*l*.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 Th(t.distortionCoefficients),i=t.screenLensDistance,a=(e.widthMeters-t.interLensDistance)/2,o=t.interLensDistance/2,s=t.baselineLensDistance-e.bevelMeters,u=e.heightMeters-s,c=un*Math.atan(r.distort(a/i)),l=un*Math.atan(r.distort(o/i)),h=un*Math.atan(r.distort(s/i)),p=un*Math.atan(r.distort(u/i)),v=new Ts,m=new Ts;return v.leftDegrees=Math.min(c,t.fov),v.rightDegrees=Math.min(l,t.fov),v.downDegrees=Math.min(h,t.fov),v.upDegrees=Math.min(p,t.fov),m.leftDegrees=v.rightDegrees,m.rightDegrees=v.leftDegrees,m.upDegrees=v.upDegrees,m.downDegrees=v.downDegrees,{left:v,right:m}},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){Cs("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(a<=$u||a>e0){Cs("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&&(r0()?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<"u"?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}(),ei=[0,0,.5,1],ti=[.5,0,.5,1],Rh=function(){function n(t){var e=this;this.renderer=t,this.sensor=new Bh(.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*ei[0]),y:Math.round(r.height*ei[1]),width:Math.round(r.width*ei[2]),height:Math.round(r.height*ei[3])},o={x:Math.round(r.width*ti[0]),y:Math.round(r.height*ti[1]),width:Math.round(r.width*ti[2]),height:Math.round(r.height*ti[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 u=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=u.left.slice(),this.cameraR.projectionMatrix.elements=u.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 Fh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///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MDXnUBaHBwoQT9Prx4Szm3TyRodLupoMJHH5LyK+9es8+l/CKvDytukQQND8FSlFIOreGM0/omiATVapVo12xd0jhExKW5294RAc40RVoftY47cd2LKtMOFwkajzuAeVOlIhfJeKahLyiWJRhLr3Ai2BVzQYKG4lLYXfg8HCSI33a2nTH5OaVWmzYHJGhsdLmDuN2exAonBTzZIuzEUS+ec0ZMBQn+Ea5KlXNI4C/UAO/k6hKwBptJgn8fgmVckgFXML9YEEFLUKMvlqAp0eWyDEAL65dLqyWo6RekTZ2XNCsD6rgpTK/4p3WcrrPH1ghWJGhONC3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var aa,oa={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},Ps=typeof navigator<"u"&&(aa=oa[navigator.language.split("-")[0]])!==null&&aa!==void 0?aa:oa.zh,kh=`
|
|
1468
1468
|
<style>
|
|
1469
1469
|
.$id {
|
|
1470
1470
|
all: initial;
|
|
@@ -1547,7 +1547,7 @@ void main() {
|
|
|
1547
1547
|
.$id-modal-content-guide-cardboard-image {
|
|
1548
1548
|
width: 100px;
|
|
1549
1549
|
height: 82px;
|
|
1550
|
-
background-image: url(`.concat(
|
|
1550
|
+
background-image: url(`.concat(Fh,`);
|
|
1551
1551
|
background-size: 100%;
|
|
1552
1552
|
background-repeat: no-repeat;
|
|
1553
1553
|
}
|
|
@@ -1589,7 +1589,7 @@ void main() {
|
|
|
1589
1589
|
.$id-modal-content-guide-phone-image {
|
|
1590
1590
|
width: 58px;
|
|
1591
1591
|
height: 56px;
|
|
1592
|
-
background-image: url(`).concat(
|
|
1592
|
+
background-image: url(`).concat(Oh,`);
|
|
1593
1593
|
background-size: 100%;
|
|
1594
1594
|
background-repeat: no-repeat;
|
|
1595
1595
|
}
|
|
@@ -1666,8 +1666,8 @@ Z
|
|
|
1666
1666
|
</div>
|
|
1667
1667
|
</div>
|
|
1668
1668
|
<div class="$id-modal-content">
|
|
1669
|
-
<div class="$id-modal-content-title">`).concat(
|
|
1670
|
-
<div class="$id-modal-content-hit">`).concat(
|
|
1669
|
+
<div class="$id-modal-content-title">`).concat(Ps.TITLE,`</div>
|
|
1670
|
+
<div class="$id-modal-content-hit">`).concat(Ps.HIT,`</div>
|
|
1671
1671
|
<div class="$id-modal-content-guide">
|
|
1672
1672
|
<div class="$id-modal-content-guide-phone">
|
|
1673
1673
|
<div class="$id-modal-content-guide-phone-move-x">
|
|
@@ -1725,13 +1725,13 @@ Z
|
|
|
1725
1725
|
</svg>
|
|
1726
1726
|
</div>
|
|
1727
1727
|
</div>
|
|
1728
|
-
`);function
|
|
1728
|
+
`);function Lh(n){for(var t=1,e=document.getElementsByTagName("meta"),r=0;r<e.length;r++){var i=e[r];if(i.getAttribute("name")==="viewport"){var a=i.getAttribute("content")||"",o=a.match(/initial\-scale\=([\d|\.]+)/);o&&(t=Number(o[1])),isNaN(t)&&(t=1)}}var s=function(u){return Math.floor(u*t)+"px"};return kh.replace(/\n/g," ").replace(/\ +/g," ").replace(/\$id/g,n).replace(/(\d+)px/g,function(u,c){return s(Number(c))})}function Dh(){var n="five_vr_helper_"+vt(),t=Lh(n),e=document.createElement("div");return e.className=n,e.innerHTML=t,e}var sa=new d.CircleBufferGeometry(.12,16),Nh=`
|
|
1729
1729
|
varying vec2 vUv;
|
|
1730
1730
|
void main() {
|
|
1731
1731
|
vUv = uv;
|
|
1732
1732
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1733
1733
|
}
|
|
1734
|
-
`,
|
|
1734
|
+
`,Qh=`
|
|
1735
1735
|
uniform float circleScale;
|
|
1736
1736
|
uniform float circleFade;
|
|
1737
1737
|
uniform float circleOpacity;
|
|
@@ -1787,13 +1787,13 @@ void main() {
|
|
|
1787
1787
|
|
|
1788
1788
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);
|
|
1789
1789
|
}
|
|
1790
|
-
`,
|
|
1790
|
+
`,Vh=`
|
|
1791
1791
|
varying vec2 vUv;
|
|
1792
1792
|
void main() {
|
|
1793
1793
|
vUv = uv;
|
|
1794
1794
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1795
1795
|
}
|
|
1796
|
-
`,
|
|
1796
|
+
`,Uh=`
|
|
1797
1797
|
varying vec2 vUv;
|
|
1798
1798
|
uniform float opacity;
|
|
1799
1799
|
|
|
@@ -1815,16 +1815,16 @@ void main() {
|
|
|
1815
1815
|
|
|
1816
1816
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity * outside * inside);
|
|
1817
1817
|
}
|
|
1818
|
-
`,jh=function(n){de(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 we({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new we({opacity:0}),e.loadingMotion=new we({opacity:0}),e.disableMotion=new we({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(sa,new d.MeshBasicMaterial(R(R({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new d.Mesh(sa,new d.ShaderMaterial(R(R({},r),{vertexShader:zh,fragmentShader:Hh,uniforms:{opacity:{value:0}}}))),e.panoMesh=new d.Mesh(sa,new d.ShaderMaterial(R(R({},r),{vertexShader:Uh,fragmentShader:qh,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=le(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:R({},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,u=a.circleFade,c=a.circleOpacity,l=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=c,this.panoMesh.material.uniforms.circleScale.value=l,this.panoMesh.material.uniforms.circleFade.value=u,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),_h=1500,Gh=function(n){de(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new kh(r.renderer);var a=Vh();r.helperElement=a;var o=new In(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=R(R({},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 R(R({},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.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(Be(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,u=this.works.resolvedObservers;s<u.length;s++){var c=u[s],l=c.panoId,h=new jh;h.name="panoSphere_".concat(l),h.position.copy(c.position),h.needsRender=!0,this.panoMeshes[l]=h}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,r){var i,a,o,s,u,c;if(!this.destroyed){var l=this.currentPano;this.userAction=!0,this.needsRender=!0;var h={},p={};if(this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),h.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(le(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var v=this.locationMotion.getKeyFrameSegment(e),m=v[0],A=v[1],y=this.panoResourceFromLocationMotionKeyframe(m),f=this.panoResourceFromLocationMotionKeyframe(A),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),b=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),w=y.position,E=f.position,x=this.locationMotion.value.count-A.value.count+1;h.useBlackTransition=f.effect==="instant",f.panoPicture&&(x<1?y.panoPicture&&(h.pano0=y.panoPicture):h.pano0=f.panoPicture,h.pano1=f.panoPicture),f.effect==="fade"&&(h.pano0&&y.panoPicture&&(h.pano0={map:h.pano0.map,luminanceMap:h.pano0.luminanceMap,matrix:y.panoPicture.matrix.clone().setPosition(f.position)}),w.copy(E)),h.progress=x,p.distance=this.locationMotion.value.distance,p.offset=new d.Vector3(w.x+(E.x-w.x)*x,w.y+(E.y-w.y)*x,w.z+(E.z-w.z)*x);for(var M=[],C=[],I=0,P=this.locationMotion.keyframes;I<P.length;I++){var S=P[I],F=S.key,k=S.progress;F!==void 0&&(M.push(F),k>=this.locationMotion.progress&&C.push(F))}for(var O=0,L=Object.keys(this.panoResources);O<L.length;O++){var N=L[O];if(!(C.indexOf(N)>=0)){var V=this.panoResources[N];if(V.panoPicture){var j=V.panoPicture.map;if(j){if(j===((i=h.pano0)===null||i===void 0?void 0:i.map)||j===((a=h.pano1)===null||a===void 0?void 0:a.map))continue;j.dispose(),V.panoPicture=null}}M.indexOf(N)>=0||delete this.panoResources[N]}}this.currentPano=Ye(f.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:Ye(g.panoId),state:R(R(R(R({},Ye(b.panoId)),{mode:this.mode}),Ve(this.camera.pose)),p),options:{},progress:this.locationMotion.progress,error:null}))}St(h)===!1&&(!((o=h.pano0)===null||o===void 0)&&o.map&&h.pano0.map instanceof Qe&&!h.pano0.map.cubeRenderTarget&&(h.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((s=h.pano0)===null||s===void 0)&&s.luminanceMap&&h.pano0.luminanceMap instanceof Qe&&!h.pano0.luminanceMap.cubeRenderTarget&&(h.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((u=h.pano1)===null||u===void 0)&&u.map&&h.pano1.map instanceof Qe&&!h.pano1.map.cubeRenderTarget&&(h.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=h.pano1)===null||c===void 0)&&c.luminanceMap&&h.pano1.luminanceMap instanceof Qe&&!h.pano1.luminanceMap.cubeRenderTarget&&(h.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(h)),p.offset&&this.camera.position.copy(p.offset),Ft(this.currentPano,l)&&this.updatePanoMeshesVisible();var z=this.camera.pose.longitude,U=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.updateMatrixWorld(),this.camera.computePose();var X=this.works.getResolvedObserver(this.currentPano);if(X)for(var G=X.visibleIds.concat(Be(this.currentPano)),K=0,Y=G;K<Y.length;K++){var H=Y[K],J=Ye(H),ne=this.works.getResolvedObserver(J);if(ne){var $=this.panoMeshes[H];if(!ne.loadable&&!ne.active){$.setOpacity(0);continue}var te=$.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);te<.05?$.setOpacity(0):$.setOpacity(le(1.5/te,0,1)),Ft(this.currentPano,J)&&$.setOpacity(0),$.lookAt(this.camera.position)}}for(var ae=this.intersect(e),ce=0,oe=this.works.resolvedObservers;ce<oe.length;ce++){var ne=oe[ce],$=this.panoMeshes[ne.panoId];$&&($.setCurrent($===ae),$.updateTime&&$.updateTime(e,r))}(z!==this.camera.pose.longitude||U!==this.camera.pose.latitude)&&(this.cameraMotion.set(sr(this.camera.pose,["longitude","latitude"]),0).catch(Q),this.emit("camera.update",_("camera.update",{userAction:!0,state:R(R(R({},this.currentPano),{mode:this.mode}),Ve(this.camera.pose))})))}},t.prototype.render=function(){this.cardboard.render(this.scene,this.camera)},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>_h){for(var a=this.activePanoMesh,o=Object.keys(this.panoMeshes),s=null,u=0,c=o;u<c.length;u++){var l=c[u];if(this.panoMeshes[l]===a){s=l;break}}return s!==null&&this.moveToPano(Ye(s),{},!0),delete this.activePanoMesh,delete this.activeTime,a}var h=this.camera.getDirection(new d.Vector3),p=new d.Raycaster(this.camera.position,h);p.params.Points={threshold:.1};for(var v=void 0,m=[],A=this.works.getResolvedObserver(this.currentPano),y=A?A.visibleIds:[],f=0,g=y;f<g.length;f++){var s=g[f],b=this.panoMeshes[s],w=p.intersectObject((r=b.hitTestMesh)!==null&&r!==void 0?r:b,!0)[0];w&&m.push({panoMesh:b,intersection:R({floor:(i=A==null?void 0:A.floorIndex)!==null&&i!==void 0?i:0},w)})}var E=m.sort(function(S,F){return S.intersection.distance-F.intersection.distance})[0];E?(v=E.intersection,this.activePanoMesh!==E.panoMesh&&(this.activePanoMesh=E.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(E.panoMesh.position),this.intersectMesh.lookAt(this.camera.position),this.intersectMesh.visible=!1):(this.activePanoMesh=void 0,this.activeTime=void 0),v||(v=this.models.intersectRaycaster(p)[0]);var x=_("intersect.update",{raycaster:p,intersection:v??null,object:this.intersectMesh});if(this.emit("intersect.update",x),x.defaultPrevented){this.hideIntersectMesh();return}if(v&&v.face){var M=v.face.normal,C=new d.Quaternion;C.setFromUnitVectors(new d.Vector3(0,0,1),M),this.intersectMesh.quaternion.copy(C);var I=M.clone().multiplyScalar(.05),P=v.point.clone().add(I);this.intersectMesh.position.copy(P),this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return E==null?void 0:E.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(so),Kh=new d.Vector3(0,1.6,0),Wh=function(n){de(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 we({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 we({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new we({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,u,c=this.parseArgs(e),l=c.works,h=e.initial,p=h.state,v=h.currentState,m=typeof p.panoIndex=="number"?{workCode:(a=(r=p.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:p.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},A=l.getResolvedObserver(m),y=(o=p.longitude)!==null&&o!==void 0?o:v.longitude,f=le((s=p.latitude)!==null&&s!==void 0?s:!A||Dn(v.mode)?v.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),g=le((u=p.fov)!==null&&u!==void 0?u:!A||Dn(v.mode)?v.fov:c.defaultFov,c.minFov,c.maxFov),b=new d.Vector3;if(c.initial.state.offset)b.copy(c.initial.state.offset);else if(A)b.copy(A.position);else{var w=Rr(v).setLength(v.distance);b.copy(c.initial.currentState.offset).sub(w)}return{workCode:m.workCode,panoIndex:m.panoIndex,mode:"Model",longitude:y,latitude:f,fov:g,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},t.prototype.updateWork=function(e,r,i,a){this.works=e;var o=t.initAnimationEndState(R(R({},this),{initial:{currentState:R(R({},this.currentPano),this.camera.pose),duration:i,state:r,userAction:a}}));this.hideIntersectMesh();var s={duration:0,longitude:o.longitude,latitude:o.latitude,fov:o.fov};return this.moveToPosition(o.offset,s,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=[],u=0,c=e;u<c.length;u++){var l=c[u];o.push({key:l.key,progress:l.progress,value:{distance:0,x:l.value.offset.x,y:l.value.offset.x,z:l.value.offset.x}}),s.push({key:l.key,progress:l.progress,value:{longitude:l.value.longitude,latitude:l.value.latitude,fov:l.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(le(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,u=Ot(s,function(c){return c.position.distanceTo(o)});this.currentPano=u?{workCode:u.work.workCode,panoIndex:u.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),St(i)||this.models.setMaterial(i),St(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),u={modelAlpha:1},c={perspToOrtho:0},l={longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(h){e.perspToOrthoMotion.set(c,a).catch(Q),e.modelAlphaMotion.set(u,a).catch(Q),e.emit("initAnimation.start",_("initAnimation.start",{state:h,userAction:e.userAction}))},moveEndCallback:function(h){e.emit("initAnimation.end",_("initAnimation.end",{state:h,userAction:e.userAction})),r()},moveCancelCallback:function(){var h=e.currentPano,p=R(R({},h),{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:p,userAction:e.userAction})),r()}};e.moveToPosition(s.offset,l,o)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return R(R({},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,u;r===void 0&&(r={}),this.userAction=i,this.stopMomentumMovement();for(var c=ve(),l=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),h=l.distanceTo(e),p=this.locationMotion.getProgressVelocity(c),v=0,m=1;m<this.locationMotion.keyframes.length;m++){var A=this.locationMotion.keyframes[m-1].value,y=A.x,f=A.y,g=A.z,b=this.locationMotion.keyframes[m].value,w=b.x,E=b.y,x=b.z;v+=Math.sqrt(Math.pow(w-y,2)+Math.pow(E-f,2)+Math.pow(x-g,2))}var M=h===0?0:p*v/h,C=this.calculateMovingDuration(r.duration,h),I={x:e.x,y:e.y,z:e.z,distance:0},P={longitude:r.longitude,latitude:r.latitude,fov:r.fov},S=this.works.resolvedObservers,F=Ot(S,function(N){return N.position.distanceTo(l)}),k=F?{workCode:F.work.workCode,panoIndex:F.panoIndex}:{workCode:"",panoIndex:0},O=R(R({},k),{mode:this.mode,longitude:(o=P.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=P.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=P.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:e.clone(),distance:0}),L=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:r,prevPano:L,progress:0,state:O,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(O),this.cameraMotion.set(P,C).catch(Q),this.locationMotion.set(I,C,M).then(function(){var N=R(R(R({},k),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.arrived",_("pano.arrived",{options:r,prevPano:L,progress:0,state:N,userAction:a.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(N)},function(){r.moveCancelCallback&&r.moveCancelCallback(),a.emit("pano.cancel",_("pano.cancel",{options:r,prevPano:L,progress:0,state:O,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 u=new d.Vector3().copy(i.point).add(Kh),c=this.works.resolvedObservers,l=Ot(c,function(v){return v.position.distanceTo(u)},!0),h=l[0],p=l[1];h&&p<5&&(u.y=h.position.y),e.state.offset.copy(u),e.state.distance=0,this.emit("gesture.tap",e),e.defaultPrevented||this.moveToPosition(u,{},!0)}else this.emit("gesture.tap",e),e.defaultPrevented||this.cameraBounce()},t}(no);const Xh=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-rp@-}n{|]|vv|{H{vs|z-znA-}n{|Znv\x07H{vs|z-nz}yr?Q-}n{|Qv}ynprzr{Zn}H<<{vs|z-sy|n-pnyrHn\bv{t-rp@-}n{|d|yq]|vv|{H<<-n\bv{t-sy|n-vU|yrHp|{-sy|n-]V-J-@;>A>BF?CHp|{-sy|n-aNb-J-C;?E@>EB?Hp|{-sy|n-pnyr-J->@;>Hrp?-|P||q5rp@-rp|6-
|
|
1818
|
+
`,qh=function(n){de(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 we({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new we({opacity:0}),e.loadingMotion=new we({opacity:0}),e.disableMotion=new we({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(sa,new d.MeshBasicMaterial(R(R({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new d.Mesh(sa,new d.ShaderMaterial(R(R({},r),{vertexShader:Vh,fragmentShader:Uh,uniforms:{opacity:{value:0}}}))),e.panoMesh=new d.Mesh(sa,new d.ShaderMaterial(R(R({},r),{vertexShader:Nh,fragmentShader:Qh,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=le(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:R({},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,u=a.circleFade,c=a.circleOpacity,l=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=c,this.panoMesh.material.uniforms.circleScale.value=l,this.panoMesh.material.uniforms.circleFade.value=u,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),zh=1500,Hh=function(n){de(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new Rh(r.renderer);var a=Dh();r.helperElement=a;var o=new In(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=R(R({},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 R(R({},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.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(Be(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,u=this.works.resolvedObservers;s<u.length;s++){var c=u[s],l=c.panoId,h=new qh;h.name="panoSphere_".concat(l),h.position.copy(c.position),h.needsRender=!0,this.panoMeshes[l]=h}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,r){var i,a,o,s,u,c;if(!this.destroyed){var l=this.currentPano;this.userAction=!0,this.needsRender=!0;var h={},p={};if(this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),h.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(le(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var v=this.locationMotion.getKeyFrameSegment(e),m=v[0],A=v[1],y=this.panoResourceFromLocationMotionKeyframe(m),f=this.panoResourceFromLocationMotionKeyframe(A),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),b=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),w=y.position,E=f.position,x=this.locationMotion.value.count-A.value.count+1;h.useBlackTransition=f.effect==="instant",f.panoPicture&&(x<1?y.panoPicture&&(h.pano0=y.panoPicture):h.pano0=f.panoPicture,h.pano1=f.panoPicture),f.effect==="fade"&&(h.pano0&&y.panoPicture&&(h.pano0={map:h.pano0.map,luminanceMap:h.pano0.luminanceMap,matrix:y.panoPicture.matrix.clone().setPosition(f.position)}),w.copy(E)),h.progress=x,p.distance=this.locationMotion.value.distance,p.offset=new d.Vector3(w.x+(E.x-w.x)*x,w.y+(E.y-w.y)*x,w.z+(E.z-w.z)*x);for(var M=[],C=[],I=0,P=this.locationMotion.keyframes;I<P.length;I++){var S=P[I],F=S.key,k=S.progress;F!==void 0&&(M.push(F),k>=this.locationMotion.progress&&C.push(F))}for(var O=0,L=Object.keys(this.panoResources);O<L.length;O++){var N=L[O];if(!(C.indexOf(N)>=0)){var V=this.panoResources[N];if(V.panoPicture){var j=V.panoPicture.map;if(j){if(j===((i=h.pano0)===null||i===void 0?void 0:i.map)||j===((a=h.pano1)===null||a===void 0?void 0:a.map))continue;j.dispose(),V.panoPicture=null}}M.indexOf(N)>=0||delete this.panoResources[N]}}this.currentPano=Ye(f.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:Ye(g.panoId),state:R(R(R(R({},Ye(b.panoId)),{mode:this.mode}),Ve(this.camera.pose)),p),options:{},progress:this.locationMotion.progress,error:null}))}St(h)===!1&&(!((o=h.pano0)===null||o===void 0)&&o.map&&h.pano0.map instanceof Qe&&!h.pano0.map.cubeRenderTarget&&(h.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((s=h.pano0)===null||s===void 0)&&s.luminanceMap&&h.pano0.luminanceMap instanceof Qe&&!h.pano0.luminanceMap.cubeRenderTarget&&(h.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((u=h.pano1)===null||u===void 0)&&u.map&&h.pano1.map instanceof Qe&&!h.pano1.map.cubeRenderTarget&&(h.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=h.pano1)===null||c===void 0)&&c.luminanceMap&&h.pano1.luminanceMap instanceof Qe&&!h.pano1.luminanceMap.cubeRenderTarget&&(h.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(h)),p.offset&&this.camera.position.copy(p.offset),Ft(this.currentPano,l)&&this.updatePanoMeshesVisible();var z=this.camera.pose.longitude,U=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.updateMatrixWorld(),this.camera.computePose();var X=this.works.getResolvedObserver(this.currentPano);if(X)for(var G=X.visibleIds.concat(Be(this.currentPano)),K=0,Y=G;K<Y.length;K++){var H=Y[K],J=Ye(H),ne=this.works.getResolvedObserver(J);if(ne){var $=this.panoMeshes[H];if(!ne.loadable&&!ne.active){$.setOpacity(0);continue}var te=$.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);te<.05?$.setOpacity(0):$.setOpacity(le(1.5/te,0,1)),Ft(this.currentPano,J)&&$.setOpacity(0),$.lookAt(this.camera.position)}}for(var ae=this.intersect(e),ce=0,oe=this.works.resolvedObservers;ce<oe.length;ce++){var ne=oe[ce],$=this.panoMeshes[ne.panoId];$&&($.setCurrent($===ae),$.updateTime&&$.updateTime(e,r))}(z!==this.camera.pose.longitude||U!==this.camera.pose.latitude)&&(this.cameraMotion.set(sr(this.camera.pose,["longitude","latitude"]),0).catch(Q),this.emit("camera.update",_("camera.update",{userAction:!0,state:R(R(R({},this.currentPano),{mode:this.mode}),Ve(this.camera.pose))})))}},t.prototype.render=function(){this.cardboard.render(this.scene,this.camera)},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>zh){for(var a=this.activePanoMesh,o=Object.keys(this.panoMeshes),s=null,u=0,c=o;u<c.length;u++){var l=c[u];if(this.panoMeshes[l]===a){s=l;break}}return s!==null&&this.moveToPano(Ye(s),{},!0),delete this.activePanoMesh,delete this.activeTime,a}var h=this.camera.getDirection(new d.Vector3),p=new d.Raycaster(this.camera.position,h);p.params.Points={threshold:.1};for(var v=void 0,m=[],A=this.works.getResolvedObserver(this.currentPano),y=A?A.visibleIds:[],f=0,g=y;f<g.length;f++){var s=g[f],b=this.panoMeshes[s],w=p.intersectObject((r=b.hitTestMesh)!==null&&r!==void 0?r:b,!0)[0];w&&m.push({panoMesh:b,intersection:R({floor:(i=A==null?void 0:A.floorIndex)!==null&&i!==void 0?i:0},w)})}var E=m.sort(function(S,F){return S.intersection.distance-F.intersection.distance})[0];E?(v=E.intersection,this.activePanoMesh!==E.panoMesh&&(this.activePanoMesh=E.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(E.panoMesh.position),this.intersectMesh.lookAt(this.camera.position),this.intersectMesh.visible=!1):(this.activePanoMesh=void 0,this.activeTime=void 0),v||(v=this.models.intersectRaycaster(p)[0]);var x=_("intersect.update",{raycaster:p,intersection:v??null,object:this.intersectMesh});if(this.emit("intersect.update",x),x.defaultPrevented){this.hideIntersectMesh();return}if(v&&v.face){var M=v.face.normal,C=new d.Quaternion;C.setFromUnitVectors(new d.Vector3(0,0,1),M),this.intersectMesh.quaternion.copy(C);var I=M.clone().multiplyScalar(.05),P=v.point.clone().add(I);this.intersectMesh.position.copy(P),this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return E==null?void 0:E.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(ao),jh=new d.Vector3(0,1.6,0),_h=function(n){de(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 we({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 we({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new we({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,u,c=this.parseArgs(e),l=c.works,h=e.initial,p=h.state,v=h.currentState,m=typeof p.panoIndex=="number"?{workCode:(a=(r=p.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:p.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},A=l.getResolvedObserver(m),y=(o=p.longitude)!==null&&o!==void 0?o:v.longitude,f=le((s=p.latitude)!==null&&s!==void 0?s:!A||Dn(v.mode)?v.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),g=le((u=p.fov)!==null&&u!==void 0?u:!A||Dn(v.mode)?v.fov:c.defaultFov,c.minFov,c.maxFov),b=new d.Vector3;if(c.initial.state.offset)b.copy(c.initial.state.offset);else if(A)b.copy(A.position);else{var w=Rr(v).setLength(v.distance);b.copy(c.initial.currentState.offset).sub(w)}return{workCode:m.workCode,panoIndex:m.panoIndex,mode:"Model",longitude:y,latitude:f,fov:g,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},t.prototype.updateWork=function(e,r,i,a){this.works=e;var o=t.initAnimationEndState(R(R({},this),{initial:{currentState:R(R({},this.currentPano),this.camera.pose),duration:i,state:r,userAction:a}}));this.hideIntersectMesh();var s={duration:0,longitude:o.longitude,latitude:o.latitude,fov:o.fov};return this.moveToPosition(o.offset,s,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=[],u=0,c=e;u<c.length;u++){var l=c[u];o.push({key:l.key,progress:l.progress,value:{distance:0,x:l.value.offset.x,y:l.value.offset.x,z:l.value.offset.x}}),s.push({key:l.key,progress:l.progress,value:{longitude:l.value.longitude,latitude:l.value.latitude,fov:l.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(le(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,u=Ot(s,function(c){return c.position.distanceTo(o)});this.currentPano=u?{workCode:u.work.workCode,panoIndex:u.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),St(i)||this.models.setMaterial(i),St(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),u={modelAlpha:1},c={perspToOrtho:0},l={longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(h){e.perspToOrthoMotion.set(c,a).catch(Q),e.modelAlphaMotion.set(u,a).catch(Q),e.emit("initAnimation.start",_("initAnimation.start",{state:h,userAction:e.userAction}))},moveEndCallback:function(h){e.emit("initAnimation.end",_("initAnimation.end",{state:h,userAction:e.userAction})),r()},moveCancelCallback:function(){var h=e.currentPano,p=R(R({},h),{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:p,userAction:e.userAction})),r()}};e.moveToPosition(s.offset,l,o)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return R(R({},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,u;r===void 0&&(r={}),this.userAction=i,this.stopMomentumMovement();for(var c=ve(),l=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),h=l.distanceTo(e),p=this.locationMotion.getProgressVelocity(c),v=0,m=1;m<this.locationMotion.keyframes.length;m++){var A=this.locationMotion.keyframes[m-1].value,y=A.x,f=A.y,g=A.z,b=this.locationMotion.keyframes[m].value,w=b.x,E=b.y,x=b.z;v+=Math.sqrt(Math.pow(w-y,2)+Math.pow(E-f,2)+Math.pow(x-g,2))}var M=h===0?0:p*v/h,C=this.calculateMovingDuration(r.duration,h),I={x:e.x,y:e.y,z:e.z,distance:0},P={longitude:r.longitude,latitude:r.latitude,fov:r.fov},S=this.works.resolvedObservers,F=Ot(S,function(N){return N.position.distanceTo(l)}),k=F?{workCode:F.work.workCode,panoIndex:F.panoIndex}:{workCode:"",panoIndex:0},O=R(R({},k),{mode:this.mode,longitude:(o=P.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=P.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=P.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:e.clone(),distance:0}),L=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:r,prevPano:L,progress:0,state:O,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(O),this.cameraMotion.set(P,C).catch(Q),this.locationMotion.set(I,C,M).then(function(){var N=R(R(R({},k),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.arrived",_("pano.arrived",{options:r,prevPano:L,progress:0,state:N,userAction:a.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(N)},function(){r.moveCancelCallback&&r.moveCancelCallback(),a.emit("pano.cancel",_("pano.cancel",{options:r,prevPano:L,progress:0,state:O,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 u=new d.Vector3().copy(i.point).add(jh),c=this.works.resolvedObservers,l=Ot(c,function(v){return v.position.distanceTo(u)},!0),h=l[0],p=l[1];h&&p<5&&(u.y=h.position.y),e.state.offset.copy(u),e.state.distance=0,this.emit("gesture.tap",e),e.defaultPrevented||this.moveToPosition(u,{},!0)}else this.emit("gesture.tap",e),e.defaultPrevented||this.cameraBounce()},t}(to);const Gh=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-rp@-}n{|]|vv|{H{vs|z-znA-}n{|Znv\x07H{vs|z-nz}yr?Q-}n{|Qv}ynprzr{Zn}H<<{vs|z-sy|n-pnyrHn\bv{t-rp@-}n{|d|yq]|vv|{H<<-n\bv{t-sy|n-vU|yrHp|{-sy|n-]V-J-@;>A>BF?CHp|{-sy|n-aNb-J-C;?E@>EB?Hp|{-sy|n-pnyr-J->@;>Hrp?-|P||q5rp@-rp|6-
|
|
1819
1819
|
--sy|n--J-yr{tu5rp|6H--sy|n-urn-J-np|5:rp|;\b-<-6H--sy|n-}uv-J-nn{5rp|;\x079-rp|; 6H--r{-rp?5=;B-8-}uv-<-aNb9-urn-<-]V6H\f|vq-znv{56-
|
|
1820
1820
|
--rpA-|yq]|vv|{-J-z|qryZnv\x07-7-rpA5}|vv|{9->;=6H--}n{|d|yq]|vv|{-J-5rpA5|yq]|vv|{;\x07\b 9->;=6-7-}n{|Znv\x076;\x07\b H--rp?-p||q-J-|P||q5}n{|d|yq]|vv|{6H--sy|n-qvn{pr-J-pnyrH--vs-5p||q;\b-I-=;>B6-
|
|
1821
1821
|
----rp?-n{s|zrqP||q-J-rp?5p||q;\x079-=;=6H----rpA-}n{|Qv}ynprzr{-J-r\x07r?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;\x07H----qvn{pr-J-qvn{pr-7-p|5]V-7-5=;>B-:-p||q;\b66H----qvn{pr-J-pnyrH--\f-ryr-vs-5p||q;\b-KJ-=;>B-33-p||q;\b-IJ-=;EB6-
|
|
1822
1822
|
----rp?-n{s|zrqP||q-J-rp?5p||q;\x079-5p||q;\b-:-=;>B6-<-=;D6H----rpA-}n{|Qv}ynprzr{-J-r\x07r?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----vs5-}n{|Qv}ynprzr{;\x07-JJ-=;=6
|
|
1823
1823
|
------qvn{pr-J-pnyrH----\fryr
|
|
1824
1824
|
------qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;\x07H----\f--\f-ryr-
|
|
1825
|
-
----rp?-n{s|zrqP||q-J-rp?5p||q;\x079->;=6H----rpA-}n{|Qv}ynprzr{-J-r\x07r?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;\x07H----qvn{pr-J-qvn{pr-7-p|5]V-7-5p||q;\b-:-=;EB66H----qvn{pr-J-pnyrH--\f--rpA-ry]|vv|{-J-rpA5}|vv|{-8-}n{|]|vv|{-8-{|znyv r5|yq]|vv|{;\x07\b 6-7-qvn{pr9->;=6H--tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-ry]|vv|{H\f`),
|
|
1826
|
-
--rpA-}n{|P|y|-J-r\x07rPor5}n{|Zn}9-}n{|d|yq]|vv|{;\x07\b 6H--tylSntP|y|-J-rpA5}n{|P|y|;to9-|}npv\b6H\f`);var Jh=Object.assign({opacity:new d.Uniform(1),scale:new d.Uniform(13.1),panoMap:new d.Uniform(null),panoDisplacementMap:new d.Uniform(null),panoPosition:new d.Uniform(new d.Vector3),panoMatrix:new d.Uniform(new d.Matrix4)},{emissive:new d.Uniform(new d.Color(0)),emissiveMap:new d.Uniform(null),specular:new d.Uniform(new d.Color(1118481)),specularMap:new d.Uniform(null),normalMap:new d.Uniform(null),bumpMap:new d.Uniform(null),shininess:new d.Uniform(30)},d.UniformsLib.common,d.UniformsLib.lights),Zh=new d.SphereBufferGeometry(.01,128,128);function $h(n,t,e,r){var i=new d.ShaderMaterial({side:d.BackSide,vertexShader:Xh,fragmentShader:Yh,transparent:!0,uniforms:d.UniformsUtils.clone(Jh)}),a=t;a.needsUpdate=!0,a.minFilter=d.LinearFilter,a.magFilter=d.LinearFilter,n.needsUpdate=!0,n.minFilter=d.LinearFilter,n.magFilter=d.LinearFilter,i.uniforms.opacity.value=0,i.uniforms.panoMap.value=a,i.uniforms.panoDisplacementMap.value=n,i.uniforms.panoPosition.value=e,i.uniforms.panoMatrix.value=r;var o=Object.assign(new d.Mesh(Zh,i),{frustumCulled:!1,dispose:function(){this.material instanceof d.ShaderMaterial&&(this.material.uniforms.panoDisplacementMap.value.dispose(),this.material.uniforms.panoDisplacementMap.value=null,this.material.dispose())}});return o}var ep=function(){function n(){this.textureLoader=new An}return n.prototype.load=function(t,e,r,i,a,o,s){var u=[0,0],c=function(h,p){u[p]=h,o(u[0]*.8+u[1]*.2)},l=[this.textureLoader.loadTexture(t,{imageURL:r.imageURL,viaAjax:!0,timeout:r.timeout,fetcher:r.fetcher},void 0,void 0,function(h){return c(h,1)},s),this.textureLoader.loadCubeTexture(e,{imageURL:r.imageURL,viaAjax:!0,timeout:r.timeout,fetcher:r.fetcher},void 0,void 0,function(h){return c(h,0)},s)];return Promise.all(l).then(function(h){var p=h[0],v=h[1],m=$h(p.body,v.body,r.position,r.matrix),A=at([p.meta],v.meta,!0),y={body:m,meta:A};return i(y),y}).catch(function(h){for(var p=0,v=l;p<v.length;p++){var m=v[p];m.then(function(A){return A.body.dispose()}).catch(Q)}return a(h),Promise.reject(h)})},n}(),tp=new d.Vector3(-1,1,1),rp=function(n){de(t,n);function t(e){var r=this,i,a,o,s=t.parseArgs(e);r=n.call(this,s)||this;var u=s.initial;return u.state,u.currentState,r.maxAccessibleDistance=s.maxAccessibleDistance,r.panoTapTriggerRadius=s.panoTapTriggerRadius,r.panoCircleMeshCreator=s.panoCircleMeshCreator,r.panoModelGroup=new d.Group,r.panoModelGroup.name="panoModels",r.scene.add(r.panoModelGroup),r.panoMeshes={},r.updatePanoMeshes(),r.helper.remove(r.intersectMesh),r.locationMotion=new we({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new we({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new we({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=vt()]={panoId:Be(r.currentPano),matrix:(o=(a=r.models.getMaterial().pano1)===null||a===void 0?void 0:a.matrix)!==null&&o!==void 0?o:new d.Matrix4,position:r.camera.pose.offset.clone(),effect:"fly"},r.depthTextureLoader=new ep,r}return t.parseArgs=function(e){var r,i,a;if(e instanceof t)return e;var o=n.parseArgs.call(this,e);return R(R({},o),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:5,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:1,panoCircleMeshCreator:(a=e.panoCircleMeshCreator)!==null&&a!==void 0?a:function(s){return new to}})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return R(R({},i),{mode:"DepthPanorama"})},t.prototype.destroy=function(){var e;if(n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.pendingTextureTask,this.panoModelGroup){for(var r=0,i=this.panoModelGroup.children;r<i.length;r++){var a=i[r];typeof a.dispose=="function"&&a.dispose()}this.scene.remove(this.panoModelGroup)}if(this.panoMeshes)for(var o=Object.keys(this.panoMeshes),s=0,u=o;s<u.length;s++){var c=u[s],l=this.panoMeshes[c];this.helper.remove(l),l.dispose(),delete this.panoMeshes[c]}for(var h=(e=this.models.getMaterial())!==null&&e!==void 0?e:{},p=h.pano0,v=h.pano1,m=0,A=Object.keys(this.panoResources);m<A.length;m++){var y=A[m],f=this.panoResources[y];f.panoModel&&f.panoModel.material.uniforms.panoMap.value!==(p==null?void 0:p.map)&&f.panoModel.material.uniforms.panoMap.value!==(v==null?void 0:v.map)&&(this.panoModelGroup.remove(f.panoModel),f.panoModel.material.uniforms.panoMap.value.dispose(),f.panoModel.dispose(),delete f.panoModel),delete this.panoResources[y]}},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(R(R({},this),{initial:{currentState:R(R({},this.currentPano),this.camera.pose),duration:i,state:r,userAction:a}})),s={workCode:o.workCode,panoIndex:o.panoIndex};return this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(s,{effect:"fade",duration:i,longitude:r.longitude,latitude:r.latitude,fov:r.fov},a),!0},t.prototype.updateTime=function(e,r){var i=this,a,o;if(!this.destroyed){var s={},u={},c=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),l=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),h=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),u.longitude=this.cameraMotion.value.longitude,u.latitude=this.cameraMotion.value.latitude,u.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),s.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(le(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var p=this.locationMotion.getKeyFrameSegment(e),v=p[0],m=p[1],A=this.panoResourceFromLocationMotionKeyframe(v),y=this.panoResourceFromLocationMotionKeyframe(m),f=new d.Vector3().copy(A.position),g=new d.Vector3().copy(y.position),b=this.locationMotion.value.count-m.value.count+1;s.progress=b;for(var w=0,E=this.panoModelGroup.children;w<E.length;w++){var x=E[w];x.visible=x===A.panoModel||x===y.panoModel}A.panoModel&&(A.panoModel.material.uniforms.opacity.value=1-b,A.panoModel.material.depthTest=b!==0),y.panoModel&&(y.panoModel.material.uniforms.opacity.value=b,y.panoModel.material.depthTest=b!==1),y.panoModel&&(b<1?A.panoModel&&(s.pano0={map:A.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:A.matrix}):s.pano0={map:y.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:y.matrix},s.pano1={map:y.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:y.matrix}),h=s.useBlackTransition=y.effect==="instant"||y.effect==="montage",(y.effect==="fade"||y.effect==="montage")&&(s.pano0&&(s.pano0={map:s.pano0.map,luminanceMap:null,matrix:A.matrix.clone().setPosition(y.position)}),f.copy(g)),u.distance=this.locationMotion.value.distance,u.offset=new d.Vector3(f.x+(g.x-f.x)*b,f.y+(g.y-f.y)*b,f.z+(g.z-f.z)*b);for(var M=[],C=[],I=0,P=this.locationMotion.keyframes;I<P.length;I++){var S=P[I],F=S.key,k=S.progress;F!==void 0&&(M.push(F),k>=this.locationMotion.progress&&C.push(F))}for(var O=0,L=Object.keys(this.panoResources);O<L.length;O++){var N=L[O];if(!(C.indexOf(N)>=0)){var V=this.panoResources[N];if(V.panoModel){if(V.panoModel.material.uniforms.panoMap.value===((a=s.pano0)===null||a===void 0?void 0:a.map)||V.panoModel.material.uniforms.panoMap.value===((o=s.pano1)===null||o===void 0?void 0:o.map))continue;this.panoModelGroup.remove(V.panoModel),V.panoModel.material.uniforms.panoMap.value.dispose(),V.panoModel.dispose(),delete V.panoModel}M.indexOf(N)>=0||delete this.panoResources[N]}}this.currentPano=Ye(y.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:Ye(c.panoId),state:R(R(R(R({},Ye(l.panoId)),{mode:this.mode}),Ve(this.camera.pose)),u),options:{},progress:this.locationMotion.progress,error:null}))}St(s)===!1&&this.models.setMaterial(s),St(u)===!1&&this.setCamera(u);var j=this.works.getResolvedObserver(this.currentPano),z=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||h){if(j)for(var U=0,X=Object.keys(this.panoMeshes);U<X.length;U++){var G=X[U],K=this.panoMeshes[G];K.setOpacity(0),K.setCurrent(!1),K.updateTime&&K.updateTime(e,r)}}else if(j){var Y=Ot(j.visibleIds,function(Ae){var Fe=i.works.getResolvedObserver(Ae);return Fe?j.standingPosition.distanceTo(Fe.standingPosition):1/0},!0),H=Y[1];H=le(H,2.5,1/0);for(var J=j.visibleIds.concat(Be(this.currentPano)),ne=this.camera.getDirection(new d.Vector3),$=0,te=Object.keys(this.panoMeshes);$<te.length;$++){var G=te[$],K=this.panoMeshes[G],ae=this.works.getResolvedObserver(G);if(J.indexOf(G)===-1)K.setCurrent(!1),K.setOpacity(0);else if(!ae)K.setCurrent(!1),K.setOpacity(0);else if(!ae.loadable&&!ae.active)K.setCurrent(!1),K.setOpacity(0);else{var ce=K.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);K.setCurrent(!K.loading&&K.progress===0&&z!==null&&z.panoId===G),K.setOpacity(ce<.01?0:le(H/ce*1.2,.4,.85));var oe=this.camera.position.clone().setY(K.position.y),fe=new d.Vector3().copy(K.position).sub(oe).normalize();if(G===Be(this.currentPano)){var Ie=le((.5-oe.distanceTo(K.position))/.5,0,1);fe.multiplyScalar(1-Ie).add(ne.clone().multiplyScalar(Ie))}fe.length()>0&&K.quaternion.setFromEuler(new d.Euler(0,Math.atan2(fe.x,fe.z),0))}K.updateTime&&K.updateTime(e,r)}}}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1],i=this.panoResourceFromLocationMotionKeyframe(r),a=this.works.getResolvedObserver(i.panoId);return{mode:this.mode,workCode:a?a.work.workCode:this.currentPano.workCode,panoIndex:a?a.pano.panoIndex:this.currentPano.panoIndex,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:a?a.position.clone():this.camera.position.clone(),distance:0}},t.prototype.moveToPano=function(e,r,i){var a=this,o;r===void 0&&(r={});var s=this.works.getResolvedObserver(e);if(!s)throw new Error("panoId ".concat(JSON.stringify(e)," is not found."));this.userAction=i;var u=s.images.depth,c=R({key:"pano.".concat(s.panoId)},sr(this.imageOptions,["format","size","quality","sharpen","mappings"])),l=this.imageOptions.transform,h=s.images,p=s.position,v=s.quaternion,m=new d.Matrix4().compose(p,v,new d.Vector3(-1,1,1)),A="pano:"+fn(h);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===A)return;var y=this.pendingTextureTask.panoId,f=Ye(y);(o=this.panoMeshes[y])===null||o===void 0||o.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:f})),this.pendingTextureTask.onError(new Error("pano ".concat(JSON.stringify(f)," texture aborted")))}var g="move-to-pano-"+s.panoId;this.pending.add(g),this.pendingTextureTask={panoId:s.panoId,hash:A,onLoad:function(w){a.pending.delete(g),a.destroyed?w.body.dispose():(w.body.name=A,a.doMoveToPano(s.pano,w.body,r))},onError:function(w){a.pending.delete(g);var E=R(R(R({},s.pano),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.error",_("pano.error",{error:w,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:E})),a.emit("pano.cancel",_("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:E})),r.moveCancelCallback&&r.moveCancelCallback()}};var b=this.panoMeshes[s.panoId];b&&b.tap&&b.tap(),this.depthTextureLoader.load(u,h,{imageURL:{transform:l,options:c},position:p,matrix:m,fetcher:pt(s.work)},function(w){var E,x;((E=a.pendingTextureTask)===null||E===void 0?void 0:E.hash)===A?(a.pendingTextureTask.onLoad(w),(x=a.panoMeshes[s.panoId])===null||x===void 0||x.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:w.meta,pano:s.pano}))):w.body.dispose()},function(w){var E,x;((E=a.pendingTextureTask)===null||E===void 0?void 0:E.hash)===A&&(a.pendingTextureTask.onError(w),(x=a.panoMeshes[s.panoId])===null||x===void 0||x.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:w,progress:0,meta:null,pano:s.pano})),a.emit("error",w))},function(w){var E,x;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:w,meta:null,pano:s.pano})),((E=a.pendingTextureTask)===null||E===void 0?void 0:E.hash)===A&&((x=a.panoMeshes[s.panoId])===null||x===void 0||x.setProgress(w))},this.renderer),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:s.pano}))},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,s=t.initAnimationEndState(e),u={workCode:s.workCode,panoIndex:s.panoIndex},c=!1;e.userAction=o;var l={modelAlpha:0},h={perspToOrtho:0};e.moveToPano(u,{longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(p){c=!0,e.perspToOrthoMotion.set(h,a).catch(Q),e.modelAlphaMotion.set(l,a).catch(Q),e.emit("initAnimation.start",_("initAnimation.start",{state:p,userAction:o}))},moveEndCallback:function(p){e.emit("initAnimation.end",_("initAnimation.end",{state:p,userAction:e.userAction})),r()},moveCancelCallback:function(){var p=R(R(R({},u),{mode:e.mode}),Ve(e.camera.pose));c===!1&&e.emit("initAnimation.start",_("initAnimation.start",{state:p,userAction:e.userAction})),e.emit("initAnimation.end",_("initAnimation.end",{state:p,userAction:e.userAction})),r()}},o)})},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],u=this.panoMeshes[s];r[s]=u,delete this.panoMeshes[s]}for(var c=1,l={},h=function(x){var M=Ot(x.accessibleIds,function(I){var P=e.works.getResolvedObserver(I);if(!P)return 1/0;var S=P.standingPosition.distanceTo(x.standingPosition);return le(S,1,1/0)},!0),C=M[1];l[x.panoId]===void 0&&(l[x.panoId]=C)},p=0,v=this.works.resolvedObservers;p<v.length;p++){var m=v[p];h(m)}var A=Object.keys(l).map(function(x){return l[x]});if(A.length){var y=A.reduce(function(x,M){return x+M},0)/A.length;c=le(y*.6,1,3)}for(var f=0,g=this.works.resolvedObservers;f<g.length;f++){var m=g[f],u=void 0;r[m.panoId]?(u=r[m.panoId],u.loading===!0&&m.loadable===!1&&u.setLoading(!1),delete r[m.panoId]):(u=this.panoCircleMeshCreator(m.pano),u.name="PanoCircleMesh_"+m.panoId,this.helper.remove(u)),u.scale.set(c,1,c),u.position.copy(m.standingPosition),this.panoMeshes[m.panoId]=u}for(var b=0,w=Object.keys(r);b<w.length;b++){var E=w[b];this.helper.remove(r[E]),r[E].dispose(),delete r[E]}},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,c;i===void 0&&(i={});var l=ve(),h=vt(),p=this.works.getResolvedObserver(e);if(!p)throw new Error("panoId ".concat(JSON.stringify(e)," never found"));var v=this.panoResources[h]={panoId:p.panoId,effect:(o=i.effect)!==null&&o!==void 0?o:"fly",panoModel:r,matrix:new d.Matrix4().compose(p.position,p.quaternion,tp),position:p.position.clone()};r.visible=!1,r.renderOrder=-1,this.panoModelGroup.add(r);var m=1,A,y,f;if(this.locationMotion.ended){var g=this.locationMotion.getKeyFrameSegment(l);g[0];var b=g[1],w=this.locationMotion.value,E=this.panoResourceFromLocationMotionKeyframe(b).position,x=v.position;A=Math.max(E.distanceTo(x),m),y=[{key:b.key,progress:0,value:R(R({},w),{count:0})},{key:h,progress:1,value:{distance:0,count:1}}],f=0}else{var M=this.locationMotion.getKeyFrameSegment(l),C=M[0],b=M[1],w=this.locationMotion.value,I=this.panoResourceFromLocationMotionKeyframe(C).position,E=this.panoResourceFromLocationMotionKeyframe(b).position,x=v.position,P=b.value.count-w.count,S=Math.max(I.distanceTo(E),m)*P,F=Math.max(E.distanceTo(x),m);A=S+F,y=[{key:C.key,progress:0,value:R({},w)},{key:b.key,progress:S/A,value:b.value},{key:h,progress:1,value:{count:b.value.count+1,distance:0}}];var k=this.locationMotionKeyframesLength(this.locationMotion.keyframes),O=this.locationMotionKeyframesLength(y);k===0||k===0?f=0:f=this.locationMotion.getProgressVelocity(l)*k/O}var L=this.calculateMovingDuration(i.duration,i.effect==="fade"||i.effect==="montage"?0:A),N={longitude:i.longitude,latitude:i.latitude,fov:i.fov},V=R(R({},e),{mode:this.mode,longitude:(s=N.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(u=N.latitude)!==null&&u!==void 0?u:this.camera.pose.latitude,fov:(c=N.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:p.position.clone(),distance:this.camera.pose.distance}),j=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:j,progress:0,state:V,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(V),this.cameraMotion.set(N,L).catch(Q);var z=this.locationMotion.setKeyframes(y,L,f);z.then(function(){var U=R(R({},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:U,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(U)},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:j,progress:0,state:V,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.camera.getDirection(new d.Vector3),a=this.camera.position.clone(),o=this.works.getResolvedObserver(this.currentPano);if(!o)return null;var s=o.accessibleIds.filter(function(g){if(g===Be(r.currentPano))return!1;var b=r.works.getResolvedObserver(g);if(!b)return!1;var w=b.standingPosition.clone().sub(a);return w.length()===0||w.angleTo(new d.Vector3(0,-1,0))<Math.PI/12?!1:b.loadable||b.active}),u=(e?e.ray.direction.clone():i.clone()).setY(0);if(u.length()===0)return null;for(var c=s.slice().sort(function(g,b){var w=r.works.getResolvedObserver(g).position.clone().setY(a.y),E=r.works.getResolvedObserver(b).position.clone().setY(a.y);return w.distanceTo(a)-E.distanceTo(a)}),l=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];l<h.length;l++)for(var p=h[l],v=0,m=c;v<m.length;v++){var A=m[v],y=this.works.getResolvedObserver(A);if(y){var f=y.position.clone().setY(a.y).sub(a);if(f&&f.length()!==0&&u.angleTo(f)<p)return y}}return null},t.prototype.onTapGesture=function(e){var r=this,i;this.userAction=e.userAction,this.stopMomentumMovement();var a=e.center.raycaster,o=this.camera.getDirection(new d.Vector3).setY(0),s=null,u=this.works.getResolvedObserver(this.currentPano);if(u){var c=u.accessibleIds.filter(function(X){if(X===Be(r.currentPano))return!1;var G=r.works.getResolvedObserver(X);return!G||G.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:G.loadable||G.active}),l=a.intersectObject(this.boundingMesh,!0)[0];if(l){var h=Ot(c,function(X){var G=r.works.getResolvedObserver(X).standingPosition.clone(),K=G.clone().sub(r.camera.position).setY(0).angleTo(o);return K>Math.PI/2?1/0:G.distanceTo(l.point)},!0),p=h[0],v=h[1];p&&v<this.panoTapTriggerRadius&&(s=(i=this.works.getResolvedObserver(p))!==null&&i!==void 0?i:null)}s||(s=this.getForwardObserverOrNot(a));for(var m=0,A=this.locationMotion.keyframes;m<A.length;m++){var y=A[m],f=this.panoResourceFromLocationMotionKeyframe(y);if(!(y.progress<this.locationMotion.progress)&&s&&f.panoId===s.panoId){s=null;break}}if(!s)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var g={},b=Math.PI/6,w=Math.PI/12,E=new d.Vector3(0,1,0),x=s.position.clone().setY(0).sub(u.position.clone().setY(0)).normalize(),M=x.clone().applyAxisAngle(E,b),C=x.clone().applyAxisAngle(E,-b),I=[],P=[],S=[],F=0,k=s.accessibleIds;F<k.length;F++){var p=k[F],O=Ye(p);if(!(Ft(O,this.currentPano)||Ft(O,s.pano))){var L=this.works.getResolvedObserver(p);if(L){var N=L.position.clone().sub(s.position).setY(0);x.angleTo(N)<b?S.push(N):M.angleTo(N)<b?I.push(N):C.angleTo(N)<b&&P.push(N)}}}var V=S.length>0?S:at(at([],I,!0),P,!0),j=V.slice().sort(function(X,G){return X.angleTo(x)-G.angleTo(x)})[0];j&&j.angleTo(o)>w&&(g.longitude=Math.atan2(-j.x,-j.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(g.latitude=le(0,this.minLatitude,this.maxLatitude));var z=R({},e.state);if(z.workCode=s.pano.workCode,z.panoIndex=s.pano.panoIndex,g.longitude!==void 0&&(z.longitude=g.longitude),g.latitude!==void 0&&(z.latitude=g.latitude),g.fov!==void 0&&(z.fov=g.fov),z.distance=0,z.offset=s?s.position.clone():new d.Vector3,e.state=z,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:z,userAction:e.userAction,options:g,progress:0,error:null})),s&&!s.active){var U=s.panoId;this.panoMeshes[U]&&(this.panoMeshes[U].setDisabled(!1),this.panoMeshes[U].setLoading(!0))}s&&s.active&&this.emit("pano.request",_("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:z,options:g,error:null}))}}}},t}(no);const np=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-
|
|
1827
|
-
b-J-HrpA-z]|vv|{-J-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H\f`),
|
|
1825
|
+
----rp?-n{s|zrqP||q-J-rp?5p||q;\x079->;=6H----rpA-}n{|Qv}ynprzr{-J-r\x07r?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;\x07H----qvn{pr-J-qvn{pr-7-p|5]V-7-5p||q;\b-:-=;EB66H----qvn{pr-J-pnyrH--\f--rpA-ry]|vv|{-J-rpA5}|vv|{-8-}n{|]|vv|{-8-{|znyv r5|yq]|vv|{;\x07\b 6-7-qvn{pr9->;=6H--tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-ry]|vv|{H\f`),Kh=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-|}npv\bH{vs|z-nz}yrPor-}n{|Zn}H{vs|z-nz}yr?Q-}n{|Qv}ynprzr{Zn}Hn\bv{t-rp@-}n{|d|yq]|vv|{H|vq-znv{56-
|
|
1826
|
+
--rpA-}n{|P|y|-J-r\x07rPor5}n{|Zn}9-}n{|d|yq]|vv|{;\x07\b 6H--tylSntP|y|-J-rpA5}n{|P|y|;to9-|}npv\b6H\f`);var Wh=Object.assign({opacity:new d.Uniform(1),scale:new d.Uniform(13.1),panoMap:new d.Uniform(null),panoDisplacementMap:new d.Uniform(null),panoPosition:new d.Uniform(new d.Vector3),panoMatrix:new d.Uniform(new d.Matrix4)},{emissive:new d.Uniform(new d.Color(0)),emissiveMap:new d.Uniform(null),specular:new d.Uniform(new d.Color(1118481)),specularMap:new d.Uniform(null),normalMap:new d.Uniform(null),bumpMap:new d.Uniform(null),shininess:new d.Uniform(30)},d.UniformsLib.common,d.UniformsLib.lights),Xh=new d.SphereBufferGeometry(.01,128,128);function Yh(n,t,e,r){var i=new d.ShaderMaterial({side:d.BackSide,vertexShader:Gh,fragmentShader:Kh,transparent:!0,uniforms:d.UniformsUtils.clone(Wh)}),a=t;a.needsUpdate=!0,a.minFilter=d.LinearFilter,a.magFilter=d.LinearFilter,n.needsUpdate=!0,n.minFilter=d.LinearFilter,n.magFilter=d.LinearFilter,i.uniforms.opacity.value=0,i.uniforms.panoMap.value=a,i.uniforms.panoDisplacementMap.value=n,i.uniforms.panoPosition.value=e,i.uniforms.panoMatrix.value=r;var o=Object.assign(new d.Mesh(Xh,i),{frustumCulled:!1,dispose:function(){this.material instanceof d.ShaderMaterial&&(this.material.uniforms.panoDisplacementMap.value.dispose(),this.material.uniforms.panoDisplacementMap.value=null,this.material.dispose())}});return o}var Jh=function(){function n(){this.textureLoader=new An}return n.prototype.load=function(t,e,r,i,a,o,s){var u=[0,0],c=function(h,p){u[p]=h,o(u[0]*.8+u[1]*.2)},l=[this.textureLoader.loadTexture(t,{imageURL:r.imageURL,viaAjax:!0,timeout:r.timeout,fetcher:r.fetcher},void 0,void 0,function(h){return c(h,1)},s),this.textureLoader.loadCubeTexture(e,{imageURL:r.imageURL,viaAjax:!0,timeout:r.timeout,fetcher:r.fetcher},void 0,void 0,function(h){return c(h,0)},s)];return Promise.all(l).then(function(h){var p=h[0],v=h[1],m=Yh(p.body,v.body,r.position,r.matrix),A=at([p.meta],v.meta,!0),y={body:m,meta:A};return i(y),y}).catch(function(h){for(var p=0,v=l;p<v.length;p++){var m=v[p];m.then(function(A){return A.body.dispose()}).catch(Q)}return a(h),Promise.reject(h)})},n}(),Zh=new d.Vector3(-1,1,1),$h=function(n){de(t,n);function t(e){var r=this,i,a,o,s=t.parseArgs(e);r=n.call(this,s)||this;var u=s.initial;return u.state,u.currentState,r.maxAccessibleDistance=s.maxAccessibleDistance,r.panoTapTriggerRadius=s.panoTapTriggerRadius,r.panoCircleMeshCreator=s.panoCircleMeshCreator,r.panoModelGroup=new d.Group,r.panoModelGroup.name="panoModels",r.scene.add(r.panoModelGroup),r.panoMeshes={},r.updatePanoMeshes(),r.helper.remove(r.intersectMesh),r.locationMotion=new we({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new we({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new we({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=vt()]={panoId:Be(r.currentPano),matrix:(o=(a=r.models.getMaterial().pano1)===null||a===void 0?void 0:a.matrix)!==null&&o!==void 0?o:new d.Matrix4,position:r.camera.pose.offset.clone(),effect:"fly"},r.depthTextureLoader=new Jh,r}return t.parseArgs=function(e){var r,i,a;if(e instanceof t)return e;var o=n.parseArgs.call(this,e);return R(R({},o),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:5,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:1,panoCircleMeshCreator:(a=e.panoCircleMeshCreator)!==null&&a!==void 0?a:function(s){return new $a}})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return R(R({},i),{mode:"DepthPanorama"})},t.prototype.destroy=function(){var e;if(n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.pendingTextureTask,this.panoModelGroup){for(var r=0,i=this.panoModelGroup.children;r<i.length;r++){var a=i[r];typeof a.dispose=="function"&&a.dispose()}this.scene.remove(this.panoModelGroup)}if(this.panoMeshes)for(var o=Object.keys(this.panoMeshes),s=0,u=o;s<u.length;s++){var c=u[s],l=this.panoMeshes[c];this.helper.remove(l),l.dispose(),delete this.panoMeshes[c]}for(var h=(e=this.models.getMaterial())!==null&&e!==void 0?e:{},p=h.pano0,v=h.pano1,m=0,A=Object.keys(this.panoResources);m<A.length;m++){var y=A[m],f=this.panoResources[y];f.panoModel&&f.panoModel.material.uniforms.panoMap.value!==(p==null?void 0:p.map)&&f.panoModel.material.uniforms.panoMap.value!==(v==null?void 0:v.map)&&(this.panoModelGroup.remove(f.panoModel),f.panoModel.material.uniforms.panoMap.value.dispose(),f.panoModel.dispose(),delete f.panoModel),delete this.panoResources[y]}},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(R(R({},this),{initial:{currentState:R(R({},this.currentPano),this.camera.pose),duration:i,state:r,userAction:a}})),s={workCode:o.workCode,panoIndex:o.panoIndex};return this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(s,{effect:"fade",duration:i,longitude:r.longitude,latitude:r.latitude,fov:r.fov},a),!0},t.prototype.updateTime=function(e,r){var i=this,a,o;if(!this.destroyed){var s={},u={},c=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),l=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),h=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),u.longitude=this.cameraMotion.value.longitude,u.latitude=this.cameraMotion.value.latitude,u.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),s.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(le(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var p=this.locationMotion.getKeyFrameSegment(e),v=p[0],m=p[1],A=this.panoResourceFromLocationMotionKeyframe(v),y=this.panoResourceFromLocationMotionKeyframe(m),f=new d.Vector3().copy(A.position),g=new d.Vector3().copy(y.position),b=this.locationMotion.value.count-m.value.count+1;s.progress=b;for(var w=0,E=this.panoModelGroup.children;w<E.length;w++){var x=E[w];x.visible=x===A.panoModel||x===y.panoModel}A.panoModel&&(A.panoModel.material.uniforms.opacity.value=1-b,A.panoModel.material.depthTest=b!==0),y.panoModel&&(y.panoModel.material.uniforms.opacity.value=b,y.panoModel.material.depthTest=b!==1),y.panoModel&&(b<1?A.panoModel&&(s.pano0={map:A.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:A.matrix}):s.pano0={map:y.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:y.matrix},s.pano1={map:y.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:y.matrix}),h=s.useBlackTransition=y.effect==="instant"||y.effect==="montage",(y.effect==="fade"||y.effect==="montage")&&(s.pano0&&(s.pano0={map:s.pano0.map,luminanceMap:null,matrix:A.matrix.clone().setPosition(y.position)}),f.copy(g)),u.distance=this.locationMotion.value.distance,u.offset=new d.Vector3(f.x+(g.x-f.x)*b,f.y+(g.y-f.y)*b,f.z+(g.z-f.z)*b);for(var M=[],C=[],I=0,P=this.locationMotion.keyframes;I<P.length;I++){var S=P[I],F=S.key,k=S.progress;F!==void 0&&(M.push(F),k>=this.locationMotion.progress&&C.push(F))}for(var O=0,L=Object.keys(this.panoResources);O<L.length;O++){var N=L[O];if(!(C.indexOf(N)>=0)){var V=this.panoResources[N];if(V.panoModel){if(V.panoModel.material.uniforms.panoMap.value===((a=s.pano0)===null||a===void 0?void 0:a.map)||V.panoModel.material.uniforms.panoMap.value===((o=s.pano1)===null||o===void 0?void 0:o.map))continue;this.panoModelGroup.remove(V.panoModel),V.panoModel.material.uniforms.panoMap.value.dispose(),V.panoModel.dispose(),delete V.panoModel}M.indexOf(N)>=0||delete this.panoResources[N]}}this.currentPano=Ye(y.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:Ye(c.panoId),state:R(R(R(R({},Ye(l.panoId)),{mode:this.mode}),Ve(this.camera.pose)),u),options:{},progress:this.locationMotion.progress,error:null}))}St(s)===!1&&this.models.setMaterial(s),St(u)===!1&&this.setCamera(u);var j=this.works.getResolvedObserver(this.currentPano),z=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||h){if(j)for(var U=0,X=Object.keys(this.panoMeshes);U<X.length;U++){var G=X[U],K=this.panoMeshes[G];K.setOpacity(0),K.setCurrent(!1),K.updateTime&&K.updateTime(e,r)}}else if(j){var Y=Ot(j.visibleIds,function(Ae){var Fe=i.works.getResolvedObserver(Ae);return Fe?j.standingPosition.distanceTo(Fe.standingPosition):1/0},!0),H=Y[1];H=le(H,2.5,1/0);for(var J=j.visibleIds.concat(Be(this.currentPano)),ne=this.camera.getDirection(new d.Vector3),$=0,te=Object.keys(this.panoMeshes);$<te.length;$++){var G=te[$],K=this.panoMeshes[G],ae=this.works.getResolvedObserver(G);if(J.indexOf(G)===-1)K.setCurrent(!1),K.setOpacity(0);else if(!ae)K.setCurrent(!1),K.setOpacity(0);else if(!ae.loadable&&!ae.active)K.setCurrent(!1),K.setOpacity(0);else{var ce=K.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);K.setCurrent(!K.loading&&K.progress===0&&z!==null&&z.panoId===G),K.setOpacity(ce<.01?0:le(H/ce*1.2,.4,.85));var oe=this.camera.position.clone().setY(K.position.y),fe=new d.Vector3().copy(K.position).sub(oe).normalize();if(G===Be(this.currentPano)){var Ie=le((.5-oe.distanceTo(K.position))/.5,0,1);fe.multiplyScalar(1-Ie).add(ne.clone().multiplyScalar(Ie))}fe.length()>0&&K.quaternion.setFromEuler(new d.Euler(0,Math.atan2(fe.x,fe.z),0))}K.updateTime&&K.updateTime(e,r)}}}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1],i=this.panoResourceFromLocationMotionKeyframe(r),a=this.works.getResolvedObserver(i.panoId);return{mode:this.mode,workCode:a?a.work.workCode:this.currentPano.workCode,panoIndex:a?a.pano.panoIndex:this.currentPano.panoIndex,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:a?a.position.clone():this.camera.position.clone(),distance:0}},t.prototype.moveToPano=function(e,r,i){var a=this,o;r===void 0&&(r={});var s=this.works.getResolvedObserver(e);if(!s)throw new Error("panoId ".concat(JSON.stringify(e)," is not found."));this.userAction=i;var u=s.images.depth,c=R({key:"pano.".concat(s.panoId)},sr(this.imageOptions,["format","size","quality","sharpen","mappings"])),l=this.imageOptions.transform,h=s.images,p=s.position,v=s.quaternion,m=new d.Matrix4().compose(p,v,new d.Vector3(-1,1,1)),A="pano:"+fn(h);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===A)return;var y=this.pendingTextureTask.panoId,f=Ye(y);(o=this.panoMeshes[y])===null||o===void 0||o.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:f})),this.pendingTextureTask.onError(new Error("pano ".concat(JSON.stringify(f)," texture aborted")))}var g="move-to-pano-"+s.panoId;this.pending.add(g),this.pendingTextureTask={panoId:s.panoId,hash:A,onLoad:function(w){a.pending.delete(g),a.destroyed?w.body.dispose():(w.body.name=A,a.doMoveToPano(s.pano,w.body,r))},onError:function(w){a.pending.delete(g);var E=R(R(R({},s.pano),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.error",_("pano.error",{error:w,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:E})),a.emit("pano.cancel",_("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:E})),r.moveCancelCallback&&r.moveCancelCallback()}};var b=this.panoMeshes[s.panoId];b&&b.tap&&b.tap(),this.depthTextureLoader.load(u,h,{imageURL:{transform:l,options:c},position:p,matrix:m,fetcher:pt(s.work)},function(w){var E,x;((E=a.pendingTextureTask)===null||E===void 0?void 0:E.hash)===A?(a.pendingTextureTask.onLoad(w),(x=a.panoMeshes[s.panoId])===null||x===void 0||x.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:w.meta,pano:s.pano}))):w.body.dispose()},function(w){var E,x;((E=a.pendingTextureTask)===null||E===void 0?void 0:E.hash)===A&&(a.pendingTextureTask.onError(w),(x=a.panoMeshes[s.panoId])===null||x===void 0||x.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:w,progress:0,meta:null,pano:s.pano})),a.emit("error",w))},function(w){var E,x;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:w,meta:null,pano:s.pano})),((E=a.pendingTextureTask)===null||E===void 0?void 0:E.hash)===A&&((x=a.panoMeshes[s.panoId])===null||x===void 0||x.setProgress(w))},this.renderer),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:s.pano}))},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,s=t.initAnimationEndState(e),u={workCode:s.workCode,panoIndex:s.panoIndex},c=!1;e.userAction=o;var l={modelAlpha:0},h={perspToOrtho:0};e.moveToPano(u,{longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(p){c=!0,e.perspToOrthoMotion.set(h,a).catch(Q),e.modelAlphaMotion.set(l,a).catch(Q),e.emit("initAnimation.start",_("initAnimation.start",{state:p,userAction:o}))},moveEndCallback:function(p){e.emit("initAnimation.end",_("initAnimation.end",{state:p,userAction:e.userAction})),r()},moveCancelCallback:function(){var p=R(R(R({},u),{mode:e.mode}),Ve(e.camera.pose));c===!1&&e.emit("initAnimation.start",_("initAnimation.start",{state:p,userAction:e.userAction})),e.emit("initAnimation.end",_("initAnimation.end",{state:p,userAction:e.userAction})),r()}},o)})},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],u=this.panoMeshes[s];r[s]=u,delete this.panoMeshes[s]}for(var c=1,l={},h=function(x){var M=Ot(x.accessibleIds,function(I){var P=e.works.getResolvedObserver(I);if(!P)return 1/0;var S=P.standingPosition.distanceTo(x.standingPosition);return le(S,1,1/0)},!0),C=M[1];l[x.panoId]===void 0&&(l[x.panoId]=C)},p=0,v=this.works.resolvedObservers;p<v.length;p++){var m=v[p];h(m)}var A=Object.keys(l).map(function(x){return l[x]});if(A.length){var y=A.reduce(function(x,M){return x+M},0)/A.length;c=le(y*.6,1,3)}for(var f=0,g=this.works.resolvedObservers;f<g.length;f++){var m=g[f],u=void 0;r[m.panoId]?(u=r[m.panoId],u.loading===!0&&m.loadable===!1&&u.setLoading(!1),delete r[m.panoId]):(u=this.panoCircleMeshCreator(m.pano),u.name="PanoCircleMesh_"+m.panoId,this.helper.remove(u)),u.scale.set(c,1,c),u.position.copy(m.standingPosition),this.panoMeshes[m.panoId]=u}for(var b=0,w=Object.keys(r);b<w.length;b++){var E=w[b];this.helper.remove(r[E]),r[E].dispose(),delete r[E]}},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,c;i===void 0&&(i={});var l=ve(),h=vt(),p=this.works.getResolvedObserver(e);if(!p)throw new Error("panoId ".concat(JSON.stringify(e)," never found"));var v=this.panoResources[h]={panoId:p.panoId,effect:(o=i.effect)!==null&&o!==void 0?o:"fly",panoModel:r,matrix:new d.Matrix4().compose(p.position,p.quaternion,Zh),position:p.position.clone()};r.visible=!1,r.renderOrder=-1,this.panoModelGroup.add(r);var m=1,A,y,f;if(this.locationMotion.ended){var g=this.locationMotion.getKeyFrameSegment(l);g[0];var b=g[1],w=this.locationMotion.value,E=this.panoResourceFromLocationMotionKeyframe(b).position,x=v.position;A=Math.max(E.distanceTo(x),m),y=[{key:b.key,progress:0,value:R(R({},w),{count:0})},{key:h,progress:1,value:{distance:0,count:1}}],f=0}else{var M=this.locationMotion.getKeyFrameSegment(l),C=M[0],b=M[1],w=this.locationMotion.value,I=this.panoResourceFromLocationMotionKeyframe(C).position,E=this.panoResourceFromLocationMotionKeyframe(b).position,x=v.position,P=b.value.count-w.count,S=Math.max(I.distanceTo(E),m)*P,F=Math.max(E.distanceTo(x),m);A=S+F,y=[{key:C.key,progress:0,value:R({},w)},{key:b.key,progress:S/A,value:b.value},{key:h,progress:1,value:{count:b.value.count+1,distance:0}}];var k=this.locationMotionKeyframesLength(this.locationMotion.keyframes),O=this.locationMotionKeyframesLength(y);k===0||k===0?f=0:f=this.locationMotion.getProgressVelocity(l)*k/O}var L=this.calculateMovingDuration(i.duration,i.effect==="fade"||i.effect==="montage"?0:A),N={longitude:i.longitude,latitude:i.latitude,fov:i.fov},V=R(R({},e),{mode:this.mode,longitude:(s=N.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(u=N.latitude)!==null&&u!==void 0?u:this.camera.pose.latitude,fov:(c=N.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:p.position.clone(),distance:this.camera.pose.distance}),j=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:j,progress:0,state:V,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(V),this.cameraMotion.set(N,L).catch(Q);var z=this.locationMotion.setKeyframes(y,L,f);z.then(function(){var U=R(R({},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:U,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(U)},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:j,progress:0,state:V,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.camera.getDirection(new d.Vector3),a=this.camera.position.clone(),o=this.works.getResolvedObserver(this.currentPano);if(!o)return null;var s=o.accessibleIds.filter(function(g){if(g===Be(r.currentPano))return!1;var b=r.works.getResolvedObserver(g);if(!b)return!1;var w=b.standingPosition.clone().sub(a);return w.length()===0||w.angleTo(new d.Vector3(0,-1,0))<Math.PI/12?!1:b.loadable||b.active}),u=(e?e.ray.direction.clone():i.clone()).setY(0);if(u.length()===0)return null;for(var c=s.slice().sort(function(g,b){var w=r.works.getResolvedObserver(g).position.clone().setY(a.y),E=r.works.getResolvedObserver(b).position.clone().setY(a.y);return w.distanceTo(a)-E.distanceTo(a)}),l=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];l<h.length;l++)for(var p=h[l],v=0,m=c;v<m.length;v++){var A=m[v],y=this.works.getResolvedObserver(A);if(y){var f=y.position.clone().setY(a.y).sub(a);if(f&&f.length()!==0&&u.angleTo(f)<p)return y}}return null},t.prototype.onTapGesture=function(e){var r=this,i;this.userAction=e.userAction,this.stopMomentumMovement();var a=e.center.raycaster,o=this.camera.getDirection(new d.Vector3).setY(0),s=null,u=this.works.getResolvedObserver(this.currentPano);if(u){var c=u.accessibleIds.filter(function(X){if(X===Be(r.currentPano))return!1;var G=r.works.getResolvedObserver(X);return!G||G.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:G.loadable||G.active}),l=a.intersectObject(this.boundingMesh,!0)[0];if(l){var h=Ot(c,function(X){var G=r.works.getResolvedObserver(X).standingPosition.clone(),K=G.clone().sub(r.camera.position).setY(0).angleTo(o);return K>Math.PI/2?1/0:G.distanceTo(l.point)},!0),p=h[0],v=h[1];p&&v<this.panoTapTriggerRadius&&(s=(i=this.works.getResolvedObserver(p))!==null&&i!==void 0?i:null)}s||(s=this.getForwardObserverOrNot(a));for(var m=0,A=this.locationMotion.keyframes;m<A.length;m++){var y=A[m],f=this.panoResourceFromLocationMotionKeyframe(y);if(!(y.progress<this.locationMotion.progress)&&s&&f.panoId===s.panoId){s=null;break}}if(!s)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var g={},b=Math.PI/6,w=Math.PI/12,E=new d.Vector3(0,1,0),x=s.position.clone().setY(0).sub(u.position.clone().setY(0)).normalize(),M=x.clone().applyAxisAngle(E,b),C=x.clone().applyAxisAngle(E,-b),I=[],P=[],S=[],F=0,k=s.accessibleIds;F<k.length;F++){var p=k[F],O=Ye(p);if(!(Ft(O,this.currentPano)||Ft(O,s.pano))){var L=this.works.getResolvedObserver(p);if(L){var N=L.position.clone().sub(s.position).setY(0);x.angleTo(N)<b?S.push(N):M.angleTo(N)<b?I.push(N):C.angleTo(N)<b&&P.push(N)}}}var V=S.length>0?S:at(at([],I,!0),P,!0),j=V.slice().sort(function(X,G){return X.angleTo(x)-G.angleTo(x)})[0];j&&j.angleTo(o)>w&&(g.longitude=Math.atan2(-j.x,-j.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(g.latitude=le(0,this.minLatitude,this.maxLatitude));var z=R({},e.state);if(z.workCode=s.pano.workCode,z.panoIndex=s.pano.panoIndex,g.longitude!==void 0&&(z.longitude=g.longitude),g.latitude!==void 0&&(z.latitude=g.latitude),g.fov!==void 0&&(z.fov=g.fov),z.distance=0,z.offset=s?s.position.clone():new d.Vector3,e.state=z,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:z,userAction:e.userAction,options:g,progress:0,error:null})),s&&!s.active){var U=s.panoId;this.panoMeshes[U]&&(this.panoMeshes[U].setDisabled(!1),this.panoMeshes[U].setLoading(!0))}s&&s.active&&this.emit("pano.request",_("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:z,options:g,error:null}))}}}},t}(to);const ep=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-
|
|
1827
|
+
b-J-HrpA-z]|vv|{-J-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H\f`),tp=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-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
|
|
1834
1834
|
-<<-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
|
|
1835
|
-
----qvpnqH--\f\f`);var
|
|
1836
|
-
`,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+
|
|
1835
|
+
----qvpnqH--\f\f`);var rp=function(n){de(t,n);function t(e){var r=n.call(this)||this;return r.uniforms={screenWidth:Qt("f",0),screenHeight:Qt("f",0),edlStrength:Qt("f",1),uNear:Qt("f",1),uFar:Qt("f",1),radius:Qt("f",1),neighbours:Qt("2fv",new Float32Array),depthMap:Qt("t",new d.Texture),uEDLColor:Qt("t",new d.Texture),uEDLDepth:Qt("t",new d.Texture),opacity:Qt("f",1),uProj:Qt("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+`
|
|
1836
|
+
`,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+ep,r=this.getDefines()+tp;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Pt([Yt("screenWidth"),Bt("design:type",Number)],t.prototype,"screenWidth",void 0),Pt([Yt("screenHeight"),Bt("design:type",Number)],t.prototype,"screenHeight",void 0),Pt([Yt("edlStrength"),Bt("design:type",Number)],t.prototype,"edlStrength",void 0),Pt([Yt("uNear"),Bt("design:type",Number)],t.prototype,"uNear",void 0),Pt([Yt("uFar"),Bt("design:type",Number)],t.prototype,"uFar",void 0),Pt([Yt("radius"),Bt("design:type",Number)],t.prototype,"radius",void 0),Pt([Yt("neighbours",!0),Bt("design:type",Float32Array)],t.prototype,"neighbours",void 0),Pt([Yt("depthMap"),Bt("design:type",d.Texture)],t.prototype,"depthMap",void 0),Pt([Yt("uEDLColor"),Bt("design:type",d.Texture)],t.prototype,"uEDLColor",void 0),Pt([Yt("uEDLDepth"),Bt("design:type",d.Texture)],t.prototype,"uEDLDepth",void 0),Pt([Yt("uProj"),Bt("design:type",Array)],t.prototype,"uProj",void 0),t}(d.RawShaderMaterial);function Qt(n,t){return{type:n,value:t}}function Yt(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 np=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 n0=new d.Mesh(oo),i0=new d.Scene;i0.add(n0);var ip=function(n){de(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 rp,n0.material=o.material,o}return t.prototype.render=function(e){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 u=new Float32Array(this.material.neighbourCount*2),c=0;c<this.material.neighbourCount;c++)u[2*c+0]=Math.cos(2*c*Math.PI/this.material.neighbourCount),u[2*c+1]=Math.sin(2*c*Math.PI/this.material.neighbourCount);i.neighbours.value=u,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(null),this.renderer.render(i0,np)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Bi);const ap=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-
|
|
1837
1837
|
sy|n-qr}u-J-r\x07r?Q5Qr}uZn}9-b6;Hvs5qr}u-KJ->;=6
|
|
1838
|
-
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`),
|
|
1839
|
-
b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var cp=function(n){de(t,n);function t(e){var r=n.call(this,{vertexShader:lp,fragmentShader:up})||this;return r.uniforms={uDepthMap:Fs("t",null),uWeightMap:Fs("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}},Pt([Os("uDepthMap"),Bt("design:type",Number)],t.prototype,"uDepthMap",void 0),Pt([Os("uWeightMap"),Bt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(d.RawShaderMaterial);function Fs(n,t){return{type:n,value:t}}function Os(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 dp=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 s0=new d.Mesh(lo),u0=new d.Scene;u0.add(s0);var fp=function(n){de(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 cp,o.scene=r,o.camera=i,s0.material=o.material,o}return t.prototype.render=function(e){var r=this.material.uniforms;this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.renderer.setRenderTarget(e[1]),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.setClearAlpha(0),this.renderer.render(this.scene,this.camera),r.uWeightMap.value=e[1].texture,r.uDepthMap.value=e[0].depthTexture,this.renderer.setRenderTarget(null),this.renderer.autoClearDepth=!0,this.renderer.setClearAlpha(1),this.renderer.render(u0,dp),this.models.setMaterial({useHQWeight:!1,useHQDepth:!0}),this.models.update(this.renderer,this.camera,"Mapview")},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Bi),ua=.5,la=0,hp=function(n){de(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.locationMotion=new we({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 we({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new we({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,{minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(1024,1024,d.UnsignedIntType)}),r.edlEffect=new sp(r.renderer,r.scene,r.camera,r.models),r.hqEffect=new fp(r.renderer,r.scene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,u;if(e instanceof t)return e;var c=n.parseArgs.call(this,e);return R(R({},c),{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,intersectMeshCreator:(u=e.intersectMeshCreator)!==null&&u!==void 0?u:function(){return new Si}})},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,u,c,l=this.parseArgs(e),h=l.works,p=l.models,v=e.initial,m=v.state,A=v.currentState,y=typeof m.panoIndex=="number"?{workCode:(a=(r=m.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:m.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},f=h.getResolvedObserver(y),g=(o=m.fov)!==null&&o!==void 0?o:60,b=le((s=m.latitude)!==null&&s!==void 0?s:Pa(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),w=t.distanceFromModel(l.models,g,l.camera.aspect),E=new d.Vector3,x=(u=m.distance)!==null&&u!==void 0?u:Math.min(l.defaultDistance,w),M=(c=m.longitude)!==null&&c!==void 0?c:Pa(A.mode)?A.longitude:l.defaultLongitude;return m.offset?E.copy(m.offset):l.defaultDistance<w&&f?(E.copy(f.position),m.longitude===void 0&&(M=A.longitude)):E.copy(p.bounding.getCenter(E)),p.bounding.containsPoint(E)||p.bounding.getCenter(E),R(R({},y),{mode:"Mapview",longitude:M,latitude:b,fov:g,offset:E,distance:x})},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(R(R({},this),{initial:{currentState:R(R({},this.currentPano),this.camera.pose),duration:i,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},u={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(u,i).catch(Q),this.cameraMotion.set(s,i).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=[],u=0,c=e;u<c.length;u++){var l=c[u];o.push({key:l.key,progress:l.progress,value:{distance:l.value.distance,x:l.value.offset.x,y:l.value.offset.x,z:l.value.offset.x}}),s.push({key:l.key,progress:l.progress,value:{longitude:l.value.longitude,latitude:l.value.latitude,fov:l.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.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;var o=Math.PI/2-a.latitude<.02?1:0;this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(Q)}this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(le(this.perspToOrthoMotion.value.perspToOrtho,0,1))),St(i)||this.models.setMaterial(i),St(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return R(R({},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),u={longitude:s.longitude,latitude:s.latitude,fov:s.fov},c={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},l={modelAlpha:1},h={perspToOrtho:0};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(h,a).catch(Q),e.modelAlphaMotion.set(l,a/3).catch(Q),e.cameraMotion.set(u,a).catch(Q),e.locationMotion.set(c,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var v=R(R(R({},e.currentPano),{mode:e.mode}),Ve(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:v,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this.models.intersectRaycaster(e)[0];if(!r)return null;var i=this.works.resolvedObservers,a=Ot(i,function(u){return u.standingPosition.distanceTo(r.point)},!0),o=a[0],s=a[1];return o&&s<10?o: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=R({},i),u={longitude:0,latitude:0,x:0,y:0,z:0},c=0;c<a;c++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,u.longitude+=s.longitude,u.latitude+=s.latitude,u.x+=s.x,u.y+=s.y,u.z+=s.z;var l=Nr(this.cameraMotion.value.longitude+u.longitude),h=le(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=le(this.locationMotion.value.x+u.x,this.models.bounding.min.x,this.models.bounding.max.x),v=le(this.locationMotion.value.y+u.y,this.models.bounding.min.y,this.models.bounding.max.y),m=le(this.locationMotion.value.z+u.z,this.models.bounding.min.z,this.models.bounding.max.z),A=R(R({},this.currentPano),{mode:this.mode,longitude:l,latitude:h,offset:new d.Vector3(p,v,m),fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),y=!(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),f=_("gesture.momentum",R(R({},e),{isFirst:r,isFinal:y,state:A}));if(this.inMomentumMovement.event=f,this.emit("gesture.momentum",f),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:l,latitude:h},0).catch(Q),this.locationMotion.set({x:A.offset.x,y:A.offset.y,z:A.offset.z},0).catch(Q),y?this.inMomentumMovement=null:it.shared.add(function(g,b){o.requestMomentumMovement(e,!1,s,b|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=Rr(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=ua;var o=this.models.intersectRaycaster(a)[0];if(!o&&a.ray.direction.y<-.3){var s=new d.Plane(new d.Vector3(0,1,0),0),u=a.ray.intersectPlane(s,new d.Vector3);if(u){var c=u.distanceTo(a.ray.origin);c<1e4&&c>=a.near&&(o={distance:c,floor:0,point:u,object:this.scene,face:null})}}o&&(e.distance=le(o.distance,la,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),u=new d.Raycaster;u.params.Points={threshold:.1},u.setFromCamera(s,this.camera),u.near=ua,o=new d.Vector3().copy(u.ray.direction).multiplyScalar(3).add(u.ray.origin);var c=this.models.intersectRaycaster(u)[0];if(!c&&u.ray.direction.y<-.3){var l=new d.Plane(new d.Vector3(0,1,0),0),h=u.ray.intersectPlane(l,new d.Vector3);if(h){var p=h.distanceTo(u.ray.origin);p<1e4&&p>=u.near&&(c={distance:p,floor:0,point:h,object:this.scene})}}if(c)o.copy(c.point);else{var v=new d.Vector3().copy(this.camera.pose.offset).sub(this.camera.position),l=new d.Plane().setFromNormalAndCoplanarPoint(v,this.camera.pose.offset);u.ray.intersectPlane(l,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>"u"||i.pointerLength!==r)){var m=r>1||a===2;if(m){var A={x:e.center.x-i.x,y:e.center.y-i.y},y=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),f=Rr(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(y),g=new d.Vector3().copy(f).sub(i.target).length();g*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var b=this.renderer.getSize(new d.Vector2),w=2*A.x*g/b.y,E=2*A.y*g/b.y,x=new d.Vector3;x.setFromMatrixColumn(this.camera.matrix,0),x.multiplyScalar(-w),y.add(x),this.camera.pose.latitude<Math.PI/12?x.setFromMatrixColumn(this.camera.matrix,1):(x.setFromMatrixColumn(this.camera.matrix,0),x.crossVectors(this.camera.up,x)),x.multiplyScalar(E),y.add(x),y.clamp(this.models.bounding.min,this.models.bounding.max);var M=R(R({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:y,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),this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(Q)),e.isFinal){var C=this.renderer.getSize(new d.Vector2),I=2*e.velocityX*g/C.y,P=2*e.velocityY*g/C.y,S=new d.Vector3,F=new d.Vector3;S.setFromMatrixColumn(this.camera.matrix,0),S.multiplyScalar(-I),F.add(S),this.camera.pose.latitude<Math.PI/4?S.setFromMatrixColumn(this.camera.matrix,1):(S.setFromMatrixColumn(this.camera.matrix,0),S.crossVectors(this.camera.up,S)),S.multiplyScalar(P),F.add(S),this.inMomentumMovement={uuid:vt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:F.x,y:F.y,z:F.z},0)}}else{var A={x:e.center.x-i.x,y:e.center.y-i.y},k=this.coordinatesForOffset(A),O=Nr(this.cameraMotion.value.longitude+k.longitude),L=le(this.cameraMotion.value.latitude+k.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 M=R(R({},this.currentPano),{mode:this.mode,longitude:O,latitude:L,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&this.fixFinalState(M),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 N=e.velocityX,V=e.velocityY;this.inMomentumMovement={uuid:vt()},this.requestMomentumMovement(e,!0,R(R({},this.coordinatesForOffset({x:N,y:V})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var r;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(e.isFinal){delete this.panState,delete this.pinchState;return}if(!(typeof i>"u")){this.models.bounding.getCenter(new d.Vector3);var a=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect)*1.3,o=le(i/e.scale,la,1/0),s=e.state.offset.clone().sub(Rr(e.state).setLength(o)),u=this.models.bounding.containsPoint(s),c;!u&&this.pinchState&&this.pinchState.scale>e.scale&&o>a?c=e.state.distance:(c=o,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)))}},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=ua,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,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(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),c=u.clone().multiplyScalar(.05),l=o.point.clone().add(c);this.intersectMesh.position.copy(l);var h=l.clone().add(c);if(this.intersectMesh.lookAt(h),Math.abs(u.y)>.99){var p=this.camera.position.clone().sub(l);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.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),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect)*1.3,s=le(this.locationMotion.value.distance-a,la,1/0),u=e.state.offset.clone().sub(Rr(e.state).setLength(s)),c=this.models.bounding.containsPoint(u),l=!c&&a<0&&s>o?e.state.distance:s;if(e.state.distance=s,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:l},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=R(R({},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 u=this.currentTapId=vt();this.preloadPano(a.pano).then(function(c){r.currentTapId===u&&r.emit("pano.request",_("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.postProcessing=function(e,r){var i;if(!this.destroyed){if(r==="edl")return this.edlEffect.render(e);if(r==="hq")return(i=this.hqEffect)===null||i===void 0?void 0:i.render(e)}},t}(ro);function ks(n){return n==null}var pp={type:"move"},Ls=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,u=this._grip,c=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(pp))),c&&t.hand){o=!0;for(var l=0,h=t.hand.values();l<h.length;l++){var p=h[l],v=e.getJointPose(p,r);if(c.joints[p.jointName]===void 0){var m=new d.Group;m.matrixAutoUpdate=!1,m.visible=!1,c.joints[p.jointName]=m,c.add(m)}var A=c.joints[p.jointName];v!==null&&(A.matrix.fromArray(v.transform.matrix),A.matrix.decompose(A.position,A.rotation,A.scale),A.jointRadius=v.radius),A.visible=v!==null}var y=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],g=y.position.distanceTo(f.position),b=.02,w=.005;c.inputState.pinching&&g>b+w?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&g<=b-w&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else u!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(u.matrix.fromArray(a.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),a.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(a.linearVelocity)):u.hasLinearVelocity=!1,a.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(a.angularVelocity)):u.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),u!==null&&(u.visible=a!==null),c!==null&&(c.visible=o!==null),this},n}(),vp=1,Ap=function(){function n(t,e,r){var i,a,o,s,u;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0,this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:"Pico",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=(u=r==null?void 0:r.onSessionEnd)!==null&&u!==void 0?u:Q,this.controllers=[new Ls,new Ls],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),u=a[14]/(a[10]+1),c=(a[9]+1)/a[5],l=(a[9]-1)/a[5],h=(a[8]-1)/a[0],p=(o[8]+1)/o[0],v=s*h,m=s*p,A=i/(-h+p),y=A*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(y),t.translateZ(A),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var f=s+A,g=u+A,b=v-y,w=m+(i-y),E=c*u/g*f,x=l*u/g*f;t.projectionMatrix.makePerspective(b,w,E,x,f,g)},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,it.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:vp};if(!e.session){console.error("session is lose while set session!");return}switch(e.machineType){case"Pico":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;case"Oculus":e.session.updateRenderState({layers:[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}(),co=function(n){de(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,u=e.count;s<u;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(co.prototype,{isLineSegmentsGeometry:!0});var ca={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:`
|
|
1838
|
+
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`),op=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-
|
|
1839
|
+
b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var sp=function(n){de(t,n);function t(e){var r=n.call(this,{vertexShader:op,fragmentShader:ap})||this;return r.uniforms={uDepthMap:Bs("t",null),uWeightMap:Bs("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}},Pt([Rs("uDepthMap"),Bt("design:type",Number)],t.prototype,"uDepthMap",void 0),Pt([Rs("uWeightMap"),Bt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(d.RawShaderMaterial);function Bs(n,t){return{type:n,value:t}}function Rs(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 up=new d.OrthographicCamera(-1,1,1,-1,0,1),so=new d.BufferGeometry;so.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));so.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var a0=new d.Mesh(so),o0=new d.Scene;o0.add(a0);var lp=function(n){de(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 sp,o.scene=r,o.camera=i,a0.material=o.material,o}return t.prototype.render=function(e){var r=this.material.uniforms;this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.renderer.setRenderTarget(e[1]),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.setClearAlpha(0),this.renderer.render(this.scene,this.camera),r.uWeightMap.value=e[1].texture,r.uDepthMap.value=e[0].depthTexture,this.renderer.setRenderTarget(null),this.renderer.autoClearDepth=!0,this.renderer.setClearAlpha(1),this.renderer.render(o0,up),this.models.setMaterial({useHQWeight:!1,useHQDepth:!0}),this.models.update(this.renderer,this.camera,"Mapview")},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Bi),ua=.5,la=0,cp=function(n){de(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.locationMotion=new we({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 we({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new we({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,{minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(1024,1024,d.UnsignedIntType)}),r.edlEffect=new ip(r.renderer,r.scene,r.camera,r.models),r.hqEffect=new lp(r.renderer,r.scene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,u;if(e instanceof t)return e;var c=n.parseArgs.call(this,e);return R(R({},c),{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,intersectMeshCreator:(u=e.intersectMeshCreator)!==null&&u!==void 0?u:function(){return new Si}})},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,u,c,l=this.parseArgs(e),h=l.works,p=l.models,v=e.initial,m=v.state,A=v.currentState,y=typeof m.panoIndex=="number"?{workCode:(a=(r=m.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:m.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},f=h.getResolvedObserver(y),g=(o=m.fov)!==null&&o!==void 0?o:60,b=le((s=m.latitude)!==null&&s!==void 0?s:Pa(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),w=t.distanceFromModel(l.models,g,l.camera.aspect),E=new d.Vector3,x=(u=m.distance)!==null&&u!==void 0?u:Math.min(l.defaultDistance,w),M=(c=m.longitude)!==null&&c!==void 0?c:Pa(A.mode)?A.longitude:l.defaultLongitude;return m.offset?E.copy(m.offset):l.defaultDistance<w&&f?(E.copy(f.position),m.longitude===void 0&&(M=A.longitude)):E.copy(p.bounding.getCenter(E)),p.bounding.containsPoint(E)||p.bounding.getCenter(E),R(R({},y),{mode:"Mapview",longitude:M,latitude:b,fov:g,offset:E,distance:x})},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(R(R({},this),{initial:{currentState:R(R({},this.currentPano),this.camera.pose),duration:i,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},u={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(u,i).catch(Q),this.cameraMotion.set(s,i).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=[],u=0,c=e;u<c.length;u++){var l=c[u];o.push({key:l.key,progress:l.progress,value:{distance:l.value.distance,x:l.value.offset.x,y:l.value.offset.x,z:l.value.offset.x}}),s.push({key:l.key,progress:l.progress,value:{longitude:l.value.longitude,latitude:l.value.latitude,fov:l.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.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;var o=Math.PI/2-a.latitude<.02?1:0;this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(Q)}this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(le(this.perspToOrthoMotion.value.perspToOrtho,0,1))),St(i)||this.models.setMaterial(i),St(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return R(R({},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),u={longitude:s.longitude,latitude:s.latitude,fov:s.fov},c={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},l={modelAlpha:1},h={perspToOrtho:0};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(h,a).catch(Q),e.modelAlphaMotion.set(l,a/3).catch(Q),e.cameraMotion.set(u,a).catch(Q),e.locationMotion.set(c,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(p){var v=R(R(R({},e.currentPano),{mode:e.mode}),Ve(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:v,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this.models.intersectRaycaster(e)[0];if(!r)return null;var i=this.works.resolvedObservers,a=Ot(i,function(u){return u.standingPosition.distanceTo(r.point)},!0),o=a[0],s=a[1];return o&&s<10?o: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=R({},i),u={longitude:0,latitude:0,x:0,y:0,z:0},c=0;c<a;c++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,u.longitude+=s.longitude,u.latitude+=s.latitude,u.x+=s.x,u.y+=s.y,u.z+=s.z;var l=Nr(this.cameraMotion.value.longitude+u.longitude),h=le(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),p=le(this.locationMotion.value.x+u.x,this.models.bounding.min.x,this.models.bounding.max.x),v=le(this.locationMotion.value.y+u.y,this.models.bounding.min.y,this.models.bounding.max.y),m=le(this.locationMotion.value.z+u.z,this.models.bounding.min.z,this.models.bounding.max.z),A=R(R({},this.currentPano),{mode:this.mode,longitude:l,latitude:h,offset:new d.Vector3(p,v,m),fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),y=!(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),f=_("gesture.momentum",R(R({},e),{isFirst:r,isFinal:y,state:A}));if(this.inMomentumMovement.event=f,this.emit("gesture.momentum",f),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:l,latitude:h},0).catch(Q),this.locationMotion.set({x:A.offset.x,y:A.offset.y,z:A.offset.z},0).catch(Q),y?this.inMomentumMovement=null:it.shared.add(function(g,b){o.requestMomentumMovement(e,!1,s,b|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=Rr(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=ua;var o=this.models.intersectRaycaster(a)[0];if(!o&&a.ray.direction.y<-.3){var s=new d.Plane(new d.Vector3(0,1,0),0),u=a.ray.intersectPlane(s,new d.Vector3);if(u){var c=u.distanceTo(a.ray.origin);c<1e4&&c>=a.near&&(o={distance:c,floor:0,point:u,object:this.scene,face:null})}}o&&(e.distance=le(o.distance,la,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),u=new d.Raycaster;u.params.Points={threshold:.1},u.setFromCamera(s,this.camera),u.near=ua,o=new d.Vector3().copy(u.ray.direction).multiplyScalar(3).add(u.ray.origin);var c=this.models.intersectRaycaster(u)[0];if(!c&&u.ray.direction.y<-.3){var l=new d.Plane(new d.Vector3(0,1,0),0),h=u.ray.intersectPlane(l,new d.Vector3);if(h){var p=h.distanceTo(u.ray.origin);p<1e4&&p>=u.near&&(c={distance:p,floor:0,point:h,object:this.scene})}}if(c)o.copy(c.point);else{var v=new d.Vector3().copy(this.camera.pose.offset).sub(this.camera.position),l=new d.Plane().setFromNormalAndCoplanarPoint(v,this.camera.pose.offset);u.ray.intersectPlane(l,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>"u"||i.pointerLength!==r)){var m=r>1||a===2;if(m){var A={x:e.center.x-i.x,y:e.center.y-i.y},y=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),f=Rr(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(y),g=new d.Vector3().copy(f).sub(i.target).length();g*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var b=this.renderer.getSize(new d.Vector2),w=2*A.x*g/b.y,E=2*A.y*g/b.y,x=new d.Vector3;x.setFromMatrixColumn(this.camera.matrix,0),x.multiplyScalar(-w),y.add(x),this.camera.pose.latitude<Math.PI/12?x.setFromMatrixColumn(this.camera.matrix,1):(x.setFromMatrixColumn(this.camera.matrix,0),x.crossVectors(this.camera.up,x)),x.multiplyScalar(E),y.add(x),y.clamp(this.models.bounding.min,this.models.bounding.max);var M=R(R({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:y,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),this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(Q)),e.isFinal){var C=this.renderer.getSize(new d.Vector2),I=2*e.velocityX*g/C.y,P=2*e.velocityY*g/C.y,S=new d.Vector3,F=new d.Vector3;S.setFromMatrixColumn(this.camera.matrix,0),S.multiplyScalar(-I),F.add(S),this.camera.pose.latitude<Math.PI/4?S.setFromMatrixColumn(this.camera.matrix,1):(S.setFromMatrixColumn(this.camera.matrix,0),S.crossVectors(this.camera.up,S)),S.multiplyScalar(P),F.add(S),this.inMomentumMovement={uuid:vt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:F.x,y:F.y,z:F.z},0)}}else{var A={x:e.center.x-i.x,y:e.center.y-i.y},k=this.coordinatesForOffset(A),O=Nr(this.cameraMotion.value.longitude+k.longitude),L=le(this.cameraMotion.value.latitude+k.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 M=R(R({},this.currentPano),{mode:this.mode,longitude:O,latitude:L,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&this.fixFinalState(M),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 N=e.velocityX,V=e.velocityY;this.inMomentumMovement={uuid:vt()},this.requestMomentumMovement(e,!0,R(R({},this.coordinatesForOffset({x:N,y:V})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var r;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(e.isFinal){delete this.panState,delete this.pinchState;return}if(!(typeof i>"u")){this.models.bounding.getCenter(new d.Vector3);var a=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect)*1.3,o=le(i/e.scale,la,1/0),s=e.state.offset.clone().sub(Rr(e.state).setLength(o)),u=this.models.bounding.containsPoint(s),c;!u&&this.pinchState&&this.pinchState.scale>e.scale&&o>a?c=e.state.distance:(c=o,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)))}},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=ua,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,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var u=(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),c=u.clone().multiplyScalar(.05),l=o.point.clone().add(c);this.intersectMesh.position.copy(l);var h=l.clone().add(c);if(this.intersectMesh.lookAt(h),Math.abs(u.y)>.99){var p=this.camera.position.clone().sub(l);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.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),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect)*1.3,s=le(this.locationMotion.value.distance-a,la,1/0),u=e.state.offset.clone().sub(Rr(e.state).setLength(s)),c=this.models.bounding.containsPoint(u),l=!c&&a<0&&s>o?e.state.distance:s;if(e.state.distance=s,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:l},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=R(R({},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 u=this.currentTapId=vt();this.preloadPano(a.pano).then(function(c){r.currentTapId===u&&r.emit("pano.request",_("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.postProcessing=function(e,r){var i;if(!this.destroyed){if(r==="edl")return this.edlEffect.render(e);if(r==="hq")return(i=this.hqEffect)===null||i===void 0?void 0:i.render(e)}},t}(eo);function Fs(n){return n==null}var dp={type:"move"},Os=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,u=this._grip,c=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(dp))),c&&t.hand){o=!0;for(var l=0,h=t.hand.values();l<h.length;l++){var p=h[l],v=e.getJointPose(p,r);if(c.joints[p.jointName]===void 0){var m=new d.Group;m.matrixAutoUpdate=!1,m.visible=!1,c.joints[p.jointName]=m,c.add(m)}var A=c.joints[p.jointName];v!==null&&(A.matrix.fromArray(v.transform.matrix),A.matrix.decompose(A.position,A.rotation,A.scale),A.jointRadius=v.radius),A.visible=v!==null}var y=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],g=y.position.distanceTo(f.position),b=.02,w=.005;c.inputState.pinching&&g>b+w?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&g<=b-w&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else u!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(u.matrix.fromArray(a.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),a.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(a.linearVelocity)):u.hasLinearVelocity=!1,a.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(a.angularVelocity)):u.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),u!==null&&(u.visible=a!==null),c!==null&&(c.visible=o!==null),this},n}(),fp=1,hp=function(){function n(t,e,r){var i,a,o,s,u;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0,this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:"Pico",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=(u=r==null?void 0:r.onSessionEnd)!==null&&u!==void 0?u:Q,this.controllers=[new Os,new Os],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),u=a[14]/(a[10]+1),c=(a[9]+1)/a[5],l=(a[9]-1)/a[5],h=(a[8]-1)/a[0],p=(o[8]+1)/o[0],v=s*h,m=s*p,A=i/(-h+p),y=A*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(y),t.translateZ(A),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var f=s+A,g=u+A,b=v-y,w=m+(i-y),E=c*u/g*f,x=l*u/g*f;t.projectionMatrix.makePerspective(b,w,E,x,f,g)},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,it.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:fp};if(!e.session){console.error("session is lose while set session!");return}switch(e.machineType){case"Pico":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;case"Oculus":e.session.updateRenderState({layers:[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}(),uo=function(n){de(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,u=e.count;s<u;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(uo.prototype,{isLineSegmentsGeometry:!0});var ca={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:`
|
|
1840
1840
|
#include <common>
|
|
1841
1841
|
#include <color_pars_vertex>
|
|
1842
1842
|
#include <fog_pars_vertex>
|
|
@@ -2035,7 +2035,7 @@ void main() {
|
|
|
2035
2035
|
#include <premultiplied_alpha_fragment>
|
|
2036
2036
|
|
|
2037
2037
|
}
|
|
2038
|
-
`},fo=function(n){de(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(ca.uniforms),vertexShader:ca.vertexShader,fragmentShader:ca.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(fo.prototype,{isLineMaterial:!0});var l0=function(n){de(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new co,i.material=r!==void 0?r:new fo({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,u=0,c=0,l=r.count;u<l;u++,c+=2)o.fromBufferAttribute(r,u),s.fromBufferAttribute(i,u),a[c]=c===0?0:a[c-1],a[c+1]=a[c]+o.distanceTo(s);var h=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(h,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(h,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,u=this.material,c=u.resolution,l=u.linewidth,h=s.attributes.instanceStart,p=s.attributes.instanceEnd,v=new d.Vector4,m=new d.Vector4,A=new d.Vector4,y=new d.Vector3,f=new d.Matrix4,g=new d.Line3,b=new d.Vector3;i.at(1,A),A.w=1,A.applyMatrix4(a.matrixWorldInverse),A.applyMatrix4(o),A.multiplyScalar(1/A.w),A.x*=c.x/2,A.y*=c.y/2,A.z=0,y.copy(A);var w=this.matrixWorld;f.multiplyMatrices(a.matrixWorldInverse,w);for(var E=0,x=h.count;E<x;E++){v.fromBufferAttribute(h,E),m.fromBufferAttribute(p,E),v.w=1,m.w=1,v.applyMatrix4(f),m.applyMatrix4(f),v.applyMatrix4(o),m.applyMatrix4(o),v.multiplyScalar(1/v.w),m.multiplyScalar(1/m.w);var M=v.z<-1&&m.z<-1,C=v.z>1&&m.z>1;if(!(M||C)){v.x*=c.x/2,v.y*=c.y/2,m.x*=c.x/2,m.y*=c.y/2,g.start.copy(v),g.start.z=0,g.end.copy(m),g.end.z=0;var I=g.closestPointToPointParameter(y,!0);g.at(I,b);var P=d.MathUtils.lerp(v.z,m.z,I),S=P>=-1&&P<=1,F=y.distanceTo(b)<l*.5;if(S&&F){g.start.fromBufferAttribute(h,E),g.end.fromBufferAttribute(p,E),g.start.applyMatrix4(w),g.end.applyMatrix4(w);var k=new d.Vector3,O=new d.Vector3;i.distanceSqToSegment(g.start,g.end,O,k),r.push({point:O,pointOnLine:k,distance:i.origin.distanceTo(O),object:this,faceIndex:E})}}}},t}(d.Mesh);Object.assign(l0.prototype,{isLineSegments2:!0});var c0=function(n){de(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(l0);Object.assign(c0.prototype,{isLine2:!0});var d0=function(n){de(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}(co);Object.assign(d0.prototype,{isLineGeometry:!0});var mp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYL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de(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 d0,o=new fo({color:Ds,linewidth:yp,dashScale:bp,dashed:!1});i.line=new c0(a,o);var s=new d.BufferGeometry,u=new d.PointsMaterial({color:Ds,size:gp,map:Ns||(Ns=new d.TextureLoader().load(mp)),sizeAttenuation:!1,transparent:!0});return i.points=new d.Points(s,u),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.0.0-alpha.64"},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(Oa.prototype,{isFiveLine:!0});var _e={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 f0(n){return Mi(this,void 0,void 0,function(){var t;return Ci(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 wp(n){return Mi(this,void 0,void 0,function(){var t,e;return Ci(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,f0("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function Ep(n,t,e,r){return e===void 0&&(e=null),r===void 0&&(r=!0),Mi(this,void 0,void 0,function(){var i,a,o,s,u,c;return Ci(this,function(l){switch(l.label){case 0:if(!n)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");return[4,wp(t)];case 1:if(i=l.sent(),n.profiles.some(function(h){var p=i[h];return p&&(a={profileId:h,profilePath:"".concat(t,"/").concat(p.path),deprecated:!!p.deprecated}),!!a}),!a){if(!e)throw new Error("No matching profile name found");if(o=i[e],!o)throw new Error('No matching profile name found and default profile "'.concat(e,'" missing.'));a={profileId:e,profilePath:"".concat(t,"/").concat(o.path),deprecated:!!o.deprecated}}return[4,f0(a.profilePath)];case 2:if(s=l.sent(),r){if(c=void 0,c=s.layouts[n.handedness],!c)throw new Error("No matching handedness, ".concat(n.handedness,", in profile ").concat(a.profileId));c.assetPath&&(u=a.profilePath.replace("profile.json",c.assetPath))}return[2,{profile:s,assetPath:u}]}})})}var xp={xAxis:0,yAxis:0,button:0,state:_e.ComponentState.DEFAULT};function Mp(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 Cp=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===_e.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(xp)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=Mp(e,r),s=o.normalizedXAxis,u=o.normalizedYAxis;switch(this.componentProperty){case _e.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case _e.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?u:.5;break;case _e.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case _e.ComponentProperty.STATE:this.valueNodeProperty===_e.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}(),Ip=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 Cp(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:_e.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=R({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=_e.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=_e.ComponentState.PRESSED:(r.touched||this.values.button>_e.ButtonTouchThreshold)&&(this.values.state=_e.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===_e.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>_e.AxisTouchThreshold&&(this.values.state=_e.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===_e.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>_e.AxisTouchThreshold&&(this.values.state=_e.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),Sp=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 Ip(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}(),Tp="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Pp="generic-trigger",Bp=function(n){de(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,u=i.value,c=i.valueNodeProperty;a&&(c===_e.VisualResponseProperty.VISIBILITY?a.visible=u:c===_e.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,u),a.position.lerpVectors(o.position,s.position,u)))})}))},t}(Sn.Object3D);function Rp(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===_e.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Sn.SphereGeometry(.001),s=new Sn.MeshBasicMaterial({color:255}),u=new Sn.Mesh(o,s);e.touchPointNode.add(u)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(c){var l=c.valueNodeName,h=c.minNodeName,p=c.maxNodeName,v=c.valueNodeProperty;if(v===_e.VisualResponseProperty.TRANSFORM){if(c.minNode=t.getObjectByName(h),c.maxNode=t.getObjectByName(p),!c.minNode){console.warn("Could not find ".concat(h," in the model"));return}if(!c.maxNode){console.warn("Could not find ".concat(p," in the model"));return}}c.valueNode=t.getObjectByName(l),c.valueNode||console.warn("Could not find ".concat(l," in the model"))})})}function Qs(n,t){Rp(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 Fp=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=Tp,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new Bp,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||Ep(o,e.path,Pp).then(function(s){var u=s.profile,c=s.assetPath;r.motionController=new Sp(o,u,c);var l=e._assetCache[r.motionController.assetUrl];if(l)i=l.scene.clone(),Qs(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(h){e._assetCache[r.motionController.assetUrl]=h,i=h.scene.clone(),Qs(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function Op(n,t){if(!t)return n;var e=n.match(/\d+_[a-z].png/);return n.substring(0,e.index)+t+"/"+n.substring(e.index)}var Vs=300,kp=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),Us=new d.Vector3(-1,1,1),Lp=function(n){de(t,n);function t(e){var r,i=n.call(this,e)||this;i.xrManager=new Ap(i.renderer,i.renderer.getContext(),{onSessionStart:function(c){i.emit("xr.session.start",_("xr.session.start",{session:c,machineType:i.xrManager.machineType}))},onSessionEnd:function(){i.emit("xr.session.end",_("xr.session.end",{session:null,machineType:i.xrManager.machineType}))}}),i.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},i.xrControllerRay.left.params.Points={threshold:.1},i.xrControllerRay.right.params.Points={threshold:.1},i.pointerLines={left:new Oa,right:new Oa},i.pointerLines.left.visible=!1,i.pointerLines.right.visible=!0,i.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),i.pointerLines.left.points.material.depthTest=!1,i.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),i.pointerLines.right.points.material.depthTest=!1,i.scene.add(i.pointerLines.left,i.pointerLines.right),i.panoResources={},i.panoResources[i.locationMotion.keyframes[0].key=i.locationMotion.keyframes[1].key=vt()]={panoId:Be(i.currentPano),leftPanoPicture:null,position:i.camera.pose.offset.clone(),effect:"fade"},i.parallaxCameraMatrixs=[],i.onlyUseRightController=(r=e.onlyUseRightController)!==null&&r!==void 0?r:!1;var a=it.shared.getContext();if(!a)return console.error("获取session失败,请退出重试"),i;i.on("xr.session.end",function(){i.scene.remove(i.pointerLines.left,i.pointerLines.right)}),i.xrManager.setSession(a),i.controllerWrappers=[new d.Group,new d.Group],i.scene.add(i.controllerWrappers[0],i.controllerWrappers[1]);var o=i.xrManager.getController(0);i.controllerWrappers[0].add(o);var s=i.xrManager.getController(1);i.controllerWrappers[1].add(s);var u=new Fp;return u.gltfLoader={load:function(c,l){ci.ajax(c,{responseType:"arraybuffer"}).then(function(h){var p;return Wa(h.body,{resourcePath:c.slice(0,c.lastIndexOf("/")+1),search:(p=c.split("?")[1])!==null&&p!==void 0?p:"",fetcher:ci})}).then(function(h){return l(h)})}},i.on("xr.session.start",function(){var c=i.xrManager.getControllerGrip(0);if(c.add(u.createControllerModel(c)),i.controllerWrappers[0].add(c),!i.onlyUseRightController){var l=i.xrManager.getControllerGrip(1);l.add(u.createControllerModel(l)),i.controllerWrappers[1].add(l)}}),i.xrControllerState={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}},i}return t.parseArgs=function(e){if(e instanceof t)return e;var r=R(R({},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 R(R({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,u,c;this.userAction=i,this.stopMomentumMovement();var l=this.works.getResolvedObserver(e);if(!l)throw new Error("Invalid PanoIndex");var h=this.imageOptions.size;if(typeof h>"u"&&l){var p=l.images.up.match(/\/cube_(\d+)\//);p&&(h=Number(p[1]))}typeof h>"u"&&(h=2048);var v=this.imageOptions.transform,m=function(P,S){return Op(di(P,v,S))},A=R({key:"pano.".concat(l.panoId)},sr(this.imageOptions,["format","size","quality"])),y=l.images,f=(s=(o=l.images.tiles)===null||o===void 0?void 0:o.filter(function(P){return P.size>h}))!==null&&s!==void 0?s:null,g="pano:"+fn([y,A,v]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===g)return;var b=this.pendingTextureTask.panoId;(u=this.panoMeshes[b])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:l.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var w=this.models.getMaterial()||{},E=w.pano0,x=w.pano1,M;if((E==null?void 0:E.map.name)===g?M=E:(x==null?void 0:x.map.name)===g&&(M=x),M){var C={panoId:l.panoId,effect:(c=r.effect)!==null&&c!==void 0?c:"fade",leftPanoPicture:{map:M.map,luminanceMap:M.luminanceMap,matrix:new d.Matrix4().compose(l.position,l.quaternion,Us)},position:l.position.clone()};this.doMoveToPano(l.pano,C,r);return}var I="move-to-pano-"+l.panoId;this.pending.add(I),this.pendingTextureTask={panoId:l.panoId,hash:g,onLoad:function(P){var S;if(a.pending.delete(I),a.destroyed)P.body.dispose();else{P.body.name=g;var F={panoId:l.panoId,effect:(S=r.effect)!==null&&S!==void 0?S:"fade",leftPanoPicture:{map:P.body,luminanceMap:null,matrix:new d.Matrix4().compose(l.position,l.quaternion,Us)},position:l.position.clone()};a.doMoveToPano(l.pano,F,r)}},onError:function(P){a.pending.delete(I);var S=R(R(R({},l.pano),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.error",_("pano.error",{error:P,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:S})),a.emit("pano.cancel",_("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:S})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&f&&f.length?this.textureLoader.loadTiledCubeTexture(y,f,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:m,options:A},format:d.RGBAFormat,viaAjax:!0,fetcher:pt(l.work)},void 0,void 0,function(P){var S,F;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:P,meta:null,pano:l.pano})),((S=a.pendingTextureTask)===null||S===void 0?void 0:S.hash)===g&&((F=a.panoMeshes[l.panoId])===null||F===void 0||F.setProgress(P))},this.renderer):this.textureLoader.loadCubeTexture(y,{imageURL:{transform:m,options:A},format:d.RGBAFormat,fetcher:pt(l.work)},void 0,void 0,function(P){var S,F;((S=a.pendingTextureTask)===null||S===void 0?void 0:S.hash)===g&&((F=a.panoMeshes[l.panoId])===null||F===void 0||F.setProgress(P)),a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:P,meta:null,pano:l.pano}))},this.renderer)]).then(function(P){var S,F,k=P[0];((S=a.pendingTextureTask)===null||S===void 0?void 0:S.hash)===g?(a.pendingTextureTask.onLoad(k),(F=a.panoMeshes[l.panoId])===null||F===void 0||F.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:k.meta,pano:l.pano}))):k.body.dispose()}).catch(function(P){var S,F;((S=a.pendingTextureTask)===null||S===void 0?void 0:S.hash)===g&&(a.pendingTextureTask.onError(P),(F=a.panoMeshes[l.panoId])===null||F===void 0||F.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:P,progress:0,meta:null,pano:l.pano})),a.emit("error",P))}),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:l.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u;i===void 0&&(i={});var c=ve(),l=vt();this.panoResources[l]=r;var h=1,p,v,m;if(this.locationMotion.ended){var A=this.locationMotion.getKeyFrameSegment(c);A[0];var y=A[1],f=this.locationMotion.value,g=this.panoResourceFromLocationMotionKeyframe(y).position,b=r.position;p=Math.max(g.distanceTo(b),h),v=[{key:y.key,progress:0,value:R(R({},f),{count:0})},{key:l,progress:1,value:{distance:0,count:1}}],m=0}else{var w=this.locationMotion.getKeyFrameSegment(c),E=w[0],y=w[1],f=this.locationMotion.value,x=this.panoResourceFromLocationMotionKeyframe(E).position,g=this.panoResourceFromLocationMotionKeyframe(y).position,b=r.position,M=y.value.count-f.count,C=Math.max(x.distanceTo(g),h)*M,I=Math.max(g.distanceTo(b),h);p=C+I,v=[{key:E.key,progress:0,value:R({},f)},{key:y.key,progress:C/p,value:y.value},{key:l,progress:1,value:{count:y.value.count+1,distance:0}}];var P=this.locationMotionKeyframesLength(this.locationMotion.keyframes),S=this.locationMotionKeyframesLength(v);m=this.locationMotion.getProgressVelocity(c)*P/S}var F=this.calculateMovingDuration(i.duration,p),k={longitude:i.longitude,latitude:i.latitude,fov:i.fov},O=R(R({},e),{mode:this.mode,longitude:(o=k.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=k.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=k.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:0}),L=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:L,progress:0,state:O,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(O),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),this.cameraMotion.set(k,F).catch(Q);var N=this.locationMotion.setKeyframes(v,F,m);N.then(function(){var V,j,z,U=R(R({},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:L,progress:1,state:U,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(U);var X=a.works.getResolvedObserver(a.currentPano);if(X&&X.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var G=kp.clone().multiply((z=(j=(V=a.models.getMaterial())===null||V===void 0?void 0:V.pano1)===null||j===void 0?void 0:j.matrix)!==null&&z!==void 0?z:new d.Matrix4).multiply(X.video.matrix),K={map:a.videoTexture,size:X.video.size,matrix:G,alpha:1},Y=vt(),H=a.videoTexture.image;H.setAttribute("uuid",Y),$u().then(function(J){J&&X.video&&H.getAttribute("uuid")===Y&&(H.oncanplay=function(){H.oncanplay=Q,H.play()},H.ontimeupdate=function(){H.currentTime>.5&&(H.ontimeupdate=Q,a.panoVideo.setMaterial(K))},H.src=X.video.source)}).catch(function(){H.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:L,progress:0,state:O,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var u=this.camera.getDirection(new d.Vector3).setY(0),c=null,l=this.works.getResolvedObserver(this.currentPano);if(!l)return null;var h=l.accessibleIds.filter(function(Y){var H=Ye(Y);if(Ft(H,r.currentPano))return!1;var J=r.works.getResolvedObserver(H);return!J||J.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:J.loadable||J.active}),p=this.models.intersectRaycaster(e)[0];if(p){var v=Ot(h,function(Y){var H=r.works.getResolvedObserver(Y);if(!H)return 1/0;var J=H.standingPosition.clone();return J.distanceTo(p.point)},!0),m=v[0],A=v[1];m&&A<this.panoTapTriggerRadius&&(c=(i=this.works.getResolvedObserver(m))!==null&&i!==void 0?i:null)}if(ks(c)){var y=this.getForwardObserverOrNot(e);y&&(c=y)}for(var f=0,g=this.locationMotion.keyframes;f<g.length;f++){var b=g[f],w=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&c&&w.panoId===c.panoId){c=null;break}}if(ks(c))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(c&&!c.active){var E=c.panoId;this.panoMeshes[E]&&(this.panoMeshes[E].setDisabled(!1),this.panoMeshes[E].setLoading(!0))}var x={};if(c){x.effect="fade";for(var M=Math.PI/6,C=Math.PI/12,I=new d.Vector3(0,1,0),P=c.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),S=P.clone().applyAxisAngle(I,M),F=P.clone().applyAxisAngle(I,-M),k=[],O=[],L=[],N=0,V=c.accessibleIds;N<V.length;N++){var m=V[N],j=Ye(m);if(!(Ft(j,this.currentPano)||Ft(j,c.pano))){var z=this.works.getResolvedObserver(m);if(z){var U=z.position.clone().sub(c.position).setY(0);P.angleTo(U)<M?L.push(U):S.angleTo(U)<M?k.push(U):F.angleTo(U)<M&&O.push(U)}}}var X=L.length>0?L:at(at([],k,!0),O,!0),G=X.slice().sort(function(Y,H){return Y.angleTo(P)-H.angleTo(P)})[0];G&&G.angleTo(u)>C&&(x.longitude=Math.atan2(-G.x,-G.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(x.latitude=le(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(x.fov=this.defaultFov);var K={workCode:c.pano.workCode,panoIndex:c.pano.panoIndex,mode:this.mode,longitude:(a=x.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=x.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=x.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:c?c.position.clone():new d.Vector3};return this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:K,userAction:!0,options:x,progress:0,error:null})),c&&c.active?(this.emit("pano.request",_("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:K,options:x,error:null})),c.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,u,c,l,h,p,v=[],m=2;m<arguments.length;m++)v[m-2]=arguments[m];this.userAction=!0;var A={},y={},f=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),y.longitude=this.cameraMotion.value.longitude,y.latitude=this.cameraMotion.value.latitude,y.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),A.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(le(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),E=w[0],x=w[1],M=this.panoResourceFromLocationMotionKeyframe(E),C=this.panoResourceFromLocationMotionKeyframe(x),I=new d.Vector3().copy(M.position),P=new d.Vector3().copy(C.position),S=this.locationMotion.value.count-x.value.count+1;A.progress=S,C.leftPanoPicture&&(S<1?M.leftPanoPicture&&(A.pano0=M.leftPanoPicture):A.pano0=C.leftPanoPicture,A.pano1=C.leftPanoPicture),b=A.useBlackTransition=C.effect==="instant"||C.effect==="montage",(C.effect==="fade"||C.effect==="montage")&&(A.pano0&&M.leftPanoPicture&&(A.pano0={map:A.pano0.map,luminanceMap:A.pano0.luminanceMap,matrix:M.leftPanoPicture.matrix.clone().setPosition(C.position)}),I.copy(P)),y.distance=this.locationMotion.value.distance,y.offset=new d.Vector3(I.x+(P.x-I.x)*S,I.y+(P.y-I.y)*S,I.z+(P.z-I.z)*S);for(var F=[],k=[],O=0,L=this.locationMotion.keyframes;O<L.length;O++){var N=L[O],V=N.key,j=N.progress;V!==void 0&&(F.push(V),j>=this.locationMotion.progress&&k.push(V))}for(var z=0,U=Object.keys(this.panoResources);z<U.length;z++){var X=U[z];if(!(k.indexOf(X)>=0)){var G=this.panoResources[X];if(G.leftPanoPicture){var K=G.leftPanoPicture.map;if(K){if(K===((a=A.pano0)===null||a===void 0?void 0:a.map)||K===((o=A.pano1)===null||o===void 0?void 0:o.map))continue;K instanceof Qe&&K.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(K.cubeRenderTarget),K.dispose(),G.leftPanoPicture=null}}F.indexOf(X)>=0||delete this.panoResources[X]}}this.currentPano=Ye(C.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:Ye(f.panoId),state:R(R(R(R({},Ye(g.panoId)),{mode:this.mode}),Ve(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}St(A)===!1&&(!((s=A.pano0)===null||s===void 0)&&s.map&&A.pano0.map instanceof Qe&&!A.pano0.map.cubeRenderTarget&&(A.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=A.pano1)===null||u===void 0)&&u.map&&A.pano1.map instanceof Qe&&!A.pano1.map.cubeRenderTarget&&(A.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(A)),St(y)===!1&&this.setCamera(y);var Y=this.works.getResolvedObserver(this.currentPano),H=v[1];if(!H){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var J=this.xrManager.referenceSpace;if(J){var ne=this.xrManager.cameraVR,$=this.xrManager.cameraL,te=this.xrManager.cameraR,ae=[$,te],ce=H.getViewerPose(J),oe=new d.Vector3(0,0,0);if(ce){var fe;fe=this.xrManager.session.renderState.baseLayer;var Ie=ce.views;if(!fe){console.error("no layer found");return}this.renderer.setFramebuffer(fe.framebuffer);var Ae=!1;Ie.length!==ne.cameras.length&&(ne.cameras.length=0,Ae=!0),this.parallaxCameraMatrixs=[];var Fe=new d.Vector3,re=new d.Vector3;new d.Matrix4().fromArray(Ie[0].transform.matrix).decompose(Fe,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(Ie[1].transform.matrix).decompose(re,new d.Quaternion,new d.Vector3),re.clone().sub(Fe).normalize();var he=new d.Vector3,W=new d.Quaternion,Oe=new d.Vector3;this.camera.matrix.decompose(he,W,Oe);for(var ke=0;ke<Ie.length;ke++){var Je=Ie[ke],Ze=fe.getViewport(Je),De=ae[ke];De.matrix.fromArray(Je.transform.matrix);var We=new d.Vector3,Le=new d.Quaternion,ye=new d.Vector3;De.matrix.decompose(We,Le,ye),oe.copy(he),De.position.copy(he),De.quaternion.copy(Le),De.scale.copy(ye),De.updateMatrix(),De.projectionMatrix.fromArray(Je.projectionMatrix),De.viewport.set(Ze.x,Ze.y,Ze.width,Ze.height),Ae===!0&&ne.cameras.push(De)}ce.views[0].transform.position,ce.views[1].transform.position;for(var me=this.xrManager.session.inputSources,ke=0;ke<this.xrManager.controllers.length;ke++){var lt=this.xrManager.controllers[ke],Se=me[ke];if(Se){lt.update(Se,H,J);var $e=this.xrManager.getController(ke),Ue=new d.Vector3(0,1.2,0),At=$e.position.clone().add(oe).sub(Ue);Se.handedness==="left"?this.xrControllerRay.left.set(At,new d.Vector3(0,0,-1).applyEuler($e.rotation)):Se.handedness==="right"&&this.xrControllerRay.right.set(At,new d.Vector3(0,0,-1).applyEuler($e.rotation)),this.controllerWrappers[ke].position.copy(new d.Vector3(0,0,0).add(oe).sub(Ue));var Ke=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ke.length===0&&(Ke=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(ft){var Et;return R({floor:(Et=Y==null?void 0:Y.floorIndex)!==null&&Et!==void 0?Et:0},ft)})),Ke.length>=1&&Ke[0].face)if(Se.handedness==="right"){var Gt=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Kt=Ke[0].face.normal,ze=Kt.clone().multiplyScalar(.05),ot=Ke[0].point.clone().add(ze);this.intersectMesh.position.copy(ot);var $t=ot.clone().add(ze);if(this.intersectMesh.lookAt($t),Math.abs(Kt.y)>.99){var He=this.camera.position.clone().sub(ot);this.intersectMesh.rotation.z=-Math.atan2(He.z,He.x)}this.intersectMesh.visible=!0,this.needsRender=!0,Gt.length>0?(this.pointerLines.right.setPoints(At,Gt[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(At,Ke[0].point));var ct=Ke[0],wt=_("intersect.update",{raycaster:(c=this.xrControllerRay.right)!==null&&c!==void 0?c:null,intersection:ct??null,object:this.intersectMesh});if(this.emit("intersect.update",wt),wt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(At,Ke[0].point)}}if(this.camera.pose.distance>.1||b){if(Y)for(var Tt=0,er=Object.keys(this.panoMeshes);Tt<er.length;Tt++){var mt=er[Tt],Te=this.panoMeshes[mt];Te.setOpacity(0),Te.setCurrent(!1),Te.updateTime&&Te.updateTime(e,r)}}else if(Y){var wr=Ot(Y.visibleIds,function(st){var ft=i.works.getResolvedObserver(st);return ft?Y.standingPosition.distanceTo(ft.standingPosition):1/0},!0),kt=wr[1];kt=le(kt,2.5,1/0);for(var ur=Y.visibleIds.concat(Be(this.currentPano)),Lt=this.getForwardObserverOrNot(),mn=this.camera.getDirection(new d.Vector3),Qr=0,Vr=Object.keys(this.panoMeshes);Qr<Vr.length;Qr++){var mt=Vr[Qr],Te=this.panoMeshes[mt],lr=this.works.getResolvedObserver(mt);if(ur.indexOf(mt)===-1)Te.setCurrent(!1),Te.setOpacity(0);else if(!lr)Te.setCurrent(!1),Te.setOpacity(0);else if(!lr.loadable&&!lr.active)Te.setCurrent(!1),Te.setOpacity(0);else{var cr=Te.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Te.setCurrent(!Te.loading&&Te.progress===0&&Lt!==null&&Lt.panoId===mt),Te.setOpacity(cr<.01?0:le(kt/cr*1.2,.65,.98));var rt=this.camera.position.clone().setY(Te.position.y),Xe=new d.Vector3().copy(Te.position).sub(rt).normalize();if(mt===Be(this.currentPano)){var Dt=le((.5-rt.distanceTo(Te.position))/.5,0,1);Xe.multiplyScalar(1-Dt).add(mn.clone().multiplyScalar(Dt))}Xe.length()>0&&Te.quaternion.setFromEuler(new d.Euler(0,Math.atan2(Xe.x,Xe.z),0))}Te.updateTime&&Te.updateTime(e,r)}}var dr=function(){if(i.tileLevelForFov===!1)return 0;var st=new d.Vector2(4e3,4e3),ft=g.panoId,Et=i.works.getResolvedObserver(ft),xt=i.imageOptions.size;if(typeof xt>"u"&&Et){var zn=Et.images.up.match(/\/cube_(\d+)\//);zn&&(xt=Number(zn[1]))}typeof xt>"u"&&(xt=2048);var qr=0;xt>=1024&&(qr=1),xt>=2048&&(qr=2),xt>=4096&&(qr=3),xt>=8192&&(qr=4);var zr=i.tileLevelForFov($.fov,st);return zr>qr?zr:0}(),gn=function(){var st=new d.PerspectiveCamera;st.applyMatrix4(ne.matrix),st.position.set(0,0,0);var ft=i.works.getResolvedObserver(g.panoId),Et=ft??Y;Et&&st.quaternion.premultiply(Et.quaternion.clone().inverse()),st.updateProjectionMatrix(),st.updateMatrixWorld(!0);var xt=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(st.projectionMatrix,st.matrixWorldInverse));return xt}();g.panoId===Be(this.currentPano)&&((l=g.leftPanoPicture)===null||l===void 0?void 0:l.map)instanceof Qe&&(g.leftPanoPicture.map.update(gn,dr),g.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0));{var qn=this.tiling.object.visible;if(dr>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var Ur=g.panoId,dt=this.works.getResolvedObserver(Ur);dt?Ti(this.camera.position,dt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ur&&this.tiling.cleanup(),this.tiling.panoId=Ur,this.tiling.setResource((p=(h=dt.images)===null||h===void 0?void 0:h.tiles)!==null&&p!==void 0?p:[],this.enableIOSEDR&&dt.images.luminance?dt.images.luminance:null),this.tiling.setFetcher(pt(dt.work)),this.tiling.setRotation(dt.quaternion),this.tiling.setPosition(dt.position),this.tiling.update(gn,dr,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;qn!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),!(!me||me.length<1)&&this.updateControllerHelper(me,e,r)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.scene,e)},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}},u=0;u<e.length;u++){var c=e[u].handedness,l=e[u].gamepad;switch(c){case"left":l.axes&&(this.emitEvent(l.axes[2]===-1,"LeftAxesLeft",r),this.emitEvent(l.axes[2]===1,"LeftAxesRight",r),this.emitEvent(l.axes[3]===-1,"LeftAxesUp",r),this.emitEvent(l.axes[3]===1,"LeftAxesDown",r)),l!=null&&l.buttons&&(this.emitEvent(l==null?void 0:l.buttons[4].pressed,"X",r),this.emitEvent(l.buttons[5].pressed,"Y",r),this.emitEvent(l==null?void 0:l.buttons[0].pressed,"LeftTrigger",r),this.emitEvent(l==null?void 0:l.buttons[1].pressed,"LeftPinch",r));var h={raycaster:a,axes:{up:l.axes&&l.axes[3]<0?Math.abs(l.axes[3]):0,down:l.axes&&l.axes[3]<0?0:Math.abs(l.axes[3]),left:l.axes&&l.axes[2]<0?Math.abs(l.axes[2]):0,right:l.axes&&l.axes[2]<0?0:Math.abs(l.axes[2])},deltaTime:i};s.buttons.X=l.buttons&&l.buttons[4]?l.buttons[4].pressed:!1,s.buttons.Y=l.buttons&&l.buttons[5]?l==null?void 0:l.buttons[5].pressed:!1,s.buttons.LeftTrigger=l.buttons&&l.buttons[0]?l==null?void 0:l.buttons[0].pressed:!1,s.buttons.LeftPinch=l.buttons&&l.buttons[1]?l==null?void 0:l.buttons[1].pressed:!1,s.left=h;break;case"right":l.axes&&(this.emitEvent(l.axes[2]===-1,"RightAxesLeft",r),this.emitEvent(l.axes[2]===1,"RightAxesRight",r),this.emitEvent(l.axes[3]===-1,"RightAxesUp",r),this.emitEvent(l.axes[3]===1,"RightAxesDown",r)),l.buttons&&(this.emitEvent(l==null?void 0:l.buttons[4].pressed,"A",r),this.emitEvent(l.buttons[5].pressed,"B",r),this.emitEvent(l==null?void 0:l.buttons[0].pressed,"RightTrigger",r),this.emitEvent(l==null?void 0:l.buttons[1].pressed,"RightPinch",r));var p={raycaster:o,axes:{up:l.axes&&l.axes[3]<0?Math.abs(l.axes[3]):0,down:l.axes&&l.axes[3]<0?0:Math.abs(l.axes[3]),left:l.axes&&l.axes[2]<0?Math.abs(l.axes[2]):0,right:l.axes&&l.axes[2]<0?0:Math.abs(l.axes[2])},deltaTime:i};s.right=p,s.buttons.A=l.buttons&&l.buttons[4]?l==null?void 0:l.buttons[4].pressed:!1,s.buttons.B=l.buttons&&l.buttons[5]?l==null?void 0:l.buttons[5].pressed:!1,s.buttons.RightTrigger=l.buttons&&l.buttons[0]?l==null?void 0:l.buttons[0].pressed:!1,s.buttons.RightPinch=l.buttons&&l.buttons[1]?l==null?void 0:l.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",_("xr.controller.update",s))}},t.prototype.emitEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrControllerState[r].touchStart===!1)this.xrControllerState[r].touchStartTime=i,this.xrControllerState[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.xrControllerState[r].touchStartTime;s>Vs&&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.xrControllerState[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.xrControllerState[r].touchStartTime;if(s<=Vs){var u=this.emit("xr.gesture.tap",_("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));u||r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrControllerState[r].touchStart=!1,this.xrControllerState[r].touchStartTime=0}},t}(so),Vt={Floorplan:si,Topview:Gf,Panorama:so,VRPanorama:Gh,Model:Wh,DepthPanorama:rp,Mapview:hp,XRPanorama:Lp},h0=["gesture.pan","gesture.tap","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 Dp(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.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=Rr(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 Np(){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}function Qp(n){{var t=new d.DirectionalLight(16777215,.5);t.position.copy(new d.Vector3(1,1,1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.3);n.add(t)}{var t=new d.AmbientLight(16777215,.3);n.add(t)}}function Vp(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],u=s.split("="),c=(t=u[0])===null||t===void 0?void 0:t.trim(),l=(e=u[1])===null||e===void 0?void 0:e.trim();c&&l&&(r[c]=l)}return r}function p0(){for(var n,t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=Vp((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const Up="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR/1XPxwJhp5DAV67T9ZPwFdovhBMIGUYoRBN4wim6S3eoXVEHXdLgmwY0x6BQnO4xPJ0Ar5OVxhQF0L9UslRM4yaQQfQImnBegi8vhY2A1k6YLlrj61TwDdNQnIISwiPvpD7TwYQTssZXK47vg8y9Gp2nxRcATkozOEmdCeObSt3IIo+xf/00IDRKAaZ89PBT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),Fi=new d.BufferGeometry;Fi.setAttribute("position",new d.BufferAttribute(qp,3));Fi.setAttribute("uv",new d.BufferAttribute(zp,2));Fi.setIndex(new d.BufferAttribute(Hp,1));var ui=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),v0=new d.Mesh(Fi,ui);v0.matrixAutoUpdate=!1;var ho=new d.Scene;ho.add(v0);ho.matrixAutoUpdate=!1;var Un=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Un.position.set(0,0,.5);Un.lookAt(0,0,0);Un.updateMatrixWorld(!0);Un.matrixAutoUpdate=!1;var jp=new d.Vector4,_p=new d.Vector4;function Hs(n){if(ui.map){var r=n.getViewport(jp),i=n.getScissor(_p),a=n.getScissorTest(),o=n.autoClear,s=i.x+zs[0]/3,u=i.y+zs[1]/3,c=qs[0]/3,l=qs[1]/3;n.setViewport(s,u,c,l),n.setScissor(s,u,c,l),n.setScissorTest(!0),n.autoClear=!1,n.render(ho,Un),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,ui.needsUpdate=!0,e.onload=Q},e.src=Up,ui.map=t}}var Gp=800,Kp=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/")},Wp=[{name:"Z",transformToUpAxisZ:function(){return new d.Matrix4}},{name:"Y",transformToUpAxisZ:function(){return new d.Matrix4().makeRotationAxis(new d.Vector3(1,0,0),+Math.PI/2)}},{name:"-Y",transformToUpAxisZ:function(){return new d.Matrix4().makeRotationAxis(new d.Vector3(1,0,0),-Math.PI/2)}},{name:"WGS84",transformToEarthCentered:function(){return new d.Matrix4}},{name:"GCJ02",transformToEarthCentered:function(){return new d.Matrix4}},{name:"BD09",transformToEarthCentered:function(){return new d.Matrix4}}],on=new d.Vector2,ri=new d.Frustum,ni=new d.Matrix4,js=new WeakMap,_s=new WeakMap,Gs=Wu([]),A0=function(n){de(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,c,l,h,p,v=n.call(this)||this;v.ident=vt(),ka.instances[v.ident]=v,v.renderSwitch01=0,v.currentMode="Panorama",v.pano={workCode:"",panoIndex:0},v.needsRender=!1,v.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,v.imageOptions=R({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),v.textureOptions=R({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),v.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,v.extraElements=[],v.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),DepthPanorama:Object.assign({},e.depthPanorama),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},v.coordinatesSystemTransformers=at([],(s=e.coordinatesSystemTransformers)!==null&&s!==void 0?s:[],!0);for(var m=function(F){var k=A.coordinatesSystemTransformers.find(function(O){return O.name===F.name});k||A.coordinatesSystemTransformers.push(R({},F))},A=this,y=0,f=Wp;y<f.length;y++){var g=f[y];m(g)}if(v.fps={testCount:0,testTime:ve()},v.info=null,v.modeChangeDuration=(u=e.modeChangeDuration)!==null&&u!==void 0?u:Gp,v.enableWheel=(c=e.enableWheel)!==null&&c!==void 0?c:!0,typeof window<"u")if(e.renderer)e.renderer instanceof _r&&v.throwError(new Error("cannot render a internal renderer")),v.renderer=e.renderer;else try{v.renderer=new _r({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e==null?void 0:e.webgl2});var b=p0();v.renderer.setPixelRatio(b===1?window.devicePixelRatio:1),v.renderer.setSize(512,512)}catch(F){F instanceof Error&&v.throwError(F)}v.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(h=(l=v.renderer)===null||l===void 0?void 0:l.outputEncoding)!==null&&h!==void 0?h:d.sRGBEncoding}),v.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),v.camera=new hi(90),v.scene=new fu,v.xrCustomObjectsScene=new d.Scene,v.scene.add(v.xrCustomObjectsScene),v.scene.matrixAutoUpdate=!1,v.lastLoadWorkTask=Promise.resolve(),v.requestProxy=(p=e.requestProxy)!==null&&p!==void 0?p:Kp,v.networkSubscribe=new eu,v.networkSubscribe.on("network",function(F,k,O,L){var N;v.emit("network.resource",_("network.resource",{source:F,requestType:k,requestState:O,detail:L})),(N=v.analysis)===null||N===void 0||N.network(v.works,F,k,O,L)}),v.boundingMesh=Nf(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),v.boundingMesh.name="bounding",v.scene.add(v.boundingMesh),v.models=ms(),v.models.push(new Ba),v.lastModels=ms(),v.readyCallbacks=[],v.syncingState=!1,v.modelGroup=new d.Group,v.modelGroup.visible=!1,v.modelGroup.name="model",v.modelGroup.matrixAutoUpdate=!1,v.modelGroup.renderOrder=-4,v.scene.add(v.modelGroup),v.helperGroup=new d.Group,v.helperGroup.name="helper",v.helperGroup.matrixAutoUpdate=!1,v.scene.add(v.helperGroup),v.videoTexture=new d.VideoTexture(e.videoInstance||Np()),Qp(v.scene),v.copyEffect=new Bi(v.renderer,v.scene,v.camera,v.models),v.state={mode:v.currentMode,workCode:v.pano.workCode,panoIndex:v.pano.panoIndex,longitude:v.camera.pose.longitude,latitude:v.camera.pose.latitude,fov:v.camera.pose.fov,offset:v.camera.pose.offset.clone(),distance:v.camera.pose.distance},v.stateSynced=!1,v._enableIOSEDR=!1,v.destroyed=!1,v.paused=!0,typeof window<"u"&&(e.play!==!1&&v.play(),v.stopAnimationLoop=it.shared.add(function(F,k){for(var O=[],L=2;L<arguments.length;L++)O[L-2]=arguments[L];v.updateTime.apply(v,at([F,k],O,!1))},!1,0,10));var w=function(){typeof document<"u"&&document.fullscreenElement===null&&v.currentMode==="VRPanorama"&&v.controller.emit("vr.requestExit",_("vr.requestExit",{}))};if(typeof document<"u"&&document.addEventListener("fullscreenchange",w,!1),v.removeEventListeners=function(){typeof document<"u"&&document.removeEventListener("fullscreenchange",w,!1)},v.plugins={},e.plugins&&e.plugins.length)for(var E=0,x=e.plugins;E<x.length;E++){var M=x[E];if(typeof M=="function")M(v);else if(Array.isArray(M)){var C=M[0],I=M[1],P=M[2];if(typeof C=="function"){var S=C(v,P);typeof I=="string"&&(v.plugins[I]?v.throwError(new Error("plugin name ".concat(I," is exists."))):v.plugins[I]=S)}}}return v.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1),v.meshReplaceMaterialMap=new Map,v.meshOriginMaterialMap=new Map,Dp(v),v}return Object.defineProperty(t,"version",{get:function(){return"6.0.0-alpha.64"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return mi.decoderPath},set:function(e){mi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Fn.transcoderPath},set:function(e){Fn.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(h){if(!(!(h instanceof d.Mesh)||h instanceof _t)){var p=Object.keys(i).filter(function(m){return m===h.uuid})[0];if(p)if(s.meshOriginMaterialMap.set(p,h.material),s.meshReplaceMaterialMap.get(p))h.material=s.meshReplaceMaterialMap.get(p);else{var v=new d.ShaderMaterial({uniforms:{color:{value:i[p]}},vertexShader:`
|
|
2038
|
+
`},lo=function(n){de(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(ca.uniforms),vertexShader:ca.vertexShader,fragmentShader:ca.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(lo.prototype,{isLineMaterial:!0});var s0=function(n){de(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new uo,i.material=r!==void 0?r:new lo({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,u=0,c=0,l=r.count;u<l;u++,c+=2)o.fromBufferAttribute(r,u),s.fromBufferAttribute(i,u),a[c]=c===0?0:a[c-1],a[c+1]=a[c]+o.distanceTo(s);var h=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(h,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(h,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,u=this.material,c=u.resolution,l=u.linewidth,h=s.attributes.instanceStart,p=s.attributes.instanceEnd,v=new d.Vector4,m=new d.Vector4,A=new d.Vector4,y=new d.Vector3,f=new d.Matrix4,g=new d.Line3,b=new d.Vector3;i.at(1,A),A.w=1,A.applyMatrix4(a.matrixWorldInverse),A.applyMatrix4(o),A.multiplyScalar(1/A.w),A.x*=c.x/2,A.y*=c.y/2,A.z=0,y.copy(A);var w=this.matrixWorld;f.multiplyMatrices(a.matrixWorldInverse,w);for(var E=0,x=h.count;E<x;E++){v.fromBufferAttribute(h,E),m.fromBufferAttribute(p,E),v.w=1,m.w=1,v.applyMatrix4(f),m.applyMatrix4(f),v.applyMatrix4(o),m.applyMatrix4(o),v.multiplyScalar(1/v.w),m.multiplyScalar(1/m.w);var M=v.z<-1&&m.z<-1,C=v.z>1&&m.z>1;if(!(M||C)){v.x*=c.x/2,v.y*=c.y/2,m.x*=c.x/2,m.y*=c.y/2,g.start.copy(v),g.start.z=0,g.end.copy(m),g.end.z=0;var I=g.closestPointToPointParameter(y,!0);g.at(I,b);var P=d.MathUtils.lerp(v.z,m.z,I),S=P>=-1&&P<=1,F=y.distanceTo(b)<l*.5;if(S&&F){g.start.fromBufferAttribute(h,E),g.end.fromBufferAttribute(p,E),g.start.applyMatrix4(w),g.end.applyMatrix4(w);var k=new d.Vector3,O=new d.Vector3;i.distanceSqToSegment(g.start,g.end,O,k),r.push({point:O,pointOnLine:k,distance:i.origin.distanceTo(O),object:this,faceIndex:E})}}}},t}(d.Mesh);Object.assign(s0.prototype,{isLineSegments2:!0});var u0=function(n){de(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(s0);Object.assign(u0.prototype,{isLine2:!0});var l0=function(n){de(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}(uo);Object.assign(l0.prototype,{isLineGeometry:!0});var pp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEd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8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",ks=14467195,vp=8,Ap=2,mp=20,Ls=null,Oa=function(n){de(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 l0,o=new lo({color:ks,linewidth:Ap,dashScale:mp,dashed:!1});i.line=new u0(a,o);var s=new d.BufferGeometry,u=new d.PointsMaterial({color:ks,size:vp,map:Ls||(Ls=new d.TextureLoader().load(pp)),sizeAttenuation:!1,transparent:!0});return i.points=new d.Points(s,u),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.0.0-alpha.65"},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(Oa.prototype,{isFiveLine:!0});var _e={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 c0(n){return Mi(this,void 0,void 0,function(){var t;return Ci(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 gp(n){return Mi(this,void 0,void 0,function(){var t,e;return Ci(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,c0("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function yp(n,t,e,r){return e===void 0&&(e=null),r===void 0&&(r=!0),Mi(this,void 0,void 0,function(){var i,a,o,s,u,c;return Ci(this,function(l){switch(l.label){case 0:if(!n)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");return[4,gp(t)];case 1:if(i=l.sent(),n.profiles.some(function(h){var p=i[h];return p&&(a={profileId:h,profilePath:"".concat(t,"/").concat(p.path),deprecated:!!p.deprecated}),!!a}),!a){if(!e)throw new Error("No matching profile name found");if(o=i[e],!o)throw new Error('No matching profile name found and default profile "'.concat(e,'" missing.'));a={profileId:e,profilePath:"".concat(t,"/").concat(o.path),deprecated:!!o.deprecated}}return[4,c0(a.profilePath)];case 2:if(s=l.sent(),r){if(c=void 0,c=s.layouts[n.handedness],!c)throw new Error("No matching handedness, ".concat(n.handedness,", in profile ").concat(a.profileId));c.assetPath&&(u=a.profilePath.replace("profile.json",c.assetPath))}return[2,{profile:s,assetPath:u}]}})})}var bp={xAxis:0,yAxis:0,button:0,state:_e.ComponentState.DEFAULT};function wp(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 Ep=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===_e.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(bp)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=wp(e,r),s=o.normalizedXAxis,u=o.normalizedYAxis;switch(this.componentProperty){case _e.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case _e.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?u:.5;break;case _e.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case _e.ComponentProperty.STATE:this.valueNodeProperty===_e.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}(),xp=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 Ep(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:_e.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=R({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=_e.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=_e.ComponentState.PRESSED:(r.touched||this.values.button>_e.ButtonTouchThreshold)&&(this.values.state=_e.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===_e.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>_e.AxisTouchThreshold&&(this.values.state=_e.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===_e.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>_e.AxisTouchThreshold&&(this.values.state=_e.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),Mp=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 xp(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}(),Cp="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Ip="generic-trigger",Sp=function(n){de(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,u=i.value,c=i.valueNodeProperty;a&&(c===_e.VisualResponseProperty.VISIBILITY?a.visible=u:c===_e.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,u),a.position.lerpVectors(o.position,s.position,u)))})}))},t}(Sn.Object3D);function Tp(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===_e.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Sn.SphereGeometry(.001),s=new Sn.MeshBasicMaterial({color:255}),u=new Sn.Mesh(o,s);e.touchPointNode.add(u)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(c){var l=c.valueNodeName,h=c.minNodeName,p=c.maxNodeName,v=c.valueNodeProperty;if(v===_e.VisualResponseProperty.TRANSFORM){if(c.minNode=t.getObjectByName(h),c.maxNode=t.getObjectByName(p),!c.minNode){console.warn("Could not find ".concat(h," in the model"));return}if(!c.maxNode){console.warn("Could not find ".concat(p," in the model"));return}}c.valueNode=t.getObjectByName(l),c.valueNode||console.warn("Could not find ".concat(l," in the model"))})})}function Ds(n,t){Tp(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 Pp=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=Cp,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new Sp,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||yp(o,e.path,Ip).then(function(s){var u=s.profile,c=s.assetPath;r.motionController=new Mp(o,u,c);var l=e._assetCache[r.motionController.assetUrl];if(l)i=l.scene.clone(),Ds(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(h){e._assetCache[r.motionController.assetUrl]=h,i=h.scene.clone(),Ds(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function Bp(n,t){if(!t)return n;var e=n.match(/\d+_[a-z].png/);return n.substring(0,e.index)+t+"/"+n.substring(e.index)}var Ns=300,Rp=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),Qs=new d.Vector3(-1,1,1),Fp=function(n){de(t,n);function t(e){var r,i=n.call(this,e)||this;i.xrManager=new hp(i.renderer,i.renderer.getContext(),{onSessionStart:function(c){i.emit("xr.session.start",_("xr.session.start",{session:c,machineType:i.xrManager.machineType}))},onSessionEnd:function(){i.emit("xr.session.end",_("xr.session.end",{session:null,machineType:i.xrManager.machineType}))}}),i.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},i.xrControllerRay.left.params.Points={threshold:.1},i.xrControllerRay.right.params.Points={threshold:.1},i.pointerLines={left:new Oa,right:new Oa},i.pointerLines.left.visible=!1,i.pointerLines.right.visible=!0,i.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),i.pointerLines.left.points.material.depthTest=!1,i.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),i.pointerLines.right.points.material.depthTest=!1,i.scene.add(i.pointerLines.left,i.pointerLines.right),i.panoResources={},i.panoResources[i.locationMotion.keyframes[0].key=i.locationMotion.keyframes[1].key=vt()]={panoId:Be(i.currentPano),leftPanoPicture:null,position:i.camera.pose.offset.clone(),effect:"fade"},i.parallaxCameraMatrixs=[],i.onlyUseRightController=(r=e.onlyUseRightController)!==null&&r!==void 0?r:!1;var a=it.shared.getContext();if(!a)return console.error("获取session失败,请退出重试"),i;i.on("xr.session.end",function(){i.scene.remove(i.pointerLines.left,i.pointerLines.right)}),i.xrManager.setSession(a),i.controllerWrappers=[new d.Group,new d.Group],i.scene.add(i.controllerWrappers[0],i.controllerWrappers[1]);var o=i.xrManager.getController(0);i.controllerWrappers[0].add(o);var s=i.xrManager.getController(1);i.controllerWrappers[1].add(s);var u=new Pp;return u.gltfLoader={load:function(c,l){ci.ajax(c,{responseType:"arraybuffer"}).then(function(h){var p;return Ga(h.body,{resourcePath:c.slice(0,c.lastIndexOf("/")+1),search:(p=c.split("?")[1])!==null&&p!==void 0?p:"",fetcher:ci})}).then(function(h){return l(h)})}},i.on("xr.session.start",function(){var c=i.xrManager.getControllerGrip(0);if(c.add(u.createControllerModel(c)),i.controllerWrappers[0].add(c),!i.onlyUseRightController){var l=i.xrManager.getControllerGrip(1);l.add(u.createControllerModel(l)),i.controllerWrappers[1].add(l)}}),i.xrControllerState={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}},i}return t.parseArgs=function(e){if(e instanceof t)return e;var r=R(R({},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 R(R({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,u,c;this.userAction=i,this.stopMomentumMovement();var l=this.works.getResolvedObserver(e);if(!l)throw new Error("Invalid PanoIndex");var h=this.imageOptions.size;if(typeof h>"u"&&l){var p=l.images.up.match(/\/cube_(\d+)\//);p&&(h=Number(p[1]))}typeof h>"u"&&(h=2048);var v=this.imageOptions.transform,m=function(P,S){return Bp(di(P,v,S))},A=R({key:"pano.".concat(l.panoId)},sr(this.imageOptions,["format","size","quality"])),y=l.images,f=(s=(o=l.images.tiles)===null||o===void 0?void 0:o.filter(function(P){return P.size>h}))!==null&&s!==void 0?s:null,g="pano:"+fn([y,A,v]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===g)return;var b=this.pendingTextureTask.panoId;(u=this.panoMeshes[b])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:l.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var w=this.models.getMaterial()||{},E=w.pano0,x=w.pano1,M;if((E==null?void 0:E.map.name)===g?M=E:(x==null?void 0:x.map.name)===g&&(M=x),M){var C={panoId:l.panoId,effect:(c=r.effect)!==null&&c!==void 0?c:"fade",leftPanoPicture:{map:M.map,luminanceMap:M.luminanceMap,matrix:new d.Matrix4().compose(l.position,l.quaternion,Qs)},position:l.position.clone()};this.doMoveToPano(l.pano,C,r);return}var I="move-to-pano-"+l.panoId;this.pending.add(I),this.pendingTextureTask={panoId:l.panoId,hash:g,onLoad:function(P){var S;if(a.pending.delete(I),a.destroyed)P.body.dispose();else{P.body.name=g;var F={panoId:l.panoId,effect:(S=r.effect)!==null&&S!==void 0?S:"fade",leftPanoPicture:{map:P.body,luminanceMap:null,matrix:new d.Matrix4().compose(l.position,l.quaternion,Qs)},position:l.position.clone()};a.doMoveToPano(l.pano,F,r)}},onError:function(P){a.pending.delete(I);var S=R(R(R({},l.pano),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.error",_("pano.error",{error:P,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:S})),a.emit("pano.cancel",_("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:S})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&f&&f.length?this.textureLoader.loadTiledCubeTexture(y,f,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:m,options:A},format:d.RGBAFormat,viaAjax:!0,fetcher:pt(l.work)},void 0,void 0,function(P){var S,F;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:P,meta:null,pano:l.pano})),((S=a.pendingTextureTask)===null||S===void 0?void 0:S.hash)===g&&((F=a.panoMeshes[l.panoId])===null||F===void 0||F.setProgress(P))},this.renderer):this.textureLoader.loadCubeTexture(y,{imageURL:{transform:m,options:A},format:d.RGBAFormat,fetcher:pt(l.work)},void 0,void 0,function(P){var S,F;((S=a.pendingTextureTask)===null||S===void 0?void 0:S.hash)===g&&((F=a.panoMeshes[l.panoId])===null||F===void 0||F.setProgress(P)),a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:P,meta:null,pano:l.pano}))},this.renderer)]).then(function(P){var S,F,k=P[0];((S=a.pendingTextureTask)===null||S===void 0?void 0:S.hash)===g?(a.pendingTextureTask.onLoad(k),(F=a.panoMeshes[l.panoId])===null||F===void 0||F.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:k.meta,pano:l.pano}))):k.body.dispose()}).catch(function(P){var S,F;((S=a.pendingTextureTask)===null||S===void 0?void 0:S.hash)===g&&(a.pendingTextureTask.onError(P),(F=a.panoMeshes[l.panoId])===null||F===void 0||F.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:P,progress:0,meta:null,pano:l.pano})),a.emit("error",P))}),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:l.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u;i===void 0&&(i={});var c=ve(),l=vt();this.panoResources[l]=r;var h=1,p,v,m;if(this.locationMotion.ended){var A=this.locationMotion.getKeyFrameSegment(c);A[0];var y=A[1],f=this.locationMotion.value,g=this.panoResourceFromLocationMotionKeyframe(y).position,b=r.position;p=Math.max(g.distanceTo(b),h),v=[{key:y.key,progress:0,value:R(R({},f),{count:0})},{key:l,progress:1,value:{distance:0,count:1}}],m=0}else{var w=this.locationMotion.getKeyFrameSegment(c),E=w[0],y=w[1],f=this.locationMotion.value,x=this.panoResourceFromLocationMotionKeyframe(E).position,g=this.panoResourceFromLocationMotionKeyframe(y).position,b=r.position,M=y.value.count-f.count,C=Math.max(x.distanceTo(g),h)*M,I=Math.max(g.distanceTo(b),h);p=C+I,v=[{key:E.key,progress:0,value:R({},f)},{key:y.key,progress:C/p,value:y.value},{key:l,progress:1,value:{count:y.value.count+1,distance:0}}];var P=this.locationMotionKeyframesLength(this.locationMotion.keyframes),S=this.locationMotionKeyframesLength(v);m=this.locationMotion.getProgressVelocity(c)*P/S}var F=this.calculateMovingDuration(i.duration,p),k={longitude:i.longitude,latitude:i.latitude,fov:i.fov},O=R(R({},e),{mode:this.mode,longitude:(o=k.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=k.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=k.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:0}),L=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:L,progress:0,state:O,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(O),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),this.cameraMotion.set(k,F).catch(Q);var N=this.locationMotion.setKeyframes(v,F,m);N.then(function(){var V,j,z,U=R(R({},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:L,progress:1,state:U,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(U);var X=a.works.getResolvedObserver(a.currentPano);if(X&&X.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var G=Rp.clone().multiply((z=(j=(V=a.models.getMaterial())===null||V===void 0?void 0:V.pano1)===null||j===void 0?void 0:j.matrix)!==null&&z!==void 0?z:new d.Matrix4).multiply(X.video.matrix),K={map:a.videoTexture,size:X.video.size,matrix:G,alpha:1},Y=vt(),H=a.videoTexture.image;H.setAttribute("uuid",Y),Ju().then(function(J){J&&X.video&&H.getAttribute("uuid")===Y&&(H.oncanplay=function(){H.oncanplay=Q,H.play()},H.ontimeupdate=function(){H.currentTime>.5&&(H.ontimeupdate=Q,a.panoVideo.setMaterial(K))},H.src=X.video.source)}).catch(function(){H.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:L,progress:0,state:O,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var u=this.camera.getDirection(new d.Vector3).setY(0),c=null,l=this.works.getResolvedObserver(this.currentPano);if(!l)return null;var h=l.accessibleIds.filter(function(Y){var H=Ye(Y);if(Ft(H,r.currentPano))return!1;var J=r.works.getResolvedObserver(H);return!J||J.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:J.loadable||J.active}),p=this.models.intersectRaycaster(e)[0];if(p){var v=Ot(h,function(Y){var H=r.works.getResolvedObserver(Y);if(!H)return 1/0;var J=H.standingPosition.clone();return J.distanceTo(p.point)},!0),m=v[0],A=v[1];m&&A<this.panoTapTriggerRadius&&(c=(i=this.works.getResolvedObserver(m))!==null&&i!==void 0?i:null)}if(Fs(c)){var y=this.getForwardObserverOrNot(e);y&&(c=y)}for(var f=0,g=this.locationMotion.keyframes;f<g.length;f++){var b=g[f],w=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&c&&w.panoId===c.panoId){c=null;break}}if(Fs(c))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(c&&!c.active){var E=c.panoId;this.panoMeshes[E]&&(this.panoMeshes[E].setDisabled(!1),this.panoMeshes[E].setLoading(!0))}var x={};if(c){x.effect="fade";for(var M=Math.PI/6,C=Math.PI/12,I=new d.Vector3(0,1,0),P=c.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),S=P.clone().applyAxisAngle(I,M),F=P.clone().applyAxisAngle(I,-M),k=[],O=[],L=[],N=0,V=c.accessibleIds;N<V.length;N++){var m=V[N],j=Ye(m);if(!(Ft(j,this.currentPano)||Ft(j,c.pano))){var z=this.works.getResolvedObserver(m);if(z){var U=z.position.clone().sub(c.position).setY(0);P.angleTo(U)<M?L.push(U):S.angleTo(U)<M?k.push(U):F.angleTo(U)<M&&O.push(U)}}}var X=L.length>0?L:at(at([],k,!0),O,!0),G=X.slice().sort(function(Y,H){return Y.angleTo(P)-H.angleTo(P)})[0];G&&G.angleTo(u)>C&&(x.longitude=Math.atan2(-G.x,-G.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(x.latitude=le(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(x.fov=this.defaultFov);var K={workCode:c.pano.workCode,panoIndex:c.pano.panoIndex,mode:this.mode,longitude:(a=x.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=x.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=x.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:c?c.position.clone():new d.Vector3};return this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:K,userAction:!0,options:x,progress:0,error:null})),c&&c.active?(this.emit("pano.request",_("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:K,options:x,error:null})),c.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,u,c,l,h,p,v=[],m=2;m<arguments.length;m++)v[m-2]=arguments[m];this.userAction=!0;var A={},y={},f=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),b=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),y.longitude=this.cameraMotion.value.longitude,y.latitude=this.cameraMotion.value.latitude,y.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),A.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(le(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),E=w[0],x=w[1],M=this.panoResourceFromLocationMotionKeyframe(E),C=this.panoResourceFromLocationMotionKeyframe(x),I=new d.Vector3().copy(M.position),P=new d.Vector3().copy(C.position),S=this.locationMotion.value.count-x.value.count+1;A.progress=S,C.leftPanoPicture&&(S<1?M.leftPanoPicture&&(A.pano0=M.leftPanoPicture):A.pano0=C.leftPanoPicture,A.pano1=C.leftPanoPicture),b=A.useBlackTransition=C.effect==="instant"||C.effect==="montage",(C.effect==="fade"||C.effect==="montage")&&(A.pano0&&M.leftPanoPicture&&(A.pano0={map:A.pano0.map,luminanceMap:A.pano0.luminanceMap,matrix:M.leftPanoPicture.matrix.clone().setPosition(C.position)}),I.copy(P)),y.distance=this.locationMotion.value.distance,y.offset=new d.Vector3(I.x+(P.x-I.x)*S,I.y+(P.y-I.y)*S,I.z+(P.z-I.z)*S);for(var F=[],k=[],O=0,L=this.locationMotion.keyframes;O<L.length;O++){var N=L[O],V=N.key,j=N.progress;V!==void 0&&(F.push(V),j>=this.locationMotion.progress&&k.push(V))}for(var z=0,U=Object.keys(this.panoResources);z<U.length;z++){var X=U[z];if(!(k.indexOf(X)>=0)){var G=this.panoResources[X];if(G.leftPanoPicture){var K=G.leftPanoPicture.map;if(K){if(K===((a=A.pano0)===null||a===void 0?void 0:a.map)||K===((o=A.pano1)===null||o===void 0?void 0:o.map))continue;K instanceof Qe&&K.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(K.cubeRenderTarget),K.dispose(),G.leftPanoPicture=null}}F.indexOf(X)>=0||delete this.panoResources[X]}}this.currentPano=Ye(C.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:Ye(f.panoId),state:R(R(R(R({},Ye(g.panoId)),{mode:this.mode}),Ve(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}St(A)===!1&&(!((s=A.pano0)===null||s===void 0)&&s.map&&A.pano0.map instanceof Qe&&!A.pano0.map.cubeRenderTarget&&(A.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=A.pano1)===null||u===void 0)&&u.map&&A.pano1.map instanceof Qe&&!A.pano1.map.cubeRenderTarget&&(A.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(A)),St(y)===!1&&this.setCamera(y);var Y=this.works.getResolvedObserver(this.currentPano),H=v[1];if(!H){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var J=this.xrManager.referenceSpace;if(J){var ne=this.xrManager.cameraVR,$=this.xrManager.cameraL,te=this.xrManager.cameraR,ae=[$,te],ce=H.getViewerPose(J),oe=new d.Vector3(0,0,0);if(ce){var fe;fe=this.xrManager.session.renderState.baseLayer;var Ie=ce.views;if(!fe){console.error("no layer found");return}this.renderer.setFramebuffer(fe.framebuffer);var Ae=!1;Ie.length!==ne.cameras.length&&(ne.cameras.length=0,Ae=!0),this.parallaxCameraMatrixs=[];var Fe=new d.Vector3,re=new d.Vector3;new d.Matrix4().fromArray(Ie[0].transform.matrix).decompose(Fe,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(Ie[1].transform.matrix).decompose(re,new d.Quaternion,new d.Vector3),re.clone().sub(Fe).normalize();var he=new d.Vector3,W=new d.Quaternion,Oe=new d.Vector3;this.camera.matrix.decompose(he,W,Oe);for(var ke=0;ke<Ie.length;ke++){var Je=Ie[ke],Ze=fe.getViewport(Je),De=ae[ke];De.matrix.fromArray(Je.transform.matrix);var We=new d.Vector3,Le=new d.Quaternion,ye=new d.Vector3;De.matrix.decompose(We,Le,ye),oe.copy(he),De.position.copy(he),De.quaternion.copy(Le),De.scale.copy(ye),De.updateMatrix(),De.projectionMatrix.fromArray(Je.projectionMatrix),De.viewport.set(Ze.x,Ze.y,Ze.width,Ze.height),Ae===!0&&ne.cameras.push(De)}ce.views[0].transform.position,ce.views[1].transform.position;for(var me=this.xrManager.session.inputSources,ke=0;ke<this.xrManager.controllers.length;ke++){var lt=this.xrManager.controllers[ke],Se=me[ke];if(Se){lt.update(Se,H,J);var $e=this.xrManager.getController(ke),Ue=new d.Vector3(0,1.2,0),At=$e.position.clone().add(oe).sub(Ue);Se.handedness==="left"?this.xrControllerRay.left.set(At,new d.Vector3(0,0,-1).applyEuler($e.rotation)):Se.handedness==="right"&&this.xrControllerRay.right.set(At,new d.Vector3(0,0,-1).applyEuler($e.rotation)),this.controllerWrappers[ke].position.copy(new d.Vector3(0,0,0).add(oe).sub(Ue));var Ke=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ke.length===0&&(Ke=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(ft){var Et;return R({floor:(Et=Y==null?void 0:Y.floorIndex)!==null&&Et!==void 0?Et:0},ft)})),Ke.length>=1&&Ke[0].face)if(Se.handedness==="right"){var Gt=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Kt=Ke[0].face.normal,ze=Kt.clone().multiplyScalar(.05),ot=Ke[0].point.clone().add(ze);this.intersectMesh.position.copy(ot);var $t=ot.clone().add(ze);if(this.intersectMesh.lookAt($t),Math.abs(Kt.y)>.99){var He=this.camera.position.clone().sub(ot);this.intersectMesh.rotation.z=-Math.atan2(He.z,He.x)}this.intersectMesh.visible=!0,this.needsRender=!0,Gt.length>0?(this.pointerLines.right.setPoints(At,Gt[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(At,Ke[0].point));var ct=Ke[0],wt=_("intersect.update",{raycaster:(c=this.xrControllerRay.right)!==null&&c!==void 0?c:null,intersection:ct??null,object:this.intersectMesh});if(this.emit("intersect.update",wt),wt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(At,Ke[0].point)}}if(this.camera.pose.distance>.1||b){if(Y)for(var Tt=0,er=Object.keys(this.panoMeshes);Tt<er.length;Tt++){var mt=er[Tt],Te=this.panoMeshes[mt];Te.setOpacity(0),Te.setCurrent(!1),Te.updateTime&&Te.updateTime(e,r)}}else if(Y){var wr=Ot(Y.visibleIds,function(st){var ft=i.works.getResolvedObserver(st);return ft?Y.standingPosition.distanceTo(ft.standingPosition):1/0},!0),kt=wr[1];kt=le(kt,2.5,1/0);for(var ur=Y.visibleIds.concat(Be(this.currentPano)),Lt=this.getForwardObserverOrNot(),mn=this.camera.getDirection(new d.Vector3),Qr=0,Vr=Object.keys(this.panoMeshes);Qr<Vr.length;Qr++){var mt=Vr[Qr],Te=this.panoMeshes[mt],lr=this.works.getResolvedObserver(mt);if(ur.indexOf(mt)===-1)Te.setCurrent(!1),Te.setOpacity(0);else if(!lr)Te.setCurrent(!1),Te.setOpacity(0);else if(!lr.loadable&&!lr.active)Te.setCurrent(!1),Te.setOpacity(0);else{var cr=Te.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Te.setCurrent(!Te.loading&&Te.progress===0&&Lt!==null&&Lt.panoId===mt),Te.setOpacity(cr<.01?0:le(kt/cr*1.2,.65,.98));var rt=this.camera.position.clone().setY(Te.position.y),Xe=new d.Vector3().copy(Te.position).sub(rt).normalize();if(mt===Be(this.currentPano)){var Dt=le((.5-rt.distanceTo(Te.position))/.5,0,1);Xe.multiplyScalar(1-Dt).add(mn.clone().multiplyScalar(Dt))}Xe.length()>0&&Te.quaternion.setFromEuler(new d.Euler(0,Math.atan2(Xe.x,Xe.z),0))}Te.updateTime&&Te.updateTime(e,r)}}var dr=function(){if(i.tileLevelForFov===!1)return 0;var st=new d.Vector2(4e3,4e3),ft=g.panoId,Et=i.works.getResolvedObserver(ft),xt=i.imageOptions.size;if(typeof xt>"u"&&Et){var zn=Et.images.up.match(/\/cube_(\d+)\//);zn&&(xt=Number(zn[1]))}typeof xt>"u"&&(xt=2048);var qr=0;xt>=1024&&(qr=1),xt>=2048&&(qr=2),xt>=4096&&(qr=3),xt>=8192&&(qr=4);var zr=i.tileLevelForFov($.fov,st);return zr>qr?zr:0}(),gn=function(){var st=new d.PerspectiveCamera;st.applyMatrix4(ne.matrix),st.position.set(0,0,0);var ft=i.works.getResolvedObserver(g.panoId),Et=ft??Y;Et&&st.quaternion.premultiply(Et.quaternion.clone().inverse()),st.updateProjectionMatrix(),st.updateMatrixWorld(!0);var xt=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(st.projectionMatrix,st.matrixWorldInverse));return xt}();g.panoId===Be(this.currentPano)&&((l=g.leftPanoPicture)===null||l===void 0?void 0:l.map)instanceof Qe&&(g.leftPanoPicture.map.update(gn,dr),g.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0));{var qn=this.tiling.object.visible;if(dr>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var Ur=g.panoId,dt=this.works.getResolvedObserver(Ur);dt?Ti(this.camera.position,dt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Ur&&this.tiling.cleanup(),this.tiling.panoId=Ur,this.tiling.setResource((p=(h=dt.images)===null||h===void 0?void 0:h.tiles)!==null&&p!==void 0?p:[],this.enableIOSEDR&&dt.images.luminance?dt.images.luminance:null),this.tiling.setFetcher(pt(dt.work)),this.tiling.setRotation(dt.quaternion),this.tiling.setPosition(dt.position),this.tiling.update(gn,dr,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;qn!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),!(!me||me.length<1)&&this.updateControllerHelper(me,e,r)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.scene,e)},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}},u=0;u<e.length;u++){var c=e[u].handedness,l=e[u].gamepad;switch(c){case"left":l.axes&&(this.emitEvent(l.axes[2]===-1,"LeftAxesLeft",r),this.emitEvent(l.axes[2]===1,"LeftAxesRight",r),this.emitEvent(l.axes[3]===-1,"LeftAxesUp",r),this.emitEvent(l.axes[3]===1,"LeftAxesDown",r)),l!=null&&l.buttons&&(this.emitEvent(l==null?void 0:l.buttons[4].pressed,"X",r),this.emitEvent(l.buttons[5].pressed,"Y",r),this.emitEvent(l==null?void 0:l.buttons[0].pressed,"LeftTrigger",r),this.emitEvent(l==null?void 0:l.buttons[1].pressed,"LeftPinch",r));var h={raycaster:a,axes:{up:l.axes&&l.axes[3]<0?Math.abs(l.axes[3]):0,down:l.axes&&l.axes[3]<0?0:Math.abs(l.axes[3]),left:l.axes&&l.axes[2]<0?Math.abs(l.axes[2]):0,right:l.axes&&l.axes[2]<0?0:Math.abs(l.axes[2])},deltaTime:i};s.buttons.X=l.buttons&&l.buttons[4]?l.buttons[4].pressed:!1,s.buttons.Y=l.buttons&&l.buttons[5]?l==null?void 0:l.buttons[5].pressed:!1,s.buttons.LeftTrigger=l.buttons&&l.buttons[0]?l==null?void 0:l.buttons[0].pressed:!1,s.buttons.LeftPinch=l.buttons&&l.buttons[1]?l==null?void 0:l.buttons[1].pressed:!1,s.left=h;break;case"right":l.axes&&(this.emitEvent(l.axes[2]===-1,"RightAxesLeft",r),this.emitEvent(l.axes[2]===1,"RightAxesRight",r),this.emitEvent(l.axes[3]===-1,"RightAxesUp",r),this.emitEvent(l.axes[3]===1,"RightAxesDown",r)),l.buttons&&(this.emitEvent(l==null?void 0:l.buttons[4].pressed,"A",r),this.emitEvent(l.buttons[5].pressed,"B",r),this.emitEvent(l==null?void 0:l.buttons[0].pressed,"RightTrigger",r),this.emitEvent(l==null?void 0:l.buttons[1].pressed,"RightPinch",r));var p={raycaster:o,axes:{up:l.axes&&l.axes[3]<0?Math.abs(l.axes[3]):0,down:l.axes&&l.axes[3]<0?0:Math.abs(l.axes[3]),left:l.axes&&l.axes[2]<0?Math.abs(l.axes[2]):0,right:l.axes&&l.axes[2]<0?0:Math.abs(l.axes[2])},deltaTime:i};s.right=p,s.buttons.A=l.buttons&&l.buttons[4]?l==null?void 0:l.buttons[4].pressed:!1,s.buttons.B=l.buttons&&l.buttons[5]?l==null?void 0:l.buttons[5].pressed:!1,s.buttons.RightTrigger=l.buttons&&l.buttons[0]?l==null?void 0:l.buttons[0].pressed:!1,s.buttons.RightPinch=l.buttons&&l.buttons[1]?l==null?void 0:l.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",_("xr.controller.update",s))}},t.prototype.emitEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrControllerState[r].touchStart===!1)this.xrControllerState[r].touchStartTime=i,this.xrControllerState[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.xrControllerState[r].touchStartTime;s>Ns&&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.xrControllerState[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.xrControllerState[r].touchStartTime;if(s<=Ns){var u=this.emit("xr.gesture.tap",_("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));u||r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrControllerState[r].touchStart=!1,this.xrControllerState[r].touchStartTime=0}},t}(ao),Vt={Floorplan:si,Topview:Hf,Panorama:ao,VRPanorama:Hh,Model:_h,DepthPanorama:$h,Mapview:cp,XRPanorama:Fp},d0=["gesture.pan","gesture.tap","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 Op(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.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=Rr(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 kp(){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}function Lp(n){{var t=new d.DirectionalLight(16777215,.5);t.position.copy(new d.Vector3(1,1,1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.3);n.add(t)}{var t=new d.AmbientLight(16777215,.3);n.add(t)}}function Dp(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],u=s.split("="),c=(t=u[0])===null||t===void 0?void 0:t.trim(),l=(e=u[1])===null||e===void 0?void 0:e.trim();c&&l&&(r[c]=l)}return r}function f0(){for(var n,t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=Dp((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const Np="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJ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wsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var Vs=[351,63],Us=[20,20],Qp=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Vp=new Float32Array([0,0,1,0,0,1,1,1]),Up=new Uint8Array([0,1,2,1,3,2]),Fi=new d.BufferGeometry;Fi.setAttribute("position",new d.BufferAttribute(Qp,3));Fi.setAttribute("uv",new d.BufferAttribute(Vp,2));Fi.setIndex(new d.BufferAttribute(Up,1));var ui=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),h0=new d.Mesh(Fi,ui);h0.matrixAutoUpdate=!1;var co=new d.Scene;co.add(h0);co.matrixAutoUpdate=!1;var Un=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Un.position.set(0,0,.5);Un.lookAt(0,0,0);Un.updateMatrixWorld(!0);Un.matrixAutoUpdate=!1;var qp=new d.Vector4,zp=new d.Vector4;function qs(n){if(ui.map){var r=n.getViewport(qp),i=n.getScissor(zp),a=n.getScissorTest(),o=n.autoClear,s=i.x+Us[0]/3,u=i.y+Us[1]/3,c=Vs[0]/3,l=Vs[1]/3;n.setViewport(s,u,c,l),n.setScissor(s,u,c,l),n.setScissorTest(!0),n.autoClear=!1,n.render(co,Un),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,ui.needsUpdate=!0,e.onload=Q},e.src=Np,ui.map=t}}var Hp=800,jp=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/")},_p=[{name:"Z",transformToUpAxisZ:function(){return new d.Matrix4}},{name:"Y",transformToUpAxisZ:function(){return new d.Matrix4().makeRotationAxis(new d.Vector3(1,0,0),+Math.PI/2)}},{name:"-Y",transformToUpAxisZ:function(){return new d.Matrix4().makeRotationAxis(new d.Vector3(1,0,0),-Math.PI/2)}},{name:"WGS84",transformToEarthCentered:function(){return new d.Matrix4}},{name:"GCJ02",transformToEarthCentered:function(){return new d.Matrix4}},{name:"BD09",transformToEarthCentered:function(){return new d.Matrix4}}],on=new d.Vector2,ri=new d.Frustum,ni=new d.Matrix4,zs=new WeakMap,Hs=new WeakMap,js=Gu([]),p0=function(n){de(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,c,l,h,p,v=n.call(this)||this;v.ident=vt(),ka.instances[v.ident]=v,v.renderSwitch01=0,v.currentMode="Panorama",v.pano={workCode:"",panoIndex:0},v.needsRender=!1,v.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,v.imageOptions=R({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),v.textureOptions=R({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),v.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,v.extraElements=[],v.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),DepthPanorama:Object.assign({},e.depthPanorama),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},v.coordinatesSystemTransformers=at([],(s=e.coordinatesSystemTransformers)!==null&&s!==void 0?s:[],!0);for(var m=function(F){var k=A.coordinatesSystemTransformers.find(function(O){return O.name===F.name});k||A.coordinatesSystemTransformers.push(R({},F))},A=this,y=0,f=_p;y<f.length;y++){var g=f[y];m(g)}if(v.fps={testCount:0,testTime:ve()},v.info=null,v.modeChangeDuration=(u=e.modeChangeDuration)!==null&&u!==void 0?u:Hp,v.enableWheel=(c=e.enableWheel)!==null&&c!==void 0?c:!0,typeof window<"u")if(e.renderer)e.renderer instanceof _r&&v.throwError(new Error("cannot render a internal renderer")),v.renderer=e.renderer;else try{v.renderer=new _r({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e==null?void 0:e.webgl2});var b=f0();v.renderer.setPixelRatio(b===1?window.devicePixelRatio:1),v.renderer.setSize(512,512)}catch(F){F instanceof Error&&v.throwError(F)}v.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(h=(l=v.renderer)===null||l===void 0?void 0:l.outputEncoding)!==null&&h!==void 0?h:d.sRGBEncoding}),v.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),v.camera=new hi(90),v.scene=new cu,v.xrCustomObjectsScene=new d.Scene,v.scene.add(v.xrCustomObjectsScene),v.scene.matrixAutoUpdate=!1,v.lastLoadWorkTask=Promise.resolve(),v.requestProxy=(p=e.requestProxy)!==null&&p!==void 0?p:jp,v.networkSubscribe=new Zs,v.networkSubscribe.on("network",function(F,k,O,L){var N;v.emit("network.resource",_("network.resource",{source:F,requestType:k,requestState:O,detail:L})),(N=v.analysis)===null||N===void 0||N.network(v.works,F,k,O,L)}),v.boundingMesh=kf(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),v.boundingMesh.name="bounding",v.scene.add(v.boundingMesh),v.models=vs(),v.models.push(new Ba),v.lastModels=vs(),v.readyCallbacks=[],v.syncingState=!1,v.modelGroup=new d.Group,v.modelGroup.visible=!1,v.modelGroup.name="model",v.modelGroup.matrixAutoUpdate=!1,v.modelGroup.renderOrder=-4,v.scene.add(v.modelGroup),v.helperGroup=new d.Group,v.helperGroup.name="helper",v.helperGroup.matrixAutoUpdate=!1,v.scene.add(v.helperGroup),v.videoTexture=new d.VideoTexture(e.videoInstance||kp()),Lp(v.scene),v.copyEffect=new Bi(v.renderer,v.scene,v.camera,v.models),v.state={mode:v.currentMode,workCode:v.pano.workCode,panoIndex:v.pano.panoIndex,longitude:v.camera.pose.longitude,latitude:v.camera.pose.latitude,fov:v.camera.pose.fov,offset:v.camera.pose.offset.clone(),distance:v.camera.pose.distance},v.stateSynced=!1,v._enableIOSEDR=!1,v.destroyed=!1,v.paused=!0,typeof window<"u"&&(e.play!==!1&&v.play(),v.stopAnimationLoop=it.shared.add(function(F,k){for(var O=[],L=2;L<arguments.length;L++)O[L-2]=arguments[L];v.updateTime.apply(v,at([F,k],O,!1))},!1,0,10));var w=function(){typeof document<"u"&&document.fullscreenElement===null&&v.currentMode==="VRPanorama"&&v.controller.emit("vr.requestExit",_("vr.requestExit",{}))};if(typeof document<"u"&&document.addEventListener("fullscreenchange",w,!1),v.removeEventListeners=function(){typeof document<"u"&&document.removeEventListener("fullscreenchange",w,!1)},v.plugins={},e.plugins&&e.plugins.length)for(var E=0,x=e.plugins;E<x.length;E++){var M=x[E];if(typeof M=="function")M(v);else if(Array.isArray(M)){var C=M[0],I=M[1],P=M[2];if(typeof C=="function"){var S=C(v,P);typeof I=="string"&&(v.plugins[I]?v.throwError(new Error("plugin name ".concat(I," is exists."))):v.plugins[I]=S)}}}return v.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1),v.meshReplaceMaterialMap=new Map,v.meshOriginMaterialMap=new Map,Op(v),v}return Object.defineProperty(t,"version",{get:function(){return"6.0.0-alpha.65"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return mi.decoderPath},set:function(e){mi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Fn.transcoderPath},set:function(e){Fn.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(h){if(!(!(h instanceof d.Mesh)||h instanceof _t)){var p=Object.keys(i).filter(function(m){return m===h.uuid})[0];if(p)if(s.meshOriginMaterialMap.set(p,h.material),s.meshReplaceMaterialMap.get(p))h.material=s.meshReplaceMaterialMap.get(p);else{var v=new d.ShaderMaterial({uniforms:{color:{value:i[p]}},vertexShader:`
|
|
2039
2039
|
void main() {
|
|
2040
2040
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
2041
2041
|
gl_Position = projectionMatrix * mvPosition;
|
|
@@ -2045,4 +2045,4 @@ void main() {
|
|
|
2045
2045
|
void main() {
|
|
2046
2046
|
gl_FragColor = vec4( color, 1.0 );
|
|
2047
2047
|
}
|
|
2048
|
-
`});v.depthTest=h.material.depthTest,v.side=h.material.side,s.meshReplaceMaterialMap.set(p,v),h.material=v}}});var u=this.renderer.getSize(new d.Vector2);this.camera.setViewOffset(u.width,u.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var c=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,c),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(h){!(h instanceof d.Mesh)||h instanceof _t||s.meshOriginMaterialMap.get(h.uuid)&&(h.material=s.meshOriginMaterialMap.get(h.uuid))}),this.models.setMaterial({constantColor:null});var l=Object.keys(i).filter(function(h){return i[h].equals(new d.Color().setRGB(c[0]/255,c[1]/255,c[2]/255))})[0];return l||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete ka.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 u=s[o];u.dispose()}this.models.length=0,this.models.setMaterial({pano0:null,pano1:null}),this.meshReplaceMaterialMap.forEach(function(c){c.dispose()}),this.meshOriginMaterialMap.forEach(function(c){c.dispose()}),this.renderer instanceof _r&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize()},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?"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.models.getMaterial().useEDL},set:function(e){var r,i,a,o;if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启EDL");if(this.models.setMaterial({useEDL:e}),this.boundingMesh.visible=!e,e){if(!this.screenBuffers){var s=this.getDrawingBufferSize(on);this.screenBuffers=[new d.WebGLRenderTarget(s.x,s.y,{encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:d.sRGBEncoding,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType}),new d.WebGLRenderTarget(s.x,s.y,{encoding:(o=(a=this.renderer)===null||a===void 0?void 0:a.outputEncoding)!==null&&o!==void 0?o:d.sRGBEncoding,minFilter:d.LinearMipMapLinearFilter,magFilter:d.LinearMipMapLinearFilter})]}}else this.screenBuffers&&(this.screenBuffers.forEach(function(u){u.dispose()}),delete this.screenBuffers);this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this.models.getMaterial().useHQWeight||this.models.getMaterial().useHQDepth||!1},set:function(e){var r,i;if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启HQ");if(e===!0?this.models.setMaterial({useHQDepth:!0,useHQWeight:!1,pointShape:"CIRCLE"}):this.models.setMaterial({useHQDepth:!1,useHQWeight:!1}),this.boundingMesh.visible=!e,e){if(!this.screenBuffers){var a=this.getDrawingBufferSize(on),o=new d.WebGLRenderTarget(a.x,a.y,{minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(a.x,a.y,d.UnsignedIntType)});o.depthTexture.format=d.DepthFormat,o.depthBuffer=!0;var s=new d.WebGLRenderTarget(a.x,a.y,{encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:d.sRGBEncoding,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:o.depthTexture});this.screenBuffers=[o,s]}}else this.screenBuffers&&(this.screenBuffers.forEach(function(u){u.dispose()}),delete this.screenBuffers);this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return this.screenBuffers!==void 0},set:function(e){var r,i,a,o;if(e){if(!this.screenBuffers){var s=this.getDrawingBufferSize(on);this.screenBuffers=[new d.WebGLRenderTarget(s.x,s.y,{encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:d.sRGBEncoding}),new d.WebGLRenderTarget(s.x,s.y,{encoding:(o=(a=this.renderer)===null||a===void 0?void 0:a.outputEncoding)!==null&&o!==void 0?o:d.sRGBEncoding})]}}else this.screenBuffers&&(this.screenBuffers.forEach(function(u){u.dispose()}),delete this.screenBuffers);this.needsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e){var r=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),this.currentMode==="Panorama"&&(r=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),this.currentMode==="Model"&&(r=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),this.currentMode==="Floorplan"&&(r=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),this.currentMode==="Topview"&&(r=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.topview),this.currentMode==="Mapview"&&(r=!0)),e.depthPanorama&&(Object.assign(this.controllerInits.DepthPanorama,e.depthPanorama),this.currentMode==="DepthPanorama"&&(r=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),this.currentMode==="VRPanorama"&&(r=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="DepthPanorama"||this.currentMode==="VRPanorama")&&(r=!0)),r&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions)},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof _r)){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,u=e.height,c=u===void 0?a.offsetHeight:u;this.renderer instanceof _r&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,c))}this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(),this.needsRender=!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,Qf(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=_s.get(this);if(!e)return Gs;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!Ja.has(a))return Gs}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 Uf(e)?e.then(function(u){return o.load_(u,r,i,a)}):o.load_(e,r,i,a)});return this.lastLoadWorkTask=s.catch(function(u){o.throwError(u)}),s},t.prototype.load_=function(e,r,i,a){var o=this,s,u,c,l,h,p;a===void 0&&(a=!0);var v=[];if(Array.isArray(e))for(var m=0,A=e;m<A.length;m++){var y=A[m];typeof y!="string"&&"work"in y?v.push(On(y.work,y)):v.push(On(y))}else v.push(On(e));for(var f=Wu(v),g=function(U){var X=b,G=new za({allowHosts:U.allowHosts,get requestProxy(){return X.requestProxy},get networkSubscribe(){return X.networkSubscribe}});df(U,G)},b=this,w=0,E=f;w<E.length;w++){var x=E[w];g(x)}var M=this.works;r===void 0&&(r=M.length!==0?"inherit":"initial");var C=f.initial,I=C.work.observers[0],P=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:C.work.workCode,panoIndex:0},S=(s=C.mode)!==null&&s!==void 0?s:I?"Panorama":"Mapview",F={};if(r==="inherit"){S=this.currentMode;var k=f.resolvedObservers[this.panoIndex];k?P={workCode:k.work.workCode,panoIndex:k.panoIndex}:typeof f.initial.panoIndex=="number"?P={workCode:f.initial.work.workCode,panoIndex:f.initial.panoIndex}:(S==="Panorama"||S==="DepthPanorama"||S==="VRPanorama"||S==="XRPanorama")&&(S="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 C.panoIndex=="number"&&(P={workCode:C.work.workCode,panoIndex:C.panoIndex}),C.mode&&(S=C.mode),F={longitude:C.longitude,latitude:C.latitude,fov:C.fov,distance:C.distance,offset:(u=C.offset)===null||u===void 0?void 0:u.clone()};else{if(S=(c=r.mode)!==null&&c!==void 0?c:this.currentMode,typeof r.panoIndex=="number"){var k=f.getResolvedObserver({workCode:(h=(l=r.workCode)!==null&&l!==void 0?l:C.work.workCode)!==null&&h!==void 0?h:"",panoIndex:r.panoIndex});k&&(P={workCode:k.work.workCode,panoIndex:k.panoIndex})}F={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var O=R(R(R({},P),{mode:S}),F);this.emit("works.request",_("works.request",{input:e,works:f,state:O,userAction:a}));var L=function(){o.pano=P;var U=o.controller?i??o.modeChangeDuration:0,X=R(R({initial:{state:O,currentState:o.getCurrentState(),duration:U,userAction:a}},o.commonParams()),o.controllerInits[S]);if(o.controller&&o.currentMode===S)o.controller.updateWork(f,O,U,a)===!1&&(o.controller.destroy(),o.controller=o.applyController(S,X));else{var G=o.currentMode,K=Vt[S].initAnimationEndState(X);if(o.controller)o.controller.destroy();else{var Y=Vt[S].initAnimationEndState(X);o.camera.setFromPose(Y),o.modelGroup.visible=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(S,X);var H=_("mode.change",{prevMode:G,mode:S,state:K,userAction:a});o.emit("mode.change",H)}};if(_s.set(this,f),!this.controller){var N=R(R({initial:{state:O,currentState:this.getCurrentState(),duration:0,userAction:a}},this.commonParams()),this.controllerInits[S]),V=Vt[S].initAnimationEndState(N);this.camera.setFromPose(V),this.emit("camera.update",_("camera.update",{state:this.getCurrentState(),userAction:a}))}if(S===t.Mode.Floorplan||S===t.Mode.Topview||S===t.Mode.Mapview||S===t.Mode.Model)this.loadModel(f).then(function(){o.needsRender=!0,L(),o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))});else{if(!this.controller){var j=new d.Vector3,z=f.getResolvedObserver(P);z&&j.copy(z.position),this.camera.setFromPose({fov:F.fov,longitude:F.longitude,latitude:F.latitude,distance:F.distance,offset:(p=F.offset)!==null&&p!==void 0?p:j}),this.needsRender=!0}L(),this.controller.once("pano.moveTo",function(){o.needsRender=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(f)})}return this.emit("works.load",_("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:f})),this.ready().then(function(){var U;o.emit("works.ready",_("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:f})),(U=o.analysis)===null||U===void 0||U.work(f)})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),i===void 0&&(i=this.modeChangeDuration),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(u,c){var l,h,p;if(!s.renderer)throw new Error("renderer is not initialized.");r=R({},r);var v=typeof r.panoIndex=="number"?{workCode:(p=(l=r.workCode)!==null&&l!==void 0?l:(h=s.work)===null||h===void 0?void 0:h.workCode)!==null&&p!==void 0?p:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var m=new Error('mode "'.concat(e,'" is not existed'));s.throwError(m),c(m);return}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!s.models.loaded){var m=new Error("model is not ready.");s.throwError(m),c(m);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(v)){var m=new Error("PanoId ".concat(Be(v)," not existed."));s.throwError(m),c(m);return}var A=s.controller,y=s.currentMode,f=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&y===e)e===t.Mode.Panorama||e===t.Mode.DepthPanorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?Ft(s.pano,v)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(v,R({duration:i},r),a):s.controller.updateCamera(r,i,a).catch(Q):(Ft(s.pano,v)||(s.pano=v),s.controller.updateCamera(r,i,a).catch(Q));else{var b=R(R({},r),v),w=R(R({initial:{state:b,currentState:s.getCurrentState(),duration:i,userAction:a}},s.commonParams()),s.controllerInits[e]),E=Vt[e].initAnimationEndState(w),x=_("mode.change.request",{prevMode:s.currentMode,mode:e,state:E,userAction:a});if(s.emit("mode.change.request",x),!x.defaultPrevented){A&&A.destroy(),s.controller=s.applyController(e,w);var M=_("mode.change",{prevMode:s.currentMode,mode:e,state:E,userAction:a});s.emit("mode.change",M)}}u()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),qf().then(function(){return f()}).catch(function(b){b instanceof Error&&(s.exitFullscreen(),s.throwError(b),c(b))});else if(e===t.Mode.XRPanorama){var g=it.shared.getContext();g?g.end():zf().then(function(b){it.shared.setContext(b),f()}).catch(function(b){b instanceof Error&&(s.throwError(b),c(b))})}else f()})},t.prototype.getPixels=function(e,r,i,a,o){if(o===void 0&&(o=1),!this.renderer)throw new Error("renderer is not initialized.");var s=this.getPixelsRenderTarget,u=this.renderer.getSize(new d.Vector2);e=le(e,Math.floor(i/2),Math.floor(u.x-i)),r=le(r,Math.floor(a/2),Math.floor(u.y-a)),s.setSize(i*o,a*o),this.renderer.setRenderTarget(s),this.camera.setViewOffset(u.width,u.height,e,u.height-r-a,i,a),this.controller?this.controller.render():this.renderer.render(this.scene,this.camera);var c=new Uint8Array(i*o*a*o*4);return this.renderer.readRenderTargetPixels(s,0,0,i*o,a*o,c),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),c},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(on);this.scene.traverseVisible(function(s){s.setResolution&&s.setResolution(a.x,a.y)})}if(this.controller&&this.screenBuffers&&this.renderer.getRenderTarget()===null){var o=this.getDrawingBufferSize(on);return this.screenBuffers.forEach(function(s){s.setSize(o.x,o.y)}),this.renderer.setRenderTarget(this.screenBuffers[0]),this.controller.render(),this.info={memory:R({},this.controller.renderer.info.memory),render:R({},this.controller.renderer.info.render)},this.currentMode!=="VRPanorama"&&this.currentMode!=="XRPanorama"&&this.poweredByRealsee&&Hs(this.renderer),e&&it.shared.add(e,!0),this.screenBuffers[0]}else return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(),i.info={memory:R({},i.controller.renderer.info.memory),render:R({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:R({},i.renderer.info.memory),render:R({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&Hs(i.renderer)),e&&it.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o,s,u=[],c=2;c<arguments.length;c++)u[c-2]=arguments[c];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,at([e,r],u,!1)),this.renderer){var l=this.getSize(on),h=this.renderer.getPixelRatio();this.camera.screenHeight=l.height,this.camera.pixelRatio=h,this.camera.aspect=l.width/l.height}if(this.camera.updateTime(e,r),this.renderer){Fn.detectSupport(this.renderer);var p=this.models.loaded,v=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),p===!1&&this.models.loaded===!0&&this.emit("models.load",_("models.load",{models:this.models})),v===!1&&this.models.refined===!0&&this.emit("models.refined",_("models.refined",{models:this.models})),this.models.loaded){for(var m=0,A=this.models;m<A.length;m++){var y=A[m];y.parent!==this.modelGroup&&(this.modelGroup.add(y),this.needsRender=!0)}if(this.lastModels.length>0){for(var f=0,g=this.lastModels;f<g.length;f++){var y=g[f];this.modelGroup.remove(y),y.dispose(),this.needsRender=!0}this.lastModels.length=0}}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 b=new d.Vector2(512,512),w=new d.Vector2(512,512);this.renderer&&(this.renderer.getSize(b),b.x*=this.scissor.width,b.y*=this.scissor.height,this.renderer.getDrawingBufferSize(w),w.x*=this.scissor.width,w.y*=this.scissor.height);{for(var E=new d.Box3,x=new d.Box3,M=new d.Vector3(4,4,4),C=0,I=this.works.resolvedObservers;C<I.length;C++){var P=I[C];x.setFromCenterAndSize(P.position,M),E.union(x)}E.union(this.models.bounding),E.getCenter(this.boundingMesh.position),E.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(E);var S=(o=this.models.getMaterial())!==null&&o!==void 0?o:{},F=1-((s=S.modelAlpha)!==null&&s!==void 0?s:0);S.opacity=le(F*4-3,0,1),S.clippers=null,S.shownFloorIndex=-2,this.boundingMesh.setMaterial(S),this.boundingMesh.needsRender=!1}var k=_("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",k),!k.defaultPrevented){var O=[];ni.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ri.setFromProjectionMatrix(ni);for(var L=0,N=this.scene.children;L<N.length;L++){var V=N[L];V!==this.modelGroup&&V!==this.boundingMesh&&V instanceof d.Object3D&&V.traverseVisible(function(H){if(H.setResolution&&H.setResolution(b.x,b.y),H.setTime&&H.setTime(e),H.mixer instanceof d.AnimationMixer){var J=js.get(H.mixer);J||(J=new d.Clock,js.set(H.mixer,J)),H.mixer.update(J.getDelta())}(H instanceof d.Mesh||H instanceof d.Line||H instanceof d.Points)&&(H instanceof d.ImmediateRenderObject||!H.frustumCulled||ri.intersectsObject(H))&&O.push(H)})}if(w.width*w.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var j=void 0;if(this.onlyRenderIfNeeds!==!0)j=this.render();else{if(this.controller&&this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0),this.models.needsRender===!0&&(this.models.needsRender=!1,this.needsRender=!0),this.needsRender!==!0)for(var z=0,U=O;z<U.length;z++){var X=U[z],G=function(H){H.needsRender===!0?(H.needsRender=!1,a.needsRender=!0):H.mixer&&H.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};G(X),X.traverseAncestors(G)}this.needsRender!==!1&&(j=this.render())}if(this.needsRender=!1,this.controller&&this.screenBuffers){var K=this.controller,Y=this.screenBuffers;this.aroundScissor(function(){K.postProcessing(Y,a.postProcessingType)})}this.hasListener("render")&&this.emit("render",_("render",{needsRender:j!==void 0,info:this.info}))}this.needsRender=!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 _r&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!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 u=this.works.getResolvedObserver(e);if(!u)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var c={workCode:u.work.workCode,panoIndex:u.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(c,r,i):u&&(this.pano=c,this.once("initAnimation.start",function(l){r.moveStartCallback&&r.moveStartCallback(l.state)}),this.once("initAnimation.end",function(l){r.moveEndCallback&&r.moveEndCallback(l.state)}),this.changeMode(t.Mode.Panorama,r,void 0,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")));a.work.allowHosts;var o=["right","left","up","down","front","back"],s=ve();return Promise.all(o.map(function(u){var c=R({key:"pano.".concat(a.panoId,".").concat(u)},sr(i.imageOptions,["size","format","quality","mappings"])),l=a.images[u],h=i.imageOptions.transform?i.imageOptions.transform(l,c):qt(l,c);return pt(a.work).preload(h)})).then(function(){var u=ve()-s;return r(u),u})},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 u=e.clone().project(this.camera);if(Math.abs(u.z)>1)return null;var c=this.renderer.getSize(new d.Vector2),l=c.x*this.scissor.width,h=c.y*this.scissor.height,p=c.x*this.scissor.left+(u.x+1)/2*l,v=c.y*(1-this.scissor.bottom-this.scissor.height)+(-u.y+1)/2*h;return new d.Vector2(p,v)},t.prototype.getRenderObjects=function(e){ni.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ri.setFromProjectionMatrix(ni),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||ri.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return R(R({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,u,c,l,h,p,v,m;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 A;typeof e.panoIndex=="number"&&(e.workCode?A={workCode:e.workCode,panoIndex:e.panoIndex}:A={workCode:(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",panoIndex:e.panoIndex});var y=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,f,g,b,w,E;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!==y){if(y==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var x={workCode:A==null?void 0:A.workCode,panoIndex:A==null?void 0:A.panoIndex};typeof e.longitude=="number"&&(x.longitude=e.longitude),typeof e.latitude=="number"&&(x.latitude=e.latitude),typeof e.fov=="number"&&(x.fov=e.fov),typeof e.distance=="number"&&(x.distance=e.distance),e.offset instanceof d.Vector3&&(x.offset=e.offset);var M=R(R({initial:{state:x,currentState:this.getCurrentState(),duration:this.modeChangeDuration,userAction:!1}},this.commonParams()),this.controllerInits[y]),C=Vt[y].initAnimationEndState(M);f=C.longitude,g=C.latitude,b=C.fov,w=C.offset,E=C.distance}else f=(u=e.longitude)!==null&&u!==void 0?u:this.state.longitude,g=(c=e.latitude)!==null&&c!==void 0?c:this.state.latitude,b=(l=e.fov)!==null&&l!==void 0?l:this.state.fov,w=(h=e.offset)!==null&&h!==void 0?h:this.state.offset,E=(p=e.distance)!==null&&p!==void 0?p:this.state.distance;var I={workCode:(A??this.pano).workCode,panoIndex:(A??this.pano).panoIndex,mode:y,longitude:f,latitude:g,fov:b,offset:w,distance:E};this.emit("state.set",_("state.set",{userAction:i,state:I})),jr(this.state,I)||(this.controller&&I.mode==="VRPanorama"&&I.mode!==this.state.mode?(vr(this.state,I),this.changeMode("VRPanorama")):this.controller&&I.mode==="XRPanorama"&&I.mode!==this.state.mode?(vr(this.state,I),this.changeMode("XRPanorama")):(vr(this.state,I),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===I.mode&&(this.syncingState=this.syncState(ve(),0,r),this.syncingState&&((v=this.controller)===null||v===void 0||v.updateTime(ve(),0),this.syncingState=!1)),this.emit("state.change",_("state.change",{userAction:i,state:this.state})),(m=this.analysis)===null||m===void 0||m.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),u=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(a,o,s,u),this.renderer.setScissor(a,o,s,u),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 Vt.Model){if(Ra(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,R(R({},s),{duration:i?0:void 0}),!1),!0}}else{var u={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!Ft(u,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(u,s,!1),!0}}if(this.controller instanceof Vt.Floorplan||this.controller instanceof Vt.Topview||this.controller instanceof Vt.Mapview){var c=1,l=.2,h=.2,p=Math.PI/45,v=i?this.state.fov:ta(this.camera.pose.fov,this.state.fov,c),m=Math.abs(this.camera.pose.distance-this.state.distance),A=m>h*15?m/15:l,y=i?this.state.distance:ta(this.camera.pose.distance,this.state.distance,A),f=this.camera.pose.offset.distanceTo(this.state.offset),g=f>h*15?f/15:h,b=i?new d.Vector3().copy(this.state.offset):Vf(this.camera.pose.offset,this.state.offset,g),w=i?{longitude:this.state.longitude,latitude:this.state.latitude}:Es({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},p),E=w.longitude,x=w.latitude;if(Jt(v,this.camera.pose.fov)||Ra(b,this.camera.pose.offset)||Jt(y,this.camera.pose.distance)||Jt(E,this.camera.pose.longitude,Math.PI*2)||Jt(x,this.camera.pose.latitude)){var M={x:b.x,y:b.y,z:b.z},C={fov:v};return Object.assign(M,{distance:y}),Object.assign(C,{longitude:E,latitude:x}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(C,0).catch(Q),this.controller.locationMotion.set(M,0).catch(Q),!0}}else{var I=1,P=Math.PI/45,v=i?this.state.fov:ta(this.camera.pose.fov,this.state.fov,I),S=i?{longitude:this.state.longitude,latitude:this.state.latitude}:Es({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},P),E=S.longitude,x=S.latitude;if(Jt(E,this.camera.pose.longitude,Math.PI*2)||Jt(x,this.camera.pose.latitude)||Jt(v,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:E,latitude:x,fov:v},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 F=this.currentMode,k=F===t.Mode.Floorplan||F===t.Mode.Topview||F===t.Mode.Mapview||F===t.Mode.Model;if(!k||this.models.loaded){var O=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var L=0,N=O;L<N.length;L++){var V=N[L];this.controller instanceof Vt.Panorama&&V.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(V):V()}}}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(Cn()){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document<"u"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document<"u"&&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){for(var r=this,i=[],a=function(A){var y=o.models.filter(function(g){var b;return((b=g.work)===null||b===void 0?void 0:b.workCode)===A.workCode})[0];if(y)y.work=A,i.push(y);else{var f=new Ba({coordinatesSystemTransformers:o.coordinatesSystemTransformers,onError:function(g){r.emit("model.error",_("model.request",{work:A,model:f,error:g}))},onShownFloorChange:function(g){r.emit("model.changeShownFloor",_("model.request",{work:A,model:f,error:null}))},onLoad:function(){r.emit("model.load",_("model.request",{work:A,model:f,error:null}))}});i.push(f),o.emit("model.request",_("model.request",{work:A,model:f,error:null})),f.load(A,{textureOptions:o.textureOptions})}},o=this,s=0,u=e;s<u.length;s++){var c=u[s];a(c)}if(this.models.length>0){for(var l=0,h=this.models;l<h.length;l++){var p=h[l];i.indexOf(p)===-1&&this.lastModels.push(p)}this.models.length=0}for(var v=0,m=i;v<m.length;v++){var p=m[v];this.models.push(p)}return this.renderer&&(this.models.loaded=!1),new Promise(function(A){r.on("models.load",function(){A()})})},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}},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=Vt[e];if(e!==this.currentMode)for(var o=0,s=this.models;o<s.length;o++){var u=s[o];u.show()}this.currentMode=e;for(var c=new a(r),l=function(y){c.on(y,function(){for(var f=[],g=0;g<arguments.length;g++)f[g]=arguments[g];var b=i.emit.apply(i,at([y],f,!1));if(b)return!1})},h=0,p=h0;h<p.length;h++){var v=p[h];l(v)}{var m=Vt[e].initAnimationEndState(r),A=r.initial.userAction;jr(this.state,m)||(vr(this.state,m),this.emit("state.change",_("state.change",{userAction:A,state:this.state}))),this.emit("currentState.change",_("currentState.change",{userAction:A,state:this.getCurrentState()}))}return c.on("camera.update",function(y){var f;if(i.controller){var g=i.controller.getTargetState();y.userAction&&i.syncingState===!1&&i.state.mode===g.mode&&!jr(i.state,g)&&(vr(i.state,g),i.emit("state.change",_("state.change",{userAction:y.userAction,state:i.state})),(f=i.analysis)===null||f===void 0||f.state(i.works,i.state))}i.emit("currentState.change",_("currentState.change",{userAction:y.userAction,state:i.getCurrentState()}))}),c.on("initAnimation.start",function(y){var f,g=y.state,b=y.userAction;b&&i.state.mode===g.mode&&!jr(i.state,g)&&(vr(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(f=i.analysis)===null||f===void 0||f.state(i.works,i.state))}),c.on("initAnimation.end",function(y){var f,g=y.state,b=y.userAction;b&&i.state.mode===g.mode&&!jr(i.state,g)&&(vr(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(f=i.analysis)===null||f===void 0||f.state(i.works,i.state))}),c.on("pano.moveTo",function(y){var f,g=y.state,b=y.userAction;i.pano={workCode:g.workCode,panoIndex:g.panoIndex},b&&i.state.mode===g.mode&&!jr(i.state,g)&&(vr(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(f=i.analysis)===null||f===void 0||f.state(i.works,i.state))}),c.on("pano.arrived",function(y){var f,g=y.state,b=y.userAction;b&&i.state.mode===g.mode&&!jr(i.state,g)&&(vr(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(f=i.analysis)===null||f===void 0||f.state(i.works,i.state))}),c.on("pano.moveTo",function(y){var f=y.userAction;i.emit("currentState.change",_("currentState.change",{userAction:f,state:i.getCurrentState()}))}),c.on("pano.request",function(y){i.emit("pano.request",y),y.defaultPrevented||i.moveToPano(y.state,y.options,y.userAction)}),c.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),c.on("error",function(y){return i.throwError(y)}),c},t.prototype.removeEventListeners=function(){},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",DepthPanorama:"DepthPanorama",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(Ii),ka={instances:{},constructor:A0};typeof window<"u"&&Object.assign(window,{__FIVE_DEBUG__:ka});var Xp=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(u){u.style.position="absolute",u.style.bottom="20px",u.style.padding="12px 6px",u.style.border="1px solid #fff",u.style.borderRadius="4px",u.style.background="rgba(0,0,0,0.1)",u.style.color="#fff",u.style.font="normal 13px sans-serif",u.style.textAlign="center",u.style.opacity="0.5",u.style.outline="none",u.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",o(e),navigator.xr.isSessionSupported("immersive-vr").then(function(u){u?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=it;exports.Camera=hi;exports.Fetcher=za;exports.Five=A0;exports.InternalWebGLRenderer=_r;exports.IntersectMesh=Si;exports.Model=Ba;exports.NetworkSubscribe=eu;exports.PBMContainer=ou;exports.PBMGroup=$l;exports.PBMMesh=_t;exports.PBMMeshMaterial=Vn;exports.PROXY_CONTROLLER_EVENT_NAMES=h0;exports.PanoCircleMesh=to;exports.PanoCircleMeshCustom=Rf;exports.PanoCircleMeshSolid=Sf;exports.RequestScheduler=ba;exports.Scene=fu;exports.Subscribe=Ii;exports.TextureLoader=An;exports.Tile=_a;exports.Tile3DModel=Ut;exports.TileCubeTextureTarget=Qe;exports.TileNode=Eu;exports.Tileset=ii;exports.TilesetCache=mu;exports.TilesetTraverser=wa;exports.Work=Za;exports.XRButton=Xp;exports.defaultImageURLTransform=qt;exports.defaultPbmParameters=be;exports.getViewportScale=p0;exports.imageSupport=ru;exports.isPanoId=iu;exports.loadAt3d=Hu;exports.loadB3dm=Bu;exports.loadDome=ju;exports.loadDomez=Gu;exports.loadPbm=Uu;exports.loadPnts=Ru;exports.panoEqual=Ft;exports.panoParse=Ye;exports.panoStringify=Be;exports.parseWork=On;
|
|
2048
|
+
`});v.depthTest=h.material.depthTest,v.side=h.material.side,s.meshReplaceMaterialMap.set(p,v),h.material=v}}});var u=this.renderer.getSize(new d.Vector2);this.camera.setViewOffset(u.width,u.height,e*a,r*a,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var c=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,c),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(h){!(h instanceof d.Mesh)||h instanceof _t||s.meshOriginMaterialMap.get(h.uuid)&&(h.material=s.meshOriginMaterialMap.get(h.uuid))}),this.models.setMaterial({constantColor:null});var l=Object.keys(i).filter(function(h){return i[h].equals(new d.Color().setRGB(c[0]/255,c[1]/255,c[2]/255))})[0];return l||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete ka.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 u=s[o];u.dispose()}this.models.length=0,this.models.setMaterial({pano0:null,pano1:null}),this.meshReplaceMaterialMap.forEach(function(c){c.dispose()}),this.meshOriginMaterialMap.forEach(function(c){c.dispose()}),this.renderer instanceof _r&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize()},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?"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.models.getMaterial().useEDL},set:function(e){var r,i,a,o;if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启EDL");if(this.models.setMaterial({useEDL:e}),this.boundingMesh.visible=!e,e){if(!this.screenBuffers){var s=this.getDrawingBufferSize(on);this.screenBuffers=[new d.WebGLRenderTarget(s.x,s.y,{encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:d.sRGBEncoding,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType}),new d.WebGLRenderTarget(s.x,s.y,{encoding:(o=(a=this.renderer)===null||a===void 0?void 0:a.outputEncoding)!==null&&o!==void 0?o:d.sRGBEncoding,minFilter:d.LinearMipMapLinearFilter,magFilter:d.LinearMipMapLinearFilter})]}}else this.screenBuffers&&(this.screenBuffers.forEach(function(u){u.dispose()}),delete this.screenBuffers);this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this.models.getMaterial().useHQWeight||this.models.getMaterial().useHQDepth||!1},set:function(e){var r,i;if(e===!0&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启HQ");if(e===!0?this.models.setMaterial({useHQDepth:!0,useHQWeight:!1,pointShape:"CIRCLE"}):this.models.setMaterial({useHQDepth:!1,useHQWeight:!1}),this.boundingMesh.visible=!e,e){if(!this.screenBuffers){var a=this.getDrawingBufferSize(on),o=new d.WebGLRenderTarget(a.x,a.y,{minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(a.x,a.y,d.UnsignedIntType)});o.depthTexture.format=d.DepthFormat,o.depthBuffer=!0;var s=new d.WebGLRenderTarget(a.x,a.y,{encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:d.sRGBEncoding,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:o.depthTexture});this.screenBuffers=[o,s]}}else this.screenBuffers&&(this.screenBuffers.forEach(function(u){u.dispose()}),delete this.screenBuffers);this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return this.screenBuffers!==void 0},set:function(e){var r,i,a,o;if(e){if(!this.screenBuffers){var s=this.getDrawingBufferSize(on);this.screenBuffers=[new d.WebGLRenderTarget(s.x,s.y,{encoding:(i=(r=this.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&i!==void 0?i:d.sRGBEncoding}),new d.WebGLRenderTarget(s.x,s.y,{encoding:(o=(a=this.renderer)===null||a===void 0?void 0:a.outputEncoding)!==null&&o!==void 0?o:d.sRGBEncoding})]}}else this.screenBuffers&&(this.screenBuffers.forEach(function(u){u.dispose()}),delete this.screenBuffers);this.needsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e){var r=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),this.currentMode==="Panorama"&&(r=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),this.currentMode==="Model"&&(r=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),this.currentMode==="Floorplan"&&(r=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),this.currentMode==="Topview"&&(r=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.topview),this.currentMode==="Mapview"&&(r=!0)),e.depthPanorama&&(Object.assign(this.controllerInits.DepthPanorama,e.depthPanorama),this.currentMode==="DepthPanorama"&&(r=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),this.currentMode==="VRPanorama"&&(r=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="DepthPanorama"||this.currentMode==="VRPanorama")&&(r=!0)),r&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions)},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof _r)){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,u=e.height,c=u===void 0?a.offsetHeight:u;this.renderer instanceof _r&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,c))}this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(),this.needsRender=!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,Lf(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=Hs.get(this);if(!e)return js;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!Xa.has(a))return js}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 Nf(e)?e.then(function(u){return o.load_(u,r,i,a)}):o.load_(e,r,i,a)});return this.lastLoadWorkTask=s.catch(function(u){o.throwError(u)}),s},t.prototype.load_=function(e,r,i,a){var o=this,s,u,c,l,h,p;a===void 0&&(a=!0);var v=[];if(Array.isArray(e))for(var m=0,A=e;m<A.length;m++){var y=A[m];typeof y!="string"&&"work"in y?v.push(On(y.work,y)):v.push(On(y))}else v.push(On(e));for(var f=Gu(v),g=function(U){var X=b,G=new za({allowHosts:U.allowHosts,get requestProxy(){return X.requestProxy},get networkSubscribe(){return X.networkSubscribe}});uf(U,G)},b=this,w=0,E=f;w<E.length;w++){var x=E[w];g(x)}var M=this.works;r===void 0&&(r=M.length!==0?"inherit":"initial");var C=f.initial,I=C.work.observers[0],P=I?{workCode:I.work.workCode,panoIndex:I.panoIndex}:{workCode:C.work.workCode,panoIndex:0},S=(s=C.mode)!==null&&s!==void 0?s:I?"Panorama":"Mapview",F={};if(r==="inherit"){S=this.currentMode;var k=f.resolvedObservers[this.panoIndex];k?P={workCode:k.work.workCode,panoIndex:k.panoIndex}:typeof f.initial.panoIndex=="number"?P={workCode:f.initial.work.workCode,panoIndex:f.initial.panoIndex}:(S==="Panorama"||S==="DepthPanorama"||S==="VRPanorama"||S==="XRPanorama")&&(S="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 C.panoIndex=="number"&&(P={workCode:C.work.workCode,panoIndex:C.panoIndex}),C.mode&&(S=C.mode),F={longitude:C.longitude,latitude:C.latitude,fov:C.fov,distance:C.distance,offset:(u=C.offset)===null||u===void 0?void 0:u.clone()};else{if(S=(c=r.mode)!==null&&c!==void 0?c:this.currentMode,typeof r.panoIndex=="number"){var k=f.getResolvedObserver({workCode:(h=(l=r.workCode)!==null&&l!==void 0?l:C.work.workCode)!==null&&h!==void 0?h:"",panoIndex:r.panoIndex});k&&(P={workCode:k.work.workCode,panoIndex:k.panoIndex})}F={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var O=R(R(R({},P),{mode:S}),F);this.emit("works.request",_("works.request",{input:e,works:f,state:O,userAction:a}));var L=function(){o.pano=P;var U=o.controller?i??o.modeChangeDuration:0,X=R(R({initial:{state:O,currentState:o.getCurrentState(),duration:U,userAction:a}},o.commonParams()),o.controllerInits[S]);if(o.controller&&o.currentMode===S)o.controller.updateWork(f,O,U,a)===!1&&(o.controller.destroy(),o.controller=o.applyController(S,X));else{var G=o.currentMode,K=Vt[S].initAnimationEndState(X);if(o.controller)o.controller.destroy();else{var Y=Vt[S].initAnimationEndState(X);o.camera.setFromPose(Y),o.modelGroup.visible=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(S,X);var H=_("mode.change",{prevMode:G,mode:S,state:K,userAction:a});o.emit("mode.change",H)}};if(Hs.set(this,f),!this.controller){var N=R(R({initial:{state:O,currentState:this.getCurrentState(),duration:0,userAction:a}},this.commonParams()),this.controllerInits[S]),V=Vt[S].initAnimationEndState(N);this.camera.setFromPose(V),this.emit("camera.update",_("camera.update",{state:this.getCurrentState(),userAction:a}))}if(S===t.Mode.Floorplan||S===t.Mode.Topview||S===t.Mode.Mapview||S===t.Mode.Model)this.loadModel(f).then(function(){o.needsRender=!0,L(),o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))});else{if(!this.controller){var j=new d.Vector3,z=f.getResolvedObserver(P);z&&j.copy(z.position),this.camera.setFromPose({fov:F.fov,longitude:F.longitude,latitude:F.latitude,distance:F.distance,offset:(p=F.offset)!==null&&p!==void 0?p:j}),this.needsRender=!0}L(),this.controller.once("pano.moveTo",function(){o.needsRender=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(f)})}return this.emit("works.load",_("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:f})),this.ready().then(function(){var U;o.emit("works.ready",_("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:f})),(U=o.analysis)===null||U===void 0||U.work(f)})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),i===void 0&&(i=this.modeChangeDuration),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(u,c){var l,h,p;if(!s.renderer)throw new Error("renderer is not initialized.");r=R({},r);var v=typeof r.panoIndex=="number"?{workCode:(p=(l=r.workCode)!==null&&l!==void 0?l:(h=s.work)===null||h===void 0?void 0:h.workCode)!==null&&p!==void 0?p:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var m=new Error('mode "'.concat(e,'" is not existed'));s.throwError(m),c(m);return}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!s.models.loaded){var m=new Error("model is not ready.");s.throwError(m),c(m);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(v)){var m=new Error("PanoId ".concat(Be(v)," not existed."));s.throwError(m),c(m);return}var A=s.controller,y=s.currentMode,f=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&y===e)e===t.Mode.Panorama||e===t.Mode.DepthPanorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?Ft(s.pano,v)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(v,R({duration:i},r),a):s.controller.updateCamera(r,i,a).catch(Q):(Ft(s.pano,v)||(s.pano=v),s.controller.updateCamera(r,i,a).catch(Q));else{var b=R(R({},r),v),w=R(R({initial:{state:b,currentState:s.getCurrentState(),duration:i,userAction:a}},s.commonParams()),s.controllerInits[e]),E=Vt[e].initAnimationEndState(w),x=_("mode.change.request",{prevMode:s.currentMode,mode:e,state:E,userAction:a});if(s.emit("mode.change.request",x),!x.defaultPrevented){A&&A.destroy(),s.controller=s.applyController(e,w);var M=_("mode.change",{prevMode:s.currentMode,mode:e,state:E,userAction:a});s.emit("mode.change",M)}}u()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),Qf().then(function(){return f()}).catch(function(b){b instanceof Error&&(s.exitFullscreen(),s.throwError(b),c(b))});else if(e===t.Mode.XRPanorama){var g=it.shared.getContext();g?g.end():Vf().then(function(b){it.shared.setContext(b),f()}).catch(function(b){b instanceof Error&&(s.throwError(b),c(b))})}else f()})},t.prototype.getPixels=function(e,r,i,a,o){if(o===void 0&&(o=1),!this.renderer)throw new Error("renderer is not initialized.");var s=this.getPixelsRenderTarget,u=this.renderer.getSize(new d.Vector2);e=le(e,Math.floor(i/2),Math.floor(u.x-i)),r=le(r,Math.floor(a/2),Math.floor(u.y-a)),s.setSize(i*o,a*o),this.renderer.setRenderTarget(s),this.camera.setViewOffset(u.width,u.height,e,u.height-r-a,i,a),this.controller?this.controller.render():this.renderer.render(this.scene,this.camera);var c=new Uint8Array(i*o*a*o*4);return this.renderer.readRenderTargetPixels(s,0,0,i*o,a*o,c),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),c},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(on);this.scene.traverseVisible(function(s){s.setResolution&&s.setResolution(a.x,a.y)})}if(this.controller&&this.screenBuffers&&this.renderer.getRenderTarget()===null){var o=this.getDrawingBufferSize(on);return this.screenBuffers.forEach(function(s){s.setSize(o.x,o.y)}),this.renderer.setRenderTarget(this.screenBuffers[0]),this.controller.render(),this.info={memory:R({},this.controller.renderer.info.memory),render:R({},this.controller.renderer.info.render)},this.currentMode!=="VRPanorama"&&this.currentMode!=="XRPanorama"&&this.poweredByRealsee&&qs(this.renderer),e&&it.shared.add(e,!0),this.screenBuffers[0]}else return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(),i.info={memory:R({},i.controller.renderer.info.memory),render:R({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:R({},i.renderer.info.memory),render:R({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&qs(i.renderer)),e&&it.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o,s,u=[],c=2;c<arguments.length;c++)u[c-2]=arguments[c];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,at([e,r],u,!1)),this.renderer){var l=this.getSize(on),h=this.renderer.getPixelRatio();this.camera.screenHeight=l.height,this.camera.pixelRatio=h,this.camera.aspect=l.width/l.height}if(this.camera.updateTime(e,r),this.renderer){Fn.detectSupport(this.renderer);var p=this.models.loaded,v=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),p===!1&&this.models.loaded===!0&&this.emit("models.load",_("models.load",{models:this.models})),v===!1&&this.models.refined===!0&&this.emit("models.refined",_("models.refined",{models:this.models})),this.models.loaded){for(var m=0,A=this.models;m<A.length;m++){var y=A[m];y.parent!==this.modelGroup&&(this.modelGroup.add(y),this.needsRender=!0)}if(this.lastModels.length>0){for(var f=0,g=this.lastModels;f<g.length;f++){var y=g[f];this.modelGroup.remove(y),y.dispose(),this.needsRender=!0}this.lastModels.length=0}}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 b=new d.Vector2(512,512),w=new d.Vector2(512,512);this.renderer&&(this.renderer.getSize(b),b.x*=this.scissor.width,b.y*=this.scissor.height,this.renderer.getDrawingBufferSize(w),w.x*=this.scissor.width,w.y*=this.scissor.height);{for(var E=new d.Box3,x=new d.Box3,M=new d.Vector3(4,4,4),C=0,I=this.works.resolvedObservers;C<I.length;C++){var P=I[C];x.setFromCenterAndSize(P.position,M),E.union(x)}E.union(this.models.bounding),E.getCenter(this.boundingMesh.position),E.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(E);var S=(o=this.models.getMaterial())!==null&&o!==void 0?o:{},F=1-((s=S.modelAlpha)!==null&&s!==void 0?s:0);S.opacity=le(F*4-3,0,1),S.clippers=null,S.shownFloorIndex=-2,this.boundingMesh.setMaterial(S),this.boundingMesh.needsRender=!1}var k=_("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",k),!k.defaultPrevented){var O=[];ni.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ri.setFromProjectionMatrix(ni);for(var L=0,N=this.scene.children;L<N.length;L++){var V=N[L];V!==this.modelGroup&&V!==this.boundingMesh&&V instanceof d.Object3D&&V.traverseVisible(function(H){if(H.setResolution&&H.setResolution(b.x,b.y),H.setTime&&H.setTime(e),H.mixer instanceof d.AnimationMixer){var J=zs.get(H.mixer);J||(J=new d.Clock,zs.set(H.mixer,J)),H.mixer.update(J.getDelta())}(H instanceof d.Mesh||H instanceof d.Line||H instanceof d.Points)&&(H instanceof d.ImmediateRenderObject||!H.frustumCulled||ri.intersectsObject(H))&&O.push(H)})}if(w.width*w.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var j=void 0;if(this.onlyRenderIfNeeds!==!0)j=this.render();else{if(this.controller&&this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0),this.models.needsRender===!0&&(this.models.needsRender=!1,this.needsRender=!0),this.needsRender!==!0)for(var z=0,U=O;z<U.length;z++){var X=U[z],G=function(H){H.needsRender===!0?(H.needsRender=!1,a.needsRender=!0):H.mixer&&H.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};G(X),X.traverseAncestors(G)}this.needsRender!==!1&&(j=this.render())}if(this.needsRender=!1,this.controller&&this.screenBuffers){var K=this.controller,Y=this.screenBuffers;this.aroundScissor(function(){K.postProcessing(Y,a.postProcessingType)})}this.hasListener("render")&&this.emit("render",_("render",{needsRender:j!==void 0,info:this.info}))}this.needsRender=!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 _r&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!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 u=this.works.getResolvedObserver(e);if(!u)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var c={workCode:u.work.workCode,panoIndex:u.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(c,r,i):u&&(this.pano=c,this.once("initAnimation.start",function(l){r.moveStartCallback&&r.moveStartCallback(l.state)}),this.once("initAnimation.end",function(l){r.moveEndCallback&&r.moveEndCallback(l.state)}),this.changeMode(t.Mode.Panorama,r,void 0,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")));a.work.allowHosts;var o=["right","left","up","down","front","back"],s=ve();return Promise.all(o.map(function(u){var c=R({key:"pano.".concat(a.panoId,".").concat(u)},sr(i.imageOptions,["size","format","quality","mappings"])),l=a.images[u],h=i.imageOptions.transform?i.imageOptions.transform(l,c):qt(l,c);return pt(a.work).preload(h)})).then(function(){var u=ve()-s;return r(u),u})},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 u=e.clone().project(this.camera);if(Math.abs(u.z)>1)return null;var c=this.renderer.getSize(new d.Vector2),l=c.x*this.scissor.width,h=c.y*this.scissor.height,p=c.x*this.scissor.left+(u.x+1)/2*l,v=c.y*(1-this.scissor.bottom-this.scissor.height)+(-u.y+1)/2*h;return new d.Vector2(p,v)},t.prototype.getRenderObjects=function(e){ni.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ri.setFromProjectionMatrix(ni),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||ri.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return R(R({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,u,c,l,h,p,v,m;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 A;typeof e.panoIndex=="number"&&(e.workCode?A={workCode:e.workCode,panoIndex:e.panoIndex}:A={workCode:(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",panoIndex:e.panoIndex});var y=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,f,g,b,w,E;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!==y){if(y==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var x={workCode:A==null?void 0:A.workCode,panoIndex:A==null?void 0:A.panoIndex};typeof e.longitude=="number"&&(x.longitude=e.longitude),typeof e.latitude=="number"&&(x.latitude=e.latitude),typeof e.fov=="number"&&(x.fov=e.fov),typeof e.distance=="number"&&(x.distance=e.distance),e.offset instanceof d.Vector3&&(x.offset=e.offset);var M=R(R({initial:{state:x,currentState:this.getCurrentState(),duration:this.modeChangeDuration,userAction:!1}},this.commonParams()),this.controllerInits[y]),C=Vt[y].initAnimationEndState(M);f=C.longitude,g=C.latitude,b=C.fov,w=C.offset,E=C.distance}else f=(u=e.longitude)!==null&&u!==void 0?u:this.state.longitude,g=(c=e.latitude)!==null&&c!==void 0?c:this.state.latitude,b=(l=e.fov)!==null&&l!==void 0?l:this.state.fov,w=(h=e.offset)!==null&&h!==void 0?h:this.state.offset,E=(p=e.distance)!==null&&p!==void 0?p:this.state.distance;var I={workCode:(A??this.pano).workCode,panoIndex:(A??this.pano).panoIndex,mode:y,longitude:f,latitude:g,fov:b,offset:w,distance:E};this.emit("state.set",_("state.set",{userAction:i,state:I})),jr(this.state,I)||(this.controller&&I.mode==="VRPanorama"&&I.mode!==this.state.mode?(vr(this.state,I),this.changeMode("VRPanorama")):this.controller&&I.mode==="XRPanorama"&&I.mode!==this.state.mode?(vr(this.state,I),this.changeMode("XRPanorama")):(vr(this.state,I),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===I.mode&&(this.syncingState=this.syncState(ve(),0,r),this.syncingState&&((v=this.controller)===null||v===void 0||v.updateTime(ve(),0),this.syncingState=!1)),this.emit("state.change",_("state.change",{userAction:i,state:this.state})),(m=this.analysis)===null||m===void 0||m.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),u=Math.floor(r.y*this.scissor.height);this.renderer.setViewport(a,o,s,u),this.renderer.setScissor(a,o,s,u),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 Vt.Model){if(Ra(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,R(R({},s),{duration:i?0:void 0}),!1),!0}}else{var u={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!Ft(u,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(u,s,!1),!0}}if(this.controller instanceof Vt.Floorplan||this.controller instanceof Vt.Topview||this.controller instanceof Vt.Mapview){var c=1,l=.2,h=.2,p=Math.PI/45,v=i?this.state.fov:ta(this.camera.pose.fov,this.state.fov,c),m=Math.abs(this.camera.pose.distance-this.state.distance),A=m>h*15?m/15:l,y=i?this.state.distance:ta(this.camera.pose.distance,this.state.distance,A),f=this.camera.pose.offset.distanceTo(this.state.offset),g=f>h*15?f/15:h,b=i?new d.Vector3().copy(this.state.offset):Df(this.camera.pose.offset,this.state.offset,g),w=i?{longitude:this.state.longitude,latitude:this.state.latitude}:bs({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},p),E=w.longitude,x=w.latitude;if(Jt(v,this.camera.pose.fov)||Ra(b,this.camera.pose.offset)||Jt(y,this.camera.pose.distance)||Jt(E,this.camera.pose.longitude,Math.PI*2)||Jt(x,this.camera.pose.latitude)){var M={x:b.x,y:b.y,z:b.z},C={fov:v};return Object.assign(M,{distance:y}),Object.assign(C,{longitude:E,latitude:x}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(C,0).catch(Q),this.controller.locationMotion.set(M,0).catch(Q),!0}}else{var I=1,P=Math.PI/45,v=i?this.state.fov:ta(this.camera.pose.fov,this.state.fov,I),S=i?{longitude:this.state.longitude,latitude:this.state.latitude}:bs({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},P),E=S.longitude,x=S.latitude;if(Jt(E,this.camera.pose.longitude,Math.PI*2)||Jt(x,this.camera.pose.latitude)||Jt(v,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:E,latitude:x,fov:v},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 F=this.currentMode,k=F===t.Mode.Floorplan||F===t.Mode.Topview||F===t.Mode.Mapview||F===t.Mode.Model;if(!k||this.models.loaded){var O=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var L=0,N=O;L<N.length;L++){var V=N[L];this.controller instanceof Vt.Panorama&&V.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(V):V()}}}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(Cn()){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document<"u"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document<"u"&&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){for(var r=this,i=[],a=function(A){var y=o.models.filter(function(g){var b;return((b=g.work)===null||b===void 0?void 0:b.workCode)===A.workCode})[0];if(y)y.work=A,i.push(y);else{var f=new Ba({coordinatesSystemTransformers:o.coordinatesSystemTransformers,onError:function(g){r.emit("model.error",_("model.request",{work:A,model:f,error:g}))},onShownFloorChange:function(g){r.emit("model.changeShownFloor",_("model.request",{work:A,model:f,error:null}))},onLoad:function(){r.emit("model.load",_("model.request",{work:A,model:f,error:null}))}});i.push(f),o.emit("model.request",_("model.request",{work:A,model:f,error:null})),f.load(A,{textureOptions:o.textureOptions})}},o=this,s=0,u=e;s<u.length;s++){var c=u[s];a(c)}if(this.models.length>0){for(var l=0,h=this.models;l<h.length;l++){var p=h[l];i.indexOf(p)===-1&&this.lastModels.push(p)}this.models.length=0}for(var v=0,m=i;v<m.length;v++){var p=m[v];this.models.push(p)}return this.renderer&&(this.models.loaded=!1),new Promise(function(A){r.on("models.load",function(){A()})})},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}},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=Vt[e];if(e!==this.currentMode)for(var o=0,s=this.models;o<s.length;o++){var u=s[o];u.show()}this.currentMode=e;for(var c=new a(r),l=function(y){c.on(y,function(){for(var f=[],g=0;g<arguments.length;g++)f[g]=arguments[g];var b=i.emit.apply(i,at([y],f,!1));if(b)return!1})},h=0,p=d0;h<p.length;h++){var v=p[h];l(v)}{var m=Vt[e].initAnimationEndState(r),A=r.initial.userAction;jr(this.state,m)||(vr(this.state,m),this.emit("state.change",_("state.change",{userAction:A,state:this.state}))),this.emit("currentState.change",_("currentState.change",{userAction:A,state:this.getCurrentState()}))}return c.on("camera.update",function(y){var f;if(i.controller){var g=i.controller.getTargetState();y.userAction&&i.syncingState===!1&&i.state.mode===g.mode&&!jr(i.state,g)&&(vr(i.state,g),i.emit("state.change",_("state.change",{userAction:y.userAction,state:i.state})),(f=i.analysis)===null||f===void 0||f.state(i.works,i.state))}i.emit("currentState.change",_("currentState.change",{userAction:y.userAction,state:i.getCurrentState()}))}),c.on("initAnimation.start",function(y){var f,g=y.state,b=y.userAction;b&&i.state.mode===g.mode&&!jr(i.state,g)&&(vr(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(f=i.analysis)===null||f===void 0||f.state(i.works,i.state))}),c.on("initAnimation.end",function(y){var f,g=y.state,b=y.userAction;b&&i.state.mode===g.mode&&!jr(i.state,g)&&(vr(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(f=i.analysis)===null||f===void 0||f.state(i.works,i.state))}),c.on("pano.moveTo",function(y){var f,g=y.state,b=y.userAction;i.pano={workCode:g.workCode,panoIndex:g.panoIndex},b&&i.state.mode===g.mode&&!jr(i.state,g)&&(vr(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(f=i.analysis)===null||f===void 0||f.state(i.works,i.state))}),c.on("pano.arrived",function(y){var f,g=y.state,b=y.userAction;b&&i.state.mode===g.mode&&!jr(i.state,g)&&(vr(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(f=i.analysis)===null||f===void 0||f.state(i.works,i.state))}),c.on("pano.moveTo",function(y){var f=y.userAction;i.emit("currentState.change",_("currentState.change",{userAction:f,state:i.getCurrentState()}))}),c.on("pano.request",function(y){i.emit("pano.request",y),y.defaultPrevented||i.moveToPano(y.state,y.options,y.userAction)}),c.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),c.on("error",function(y){return i.throwError(y)}),c},t.prototype.removeEventListeners=function(){},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",DepthPanorama:"DepthPanorama",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(Ii),ka={instances:{},constructor:p0};typeof window<"u"&&Object.assign(window,{__FIVE_DEBUG__:ka});var Gp=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(u){u.style.position="absolute",u.style.bottom="20px",u.style.padding="12px 6px",u.style.border="1px solid #fff",u.style.borderRadius="4px",u.style.background="rgba(0,0,0,0.1)",u.style.color="#fff",u.style.font="normal 13px sans-serif",u.style.textAlign="center",u.style.opacity="0.5",u.style.outline="none",u.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",o(e),navigator.xr.isSessionSupported("immersive-vr").then(function(u){u?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=it;exports.Camera=hi;exports.Fetcher=za;exports.Five=p0;exports.InternalWebGLRenderer=_r;exports.IntersectMesh=Si;exports.Model=Ba;exports.NetworkSubscribe=Zs;exports.PBMContainer=iu;exports.PBMGroup=Jl;exports.PBMMesh=_t;exports.PBMMeshMaterial=Vn;exports.PROXY_CONTROLLER_EVENT_NAMES=d0;exports.PanoCircleMesh=$a;exports.PanoCircleMeshCustom=Tf;exports.PanoCircleMeshSolid=Mf;exports.RequestScheduler=ba;exports.Scene=cu;exports.Subscribe=Ii;exports.TextureLoader=An;exports.Tile=_a;exports.Tile3DModel=Ut;exports.TileCubeTextureTarget=Qe;exports.TileNode=bu;exports.Tileset=ii;exports.TilesetCache=vu;exports.TilesetTraverser=wa;exports.Work=Ya;exports.XRButton=Gp;exports.defaultImageURLTransform=qt;exports.defaultPbmParameters=be;exports.getViewportScale=f0;exports.imageSupport=eu;exports.isPanoId=ru;exports.loadAt3d=qu;exports.loadB3dm=Tu;exports.loadDome=zu;exports.loadDomez=ju;exports.loadPbm=Qu;exports.loadPnts=Pu;exports.panoEqual=Ft;exports.panoParse=Ye;exports.panoStringify=Be;exports.parseWork=On;
|