@realsee/five 6.0.0-alpha.82 → 6.0.0-alpha.84

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.
Files changed (67) hide show
  1. package/docs/assets/navigation.js +1 -1
  2. package/docs/assets/search.js +1 -1
  3. package/docs/classes/five.Camera.html +6 -6
  4. package/docs/classes/five.Five.html +56 -57
  5. package/docs/classes/five.Model.html +11 -3
  6. package/docs/classes/five.PBMMeshMaterial.html +25 -25
  7. package/docs/classes/five.Tile3DModel.html +2 -1
  8. package/docs/classes/five.Work.html +18 -14
  9. package/docs/functions/five.parseWork.html +1 -1
  10. package/docs/interfaces/five.FiveInitArgs.html +10 -12
  11. package/docs/interfaces/five.FiveLoadOptions.html +36 -0
  12. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +9 -9
  13. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +7 -7
  14. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
  15. package/docs/interfaces/five.MovePanoOptions.html +9 -19
  16. package/docs/interfaces/five.PBMParameters.html +4 -4
  17. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +6 -6
  18. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
  19. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +5 -5
  20. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +6 -6
  21. package/docs/interfaces/five.WorkCubeImage.html +7 -7
  22. package/docs/interfaces/five.WorkImage.html +9 -11
  23. package/docs/interfaces/five.WorkInitial.html +8 -8
  24. package/docs/interfaces/five.WorkModel.html +6 -6
  25. package/docs/interfaces/five.WorkObserver.html +20 -20
  26. package/docs/interfaces/five.WorkResolvedObserver.html +20 -20
  27. package/docs/interfaces/five.WorkTile.html +2 -2
  28. package/docs/interfaces/five.WorkVideo.html +4 -4
  29. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +5 -5
  30. package/docs/interfaces/react.FiveInjectionTypes.html +3 -4
  31. package/docs/modules/five.html +2 -3
  32. package/docs/types/five.ControllerCustomInitTypes.html +1 -1
  33. package/docs/types/five.LooseWorkWithExtrinsics.html +2 -8
  34. package/docs/types/five.Mirror.html +1 -1
  35. package/docs/types/five.Mode.html +2 -3
  36. package/docs/types/five.ModelMaterialValues.html +1 -1
  37. package/docs/types/five.Models.html +4 -4
  38. package/docs/types/five.MovePanoEffect.html +9 -0
  39. package/docs/types/five.ParseWorkOptions.html +3 -10
  40. package/docs/types/five.PostProcessingType.html +1 -1
  41. package/docs/types/five.Works.html +1 -1
  42. package/five/index.d.ts +116 -101
  43. package/five/index.js +92 -100
  44. package/five/index.mjs +7178 -7655
  45. package/gltf-loader/index.js +3 -3
  46. package/gltf-loader/index.mjs +3 -3
  47. package/line/index.js +3 -3
  48. package/line/index.mjs +3 -3
  49. package/package.json +1 -1
  50. package/react/index.js +2 -2
  51. package/react/index.mjs +2 -2
  52. package/sticker/index.js +3 -3
  53. package/sticker/index.mjs +3 -3
  54. package/umd/five-gltf-loader.js +3 -3
  55. package/umd/five-line.js +3 -3
  56. package/umd/five-react.js +2 -2
  57. package/umd/five-sticker.js +3 -3
  58. package/umd/five-vfx.js +2 -2
  59. package/umd/five-vue.js +2 -2
  60. package/umd/five.js +58 -66
  61. package/vfx/index.js +2 -2
  62. package/vfx/index.mjs +2 -2
  63. package/vue/index.js +2 -2
  64. package/vue/index.mjs +2 -2
  65. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +0 -26
  66. package/docs/interfaces/five.ModelLodOptions.html +0 -2
  67. package/docs/interfaces/five.WorkOptions.html +0 -17
package/five/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2/28/2024
5
- * Version: 6.0.0-alpha.82
4
+ * Generated: 3/18/2024
5
+ * Version: 6.0.0-alpha.84
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 Tn=require("three"),v0=require("protobufjs/minimal");function Us(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=Us(Tn),Br=Us(v0);var uo=Number(d.REVISION);if(uo<115||uo>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');/**
255
+ */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Mn=require("three"),pl=require("protobufjs/minimal");function Qs(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=Qs(Mn),Br=Qs(pl);var oo=Number(d.REVISION);if(oo<115||oo>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
  *
@@ -339,84 +339,84 @@
339
339
  *
340
340
  * https://code.google.com/p/crypto-js/wiki/License
341
341
  * PART: ext/cryptojs
342
- */var $={},ge=ge||function(n,t){var e={},r=e.lib={},i=r.Base=function(){function v(){}return{extend:function(p){v.prototype=this;var m=new v;return p&&m.mixIn(p),m.hasOwnProperty("init")||(m.init=function(){m.$super.init.apply(this,arguments)}),m.init.prototype=m,m.$super=this,m},create:function(){var p=this.extend();return p.init.apply(p,arguments),p},init:function(){},mixIn:function(p){for(var m in p)p.hasOwnProperty(m)&&(this[m]=p[m]);p.hasOwnProperty("toString")&&(this.toString=p.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=r.WordArray=i.extend({init:function(v,p){v=this.words=v||[],p!=t?this.sigBytes=p:this.sigBytes=v.length*4},toString:function(v){return(v||s).stringify(this)},concat:function(v){var p=this.words,m=v.words,A=this.sigBytes,y=v.sigBytes;if(this.clamp(),A%4)for(var f=0;f<y;f++){var g=m[f>>>2]>>>24-f%4*8&255;p[A+f>>>2]|=g<<24-(A+f)%4*8}else for(var f=0;f<y;f+=4)p[A+f>>>2]=m[f>>>2];return this.sigBytes+=y,this},clamp:function(){var v=this.words,p=this.sigBytes;v[p>>>2]&=4294967295<<32-p%4*8,v.length=n.ceil(p/4)},clone:function(){var v=i.clone.call(this);return v.words=this.words.slice(0),v},random:function(v){for(var p=[],m=0;m<v;m+=4)p.push(n.random()*4294967296|0);return new a.init(p,v)}}),o=e.enc={},s=o.Hex={stringify:function(v){for(var p=v.words,m=v.sigBytes,A=[],y=0;y<m;y++){var f=p[y>>>2]>>>24-y%4*8&255;A.push((f>>>4).toString(16)),A.push((f&15).toString(16))}return A.join("")},parse:function(v){for(var p=v.length,m=[],A=0;A<p;A+=2)m[A>>>3]|=parseInt(v.substr(A,2),16)<<24-A%8*4;return new a.init(m,p/2)}},u=o.Latin1={stringify:function(v){for(var p=v.words,m=v.sigBytes,A=[],y=0;y<m;y++){var f=p[y>>>2]>>>24-y%4*8&255;A.push(String.fromCharCode(f))}return A.join("")},parse:function(v){for(var p=v.length,m=[],A=0;A<p;A++)m[A>>>2]|=(v.charCodeAt(A)&255)<<24-A%4*8;return new a.init(m,p)}},c=o.Utf8={stringify:function(v){try{return decodeURIComponent(escape(u.stringify(v)))}catch(p){throw new Error("Malformed UTF-8 data")}},parse:function(v){return u.parse(unescape(encodeURIComponent(v)))}},l=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(v){typeof v=="string"&&(v=c.parse(v)),this._data.concat(v),this._nDataBytes+=v.sigBytes},_process:function(v){var p=this._data,m=p.words,A=p.sigBytes,y=this.blockSize,f=y*4,g=A/f;v?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 x=0;x<b;x+=y)this._doProcessBlock(m,x);var E=m.splice(0,b);p.sigBytes-=w}return new a.init(E,w)},clone:function(){var v=i.clone.call(this);return v._data=this._data.clone(),v},_minBufferSize:0});r.Hasher=l.extend({cfg:i.extend(),init:function(v){this.cfg=this.cfg.extend(v),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(v){return this._append(v),this._process(),this},finalize:function(v){v&&this._append(v);var p=this._doFinalize();return p},blockSize:512/32,_createHelper:function(v){return function(p,m){return new v.init(m).finalize(p)}},_createHmacHelper:function(v){return function(p,m){return new h.HMAC.init(v,m).finalize(p)}}});var h=e.algo={};return e}(Math);(function(n){for(var t=ge,p=t.lib,e=p.WordArray,r=p.Hasher,p=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 v=[],p=p.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],x=y[4],E=y[5],M=y[6],C=y[7],S=0;64>S;S++){if(16>S)v[S]=m[A+S]|0;else{var P=v[S-15],I=v[S-2];v[S]=((P<<25|P>>>7)^(P<<14|P>>>18)^P>>>3)+v[S-7]+((I<<15|I>>>17)^(I<<13|I>>>19)^I>>>10)+v[S-16]}P=C+((x<<26|x>>>6)^(x<<21|x>>>11)^(x<<7|x>>>25))+(x&E^~x&M)+a[S]+v[S],I=((f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22))+(f&g^f&b^g&b),C=M,M=E,E=x,x=w+P|0,w=b,b=g,g=f,f=P+I|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]+x|0,y[5]=y[5]+E|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(p),t.HmacSHA256=r._createHmacHelper(p)})(Math);ge.lib.Cipher||function(n){var p=ge,t=p.lib,e=t.Base,r=t.WordArray,i=t.BufferedBlockAlgorithm,a=p.enc.Base64,o=p.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:v).encrypt(A,y,f,g)},decrypt:function(y,f,g){return(typeof f=="string"?m:v).decrypt(A,y,f,g)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var h=p.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=(p.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=(p.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})}},v=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}}),p=(p.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=v.extend({cfg:v.cfg.extend({kdf:p}),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=v.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,v.decrypt.call(this,A,y,f.key,g)}})}();(function(){for(var n=ge,t=n.lib.BlockCipher,E=n.algo,e=[],r=[],i=[],a=[],o=[],s=[],u=[],c=[],l=[],h=[],v=[],p=0;256>p;p++)v[p]=128>p?p<<1:p<<1^283;for(var m=0,A=0,p=0;256>p;p++){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=v[m],g=v[f],b=v[g],w=257*v[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^v[v[v[b^f]]],A^=v[v[A]]):m=A=1}var x=[0,1,2,4,8,16,32,64,128,27,54],E=E.AES=t.extend({_doReset:function(){for(var S=this._key,M=S.words,C=S.sigBytes/4,S=4*((this._nRounds=C+6)+1),P=this._keySchedule=[],I=0;I<S;I++)if(I<C)P[I]=M[I];else{var B=P[I-1];I%C?6<C&&I%C==4&&(B=e[B>>>24]<<24|e[B>>>16&255]<<16|e[B>>>8&255]<<8|e[B&255]):(B=B<<8|B>>>24,B=e[B>>>24]<<24|e[B>>>16&255]<<16|e[B>>>8&255]<<8|e[B&255],B^=x[I/C|0]<<24),P[I]=P[I-C]^B}for(M=this._invKeySchedule=[],C=0;C<S;C++)I=S-C,B=C%4?P[I]:P[I-4],M[C]=4>C||4>=I?B:u[e[B>>>24]]^c[e[B>>>16&255]]^l[e[B>>>8&255]]^h[e[B&255]]},encryptBlock:function(M,C){this._doCryptBlock(M,C,this._keySchedule,i,a,o,s,e)},decryptBlock:function(M,C){var S=M[C+1];M[C+1]=M[C+3],M[C+3]=S,this._doCryptBlock(M,C,this._invKeySchedule,u,c,l,h,r),S=M[C+1],M[C+1]=M[C+3],M[C+3]=S},_doCryptBlock:function(M,C,S,P,I,B,L,k){for(var O=this._nRounds,j=M[C]^S[0],_=M[C+1]^S[1],Z=M[C+2]^S[2],q=M[C+3]^S[3],N=4,D=1;D<O;D++)var H=P[j>>>24]^I[_>>>16&255]^B[Z>>>8&255]^L[q&255]^S[N++],z=P[_>>>24]^I[Z>>>16&255]^B[q>>>8&255]^L[j&255]^S[N++],U=P[Z>>>24]^I[q>>>16&255]^B[j>>>8&255]^L[_&255]^S[N++],q=P[q>>>24]^I[j>>>16&255]^B[_>>>8&255]^L[Z&255]^S[N++],j=H,_=z,Z=U;H=(k[j>>>24]<<24|k[_>>>16&255]<<16|k[Z>>>8&255]<<8|k[q&255])^S[N++],z=(k[_>>>24]<<24|k[Z>>>16&255]<<16|k[q>>>8&255]<<8|k[j&255])^S[N++],U=(k[Z>>>24]<<24|k[q>>>16&255]<<16|k[j>>>8&255]<<8|k[_&255])^S[N++],q=(k[q>>>24]<<24|k[j>>>16&255]<<16|k[_>>>8&255]<<8|k[Z&255])^S[N++],M[C]=H,M[C+1]=z,M[C+2]=U,M[C+3]=q},keySize:8});n.AES=t._createHelper(E)})();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
343
- */var Pr;function ie(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 zt(){return new ie(null)}function A0(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 m0(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 g0(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!="undefined"&&navigator.appName=="Microsoft Internet Explorer"?(ie.prototype.am=m0,Pr=30):typeof navigator!="undefined"&&navigator.appName!="Netscape"?(ie.prototype.am=A0,Pr=26):(ie.prototype.am=g0,Pr=28);ie.prototype.DB=Pr;ie.prototype.DM=(1<<Pr)-1;ie.prototype.DV=1<<Pr;var Ta=52;ie.prototype.FV=Math.pow(2,Ta);ie.prototype.F1=Ta-Pr;ie.prototype.F2=2*Pr-Ta;var y0="0123456789abcdefghijklmnopqrstuvwxyz",yi=new Array,hn,Dt;hn=48;for(Dt=0;Dt<=9;++Dt)yi[hn++]=Dt;hn=97;for(Dt=10;Dt<36;++Dt)yi[hn++]=Dt;hn=65;for(Dt=10;Dt<36;++Dt)yi[hn++]=Dt;function hr(n){return y0.charAt(n)}function b0(n,t){var e=yi[n.charCodeAt(t)];return e==null?-1:e}function w0(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function x0(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 Pa(n){var t=zt();return t.fromInt(n),t}function E0(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:b0(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&&ie.ZERO.subTo(this,this)}function M0(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function C0(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=hr(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+=hr(r));return i?a:"0"}function S0(){var n=zt();return ie.ZERO.subTo(this,n),n}function I0(){return this.s<0?this.negate():this}function T0(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 Ba(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 P0(){return this.t<=0?0:this.DB*(this.t-1)+Ba(this[this.t-1]^this.s&this.DM)}function B0(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 R0(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 F0(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 k0(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 L0(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 O0(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&&ie.ZERO.subTo(t,t)}function V0(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 N0(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=zt());var a=zt(),o=this.s,s=n.s,u=this.DB-Ba(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),v=this.FV/h,p=(1<<this.F1)/h,m=1<<this.F2,A=e.t,y=A-c,f=t==null?zt():t;for(a.dlShiftTo(y,f),e.compareTo(f)>=0&&(e[e.t++]=1,e.subTo(f,e)),ie.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]*v+(e[A-1]+m)*p);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&&ie.ZERO.subTo(t,t)),e.t=c,e.clamp(),u>0&&e.rShiftTo(u,e),o<0&&ie.ZERO.subTo(e,e)}}}function Q0(n){var t=zt();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(ie.ZERO)>0&&n.subTo(t,t),t}function pn(n){this.m=n}function D0(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function U0(n){return n}function z0(n){n.divRemTo(this.m,null,n)}function G0(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function H0(n,t){n.squareTo(t),this.reduce(t)}pn.prototype.convert=D0;pn.prototype.revert=U0;pn.prototype.reduce=z0;pn.prototype.mulTo=G0;pn.prototype.sqrTo=H0;function q0(){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=zt();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(ie.ZERO)>0&&this.m.subTo(t,t),t}function j0(n){var t=zt();return n.copyTo(t),this.reduce(t),t}function W0(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 X0(n,t){n.squareTo(t),this.reduce(t)}function _0(n,t,e){n.multiplyTo(t,e),this.reduce(e)}vn.prototype.convert=K0;vn.prototype.revert=j0;vn.prototype.reduce=W0;vn.prototype.mulTo=_0;vn.prototype.sqrTo=X0;function Z0(){return(this.t>0?this[0]&1:this.s)==0}function Y0(n,t){if(n>4294967295||n<1)return ie.ONE;var e=zt(),r=zt(),i=t.convert(this),a=Ba(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 J0(n,t){var e;return n<256||t.isEven()?e=new pn(t):e=new vn(t),this.exp(n,e)}ie.prototype.copyTo=w0;ie.prototype.fromInt=x0;ie.prototype.fromString=E0;ie.prototype.clamp=M0;ie.prototype.dlShiftTo=B0;ie.prototype.drShiftTo=R0;ie.prototype.lShiftTo=F0;ie.prototype.rShiftTo=k0;ie.prototype.subTo=L0;ie.prototype.multiplyTo=O0;ie.prototype.squareTo=V0;ie.prototype.divRemTo=N0;ie.prototype.invDigit=q0;ie.prototype.isEven=Z0;ie.prototype.exp=Y0;ie.prototype.toString=C0;ie.prototype.negate=S0;ie.prototype.abs=I0;ie.prototype.compareTo=T0;ie.prototype.bitLength=P0;ie.prototype.mod=Q0;ie.prototype.modPowInt=J0;ie.ZERO=Pa(0);ie.ONE=Pa(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function $0(){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 el(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function tl(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function rl(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=Pa(e),i=zt(),a=zt(),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}ie.prototype.chunkSize=el;ie.prototype.toRadix=rl;ie.prototype.intValue=$0;ie.prototype.signum=tl;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var an="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zs="=";function nl(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=an.charAt(e>>6)+an.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=an.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=an.charAt(e>>2)+an.charAt((e&3)<<4));(r.length&3)>0;)r+=zs;return r}function Ra(n){var t="",e,r=0,i,a;for(e=0;e<n.length&&n.charAt(e)!=zs;++e)a=an.indexOf(n.charAt(e)),!(a<0)&&(r==0?(t+=hr(a>>2),i=a&3,r=1):r==1?(t+=hr(i<<2|a>>4),i=a&15,r=2):r==2?(t+=hr(i),t+=hr(a>>2),i=a&3,r=3):(t+=hr(i<<2|a>>4),t+=hr(a&15),r=0));return r==1&&(t+=hr(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function wt(n,t){return new ie(n,t)}function il(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 ie(e)}function lo(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 al(n,t,e,r){var i=$.crypto.MessageDigest,a=$.crypto.Util,o=null;if(e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(A){return vr(a.hashHex(bi(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=lo(l,c.length,e),v=[];for(u=0;u<c.length;u+=1)v[u]=c.charCodeAt(u)^h.charCodeAt(u);var p=lo(v,l.length,e),m=[0];for(u=0;u<l.length;u+=1)m[u+1]=l[u]^p.charCodeAt(u);return new ie(m.concat(v))}function Me(){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 ol(n,t){if(this.isPublic=!0,this.isPrivate=!1,typeof n!="string")this.n=n,this.e=t;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=wt(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function sl(n){return n.modPowInt(this.e,this.n)}function ul(n){var t=il(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 ll(n,t,e){var r=al(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}Me.prototype.doPublic=sl;Me.prototype.setPublic=ol;Me.prototype.encrypt=ul;Me.prototype.encryptOAEP=ll;Me.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function cl(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 co(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 dl(n,t,e,r){var i=$.crypto.MessageDigest,a=$.crypto.Util,o=null;e||(e="sha1"),typeof e=="string"&&(o=i.getCanonicalAlgName(e),r=i.getHashLength(o),e=function(y){return vr(a.hashHex(bi(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=co(u,r,e),l=[],h;for(h=0;h<s.length;h+=1)l[h]=s.charCodeAt(h)^c.charCodeAt(h);var v=co(String.fromCharCode.apply(String,l),n.length-r,e),p=[];for(h=0;h<u.length;h+=1)p[h]=u.charCodeAt(h)^v.charCodeAt(h);if(p=String.fromCharCode.apply(String,p),p.substr(0,r)!==e(""))throw"Hash mismatch";p=p.substr(r);var m=p.indexOf(""),A=m!=-1?p.substr(0,m).lastIndexOf("\0"):-1;if(A+1!=m)throw"Malformed data";return p.substr(m+1)}function fl(n,t,e){if(this.isPrivate=!0,typeof n!="string")this.n=n,this.e=t,this.d=e;else if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=wt(n,16),this.e=parseInt(t,16),this.d=wt(e,16);else throw"Invalid RSA private key"}function hl(n,t,e,r,i,a,o,s){if(this.isPrivate=!0,this.isPublic=!1,n==null)throw"RSASetPrivateEx N == null";if(t==null)throw"RSASetPrivateEx E == null";if(n.length==0)throw"RSASetPrivateEx N.length == 0";if(t.length==0)throw"RSASetPrivateEx E.length == 0";if(n!=null&&t!=null&&n.length>0&&t.length>0)this.n=wt(n,16),this.e=parseInt(t,16),this.d=wt(e,16),this.p=wt(r,16),this.q=wt(i,16),this.dmp1=wt(a,16),this.dmq1=wt(o,16),this.coeff=wt(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function pl(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 vl(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=wt(n,16),e=this.doPrivate(t);return e==null?null:cl(e,this.n.bitLength()+7>>3)}function Al(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=wt(n,16),i=this.doPrivate(r);return i==null?null:dl(i,this.n.bitLength()+7>>3,t,e)}Me.prototype.doPrivate=pl;Me.prototype.setPrivate=fl;Me.prototype.setPrivateEx=hl;Me.prototype.decrypt=vl;Me.prototype.decryptOAEP=Al;(typeof $.lang=="undefined"||!$.lang)&&($.lang={});$.lang.String=function(){};function ml(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function tt(n){return Ra(ml(n))}function tr(n){return decodeURIComponent(xl(n))}function vr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function bi(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function gl(n){return nl(n)}function yl(n){var t=gl(n),e=t.replace(/(.{64})/g,`$1\r
344
- `);return e=e.replace(/\r\n$/,""),e}function bl(n){var t=n.replace(/[^0-9A-Za-z\/+=]*/g,""),e=Ra(t);return e}function wl(n,t){var e=yl(n);return"-----BEGIN "+t+`-----\r
342
+ */var ee={},ye=ye||function(n,t){var e={},r=e.lib={},i=r.Base=function(){function A(){}return{extend:function(p){A.prototype=this;var y=new A;return p&&y.mixIn(p),y.hasOwnProperty("init")||(y.init=function(){y.$super.init.apply(this,arguments)}),y.init.prototype=y,y.$super=this,y},create:function(){var p=this.extend();return p.init.apply(p,arguments),p},init:function(){},mixIn:function(p){for(var y in p)p.hasOwnProperty(y)&&(this[y]=p[y]);p.hasOwnProperty("toString")&&(this.toString=p.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=r.WordArray=i.extend({init:function(A,p){A=this.words=A||[],p!=t?this.sigBytes=p:this.sigBytes=A.length*4},toString:function(A){return(A||s).stringify(this)},concat:function(A){var p=this.words,y=A.words,v=this.sigBytes,m=A.sigBytes;if(this.clamp(),v%4)for(var h=0;h<m;h++){var g=y[h>>>2]>>>24-h%4*8&255;p[v+h>>>2]|=g<<24-(v+h)%4*8}else for(var h=0;h<m;h+=4)p[v+h>>>2]=y[h>>>2];return this.sigBytes+=m,this},clamp:function(){var A=this.words,p=this.sigBytes;A[p>>>2]&=4294967295<<32-p%4*8,A.length=n.ceil(p/4)},clone:function(){var A=i.clone.call(this);return A.words=this.words.slice(0),A},random:function(A){for(var p=[],y=0;y<A;y+=4)p.push(n.random()*4294967296|0);return new a.init(p,A)}}),o=e.enc={},s=o.Hex={stringify:function(A){for(var p=A.words,y=A.sigBytes,v=[],m=0;m<y;m++){var h=p[m>>>2]>>>24-m%4*8&255;v.push((h>>>4).toString(16)),v.push((h&15).toString(16))}return v.join("")},parse:function(A){for(var p=A.length,y=[],v=0;v<p;v+=2)y[v>>>3]|=parseInt(A.substr(v,2),16)<<24-v%8*4;return new a.init(y,p/2)}},u=o.Latin1={stringify:function(A){for(var p=A.words,y=A.sigBytes,v=[],m=0;m<y;m++){var h=p[m>>>2]>>>24-m%4*8&255;v.push(String.fromCharCode(h))}return v.join("")},parse:function(A){for(var p=A.length,y=[],v=0;v<p;v++)y[v>>>2]|=(A.charCodeAt(v)&255)<<24-v%4*8;return new a.init(y,p)}},l=o.Utf8={stringify:function(A){try{return decodeURIComponent(escape(u.stringify(A)))}catch(p){throw new Error("Malformed UTF-8 data")}},parse:function(A){return u.parse(unescape(encodeURIComponent(A)))}},c=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(A){typeof A=="string"&&(A=l.parse(A)),this._data.concat(A),this._nDataBytes+=A.sigBytes},_process:function(A){var p=this._data,y=p.words,v=p.sigBytes,m=this.blockSize,h=m*4,g=v/h;A?g=n.ceil(g):g=n.max((g|0)-this._minBufferSize,0);var b=g*m,w=n.min(b*4,v);if(b){for(var E=0;E<b;E+=m)this._doProcessBlock(y,E);var C=y.splice(0,b);p.sigBytes-=w}return new a.init(C,w)},clone:function(){var A=i.clone.call(this);return A._data=this._data.clone(),A},_minBufferSize:0});r.Hasher=c.extend({cfg:i.extend(),init:function(A){this.cfg=this.cfg.extend(A),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(A){return this._append(A),this._process(),this},finalize:function(A){A&&this._append(A);var p=this._doFinalize();return p},blockSize:512/32,_createHelper:function(A){return function(p,y){return new A.init(y).finalize(p)}},_createHmacHelper:function(A){return function(p,y){return new f.HMAC.init(A,y).finalize(p)}}});var f=e.algo={};return e}(Math);(function(n){for(var t=ye,p=t.lib,e=p.WordArray,r=p.Hasher,p=t.algo,i=[],a=[],o=function(v){return 4294967296*(v-(v|0))|0},s=2,u=0;64>u;){var l;e:{l=s;for(var c=n.sqrt(l),f=2;f<=c;f++)if(!(l%f)){l=!1;break e}l=!0}l&&(8>u&&(i[u]=o(n.pow(s,.5))),a[u]=o(n.pow(s,1/3)),u++),s++}var A=[],p=p.SHA256=r.extend({_doReset:function(){this._hash=new e.init(i.slice(0))},_doProcessBlock:function(y,v){for(var m=this._hash.words,h=m[0],g=m[1],b=m[2],w=m[3],E=m[4],C=m[5],x=m[6],M=m[7],S=0;64>S;S++){if(16>S)A[S]=y[v+S]|0;else{var P=A[S-15],T=A[S-2];A[S]=((P<<25|P>>>7)^(P<<14|P>>>18)^P>>>3)+A[S-7]+((T<<15|T>>>17)^(T<<13|T>>>19)^T>>>10)+A[S-16]}P=M+((E<<26|E>>>6)^(E<<21|E>>>11)^(E<<7|E>>>25))+(E&C^~E&x)+a[S]+A[S],T=((h<<30|h>>>2)^(h<<19|h>>>13)^(h<<10|h>>>22))+(h&g^h&b^g&b),M=x,x=C,C=E,E=w+P|0,w=b,b=g,g=h,h=P+T|0}m[0]=m[0]+h|0,m[1]=m[1]+g|0,m[2]=m[2]+b|0,m[3]=m[3]+w|0,m[4]=m[4]+E|0,m[5]=m[5]+C|0,m[6]=m[6]+x|0,m[7]=m[7]+M|0},_doFinalize:function(){var y=this._data,v=y.words,m=8*this._nDataBytes,h=8*y.sigBytes;return v[h>>>5]|=128<<24-h%32,v[(h+64>>>9<<4)+14]=n.floor(m/4294967296),v[(h+64>>>9<<4)+15]=m,y.sigBytes=4*v.length,this._process(),this._hash},clone:function(){var y=r.clone.call(this);return y._hash=this._hash.clone(),y}});t.SHA256=r._createHelper(p),t.HmacSHA256=r._createHmacHelper(p)})(Math);ye.lib.Cipher||function(n){var p=ye,t=p.lib,e=t.Base,r=t.WordArray,i=t.BufferedBlockAlgorithm,a=p.enc.Base64,o=p.algo.EvpKDF,s=t.Cipher=i.extend({cfg:e.extend(),createEncryptor:function(v,m){return this.create(this._ENC_XFORM_MODE,v,m)},createDecryptor:function(v,m){return this.create(this._DEC_XFORM_MODE,v,m)},init:function(v,m,h){this.cfg=this.cfg.extend(h),this._xformMode=v,this._key=m,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(v){return this._append(v),this._process()},finalize:function(v){return v&&this._append(v),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(v){return{encrypt:function(m,h,g){return(typeof h=="string"?y:A).encrypt(v,m,h,g)},decrypt:function(m,h,g){return(typeof h=="string"?y:A).decrypt(v,m,h,g)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var f=p.mode={},u=function(v,m,h){var g=this._iv;g?this._iv=n:g=this._prevBlock;for(var b=0;b<h;b++)v[m+b]^=g[b]},l=(t.BlockCipherMode=e.extend({createEncryptor:function(v,m){return this.Encryptor.create(v,m)},createDecryptor:function(v,m){return this.Decryptor.create(v,m)},init:function(v,m){this._cipher=v,this._iv=m}})).extend();l.Encryptor=l.extend({processBlock:function(v,m){var h=this._cipher,g=h.blockSize;u.call(this,v,m,g),h.encryptBlock(v,m),this._prevBlock=v.slice(m,m+g)}}),l.Decryptor=l.extend({processBlock:function(v,m){var h=this._cipher,g=h.blockSize,b=v.slice(m,m+g);h.decryptBlock(v,m),u.call(this,v,m,g),this._prevBlock=b}}),f=f.CBC=l,l=(p.pad={}).Pkcs7={pad:function(v,m){for(var h=4*m,h=h-v.sigBytes%h,g=h<<24|h<<16|h<<8|h,b=[],w=0;w<h;w+=4)b.push(g);h=r.create(b,h),v.concat(h)},unpad:function(v){v.sigBytes-=v.words[v.sigBytes-1>>>2]&255}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:f,padding:l}),reset:function(){s.reset.call(this);var m=this.cfg,v=m.iv,m=m.mode;if(this._xformMode==this._ENC_XFORM_MODE)var h=m.createEncryptor;else h=m.createDecryptor,this._minBufferSize=1;this._mode=h.call(m,this,v&&v.words)},_doProcessBlock:function(v,m){this._mode.processBlock(v,m)},_doFinalize:function(){var v=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){v.pad(this._data,this.blockSize);var m=this._process(!0)}else m=this._process(!0),v.unpad(m);return m},blockSize:4});var c=t.CipherParams=e.extend({init:function(v){this.mixIn(v)},toString:function(v){return(v||this.formatter).stringify(this)}}),f=(p.format={}).OpenSSL={stringify:function(v){var m=v.ciphertext;return v=v.salt,(v?r.create([1398893684,1701076831]).concat(v).concat(m):m).toString(a)},parse:function(v){v=a.parse(v);var m=v.words;if(m[0]==1398893684&&m[1]==1701076831){var h=r.create(m.slice(2,4));m.splice(0,4),v.sigBytes-=16}return c.create({ciphertext:v,salt:h})}},A=t.SerializableCipher=e.extend({cfg:e.extend({format:f}),encrypt:function(v,m,h,g){g=this.cfg.extend(g);var b=v.createEncryptor(h,g);return m=b.finalize(m),b=b.cfg,c.create({ciphertext:m,key:h,iv:b.iv,algorithm:v,mode:b.mode,padding:b.padding,blockSize:v.blockSize,formatter:g.format})},decrypt:function(v,m,h,g){return g=this.cfg.extend(g),m=this._parse(m,g.format),v.createDecryptor(h,g).finalize(m.ciphertext)},_parse:function(v,m){return typeof v=="string"?m.parse(v,this):v}}),p=(p.kdf={}).OpenSSL={execute:function(v,m,h,g){return g||(g=r.random(8)),v=o.create({keySize:m+h}).compute(v,g),h=r.create(v.words.slice(m),4*h),v.sigBytes=4*m,c.create({key:v,iv:h,salt:g})}},y=t.PasswordBasedCipher=A.extend({cfg:A.cfg.extend({kdf:p}),encrypt:function(v,m,h,g){return g=this.cfg.extend(g),h=g.kdf.execute(h,v.keySize,v.ivSize),g.iv=h.iv,v=A.encrypt.call(this,v,m,h.key,g),v.mixIn(h),v},decrypt:function(v,m,h,g){return g=this.cfg.extend(g),m=this._parse(m,g.format),h=g.kdf.execute(h,v.keySize,v.ivSize,m.salt),g.iv=h.iv,A.decrypt.call(this,v,m,h.key,g)}})}();(function(){for(var n=ye,t=n.lib.BlockCipher,C=n.algo,e=[],r=[],i=[],a=[],o=[],s=[],u=[],l=[],c=[],f=[],A=[],p=0;256>p;p++)A[p]=128>p?p<<1:p<<1^283;for(var y=0,v=0,p=0;256>p;p++){var m=v^v<<1^v<<2^v<<3^v<<4,m=m>>>8^m&255^99;e[y]=m,r[m]=y;var h=A[y],g=A[h],b=A[g],w=257*A[m]^16843008*m;i[y]=w<<24|w>>>8,a[y]=w<<16|w>>>16,o[y]=w<<8|w>>>24,s[y]=w,w=16843009*b^65537*g^257*h^16843008*y,u[m]=w<<24|w>>>8,l[m]=w<<16|w>>>16,c[m]=w<<8|w>>>24,f[m]=w,y?(y=h^A[A[A[b^h]]],v^=A[A[v]]):y=v=1}var E=[0,1,2,4,8,16,32,64,128,27,54],C=C.AES=t.extend({_doReset:function(){for(var S=this._key,x=S.words,M=S.sigBytes/4,S=4*((this._nRounds=M+6)+1),P=this._keySchedule=[],T=0;T<S;T++)if(T<M)P[T]=x[T];else{var B=P[T-1];T%M?6<M&&T%M==4&&(B=e[B>>>24]<<24|e[B>>>16&255]<<16|e[B>>>8&255]<<8|e[B&255]):(B=B<<8|B>>>24,B=e[B>>>24]<<24|e[B>>>16&255]<<16|e[B>>>8&255]<<8|e[B&255],B^=E[T/M|0]<<24),P[T]=P[T-M]^B}for(x=this._invKeySchedule=[],M=0;M<S;M++)T=S-M,B=M%4?P[T]:P[T-4],x[M]=4>M||4>=T?B:u[e[B>>>24]]^l[e[B>>>16&255]]^c[e[B>>>8&255]]^f[e[B&255]]},encryptBlock:function(x,M){this._doCryptBlock(x,M,this._keySchedule,i,a,o,s,e)},decryptBlock:function(x,M){var S=x[M+1];x[M+1]=x[M+3],x[M+3]=S,this._doCryptBlock(x,M,this._invKeySchedule,u,l,c,f,r),S=x[M+1],x[M+1]=x[M+3],x[M+3]=S},_doCryptBlock:function(x,M,S,P,T,B,F,L){for(var O=this._nRounds,X=x[M]^S[0],Z=x[M+1]^S[1],q=x[M+2]^S[2],G=x[M+3]^S[3],Q=4,N=1;N<O;N++)var H=P[X>>>24]^T[Z>>>16&255]^B[q>>>8&255]^F[G&255]^S[Q++],K=P[Z>>>24]^T[q>>>16&255]^B[G>>>8&255]^F[X&255]^S[Q++],U=P[q>>>24]^T[G>>>16&255]^B[X>>>8&255]^F[Z&255]^S[Q++],G=P[G>>>24]^T[X>>>16&255]^B[Z>>>8&255]^F[q&255]^S[Q++],X=H,Z=K,q=U;H=(L[X>>>24]<<24|L[Z>>>16&255]<<16|L[q>>>8&255]<<8|L[G&255])^S[Q++],K=(L[Z>>>24]<<24|L[q>>>16&255]<<16|L[G>>>8&255]<<8|L[X&255])^S[Q++],U=(L[q>>>24]<<24|L[G>>>16&255]<<16|L[X>>>8&255]<<8|L[Z&255])^S[Q++],G=(L[G>>>24]<<24|L[X>>>16&255]<<16|L[Z>>>8&255]<<8|L[q&255])^S[Q++],x[M]=H,x[M+1]=K,x[M+2]=U,x[M+3]=G},keySize:8});n.AES=t._createHelper(C)})();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
343
+ */var Pr;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 Ot(){return new ue(null)}function vl(n,t,e,r,i,a){for(;--a>=0;){var o=t*this[n++]+e[r]+i;i=Math.floor(o/67108864),e[r++]=o&67108863}return i}function Al(n,t,e,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var u=this[n]&32767,l=this[n++]>>15,c=s*u+l*o;u=o*u+((c&32767)<<15)+e[r]+(i&1073741823),i=(u>>>30)+(c>>>15)+s*l+(i>>>30),e[r++]=u&1073741823}return i}function ml(n,t,e,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var u=this[n]&16383,l=this[n++]>>14,c=s*u+l*o;u=o*u+((c&16383)<<14)+e[r]+i,i=(u>>28)+(c>>14)+s*l,e[r++]=u&268435455}return i}typeof navigator!="undefined"&&navigator.appName=="Microsoft Internet Explorer"?(ue.prototype.am=Al,Pr=30):typeof navigator!="undefined"&&navigator.appName!="Netscape"?(ue.prototype.am=vl,Pr=26):(ue.prototype.am=ml,Pr=28);ue.prototype.DB=Pr;ue.prototype.DM=(1<<Pr)-1;ue.prototype.DV=1<<Pr;var Ta=52;ue.prototype.FV=Math.pow(2,Ta);ue.prototype.F1=Ta-Pr;ue.prototype.F2=2*Pr-Ta;var gl="0123456789abcdefghijklmnopqrstuvwxyz",mi=new Array,un,Ft;un=48;for(Ft=0;Ft<=9;++Ft)mi[un++]=Ft;un=97;for(Ft=10;Ft<36;++Ft)mi[un++]=Ft;un=65;for(Ft=10;Ft<36;++Ft)mi[un++]=Ft;function fr(n){return gl.charAt(n)}function yl(n,t){var e=mi[n.charCodeAt(t)];return e==null?-1:e}function bl(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t,n.s=this.s}function wl(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 Pa(n){var t=Ot();return t.fromInt(n),t}function El(n,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(n,t);return}this.t=0,this.s=0;for(var r=n.length,i=!1,a=0;--r>=0;){var o=e==8?n[r]&255:yl(n,r);if(o<0){n.charAt(r)=="-"&&(i=!0);continue}i=!1,a==0?this[this.t++]=o:a+e>this.DB?(this[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this[this.t++]=o>>this.DB-a):this[this.t-1]|=o<<a,a+=e,a>=this.DB&&(a-=this.DB)}e==8&&n[0]&128&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&ue.ZERO.subTo(this,this)}function xl(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t}function Cl(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=fr(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+=fr(r));return i?a:"0"}function Ml(){var n=Ot();return ue.ZERO.subTo(this,n),n}function Sl(){return this.s<0?this.negate():this}function Il(n){var t=this.s-n.s;if(t!=0)return t;var e=this.t;if(t=e-n.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-n[e])!=0)return t;return 0}function Ba(n){var t=1,e;return(e=n>>>16)!=0&&(n=e,t+=16),(e=n>>8)!=0&&(n=e,t+=8),(e=n>>4)!=0&&(n=e,t+=4),(e=n>>2)!=0&&(n=e,t+=2),(e=n>>1)!=0&&(n=e,t+=1),t}function Tl(){return this.t<=0?0:this.DB*(this.t-1)+Ba(this[this.t-1]^this.s&this.DM)}function Pl(n,t){var e;for(e=this.t-1;e>=0;--e)t[e+n]=this[e];for(e=n-1;e>=0;--e)t[e]=0;t.t=this.t+n,t.s=this.s}function Bl(n,t){for(var e=n;e<this.t;++e)t[e-n]=this[e];t.t=Math.max(this.t-n,0),t.s=this.s}function Rl(n,t){var e=n%this.DB,r=this.DB-e,i=(1<<r)-1,a=Math.floor(n/this.DB),o=this.s<<e&this.DM,s;for(s=this.t-1;s>=0;--s)t[s+a+1]=this[s]>>r|o,o=(this[s]&i)<<e;for(s=a-1;s>=0;--s)t[s]=0;t[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function Fl(n,t){t.s=this.s;var e=Math.floor(n/this.DB);if(e>=this.t){t.t=0;return}var r=n%this.DB,i=this.DB-r,a=(1<<r)-1;t[0]=this[e]>>r;for(var o=e+1;o<this.t;++o)t[o-e-1]|=(this[o]&a)<<i,t[o-e]=this[o]>>r;r>0&&(t[this.t-e-1]|=(this.s&a)<<i),t.t=this.t-e,t.clamp()}function kl(n,t){for(var e=0,r=0,i=Math.min(n.t,this.t);e<i;)r+=this[e]-n[e],t[e++]=r&this.DM,r>>=this.DB;if(n.t<this.t){for(r-=n.s;e<this.t;)r+=this[e],t[e++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;e<n.t;)r-=n[e],t[e++]=r&this.DM,r>>=this.DB;r-=n.s}t.s=r<0?-1:0,r<-1?t[e++]=this.DV+r:r>0&&(t[e++]=r),t.t=e,t.clamp()}function Ll(n,t){var e=this.abs(),r=n.abs(),i=e.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+e.t]=e.am(0,r[i],t,i,0,e.t);t.s=0,t.clamp(),this.s!=n.s&&ue.ZERO.subTo(t,t)}function Ol(n){for(var t=this.abs(),e=n.t=2*t.t;--e>=0;)n[e]=0;for(e=0;e<t.t-1;++e){var r=t.am(e,t[e],n,2*e,0,1);(n[e+t.t]+=t.am(e+1,2*t[e],n,2*e+1,r,t.t-e-1))>=t.DV&&(n[e+t.t]-=t.DV,n[e+t.t+1]=1)}n.t>0&&(n[n.t-1]+=t.am(e,t[e],n,2*e,0,1)),n.s=0,n.clamp()}function Vl(n,t,e){var r=n.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=Ot());var a=Ot(),o=this.s,s=n.s,u=this.DB-Ba(r[r.t-1]);u>0?(r.lShiftTo(u,a),i.lShiftTo(u,e)):(r.copyTo(a),i.copyTo(e));var l=a.t,c=a[l-1];if(c!=0){var f=c*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0),A=this.FV/f,p=(1<<this.F1)/f,y=1<<this.F2,v=e.t,m=v-l,h=t==null?Ot():t;for(a.dlShiftTo(m,h),e.compareTo(h)>=0&&(e[e.t++]=1,e.subTo(h,e)),ue.ONE.dlShiftTo(l,h),h.subTo(a,a);a.t<l;)a[a.t++]=0;for(;--m>=0;){var g=e[--v]==c?this.DM:Math.floor(e[v]*A+(e[v-1]+y)*p);if((e[v]+=a.am(0,g,e,m,0,l))<g)for(a.dlShiftTo(m,h),e.subTo(h,e);e[v]<--g;)e.subTo(h,e)}t!=null&&(e.drShiftTo(l,t),o!=s&&ue.ZERO.subTo(t,t)),e.t=l,e.clamp(),u>0&&e.rShiftTo(u,e),o<0&&ue.ZERO.subTo(e,e)}}}function Nl(n){var t=Ot();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(ue.ZERO)>0&&n.subTo(t,t),t}function ln(n){this.m=n}function Ql(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n}function Dl(n){return n}function Ul(n){n.divRemTo(this.m,null,n)}function zl(n,t,e){n.multiplyTo(t,e),this.reduce(e)}function Gl(n,t){n.squareTo(t),this.reduce(t)}ln.prototype.convert=Ql;ln.prototype.revert=Dl;ln.prototype.reduce=Ul;ln.prototype.mulTo=zl;ln.prototype.sqrTo=Gl;function Hl(){if(this.t<1)return 0;var n=this[0];if(!(n&1))return 0;var t=n&3;return t=t*(2-(n&15)*t)&15,t=t*(2-(n&255)*t)&255,t=t*(2-((n&65535)*t&65535))&65535,t=t*(2-n*t%this.DV)%this.DV,t>0?this.DV-t:-t}function cn(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 Kl(n){var t=Ot();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 ql(n){var t=Ot();return n.copyTo(t),this.reduce(t),t}function jl(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var t=0;t<this.m.t;++t){var e=n[t]&32767,r=e*this.mpl+((e*this.mph+(n[t]>>15)*this.mpl&this.um)<<15)&n.DM;for(e=t+this.m.t,n[e]+=this.m.am(0,r,n,t,0,this.m.t);n[e]>=n.DV;)n[e]-=n.DV,n[++e]++}n.clamp(),n.drShiftTo(this.m.t,n),n.compareTo(this.m)>=0&&n.subTo(this.m,n)}function Wl(n,t){n.squareTo(t),this.reduce(t)}function Xl(n,t,e){n.multiplyTo(t,e),this.reduce(e)}cn.prototype.convert=Kl;cn.prototype.revert=ql;cn.prototype.reduce=jl;cn.prototype.mulTo=Xl;cn.prototype.sqrTo=Wl;function _l(){return(this.t>0?this[0]&1:this.s)==0}function Zl(n,t){if(n>4294967295||n<1)return ue.ONE;var e=Ot(),r=Ot(),i=t.convert(this),a=Ba(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 Yl(n,t){var e;return n<256||t.isEven()?e=new ln(t):e=new cn(t),this.exp(n,e)}ue.prototype.copyTo=bl;ue.prototype.fromInt=wl;ue.prototype.fromString=El;ue.prototype.clamp=xl;ue.prototype.dlShiftTo=Pl;ue.prototype.drShiftTo=Bl;ue.prototype.lShiftTo=Rl;ue.prototype.rShiftTo=Fl;ue.prototype.subTo=kl;ue.prototype.multiplyTo=Ll;ue.prototype.squareTo=Ol;ue.prototype.divRemTo=Vl;ue.prototype.invDigit=Hl;ue.prototype.isEven=_l;ue.prototype.exp=Zl;ue.prototype.toString=Cl;ue.prototype.negate=Ml;ue.prototype.abs=Sl;ue.prototype.compareTo=Il;ue.prototype.bitLength=Tl;ue.prototype.mod=Nl;ue.prototype.modPowInt=Yl;ue.ZERO=Pa(0);ue.ONE=Pa(1);/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Jl(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function $l(n){return Math.floor(Math.LN2*this.DB/Math.log(n))}function e0(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function t0(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=Pa(e),i=Ot(),a=Ot(),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=$l;ue.prototype.toRadix=t0;ue.prototype.intValue=Jl;ue.prototype.signum=e0;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */var $r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ds="=";function r0(n){var t,e,r="";for(t=0;t+3<=n.length;t+=3)e=parseInt(n.substring(t,t+3),16),r+=$r.charAt(e>>6)+$r.charAt(e&63);for(t+1==n.length?(e=parseInt(n.substring(t,t+1),16),r+=$r.charAt(e<<2)):t+2==n.length&&(e=parseInt(n.substring(t,t+2),16),r+=$r.charAt(e>>2)+$r.charAt((e&3)<<4));(r.length&3)>0;)r+=Ds;return r}function Ra(n){var t="",e,r=0,i,a;for(e=0;e<n.length&&n.charAt(e)!=Ds;++e)a=$r.indexOf(n.charAt(e)),!(a<0)&&(r==0?(t+=fr(a>>2),i=a&3,r=1):r==1?(t+=fr(i<<2|a>>4),i=a&15,r=2):r==2?(t+=fr(i),t+=fr(a>>2),i=a&3,r=3):(t+=fr(i<<2|a>>4),t+=fr(a&15),r=0));return r==1&&(t+=fr(i<<2)),t}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function yt(n,t){return new ue(n,t)}function n0(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 so(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 i0(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(v){return pr(a.hashHex(gi(v),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 l=e("")+s+""+n,c=new Array(r);new SecureRandom().nextBytes(c);var f=so(c,l.length,e),A=[];for(u=0;u<l.length;u+=1)A[u]=l.charCodeAt(u)^f.charCodeAt(u);var p=so(A,c.length,e),y=[0];for(u=0;u<c.length;u+=1)y[u+1]=c[u]^p.charCodeAt(u);return new ue(y.concat(A))}function Ie(){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 a0(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=yt(n,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"}function o0(n){return n.modPowInt(this.e,this.n)}function s0(n){var t=n0(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 u0(n,t,e){var r=i0(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}Ie.prototype.doPublic=o0;Ie.prototype.setPublic=a0;Ie.prototype.encrypt=s0;Ie.prototype.encryptOAEP=u0;Ie.prototype.type="RSA";/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function l0(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 uo(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 c0(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(m){return pr(a.hashHex(gi(m),o))}),n=n.toByteArray();var f;for(f=0;f<n.length;f+=1)n[f]&=255;for(;n.length<t;)n.unshift(0);if(n=String.fromCharCode.apply(String,n),n.length<2*r+2)throw"Cipher too short";var s=n.substr(1,r),u=n.substr(r+1),l=uo(u,r,e),c=[],f;for(f=0;f<s.length;f+=1)c[f]=s.charCodeAt(f)^l.charCodeAt(f);var A=uo(String.fromCharCode.apply(String,c),n.length-r,e),p=[];for(f=0;f<u.length;f+=1)p[f]=u.charCodeAt(f)^A.charCodeAt(f);if(p=String.fromCharCode.apply(String,p),p.substr(0,r)!==e(""))throw"Hash mismatch";p=p.substr(r);var y=p.indexOf(""),v=y!=-1?p.substr(0,y).lastIndexOf("\0"):-1;if(v+1!=y)throw"Malformed data";return p.substr(y+1)}function d0(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=yt(n,16),this.e=parseInt(t,16),this.d=yt(e,16);else throw"Invalid RSA private key"}function f0(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=yt(n,16),this.e=parseInt(t,16),this.d=yt(e,16),this.p=yt(r,16),this.q=yt(i,16),this.dmp1=yt(a,16),this.dmq1=yt(o,16),this.coeff=yt(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"}function h0(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 p0(n){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=yt(n,16),e=this.doPrivate(t);return e==null?null:l0(e,this.n.bitLength()+7>>3)}function v0(n,t,e){if(n.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=yt(n,16),i=this.doPrivate(r);return i==null?null:c0(i,this.n.bitLength()+7>>3,t,e)}Ie.prototype.doPrivate=h0;Ie.prototype.setPrivate=d0;Ie.prototype.setPrivateEx=f0;Ie.prototype.decrypt=p0;Ie.prototype.decryptOAEP=v0;(typeof ee.lang=="undefined"||!ee.lang)&&(ee.lang={});ee.lang.String=function(){};function A0(n){return n.length%4==2?n=n+"==":n.length%4==3&&(n=n+"="),n=n.replace(/-/g,"+"),n=n.replace(/_/g,"/"),n}function $e(n){return Ra(A0(n))}function tr(n){return decodeURIComponent(w0(n))}function pr(n){for(var t="",e=0;e<n.length-1;e+=2)t+=String.fromCharCode(parseInt(n.substr(e,2),16));return t}function gi(n){for(var t="",e=0;e<n.length;e++)t+=("0"+n.charCodeAt(e).toString(16)).slice(-2);return t}function m0(n){return r0(n)}function g0(n){var t=m0(n),e=t.replace(/(.{64})/g,`$1\r
344
+ `);return e=e.replace(/\r\n$/,""),e}function y0(n){var t=n.replace(/[^0-9A-Za-z\/+=]*/g,""),e=Ra(t);return e}function b0(n,t){var e=g0(n);return"-----BEGIN "+t+`-----\r
345
345
  `+e+`\r
346
346
  -----END `+t+`-----\r
347
- `}function jr(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 [^-]+-----[^]*$/,"")),bl(n)}function xl(n){return n.replace(/(..)/g,"%$1")}function El(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 fo(n){var t="malformed hex value";if(!n.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(n.length==8){var e;try{return e=parseInt(n.substr(0,2),16)+"."+parseInt(n.substr(2,2),16)+"."+parseInt(n.substr(4,2),16)+"."+parseInt(n.substr(6,2),16),e}catch(r){throw t}}else return n.length==32?El(n):n}function Ml(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 tr(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 tr(s.toString(16)+u.toString(16)+c.toString(16))}var e=n.match(/.{4}/g),r=e.map(t);return r.join("")}$.lang.String.isHex=function(n){return Gs(n)};function Gs(n){return!!(n.length%2==0&&(n.match(/^[0-9a-f]+$/)||n.match(/^[0-9A-F]+$/)))}$.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 ho(n){return n.length%2==1?"0"+n:n.substr(0,1)>"7"?"00"+n:n}function Cl(n){if(!Gs(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+po((a[o]&127).toString(2),7):(u=u+po((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(l){return null}}var po=function(n,t,e){return e==null&&(e="0"),n.length>=t?n:new Array(t-n.length+1).join(e)+n};function Sl(n){try{var t=n.substr(0,2);if(t=="00")return parseInt(n.substr(2),16);var e=parseInt(t,16),r=n.substr(2),i=parseInt(r,16).toString(2);return i=="0"&&(i="00000000"),i=i.slice(0,0-e),parseInt(i,2)}catch(a){return-1}}(typeof $.crypto=="undefined"||!$.crypto)&&($.crypto={});$.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 $.crypto.MessageDigest({alg:t});return e.digestString(n)},this.hashHex=function(n,t){var e=new $.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")}};$.crypto.MessageDigest=function(n){this.setAlgAndProvider=function(t,e){if(t=$.crypto.MessageDigest.getCanonicalAlgName(t),t!==null&&e===void 0&&(e=$.crypto.Util.DEFAULTPROVIDER[t]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)!=-1&&e=="cryptojs"){try{this.md=$.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=$.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))};$.crypto.MessageDigest.getCanonicalAlgName=function(n){return typeof n=="string"&&(n=n.toLowerCase(),n=n.replace(/-/,"")),n};$.crypto.MessageDigest.getHashLength=function(n){var t=$.crypto.MessageDigest,e=t.getCanonicalAlgName(n);if(t.HASHLENGTH[e]===void 0)throw"not supported algorithm: "+n;return t.HASHLENGTH[e]};$.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20};$.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 $.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=qr.getKey(i):o=qr.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 Me&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,i,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof Me&&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=$.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=qr.getKey(n.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}};$.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 qr=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),x={};x.key=b,x.iv=w,x.ciphertext=g;var E=m.decrypt(x,b,{iv:w});return ge.enc.Hex.stringify(E)},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),x=m.encrypt(g,b,{iv:w}),E=ge.enc.Hex.parse(x.toString()),M=ge.enc.Base64.stringify(E);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 Gr(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 [^-]+-----[^]*$/,"")),y0(n)}function w0(n){return n.replace(/(..)/g,"%$1")}function E0(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 lo(n){var t="malformed hex value";if(!n.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(n.length==8){var e;try{return e=parseInt(n.substr(0,2),16)+"."+parseInt(n.substr(2,2),16)+"."+parseInt(n.substr(4,2),16)+"."+parseInt(n.substr(6,2),16),e}catch(r){throw t}}else return n.length==32?E0(n):n}function x0(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 tr(s.toString(16)+u.toString(16))}var s=224|(a&240)>>4,u=128|(a&15)<<2|(o&192)>>6,l=128|o&63;return tr(s.toString(16)+u.toString(16)+l.toString(16))}var e=n.match(/.{4}/g),r=e.map(t);return r.join("")}ee.lang.String.isHex=function(n){return Us(n)};function Us(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 co(n){return n.length%2==1?"0"+n:n.substr(0,1)>"7"?"00"+n:n}function C0(n){if(!Us(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+fo((a[o]&127).toString(2),7):(u=u+fo((a[o]&127).toString(2),7),s.push(new String(parseInt(u,2))),u="");var l=t.join(".");return s.length>0&&(l=l+"."+s.join(".")),l}catch(c){return null}}var fo=function(n,t,e){return e==null&&(e="0"),n.length>=t?n:new Array(t-n.length+1).join(e)+n};function M0(n){try{var t=n.substr(0,2);if(t=="00")return parseInt(n.substr(2),16);var e=parseInt(t,16),r=n.substr(2),i=parseInt(r,16).toString(2);return i=="0"&&(i="00000000"),i=i.slice(0,0-e),parseInt(i,2)}catch(a){return-1}}(typeof ee.crypto=="undefined"||!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:ye.algo.MD5,sha1:ye.algo.SHA1,sha224:ye.algo.SHA224,sha256:ye.algo.SHA256,sha384:ye.algo.SHA384,sha512:ye.algo.SHA512,ripemd160:ye.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=ye.enc.Hex.parse(r);this.md.update(i)},this.digest=function(){var r=this.md.finalize();return r.toString(ye.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=Ur.getKey(i):o=Ur.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 Ie&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,i,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof Ie&&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=Ur.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 Ur=function(){var n=function(y,v,m){return r(ye.AES,y,v,m)},t=function(y,v,m){return r(ye.TripleDES,y,v,m)},e=function(y,v,m){return r(ye.DES,y,v,m)},r=function(y,v,m,h){var g=ye.enc.Hex.parse(v),b=ye.enc.Hex.parse(m),w=ye.enc.Hex.parse(h),E={};E.key=b,E.iv=w,E.ciphertext=g;var C=y.decrypt(E,b,{iv:w});return ye.enc.Hex.stringify(C)},i=function(y,v,m){return s(ye.AES,y,v,m)},a=function(y,v,m){return s(ye.TripleDES,y,v,m)},o=function(y,v,m){return s(ye.DES,y,v,m)},s=function(y,v,m,h){var g=ye.enc.Hex.parse(v),b=ye.enc.Hex.parse(m),w=ye.enc.Hex.parse(h),E=y.encrypt(g,b,{iv:w}),C=ye.enc.Hex.parse(E.toString()),x=ye.enc.Base64.stringify(C);return x},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}},l=function(y){var v=ye.lib.WordArray.random(y),m=ye.enc.Hex.stringify(v);return m},c=function(y){var v={},m=y.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));m&&(v.cipher=m[1],v.ivsalt=m[2]);var h=y.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));h&&(v.type=h[1]);var g=-1,b=0;y.indexOf(`\r
348
348
  \r
349
- `)!=-1&&(g=m.indexOf(`\r
349
+ `)!=-1&&(g=y.indexOf(`\r
350
350
  \r
351
- `),b=2),m.indexOf(`
351
+ `),b=2),y.indexOf(`
352
352
 
353
- `)!=-1&&(g=m.indexOf(`
353
+ `)!=-1&&(g=y.indexOf(`
354
354
 
355
- `),b=1);var w=m.indexOf("-----END");if(g!=-1&&w!=-1){var x=m.substring(g+b*2,w-b);x=x.replace(/\s+/g,""),A.data=x}return A},h=function(m,A,y){for(var f=y.substring(0,16),g=ge.enc.Hex.parse(f),b=ge.enc.Utf8.parse(A),w=u[m].keylen+u[m].ivlen,x="",E=null;;){var M=ge.algo.MD5.create();if(E!=null&&M.update(E),M.update(b),M.update(g),E=M.finalize(),x=x+ge.enc.Hex.stringify(E),x.length>=w*2)break}var C={};return C.keyhex=x.substr(0,u[m].keylen*2),C.ivhex=x.substr(u[m].keylen*2,u[m].ivlen*2),C},v=function(m,A,y,f){var g=ge.enc.Base64.parse(m),b=ge.enc.Hex.stringify(g),w=u[A].proc,x=w(b,y,f);return x},p=function(m,A,y,f){var g=u[A].eproc,b=g(m,y,f);return b};return{version:"1.0.0",parsePKCS5PEM:function(m){return l(m)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(m,A,y){return h(m,A,y)},decryptKeyB64:function(m,A,y,f){return v(m,A,y,f)},getDecryptedKeyHex:function(m,A){var y=l(m),f=y.cipher,g=y.ivsalt,b=y.data,w=h(f,A,g),x=w.keyhex,E=v(b,f,x,g);return E},getEncryptedPKCS5PEMFromPrvKeyHex:function(m,A,y,f,g){var S="";if((typeof f=="undefined"||f==null)&&(f="AES-256-CBC"),typeof u[f]=="undefined")throw"KEYUTIL unsupported algorithm: "+f;if(typeof g=="undefined"||g==null){var b=u[f].ivlen,w=c(b);g=w.toUpperCase()}var x=h(f,y,g),E=x.keyhex,M=p(A,f,E,g),C=M.replace(/(.{64})/g,`$1\r
356
- `),S="-----BEGIN "+m+` PRIVATE KEY-----\r
355
+ `),b=1);var w=y.indexOf("-----END");if(g!=-1&&w!=-1){var E=y.substring(g+b*2,w-b);E=E.replace(/\s+/g,""),v.data=E}return v},f=function(y,v,m){for(var h=m.substring(0,16),g=ye.enc.Hex.parse(h),b=ye.enc.Utf8.parse(v),w=u[y].keylen+u[y].ivlen,E="",C=null;;){var x=ye.algo.MD5.create();if(C!=null&&x.update(C),x.update(b),x.update(g),C=x.finalize(),E=E+ye.enc.Hex.stringify(C),E.length>=w*2)break}var M={};return M.keyhex=E.substr(0,u[y].keylen*2),M.ivhex=E.substr(u[y].keylen*2,u[y].ivlen*2),M},A=function(y,v,m,h){var g=ye.enc.Base64.parse(y),b=ye.enc.Hex.stringify(g),w=u[v].proc,E=w(b,m,h);return E},p=function(y,v,m,h){var g=u[v].eproc,b=g(y,m,h);return b};return{version:"1.0.0",parsePKCS5PEM:function(y){return c(y)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(y,v,m){return f(y,v,m)},decryptKeyB64:function(y,v,m,h){return A(y,v,m,h)},getDecryptedKeyHex:function(y,v){var m=c(y),h=m.cipher,g=m.ivsalt,b=m.data,w=f(h,v,g),E=w.keyhex,C=A(b,h,E,g);return C},getEncryptedPKCS5PEMFromPrvKeyHex:function(y,v,m,h,g){var S="";if((typeof h=="undefined"||h==null)&&(h="AES-256-CBC"),typeof u[h]=="undefined")throw"KEYUTIL unsupported algorithm: "+h;if(typeof g=="undefined"||g==null){var b=u[h].ivlen,w=l(b);g=w.toUpperCase()}var E=f(h,m,g),C=E.keyhex,x=p(v,h,C,g),M=x.replace(/(.{64})/g,`$1\r
356
+ `),S="-----BEGIN "+y+` PRIVATE KEY-----\r
357
357
  `;return S+=`Proc-Type: 4,ENCRYPTED\r
358
- `,S+="DEK-Info: "+f+","+g+`\r
358
+ `,S+="DEK-Info: "+h+","+g+`\r
359
359
  `,S+=`\r
360
- `,S+=C,S+=`\r
361
- -----END `+m+` PRIVATE KEY-----\r
362
- `,S},parseHexOfEncryptedPKCS8:function(m){var A=re,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 x=y(m,w[1]);if(w.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+x.length;var E=y(m,x[1]);if(E.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+E.length;if(f(m,E[0])!="2a864886f70d0307")throw"this only supports TripleDES";g.encryptionSchemeAlg="TripleDES",g.encryptionSchemeIV=f(m,E[1]);var M=y(m,x[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 S=f(m,C[1]);try{g.pbkdf2Iter=parseInt(S,16)}catch(P){throw"malformed format pbkdf2Iter: "+S}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=jr(m,"ENCRYPTED PRIVATE KEY"),f=this.parseHexOfEncryptedPKCS8(y),g=qr.getPBKDF2KeyHexFromParam(f,A),b={};b.ciphertext=ge.enc.Hex.parse(f.ciphertext);var w=ge.enc.Hex.parse(g),x=ge.enc.Hex.parse(f.encryptionSchemeIV),E=ge.TripleDES.decrypt(b,w,{iv:x}),M=ge.enc.Hex.stringify(E);return M},getKeyFromEncryptedPKCS8PEM:function(m,A){var y=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(m,A),f=this.getKeyFromPlainPrivatePKCS8Hex(y);return f},parsePlainPrivatePKCS8Hex:function(m){var A=re,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=jr(m,"PRIVATE KEY"),y=this.getKeyFromPlainPrivatePKCS8Hex(A);return y},getKeyFromPlainPrivatePKCS8Hex:function(m){var A=this.parsePlainPrivatePKCS8Hex(m),y;if(A.algoid=="2a864886f70d010101")y=new Me;else if($.crypto.DSA&&A.algoid=="2a8648ce380401")y=new $.crypto.DSA;else if($.crypto.ECDSA&&A.algoid=="2a8648ce3d0201")y=new $.crypto.ECDSA;else throw"unsupported private key algorithm";return y.readPKCS8PrvKeyHex(m),y},_getKeyFromPublicPKCS8Hex:function(m){var A,y=re.getVbyList(m,0,[0,0],"06");if(y==="2a864886f70d010101")A=new Me;else if($.crypto.DSA&&y==="2a8648ce380401")A=new $.crypto.DSA;else if($.crypto.ECDSA&&y==="2a8648ce3d0201")A=new $.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return A.readPKCS8PubKeyHex(m),A},parsePublicRawRSAKeyHex:function(m){var A=re,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=re,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 x=y(m,w);if(x.length!=2)throw"malformed PKCS8 public key(code:002)";if(m.substr(x[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(g.algoid=f(m,x[0]),m.substr(x[1],2)=="06"?g.algparam=f(m,x[1]):m.substr(x[1],2)=="30"&&(g.algparam={},g.algparam.p=A.getVbyList(m,x[1],[0],"02"),g.algparam.q=A.getVbyList(m,x[1],[1],"02"),g.algparam.g=A.getVbyList(m,x[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}}}();qr.getKey=function(n,t,e){var r=re,i=r.getChildIdx;r.getV;var a=r.getVbyList,o=$.crypto,s=o.ECDSA,u=o.DSA,c=Me,l=jr,h=qr;if(typeof c!="undefined"&&n instanceof c||typeof s!="undefined"&&n instanceof s||typeof u!="undefined"&&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 v=new c;return v.setPublic(n.n,n.e),v}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 v=new c;return v.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),v}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var v=new c;return v.setPrivate(n.n,n.e,n.d),v}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var v=new u;return v.setPublic(n.p,n.q,n.g,n.y),v}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var v=new u;return v.setPrivate(n.p,n.q,n.g,n.y,n.x),v}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var v=new c;return v.setPublic(tt(n.n),tt(n.e)),v}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 v=new c;return v.setPrivateEx(tt(n.n),tt(n.e),tt(n.d),tt(n.p),tt(n.q),tt(n.dp),tt(n.dq),tt(n.qi)),v}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var v=new c;return v.setPrivate(tt(n.n),tt(n.e),tt(n.d)),v}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d===void 0){var p=new s({curve:n.crv}),m=p.ecparams.keylen/4,A=("0000000000"+tt(n.x)).slice(-m),y=("0000000000"+tt(n.y)).slice(-m),f="04"+A+y;return p.setPublicKeyHex(f),p}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d!==void 0){var p=new s({curve:n.crv}),m=p.ecparams.keylen/4,A=("0000000000"+tt(n.x)).slice(-m),y=("0000000000"+tt(n.y)).slice(-m),f="04"+A+y,g=("0000000000"+tt(n.d)).slice(-m);return p.setPublicKeyHex(f),p.setPrivateKeyHex(g),p}if(e==="pkcs5prv"){var b=n,r=re,w,v;if(w=i(b,0),w.length===9)v=new c,v.readPKCS5PrvKeyHex(b);else if(w.length===6)v=new u,v.readPKCS5PrvKeyHex(b);else if(w.length>2&&b.substr(w[1],2)==="04")v=new s,v.readPKCS5PrvKeyHex(b);else throw"unsupported PKCS#1/5 hexadecimal key";return v}if(e==="pkcs8prv"){var v=h.getKeyFromPlainPrivatePKCS8Hex(n);return v}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 x=jr(n,"PUBLIC KEY");return h._getKeyFromPublicPKCS8Hex(x)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=l(n,"RSA PRIVATE KEY");return h.getKey(E,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"),S=a(M,0,[2],"02"),P=a(M,0,[3],"02"),I=a(M,0,[4],"02"),B=a(M,0,[5],"02"),v=new u;return v.setPrivate(new ie(C,16),new ie(S,16),new ie(P,16),new ie(I,16),new ie(B,16)),v}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var E=l(n,"EC PRIVATE KEY");return h.getKey(E,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 L=h.getDecryptedKeyHex(n,t),k=new Me;return k.readPKCS5PrvKeyHex(L),k}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var M=h.getDecryptedKeyHex(n,t),v=a(M,0,[1],"04"),O=a(M,0,[2,0],"06"),N=a(M,0,[3,0],"03").substr(2),D="";if($.crypto.OID.oidhex2name[O]!==void 0)D=$.crypto.OID.oidhex2name[O];else throw"undefined OID(hex) in KJUR.crypto.OID: "+O;var p=new s({curve:D});return p.setPublicKeyHex(N),p.setPrivateKeyHex(v),p.isPublic=!1,p}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"),S=a(M,0,[2],"02"),P=a(M,0,[3],"02"),I=a(M,0,[4],"02"),B=a(M,0,[5],"02"),v=new u;return v.setPrivate(new ie(C,16),new ie(S,16),new ie(P,16),new ie(I,16),new ie(B,16)),v}if(n.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return h.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument")};(typeof $.asn1=="undefined"||!$.asn1)&&($.asn1={});$.asn1.ASN1Util={};$.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 ie(a,2);i=i+"."+c.toString(10),a=""}}return i};var re=new function(){};re.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};re.getL=function(n,t){var e=re.getLblen(n,t);return e<1?"":n.substr(t+2,e*2)};re.getVblen=function(n,t){var e,r;return e=re.getL(n,t),e==""?-1:(e.substr(0,1)==="8"?r=new ie(e.substr(2),16):r=new ie(e,16),r.intValue())};re.getVidx=function(n,t){var e=re.getLblen(n,t);return e<0?e:t+(e+1)*2};re.getV=function(n,t){var e=re.getVidx(n,t),r=re.getVblen(n,t);return n.substr(e,r*2)};re.getTLV=function(n,t){return n.substr(t,2)+re.getL(n,t)+re.getV(n,t)};re.getTLVblen=function(n,t){return 2+re.getLblen(n,t)*2+re.getVblen(n,t)*2};re.getNextSiblingIdx=function(n,t){var e=re.getVidx(n,t),r=re.getVblen(n,t);return e+r*2};re.getChildIdx=function(n,t){var e=re,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};re.getNthChildIdx=function(n,t,e){var r=re.getChildIdx(n,t);return r[e]};re.getIdxbyList=function(n,t,e,r){var i=re,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))};re.getIdxbyListEx=function(n,t,e,r){var i=re,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};re.getTLVbyList=function(n,t,e,r){var i=re,a=i.getIdxbyList(n,t,e,r);return a==-1||a>=n.length?null:i.getTLV(n,a)};re.getTLVbyListEx=function(n,t,e,r){var i=re,a=i.getIdxbyListEx(n,t,e,r);return a==-1?null:i.getTLV(n,a)};re.getVbyList=function(n,t,e,r,i){var a=re,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)};re.getVbyListEx=function(n,t,e,r,i){var a=re,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)};re.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=re.getV(n,t);return r=="02"?parseInt(i,16):Sl(i)}catch(a){return e}};re.getOID=function(n,t,e){e==null&&(e=null);try{if(n.substr(t,2)!="06")return e;var r=re.getV(n,t);return Cl(r)}catch(i){return e}};re.getOIDName=function(n,t,e){e==null&&(e=null);try{var r=re.getOID(n,t,e);if(r==e)return e;var i=$.asn1.x509.OID.oid2name(r);return i==""?r:i}catch(a){return e}};re.getString=function(n,t,e){e==null&&(e=null);try{var r=re.getV(n,t);return vr(r)}catch(i){return e}};re.hextooidstr=function(n){var t=function(h,v){return h.length>=v?h:new Array(v-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};re.isContextTag=function(n,t){n=n.toLowerCase();var e,r;try{e=parseInt(n,16)}catch(a){return-1}if(t===void 0)return(e&192)==128;try{var i=t.match(/^\[[0-9]+\]$/);return i==null||(r=parseInt(t.substr(1,t.length-1),10),r>31)?!1:(e&192)==128&&(e&31)==r}catch(a){return!1}};re.isASN1HEX=function(n){var t=re;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};re.checkStrictDER=function(n,t,e,r,i){var a=re;if(e===void 0){if(typeof n!="string")throw new Error("not hex string");if(n=n.toLowerCase(),!$.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 v=a.getVblen(n,t),p=0,m=a.getChildIdx(n,t),A=0;A<m.length;A++){var y=a.getTLV(n,m[A]);p+=y.length,a.checkStrictDER(n,m[A],e,r,i)}if(v*2!=p)throw new Error("sum of children's TLV length and L unmatch: "+v*2+"!="+p)}};re.oidname=function(n){var t=$.asn1;$.lang.String.isHex(n)&&(n=t.ASN1Util.oidHexToInt(n));var e=t.x509.OID.oid2name(n);return e===""&&(e=n),e};(typeof $.asn1=="undefined"||!$.asn1)&&($.asn1={});(typeof $.asn1.x509=="undefined"||!$.asn1.x509)&&($.asn1.x509={});$.asn1.x509.AlgorithmIdentifier={};$.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"};$.asn1.x509.OID=new function(n){this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1"},this.objCache={},this.name2obj=function(t){if(typeof this.objCache[t]!="undefined")return this.objCache[t];if(typeof this.name2oidList[t]=="undefined")throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],r=new $.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 $.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=r,r}};$.asn1.x509.OID.oid2name=function(n){var t=$.asn1.x509.OID.name2oidList;for(var e in t)if(t[e]==n)return e;return""};$.asn1.x509.OID.oid2atype=function(n){var t=$.asn1.x509.OID.atype2oidList;for(var e in t)if(t[e]==n)return e;return n};$.asn1.x509.OID.name2oid=function(n){if(n.match(/^[0-9.]+$/))return n;var t=$.asn1.x509.OID.name2oidList;return t[n]===void 0?"":t[n]};Me.getPosArrayOfChildrenFromHex=function(n){return re.getChildIdx(n,0)};Me.getHexValueArrayOfChildrenFromHex=function(n){var t=re,e=t.getV,v=Me.getPosArrayOfChildrenFromHex(n),r=e(n,v[0]),i=e(n,v[1]),a=e(n,v[2]),o=e(n,v[3]),s=e(n,v[4]),u=e(n,v[5]),c=e(n,v[6]),l=e(n,v[7]),h=e(n,v[8]),v=new Array;return v.push(r,i,a,o,s,u,c,l,h),v};Me.prototype.readPrivateKeyFromPEMString=function(n){var t=jr(n),e=Me.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Me.prototype.readPKCS5PrvKeyHex=function(n){var t=Me.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};Me.prototype.readPKCS8PrvKeyHex=function(n){var t,e,r,i,a,o,s,u,c=re,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(h){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,e,r,i,a,o,s,u)};Me.prototype.readPKCS5PubKeyHex=function(n){var t=re,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)};Me.prototype.readPKCS8PubKeyHex=function(n){var t=re;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)};Me.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new Qe,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function Hs(n){for(var t in $.crypto.Util.DIGESTINFOHEAD){var e=$.crypto.Util.DIGESTINFOHEAD[t],r=e.length;if(n.substring(0,r)==e){var i=[t,n.substring(r)];return i}}return[]}Me.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=wt(t,16),r=this.n.bitLength();if(e.bitLength()>r)return!1;var i=this.doPublic(e),a=i.toString(16);if(a.length+3!=r/4)return!1;var o=a.replace(/^1f+00/,""),s=Hs(o);if(s.length==0)return!1;var u=s[0],c=s[1],l=function(v){return $.crypto.Util.hashString(v,u)},h=l(n);return c==h};Me.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=wt(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),a=Hs(i);if(a.length==0)return!1;a[0];var o=a[1];return o==n};Me.prototype.verifyPSS=function(n,t,e,r){var i=function(o){return $.crypto.Util.hashHex(o,e)},a=i(bi(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(a,t,e,r)};Me.prototype.verifyWithMessageHashPSS=function(n,t,e,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=new ie(t,16),a=function(g){return $.crypto.Util.hashHex(g,e)},o=vr(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 v=h.substr(0,c-s-1),p=h.substr(v.length,s),m=65280>>8*c-u&255;if(v.charCodeAt(0)&m)throw new Error("bits beyond keysize not zero");var A=pss_mgf1_str(p,v.length,a),y=[];for(l=0;l<v.length;l+=1)y[l]=v.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 p===vr(a(bi("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,y.slice(-r)))))};Me.SALT_LEN_HLEN=-1;Me.SALT_LEN_MAX=-2;Me.SALT_LEN_RECOVER=-2;function Qe(n){var t=re,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,v=t.getInt,p=t.oidname,m=t.hextooidstr,A=jr,y;try{y=$.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(f){}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=v(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 p(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 qr.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"),x=new $.crypto.Signature({alg:g});return x.init(f),x.updateHex(w),x.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=jr(f);var x=c(w,0,[0,3,0,0],"06");if(r(w,x)!="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 E=0;E<b.length;E++){var M={};M.critical=!1;var C=e(w,b[E]),S=0;C.length===3&&(M.critical=!0,S=1),M.oid=t.hextooidstr(a(w,b[E],[0],"06"));var P=c(w,b[E],[1+S]);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=$.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 x=r(f,10),E=parseInt(x,16);return w.cA=!0,w.pathLen=E,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 x=r(f,0);return w.kid={hex:x},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 x=e(f,0),E=0;E<x.length;E++){var M=f.substr(x[E],2);if(M==="80"&&(w.kid={hex:r(f,x[E])}),M==="a1"){var C=i(f,x[E]),S=this.getGeneralNames(C);w.issuer=S[0].dn}M==="82"&&(w.sn={hex:r(f,x[E])})}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 x=e(f,0),E=0;E<x.length;E++)w.array.push(p(r(f,x[E])));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),x=0;x<w.length;x++)g.push(p(r(b,w[x])));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 x=this.getGeneralName(i(f,g[w]));x!==void 0&&b.push(x)}return b},this.getGeneralName=function(f){var g=f.substr(0,2),b=r(f,0),w=vr(b);if(g=="81")return{rfc822:w};if(g=="82")return{dns:w};if(g=="86")return{uri:w};if(g=="87")return{ip:fo(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 x=new Array,E=i(this.hex,w.vidx),M=e(E,0),C=0;C<M.length;C++)b=E.substr(M[C],2),f=r(E,M[C]),b==="81"&&(g=tr(f),x.push(["MAIL",g])),b==="82"&&(g=tr(f),x.push(["DNS",g])),b==="84"&&(g=Qe.hex2dn(f,0),x.push(["DN",g])),b==="86"&&(g=tr(f),x.push(["URI",g])),b==="87"&&(g=fo(f),x.push(["IP",g]));return x},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 x=e(f,0),E=0;E<x.length;E++){var M=i(f,x[E]);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 x=f.substr(b[w],2),E=i(f,b[w]);x=="a0"&&(g.dpname=this.getDistributionPointName(E))}return g},this.getDistributionPointName=function(f){for(var g={},b=e(f,0),w=0;w<b.length;w++){var x=f.substr(b[w],2),E=i(f,b[w]);x=="a0"&&(g.full=this.getGeneralNames(E))}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 x=a(this.hex,b[w],[0,0,0],"86"),E=tr(x);g.push(E)}catch(M){}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 x=a(this.hex,b[w],[0],"06"),E=a(this.hex,b[w],[1],"86");x==="2b06010505073001"&&g.ocsp.push(tr(E)),x==="2b06010505073002"&&g.caissuer.push(tr(E))}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 x=e(f,0),E=0;E<x.length;E++){var M=o(f,x[E],[0],"06"),C=a(f,x[E],[1],"86"),S=tr(C);if(M=="2b06010505073001")w.array.push({ocsp:S});else if(M=="2b06010505073002")w.array.push({caissuer:S});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 x=e(f,0),E=0;E<x.length;E++){var M=i(f,x[E]),C=this.getPolicyInformation(M);w.array.push(C)}return w},this.getPolicyInformation=function(f){var g={},b=a(f,0,[0],"06");g.policyoid=p(b);var w=l(f,0,[1],"30");if(w!=-1){g.array=[];for(var x=e(f,w),E=0;E<x.length;E++){var M=i(f,x[E]),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=vr(w)}else if(b==="2b06010505070202"){var x=s(f,0,[1],"30");g.unotice=this.getUserNotice(x)}return g},this.getUserNotice=function(f){for(var g={},b=e(f,0),w=0;w<b.length;w++){var x=i(f,b[w]);x.substr(0,2)!="30"&&(g.exptext=this.getDisplayText(x))}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=vr(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 x=e(f,0);if(x.length>1){var E=i(f,x[1]),M=this.getGeneralName(E);M.uri!=null&&(w.uri=M.uri)}if(x.length>2){var C=i(f,x[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 x=f[w],E=0;E<x.length;E++)b.push(x[E]);for(var w=0;w<b.length;w++){var M=b[w],C=M.ds,S=M.value,P=M.type;if(C!="prn"&&C!="utf8"&&C!="ia5")return"mixed";if(C=="ia5"){if(P!="CN")return"mixed";if($.lang.String.isMail(S))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==null?"prn":g},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"),x=a(f,b[1],[]),E=$.asn1.ASN1Util.oidHexToInt(w);return g.type=$.asn1.x509.OID.oid2atype(E),g.ds=this.HEX2STAG[f.substr(b[1],2)],g.ds!="bmp"?g.value=tr(x):g.value=Ml(x),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(g){}},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=wl(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),x=0;x<w.length;x++){var E=i(f,w[x]),M=this.getExtParam(E);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")),x=!1;b==3&&s(f,0,[1])=="0101ff"&&(x=!0);var E=s(f,0,[b-1,0]),M=void 0;if(w=="2.5.29.14"?M=this.getExtSubjectKeyIdentifier(E,x):w=="2.5.29.15"?M=this.getExtKeyUsage(E,x):w=="2.5.29.17"?M=this.getExtSubjectAltName(E,x):w=="2.5.29.18"?M=this.getExtIssuerAltName(E,x):w=="2.5.29.19"?M=this.getExtBasicConstraints(E,x):w=="2.5.29.31"?M=this.getExtCRLDistributionPoints(E,x):w=="2.5.29.32"?M=this.getExtCertificatePolicies(E,x):w=="2.5.29.35"?M=this.getExtAuthorityKeyIdentifier(E,x):w=="2.5.29.37"?M=this.getExtExtKeyUsage(E,x):w=="1.3.6.1.5.5.7.1.1"?M=this.getExtAuthorityInfoAccess(E,x):w=="2.5.29.20"?M=this.getExtCRLNumber(E,x):w=="2.5.29.21"?M=this.getExtCRLReason(E,x):w=="1.3.6.1.5.5.7.48.1.2"?M=this.getExtOcspNonce(E,x):w=="1.3.6.1.5.5.7.48.1.5"?M=this.getExtOcspNoCheck(E,x):w=="1.2.840.113583.1.1.9.1"&&(M=this.getExtAdobeTimeStamp(E,x)),M!=null)return M;var C={extname:w,extn:E};return x&&(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(x){return b(x).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(H){var z=JSON.stringify(H.array).replace(/[\[\]\{\}\"]/g,"");return z},g=function(H){for(var z="",U=H.array,q=0;q<U.length;q++){var j=U[q];if(z+=" policy oid: "+j.policyoid+`
363
- `,j.array!==void 0)for(var _=0;_<j.array.length;_++){var Z=j.array[_];Z.cps!==void 0&&(z+=" cps: "+Z.cps+`
364
- `)}}return z},b=function(H){for(var z="",U=H.array,q=0;q<U.length;q++){var j=U[q];try{j.dpname.full[0].uri!==void 0&&(z+=" "+j.dpname.full[0].uri+`
365
- `)}catch(_){}try{j.dname.full[0].dn.hex!==void 0&&(z+=" "+Qe.hex2dn(j.dpname.full[0].dn.hex)+`
366
- `)}catch(_){}}return z},w=function(H){for(var z="",U=H.array,q=0;q<U.length;q++){var j=U[q];j.caissuer!==void 0&&(z+=" caissuer: "+j.caissuer+`
367
- `),j.ocsp!==void 0&&(z+=" ocsp: "+j.ocsp+`
368
- `)}return z},x,E,M;if(x=`Basic Fields
369
- `,x+=" serial number: "+this.getSerialNumberHex()+`
370
- `,x+=" signature algorithm: "+this.getSignatureAlgorithmField()+`
371
- `,x+=" issuer: "+this.getIssuerString()+`
372
- `,x+=" notBefore: "+this.getNotBefore()+`
373
- `,x+=" notAfter: "+this.getNotAfter()+`
374
- `,x+=" subject: "+this.getSubjectString()+`
375
- `,x+=` subject public key info:
376
- `,E=this.getPublicKey(),x+=" key algorithm: "+E.type+`
377
- `,E.type==="RSA"&&(x+=" n="+ho(E.n.toString(16)).substr(0,16)+`...
378
- `,x+=" e="+ho(E.e.toString(16))+`
379
- `),M=this.aExtInfo,M!=null){x+=`X509v3 Extensions:
380
- `;for(var C=0;C<M.length;C++){var S=M[C],P=$.asn1.x509.OID.oid2name(S.oid);P===""&&(P=S.oid);var I="";if(S.critical===!0&&(I="CRITICAL"),x+=" "+P+" "+I+`:
381
- `,P==="basicConstraints"){var B=this.getExtBasicConstraints();B.cA===void 0?x+=` {}
382
- `:(x+=" cA=true",B.pathLen!==void 0&&(x+=", pathLen="+B.pathLen),x+=`
383
- `)}else if(P==="keyUsage")x+=" "+this.getExtKeyUsageString()+`
384
- `;else if(P==="subjectKeyIdentifier")x+=" "+this.getExtSubjectKeyIdentifier().kid.hex+`
385
- `;else if(P==="authorityKeyIdentifier"){var L=this.getExtAuthorityKeyIdentifier();L.kid!==void 0&&(x+=" kid="+L.kid.hex+`
386
- `)}else if(P==="extKeyUsage"){var k=this.getExtExtKeyUsage().array;x+=" "+k.join(", ")+`
387
- `}else if(P==="subjectAltName"){var O=f(this.getExtSubjectAltName());x+=" "+O+`
388
- `}else if(P==="cRLDistributionPoints"){var N=this.getExtCRLDistributionPoints();x+=b(N)}else if(P==="authorityInfoAccess"){var D=this.getExtAuthorityInfoAccess();x+=w(D)}else P==="certificatePolicies"&&(x+=g(this.getExtCertificatePolicies()))}}return x+="signature algorithm: "+this.getSignatureAlgorithmName()+`
389
- `,x+="signature: "+this.getSignatureValueHex().substr(0,16)+`...
390
- `,x},typeof n=="string"&&(n.indexOf("-----BEGIN")!=-1?this.readCertPEM(n):$.lang.String.isHex(n)&&this.readCertHex(n))}Qe.hex2dn=function(n,t){t===void 0&&(t=0);var e=new Qe;re.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=re.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=re,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=$.asn1.ASN1Util.oidHexToInt(a),s=$.asn1.x509.OID.oid2atype(o),u=r(n,i[1]),c=vr(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=re,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 vo(n){return ge.SHA256(n).toString()}var qs=[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{[vTt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PF}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 Il(n,t){for(var e=0,r=t;e<r.length;e++){var i=r[e];if(i.getSubjectHex()===n)return i}}function Ks(n,t){var e=n.getIssuerHex();if(e===n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=Il(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:Ks(r,t)}function js(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:Ks(n,qs)}function Tl(n){var t=new Qe;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=js(t);return qs.push(t),e}function Pl(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 Me;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,Ra(t))}Tl(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>bRPN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>|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 oa=function(n,t){return oa=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])},oa(n,t)};function oe(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");oa(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var F=function(){return F=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},F.apply(this,arguments)};function Ct(n,t,e,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(n,t,e,r);else for(var s=n.length-1;s>=0;s--)(o=n[s])&&(a=(i<3?o(a):i>3?o(t,e,a):o(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a}function St(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function wi(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 xi(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 rt(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 Bl(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var Pn=Bl("$$FIVE_EVENT$$");function bn(n){return n[Pn]||(n[Pn]={}),n[Pn]}function Rl(n){n[Pn]&&delete n[Pn]}var Ei=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){Rl(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],v=h===void 0?!1:h,p=l.apply(void 0,e);v&&this.off(t,l),p===!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 Fl=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),ve=typeof performance!="undefined"?function(){return Fl+performance.now()}:function(){return Date.now()};function on(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])&&on(n[r])}),n}var Ao=/^([^.]+)(\.([^.]+))*$/;function kl(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 Wr(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function Rr(n,t){return Ao.test(n)&&Ao.test(t)&&kl(n,t)}var Ll=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],rr=on(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"))),Fa=function(n){oe(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),ui=function(n){oe(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){oe(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var sa=function(n){oe(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),ka=function(n){oe(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 Ol(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 ua(n){for(var t=0,e=Ll;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function mo(n){return ua(n)!==null}function go(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function La(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 Ws=function(n){oe(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(Ei);function un(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=ua(n),l=c?"Script":"XMLHttpRequest",h=new Fa(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?rr.concat(t.allowHosts):rr.slice(),v=La(s),p=ua(s);if(location.hostname.length!==0&&!Wr(location.hostname)&&rr.filter(function(L){return Rr(L,location.hostname)}).length===0&&!Wr(v)&&h.filter(function(L){return Rr(L,v)}).length===0){var m=p?"Script":"XMLHttpRequest",A=new ka(s,m,"request host(".concat(v,") is not allowed"));r(A),c(A),(l=t.networkSubscribe)===null||l===void 0||l.emit("network",s,m,"forbidden",A.message);return}if(p){var y=window,f=null,g=!1,b=document.createElement("script"),w=function(){var L;if(f=null,g!==!0){g=!0;var k=new sa(s,"Script",t.timeout||NaN);r(k),c(k),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"Script","timeout",k.message)}},x=function(L){var k,O,N=ve(),D=N-a;if(delete y[p],b.parentNode&&b.parentNode.removeChild(b),f!==null&&(window.clearTimeout(f),f=null),g!==!0){if(L.indexOf("data:")!==0){var H=new ui(s,"Script",500);r(H),c(H),(k=t.networkSubscribe)===null||k===void 0||k.emit("network",s,"Script","error",H.message);return}var z=L.split(","),U=(z[0].match(/:(.*?);/)||[])[1],q=z[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var j=atob(z[1]),_=j.length,Z=new Uint8Array(_),W=0;W<_;W++)Z[W]=j.charCodeAt(W);t.responseType==="arraybuffer"?q=Z.buffer:q=new Blob([Z],{type:U})}var Y={},ce={body:q,meta:{origin:o,source:s,requestTime:a,responseTime:N,costs:D,headers:Y}};e(ce),u(ce),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"Script","ok",JSON.stringify(ce.meta)),g=!0}};y[p]=x,b.src=s,document.body.appendChild(b),typeof t.timeout=="number"&&(f=window.setTimeout(w,t.timeout))}else{var E=!1,M=new XMLHttpRequest,C=function(){M&&(M.removeEventListener("timeout",S,!1),M.removeEventListener("progress",P,!1),M.removeEventListener("load",I,!1),M.removeEventListener("error",B,!1)),M=null,C=Q},S=function(){var L;if(E!==!0){E=!0,C();var k=new sa(s,"XMLHttpRequest",t.timeout||NaN);r(k),c(k),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"XMLHttpRequest","timeout",k.message)}},P=function(L){E!==!0&&L.lengthComputable&&(L.total<=0||i(L.loaded/L.total))},I=function(L){var k;if(E!==!0){var O=this.status;if(O===0||O>=200&&O<400){E=!0,C();var N=ve(),D=N-a,H=Ol(this.getAllResponseHeaders()),z=L.total,U={body:this.response,meta:{origin:o,source:s,requestTime:a,responseTime:N,costs:D,headers:H,size:z}};e(U),u(U),(k=t.networkSubscribe)===null||k===void 0||k.emit("network",s,"XMLHttpRequest","ok",JSON.stringify(U.meta))}else B.call(this)}},B=function(){var L;if(E!==!0){E=!0,C();var k=new ui(s,"XMLHttpRequest",this.status);r(k),c(k),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"XMLHttpRequest","error",k.message)}};M.addEventListener("timeout",S,!1),M.addEventListener("progress",P,!1),M.addEventListener("load",I,!1),M.addEventListener("error",B,!1),t.responseType&&(M.responseType=t.responseType),typeof t.timeout=="number"&&(M.timeout=t.timeout),M.open("GET",s,!0),M.send(null)}})})}var Oi={};function Vl(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 Fa(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 Oi?Oi[i]:Oi[i]=new Promise(function(a,o){var s,u=t.allowHosts?rr.concat(t.allowHosts):rr.slice(),c=La(i);if(location.hostname.length!==0&&!Wr(location.hostname)&&rr.filter(function(m){return Rr(m,location.hostname)}).length===0&&!Wr(c)&&u.filter(function(m){return Rr(m,c)}).length===0){var l=new ka(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 v=document.head||document.getElementsByTagName("head")[0];v&&v.appendChild(h);var p=!1;h.onload=function(){var m;if(p!==!0){p=!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(p!==!0){p=!0;var y=new ui(i,"Link",0);o(y),(A=t.networkSubscribe)===null||A===void 0||A.emit("network",i,"Link","error",y.message)}}})})}function Nl(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 Fa(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,v=t.allowHosts?rr.concat(t.allowHosts):rr.slice(),p=La(u);if(location.hostname.length!==0&&!Wr(location.hostname)&&rr.filter(function(w){return Rr(w,location.hostname)}).length===0&&!Wr(p)&&v.filter(function(w){return Rr(w,p)}).length===0){var m=new ka(u,"Image","request host(".concat(p,") 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!=null?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 x=ve(),E={headers:{},origin:s,source:u,requestTime:o,responseTime:x,costs:x-o};y=!0;var M={body:A,meta:E};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 x=new ui(u,"Image",0);r(x),l(x),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",u,"Image","ok",x.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 x=new sa(u,"Image",t.timeout);r(x),l(x),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",u,"Image","timeout",x.message)}},t.timeout)),A.onload=g,A.onerror=b,i(0),A.src=u})})}var Oa=function(){function n(t){t===void 0&&(t={}),this.options=Object.freeze(t),this.options.allowHosts&&Object.freeze(this.options.allowHosts)}return n.prototype.ajax=function(t,e,r,i,a){var o;e===void 0&&(e={}),r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var s=this.options,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 un(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 Nl(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 Vl(t,a)},n}(),li=new Oa,Ql=function(){if(typeof window!="undefined"){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)}}(),Dl=function(n){var t;if(typeof window!="undefined"){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)},Ul=5,yo=16,ft=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 yo},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=[];yo=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,rt([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):Ql(t)},n.prototype.cancelAnimationFrame=function(t){this.context?this.context.cancelAnimationFrame(t):Dl(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=Ul);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}(),zl={"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"]}},Xs=/^https?\:\/\/?([^\/]+)/;function Gl(n){var t=n.match(Xs);return t===null?null:t[1]}function Yr(n,t){return n.replace(Xs,function(e,r){return e.slice(0,e.length-r.length)+t})}function Hl(n,t,e){var r=t.split("."),i=r[0],a=r.slice(1);if(i==="texture")return Yr(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 Yr(n,e.pano[0]);case"down":case"right":case"back":return Yr(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 Yr(n,e.tile[l%2])}else if(i==="model"){var h=a[0],l=Number(h);if(!isNaN(l))return Yr(n,e.model[l%2])}return Yr(n,e.default[0])}var ql=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],v=l[1],p=l[2],m=l[3];o.push("crop,x_".concat(h,",y_").concat(v,",w_").concat(p,",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 Wt(n,t){var e=F(F({},zl),t.mappings),r=Gl(n);if(r===null)return n;var i=e[r];return i?(n=Hl(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?ql(n,t):i.type==="aliyun"?Kl(n,t):n):n}function ci(n,t,e){t===void 0&&(t=Wt);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var jl="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",Wl="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",Xl="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 Ni=null;function _s(){return Ni||(Ni=Promise.all([Vi(jl),Vi(Wl),Vi(Xl)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var Zs=/^(.*)\[(\d+)\]$/;function Re(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function We(n){var t=n.match(Zs);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 Tt(n,t){return Re(n)===Re(t)}function Ys(n){return typeof n=="string"&&Zs.test(n)}var _l=function(n){oe(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(d.Group),Gt=function(n){oe(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 Qn=function(){return typeof document!="undefined"?new d.TextureLoader().load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAABCAYAAACouxZ2AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAAQAAAAB7UD0+AAACA0lEQVRIDXWUW3YjIQxEwdnV/GT/q8kO3FO3pAJst3PSAaR6Cbszf//9XeMxxpjXmI+pVXudp2s6PC4dqHff9e6D7/PZLy46xQvG+sZvrfK8xgXUeq85yINe9bdmtOK1+kun5vjgq58a+eZPna9jvmjiserqG/+Whathvo3L3WhV89L9sXI/m18z2uene9ap/ftsuT9WZxoHXzW56/fpj8l7+tTw7P011NdpqnY19sRsfuHMA9u8oZWfDz4+fra/dfG1V60ydZ7qba1g7UNAeK0JP7ydD7/OqH6wO2f7HTq+B/lbL9qsB3/N1/UzR81XfPzw4tp5OPvRneacteq8Xo0xR3vuv/kPz0KtX0Nhg0eHuaNXdWI3X/ld427h++vzyp99V6VPrzWFhbv4ayay4oFecm198MmUXN/mL+x7npq/uJXBGb/MTw4+t+SvbLoTZnUW5uHhz7nWcTxT73OwXV7cxT9wbBf/0LnDBgcnHmtPLYba32Hp808sMy1u88yhr58n70/v4xX92GSN19l/2UsqGmiH94Hpxjcs+DO/ccpIVNVp62PUWXu//ur1GQy1Cf+GZ13rtNYN1po3/NI79fGXibHkq4z25xvV2pW3szpneXsW8SsreTe/NIPrtXMnH7wPf+LEN6tqhUVHj3XKD/72p9eafCeYB3zuonnbv7yqP8d/o4K6gRb1wbYAAAAASUVORK5CYII="):new d.Texture}();Qn.minFilter=d.NearestFilter;Qn.magFilter=d.NearestFilter;Qn.wrapS=d.RepeatWrapping;Qn.wrapT=d.RepeatWrapping;var ye={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:Qn};function Yl(n,t){var e=n!=null?n:[],r=t!=null?t:[];if(r.length!==e.length)return!1;for(var i=0;i<r.length;i++)if(!e[i].clippingBoxMatrix.equals(r[i].clippingBoxMatrix)||e[i].floorIndex!==r[i].floorIndex)return!1;return!0}function Jl(n,t){return n&&t?n.luminanceMap===t.luminanceMap&&n.map===t.map&&n.matrix.equals(t.matrix):!n&&!t}function Js(n,t){var e=!1;for(var r in t)switch(r){case"clippers":Yl(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":Jl(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 Fr=function(n){oe(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=$l,i}return t}(d.Points);function $l(n,t,e){this.model&&this.material.syncModel(this.model),this.material.update(n,e)}var Jr=new Set,$s=function(n){oe(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=F({},ye),e}return t.prototype.getMaterial=function(){return F({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),Jr.clear(),this.traverse(function(i){if(i instanceof Gt)for(var a=0,o=i.material;a<o.length;a++){var s=o[a];Jr.has(s)||(Object.assign(s,r.materialParameters),Jr.add(s))}i instanceof Fr&&(Jr.has(i.material)||(Object.assign(i.material,r.materialParameters),Jr.add(i.material)))}),Jr.clear(),this.needsRender=!0},t}(d.Group),ec=["right","left","up","down","front","back"];function eu(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 tu=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:eu(n.face,s.x,s.y,r),children:[]};n.children.push(u),tu(u,t)}};function tc(n,t){var e={level:0,face:n,position:new d.Vector2(0,0),size:1,box:eu(n,0,0,1),children:[]};return tu(e,t),e}function la(n){var t=ec.map(function(e){return tc(e,n)});return{children:t}}function Va(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],a=t(i);a!==!1&&Va(i,t)}}var Dn=new d.BoxBufferGeometry(1,1,1,1,1);Dn.deleteAttribute("uv");Dn.deleteAttribute("normal");Dn.groups=[];Dn.scale(-1,1,1);var rc=`
360
+ `,S+=M,S+=`\r
361
+ -----END `+y+` PRIVATE KEY-----\r
362
+ `,S},parseHexOfEncryptedPKCS8:function(y){var v=ae,m=v.getChildIdx,h=v.getV,g={},b=m(y,0);if(b.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+b.length;g.ciphertext=h(y,b[1]);var w=m(y,b[0]);if(w.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+w.length;if(h(y,w[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var E=m(y,w[1]);if(w.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+E.length;var C=m(y,E[1]);if(C.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+C.length;if(h(y,C[0])!="2a864886f70d0307")throw"this only supports TripleDES";g.encryptionSchemeAlg="TripleDES",g.encryptionSchemeIV=h(y,C[1]);var x=m(y,E[0]);if(x.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+x.length;if(h(y,x[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var M=m(y,x[1]);if(M.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+M.length;g.pbkdf2Salt=h(y,M[0]);var S=h(y,M[1]);try{g.pbkdf2Iter=parseInt(S,16)}catch(P){throw"malformed format pbkdf2Iter: "+S}return g},getPBKDF2KeyHexFromParam:function(y,v){var m=ye.enc.Hex.parse(y.pbkdf2Salt),h=y.pbkdf2Iter,g=ye.PBKDF2(v,m,{keySize:192/32,iterations:h}),b=ye.enc.Hex.stringify(g);return b},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(y,v){var m=Gr(y,"ENCRYPTED PRIVATE KEY"),h=this.parseHexOfEncryptedPKCS8(m),g=Ur.getPBKDF2KeyHexFromParam(h,v),b={};b.ciphertext=ye.enc.Hex.parse(h.ciphertext);var w=ye.enc.Hex.parse(g),E=ye.enc.Hex.parse(h.encryptionSchemeIV),C=ye.TripleDES.decrypt(b,w,{iv:E}),x=ye.enc.Hex.stringify(C);return x},getKeyFromEncryptedPKCS8PEM:function(y,v){var m=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(y,v),h=this.getKeyFromPlainPrivatePKCS8Hex(m);return h},parsePlainPrivatePKCS8Hex:function(y){var v=ae,m=v.getChildIdx,h=v.getV,g={};if(g.algparam=null,y.substr(0,2)!="30")throw new Error("malformed plain PKCS8 private key(code:001)");var b=m(y,0);if(b.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if(y.substr(b[1],2)!="30")throw new Error("malformed PKCS8 private key(code:003)");var w=m(y,b[1]);if(w.length!=2)throw new Error("malformed PKCS8 private key(code:004)");if(y.substr(w[0],2)!="06")throw new Error("malformed PKCS8 private key(code:005)");if(g.algoid=h(y,w[0]),y.substr(w[1],2)=="06"&&(g.algparam=h(y,w[1])),y.substr(b[2],2)!="04")throw new Error("malformed PKCS8 private key(code:006)");return g.keyidx=v.getVidx(y,b[2]),g},getKeyFromPlainPrivatePKCS8PEM:function(y){var v=Gr(y,"PRIVATE KEY"),m=this.getKeyFromPlainPrivatePKCS8Hex(v);return m},getKeyFromPlainPrivatePKCS8Hex:function(y){var v=this.parsePlainPrivatePKCS8Hex(y),m;if(v.algoid=="2a864886f70d010101")m=new Ie;else if(ee.crypto.DSA&&v.algoid=="2a8648ce380401")m=new ee.crypto.DSA;else if(ee.crypto.ECDSA&&v.algoid=="2a8648ce3d0201")m=new ee.crypto.ECDSA;else throw"unsupported private key algorithm";return m.readPKCS8PrvKeyHex(y),m},_getKeyFromPublicPKCS8Hex:function(y){var v,m=ae.getVbyList(y,0,[0,0],"06");if(m==="2a864886f70d010101")v=new Ie;else if(ee.crypto.DSA&&m==="2a8648ce380401")v=new ee.crypto.DSA;else if(ee.crypto.ECDSA&&m==="2a8648ce3d0201")v=new ee.crypto.ECDSA;else throw"unsupported PKCS#8 public key hex";return v.readPKCS8PubKeyHex(y),v},parsePublicRawRSAKeyHex:function(y){var v=ae,m=v.getChildIdx,h=v.getV,g={};if(y.substr(0,2)!="30")throw"malformed RSA key(code:001)";var b=m(y,0);if(b.length!=2)throw"malformed RSA key(code:002)";if(y.substr(b[0],2)!="02")throw"malformed RSA key(code:003)";if(g.n=h(y,b[0]),y.substr(b[1],2)!="02")throw"malformed RSA key(code:004)";return g.e=h(y,b[1]),g},parsePublicPKCS8Hex:function(y){var v=ae,m=v.getChildIdx,h=v.getV,g={};g.algparam=null;var b=m(y,0);if(b.length!=2)throw"outer DERSequence shall have 2 elements: "+b.length;var w=b[0];if(y.substr(w,2)!="30")throw"malformed PKCS8 public key(code:001)";var E=m(y,w);if(E.length!=2)throw"malformed PKCS8 public key(code:002)";if(y.substr(E[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(g.algoid=h(y,E[0]),y.substr(E[1],2)=="06"?g.algparam=h(y,E[1]):y.substr(E[1],2)=="30"&&(g.algparam={},g.algparam.p=v.getVbyList(y,E[1],[0],"02"),g.algparam.q=v.getVbyList(y,E[1],[1],"02"),g.algparam.g=v.getVbyList(y,E[1],[2],"02")),y.substr(b[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return g.key=h(y,b[1]).substr(2),g}}}();Ur.getKey=function(n,t,e){var r=ae,i=r.getChildIdx;r.getV;var a=r.getVbyList,o=ee.crypto,s=o.ECDSA,u=o.DSA,l=Ie,c=Gr,f=Ur;if(typeof l!="undefined"&&n instanceof l||typeof s!="undefined"&&n instanceof s||typeof u!="undefined"&&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 A=new l;return A.setPublic(n.n,n.e),A}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 A=new l;return A.setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),A}if(n.kty===void 0&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0&&n.p===void 0){var A=new l;return A.setPrivate(n.n,n.e,n.d),A}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x===void 0){var A=new u;return A.setPublic(n.p,n.q,n.g,n.y),A}if(n.p!==void 0&&n.q!==void 0&&n.g!==void 0&&n.y!==void 0&&n.x!==void 0){var A=new u;return A.setPrivate(n.p,n.q,n.g,n.y,n.x),A}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d===void 0){var A=new l;return A.setPublic($e(n.n),$e(n.e)),A}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 A=new l;return A.setPrivateEx($e(n.n),$e(n.e),$e(n.d),$e(n.p),$e(n.q),$e(n.dp),$e(n.dq),$e(n.qi)),A}if(n.kty==="RSA"&&n.n!==void 0&&n.e!==void 0&&n.d!==void 0){var A=new l;return A.setPrivate($e(n.n),$e(n.e),$e(n.d)),A}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d===void 0){var p=new s({curve:n.crv}),y=p.ecparams.keylen/4,v=("0000000000"+$e(n.x)).slice(-y),m=("0000000000"+$e(n.y)).slice(-y),h="04"+v+m;return p.setPublicKeyHex(h),p}if(n.kty==="EC"&&n.crv!==void 0&&n.x!==void 0&&n.y!==void 0&&n.d!==void 0){var p=new s({curve:n.crv}),y=p.ecparams.keylen/4,v=("0000000000"+$e(n.x)).slice(-y),m=("0000000000"+$e(n.y)).slice(-y),h="04"+v+m,g=("0000000000"+$e(n.d)).slice(-y);return p.setPublicKeyHex(h),p.setPrivateKeyHex(g),p}if(e==="pkcs5prv"){var b=n,r=ae,w,A;if(w=i(b,0),w.length===9)A=new l,A.readPKCS5PrvKeyHex(b);else if(w.length===6)A=new u,A.readPKCS5PrvKeyHex(b);else if(w.length>2&&b.substr(w[1],2)==="04")A=new s,A.readPKCS5PrvKeyHex(b);else throw"unsupported PKCS#1/5 hexadecimal key";return A}if(e==="pkcs8prv"){var A=f.getKeyFromPlainPrivatePKCS8Hex(n);return A}if(e==="pkcs8pub")return f._getKeyFromPublicPKCS8Hex(n);if(e==="x509pub")return ze.getPublicKeyFromCertHex(n);if(n.indexOf("-END CERTIFICATE-",0)!=-1||n.indexOf("-END X509 CERTIFICATE-",0)!=-1||n.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return ze.getPublicKeyFromCertPEM(n);if(n.indexOf("-END PUBLIC KEY-")!=-1){var E=Gr(n,"PUBLIC KEY");return f._getKeyFromPublicPKCS8Hex(E)}if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var C=c(n,"RSA PRIVATE KEY");return f.getKey(C,null,"pkcs5prv")}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var x=c(n,"DSA PRIVATE KEY"),M=a(x,0,[1],"02"),S=a(x,0,[2],"02"),P=a(x,0,[3],"02"),T=a(x,0,[4],"02"),B=a(x,0,[5],"02"),A=new u;return A.setPrivate(new ue(M,16),new ue(S,16),new ue(P,16),new ue(T,16),new ue(B,16)),A}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")==-1){var C=c(n,"EC PRIVATE KEY");return f.getKey(C,null,"pkcs5prv")}if(n.indexOf("-END PRIVATE KEY-")!=-1)return f.getKeyFromPlainPrivatePKCS8PEM(n);if(n.indexOf("-END RSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var F=f.getDecryptedKeyHex(n,t),L=new Ie;return L.readPKCS5PrvKeyHex(F),L}if(n.indexOf("-END EC PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var x=f.getDecryptedKeyHex(n,t),A=a(x,0,[1],"04"),O=a(x,0,[2,0],"06"),Q=a(x,0,[3,0],"03").substr(2),N="";if(ee.crypto.OID.oidhex2name[O]!==void 0)N=ee.crypto.OID.oidhex2name[O];else throw"undefined OID(hex) in KJUR.crypto.OID: "+O;var p=new s({curve:N});return p.setPublicKeyHex(Q),p.setPrivateKeyHex(A),p.isPublic=!1,p}if(n.indexOf("-END DSA PRIVATE KEY-")!=-1&&n.indexOf("4,ENCRYPTED")!=-1){var x=f.getDecryptedKeyHex(n,t),M=a(x,0,[1],"02"),S=a(x,0,[2],"02"),P=a(x,0,[3],"02"),T=a(x,0,[4],"02"),B=a(x,0,[5],"02"),A=new u;return A.setPrivate(new ue(M,16),new ue(S,16),new ue(P,16),new ue(T,16),new ue(B,16)),A}if(n.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return f.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument")};(typeof ee.asn1=="undefined"||!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 l=new ue(a,2);i=i+"."+l.toString(10),a=""}}return i};var ae=new function(){};ae.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};ae.getL=function(n,t){var e=ae.getLblen(n,t);return e<1?"":n.substr(t+2,e*2)};ae.getVblen=function(n,t){var e,r;return e=ae.getL(n,t),e==""?-1:(e.substr(0,1)==="8"?r=new ue(e.substr(2),16):r=new ue(e,16),r.intValue())};ae.getVidx=function(n,t){var e=ae.getLblen(n,t);return e<0?e:t+(e+1)*2};ae.getV=function(n,t){var e=ae.getVidx(n,t),r=ae.getVblen(n,t);return n.substr(e,r*2)};ae.getTLV=function(n,t){return n.substr(t,2)+ae.getL(n,t)+ae.getV(n,t)};ae.getTLVblen=function(n,t){return 2+ae.getLblen(n,t)*2+ae.getVblen(n,t)*2};ae.getNextSiblingIdx=function(n,t){var e=ae.getVidx(n,t),r=ae.getVblen(n,t);return e+r*2};ae.getChildIdx=function(n,t){var e=ae,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};ae.getNthChildIdx=function(n,t,e){var r=ae.getChildIdx(n,t);return r[e]};ae.getIdxbyList=function(n,t,e,r){var i=ae,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))};ae.getIdxbyListEx=function(n,t,e,r){var i=ae,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 l=n.substr(o[u],2);if(typeof a=="number"&&!i.isContextTag(l)&&s==a||typeof a=="string"&&i.isContextTag(l,a))return i.getIdxbyListEx(n,o[u],e,r);i.isContextTag(l)||s++}return-1};ae.getTLVbyList=function(n,t,e,r){var i=ae,a=i.getIdxbyList(n,t,e,r);return a==-1||a>=n.length?null:i.getTLV(n,a)};ae.getTLVbyListEx=function(n,t,e,r){var i=ae,a=i.getIdxbyListEx(n,t,e,r);return a==-1?null:i.getTLV(n,a)};ae.getVbyList=function(n,t,e,r,i){var a=ae,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)};ae.getVbyListEx=function(n,t,e,r,i){var a=ae,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)};ae.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=ae.getV(n,t);return r=="02"?parseInt(i,16):M0(i)}catch(a){return e}};ae.getOID=function(n,t,e){e==null&&(e=null);try{if(n.substr(t,2)!="06")return e;var r=ae.getV(n,t);return C0(r)}catch(i){return e}};ae.getOIDName=function(n,t,e){e==null&&(e=null);try{var r=ae.getOID(n,t,e);if(r==e)return e;var i=ee.asn1.x509.OID.oid2name(r);return i==""?r:i}catch(a){return e}};ae.getString=function(n,t,e){e==null&&(e=null);try{var r=ae.getV(n,t);return pr(r)}catch(i){return e}};ae.hextooidstr=function(n){var t=function(f,A){return f.length>=A?f:new Array(A-f.length+1).join("0")+f},e=[],r=n.substr(0,2),i=parseInt(r,16);e[0]=new String(Math.floor(i/40)),e[1]=new String(i%40);for(var a=n.substr(2),o=[],s=0;s<a.length/2;s++)o.push(parseInt(a.substr(s*2,2),16));for(var u=[],l="",s=0;s<o.length;s++)o[s]&128?l=l+t((o[s]&127).toString(2),7):(l=l+t((o[s]&127).toString(2),7),u.push(new String(parseInt(l,2))),l="");var c=e.join(".");return u.length>0&&(c=c+"."+u.join(".")),c};ae.isContextTag=function(n,t){n=n.toLowerCase();var e,r;try{e=parseInt(n,16)}catch(a){return-1}if(t===void 0)return(e&192)==128;try{var i=t.match(/^\[[0-9]+\]$/);return i==null||(r=parseInt(t.substr(1,t.length-1),10),r>31)?!1:(e&192)==128&&(e&31)==r}catch(a){return!1}};ae.isASN1HEX=function(n){var t=ae;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};ae.checkStrictDER=function(n,t,e,r,i){var a=ae;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),l=u.length-2-a.getL(n,t).length;if(l!==s*2)throw new Error("V string length and L's value not the same:"+l+"/"+s*2);if(t===0&&n.length!=u.length)throw new Error("total length and TLV length unmatch:"+n.length+"!="+u.length);var c=n.substr(t,2);if(c==="02"){var f=a.getVidx(n,t);if(n.substr(f,2)=="00"&&n.charCodeAt(f+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(c,16)&32){for(var A=a.getVblen(n,t),p=0,y=a.getChildIdx(n,t),v=0;v<y.length;v++){var m=a.getTLV(n,y[v]);p+=m.length,a.checkStrictDER(n,y[v],e,r,i)}if(A*2!=p)throw new Error("sum of children's TLV length and L unmatch: "+A*2+"!="+p)}};ae.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=="undefined"||!ee.asn1)&&(ee.asn1={});(typeof ee.asn1.x509=="undefined"||!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]!="undefined")return this.objCache[t];if(typeof this.name2oidList[t]=="undefined")throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],r=new 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]};Ie.getPosArrayOfChildrenFromHex=function(n){return ae.getChildIdx(n,0)};Ie.getHexValueArrayOfChildrenFromHex=function(n){var t=ae,e=t.getV,A=Ie.getPosArrayOfChildrenFromHex(n),r=e(n,A[0]),i=e(n,A[1]),a=e(n,A[2]),o=e(n,A[3]),s=e(n,A[4]),u=e(n,A[5]),l=e(n,A[6]),c=e(n,A[7]),f=e(n,A[8]),A=new Array;return A.push(r,i,a,o,s,u,l,c,f),A};Ie.prototype.readPrivateKeyFromPEMString=function(n){var t=Gr(n),e=Ie.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Ie.prototype.readPKCS5PrvKeyHex=function(n){var t=Ie.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};Ie.prototype.readPKCS8PrvKeyHex=function(n){var t,e,r,i,a,o,s,u,l=ae,c=l.getVbyListEx;if(l.isASN1HEX(n)===!1)throw new Error("not ASN.1 hex string");try{t=c(n,0,[2,0,1],"02"),e=c(n,0,[2,0,2],"02"),r=c(n,0,[2,0,3],"02"),i=c(n,0,[2,0,4],"02"),a=c(n,0,[2,0,5],"02"),o=c(n,0,[2,0,6],"02"),s=c(n,0,[2,0,7],"02"),u=c(n,0,[2,0,8],"02")}catch(f){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,e,r,i,a,o,s,u)};Ie.prototype.readPKCS5PubKeyHex=function(n){var t=ae,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)};Ie.prototype.readPKCS8PubKeyHex=function(n){var t=ae;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)};Ie.prototype.readCertPubKeyHex=function(n,t){var e,r;e=new ze,e.readCertHex(n),r=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};function zs(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[]}Ie.prototype.verify=function(n,t){if(t=t.toLowerCase(),t.match(/^[0-9a-f]+$/)==null)return!1;var e=yt(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=zs(o);if(s.length==0)return!1;var u=s[0],l=s[1],c=function(A){return ee.crypto.Util.hashString(A,u)},f=c(n);return l==f};Ie.prototype.verifyWithMessageHash=function(n,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e=yt(t,16);if(e.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(e),i=r.toString(16).replace(/^1f+00/,""),a=zs(i);if(a.length==0)return!1;a[0];var o=a[1];return o==n};Ie.prototype.verifyPSS=function(n,t,e,r){var i=function(o){return ee.crypto.Util.hashHex(o,e)},a=i(gi(n));return r===void 0&&(r=-1),this.verifyWithMessageHashPSS(a,t,e,r)};Ie.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=pr(n),s=o.length,u=this.n.bitLength()-1,l=Math.ceil(u/8),c;if(r===-1||r===void 0)r=s;else if(r===-2)r=l-s-2;else if(r<-2)throw new Error("invalid salt length");if(l<s+r+2)throw new Error("data too long");var f=this.doPublic(i).toByteArray();for(c=0;c<f.length;c+=1)f[c]&=255;for(;f.length<l;)f.unshift(0);if(f[l-1]!==188)throw new Error("encoded message does not end in 0xbc");f=String.fromCharCode.apply(String,f);var A=f.substr(0,l-s-1),p=f.substr(A.length,s),y=65280>>8*l-u&255;if(A.charCodeAt(0)&y)throw new Error("bits beyond keysize not zero");var v=pss_mgf1_str(p,A.length,a),m=[];for(c=0;c<A.length;c+=1)m[c]=A.charCodeAt(c)^v.charCodeAt(c);m[0]&=~y;var h=l-s-r-2;for(c=0;c<h;c+=1)if(m[c]!==0)throw new Error("leftmost octets not zero");if(m[h]!==1)throw new Error("0x01 marker not found");return p===pr(a(gi("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,m.slice(-r)))))};Ie.SALT_LEN_HLEN=-1;Ie.SALT_LEN_MAX=-2;Ie.SALT_LEN_RECOVER=-2;function ze(n){var t=ae,e=t.getChildIdx,r=t.getV,i=t.getTLV,a=t.getVbyList,o=t.getVbyListEx,s=t.getTLVbyList,u=t.getTLVbyListEx,l=t.getIdxbyList,c=t.getIdxbyListEx,f=t.getVidx,A=t.getInt,p=t.oidname,y=t.hextooidstr,v=Gr,m;try{m=ee.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(h){}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 h=s(this.hex,0,[0,0]);if(h.substr(0,2)=="a0"){var g=s(h,0,[0]),b=A(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 h=u(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(h)},this.getAlgorithmIdentifierName=function(h){for(var g in m)if(h===m[g])return g;return p(o(h,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 h=this.getIssuer();return h.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 h=this.getSubject();return h.str},this.getNotBefore=function(){var h=a(this.hex,0,[0,4+this.foffset,0]);return h=h.replace(/(..)/g,"%$1"),h=decodeURIComponent(h),h},this.getNotAfter=function(){var h=a(this.hex,0,[0,4+this.foffset,1]);return h=h.replace(/(..)/g,"%$1"),h=decodeURIComponent(h),h},this.getPublicKeyHex=function(){return t.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return l(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var h=this.getPublicKeyIdx();return l(this.hex,h,[1,0],"30")},this.getPublicKey=function(){return Ur.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var h=s(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(h)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(h){var g=this.getSignatureAlgorithmField(),b=this.getSignatureValueHex(),w=s(this.hex,0,[0],"30"),E=new ee.crypto.Signature({alg:g});return E.init(h),E.updateHex(w),E.verify(b)},this.parseExt=function(h){var g,b,w;if(h===void 0){if(w=this.hex,this.version!==3)return-1;g=l(w,0,[0,7,0],"30"),b=e(w,g)}else{w=Gr(h);var E=l(w,0,[0,3,0,0],"06");if(r(w,E)!="2a864886f70d01090e"){this.aExtInfo=new Array;return}g=l(w,0,[0,3,0,1,0],"30"),b=e(w,g),this.hex=w}this.aExtInfo=new Array;for(var C=0;C<b.length;C++){var x={};x.critical=!1;var M=e(w,b[C]),S=0;M.length===3&&(x.critical=!0,S=1),x.oid=t.hextooidstr(a(w,b[C],[0],"06"));var P=l(w,b[C],[1+S]);x.vidx=f(w,P),this.aExtInfo.push(x)}},this.getExtInfo=function(h){var g=this.aExtInfo,b=h;if(h.match(/^[0-9.]+$/)||(b=ee.asn1.x509.OID.name2oid(h)),b!==""){for(var w=0;w<g.length;w++)if(g[w].oid===b)return g[w]}},this.getExtBasicConstraints=function(h,g){if(h===void 0&&g===void 0){var b=this.getExtInfo("basicConstraints");if(b===void 0)return;h=i(this.hex,b.vidx),g=b.critical}var w={extname:"basicConstraints"};if(g&&(w.critical=!0),h==="3000")return w;if(h==="30030101ff")return w.cA=!0,w;if(h.substr(0,12)==="30060101ff02"){var E=r(h,10),C=parseInt(E,16);return w.cA=!0,w.pathLen=C,w}throw new Error("hExtV parse error: "+h)},this.getExtKeyUsage=function(h,g){if(h===void 0&&g===void 0){var b=this.getExtInfo("keyUsage");if(b===void 0)return;h=i(this.hex,b.vidx),g=b.critical}var w={extname:"keyUsage"};return g&&(w.critical=!0),w.names=this.getExtKeyUsageString(h).split(","),w},this.getExtKeyUsageBin=function(h){if(h===void 0){var g=this.getExtInfo("keyUsage");if(g===void 0)return"";h=i(this.hex,g.vidx)}if(h.length!=8&&h.length!=10)throw new Error("malformed key usage value: "+h);var b="000000000000000"+parseInt(h.substr(6),16).toString(2);return h.length==8&&(b=b.slice(-8)),h.length==10&&(b=b.slice(-16)),b=b.replace(/0+$/,""),b==""&&(b="0"),b},this.getExtKeyUsageString=function(h){for(var g=this.getExtKeyUsageBin(h),b=new Array,w=0;w<g.length;w++)g.substr(w,1)=="1"&&b.push(ze.KEYUSAGE_NAME[w]);return b.join(",")},this.getExtSubjectKeyIdentifier=function(h,g){if(h===void 0&&g===void 0){var b=this.getExtInfo("subjectKeyIdentifier");if(b===void 0)return;h=i(this.hex,b.vidx),g=b.critical}var w={extname:"subjectKeyIdentifier"};g&&(w.critical=!0);var E=r(h,0);return w.kid={hex:E},w},this.getExtAuthorityKeyIdentifier=function(h,g){if(h===void 0&&g===void 0){var b=this.getExtInfo("authorityKeyIdentifier");if(b===void 0)return;h=i(this.hex,b.vidx),g=b.critical}var w={extname:"authorityKeyIdentifier"};g&&(w.critical=!0);for(var E=e(h,0),C=0;C<E.length;C++){var x=h.substr(E[C],2);if(x==="80"&&(w.kid={hex:r(h,E[C])}),x==="a1"){var M=i(h,E[C]),S=this.getGeneralNames(M);w.issuer=S[0].dn}x==="82"&&(w.sn={hex:r(h,E[C])})}return w},this.getExtExtKeyUsage=function(h,g){if(h===void 0&&g===void 0){var b=this.getExtInfo("extKeyUsage");if(b===void 0)return;h=i(this.hex,b.vidx),g=b.critical}var w={extname:"extKeyUsage",array:[]};g&&(w.critical=!0);for(var E=e(h,0),C=0;C<E.length;C++)w.array.push(p(r(h,E[C])));return w},this.getExtExtKeyUsageName=function(){var h=this.getExtInfo("extKeyUsage");if(h===void 0)return h;var g=new Array,b=i(this.hex,h.vidx);if(b==="")return g;for(var w=e(b,0),E=0;E<w.length;E++)g.push(p(r(b,w[E])));return g},this.getExtSubjectAltName=function(h,g){if(h===void 0&&g===void 0){var b=this.getExtInfo("subjectAltName");if(b===void 0)return;h=i(this.hex,b.vidx),g=b.critical}var w={extname:"subjectAltName",array:[]};return g&&(w.critical=!0),w.array=this.getGeneralNames(h),w},this.getExtIssuerAltName=function(h,g){if(h===void 0&&g===void 0){var b=this.getExtInfo("issuerAltName");if(b===void 0)return;h=i(this.hex,b.vidx),g=b.critical}var w={extname:"issuerAltName",array:[]};return g&&(w.critical=!0),w.array=this.getGeneralNames(h),w},this.getGeneralNames=function(h){for(var g=e(h,0),b=[],w=0;w<g.length;w++){var E=this.getGeneralName(i(h,g[w]));E!==void 0&&b.push(E)}return b},this.getGeneralName=function(h){var g=h.substr(0,2),b=r(h,0),w=pr(b);if(g=="81")return{rfc822:w};if(g=="82")return{dns:w};if(g=="86")return{uri:w};if(g=="87")return{ip:lo(b)};if(g=="a4")return{dn:this.getX500Name(b)}},this.getExtSubjectAltName2=function(){var h,g,b,w=this.getExtInfo("subjectAltName");if(w===void 0)return w;for(var E=new Array,C=i(this.hex,w.vidx),x=e(C,0),M=0;M<x.length;M++)b=C.substr(x[M],2),h=r(C,x[M]),b==="81"&&(g=tr(h),E.push(["MAIL",g])),b==="82"&&(g=tr(h),E.push(["DNS",g])),b==="84"&&(g=ze.hex2dn(h,0),E.push(["DN",g])),b==="86"&&(g=tr(h),E.push(["URI",g])),b==="87"&&(g=lo(h),E.push(["IP",g]));return E},this.getExtCRLDistributionPoints=function(h,g){if(h===void 0&&g===void 0){var b=this.getExtInfo("cRLDistributionPoints");if(b===void 0)return;h=i(this.hex,b.vidx),g=b.critical}var w={extname:"cRLDistributionPoints",array:[]};g&&(w.critical=!0);for(var E=e(h,0),C=0;C<E.length;C++){var x=i(h,E[C]);w.array.push(this.getDistributionPoint(x))}return w},this.getDistributionPoint=function(h){for(var g={},b=e(h,0),w=0;w<b.length;w++){var E=h.substr(b[w],2),C=i(h,b[w]);E=="a0"&&(g.dpname=this.getDistributionPointName(C))}return g},this.getDistributionPointName=function(h){for(var g={},b=e(h,0),w=0;w<b.length;w++){var E=h.substr(b[w],2),C=i(h,b[w]);E=="a0"&&(g.full=this.getGeneralNames(C))}return g},this.getExtCRLDistributionPointsURI=function(){var h=this.getExtInfo("cRLDistributionPoints");if(h===void 0)return h;for(var g=new Array,b=e(this.hex,h.vidx),w=0;w<b.length;w++)try{var E=a(this.hex,b[w],[0,0,0],"86"),C=tr(E);g.push(C)}catch(x){}return g},this.getExtAIAInfo=function(){var h=this.getExtInfo("authorityInfoAccess");if(h===void 0)return h;for(var g={ocsp:[],caissuer:[]},b=e(this.hex,h.vidx),w=0;w<b.length;w++){var E=a(this.hex,b[w],[0],"06"),C=a(this.hex,b[w],[1],"86");E==="2b06010505073001"&&g.ocsp.push(tr(C)),E==="2b06010505073002"&&g.caissuer.push(tr(C))}return g},this.getExtAuthorityInfoAccess=function(h,g){if(h===void 0&&g===void 0){var b=this.getExtInfo("authorityInfoAccess");if(b===void 0)return;h=i(this.hex,b.vidx),g=b.critical}var w={extname:"authorityInfoAccess",array:[]};g&&(w.critical=!0);for(var E=e(h,0),C=0;C<E.length;C++){var x=o(h,E[C],[0],"06"),M=a(h,E[C],[1],"86"),S=tr(M);if(x=="2b06010505073001")w.array.push({ocsp:S});else if(x=="2b06010505073002")w.array.push({caissuer:S});else throw new Error("unknown method: "+x)}return w},this.getExtCertificatePolicies=function(h,g){if(h===void 0&&g===void 0){var b=this.getExtInfo("certificatePolicies");if(b===void 0)return;h=i(this.hex,b.vidx),g=b.critical}var w={extname:"certificatePolicies",array:[]};g&&(w.critical=!0);for(var E=e(h,0),C=0;C<E.length;C++){var x=i(h,E[C]),M=this.getPolicyInformation(x);w.array.push(M)}return w},this.getPolicyInformation=function(h){var g={},b=a(h,0,[0],"06");g.policyoid=p(b);var w=c(h,0,[1],"30");if(w!=-1){g.array=[];for(var E=e(h,w),C=0;C<E.length;C++){var x=i(h,E[C]),M=this.getPolicyQualifierInfo(x);g.array.push(M)}}return g},this.getPolicyQualifierInfo=function(h){var g={},b=a(h,0,[0],"06");if(b==="2b06010505070201"){var w=o(h,0,[1],"16");g.cps=pr(w)}else if(b==="2b06010505070202"){var E=s(h,0,[1],"30");g.unotice=this.getUserNotice(E)}return g},this.getUserNotice=function(h){for(var g={},b=e(h,0),w=0;w<b.length;w++){var E=i(h,b[w]);E.substr(0,2)!="30"&&(g.exptext=this.getDisplayText(E))}return g},this.getDisplayText=function(h){var g={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"},b={};return b.type=g[h.substr(0,2)],b.str=pr(r(h,0)),b},this.getExtCRLNumber=function(h,g){var b={extname:"cRLNumber"};if(g&&(b.critical=!0),h.substr(0,2)=="02")return b.num={hex:r(h,0)},b;throw new Error("hExtV parse error: "+h)},this.getExtCRLReason=function(h,g){var b={extname:"cRLReason"};if(g&&(b.critical=!0),h.substr(0,2)=="0a")return b.code=parseInt(r(h,0),16),b;throw new Error("hExtV parse error: "+h)},this.getExtOcspNonce=function(h,g){var b={extname:"ocspNonce"};g&&(b.critical=!0);var w=r(h,0);return b.hex=w,b},this.getExtOcspNoCheck=function(h,g){var b={extname:"ocspNoCheck"};return g&&(b.critical=!0),b},this.getExtAdobeTimeStamp=function(h,g){if(h===void 0&&g===void 0){var b=this.getExtInfo("adobeTimeStamp");if(b===void 0)return;h=i(this.hex,b.vidx),g=b.critical}var w={extname:"adobeTimeStamp"};g&&(w.critical=!0);var E=e(h,0);if(E.length>1){var C=i(h,E[1]),x=this.getGeneralName(C);x.uri!=null&&(w.uri=x.uri)}if(E.length>2){var M=i(h,E[2]);M=="0101ff"&&(w.reqauth=!0),M=="010100"&&(w.reqauth=!1)}return w},this.getX500NameRule=function(h){for(var g=null,b=[],w=0;w<h.length;w++)for(var E=h[w],C=0;C<E.length;C++)b.push(E[C]);for(var w=0;w<b.length;w++){var x=b[w],M=x.ds,S=x.value,P=x.type;if(M!="prn"&&M!="utf8"&&M!="ia5")return"mixed";if(M=="ia5"){if(P!="CN")return"mixed";if(ee.lang.String.isMail(S))continue;return"mixed"}if(P=="C"){if(M=="prn")continue;return"mixed"}if(g==null)g=M;else if(g!==M)return"mixed"}return g==null?"prn":g},this.getX500Name=function(h){var g=this.getX500NameArray(h),b=this.dnarraytostr(g);return{array:g,str:b}},this.getX500NameArray=function(h){for(var g=[],b=e(h,0),w=0;w<b.length;w++)g.push(this.getRDN(i(h,b[w])));return g},this.getRDN=function(h){for(var g=[],b=e(h,0),w=0;w<b.length;w++)g.push(this.getAttrTypeAndValue(i(h,b[w])));return g},this.getAttrTypeAndValue=function(h){var g={type:null,value:null,ds:null},b=e(h,0),w=a(h,b[0],[],"06"),E=a(h,b[1],[]),C=ee.asn1.ASN1Util.oidHexToInt(w);return g.type=ee.asn1.x509.OID.oid2atype(C),g.ds=this.HEX2STAG[h.substr(b[1],2)],g.ds!="bmp"?g.value=tr(E):g.value=x0(E),g},this.readCertPEM=function(h){this.readCertHex(v(h))},this.readCertHex=function(h){this.hex=h,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(g){}},this.getParam=function(){var h={};return h.version=this.getVersion(),h.serial={hex:this.getSerialNumberHex()},h.sigalg=this.getSignatureAlgorithmField(),h.issuer=this.getIssuer(),h.notbefore=this.getNotBefore(),h.notafter=this.getNotAfter(),h.subject=this.getSubject(),h.sbjpubkey=b0(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(h.ext=this.getExtParamArray()),h.sighex=this.getSignatureValueHex(),h},this.getExtParamArray=function(h){if(h==null){var g=c(this.hex,0,[0,"[3]"]);g!=-1&&(h=u(this.hex,0,[0,"[3]",0],"30"))}for(var b=[],w=e(h,0),E=0;E<w.length;E++){var C=i(h,w[E]),x=this.getExtParam(C);x!=null&&b.push(x)}return b},this.getExtParam=function(h){var g=e(h,0),b=g.length;if(b!=2&&b!=3)throw new Error("wrong number elements in Extension: "+b+" "+h);var w=y(a(h,0,[0],"06")),E=!1;b==3&&s(h,0,[1])=="0101ff"&&(E=!0);var C=s(h,0,[b-1,0]),x=void 0;if(w=="2.5.29.14"?x=this.getExtSubjectKeyIdentifier(C,E):w=="2.5.29.15"?x=this.getExtKeyUsage(C,E):w=="2.5.29.17"?x=this.getExtSubjectAltName(C,E):w=="2.5.29.18"?x=this.getExtIssuerAltName(C,E):w=="2.5.29.19"?x=this.getExtBasicConstraints(C,E):w=="2.5.29.31"?x=this.getExtCRLDistributionPoints(C,E):w=="2.5.29.32"?x=this.getExtCertificatePolicies(C,E):w=="2.5.29.35"?x=this.getExtAuthorityKeyIdentifier(C,E):w=="2.5.29.37"?x=this.getExtExtKeyUsage(C,E):w=="1.3.6.1.5.5.7.1.1"?x=this.getExtAuthorityInfoAccess(C,E):w=="2.5.29.20"?x=this.getExtCRLNumber(C,E):w=="2.5.29.21"?x=this.getExtCRLReason(C,E):w=="1.3.6.1.5.5.7.48.1.2"?x=this.getExtOcspNonce(C,E):w=="1.3.6.1.5.5.7.48.1.5"?x=this.getExtOcspNoCheck(C,E):w=="1.2.840.113583.1.1.9.1"&&(x=this.getExtAdobeTimeStamp(C,E)),x!=null)return x;var M={extname:w,extn:C};return E&&(M.critical=!0),M},this.findExt=function(h,g){for(var b=0;b<h.length;b++)if(h[b].extname==g)return h[b];return null},this.dnarraytostr=function(h){function g(w){return w.map(function(E){return b(E).replace(/\+/,"\\+")}).join("+")}function b(w){return w.type+"="+w.value}return"/"+h.map(function(w){return g(w).replace(/\//,"\\/")}).join("/")},this.getInfo=function(){var h=function(H){var K=JSON.stringify(H.array).replace(/[\[\]\{\}\"]/g,"");return K},g=function(H){for(var K="",U=H.array,G=0;G<U.length;G++){var X=U[G];if(K+=" policy oid: "+X.policyoid+`
363
+ `,X.array!==void 0)for(var Z=0;Z<X.array.length;Z++){var q=X.array[Z];q.cps!==void 0&&(K+=" cps: "+q.cps+`
364
+ `)}}return K},b=function(H){for(var K="",U=H.array,G=0;G<U.length;G++){var X=U[G];try{X.dpname.full[0].uri!==void 0&&(K+=" "+X.dpname.full[0].uri+`
365
+ `)}catch(Z){}try{X.dname.full[0].dn.hex!==void 0&&(K+=" "+ze.hex2dn(X.dpname.full[0].dn.hex)+`
366
+ `)}catch(Z){}}return K},w=function(H){for(var K="",U=H.array,G=0;G<U.length;G++){var X=U[G];X.caissuer!==void 0&&(K+=" caissuer: "+X.caissuer+`
367
+ `),X.ocsp!==void 0&&(K+=" ocsp: "+X.ocsp+`
368
+ `)}return K},E,C,x;if(E=`Basic Fields
369
+ `,E+=" serial number: "+this.getSerialNumberHex()+`
370
+ `,E+=" signature algorithm: "+this.getSignatureAlgorithmField()+`
371
+ `,E+=" issuer: "+this.getIssuerString()+`
372
+ `,E+=" notBefore: "+this.getNotBefore()+`
373
+ `,E+=" notAfter: "+this.getNotAfter()+`
374
+ `,E+=" subject: "+this.getSubjectString()+`
375
+ `,E+=` subject public key info:
376
+ `,C=this.getPublicKey(),E+=" key algorithm: "+C.type+`
377
+ `,C.type==="RSA"&&(E+=" n="+co(C.n.toString(16)).substr(0,16)+`...
378
+ `,E+=" e="+co(C.e.toString(16))+`
379
+ `),x=this.aExtInfo,x!=null){E+=`X509v3 Extensions:
380
+ `;for(var M=0;M<x.length;M++){var S=x[M],P=ee.asn1.x509.OID.oid2name(S.oid);P===""&&(P=S.oid);var T="";if(S.critical===!0&&(T="CRITICAL"),E+=" "+P+" "+T+`:
381
+ `,P==="basicConstraints"){var B=this.getExtBasicConstraints();B.cA===void 0?E+=` {}
382
+ `:(E+=" cA=true",B.pathLen!==void 0&&(E+=", pathLen="+B.pathLen),E+=`
383
+ `)}else if(P==="keyUsage")E+=" "+this.getExtKeyUsageString()+`
384
+ `;else if(P==="subjectKeyIdentifier")E+=" "+this.getExtSubjectKeyIdentifier().kid.hex+`
385
+ `;else if(P==="authorityKeyIdentifier"){var F=this.getExtAuthorityKeyIdentifier();F.kid!==void 0&&(E+=" kid="+F.kid.hex+`
386
+ `)}else if(P==="extKeyUsage"){var L=this.getExtExtKeyUsage().array;E+=" "+L.join(", ")+`
387
+ `}else if(P==="subjectAltName"){var O=h(this.getExtSubjectAltName());E+=" "+O+`
388
+ `}else if(P==="cRLDistributionPoints"){var Q=this.getExtCRLDistributionPoints();E+=b(Q)}else if(P==="authorityInfoAccess"){var N=this.getExtAuthorityInfoAccess();E+=w(N)}else P==="certificatePolicies"&&(E+=g(this.getExtCertificatePolicies()))}}return E+="signature algorithm: "+this.getSignatureAlgorithmName()+`
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))}ze.hex2dn=function(n,t){t===void 0&&(t=0);var e=new ze;ae.getTLV(n,t);var r=e.getX500Name(n);return r.str};ze.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=ae.getChildIdx(n,t),i=0;i<r.length;i++)e.push(ze.hex2attrTypeValue(n,r[i]));return e=e.map(function(a){return a.replace("+","\\+")}),e.join("+")};ze.hex2attrTypeValue=function(n,t){var e=ae,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]),l=pr(u);return s+"="+l};ze.getPublicKeyFromCertHex=function(n){var t=new ze;return t.readCertHex(n),t.getPublicKey()};ze.getPublicKeyFromCertPEM=function(n){var t=new ze;return t.readCertPEM(n),t.getPublicKey()};ze.getPublicKeyInfoPropOfCertPEM=function(n){var t=ae,e=t.getVbyList,r={},i,a;return r.algparam=null,i=new ze,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};ze.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];function ho(n){return ye.SHA256(n).toString()}var Gs=[function(){var n=new ze;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:::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n.getSubjectHex())return n.verifySignature(n.getPublicKey());var r=S0(e,t);return!r||n.verifySignature(r.getPublicKey())===!1?!1:Hs(r,t)}function Ks(n){var t=n.getIssuerHex();return t===n.getSubjectHex()?!1:Hs(n,Gs)}function I0(n){var t=new ze;typeof n=="string"?t.readCertPEM(n):t.readCertHex(n.hex);var e=Ks(t);return Gs.push(t),e}function T0(n,t,e){var r=new ze;if(typeof e=="string"?r.readCertPEM(e):r.readCertHex(e.hex),Ks(r)===!1)return!1;var i=new Ie;return i.readCertPubKeyHex(r.hex,6),!!i.verify(n,Ra(t))}I0(function(){var t=113,e=126,r=0,i="";return arguments[r].split(i).map(function(a){return a.charCodeAt(r)>e?a:String.fromCharCode((a.charCodeAt(r)+t)%e)}).join(i)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVTU PPONrtNVONtVWNW=_SVw VE=ZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg R]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\bZQNAZaN\\aZ [QSnS=\b[aNBZQZ\\aZ [QSnZVTaZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg R^ZNATN>bROU^zc}nzyg RbZOVTN>bRPtYoTyuoz}}f`Bwo?=\x07RQN\\Ot[cONZO>Wyfd\x07 gdb\x07RaN]Ot[cONZZPRuupz_@feWyZ`bVfWX|gVup[N^xOSugnec|fdy\x07ndB{^T\x07}fdB\0ndRf?FZVVPVwN[Otx\0uxvTF=ON^RSNN\\PNtENZVVPPtXPNtRN?=?]q[VD|{\\oyo`oOu}F SA\x07e`tn[t u\b8^a]qx\bE_^\x07ZN?[QC\0yuOpybY8r\\RPAS=8rUq\0E8>xean^e\bf]Y`XO}{C[Ur^?\0x[SRXvVQ\\C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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 ia=function(n,t){return ia=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])},ia(n,t)};function le(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ia(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var k=function(){return k=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},k.apply(this,arguments)};function Et(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 xt(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}function yi(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(c){try{l(r.next(c))}catch(f){o(f)}}function u(c){try{l(r.throw(c))}catch(f){o(f)}}function l(c){c.done?a(c.value):i(c.value).then(s,u)}l((r=r.apply(n,t||[])).next())})}function bi(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(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(e=0)),e;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){e.label=l[1];break}if(l[0]===6&&e.label<a[1]){e.label=a[1],a=l;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(l);break}a[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(n,e)}catch(c){l=[6,c],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function pt(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 P0(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var Sn=P0("$$FIVE_EVENT$$");function An(n){return n[Sn]||(n[Sn]={}),n[Sn]}function B0(n){n[Sn]&&delete n[Sn]}var wi=function(){function n(){}return n.prototype.hasListener=function(t){var e=An(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var i=this,a=An(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){B0(this);return}var r=An(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=An(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 l=u[s],c=l[0],f=l[1],A=f===void 0?!1:f,p=c.apply(void 0,e);A&&this.off(t,c),p===!1&&(i=!0)}return i},n.prototype.waitUnitl=function(t){var e=this,r=An(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=[],l=0;l<arguments.length;l++)u[l]=arguments[l];return s(u),!0})})},n}();function D(){}var R0=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),be=typeof performance!="undefined"?function(){return R0+performance.now()}:function(){return Date.now()};function tn(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])&&tn(n[r])}),n}var po=/^([^.]+)(\.([^.]+))*$/;function F0(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 Hr(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function Rr(n,t){return po.test(n)&&po.test(t)&&F0(n,t)}var k0=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],rr=tn(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"))),Fa=function(n){le(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),si=function(n){le(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){le(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var aa=function(n){le(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),ka=function(n){le(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 L0(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 oa(n){for(var t=0,e=k0;t<e.length;t++){var r=e[t],i=n.match(r);if(i)return"jsonp_"+i[1]}return null}function vo(n){return oa(n)!==null}function Ao(n){var t=n.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function La(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 qs=function(n){le(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(wi);function nn(n,t,e,r,i){t===void 0&&(t={}),e===void 0&&(e=D),r===void 0&&(r=D),i===void 0&&(i=D);var a=be(),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,l=oa(n),c=l?"Script":"XMLHttpRequest",f=new Fa(o,c,s&&s.message?String(s.message):String(s));return(u=t.networkSubscribe)===null||u===void 0||u.emit("network",n,c,"proxy-error",f.message),Promise.reject(f)}).then(function(s){return new Promise(function(u,l){var c,f=t.allowHosts?rr.concat(t.allowHosts):rr.slice(),A=La(s),p=oa(s);if(location.hostname.length!==0&&!Hr(location.hostname)&&rr.filter(function(F){return Rr(F,location.hostname)}).length===0&&!Hr(A)&&f.filter(function(F){return Rr(F,A)}).length===0){var y=p?"Script":"XMLHttpRequest",v=new ka(s,y,"request host(".concat(A,") is not allowed"));r(v),l(v),(c=t.networkSubscribe)===null||c===void 0||c.emit("network",s,y,"forbidden",v.message);return}if(p){var m=window,h=null,g=!1,b=document.createElement("script"),w=function(){var F;if(h=null,g!==!0){g=!0;var L=new aa(s,"Script",t.timeout||NaN);r(L),l(L),(F=t.networkSubscribe)===null||F===void 0||F.emit("network",s,"Script","timeout",L.message)}},E=function(F){var L,O,Q=be(),N=Q-a;if(delete m[p],b.parentNode&&b.parentNode.removeChild(b),h!==null&&(window.clearTimeout(h),h=null),g!==!0){if(F.indexOf("data:")!==0){var H=new si(s,"Script",500);r(H),l(H),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"Script","error",H.message);return}var K=F.split(","),U=(K[0].match(/:(.*?);/)||[])[1],G=K[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var X=atob(K[1]),Z=X.length,q=new Uint8Array(Z),W=0;W<Z;W++)q[W]=X.charCodeAt(W);t.responseType==="arraybuffer"?G=q.buffer:G=new Blob([q],{type:U})}var J={},ve={body:G,meta:{origin:o,source:s,requestTime:a,responseTime:Q,costs:N,headers:J}};e(ve),u(ve),(O=t.networkSubscribe)===null||O===void 0||O.emit("network",s,"Script","ok",JSON.stringify(ve.meta)),g=!0}};m[p]=E,b.src=s,document.body.appendChild(b),typeof t.timeout=="number"&&(h=window.setTimeout(w,t.timeout))}else{var C=!1,x=new XMLHttpRequest,M=function(){x&&(x.removeEventListener("timeout",S,!1),x.removeEventListener("progress",P,!1),x.removeEventListener("load",T,!1),x.removeEventListener("error",B,!1)),x=null,M=D},S=function(){var F;if(C!==!0){C=!0,M();var L=new aa(s,"XMLHttpRequest",t.timeout||NaN);r(L),l(L),(F=t.networkSubscribe)===null||F===void 0||F.emit("network",s,"XMLHttpRequest","timeout",L.message)}},P=function(F){C!==!0&&F.lengthComputable&&(F.total<=0||i(F.loaded/F.total))},T=function(F){var L;if(C!==!0){var O=this.status;if(O===0||O>=200&&O<400){C=!0,M();var Q=be(),N=Q-a,H=L0(this.getAllResponseHeaders()),K=F.total,U={body:this.response,meta:{origin:o,source:s,requestTime:a,responseTime:Q,costs:N,headers:H,size:K}};e(U),u(U),(L=t.networkSubscribe)===null||L===void 0||L.emit("network",s,"XMLHttpRequest","ok",JSON.stringify(U.meta))}else B.call(this)}},B=function(){var F;if(C!==!0){C=!0,M();var L=new si(s,"XMLHttpRequest",this.status);r(L),l(L),(F=t.networkSubscribe)===null||F===void 0||F.emit("network",s,"XMLHttpRequest","error",L.message)}};x.addEventListener("timeout",S,!1),x.addEventListener("progress",P,!1),x.addEventListener("load",T,!1),x.addEventListener("error",B,!1),t.responseType&&(x.responseType=t.responseType),typeof t.timeout=="number"&&(x.timeout=t.timeout),x.open("GET",s,!0),x.send(null)}})})}var ki={};function O0(n,t){t===void 0&&(t={});var e=be(),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 Fa(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 ki?ki[i]:ki[i]=new Promise(function(a,o){var s,u=t.allowHosts?rr.concat(t.allowHosts):rr.slice(),l=La(i);if(location.hostname.length!==0&&!Hr(location.hostname)&&rr.filter(function(y){return Rr(y,location.hostname)}).length===0&&!Hr(l)&&u.filter(function(y){return Rr(y,l)}).length===0){var c=new ka(i,"Link","request host(".concat(l,") is not allowed"));o(c),(s=t.networkSubscribe)===null||s===void 0||s.emit("network",i,"Link","forbidden",c.message);return}var f=document.createElement("link");f.href=i,f.rel=f.relList&&f.relList.supports("prefetch")?"prefetch":"preload",f.as="fetch",f.crossOrigin="";var A=document.head||document.getElementsByTagName("head")[0];A&&A.appendChild(f);var p=!1;f.onload=function(){var y;if(p!==!0){p=!0,a();var v=be(),m=v-e,h={},g={origin:r,source:i,requestTime:e,responseTime:v,costs:m,headers:h};(y=t.networkSubscribe)===null||y===void 0||y.emit("network",i,"Link","preload",JSON.stringify(g))}},f.onerror=function(y){var v;if(p!==!0){p=!0;var m=new si(i,"Link",0);o(m),(v=t.networkSubscribe)===null||v===void 0||v.emit("network",i,"Link","error",m.message)}}})})}function V0(n,t,e,r,i,a){t===void 0&&(t={}),e===void 0&&(e=D),r===void 0&&(r=D),i===void 0&&(i=D);var o=be(),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 l,c=new Fa(s,"Image",u&&u.message?String(u.message):String(u));return(l=t.networkSubscribe)===null||l===void 0||l.emit("network",n,"Image","proxy-error",c.message),Promise.reject(c)}).then(function(u){return new Promise(function(l,c){var f,A=t.allowHosts?rr.concat(t.allowHosts):rr.slice(),p=La(u);if(location.hostname.length!==0&&!Hr(location.hostname)&&rr.filter(function(w){return Rr(w,location.hostname)}).length===0&&!Hr(p)&&A.filter(function(w){return Rr(w,p)}).length===0){var y=new ka(u,"Image","request host(".concat(p,") is not allowed"));r(y),c(y),(f=t.networkSubscribe)===null||f===void 0||f.emit("network",u,"Image","forbidden",y.message);return}var v=a!=null?a:new Image,m=!1,h=null,g=function(){var w;if(v.onload=D,v.onerror=D,h!==null&&(clearTimeout(h),h=null),m!==!0){var E=be(),C={headers:{},origin:s,source:u,requestTime:o,responseTime:E,costs:E-o};m=!0;var x={body:v,meta:C};i(1),e(x),l(x),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",u,"Image","ok",JSON.stringify(x.meta))}},b=function(){var w;if(v.onload=D,v.onerror=D,h!==null&&(clearTimeout(h),h=null),m!==!0){m=!0;var E=new si(u,"Image",0);r(E),c(E),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",u,"Image","ok",E.message)}};typeof t.timeout=="number"&&(h=window.setTimeout(function(){var w;if(v.onload=D,v.onerror=D,h=null,m!==!0){m=!0;var E=new aa(u,"Image",t.timeout);r(E),c(E),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",u,"Image","timeout",E.message)}},t.timeout)),v.onload=g,v.onerror=b,i(0),v.src=u})})}var Oa=function(){function n(t){t===void 0&&(t={}),this.options=Object.freeze(t),this.options.allowHosts&&Object.freeze(this.options.allowHosts)}return n.prototype.ajax=function(t,e,r,i,a){var o;e===void 0&&(e={}),r===void 0&&(r=D),i===void 0&&(i=D),a===void 0&&(a=D);var s=this.options,u={responseType:e.responseType,timeout:(o=e.timeout)!==null&&o!==void 0?o:s.timeout,get allowHosts(){var l;return(l=e.allowHosts)!==null&&l!==void 0?l:s.allowHosts},get requestProxy(){var l;return(l=e.requestProxy)!==null&&l!==void 0?l:s.requestProxy},get networkSubscribe(){var l;return(l=e.networkSubscribe)!==null&&l!==void 0?l:s.networkSubscribe}};return nn(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=D),i===void 0&&(i=D),a===void 0&&(a=D);var u=this.options,l={timeout:(s=e.timeout)!==null&&s!==void 0?s:u.timeout,get allowHosts(){var c;return(c=e.allowHosts)!==null&&c!==void 0?c:u.allowHosts},get requestProxy(){var c;return(c=e.requestProxy)!==null&&c!==void 0?c:u.requestProxy},get networkSubscribe(){var c;return(c=e.networkSubscribe)!==null&&c!==void 0?c:u.networkSubscribe}};return V0(t,l,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 O0(t,a)},n}(),ui=new Oa,N0=function(){if(typeof window!="undefined"){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)}}(),Q0=function(n){var t;if(typeof window!="undefined"){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)},D0=5,mo=16,lt=function(){function n(){this.frames=[],this.stoped=!1,this.time=be(),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 mo},n.prototype.loop=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!this.stoped){var r=be(),i=r-this.time;this.time=r;var a=[];mo=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,pt([r,i],t,!1))}catch(l){console.error(l)}u.once&&a.push(u)}a.length>0&&(this.frames=this.frames.filter(function(l){return a.indexOf(l)===-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):N0(t)},n.prototype.cancelAnimationFrame=function(t){this.context?this.context.cancelAnimationFrame(t):Q0(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=D0);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}(),U0={"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"]}},js=/^https?\:\/\/?([^\/]+)/;function z0(n){var t=n.match(js);return t===null?null:t[1]}function Wr(n,t){return n.replace(js,function(e,r){return e.slice(0,e.length-r.length)+t})}function G0(n,t,e){var r=t.split("."),i=r[0],a=r.slice(1);if(i==="texture")return Wr(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 Wr(n,e.pano[0]);case"down":case"right":case"back":return Wr(n,e.pano[1])}}else if(i==="pano_tile"||i==="pano_tile_luminance"){a[0],a[1];var s=a[2],u=a[3],l=a[4],c=Math.pow(2,Number(s))*Number(u)+Number(l);if(!isNaN(c))return Wr(n,e.tile[c%2])}else if(i==="model"){var f=a[0],c=Number(f);if(!isNaN(c))return Wr(n,e.model[c%2])}return Wr(n,e.default[0])}var H0=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},K0=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,l=t.size;if(s!==void 0&&s!==i&&o.push("format,".concat(s==="heif"?"heic":s)),t.cut!==void 0){var c=t.cut,f=c[0],A=c[1],p=c[2],y=c[3];o.push("crop,x_".concat(f,",y_").concat(A,",w_").concat(p,",h_").concat(y,",g_nw"))}if(u!==void 0&&u!==100){var v=(e=t.format)!==null&&e!==void 0?e:i;v&&["jpg","webp"].indexOf(v)>=0&&o.push("quality,Q_".concat(u))}return l&&l!==2048&&o.push("resize,w_".concat(l)),t.sharpen!==void 0&&o.push("sharpen,".concat(t.sharpen)),o.length&&(a="?x-oss-process=image/"+o.join("/")),r+a};function Ht(n,t){var e=k(k({},U0),t.mappings),r=z0(n);if(r===null)return n;var i=e[r];return i?(n=G0(n,t.key,i),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),i.type==="tencentCloud"?H0(n,t):i.type==="aliyun"?K0(n,t):n):n}function li(n,t,e){t===void 0&&(t=Ht);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var q0="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",j0="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",W0="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function Li(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 Oi=null;function Ws(){return Oi||(Oi=Promise.all([Li(q0),Li(j0),Li(W0)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var Xs=/^(.*)\[(\d+)\]$/;function Oe(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function ht(n){var t=n.match(Xs);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 qt(n,t){return Oe(n)===Oe(t)}function _s(n){return typeof n=="string"&&Xs.test(n)}var X0=function(n){le(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(d.Group),Mt=function(n){le(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=_0,i}return t}(d.Mesh);function _0(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 On=function(){return typeof document!="undefined"?new d.TextureLoader().load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAABCAYAAACouxZ2AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAAQAAAAB7UD0+AAACA0lEQVRIDXWUW3YjIQxEwdnV/GT/q8kO3FO3pAJst3PSAaR6Cbszf//9XeMxxpjXmI+pVXudp2s6PC4dqHff9e6D7/PZLy46xQvG+sZvrfK8xgXUeq85yINe9bdmtOK1+kun5vjgq58a+eZPna9jvmjiserqG/+Whathvo3L3WhV89L9sXI/m18z2uene9ap/ftsuT9WZxoHXzW56/fpj8l7+tTw7P011NdpqnY19sRsfuHMA9u8oZWfDz4+fra/dfG1V60ydZ7qba1g7UNAeK0JP7ydD7/OqH6wO2f7HTq+B/lbL9qsB3/N1/UzR81XfPzw4tp5OPvRneacteq8Xo0xR3vuv/kPz0KtX0Nhg0eHuaNXdWI3X/ld427h++vzyp99V6VPrzWFhbv4ayay4oFecm198MmUXN/mL+x7npq/uJXBGb/MTw4+t+SvbLoTZnUW5uHhz7nWcTxT73OwXV7cxT9wbBf/0LnDBgcnHmtPLYba32Hp808sMy1u88yhr58n70/v4xX92GSN19l/2UsqGmiH94Hpxjcs+DO/ccpIVNVp62PUWXu//ur1GQy1Cf+GZ13rtNYN1po3/NI79fGXibHkq4z25xvV2pW3szpneXsW8SsreTe/NIPrtXMnH7wPf+LEN6tqhUVHj3XKD/72p9eafCeYB3zuonnbv7yqP8d/o4K6gRb1wbYAAAAASUVORK5CYII="):new d.Texture}();On.minFilter=d.NearestFilter;On.magFilter=d.NearestFilter;On.wrapS=d.RepeatWrapping;On.wrapT=d.RepeatWrapping;var we={pano0:null,pano1:null,shownFloorIndex:-1,modelAlpha:1,opacity:1,progress:0,transition:"FADE",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:On};function Z0(n,t){var e=n!=null?n:[],r=t!=null?t:[];if(r.length!==e.length)return!1;for(var i=0;i<r.length;i++)if(!e[i].clippingBoxMatrix.equals(r[i].clippingBoxMatrix)||e[i].floorIndex!==r[i].floorIndex)return!1;return!0}function Y0(n,t){return n&&t?n.luminanceMap===t.luminanceMap&&n.map===t.map&&n.matrix.equals(t.matrix):!n&&!t}function Zs(n,t){var e=!1;for(var r in t)switch(r){case"clippers":Z0(n[r],t[r])||(n[r]=t[r],e=!0);break;case"pano0":case"pano1":Y0(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 vr=function(n){le(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.onBeforeRender=J0,i}return t}(d.Points);function J0(n,t,e){this.model&&this.material.syncModel(this.model),this.material.update(n,e)}var Xr=new Set,Ys=function(n){le(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!0,e.pbmMaterialParametersVersion=0,e.materialParameters=k({},we),e}return t.prototype.getMaterial=function(){return k({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this;Object.assign(this.materialParameters,e),Xr.clear(),this.traverse(function(i){if(i instanceof Mt)for(var a=0,o=i.material;a<o.length;a++){var s=o[a];Xr.has(s)||(Object.assign(s,r.materialParameters),Xr.add(s))}i instanceof vr&&(Xr.has(i.material)||(Object.assign(i.material,r.materialParameters),Xr.add(i.material)))}),Xr.clear(),this.needsRender=!0},t}(d.Group),$0=["right","left","up","down","front","back"];function Js(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 $s=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:Js(n.face,s.x,s.y,r),children:[]};n.children.push(u),$s(u,t)}};function ec(n,t){var e={level:0,face:n,position:new d.Vector2(0,0),size:1,box:Js(n,0,0,1),children:[]};return $s(e,t),e}function sa(n){var t=$0.map(function(e){return ec(e,n)});return{children:t}}function Va(n,t){for(var e=0,r=n.children;e<r.length;e++){var i=r[e],a=t(i);a!==!1&&Va(i,t)}}var Vn=new d.BoxBufferGeometry(1,1,1,1,1);Vn.deleteAttribute("uv");Vn.deleteAttribute("normal");Vn.groups=[];Vn.scale(-1,1,1);var tc=`
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
- `,nc=`
398
+ `,rc=`
399
399
  uniform samplerCube map;
400
400
  varying vec3 worldPosition;
401
401
  void main() {
402
402
  gl_FragColor = textureCube(map, worldPosition);
403
403
  }
404
- `,ca=new d.ShaderMaterial({uniforms:{map:{value:null}},vertexShader:rc,fragmentShader:nc,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1,fog:!1}),Na=new d.Scene;Na.matrixAutoUpdate=!1;var ru=new d.Mesh(Dn,ca);ru.matrixAutoUpdate=!1;Na.add(ru);function da(n,t,e){ca.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,Na),e.autoClear=r,ca.uniforms.map.value=null}var Qi,br=(Qi=Math.SQRT1_2)!==null&&Qi!==void 0?Qi:Math.sqrt(2),ic={up:new d.Quaternion(br,0,0,br),down:new d.Quaternion(-br,0,0,br),left:new d.Quaternion(0,br,0,br),right:new d.Quaternion(0,-br,0,br),front:new d.Quaternion(0,0,0,1),back:new d.Quaternion(0,1,0,0)},ac=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}(),oc=`
404
+ `,ua=new d.ShaderMaterial({uniforms:{map:{value:null}},vertexShader:tc,fragmentShader:rc,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1,fog:!1}),Na=new d.Scene;Na.matrixAutoUpdate=!1;var eu=new d.Mesh(Vn,ua);eu.matrixAutoUpdate=!1;Na.add(eu);function la(n,t,e){ua.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,Na),e.autoClear=r,ua.uniforms.map.value=null}var Vi,br=(Vi=Math.SQRT1_2)!==null&&Vi!==void 0?Vi:Math.sqrt(2),nc={up:new d.Quaternion(br,0,0,br),down:new d.Quaternion(-br,0,0,br),left:new d.Quaternion(0,br,0,br),right:new d.Quaternion(0,-br,0,br),front:new d.Quaternion(0,0,0,1),back:new d.Quaternion(0,1,0,0)},ic=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}(),ac=`
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
- `,sc=`
411
+ `,oc=`
412
412
  uniform sampler2D map;
413
413
  varying vec2 vUv;
414
414
  void main() {
415
415
  gl_FragColor = texture2D(map, vUv);
416
416
  }
417
- `,nu=[];function uc(){var n=nu.pop();return n||new d.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:oc,fragmentShader:sc,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function lc(n){n.uniforms.map.value=null,nu.push(n)}function cc(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=uc();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(ac,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(ic[u.face]),l.add(h),i.add(l)}var v=e.autoClear;e.autoClear=!1;var p=new d.CubeCamera(.1,2,t);p.matrixAutoUpdate=!1,p.update(e,r),e.autoClear=v;for(var m=0,A=a;m<A.length;m++){var c=A[m];lc(c)}}var dc=function(){return!1}();function di(){var n=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onerror=n.onload=n.close=Q,n.decoding="async";var t=n.src;n.removeAttribute("src"),/^blob\:/.test(t)&&URL.revokeObjectURL(t)}});return n}function fa(n){return new Promise(function(t,e){var r=di();r.onload=function(){/^blob\:/.test(r.src)&&URL.revokeObjectURL(r.src),r.onload=r.onerror=Q,setTimeout(function(){t(r)},10)},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)})}var bo=[];function fc(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 wo(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=fc(Math.min(n.width,t.width),Math.min(n.height,t.height)),r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.drawImage(n,0,0,e.width,e.height),n.close();var i=new d.Texture(e);i.needsUpdate=!0,i.flipY=!0;var a=i.dispose;return i.dispose=function(){e.close(),a.call(i),i.dispose=a},i}else{var o=new d.Texture(n);o.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?o.flipY=!1:o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}}function hc(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 zr=["right","left","up","down","front","back"],pc=4,Le=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,s;if(t===null)throw new Error("cannot set cubeRenderTarget to null.");t.width!==this.options.textureSize&&t.setSize(this.options.textureSize,this.options.textureSize),t.texture.format=(e=this.options.format)!==null&&e!==void 0?e:d.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:d.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:d.LinearFilter,t.texture.wrapS=(a=this.options.wrapS)!==null&&a!==void 0?a:d.ClampToEdgeWrapping,t.texture.wrapT=(o=this.options.wrapT)!==null&&o!==void 0?o:d.ClampToEdgeWrapping,t.texture.generateMipmaps=(s=this.options.generateMipmaps)!==null&&s!==void 0?s:!0,this.baseCubeTexture&&(da(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&da(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,v=Math.pow(2,t.level)*t.position.x,p="".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(v),m=F(F({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:p,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:F({},m)},format:d.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,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=[];Va(this.tileTree,function(v){if(r.loadingCubeNodes.has(v)||v.level>e||!t.intersectsBox(v.box))return!1;if(!r.loadedCubeNodes.has(v))return i.push(v),!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,pc);cc(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,h,v;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var p={};typeof e.flipY!="undefined"&&(p.flipY=e.flipY),typeof e.format!="undefined"&&(p.format=e.format),typeof e.generateMipmaps!="undefined"&&(p.generateMipmaps=e.generateMipmaps),p.minFilter=(s=e.minFilter)!==null&&s!==void 0?s:d.LinearFilter,p.magFilter=(u=e.magFilter)!==null&&u!==void 0?u:d.LinearFilter;var m=(l=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&l!==void 0?l:{key:"unknown"};t=ci(t,(h=e.imageURL)===null||h===void 0?void 0:h.transform,m);var A=go(t),y=(v=e.viaAjax)!==null&&v!==void 0?v:dc,f=mo(t),g=/^https?:/.test(A);if(f?y=!0:g||(y=!1),y){var b=null,w="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:w},void 0,void 0,a).then(function(M){return fa(M.body)}).then(function(M){return wo(M,e.maxSize)}).then(function(M){return Object.assign(M,p),M}).then(function(M){var C={meta:b,body:M};return r(C),C}).catch(function(M){return i(M),Promise.reject(M)})}else{var x=null,E;return Promise.resolve().then(function(){return di()}).then(function(M){return E=M,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,M)}).then(function(M){return x=M.meta,wo(M.body,e.maxSize)}).then(function(M){return Object.assign(M,p),M}).then(function(M){var C={meta:x,body:M};return r(C),C}).catch(function(M){return E&&E.close(),i(M),Promise.reject(M)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,u,c,l,h,v;r===void 0&&(r=Q),i===void 0&&(i=Q),a===void 0&&(a=Q);var p={};typeof e.format!="undefined"&&(p.format=e.format),typeof e.generateMipmaps!="undefined"&&(p.generateMipmaps=e.generateMipmaps),p.minFilter=(s=e.minFilter)!==null&&s!==void 0?s:d.LinearFilter,p.magFilter=(u=e.magFilter)!==null&&u!==void 0?u:d.LinearFilter;for(var m=[t[zr[0]],t[zr[1]],t[zr[2]],t[zr[3]],t[zr[4]],t[zr[5]]],A=[],y=[0,0,0,0,0,0],f=[],g=function(w){var x=(l=(c=e.imageURL)===null||c===void 0?void 0:c.options)!==null&&l!==void 0?l:{key:"unknown"},E=ci(m[w],(h=e.imageURL)===null||h===void 0?void 0:h.transform,F(F({},x),{key:x.key+"."+zr[w]})),M=go(E),C=function(O){y[w]=O,a(y.reduce(function(N,D){return N+D},0)/6)},S=(v=e.viaAjax)!==null&&v!==void 0?v:!1,P=/^https?:$/.test(M),I=mo(E);if(I?S=!0:P||(S=!1),S){var B="blob",L=e.fetcher.ajax(E,{timeout:e.timeout,responseType:B},void 0,void 0,C).then(function(O){return f[w]=O.meta,fa(O.body)});A.push(L)}else{var k,L=Promise.resolve().then(function(){return di()}).then(function(N){return k=N,e.fetcher.loadImage(E,{timeout:e.timeout},void 0,void 0,C,N)}).then(function(N){return f[w]=N.meta,N.body}).catch(function(N){return k&&k.close(),Promise.reject(N)});A.push(L)}},b=0;b<6;b++)g(b);return Promise.all(A).then(function(w){return hc(w)}).then(function(w){return Object.assign(w,F({encoding:d.sRGBEncoding},p)),w}).then(function(w){var x={body:w,meta:f};return r(x),x}).catch(function(w){for(var x=0,E=A;x<E.length;x++){var M=E[x];M.then(function(C){return C.close()}).catch(Q)}return i(w),Promise.reject(w)})},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,v;u.loadCubeTexture(t,{imageURL:{transform:(h=r.imageURL)===null||h===void 0?void 0:h.transform,options:(v=r.imageURL)===null||v===void 0?void 0:v.options},format:d.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(p){var m,A,y=p.meta,f=p.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),x=la(b),E=new Le(f,x,e,{textureSize:w,tileImageSize:g,textureLoader:u,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},s),M={meta:y,body:E};i(M),c(M)},function(p){a(p),l(p)},o,s).catch(Q)})},n}();const vc=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"),Ac=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{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}uv-<-aNb9-urn-<-]V6H\f|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--zn@-pnzrn_|nv|{Znv\x07-J-zn@5cvrZnv\x07h=jh=j9-cvrZnv\x07h>jh=j9-cvrZnv\x07h?jh=j9-cvrZnv\x07h=jh>j9-cvrZnv\x07h>jh>j9-cvrZnv\x07h?jh>j9-cvrZnv\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-no5V_||sZnx-:->;=6-I-=;>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 Vn=new d.WebGLCubeRenderTarget(1).texture;Vn.name="EMPTY_TEXTURE";var mc=Object.assign({modelAlpha:new d.Uniform(0),progress:new d.Uniform(0),pano0_map:new d.Uniform(Vn),pano0_luminanceMap:new d.Uniform(null),pano0_matrix:new d.Uniform(new d.Matrix4),pano1_map:new d.Uniform(Vn),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)),Un=function(n){oe(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,c,l,h,v,p,m,A,y,f,g,b,w,x,E,M=n.call(this,{vertexShader:vc,fragmentShader:Ac,uniforms:d.UniformsUtils.clone(mc),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,S=null,P=null;return Object.defineProperties(M,{pano0:{get:function(){return S},set:function(I){if(S!==I){S=I,I===null?(this.uniforms.pano0_map.value=Vn,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity()):(this.uniforms.pano0_map.value=I.map instanceof Le?I.map.texture:I.map,this.uniforms.pano0_luminanceMap.value=I.luminanceMap instanceof Le?I.luminanceMap.texture:I.luminanceMap,this.uniforms.pano0_matrix.value.copy(I.matrix));var B=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,L=this.defines.USE_LUMINANCE;L!==B&&(this.defines.USE_LUMINANCE=B,this.needsUpdate=!0)}}},pano1:{get:function(){return P},set:function(I){if(P!==I){P=I,I===null?(this.uniforms.pano1_map.value=Vn,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity()):(this.uniforms.pano1_map.value=I.map instanceof Le?I.map.texture:I.map,this.uniforms.pano1_luminanceMap.value=I.luminanceMap instanceof Le?I.luminanceMap.texture:I.luminanceMap,this.uniforms.pano1_matrix.value.copy(I.matrix));var B=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,L=this.defines.USE_LUMINANCE;L!==B&&(this.defines.USE_LUMINANCE=B,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(I){this.uniforms.modelAlpha.value=I}},progress:{get:function(){return this.uniforms.progress.value},set:function(I){this.uniforms.progress.value=I}},useBlackTransition:{get:function(){return this.defines.USE_BLACK_TRANSITION},set:function(I){var B=this.defines.USE_BLACK_TRANSITION;B!==I&&(this.defines.USE_BLACK_TRANSITION=I,this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(I){this.uniforms.constantColor.value=I;var B=this.defines.USE_CONSTANT_COLOR,L=I!==null;B!==L&&(this.defines.USE_CONSTANT_COLOR=L,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(I){this.uniforms.opacity.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(B){var L=typeof B.floorIndex=="number"?B.floorIndex:-1,k=new d.Matrix4().getInverse(B.clippingBoxMatrix);return{matrixInverse:k,floorIndex:L}}),this.needsUpdate=!0)}},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)}},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:ye.pano0,M.pano1=(i=e.pano1)!==null&&i!==void 0?i:ye.pano1,M.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:ye.modelAlpha,M.progress=(o=e.progress)!==null&&o!==void 0?o:ye.progress,M.useBlackTransition=(s=e.useBlackTransition)!==null&&s!==void 0?s:ye.useBlackTransition,M.constantColor=(u=e.constantColor)!==null&&u!==void 0?u:ye.constantColor,M.opacity=(c=e.opacity)!==null&&c!==void 0?c:ye.opacity,M.shownFloorIndex=(l=e.shownFloorIndex)!==null&&l!==void 0?l:ye.shownFloorIndex,M.clippers=(h=e.clippers)!==null&&h!==void 0?h:ye.clippers,M.useEDL=(v=e.useEDL)!==null&&v!==void 0?v:ye.useEDL,M.useHQWeight=(p=e.useHQWeight)!==null&&p!==void 0?p:ye.useHQWeight,M.useHQDepth=(m=e.useHQDepth)!==null&&m!==void 0?m:ye.useHQDepth,M.pointSize=(A=e.pointSize)!==null&&A!==void 0?A:ye.pointSize,M.pointColor=(y=e.pointColor)!==null&&y!==void 0?y:ye.pointColor,M.pointShape=(f=e.pointShape)!==null&&f!==void 0?f:ye.pointShape,M.pointScale=(g=e.pointScale)!==null&&g!==void 0?g:ye.pointScale,M.pointBack=(b=e.pointBack)!==null&&b!==void 0?b:ye.pointBack,M.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:ye.pointMinPixel,M.pointMaxPixel=(x=e.pointMaxPixel)!==null&&x!==void 0?x:ye.pointMaxPixel,M.gradientTexture=(E=e.gradientTexture)!==null&&E!==void 0?E:ye.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;var i;this.uniforms.map.value&&(i=this.uniforms.map.value),i?(i.updateMatrix(),this.uniforms.uvTransform.value.copy(i.matrix)):this.uniforms.uvTransform.value.identity()},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),Hr=function(n){oe(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.premultipliedAlpha,o=a===void 0?!0:a,s=e.stencil,u=s===void 0?!0:s,c=e.backgroundColor,l=c===void 0?1579548:c,h=e.backgroundAlpha,v=h===void 0?1:h,p=e.pixelRatio,m=p===void 0?1:p,A=e.antialias,y=e.webgl2,f=this,g={antialias:A,alpha:!0,preserveDrawingBuffer:i,stencil:u,premultipliedAlpha:o,powerPreference:"high-performance"};if(y){var b=document.createElement("canvas"),w=b.getContext("webgl2",g);w?f=n.call(this,F(F({},g),{antialias:!0,canvas:b,context:w}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),f=n.call(this,g)||this)}else f=n.call(this,g)||this;return f.setPixelRatio(m),f.setClearColor(l,v),f.outputEncoding=d.sRGBEncoding,f.autoClear=!0,f}return t}(d.WebGLRenderer),iu=function(n){oe(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 Tr(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 gc=1,yc=.1,bc=2e3,Wn=Math.PI*2,xo=Math.PI/2;function Eo(n){return n>0&&n<=Wn?n:(n%Wn+Wn)%Wn}function wc(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 fi=function(n){oe(t,n);function t(e,r,i,a,o,s,u){r===void 0&&(r=gc),i===void 0&&(i=yc),a===void 0&&(a=bc),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.refineModel=!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 Tr(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0);var r=this.getDirection(new d.Vector3);this.pose.longitude=Eo(-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=Eo((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),c=Math.max(-xo+1e-4,Math.min(xo-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,v=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,p=Tr({longitude:u,latitude:c}).normalize();return this.position.set(0,0,0),this.lookAt(p),this.position.add(v).sub(p.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(v),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(){wc(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),mt;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(mt||(mt={}));var au=1e-6,ke=new d.Vector3,Ir=new d.Matrix4,wr=new d.Vector3,xr=new d.Vector3,Er=new d.Vector3,ha=new d.Vector3,Mo=new d.Box3,Co=new d.Sphere,So=new d.Matrix4,Io=new d.Ray,vt=new d.Object3D,To=new d.Frustum;function ou(n,t){var e=n.elements;return t.setFromRotationMatrix(Ir.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 Bn=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 Ir.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),To.setFromProjectionMatrix(Ir),this.setFromFrustum(To),this},n.prototype.applyMatrix4=function(t){for(var e=0,r=this.planes;e<r.length;e++){var i=r[e];i.applyMatrix4(t)}},n.prototype.copy=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.computeVisibility=function(t){for(var e=mt.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case mt.Outside:return mt.Outside;case mt.Intersecting:e=mt.Intersecting;break}}return e},n.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===n.MASK_OUTSIDE||e===n.MASK_INSIDE)return e;for(var r=n.MASK_INSIDE,i=Math.min(32,this.planes.length),a=0;a<i;++a){var o=1<<a;if(e&o){var s=this.planes[a],u=t.intersectPlane(s);if(u===mt.Outside)return n.MASK_OUTSIDE;u===mt.Intersecting&&(r|=o)}}return r},n}(),su=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],v=Math.sqrt(r*r+i*i+a*a),p=Math.sqrt(o*o+s*s+u*u),m=Math.sqrt(c*c+l*l+h*h);this.halfSize.set(v,p,m);var A=this.halfSize.toArray().reduce(function(y,f){return y+f},0);return(isNaN(A)||A<=0)&&this.halfSize.setScalar(au),this.rotation.fromArray([r/v,i/v,a/v,o/p,s/p,u/p,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(wr,xr,Er),{box:rt(rt(rt(rt([],this.center.toArray(),!0),wr.multiplyScalar(this.halfSize.x).toArray(),!0),xr.multiplyScalar(this.halfSize.y).toArray(),!0),Er.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 vt.position.copy(this.center),ou(this.rotation,vt.quaternion),vt.scale.copy(this.halfSize),vt.matrix.compose(vt.position,vt.quaternion,vt.scale),vt.matrix.premultiply(t),vt.matrix.decompose(vt.position,vt.quaternion,vt.scale),this.center.copy(vt.position),this.rotation.setFromMatrix4(Ir.makeRotationFromQuaternion(vt.quaternion)),this.halfSize.copy(vt.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(wr,xr,Er),wr.setLength(this.halfSize.x),xr.setLength(this.halfSize.y),Er.setLength(this.halfSize.z),t.expandByPoint(ke.copy(this.center).add(wr)),t.expandByPoint(ke.copy(this.center).sub(wr)),t.expandByPoint(ke.copy(this.center).add(xr)),t.expandByPoint(ke.copy(this.center).sub(xr)),t.expandByPoint(ke.copy(this.center).add(Er)),t.expandByPoint(ke.copy(this.center).sub(Er)),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);ke.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),ke.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),ke.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),ke.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),ke.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),ke.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),ke.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),ke.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?mt.Outside:l>=c?mt.Inside:mt.Intersecting},n.prototype.intersectRay=function(t,e){ha.copy(this.halfSize).multiplyScalar(2),Mo.setFromCenterAndSize(ke.set(0,0,0),ha),this.rotation.extractBasis(wr,xr,Er),Ir.makeBasis(wr,xr,Er),Ir.setPosition(this.center),So.getInverse(Ir),Io.copy(t).applyMatrix4(So);var r=Io.intersectBox(Mo,ke);return r?e!==void 0?r.applyMatrix4(Ir).distanceTo(t.origin)<e:!0:!1},n}(),uu=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],au),this},n.prototype.toJson=function(){return{sphere:rt(rt([],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,ha.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?mt.Outside:a<r?mt.Intersecting:mt.Inside},n.prototype.intersectRay=function(t,e){Co.set(this.center,this.radius);var r=t.intersectSphere(Co,ke);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),xc=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 Rn(n){if("box"in n)return new su().fromJson(n);if("sphere"in n)return new uu().fromJson(n);if("region"in n)return new xc().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var Xn=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new d.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),Ec=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);ke.set(1,1,1).toArray(t,0),ke.set(-1,1,1).toArray(t,3),ke.set(-1,-1,1).toArray(t,6),ke.set(1,-1,1).toArray(t,9),ke.set(1,1,-1).toArray(t,12),ke.set(-1,1,-1).toArray(t,15),ke.set(-1,-1,-1).toArray(t,18),ke.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}(),Mc=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 Cc(n,t){if(n instanceof su){var e=new d.LineSegments(Ec,Xn[Math.min(t,Xn.length-1)]);return e.position.copy(n.center),ou(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 uu){var e=new d.LineSegments(Mc,Xn[Math.min(t,Xn.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 Qa=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?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=Rn(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=Rn(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=Rn(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:Bn.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,i),this.state.visible=this.state.visibilityPlaneMask!==Bn.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.visibilityPlaneMask=Bn.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}(),pa=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}(),Sc=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Ic=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 Sc(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}(),lu=function(){function n(){this.cacheNodeMap=new Map,this.list=new Ic,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}(),Po=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}(),va=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 Po,this._emptyTraversalStack=new Po,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(),o.camera.refine&&(this._canSelectTile=o.camera.visible,this.updateTile(t,o),this.executeTraversal(t,o))}this._traversalStack.reset(),this._emptyTraversalStack.reset(),e.camera.refine&&(this._canSelectTile=e.camera.visible,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}(),Tc=new d.Matrix4,ri=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 va,this.cache=new lu,this.requestScheduler=new pa,this.frameNumber=0,this.pendingCount=0,this.tiles=new Map,this.memoryUsageInBytes=0,this.root=new Qa("".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(Tc),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=va.DEFAULT_MAX_SCREEN_SPACE_ERROR,n.DEFAULT_MAX_REQUESTS=pa.DEFAULT_MAX_REQUESTS,n}(),ln=function(){function n(t,e,r,i,a){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=a}return n}(),pr=6*4+4+4+2+2;function cu(n,t){for(var e=new ArrayBuffer(t*pr),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,u;s=o.pop();)u=s.id*pr/4,r[u]=s.extents[0],r[u+1]=s.extents[1],r[u+2]=s.extents[2],r[u+3]=s.extents[3],r[u+4]=s.extents[4],r[u+5]=s.extents[5],i[u+6]=s.startIndex,i[u+7]=s.endIndex,u=s.id*pr/2,s.node0&&(a[u+16]=s.node0.id,o.push(s.node0)),s.node1&&(a[u+17]=s.node1.id,o.push(s.node1));return e}function du(n,t,e,r,i,a,o,s,u){u===void 0&&(u=0),e=e-u,r=r-u,i=i-u,a=a+u,o=o+u,s=s+u;var c={min:0,max:0};t.x>=0?(c.min=(e-n.x)*t.x,c.max=(a-n.x)*t.x):(c.min=(a-n.x)*t.x,c.max=(e-n.x)*t.x);var l={min:0,max:0};if(t.y>=0?(l.min=(r-n.y)*t.y,l.max=(o-n.y)*t.y):(l.min=(o-n.y)*t.y,l.max=(r-n.y)*t.y),c.min>l.max||l.min>c.max)return!1;l.min>c.min&&(c.min=l.min),l.max<c.max&&(c.max=l.max);var h={min:0,max:0};return t.z>=0?(h.min=(i-n.z)*t.z,h.max=(s-n.z)*t.z):(h.min=(s-n.z)*t.z,h.max=(i-n.z)*t.z),!(c.min>h.max||h.min>c.max||(h.min>c.min&&(c.min=h.min),h.max<c.max&&(c.max=h.max),c.max<0))}var fu=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}(),hu=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),Bo=1e-6,Ro=function(){function n(t,e){if(this.positionArray=t,e)this.indicesArray=e;else{for(var r=t.length/3,i=r>65535?new Uint32Array(r):new Uint16Array(r),a=0;a<r;a++)i[a]=a;this.indicesArray=i}}return n.prototype.createTree=function(t,e,r){e=Math.min(e,16);var i=this.positionArray,a=this.indicesArray,o=a.length/3,s=o>65535?new Uint32Array(o):new Uint16Array(o),u=new Float32Array(o*6),c=[],l=0,h=-1;if(r)for(var v=0,p=0,m=0,A=void 0,y=void 0,f=void 0,g=void 0,b=void 0,w=void 0,x=void 0;v<o;v+=1,p+=3,m+=6)s[v]=v,A=g=i[a[p]*3],x=i[a[p+1]*3],x<A&&(A=x),x>g&&(g=x),x=i[a[p+2]*3],x<A&&(A=x),x>g&&(g=x),y=b=i[a[p]*3+1],x=i[a[p+1]*3+1],x<y&&(y=x),x>b&&(b=x),x=i[a[p+2]*3+1],x<y&&(y=x),x>b&&(b=x),f=w=i[a[p]*3+2],x=i[a[p+1]*3+2],x<f&&(f=x),x>w&&(w=x),x=i[a[p+2]*3+2],x<f&&(f=x),x>w&&(w=x),u[m]=A,u[m+1]=y,u[m+2]=f,u[m+3]=g,u[m+4]=b,u[m+5]=w;else{for(var E=1/0,M=1/0,C=1/0,S=-1/0,P=-1/0,I=-1/0,v=0,p=0,m=0,A=void 0,y=void 0,f=void 0,g=void 0,b=void 0,w=void 0,x=void 0;v<o;v+=1,p+=3,m+=6)s[v]=v,A=g=i[a[p]*3],x=i[a[p+1]*3],x<A&&(A=x),x>g&&(g=x),x=i[a[p+2]*3],x<A&&(A=x),x>g&&(g=x),y=b=i[a[p]*3+1],x=i[a[p+1]*3+1],x<y&&(y=x),x>b&&(b=x),x=i[a[p+2]*3+1],x<y&&(y=x),x>b&&(b=x),f=w=i[a[p]*3+2],x=i[a[p+1]*3+2],x<f&&(f=x),x>w&&(w=x),x=i[a[p+2]*3+2],x<f&&(f=x),x>w&&(w=x),u[m]=A,u[m+1]=y,u[m+2]=f,u[m+3]=g,u[m+4]=b,u[m+5]=w,A<E&&(E=A),g>S&&(S=g),y<M&&(M=y),b>P&&(P=b),f<C&&(C=f),w>I&&(I=w);r=[E,M,C,S,P,I]}var B=new ln(++h,r,0,o,0);c[l++]=B;var L=[],k=[0,1,2],O=function(D,H){return L[H]-L[D]};function N(D){var H=D.startIndex,z=D.endIndex,U=D.extents;L[0]=U[3]-U[0],L[1]=U[4]-U[1],L[2]=U[5]-U[2],k.sort(O);for(var q=0;q<3;q++){for(var j=k[q],_=U[j]+U[j+3],Z=H,W=z-1,Y=-1,ce=void 0;Z<=W;)Y===-1?(ce=s[Z],u[ce*6+j]+u[ce*6+j+3]<_?Z++:Y=ce):(ce=s[W],u[ce*6+j]+u[ce*6+j+3]>=_||(s[Z]=ce,s[W]=Y,Y=-1,Z++),W--);if(Z>H&&Z<z){var te=new ln(++h,Fo(s,u,H,Z,Bo),H,Z,D.deepth+1);te.deepth<e&&te.endIndex-te.startIndex>t&&(c[l++]=te);var se=new ln(++h,Fo(s,u,Z,z,Bo),Z,z,D.deepth+1);se.deepth<e&&se.endIndex-se.startIndex>t&&(c[l++]=se),D.node0=te,D.node1=se,D.startIndex=0,D.endIndex=0;break}}}for(;l;)N(c[--l]);return this.offsetArray=s,this.rootNodePacked=cu(B,h+1),c.length=0,this},n.prototype.trianglesInSphere=function(t,e){for(var r=this.positionArray,i=this.indicesArray,a=this.offsetArray,o=this.rootNodePacked,s=new Float32Array(o),u=new Uint32Array(o),c=new Uint16Array(o),l=[0],h=[],v,p,m,A;(v=l.pop())!==void 0;){A=v*pr/4;var y=Di(t.x,s[A],s[A+3])-t.x,f=Di(t.y,s[A+1],s[A+4])-t.y,g=Di(t.z,s[A+2],s[A+5])-t.z;if(y*y+f*f+g*g<=e*e){for(var b=u[A+6];b<u[A+7];b++)h.push(a[b]);A=v*pr/2,p=c[A+16],m=c[A+17],p&&l.push(p),m&&l.push(m)}}for(var w=h.length,x=new Float32Array(w*9),b=0;b<w;b++){var E=h[b];x[b*9]=r[i[E]*3],x[b*9+1]=r[i[E]*3+1],x[b*9+2]=r[i[E]*3+2],x[b*9+3]=r[i[E+1]*3],x[b*9+4]=r[i[E+1]*3+1],x[b*9+5]=r[i[E+1]*3+2],x[b*9+6]=r[i[E+2]*3],x[b*9+7]=r[i[E+2]*3+1],x[b*9+8]=r[i[E+2]*3+2]}return x},n.prototype.intersectRay=function(t,e,r){for(var i=this.positionArray,a=this.indicesArray,o=this.offsetArray,s=this.rootNodePacked,u=new Float32Array(s),c=new Uint32Array(s),l=new Uint16Array(s),h=new fu(1/e.x,1/e.y,1/e.z),v=[0],p,m,A,y;(p=v.pop())!==void 0;)if(y=p*pr/4,du(t,h,u[y],u[y+1],u[y+2],u[y+3],u[y+4],u[y+5])){for(var f=c[y+6],g=c[y+7],b=void 0,w=void 0,x=void 0,E=t.x,M=t.y,C=t.z,S=e.x,P=e.y,I=e.z,B=void 0,L=void 0,k=void 0,O=void 0,N=void 0,D=void 0,H=void 0,z=void 0,U=void 0,q=void 0,j=void 0,_=void 0,Z=void 0,W=void 0,Y=void 0,ce=void 0,te=void 0,se=void 0,ue=void 0,pe=void 0,he=void 0,de=void 0,be=void 0,fe=void 0,Se=void 0,ee=void 0,le=void 0;f<g;f++){if(b=o[f],w=b*3,x=a[w]*3,B=i[x],L=i[++x],k=i[++x],x=a[w+1]*3,O=i[x],N=i[++x],D=i[++x],x=a[w+2]*3,H=i[x],z=i[++x],U=i[++x],q=O-B,j=N-L,_=D-k,Z=H-B,W=z-L,Y=U-k,ce=j*Y-_*W,te=_*Z-q*Y,se=q*W-j*Z,be=S*ce+P*te+I*se,be>0)de=1;else if(be<0)de=-1,be=-be;else continue;ue=E-B,pe=M-L,he=C-k,fe=de*(S*(pe*Y-he*W)+P*(he*Z-ue*Y)+I*(ue*W-pe*Z)),!(fe<0)&&(Se=de*(S*(j*he-_*pe)+P*(_*ue-q*he)+I*(q*pe-j*ue)),!(Se<0)&&(fe+Se>be||(ee=-de*(ue*ce+pe*te+he*se),!(ee<0)&&(le=ee/be,r.push(new hu([B,L,k,O,N,D,H,z,U],[E+S*le,M+P*le,C+I*le],b))))))}y=p*pr/2,m=l[y+16],A=l[y+17],m&&v.push(m),A&&v.push(A)}return r},n}();function Di(n,t,e){return n<t?t:n>e?e:n}function Fo(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,v=void 0,p=void 0;h<r;h++)v=n[h]*6,p=t[v],p<a&&(a=p),p=t[v+1],p<o&&(o=p),p=t[v+2],p<s&&(s=p),p=t[v+3],p>u&&(u=p),p=t[v+4],p>c&&(c=p),p=t[v+5],p>l&&(l=p);return[a-i,o-i,s-i,u+i,c+i,l+i]}var ko=1e-6,Lo=function(){function n(t,e){this.positionArray=t,this.indicesArray=e}return n.prototype.createTree=function(t,e,r){e=Math.min(e,16);var i=this.positionArray,a=this.indicesArray,o=a?a.length:i.length/3,s=o>65535?new Uint32Array(o):new Uint16Array(o),u=[],c=0,l=-1;if(r)for(var h=0;h<o;h+=1)s[h]=h;else{for(var v=a?a[0]*3:0,p=i[v],m=i[v+1],A=i[v+2],y=p,f=m,g=A,h=0,b=0,w=void 0,x=void 0,E=void 0;h<o;h+=1,b+=3)s[h]=h,v=(a?a[b]:b)*3,w=i[v],x=i[v+1],E=i[v+2],w<p?p=w:w>y&&(y=w),x<m?m=x:x>f&&(f=x),E<A?A=E:E>g&&(g=E);r=[p,m,A,y,f,g]}var M=new ln(++l,r,0,o,0);u[c++]=M;var C=[],S=[0,1,2],P=function(B,L){return C[L]-C[B]};function I(B){var L=B.startIndex,k=B.endIndex,O=B.extents;C[0]=O[3]-O[0],C[1]=O[4]-O[1],C[2]=O[5]-O[2];for(var N=S.sort(P)[0],D=(O[N]+O[N+3])/2,H=L,z=k-1,U=-1,q,j;H<=z;)U===-1?(q=s[H],j=(a?a[q]:q)*3,i[j+N]<D?H++:U=q):(q=s[z],j=(a?a[q]:q)*3,i[j+N]>=D||(s[H]=q,s[z]=U,U=-1,H++),z--);if(H>L){var _=O.slice();_[N+3]=D+ko;var Z=new ln(++l,_,L,H,B.deepth+1);Z.deepth<e&&Z.endIndex-Z.startIndex>t&&(u[c++]=Z),B.node0=Z}if(k>H){var W=O.slice();W[N]=D-ko;var Y=new ln(++l,W,H,k,B.deepth+1);Y.deepth<e&&Y.endIndex-Y.startIndex>t&&(u[c++]=Y),B.node1=Y}B.startIndex=0,B.endIndex=0}for(;c;)I(u[--c]);return this.offsetArray=s,this.rootNodePacked=cu(M,l+1),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.rootNodePacked,c=new Float32Array(u),l=new Uint32Array(u),h=new Uint16Array(u),v=r*r,p=new fu(1/e.x,1/e.y,1/e.z),m=[0],A,y,f,g;(A=m.pop())!==void 0;)if(g=A*pr/4,du(t,p,c[g],c[g+1],c[g+2],c[g+3],c[g+4],c[g+5],r)){for(var b=l[g+6],w=l[g+7],x=void 0,E=void 0,M=void 0,C=void 0,S=void 0,P=void 0,I=void 0,B=void 0,L=void 0,k=void 0,O=void 0,N=void 0,D=void 0;b<w;b++)x=s[b],E=(o?o[x]:x)*3,M=a[E],C=a[++E],S=a[++E],P=t.x,I=t.y,B=t.z,L=e.x,k=e.y,O=e.z,N=L*(M-P)+k*(C-I)+O*(S-B),N>0&&(P+=L*N,I+=k*N,B+=O*N),L=M-P,k=C-I,O=S-B,N=L*L+k*k+O*O,N<=v&&i.push(new hu([M,C,S,M,C,S,M,C,S],[P,I,B],x));g=A*pr/2,y=h[g+16],f=h[g+17],y&&m.push(y),f&&m.push(f)}return i},n}();const pu="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBYPWZ1bmN0aW9uKCl7ZnVuY3Rpb24gaChyLHQsYSxvLHMpe3RoaXMuaWQ9cix0aGlzLmV4dGVudHM9dCx0aGlzLnN0YXJ0SW5kZXg9YSx0aGlzLmVuZEluZGV4PW8sdGhpcy5kZWVwdGg9c31yZXR1cm4gaH0oKSxSPTYqNCs0KzQrMisyO2Z1bmN0aW9uIG5yKGgscil7Zm9yKHZhciB0PW5ldyBBcnJheUJ1ZmZlcihyKlIpLGE9bmV3IEZsb2F0MzJBcnJheSh0KSxvPW5ldyBVaW50MzJBcnJheSh0KSxzPW5ldyBVaW50MTZBcnJheSh0KSxlPVtoXSx2LG47dj1lLnBvcCgpOyluPXYuaWQqUi80LGFbbl09di5leHRlbnRzWzBdLGFbbisxXT12LmV4dGVudHNbMV0sYVtuKzJdPXYuZXh0ZW50c1syXSxhW24rM109di5leHRlbnRzWzNdLGFbbis0XT12LmV4dGVudHNbNF0sYVtuKzVdPXYuZXh0ZW50c1s1XSxvW24rNl09di5zdGFydEluZGV4LG9bbis3XT12LmVuZEluZGV4LG49di5pZCpSLzIsdi5ub2RlMCYmKHNbbisxNl09di5ub2RlMC5pZCxlLnB1c2godi5ub2RlMCkpLHYubm9kZTEmJihzW24rMTddPXYubm9kZTEuaWQsZS5wdXNoKHYubm9kZTEpKTtyZXR1cm4gdH1mdW5jdGlvbiBhcihoLHIsdCxhLG8scyxlLHYsbil7bj09PXZvaWQgMCYmKG49MCksdD10LW4sYT1hLW4sbz1vLW4scz1zK24sZT1lK24sdj12K247dmFyIHk9e21pbjowLG1heDowfTtyLng+PTA/KHkubWluPSh0LWgueCkqci54LHkubWF4PShzLWgueCkqci54KTooeS5taW49KHMtaC54KSpyLngseS5tYXg9KHQtaC54KSpyLngpO3ZhciBBPXttaW46MCxtYXg6MH07aWYoci55Pj0wPyhBLm1pbj0oYS1oLnkpKnIueSxBLm1heD0oZS1oLnkpKnIueSk6KEEubWluPShlLWgueSkqci55LEEubWF4PShhLWgueSkqci55KSx5Lm1pbj5BLm1heHx8QS5taW4+eS5tYXgpcmV0dXJuITE7QS5taW4+eS5taW4mJih5Lm1pbj1BLm1pbiksQS5tYXg8eS5tYXgmJih5Lm1heD1BLm1heCk7dmFyIHc9e21pbjowLG1heDowfTtyZXR1cm4gci56Pj0wPyh3Lm1pbj0oby1oLnopKnIueix3Lm1heD0odi1oLnopKnIueik6KHcubWluPSh2LWgueikqci56LHcubWF4PShvLWgueikqci56KSwhKHkubWluPncubWF4fHx3Lm1pbj55Lm1heHx8KHcubWluPnkubWluJiYoeS5taW49dy5taW4pLHcubWF4PHkubWF4JiYoeS5tYXg9dy5tYXgpLHkubWF4PDApKX12YXIgdnI9ZnVuY3Rpb24oKXtmdW5jdGlvbiBoKHIsdCxhKXt0aGlzLng9cix0aGlzLnk9dCx0aGlzLno9YX1yZXR1cm4gaC5wcm90b3R5cGUuY29weT1mdW5jdGlvbihyKXtyZXR1cm4gdGhpcy54PXIueCx0aGlzLnk9ci55LHRoaXMuej1yLnosdGhpc30saC5wcm90b3R5cGUuc2V0PWZ1bmN0aW9uKH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Ipdj1uZXcgeXIoZS5wb3NpdGlvbkFycmF5LGUuaW5kaWNlc0FycmF5KTtlbHNlIGlmKGUudHlwZT09PSJwb2ludHMiKXY9bmV3IGZyKGUucG9zaXRpb25BcnJheSxlLmluZGljZXNBcnJheSk7ZWxzZSB0aHJvdyBuZXcgRXJyb3IoIkludmFsaWQgVHlwZSIpO3YuY3JlYXRlVHJlZShlLm1heEl0ZW1QZXJOb2RlLGUubWF4VHJlZURlcHRoLGUuZXh0ZW50cyk7dmFyIG49e29mZnNldEFycmF5OnYub2Zmc2V0QXJyYXksaW5kaWNlc0FycmF5OnYuaW5kaWNlc0FycmF5LHBvc2l0aW9uQXJyYXk6di5wb3NpdGlvbkFycmF5LHJvb3ROb2RlUGFja2VkOnYucm9vdE5vZGVQYWNrZWR9O3QucHVzaChuKTtmb3IodmFyIHkgaW4gbil7dmFyIEE9blt5XTtBJiYoQSBpbnN0YW5jZW9mIEFycmF5QnVmZmVyP2EuaW5kZXhPZihBKT09PS0xJiZhLnB1c2goQSk6QS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmYS5pbmRleE9mKEEuYnVmZmVyKT09LTEmJmEucHVzaChBLmJ1ZmZlcikpfX1yZXR1cm57b3V0cHV0OnQsdHJhbnNmZXI6YX19KX0pfSkoKTsK",Oo=typeof window!="undefined"&&window.Blob&&new Blob([atob(pu)],{type:"text/javascript;charset=utf-8"});function Pc(n){let t;try{if(t=Oo&&(window.URL||window.webkitURL).createObjectURL(Oo),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:application/javascript;base64,"+pu,{name:n==null?void 0:n.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var vu=function(){function n(t,e){this.pool=e,this.workerCreator=t,this.queue=[],this.workers=[],this.workersResolver=[],this.workerStatus=0}return n.prototype.initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this.onMessage.bind(this,t)),this.workers[t]=e}},n.prototype.getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype.onMessage=function(t,e){var r=this.workersResolver[t],i=r.resolve,a=r.reject;if(e.data&&"$$error"in e.data?a(e.data.$$error):i(e.data),this.queue.length){var o=this.queue.shift(),s=o.resolve,u=o.reject,c=o.input,l=o.transfer;this.workersResolver[t]={resolve:s,reject:u},this.workers[t].postMessage(c,l)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,a){var o=r.getIdleWorker();o!==-1?(r.initWorker(o),r.workerStatus|=1<<o,r.workersResolver[o]={resolve:i,reject:a},r.workers[o].postMessage(t,e)):r.queue.push({resolve:i,reject:a,input:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolver.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),Bc=new vu(function(){return new Pc},4),ni=new Map,Ui=new Map,cn=new d.Ray,Vo=new d.Matrix3,Fn=new d.Matrix4,Au=new d.Vector3,Rc=new d.Vector3,Fc=new d.Vector3,kc=new d.Triangle;function Lc(n,t,e,r){var i,a=n.matrixWorld;Fn.getInverse(a),cn.copy(e.ray).applyMatrix4(Fn);for(var o=t.intersectRay(cn.origin,cn.direction,[]),s=n.geometry,u=n.material,c=s.groups,l=s.index,h=0,v=o.length;h<v;h++){var p=o[h],m=p.triangle,A=p.index,y=p.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,x=0,E=c;x<E.length;x++){var M=E[x];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=kc.set(Au.set(m[0],m[1],m[2]).applyMatrix4(a),Rc.set(m[3],m[4],m[5]).applyMatrix4(a),Fc.set(m[6],m[7],m[8]).applyMatrix4(a)).getNormal(new d.Vector3),S=A*3,P=new d.Face3(l?l.array[S]:S,l?l.array[S+1]:S+1,l?l.array[S+2]:S+2,C),I=e.ray.direction.dot(C);b.side===d.FrontSide&&I>=0||b.side===d.BackSide&&I<=0||r.push({distance:g,object:n,face:P,point:f,distanceToRay:0,faceIndex:A})}}}}function Oc(n,t,e,r){var i,a,o=n.matrixWorld;Vo.getNormalMatrix(o),Fn.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*Fn.getMaxScaleOnAxis();cn.copy(e.ray).applyMatrix4(Fn);for(var u=t.intersectRay(cn.origin,cn.direction,s,[]),c=n.geometry,l=c.index,h=c.getAttribute("normal"),v=0,p=u.length;v<p;v++){var m=u[v],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=Au.set(A[0],A[1],A[2]).applyMatrix4(o),x=l?l.array[y]:y,E=void 0;h instanceof d.BufferAttribute&&(E=new d.Vector3().fromBufferAttribute(h,x).applyNormalMatrix(Vo));var M=new d.Face3(x,x,x,E);r.push({distance:b,object:n,face:M,point:g,distanceToRay:g.distanceTo(w),index:y})}}}function No(n,t){var e=n.raycast,r=function(i,a){var o=ni.get(this);o?Lc(this,o,i,a):e.call(this,i,a)};return n.raycast=r,ni.set(n,t),function(){ni.delete(n),n.raycast===r&&(n.raycast=e)}}function Qo(n,t){var e=n.raycast,r=function(i,a){var o=Ui.get(this);o?Oc(this,o,i,a):e.call(this,i,a)};return n.raycast=r,Ui.set(n,t),function(){Ui.delete(n),n.raycast===r&&(n.raycast=e)}}function Vc(n,t,e,r){t===void 0&&(t=!0),e===void 0&&(e=100),r===void 0&&(r=10);var i=[];return n.traverse(function(a){if((a instanceof d.Mesh||a instanceof d.Points)&&a.geometry instanceof d.BufferGeometry){var o=a.geometry.getAttribute("position");o instanceof d.BufferAttribute&&i.push(a)}}),t?Promise.resolve().then(function(){for(var a,o,s=[],u=[],c=0;c<i.length;c++){var l=i[c];if(l instanceof d.Mesh){if(l.geometry instanceof d.BufferGeometry){var h=l.geometry.getAttribute("position");if(h instanceof d.BufferAttribute){var v=h.array,p=(a=l.geometry.getIndex())===null||a===void 0?void 0:a.array,m=l.geometry.boundingBox,A=m?[m.min.x,m.min.y,m.min.z,m.max.x,m.max.y,m.max.z]:void 0,y={type:"mesh",positionArray:v,indicesArray:p,maxItemPerNode:e,maxTreeDepth:r,extents:A};s.push(y);for(var f in y){var g=y[f];g&&(g instanceof ArrayBuffer?u.indexOf(g)===-1&&u.push(g):g.buffer instanceof ArrayBuffer&&u.indexOf(g.buffer)===-1&&u.push(g.buffer))}}}}else if(l instanceof d.Points&&l.geometry instanceof d.BufferGeometry){var h=l.geometry.getAttribute("position");if(h instanceof d.BufferAttribute){var v=h.array,p=(o=l.geometry.getIndex())===null||o===void 0?void 0:o.array,m=l.geometry.boundingBox,A=m?[m.min.x,m.min.y,m.min.z,m.max.x,m.max.y,m.max.z]:void 0,y={type:"points",positionArray:v,indicesArray:p,maxItemPerNode:e,maxTreeDepth:r,extents:A};s.push(y);for(var b in y){var g=y[b];g&&(g instanceof ArrayBuffer?u.indexOf(g)===-1&&u.push(g):g.buffer instanceof ArrayBuffer&&u.indexOf(g.buffer)===-1&&u.push(g.buffer))}}}}return Bc.postMessage(s,u)}).then(function(a){for(var o=[],s=0;s<i.length;s++){var u=i[s],c=a[s];if(u instanceof d.Mesh){if(u.geometry instanceof d.BufferGeometry){var l=u.geometry.getAttribute("position");if(l instanceof d.BufferAttribute){l.array=c.positionArray;var h=u.geometry.getIndex();h&&c.indicesArray&&(h.array=c.indicesArray);var v=new Ro(c.positionArray,c.indicesArray);v.offsetArray=c.offsetArray,v.rootNodePacked=c.rootNodePacked;var p=No(u,v);o.push(p)}}}else if(u instanceof d.Points&&u.geometry instanceof d.BufferGeometry){var l=u.geometry.getAttribute("position");if(l instanceof d.BufferAttribute){l.array=c.positionArray;var h=u.geometry.getIndex();h&&c.indicesArray&&(h.array=c.indicesArray);var v=new Lo(c.positionArray,c.indicesArray);v.offsetArray=c.offsetArray,v.rootNodePacked=c.rootNodePacked;var p=Qo(u,v);o.push(p)}}}return function(){for(var m=0,A=o;m<A.length;m++){var y=A[m];y()}o.length=0}}):Promise.resolve().then(function(){for(var a,o,s=[],u=0,c=i;u<c.length;u++){var l=c[u];if(l instanceof d.Mesh){if(l.geometry instanceof d.BufferGeometry){var h=l.geometry.getAttribute("position");if(h instanceof d.BufferAttribute){var v=h.array,p=(a=l.geometry.getIndex())===null||a===void 0?void 0:a.array,m=l.geometry.boundingBox,A=m?[m.min.x,m.min.y,m.min.z,m.max.x,m.max.y,m.max.z]:void 0,y=new Ro(v,p);y.createTree(e,r,A);var f=No(l,y);s.push(f)}}}else if(l instanceof d.Points&&l.geometry instanceof d.BufferGeometry){var h=l.geometry.getAttribute("position");if(h instanceof d.BufferAttribute){var v=h.array,p=(o=l.geometry.getIndex())===null||o===void 0?void 0:o.array,m=l.geometry.boundingBox,A=m?[m.min.x,m.min.y,m.min.z,m.max.x,m.max.y,m.max.z]:void 0,y=new Lo(v,p);y.createTree(e,r,A);var f=Qo(l,y);s.push(f)}}}return function(){for(var g=0,b=s;g<b.length;g++){var w=b[g];w()}s.length=0}})}var Nc=new d.Vector3,Qc=new d.Vector3,Dc=new d.Vector3,mu=function(n){oe(t,n);function t(e,r){var i=n.call(this)||this;return i.renderOrder=-4,i.disposers=[r],i.add(e),i}return t.prototype.generateBvhTree=function(){var e=this;return Vc(this,!0,200,10).then(function(r){e.disposers.push(r)})},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,v,p=0;if((l.object instanceof Gt||l.object instanceof Fr)&&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=(v=l.object.geometry.attributes.floor)===null||v===void 0?void 0:v.array;if(A&&y){var f=Nc.set(A[l.face.a*3],A[l.face.a*3+1],A[l.face.a*3+2]).applyMatrix4(a.matrixWorld),g=Qc.set(A[l.face.b*3],A[l.face.b*3+1],A[l.face.b*3+2]).applyMatrix4(a.matrixWorld),b=Dc.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),x=l.point.distanceTo(g),E=l.point.distanceTo(b);p=Math.round((w*y[l.face.a]+x*y[l.face.b]+E*y[l.face.c])/(w+x+E))}}else p=m.floor}l.floor=p}),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()}this.disposers.length=0},t}(d.Group);function xt(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(s!=null?s:"").trim()}).filter(function(s){return s.length>0&&!/^\/+$/.test(s)});for(var r=0;r<n.length;r++){var i=r===0,a=r===n.length-1,o=n[r];i||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),a||(o=o.replace(/\/+$/,"")),e.push(o)}return e.join("/")}function Ar(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function gu(n,t){if(n.content&&n.content.uri&&(Ar(n.content.uri)||(n.content.uri=xt(t,n.content.uri))),n.children)for(var e=0,r=n.children;e<r.length;e++){var i=r[e];gu(i,t)}return n}function Do(n,t){return n.asset.overview&&(Ar(n.asset.overview.imageFile)||(n.asset.overview.imageFile=xt(t,n.asset.overview.imageFile)),Ar(n.asset.overview.worldFile)||(n.asset.overview.worldFile=xt(t,n.asset.overview.worldFile))),gu(n.root,t),n}function yu(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 zi=4;function bu(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=zi,n.version=r.getUint32(e,!0),e+=zi,n.byteLength=r.getUint32(e,!0),e+=zi,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var er,je;(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"})(je||(je={}));var Uc=(er={},er[je.DOUBLE]=Float64Array,er[je.FLOAT]=Float32Array,er[je.UNSIGNED_SHORT]=Uint16Array,er[je.UNSIGNED_INT]=Uint32Array,er[je.UNSIGNED_BYTE]=Uint8Array,er[je.BYTE]=Int8Array,er[je.SHORT]=Int16Array,er[je.INT]=Int32Array,er),zc={DOUBLE:je.DOUBLE,FLOAT:je.FLOAT,UNSIGNED_SHORT:je.UNSIGNED_SHORT,UNSIGNED_INT:je.UNSIGNED_INT,UNSIGNED_BYTE:je.UNSIGNED_BYTE,BYTE:je.BYTE,SHORT:je.SHORT,INT:je.INT};function hi(n){var t=Uc[n];if(!t)throw new Error("Failed to convert GL type");return t}function Gi(n){var t=hi(n);return t.BYTES_PER_ELEMENT}function Uo(n,t,e,r){e===void 0&&(e=0);var i=hi(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!=null?r:(t.byteLength-e)/Gi(n))}function Gc(n){var t=zc[n];if(!t)throw new Error("Failed to convert GL type");return t}var wu=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",je.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=hi(e);return new a([i])}else if(Array.isArray(i)){var a=hi(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=Uo(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=Uo(e,r),i[t]=a),a},n}(),$r=4,zo="b3dm tile in legacy format.";function xu(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function Eu(n,t,e){return e=Hc(n,t,e),e=qc(n,t,e),e=Kc(n,t,e),e}function Hc(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=$r;var o=r.getUint32(e,!0);e+=$r;var s=r.getUint32(e,!0);e+=$r;var u=r.getUint32(e,!0);return e+=$r,s>=570425344?(e-=$r*2,i=a,s=o,u=0,a=0,o=0,console.warn(zo)):u>=570425344&&(e-=$r,i=s,s=a,u=o,a=0,o=0,console.warn(zo)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=u,n.header.batchLength=i,e}function qc(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=xu(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=[0,0,0];var u=new wu(n.featureTableJson,n.featureTableBinary);if(Array.isArray(u.json.RTC_CENTER)){var c=u.json.RTC_CENTER;n.rtcCenter[0]=c[0],n.rtcCenter[1]=c[1],n.rtcCenter[2]=c[2]}else{var c=u.getGlobalProperty("RTC_CENTER",je.FLOAT,3);c&&(n.rtcCenter[0]=c[0],n.rtcCenter[1]=c[1],n.rtcCenter[2]=c[2])}return e}function Kc(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=xu(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 jc(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 Wc(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=jc(t,e,r),n.byteLength}function Aa(n){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(n);for(var t="",e=0,r=n.length;e<r;e++)t+=String.fromCharCode(n[e]);try{return decodeURIComponent(escape(t))}catch(i){return t}}var Be={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},xn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},pi={9728:d.NearestFilter,9729:d.LinearFilter,9984:d.NearestMipmapNearestFilter,9985:d.LinearMipmapNearestFilter,9986:d.NearestMipmapLinearFilter,9987:d.LinearMipmapLinearFilter},vi={33071:d.ClampToEdgeWrapping,33648:d.MirroredRepeatWrapping,10497:d.RepeatWrapping},Go={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},It={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Mr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Xc={CUBICSPLINE:void 0,LINEAR:d.InterpolateLinear,STEP:d.InterpolateDiscrete},cr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function At(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){typeof t.dispose=="function"&&t.dispose(),typeof t.close=="function"&&t.close()}),this.disposeSet.clear(),delete this.cache,delete this.disposeSet,delete this.json,delete this.extensions,delete this.options},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.markDefs();for(var i=0,a=At(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(At(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(At(r).map(function(v){return v.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=At(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=At(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=[],v=[],p=[],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,x=c.parameters!==void 0?c.parameters[g.input]:g.input,E=c.parameters!==void 0?c.parameters[g.output]:g.output;l.push(this.loadNode(w)),h.push(this.loadAccessor(x)),v.push(this.loadAccessor(E)),p.push(g),m.push(b)}i=Promise.all([Promise.all(l),Promise.all(h),Promise.all(v),Promise.all(p),Promise.all(m)]).then(function(M){for(var C=M[0],S=M[1],P=M[2],I=M[3],B=M[4],L=[],k=function(H,z){var U=C[H],q=S[H],j=P[H],_=I[H],Z=B[H];if(U===void 0)return"continue";U.updateMatrix(),U.matrixAutoUpdate=!0;var W=void 0;switch(Mr[Z.path]){case Mr.weights:W=d.NumberKeyframeTrack;break;case Mr.rotation:W=d.QuaternionKeyframeTrack;break;case Mr.position:case Mr.scale:default:W=d.VectorKeyframeTrack;break}var Y=U.name?U.name:U.uuid,ce=_.interpolation!==void 0?Xc[_.interpolation]:d.InterpolateLinear,te=[];Mr[Z.path]===Mr.weights?U.traverse(function(fe){fe.morphTargetInfluences&&te.push(fe.name?fe.name:fe.uuid)}):te.push(Y);var se=j.array;if(j.normalized){for(var ue=Hi(se.constructor),pe=new Float32Array(se.length),he=0,de=se.length;he<de;he++)pe[he]=se[he]*ue;se=pe}for(var he=0,de=te.length;he<de;he++){var be=new W(te[he]+"."+Mr[Z.path],q.array,se,ce);L.push(be)}},O=0,N=C.length;O<N;O++)k(O);var D=c.name?c.name:"animation_"+t;return new d.AnimationClip(D,void 0,L)})}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=At(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=At(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=Go[o.type],h=xn[o.componentType],v=h.BYTES_PER_ELEMENT,p=v*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!==p){var b=Math.floor(m/A),w="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,x=e.cache.get(w);x||(f=new h(c,b*A,o.count*A/v),x=new d.InterleavedBuffer(f,A/v),e.cache.set(w,x)),g=new d.InterleavedBufferAttribute(x,l,m%A/v,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 E=Go.SCALAR,M=xn[o.sparse.indices.componentType],C=o.sparse.indices.byteOffset||0,S=o.sparse.values.byteOffset||0,P=new M(u[1],C,o.sparse.count*E),I=new h(u[2],S,o.sparse.count*l);c!==null&&(g=new d.BufferAttribute(g.array.slice(),g.itemSize,g.normalized));for(var B=0,L=P.length;B<L;B++){var k=P[B];if(g.setX(k,I[B*l]),l>=2&&g.setY(k,I[B*l+1]),l>=3&&g.setZ(k,I[B*l+2]),l>=4&&g.setW(k,I[B*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=At(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){for(var e=this,r=null,i=0,a=At(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new d.BufferGeometry,t)),r=r.then(function(s){return e.disposeSet.add(s),s}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,a=At(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadImage(t,this),r)break}if(!r){var s=this.json.images[t];if(s.bufferView!==void 0){var u=this.json.bufferViews[s.bufferView];r=this.loadBuffer(u.buffer).then(function(l){var h=u.byteOffset||0,v=u.byteLength||0,p=new Uint8Array(l,h,v),m=new Blob([p],{type:s.mimeType});return fa(m)})}else if(s.uri){var c=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(c,{},void 0,void 0,void 0,di()).then(function(l){return l.body})}else throw new Error("glTF: Invalid image defs.")}return r=r.then(function(l){return e.disposeSet.add(l),l}),r},n.prototype.loadMaterialAsMeshStandardMaterial=function(t){var e=this,r=[],i=new d.MeshStandardMaterial;if(i.color=new d.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(l){return It[l]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return It[l]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(l){return It[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||cr.OPAQUE;if(u===cr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===cr.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 It[u]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return It[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||cr.OPAQUE;s===cr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===cr.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 It[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return It[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||cr.OPAQUE;u===cr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===cr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterial=function(t){var e,r=(e=t.mode)!==null&&e!==void 0?e:Be.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,u=At(this.extensions);s<u.length;s++){var c=u[s];if(o=c.loadMaterial(t,this),o)break}if(r===Be.TRIANGLES||r===Be.TRIANGLE_STRIP||r===Be.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Be.LINES||r===Be.LINE_STRIP||r===Be.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Be.POINTS)o=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,o),o},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=At(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 v=e.json.samplers||{},p=v[c.sampler]||{};return h.magFilter=pi[p.magFilter]||d.LinearFilter,h.minFilter=pi[p.minFilter]||d.LinearMipmapLinearFilter,h.wrapS=vi[p.wrapS]||d.RepeatWrapping,h.wrapT=vi[p.wrapT]||d.RepeatWrapping,h.onUpdate=function(){l.close()},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=At(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 v=h[0],p=h[1],m=[],A=0;A<u.length;A++){var y=u[A],f=v[A],g=p[A],b=y.mode||Be.TRIANGLES,w=void 0;if(b===Be.TRIANGLES||b===Be.TRIANGLE_STRIP||b===Be.TRIANGLE_FAN)if(b===Be.TRIANGLE_STRIP?f=e.toGeometryTrianglesDrawMode(f,d.TriangleStripDrawMode):b===Be.TRIANGLE_FAN&&(f=e.toGeometryTrianglesDrawMode(f,d.TriangleFanDrawMode)),e.disposeSet.add(f),s.isSkinnedMesh){var x=new d.SkinnedMesh(f,g);f.attributes.skinWeight.normalized||x.normalizeSkinWeights(),w=x}else w=new d.Mesh(f,g);else if(b===Be.POINTS)w=new d.Points(f,g);else if(b===Be.LINES)w=new d.LineSegments(f,g);else if(b===Be.LINE_STRIP)w=new d.Line(f,g);else if(b===Be.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 E=0,M=s.weights.length;E<M;E++)w.morphTargetInfluences[E]=s.weights[E];if(s.extras&&Array.isArray(s.extras.targetNames)){var C=s.extras.targetNames;if(w.morphTargetInfluences.length===C.length){w.morphTargetDictionary={};for(var E=0,M=C.length;E<M;E++)w.morphTargetDictionary[C[E]]=E}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 S=new d.Group,P=0,I=m;P<I.length;P++){var w=I[P];S.add(w)}return S})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=At(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(v){if(a.weights!==void 0){var p=a.weights;v.traverse(function(m){if(m instanceof d.Mesh||m instanceof d.Line||m instanceof d.Points)for(var A=0,y=p.length;A<y;A++)m.morphTargetInfluences[A]=p[A]})}return v})),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(v){var p;if(a.isBone===!0?p=new d.Bone:v.length>1?p=new d.Group:v.length===1?p=v[0]:p=new d.Object3D,p!==v[0])for(var m=0,A=v.length;m<A;m++)p.add(v[m]);if(a.name&&(p.name=o),a.matrix!==void 0){var y=new d.Matrix4;y.fromArray(a.matrix),p.applyMatrix4(y)}else a.translation!==void 0&&p.position.fromArray(a.translation),a.rotation!==void 0&&p.quaternion.fromArray(a.rotation),a.scale!==void 0&&p.scale.fromArray(a.scale);return p})},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=At(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s,e.disposeSet.add(r))}return r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(x){var E=It[x]||x.toLowerCase();if(E in t.attributes)return"continue";a.push(s.loadAccessor(i[x]).then(function(M){M&&t.setAttribute(E,M)}))},s=this;for(var u in i)o(u);e.indices!==void 0&&!t.index&&a.push(this.loadAccessor(e.indices).then(function(x){x&&t.setIndex(x)}));var c=new d.Box3;if(i.POSITION!==void 0){var l=this.json.accessors[i.POSITION],h=l.min,v=l.max;if(h!==void 0&&v!==void 0){if(c.set(new d.Vector3(h[0],h[1],h[2]),new d.Vector3(v[0],v[1],v[2])),l.normalized){var p=Hi(xn[l.componentType]);c.min.multiplyScalar(p),c.max.multiplyScalar(p)}}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,v=l.max;if(h!==void 0&&v!==void 0){if(y.setX(Math.max(Math.abs(h[0]),Math.abs(v[0]))),y.setY(Math.max(Math.abs(h[1]),Math.abs(v[1]))),y.setZ(Math.max(Math.abs(h[2]),Math.abs(v[2]))),l.normalized){var p=Hi(xn[l.componentType]);y.multiplyScalar(p)}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 x=!1,E=!1,M=0,C=e.targets.length;M<C;M++){var S=e.targets[M];if(S.POSITION!==void 0&&(x=!0),S.NORMAL!==void 0&&(E=!0),x&&E)break}if(!x&&!E)return t;var P=[];t.morphTargetsRelative=!0;for(var I=function(B,L){var k=e.targets[B];x?P.push(r.loadAccessor(k.POSITION).then(function(O){O&&(t.morphAttributes.position[B]=O)})):t.morphAttributes.position[B]=t.attributes.position,E?P.push(r.loadAccessor(k.NORMAL).then(function(O){O&&(t.morphAttributes.normal[B]=O)})):t.morphAttributes.normal[B]=t.attributes.normal},M=0,C=e.targets.length;M<C;M++)I(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,v=s.length;h<v;h++){var p=s[h];if(p instanceof d.Bone){c.push(p);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 xt(this.options.resourcePath,yu(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),this.disposeSet.add(c),c},n}();function Hi(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 mr=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}(),Zc=function(n){oe(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 Aa(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=Aa(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}(mr),Yc="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",Ho={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},qo={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},Jc=function(){function n(){this.decoderPath=Yc,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||Ho,attributeTypes:i||qo,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:Ho,attributeTypes:qo,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,v){o._callbacks[s]={resolve:h,reject:v},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=un(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 */",Ko].join(`
418
- `);t.workerSourceURL=URL.createObjectURL(new Blob([o]))})}else{var r=un(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(o){return o.body}),i=un(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 */",Ko].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}(),Ai=new Jc,Ko=`
417
+ `,tu=[];function sc(){var n=tu.pop();return n||new d.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:ac,fragmentShader:oc,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:d.NoBlending,lights:!1,toneMapped:!1,fog:!1})}function uc(n){n.uniforms.map.value=null,tu.push(n)}function lc(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],l=sc();a.push(l),l.uniforms.map.value=u.texture,l.uniforms.flipY.value=u.flipY?1:0;var c=new d.Group,f=new d.Mesh(ic,l);f.position.set(u.position.x+u.size.x/2-.5,1-(u.position.y+u.size.y/2)-.5,-.5),f.scale.set(u.size.x,u.size.y,1),c.quaternion.copy(nc[u.face]),c.add(f),i.add(c)}var A=e.autoClear;e.autoClear=!1;var p=new d.CubeCamera(.1,2,t);p.matrixAutoUpdate=!1,p.update(e,r),e.autoClear=A;for(var y=0,v=a;y<v.length;y++){var l=v[y];uc(l)}}var cc=function(){return!1}();function ci(){var n=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onerror=n.onload=n.close=D,n.decoding="async";var t=n.src;n.removeAttribute("src"),/^blob\:/.test(t)&&URL.revokeObjectURL(t)}});return n}function ca(n){return new Promise(function(t,e){var r=ci();r.onload=function(){/^blob\:/.test(r.src)&&URL.revokeObjectURL(r.src),r.onload=r.onerror=D,setTimeout(function(){t(r)},10)},r.onerror=function(){var i=r.src;r.onload=r.onerror=D,r.close(),e(new Error("image load error: ".concat(i)))},r.src=URL.createObjectURL(n)})}var go=[];function dc(n,t){var e=go.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=D,go.push(r)}});return r}function yo(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=dc(Math.min(n.width,t.width),Math.min(n.height,t.height)),r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.drawImage(n,0,0,e.width,e.height),n.close();var i=new d.Texture(e);i.needsUpdate=!0,i.flipY=!0;var a=i.dispose;return i.dispose=function(){e.close(),a.call(i),i.dispose=a},i}else{var o=new d.Texture(n);o.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?o.flipY=!1:o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}}function fc(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 Qr=["right","left","up","down","front","back"],hc=4,Fe=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,s;if(t===null)throw new Error("cannot set cubeRenderTarget to null.");t.width!==this.options.textureSize&&t.setSize(this.options.textureSize,this.options.textureSize),t.texture.format=(e=this.options.format)!==null&&e!==void 0?e:d.RGBAFormat,t.texture.minFilter=(r=this.options.minFilter)!==null&&r!==void 0?r:d.LinearFilter,t.texture.magFilter=(i=this.options.magFilter)!==null&&i!==void 0?i:d.LinearFilter,t.texture.wrapS=(a=this.options.wrapS)!==null&&a!==void 0?a:d.ClampToEdgeWrapping,t.texture.wrapT=(o=this.options.wrapT)!==null&&o!==void 0?o:d.ClampToEdgeWrapping,t.texture.generateMipmaps=(s=this.options.generateMipmaps)!==null&&s!==void 0?s:!0,this.baseCubeTexture&&(la(this.baseCubeTexture,t,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&la(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,l=this.tileSources.filter(function(v){return v.level===t.level})[0];if(!l){this.loadedCubeNodes.add(t);return}var c=l.size,f=Math.pow(2,t.level)*t.position.y,A=Math.pow(2,t.level)*t.position.x,p="".concat(((a=(i=(r=this.options.imageURL)===null||r===void 0?void 0:r.options)===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:"pano.0").replace(/^pano/,"pano_tile"),".").concat(t.face,".").concat(t.level,".").concat(f,".").concat(A),y=k(k({},(s=(o=this.options.imageURL)===null||o===void 0?void 0:o.options)!==null&&s!==void 0?s:{key:"unknown"}),{key:p,size:c*t.size===this.options.tileImageSize?void 0:this.options.tileImageSize,quality:void 0,cut:[c*t.position.x,c*t.position.y,c*t.size,c*t.size]});this.loadingCubeNodes.add(t),this.options.textureLoader.loadTexture(l[t.face],{imageURL:{transform:(u=this.options.imageURL)===null||u===void 0?void 0:u.transform,options:k({},y)},format:d.RGBAFormat,timeout:this.options.timeout,magFilter:this.options.magFilter,minFilter:this.options.minFilter,fetcher:this.options.fetcher}).then(function(v){if(e.disposed){v.body.dispose();return}e.textures.push({face:t.face,level:t.level,position:t.position,size:new d.Vector2(t.size,t.size),texture:v.body,flipY:!v.body.flipY}),e.loadedCubeNodes.add(t)}).catch(D).then(function(){e.disposed||e.loadingCubeNodes.delete(t)})},n.prototype.update=function(t,e){var r=this;if(!this.disposed){var i=[];Va(this.tileTree,function(A){if(r.loadingCubeNodes.has(A)||A.level>e||!t.intersectsBox(A.box))return!1;if(!r.loadedCubeNodes.has(A))return i.push(A),!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,hc);lc(u,this.cubeRenderTarget,this.renderer),this.needsRender=!0;for(var l=0,c=u;l<c.length;l++){var f=c[l];f.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}(),Nn=function(){function n(){}return n.prototype.loadTexture=function(t,e,r,i,a,o){var s,u,l,c,f,A;r===void 0&&(r=D),i===void 0&&(i=D),a===void 0&&(a=D);var p={};typeof e.flipY!="undefined"&&(p.flipY=e.flipY),typeof e.format!="undefined"&&(p.format=e.format),typeof e.generateMipmaps!="undefined"&&(p.generateMipmaps=e.generateMipmaps),p.minFilter=(s=e.minFilter)!==null&&s!==void 0?s:d.LinearFilter,p.magFilter=(u=e.magFilter)!==null&&u!==void 0?u:d.LinearFilter;var y=(c=(l=e.imageURL)===null||l===void 0?void 0:l.options)!==null&&c!==void 0?c:{key:"unknown"};t=li(t,(f=e.imageURL)===null||f===void 0?void 0:f.transform,y);var v=Ao(t),m=(A=e.viaAjax)!==null&&A!==void 0?A:cc,h=vo(t),g=/^https?:/.test(v);if(h?m=!0:g||(m=!1),m){var b=null,w="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:w},void 0,void 0,a).then(function(x){return ca(x.body)}).then(function(x){return yo(x,e.maxSize)}).then(function(x){return Object.assign(x,p),x}).then(function(x){var M={meta:b,body:x};return r(M),M}).catch(function(x){return i(x),Promise.reject(x)})}else{var E=null,C;return Promise.resolve().then(function(){return ci()}).then(function(x){return C=x,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,a,x)}).then(function(x){return E=x.meta,yo(x.body,e.maxSize)}).then(function(x){return Object.assign(x,p),x}).then(function(x){var M={meta:E,body:x};return r(M),M}).catch(function(x){return C&&C.close(),i(x),Promise.reject(x)})}},n.prototype.loadCubeTexture=function(t,e,r,i,a,o){var s,u,l,c,f,A;r===void 0&&(r=D),i===void 0&&(i=D),a===void 0&&(a=D);var p={};typeof e.format!="undefined"&&(p.format=e.format),typeof e.generateMipmaps!="undefined"&&(p.generateMipmaps=e.generateMipmaps),p.minFilter=(s=e.minFilter)!==null&&s!==void 0?s:d.LinearFilter,p.magFilter=(u=e.magFilter)!==null&&u!==void 0?u:d.LinearFilter;for(var y=[t[Qr[0]],t[Qr[1]],t[Qr[2]],t[Qr[3]],t[Qr[4]],t[Qr[5]]],v=[],m=[0,0,0,0,0,0],h=[],g=function(w){var E=(c=(l=e.imageURL)===null||l===void 0?void 0:l.options)!==null&&c!==void 0?c:{key:"unknown"},C=li(y[w],(f=e.imageURL)===null||f===void 0?void 0:f.transform,k(k({},E),{key:E.key+"."+Qr[w]})),x=Ao(C),M=function(O){m[w]=O,a(m.reduce(function(Q,N){return Q+N},0)/6)},S=(A=e.viaAjax)!==null&&A!==void 0?A:!1,P=/^https?:$/.test(x),T=vo(C);if(T?S=!0:P||(S=!1),S){var B="blob",F=e.fetcher.ajax(C,{timeout:e.timeout,responseType:B},void 0,void 0,M).then(function(O){return h[w]=O.meta,ca(O.body)});v.push(F)}else{var L,F=Promise.resolve().then(function(){return ci()}).then(function(Q){return L=Q,e.fetcher.loadImage(C,{timeout:e.timeout},void 0,void 0,M,Q)}).then(function(Q){return h[w]=Q.meta,Q.body}).catch(function(Q){return L&&L.close(),Promise.reject(Q)});v.push(F)}},b=0;b<6;b++)g(b);return Promise.all(v).then(function(w){return fc(w)}).then(function(w){return Object.assign(w,k({encoding:d.sRGBEncoding},p)),w}).then(function(w){var E={body:w,meta:h};return r(E),E}).catch(function(w){for(var E=0,C=v;E<C.length;E++){var x=C[E];x.then(function(M){return M.close()}).catch(D)}return i(w),Promise.reject(w)})},n.prototype.loadTiledCubeTexture=function(t,e,r,i,a,o,s){var u=this;return i===void 0&&(i=D),a===void 0&&(a=D),o===void 0&&(o=D),new Promise(function(l,c){var f,A;u.loadCubeTexture(t,{imageURL:{transform:(f=r.imageURL)===null||f===void 0?void 0:f.transform,options:(A=r.imageURL)===null||A===void 0?void 0:A.options},format:d.RGBAFormat,viaAjax:r.viaAjax,timeout:r.timeout,fetcher:r.fetcher,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps},function(p){var y,v,m=p.meta,h=p.body,g=(y=r.tileImageSize)!==null&&y!==void 0?y:512,b=(v=r.tileMaxLevel)!==null&&v!==void 0?v:2,w=Math.max(1024*b,512),E=sa(b),C=new Fe(h,E,e,{textureSize:w,tileImageSize:g,textureLoader:u,imageURL:r.imageURL,magFilter:r.magFilter,minFilter:r.minFilter,generateMipmaps:r.generateMipmaps,timeout:r.timeout,fetcher:r.fetcher},s),x={meta:m,body:C};i(x),l(x)},function(p){a(p),c(p)},o,s).catch(D)})},n}();const pc=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"),vc=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\x07H{vs|z-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|Hn\bv{t-sy|n-V_||sZnxH0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvs0vs-qrsv{rq5b`Rl]N[\\lcVQR\\6--{vs|z-rp?-}n{|cvqr|lv rH--{vs|z-znA-}n{|cvqr|lznv\x07H--{vs|z-sy|n-}n{|cvqr|lny}unH--{vs|z-nz}yr?Q-}n{|cvqr|lzn}H0r{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-sy|n-Y|tQr}uHn\bv{t-znA-cvrZnv\x07Hp-Pyv}}r-\n--znA-znv\x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pnqH--\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--0ryvs-qrsv{rq5b`Rl`]_RNQla_N[`VaV\\[6----rp?-prr{Pr{rP||q-J-r|yv|{-7-}v\x07ry_nv|-<-?;=H----sy|n-n{vv|{_nqv-J-qvn{pr5rp?5=;=9-=;=69-prr{Pr{rP||q6-7->;?H----sy|n-n{vv|{]|tr-J--qvn{pr5tylSntP||q;\x07\b9-prr{Pr{rP||q6-<-n{vv|{_nqvH----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-z||ur}5=;=9-=;?9-}|tr-:-n{vv|{]|tr66H--0ryr----}n{|P|y|-J-zv\x075}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--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");function kt(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 Ac=1,mc=.1,gc=2e3,jn=Math.PI*2,bo=Math.PI/2;function wo(n){return n>0&&n<=jn?n:(n%jn+jn)%jn}function yc(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 Ei=function(n){le(t,n);function t(e,r,i,a,o,s,u){r===void 0&&(r=Ac),i===void 0&&(i=mc),a===void 0&&(a=gc),o===void 0&&(o=new d.Vector2),s===void 0&&(s=new d.Vector2(512,512)),u===void 0&&(u=1);var l=n.call(this)||this;l.fov=e,l.aspect=r,l.near=i,l.far=a,l.perspToOrtho=o,l.resolution=s,l.pixelRatio=u,l.needsRender=!0,l.refineModel=!0,l.pose={longitude:0,latitude:0,fov:e,distance:0,offset:new d.Vector3},l.computePose(),l.perspectiveCamera=new d.PerspectiveCamera(l.fov,l.aspect,.001,l.far);var c=Math.max(l.orthoDistance,.01)*Math.tan(.5*l.fov/180*Math.PI),f=-.5*l.aspect*2*c;return l.orthographicCamera=new d.OrthographicCamera(f,-f,c,-c,.001,l.far),l.computeProjectionMatrix(),l.lastValues={position:l.position.clone(),quaternion:l.quaternion.clone(),scale:l.scale.clone(),fov:l.fov,aspect:l.aspect,near:l.near,far:l.far,perspToOrtho:l.perspToOrtho.clone()},l.type=l.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",l}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 kt(this.pose,e)},t.prototype.computePose=function(e){e===void 0&&(e=0),this.updateMatrix();var r=this.matrix.elements,i=new d.Vector3().set(-r[8],-r[9],-r[10]).normalize();this.pose.longitude=wo(-Math.atan2(i.x,-i.z)),this.pose.latitude=-Math.asin(i.y/1),this.pose.fov=this.fov,this.pose.distance=e;var a=new d.Vector3().add(this.position).add(i.clone().setLength(this.pose.distance));return this.pose.offset.copy(a),this},t.prototype.setFromPose=function(e){var r,i,a,o,s,u=wo((r=e.longitude)!==null&&r!==void 0?r:this.pose.longitude),l=Math.max(-bo+1e-4,Math.min(bo-1e-4,(i=e.latitude)!==null&&i!==void 0?i:this.pose.latitude)),c=(a=e.fov)!==null&&a!==void 0?a:this.pose.fov,f=(o=e.distance)!==null&&o!==void 0?o:this.pose.distance,A=(s=e.offset)!==null&&s!==void 0?s:this.pose.offset,p=kt({longitude:u,latitude:l}).normalize();return this.position.set(0,0,0),this.lookAt(p),this.position.add(A).sub(p.clone().setLength(f)),this.fov!==c&&(this.fov=c,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=u,this.pose.latitude=l,this.pose.fov=c,this.pose.distance=f,this.pose.offset.copy(A),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(){yc(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(be(),0),this},t}(d.Camera),bc=new d.Vector4,kn=new d.WebGLCubeRenderTarget(1).texture;kn.name="EMPTY_TEXTURE";var wc=Object.assign({modelAlpha:new d.Uniform(0),progress:new d.Uniform(0),pano0_map:new d.Uniform(kn),pano0_luminanceMap:new d.Uniform(null),pano0_matrix:new d.Uniform(new d.Matrix4),pano1_map:new d.Uniform(kn),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),geometricError:new d.Uniform(0),pixelRatio:new d.Uniform(1),resolution:new d.Uniform(new d.Vector2(512,512)),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)),Qn=function(n){le(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,f,A,p,y,v,m,h,g,b,w,E,C,x=n.call(this,{vertexShader:pc,fragmentShader:vc,uniforms:d.UniformsUtils.clone(wc),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_SPREAD_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,M,S=null,P=null;return Object.defineProperties(x,{pano0:{get:function(){return S},set:function(T){if(S!==T){S=T,T===null?(this.uniforms.pano0_map.value=kn,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity()):(this.uniforms.pano0_map.value=T.map instanceof Fe?T.map.texture:T.map,this.uniforms.pano0_luminanceMap.value=T.luminanceMap instanceof Fe?T.luminanceMap.texture:T.luminanceMap,this.uniforms.pano0_matrix.value.copy(T.matrix));var B=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,F=this.defines.USE_LUMINANCE;F!==B&&(this.defines.USE_LUMINANCE=B,this.needsUpdate=!0)}}},pano1:{get:function(){return P},set:function(T){if(P!==T){P=T,T===null?(this.uniforms.pano1_map.value=kn,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity()):(this.uniforms.pano1_map.value=T.map instanceof Fe?T.map.texture:T.map,this.uniforms.pano1_luminanceMap.value=T.luminanceMap instanceof Fe?T.luminanceMap.texture:T.luminanceMap,this.uniforms.pano1_matrix.value.copy(T.matrix));var B=this.uniforms.pano0_luminanceMap.value!==null&&this.uniforms.pano1_luminanceMap.value!==null,F=this.defines.USE_LUMINANCE;F!==B&&(this.defines.USE_LUMINANCE=B,this.needsUpdate=!0)}}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(T){this.uniforms.modelAlpha.value=T}},progress:{get:function(){return this.uniforms.progress.value},set:function(T){this.uniforms.progress.value=T}},transition:{get:function(){return this.defines.USE_BLACK_TRANSITION?"BLACK":this.defines.USE_SPREAD_TRANSITION?"SPREAD":"FADE"},set:function(T){var B=this.defines.USE_BLACK_TRANSITION,F=this.defines.USE_SPREAD_TRANSITION;this.defines.USE_BLACK_TRANSITION=!1,this.defines.USE_SPREAD_TRANSITION=!1,this.defines["USE_".concat(T,"_TRANSITION")]=!0;var L=!1;B!==this.defines.USE_BLACK_TRANSITION&&(L=!0),F!==this.defines.USE_SPREAD_TRANSITION&&(L=!0),L&&(this.needsUpdate=!0)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(T){this.uniforms.constantColor.value=T;var B=this.defines.USE_CONSTANT_COLOR,F=T!==null;B!==F&&(this.defines.USE_CONSTANT_COLOR=F,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(T){this.uniforms.opacity.value=T}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(T){this.uniforms.shownFloorIndex.value=T}},clippers:{get:function(){return M},set:function(T){M!==T&&(M=T,this.uniforms.clippers.value=(M||[]).map(function(B){var F=typeof B.floorIndex=="number"?B.floorIndex:-1,L=new d.Matrix4().getInverse(B.clippingBoxMatrix);return{matrixInverse:L,floorIndex:F}}),this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(T){T!==this.defines.USE_EDL&&(this.defines.USE_EDL=T,this.needsUpdate=!0)}},useHQWeight:{get:function(){return this.defines.USE_HQ_WEIGHT},set:function(T){T!==this.defines.USE_HQ_WEIGHT&&(this.defines.USE_HQ_WEIGHT=T,this.needsUpdate=!0)}},useHQDepth:{get:function(){return this.defines.USE_HQ_DEPTH},set:function(T){T!==this.defines.USE_HQ_DEPTH&&(this.defines.USE_HQ_DEPTH=T,this.needsUpdate=!0)}},floor:{get:function(){return this.uniforms.floor.value},set:function(T){this.uniforms.floor.value=T}}}),x.pano0=(r=e.pano0)!==null&&r!==void 0?r:we.pano0,x.pano1=(i=e.pano1)!==null&&i!==void 0?i:we.pano1,x.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:we.modelAlpha,x.progress=(o=e.progress)!==null&&o!==void 0?o:we.progress,x.transition=(s=e.transition)!==null&&s!==void 0?s:we.transition,x.constantColor=(u=e.constantColor)!==null&&u!==void 0?u:we.constantColor,x.opacity=(l=e.opacity)!==null&&l!==void 0?l:we.opacity,x.shownFloorIndex=(c=e.shownFloorIndex)!==null&&c!==void 0?c:we.shownFloorIndex,x.clippers=(f=e.clippers)!==null&&f!==void 0?f:we.clippers,x.useEDL=(A=e.useEDL)!==null&&A!==void 0?A:we.useEDL,x.useHQWeight=(p=e.useHQWeight)!==null&&p!==void 0?p:we.useHQWeight,x.useHQDepth=(y=e.useHQDepth)!==null&&y!==void 0?y:we.useHQDepth,x.pointSize=(v=e.pointSize)!==null&&v!==void 0?v:we.pointSize,x.pointColor=(m=e.pointColor)!==null&&m!==void 0?m:we.pointColor,x.pointShape=(h=e.pointShape)!==null&&h!==void 0?h:we.pointShape,x.pointScale=(g=e.pointScale)!==null&&g!==void 0?g:we.pointScale,x.pointBack=(b=e.pointBack)!==null&&b!==void 0?b:we.pointBack,x.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:we.pointMinPixel,x.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:we.pointMaxPixel,x.gradientTexture=(C=e.gradientTexture)!==null&&C!==void 0?C:we.gradientTexture,x.floor=0,x}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;var i;if(this.uniforms.map.value&&(i=this.uniforms.map.value),i?(i.updateMatrix(),this.uniforms.uvTransform.value.copy(i.matrix)):this.uniforms.uvTransform.value.identity(),r instanceof Ei)this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution);else{this.uniforms.pixelRatio.value=e.getPixelRatio();var a=e.getViewport(bc);this.uniforms.resolution.value.set(a.z,a.w)}},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),Dr=function(n){le(t,n);function t(e){var r=e.preserveDrawingBuffer,i=r===void 0?!0:r,a=e.premultipliedAlpha,o=a===void 0?!0:a,s=e.stencil,u=s===void 0?!0:s,l=e.backgroundColor,c=l===void 0?1579548:l,f=e.backgroundAlpha,A=f===void 0?1:f,p=e.pixelRatio,y=p===void 0?1:p,v=e.antialias,m=e.webgl2,h=this,g={antialias:v,alpha:!0,preserveDrawingBuffer:i,stencil:u,premultipliedAlpha:o,powerPreference:"high-performance"};if(m){var b=document.createElement("canvas"),w=b.getContext("webgl2",g);w?h=n.call(this,k(k({},g),{antialias:!0,canvas:b,context:w}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),h=n.call(this,g)||this)}else h=n.call(this,g)||this;return h.setPixelRatio(y),h.setClearColor(c,A),h.outputEncoding=d.sRGBEncoding,h.autoClear=!0,h}return t}(d.WebGLRenderer),ru=function(n){le(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),ft;(function(n){n[n.Outside=-1]="Outside",n[n.Intersecting=0]="Intersecting",n[n.Inside=1]="Inside"})(ft||(ft={}));var nu=1e-6,Ve=new d.Vector3,Tr=new d.Matrix4,wr=new d.Vector3,Er=new d.Vector3,xr=new d.Vector3,da=new d.Vector3,Eo=new d.Box3,xo=new d.Sphere,Co=new d.Matrix4,Mo=new d.Ray,ct=new d.Object3D,So=new d.Frustum;function iu(n,t){var e=n.elements;return t.setFromRotationMatrix(Tr.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 In=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 Tr.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),So.setFromProjectionMatrix(Tr),this.setFromFrustum(So),this},n.prototype.applyMatrix4=function(t){for(var e=0,r=this.planes;e<r.length;e++){var i=r[e];i.applyMatrix4(t)}},n.prototype.copy=function(t){return this.planes=t.planes.map(function(e){return e.clone()}),this},n.prototype.clone=function(){return new n().copy(this)},n.prototype.computeVisibility=function(t){for(var e=ft.Inside,r=0,i=this.planes;r<i.length;r++){var a=i[r],o=t.intersectPlane(a);switch(o){case ft.Outside:return ft.Outside;case ft.Intersecting:e=ft.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===ft.Outside)return n.MASK_OUTSIDE;u===ft.Intersecting&&(r|=o)}}return r},n}(),au=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],l=e[9],c=e[10],f=e[11],A=Math.sqrt(r*r+i*i+a*a),p=Math.sqrt(o*o+s*s+u*u),y=Math.sqrt(l*l+c*c+f*f);this.halfSize.set(A,p,y);var v=this.halfSize.toArray().reduce(function(m,h){return m+h},0);return(isNaN(v)||v<=0)&&this.halfSize.setScalar(nu),this.rotation.fromArray([r/A,i/A,a/A,o/p,s/p,u/p,l/y,c/y,f/y]),isNaN(this.rotation.toArray().reduce(function(m,h){return m+h},0))&&this.rotation.identity(),this},n.prototype.toJson=function(){return this.rotation.extractBasis(wr,Er,xr),{box:pt(pt(pt(pt([],this.center.toArray(),!0),wr.multiplyScalar(this.halfSize.x).toArray(),!0),Er.multiplyScalar(this.halfSize.y).toArray(),!0),xr.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 ct.position.copy(this.center),iu(this.rotation,ct.quaternion),ct.scale.copy(this.halfSize),ct.matrix.compose(ct.position,ct.quaternion,ct.scale),ct.matrix.premultiply(t),ct.matrix.decompose(ct.position,ct.quaternion,ct.scale),this.center.copy(ct.position),this.rotation.setFromMatrix4(Tr.makeRotationFromQuaternion(ct.quaternion)),this.halfSize.copy(ct.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(wr,Er,xr),wr.setLength(this.halfSize.x),Er.setLength(this.halfSize.y),xr.setLength(this.halfSize.z),t.expandByPoint(Ve.copy(this.center).add(wr)),t.expandByPoint(Ve.copy(this.center).sub(wr)),t.expandByPoint(Ve.copy(this.center).add(Er)),t.expandByPoint(Ve.copy(this.center).sub(Er)),t.expandByPoint(Ve.copy(this.center).add(xr)),t.expandByPoint(Ve.copy(this.center).sub(xr)),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);Ve.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,0),Ve.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,3),Ve.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,6),Ve.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,9),Ve.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,12),Ve.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,15),Ve.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(e,18),Ve.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,l=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),c=r.dot(e)+t.constant;return c<=-l?ft.Outside:c>=l?ft.Inside:ft.Intersecting},n.prototype.intersectRay=function(t,e){da.copy(this.halfSize).multiplyScalar(2),Eo.setFromCenterAndSize(Ve.set(0,0,0),da),this.rotation.extractBasis(wr,Er,xr),Tr.makeBasis(wr,Er,xr),Tr.setPosition(this.center),Co.getInverse(Tr),Mo.copy(t).applyMatrix4(Co);var r=Mo.intersectBox(Eo,Ve);return r?e!==void 0?r.applyMatrix4(Tr).distanceTo(t.origin)<e:!0:!1},n}(),ou=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],nu),this},n.prototype.toJson=function(){return{sphere:pt(pt([],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,da.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?ft.Outside:a<r?ft.Intersecting:ft.Inside},n.prototype.intersectRay=function(t,e){xo.set(this.center,this.radius);var r=t.intersectSphere(xo,Ve);return r?e!==void 0?t.origin.distanceTo(r)<e:!0:!1},n}(),Ec=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 ti(n){if("box"in n)return new au().fromJson(n);if("sphere"in n)return new ou().fromJson(n);if("region"in n)return new Ec().fromJson(n);throw new Error("BoundingVolume ".concat(JSON.stringify(n)," never suppored."))}var Wn=[4821759,8191922,16637280,16739958,5822969,376977,16747077,9259235,14514687].map(function(n){return new d.LineBasicMaterial({color:n,depthWrite:!1,depthTest:!1,transparent:!0})}),xc=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);Ve.set(1,1,1).toArray(t,0),Ve.set(-1,1,1).toArray(t,3),Ve.set(-1,-1,1).toArray(t,6),Ve.set(1,-1,1).toArray(t,9),Ve.set(1,1,-1).toArray(t,12),Ve.set(-1,1,-1).toArray(t,15),Ve.set(-1,-1,-1).toArray(t,18),Ve.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}(),Cc=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 Mc(n,t){if(n instanceof au){var e=new d.LineSegments(xc,Wn[Math.min(t,Wn.length-1)]);return e.position.copy(n.center),iu(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 ou){var e=new d.LineSegments(Cc,Wn[Math.min(t,Wn.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 Qa=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?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=ti(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=ti(e.boundingVolume).applyMatrix4(this.transform)),e.viewerRequestVolume&&(this.viewerRequestVolume=ti(e.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=e.extras||{},e.children?this.children=e.children.map(function(l,c){return new n("".concat(a.id,".").concat(c),l,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:In.MASK_INDETERMINATE;this.state.visibilityPlaneMask=t.cullingVolume.computeVisibilityWithPlaneMask(r,i),this.state.visible=this.state.visibilityPlaneMask!==In.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.visibilityPlaneMask=In.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}(),fa=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}(),Sc=function(){function n(t,e,r){this.item=t,this.previous=e,this.next=r}return n}(),Ic=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 Sc(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}(),su=function(){function n(){this.cacheNodeMap=new Map,this.list=new Ic,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}(),Io=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}(),ha=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 Io,this._emptyTraversalStack=new Io,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(),o.camera.refine&&(this._canSelectTile=o.camera.visible,this.updateTile(t,o),this.executeTraversal(t,o))}this._traversalStack.reset(),this._emptyTraversalStack.reset(),e.camera.refine&&(this._canSelectTile=e.camera.visible,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,l=!a;i.hasRenderContent?i.refine==="ADD"?(this.loadTile(i,e.frameNumber),this.selectTile(i,e)):i.refine==="REPLACE"&&(this.loadTile(i,e.frameNumber),l&&this.selectTile(i,e)):(this.emptyTiles.set(i.id,i),this.loadTile(i,e.frameNumber),l&&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,l=i;u<l.length;u++){var c=l[u];if(c.state.visible&&c.state.inRequestVolume?(r.find(c)&&r.delete(c),r.push(c),o=!0):(a||this.loadSiblings)&&(this.loadTile(c,e.frameNumber),this.touchTile(c,e)),a){var f=void 0;c.state.inRequestVolume?c.hasRenderContent?f=c.contentAvailable:f=this.executeEmptyTraversal(c,e):f=!1,s=s&&f}}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,l=s;u<l.length;u++){var c=l[u];i.find(c)&&i.delete(c),i.push(c)}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}(),Tc=new d.Matrix4,ri=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 ha,this.cache=new su,this.requestScheduler=new fa,this.frameNumber=0,this.pendingCount=0,this.tiles=new Map,this.memoryUsageInBytes=0,this.root=new Qa("".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(Tc),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=ha.DEFAULT_MAX_SCREEN_SPACE_ERROR,n.DEFAULT_MAX_REQUESTS=fa.DEFAULT_MAX_REQUESTS,n}(),an=function(){function n(t,e,r,i,a){this.id=t,this.extents=e,this.startIndex=r,this.endIndex=i,this.deepth=a}return n}(),hr=6*4+4+4+2+2;function uu(n,t){for(var e=new ArrayBuffer(t*hr),r=new Float32Array(e),i=new Uint32Array(e),a=new Uint16Array(e),o=[n],s,u;s=o.pop();)u=s.id*hr/4,r[u]=s.extents[0],r[u+1]=s.extents[1],r[u+2]=s.extents[2],r[u+3]=s.extents[3],r[u+4]=s.extents[4],r[u+5]=s.extents[5],i[u+6]=s.startIndex,i[u+7]=s.endIndex,u=s.id*hr/2,s.node0&&(a[u+16]=s.node0.id,o.push(s.node0)),s.node1&&(a[u+17]=s.node1.id,o.push(s.node1));return e}function lu(n,t,e,r,i,a,o,s,u){u===void 0&&(u=0),e=e-u,r=r-u,i=i-u,a=a+u,o=o+u,s=s+u;var l={min:0,max:0};t.x>=0?(l.min=(e-n.x)*t.x,l.max=(a-n.x)*t.x):(l.min=(a-n.x)*t.x,l.max=(e-n.x)*t.x);var c={min:0,max:0};if(t.y>=0?(c.min=(r-n.y)*t.y,c.max=(o-n.y)*t.y):(c.min=(o-n.y)*t.y,c.max=(r-n.y)*t.y),l.min>c.max||c.min>l.max)return!1;c.min>l.min&&(l.min=c.min),c.max<l.max&&(l.max=c.max);var f={min:0,max:0};return t.z>=0?(f.min=(i-n.z)*t.z,f.max=(s-n.z)*t.z):(f.min=(s-n.z)*t.z,f.max=(i-n.z)*t.z),!(l.min>f.max||f.min>l.max||(f.min>l.min&&(l.min=f.min),f.max<l.max&&(l.max=f.max),l.max<0))}var cu=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}(),du=function(){function n(t,e,r){this.triangle=t,this.intersectionPoint=e,this.index=r}return n}(),To=1e-6,Po=function(){function n(t,e){if(this.positionArray=t,e)this.indicesArray=e;else{for(var r=t.length/3,i=r>65535?new Uint32Array(r):new Uint16Array(r),a=0;a<r;a++)i[a]=a;this.indicesArray=i}}return n.prototype.createTree=function(t,e,r){e=Math.min(e,16);var i=this.positionArray,a=this.indicesArray,o=a.length/3,s=o>65535?new Uint32Array(o):new Uint16Array(o),u=new Float32Array(o*6),l=[],c=0,f=-1;if(r)for(var A=0,p=0,y=0,v=void 0,m=void 0,h=void 0,g=void 0,b=void 0,w=void 0,E=void 0;A<o;A+=1,p+=3,y+=6)s[A]=A,v=g=i[a[p]*3],E=i[a[p+1]*3],E<v&&(v=E),E>g&&(g=E),E=i[a[p+2]*3],E<v&&(v=E),E>g&&(g=E),m=b=i[a[p]*3+1],E=i[a[p+1]*3+1],E<m&&(m=E),E>b&&(b=E),E=i[a[p+2]*3+1],E<m&&(m=E),E>b&&(b=E),h=w=i[a[p]*3+2],E=i[a[p+1]*3+2],E<h&&(h=E),E>w&&(w=E),E=i[a[p+2]*3+2],E<h&&(h=E),E>w&&(w=E),u[y]=v,u[y+1]=m,u[y+2]=h,u[y+3]=g,u[y+4]=b,u[y+5]=w;else{for(var C=1/0,x=1/0,M=1/0,S=-1/0,P=-1/0,T=-1/0,A=0,p=0,y=0,v=void 0,m=void 0,h=void 0,g=void 0,b=void 0,w=void 0,E=void 0;A<o;A+=1,p+=3,y+=6)s[A]=A,v=g=i[a[p]*3],E=i[a[p+1]*3],E<v&&(v=E),E>g&&(g=E),E=i[a[p+2]*3],E<v&&(v=E),E>g&&(g=E),m=b=i[a[p]*3+1],E=i[a[p+1]*3+1],E<m&&(m=E),E>b&&(b=E),E=i[a[p+2]*3+1],E<m&&(m=E),E>b&&(b=E),h=w=i[a[p]*3+2],E=i[a[p+1]*3+2],E<h&&(h=E),E>w&&(w=E),E=i[a[p+2]*3+2],E<h&&(h=E),E>w&&(w=E),u[y]=v,u[y+1]=m,u[y+2]=h,u[y+3]=g,u[y+4]=b,u[y+5]=w,v<C&&(C=v),g>S&&(S=g),m<x&&(x=m),b>P&&(P=b),h<M&&(M=h),w>T&&(T=w);r=[C,x,M,S,P,T]}var B=new an(++f,r,0,o,0);l[c++]=B;var F=[],L=[0,1,2],O=function(N,H){return F[H]-F[N]};function Q(N){var H=N.startIndex,K=N.endIndex,U=N.extents;F[0]=U[3]-U[0],F[1]=U[4]-U[1],F[2]=U[5]-U[2],L.sort(O);for(var G=0;G<3;G++){for(var X=L[G],Z=U[X]+U[X+3],q=H,W=K-1,J=-1,ve=void 0;q<=W;)J===-1?(ve=s[q],u[ve*6+X]+u[ve*6+X+3]<Z?q++:J=ve):(ve=s[W],u[ve*6+X]+u[ve*6+X+3]>=Z||(s[q]=ve,s[W]=J,J=-1,q++),W--);if(q>H&&q<K){var re=new an(++f,Bo(s,u,H,q,To),H,q,N.deepth+1);re.deepth<e&&re.endIndex-re.startIndex>t&&(l[c++]=re);var se=new an(++f,Bo(s,u,q,K,To),q,K,N.deepth+1);se.deepth<e&&se.endIndex-se.startIndex>t&&(l[c++]=se),N.node0=re,N.node1=se,N.startIndex=0,N.endIndex=0;break}}}for(;c;)Q(l[--c]);return this.offsetArray=s,this.rootNodePacked=uu(B,f+1),l.length=0,this},n.prototype.trianglesInSphere=function(t,e){for(var r=this.positionArray,i=this.indicesArray,a=this.offsetArray,o=this.rootNodePacked,s=new Float32Array(o),u=new Uint32Array(o),l=new Uint16Array(o),c=[0],f=[],A,p,y,v;(A=c.pop())!==void 0;){v=A*hr/4;var m=Ni(t.x,s[v],s[v+3])-t.x,h=Ni(t.y,s[v+1],s[v+4])-t.y,g=Ni(t.z,s[v+2],s[v+5])-t.z;if(m*m+h*h+g*g<=e*e){for(var b=u[v+6];b<u[v+7];b++)f.push(a[b]);v=A*hr/2,p=l[v+16],y=l[v+17],p&&c.push(p),y&&c.push(y)}}for(var w=f.length,E=new Float32Array(w*9),b=0;b<w;b++){var C=f[b];E[b*9]=r[i[C]*3],E[b*9+1]=r[i[C]*3+1],E[b*9+2]=r[i[C]*3+2],E[b*9+3]=r[i[C+1]*3],E[b*9+4]=r[i[C+1]*3+1],E[b*9+5]=r[i[C+1]*3+2],E[b*9+6]=r[i[C+2]*3],E[b*9+7]=r[i[C+2]*3+1],E[b*9+8]=r[i[C+2]*3+2]}return E},n.prototype.intersectRay=function(t,e,r){for(var i=this.positionArray,a=this.indicesArray,o=this.offsetArray,s=this.rootNodePacked,u=new Float32Array(s),l=new Uint32Array(s),c=new Uint16Array(s),f=new cu(1/e.x,1/e.y,1/e.z),A=[0],p,y,v,m;(p=A.pop())!==void 0;)if(m=p*hr/4,lu(t,f,u[m],u[m+1],u[m+2],u[m+3],u[m+4],u[m+5])){for(var h=l[m+6],g=l[m+7],b=void 0,w=void 0,E=void 0,C=t.x,x=t.y,M=t.z,S=e.x,P=e.y,T=e.z,B=void 0,F=void 0,L=void 0,O=void 0,Q=void 0,N=void 0,H=void 0,K=void 0,U=void 0,G=void 0,X=void 0,Z=void 0,q=void 0,W=void 0,J=void 0,ve=void 0,re=void 0,se=void 0,ie=void 0,pe=void 0,ne=void 0,de=void 0,ce=void 0,fe=void 0,$=void 0,te=void 0,j=void 0;h<g;h++){if(b=o[h],w=b*3,E=a[w]*3,B=i[E],F=i[++E],L=i[++E],E=a[w+1]*3,O=i[E],Q=i[++E],N=i[++E],E=a[w+2]*3,H=i[E],K=i[++E],U=i[++E],G=O-B,X=Q-F,Z=N-L,q=H-B,W=K-F,J=U-L,ve=X*J-Z*W,re=Z*q-G*J,se=G*W-X*q,ce=S*ve+P*re+T*se,ce>0)de=1;else if(ce<0)de=-1,ce=-ce;else continue;ie=C-B,pe=x-F,ne=M-L,fe=de*(S*(pe*J-ne*W)+P*(ne*q-ie*J)+T*(ie*W-pe*q)),!(fe<0)&&($=de*(S*(X*ne-Z*pe)+P*(Z*ie-G*ne)+T*(G*pe-X*ie)),!($<0)&&(fe+$>ce||(te=-de*(ie*ve+pe*re+ne*se),!(te<0)&&(j=te/ce,r.push(new du([B,F,L,O,Q,N,H,K,U],[C+S*j,x+P*j,M+T*j],b))))))}m=p*hr/2,y=c[m+16],v=c[m+17],y&&A.push(y),v&&A.push(v)}return r},n}();function Ni(n,t,e){return n<t?t:n>e?e:n}function Bo(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,l=-1/0,c=-1/0,f=e,A=void 0,p=void 0;f<r;f++)A=n[f]*6,p=t[A],p<a&&(a=p),p=t[A+1],p<o&&(o=p),p=t[A+2],p<s&&(s=p),p=t[A+3],p>u&&(u=p),p=t[A+4],p>l&&(l=p),p=t[A+5],p>c&&(c=p);return[a-i,o-i,s-i,u+i,l+i,c+i]}var Ro=1e-6,Fo=function(){function n(t,e){this.positionArray=t,this.indicesArray=e}return n.prototype.createTree=function(t,e,r){e=Math.min(e,16);var i=this.positionArray,a=this.indicesArray,o=a?a.length:i.length/3,s=o>65535?new Uint32Array(o):new Uint16Array(o),u=[],l=0,c=-1;if(r)for(var f=0;f<o;f+=1)s[f]=f;else{for(var A=a?a[0]*3:0,p=i[A],y=i[A+1],v=i[A+2],m=p,h=y,g=v,f=0,b=0,w=void 0,E=void 0,C=void 0;f<o;f+=1,b+=3)s[f]=f,A=(a?a[b]:b)*3,w=i[A],E=i[A+1],C=i[A+2],w<p?p=w:w>m&&(m=w),E<y?y=E:E>h&&(h=E),C<v?v=C:C>g&&(g=C);r=[p,y,v,m,h,g]}var x=new an(++c,r,0,o,0);u[l++]=x;var M=[],S=[0,1,2],P=function(B,F){return M[F]-M[B]};function T(B){var F=B.startIndex,L=B.endIndex,O=B.extents;M[0]=O[3]-O[0],M[1]=O[4]-O[1],M[2]=O[5]-O[2];for(var Q=S.sort(P)[0],N=(O[Q]+O[Q+3])/2,H=F,K=L-1,U=-1,G,X;H<=K;)U===-1?(G=s[H],X=(a?a[G]:G)*3,i[X+Q]<N?H++:U=G):(G=s[K],X=(a?a[G]:G)*3,i[X+Q]>=N||(s[H]=G,s[K]=U,U=-1,H++),K--);if(H>F){var Z=O.slice();Z[Q+3]=N+Ro;var q=new an(++c,Z,F,H,B.deepth+1);q.deepth<e&&q.endIndex-q.startIndex>t&&(u[l++]=q),B.node0=q}if(L>H){var W=O.slice();W[Q]=N-Ro;var J=new an(++c,W,H,L,B.deepth+1);J.deepth<e&&J.endIndex-J.startIndex>t&&(u[l++]=J),B.node1=J}B.startIndex=0,B.endIndex=0}for(;l;)T(u[--l]);return this.offsetArray=s,this.rootNodePacked=uu(x,c+1),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.rootNodePacked,l=new Float32Array(u),c=new Uint32Array(u),f=new Uint16Array(u),A=r*r,p=new cu(1/e.x,1/e.y,1/e.z),y=[0],v,m,h,g;(v=y.pop())!==void 0;)if(g=v*hr/4,lu(t,p,l[g],l[g+1],l[g+2],l[g+3],l[g+4],l[g+5],r)){for(var b=c[g+6],w=c[g+7],E=void 0,C=void 0,x=void 0,M=void 0,S=void 0,P=void 0,T=void 0,B=void 0,F=void 0,L=void 0,O=void 0,Q=void 0,N=void 0;b<w;b++)E=s[b],C=(o?o[E]:E)*3,x=a[C],M=a[++C],S=a[++C],P=t.x,T=t.y,B=t.z,F=e.x,L=e.y,O=e.z,Q=F*(x-P)+L*(M-T)+O*(S-B),Q>0&&(P+=F*Q,T+=L*Q,B+=O*Q),F=x-P,L=M-T,O=S-B,Q=F*F+L*L+O*O,Q<=A&&i.push(new du([x,M,S,x,M,S,x,M,S],[P,T,B],E));g=v*hr/2,m=f[g+16],h=f[g+17],m&&y.push(m),h&&y.push(h)}return i},n}();const fu="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBYPWZ1bmN0aW9uKCl7ZnVuY3Rpb24gaChyLHQsYSxvLHMpe3RoaXMuaWQ9cix0aGlzLmV4dGVudHM9dCx0aGlzLnN0YXJ0SW5kZXg9YSx0aGlzLmVuZEluZGV4PW8sdGhpcy5kZWVwdGg9c31yZXR1cm4gaH0oKSxSPTYqNCs0KzQrMisyO2Z1bmN0aW9uIG5yKGgscil7Zm9yKHZhciB0PW5ldyBBcnJheUJ1ZmZlcihyKlIpLGE9bmV3IEZsb2F0MzJBcnJheSh0KSxvPW5ldyBVaW50MzJBcnJheSh0KSxzPW5ldyBVaW50MTZBcnJheSh0KSxlPVtoXSx2LG47dj1lLnBvcCgpOyluPXYuaWQqUi80LGFbbl09di5leHRlbnRzWzBdLGFbbisxXT12LmV4dGVudHNbMV0sYVtuKzJdPXYuZXh0ZW50c1syXSxhW24rM109di5leHRlbnRzWzNdLGFbbis0XT12LmV4dGVudHNbNF0sYVtuKzVdPXYuZXh0ZW50c1s1XSxvW24rNl09di5zdGFydEluZGV4LG9bbis3XT12LmVuZEluZGV4LG49di5pZCpSLzIsdi5ub2RlMCYmKHNbbisxNl09di5ub2RlMC5pZCxlLnB1c2godi5ub2RlMCkpLHYubm9kZTEmJihzW24rMTddPXYubm9kZTEuaWQsZS5wdXNoKHYubm9kZTEpKTtyZXR1cm4gdH1mdW5jdGlvbiBhcihoLHIsdCxhLG8scyxlLHYsbil7bj09PXZvaWQgMCYmKG49MCksdD10LW4sYT1hLW4sbz1vLW4scz1zK24sZT1lK24sdj12K247dmFyIHk9e21pbjowLG1heDowfTtyLng+PTA/KHkubWluPSh0LWgueCkqci54LHkubWF4PShzLWgueCkqci54KTooeS5taW49KHMtaC54KSpyLngseS5tYXg9KHQtaC54KSpyLngpO3ZhciBBPXttaW46MCxtYXg6MH07aWYoci55Pj0wPyhBLm1pbj0oYS1oLnkpKnIueSxBLm1heD0oZS1oLnkpKnIueSk6KEEubWluPShlLWgueSkqci55LEEubWF4PShhLWgueSkqci55KSx5Lm1pbj5BLm1heHx8QS5taW4+eS5tYXgpcmV0dXJuITE7QS5taW4+eS5taW4mJih5Lm1pbj1BLm1pbiksQS5tYXg8eS5tYXgmJih5Lm1heD1BLm1heCk7dmFyIHc9e21pbjowLG1heDowfTtyZXR1cm4gci56Pj0wPyh3Lm1pbj0oby1oLnopKnIueix3Lm1heD0odi1oLnopKnIueik6KHcubWluPSh2LWgueikqci56LHcubWF4PShvLWgueikqci56KSwhKHkubWluPncubWF4fHx3Lm1pbj55Lm1heHx8KHcubWluPnkubWluJiYoeS5taW49dy5taW4pLHcubWF4PHkubWF4JiYoeS5tYXg9dy5t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rpb24odCl7cmV0dXJuIHBvc3RNZXNzYWdlKHskJGVycm9yOnR9KX0pfX1BcihmdW5jdGlvbihoKXtyZXR1cm4gUHJvbWlzZS5yZXNvbHZlKGgpLnRoZW4oZnVuY3Rpb24ocil7Zm9yKHZhciB0PVtdLGE9W10sbz0wLHM9cjtvPHMubGVuZ3RoO28rKyl7dmFyIGU9c1tvXSx2PXZvaWQgMDtpZihlLnR5cGU9PT0ibWVzaCIpdj1uZXcgeXIoZS5wb3NpdGlvbkFycmF5LGUuaW5kaWNlc0FycmF5KTtlbHNlIGlmKGUudHlwZT09PSJwb2ludHMiKXY9bmV3IGZyKGUucG9zaXRpb25BcnJheSxlLmluZGljZXNBcnJheSk7ZWxzZSB0aHJvdyBuZXcgRXJyb3IoIkludmFsaWQgVHlwZSIpO3YuY3JlYXRlVHJlZShlLm1heEl0ZW1QZXJOb2RlLGUubWF4VHJlZURlcHRoLGUuZXh0ZW50cyk7dmFyIG49e29mZnNldEFycmF5OnYub2Zmc2V0QXJyYXksaW5kaWNlc0FycmF5OnYuaW5kaWNlc0FycmF5LHBvc2l0aW9uQXJyYXk6di5wb3NpdGlvbkFycmF5LHJvb3ROb2RlUGFja2VkOnYucm9vdE5vZGVQYWNrZWR9O3QucHVzaChuKTtmb3IodmFyIHkgaW4gbil7dmFyIEE9blt5XTtBJiYoQSBpbnN0YW5jZW9mIEFycmF5QnVmZmVyP2EuaW5kZXhPZihBKT09PS0xJiZhLnB1c2goQSk6QS5idWZmZXIgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlciYmYS5pbmRleE9mKEEuYnVmZmVyKT09LTEmJmEucHVzaChBLmJ1ZmZlcikpfX1yZXR1cm57b3V0cHV0OnQsdHJhbnNmZXI6YX19KX0pfSkoKTsK",ko=typeof window!="undefined"&&window.Blob&&new Blob([atob(fu)],{type:"text/javascript;charset=utf-8"});function Pc(n){let t;try{if(t=ko&&(window.URL||window.webkitURL).createObjectURL(ko),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:application/javascript;base64,"+fu,{name:n==null?void 0:n.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var hu=function(){function n(t,e){this.pool=e,this.workerCreator=t,this.queue=[],this.workers=[],this.workersResolver=[],this.workerStatus=0}return n.prototype.initWorker=function(t){if(this.workerCreator&&!this.workers[t]){var e=this.workerCreator();e.addEventListener("message",this.onMessage.bind(this,t)),this.workers[t]=e}},n.prototype.getIdleWorker=function(){for(var t=0;t<this.pool;t++)if(!(this.workerStatus&1<<t))return t;return-1},n.prototype.onMessage=function(t,e){var r=this.workersResolver[t],i=r.resolve,a=r.reject;if(e.data&&"$$error"in e.data?a(e.data.$$error):i(e.data),this.queue.length){var o=this.queue.shift(),s=o.resolve,u=o.reject,l=o.input,c=o.transfer;this.workersResolver[t]={resolve:s,reject:u},this.workers[t].postMessage(l,c)}else this.workerStatus^=1<<t},n.prototype.postMessage=function(t,e){var r=this;return e===void 0&&(e=[]),new Promise(function(i,a){var o=r.getIdleWorker();o!==-1?(r.initWorker(o),r.workerStatus|=1<<o,r.workersResolver[o]={resolve:i,reject:a},r.workers[o].postMessage(t,e)):r.queue.push({resolve:i,reject:a,input:t,transfer:e})})},n.prototype.dispose=function(){this.workers.forEach(function(t){return t.terminate()}),this.workersResolver.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0},n}(),Bc=new hu(function(){return new Pc},4),ni=new Map,Qi=new Map,on=new d.Ray,Lo=new d.Matrix3,Tn=new d.Matrix4,pu=new d.Vector3,Rc=new d.Vector3,Fc=new d.Vector3,kc=new d.Triangle;function Lc(n,t,e,r){var i,a=n.matrixWorld;Tn.getInverse(a),on.copy(e.ray).applyMatrix4(Tn);for(var o=t.intersectRay(on.origin,on.direction,[]),s=n.geometry,u=n.material,l=s.groups,c=s.index,f=0,A=o.length;f<A;f++){var p=o[f],y=p.triangle,v=p.index,m=p.intersectionPoint,h=new d.Vector3(m[0],m[1],m[2]).applyMatrix4(a),g=e.ray.origin.distanceTo(h);if(!(g<e.near||g>e.far)){var b=void 0;if(Array.isArray(u)){if(l)for(var w=v*3,E=0,C=l;E<C.length;E++){var x=C[E];if(w>=x.start&&w-x.start<x.count){b=u[(i=x.materialIndex)!==null&&i!==void 0?i:0];break}}}else b=u;if(b){var M=kc.set(pu.set(y[0],y[1],y[2]).applyMatrix4(a),Rc.set(y[3],y[4],y[5]).applyMatrix4(a),Fc.set(y[6],y[7],y[8]).applyMatrix4(a)).getNormal(new d.Vector3),S=v*3,P=new d.Face3(c?c.array[S]:S,c?c.array[S+1]:S+1,c?c.array[S+2]:S+2,M),T=e.ray.direction.dot(M);b.side===d.FrontSide&&T>=0||b.side===d.BackSide&&T<=0||r.push({distance:g,object:n,face:P,point:h,distanceToRay:0,faceIndex:v})}}}}function Oc(n,t,e,r){var i,a,o=n.matrixWorld;Lo.getNormalMatrix(o),Tn.getInverse(o);var s=((a=(i=e.params.Points)===null||i===void 0?void 0:i.threshold)!==null&&a!==void 0?a:1)*Tn.getMaxScaleOnAxis();on.copy(e.ray).applyMatrix4(Tn);for(var u=t.intersectRay(on.origin,on.direction,s,[]),l=n.geometry,c=l.index,f=l.getAttribute("normal"),A=0,p=u.length;A<p;A++){var y=u[A],v=y.triangle,m=y.index,h=y.intersectionPoint,g=new d.Vector3(h[0],h[1],h[2]).applyMatrix4(o),b=e.ray.origin.distanceTo(g);if(!(b<e.near||b>e.far)){var w=pu.set(v[0],v[1],v[2]).applyMatrix4(o),E=c?c.array[m]:m,C=void 0;f instanceof d.BufferAttribute&&(C=new d.Vector3().fromBufferAttribute(f,E).applyNormalMatrix(Lo));var x=new d.Face3(E,E,E,C);r.push({distance:b,object:n,face:x,point:g,distanceToRay:g.distanceTo(w),index:m})}}}function Oo(n,t){var e=n.raycast,r=function(i,a){var o=ni.get(this);o?Lc(this,o,i,a):e.call(this,i,a)};return n.raycast=r,ni.set(n,t),function(){ni.delete(n),n.raycast===r&&(n.raycast=e)}}function Vo(n,t){var e=n.raycast,r=function(i,a){var o=Qi.get(this);o?Oc(this,o,i,a):e.call(this,i,a)};return n.raycast=r,Qi.set(n,t),function(){Qi.delete(n),n.raycast===r&&(n.raycast=e)}}function Vc(n,t,e,r){t===void 0&&(t=!0),e===void 0&&(e=100),r===void 0&&(r=10);var i=[];return n.traverse(function(a){if((a instanceof d.Mesh||a instanceof d.Points)&&a.geometry instanceof d.BufferGeometry){var o=a.geometry.getAttribute("position");o instanceof d.BufferAttribute&&i.push(a)}}),t?Promise.resolve().then(function(){for(var a,o,s=[],u=[],l=0;l<i.length;l++){var c=i[l];if(c instanceof d.Mesh){if(c.geometry instanceof d.BufferGeometry){var f=c.geometry.getAttribute("position");if(f instanceof d.BufferAttribute){var A=f.array,p=(a=c.geometry.getIndex())===null||a===void 0?void 0:a.array,y=c.geometry.boundingBox,v=y?[y.min.x,y.min.y,y.min.z,y.max.x,y.max.y,y.max.z]:void 0,m={type:"mesh",positionArray:A,indicesArray:p,maxItemPerNode:e,maxTreeDepth:r,extents:v};s.push(m);for(var h in m){var g=m[h];g&&(g instanceof ArrayBuffer?u.indexOf(g)===-1&&u.push(g):g.buffer instanceof ArrayBuffer&&u.indexOf(g.buffer)===-1&&u.push(g.buffer))}}}}else if(c instanceof d.Points&&c.geometry instanceof d.BufferGeometry){var f=c.geometry.getAttribute("position");if(f instanceof d.BufferAttribute){var A=f.array,p=(o=c.geometry.getIndex())===null||o===void 0?void 0:o.array,y=c.geometry.boundingBox,v=y?[y.min.x,y.min.y,y.min.z,y.max.x,y.max.y,y.max.z]:void 0,m={type:"points",positionArray:A,indicesArray:p,maxItemPerNode:e,maxTreeDepth:r,extents:v};s.push(m);for(var b in m){var g=m[b];g&&(g instanceof ArrayBuffer?u.indexOf(g)===-1&&u.push(g):g.buffer instanceof ArrayBuffer&&u.indexOf(g.buffer)===-1&&u.push(g.buffer))}}}}return Bc.postMessage(s,u)}).then(function(a){for(var o=[],s=0;s<i.length;s++){var u=i[s],l=a[s];if(u instanceof d.Mesh){if(u.geometry instanceof d.BufferGeometry){var c=u.geometry.getAttribute("position");if(c instanceof d.BufferAttribute){c.array=l.positionArray;var f=u.geometry.getIndex();f&&l.indicesArray&&(f.array=l.indicesArray);var A=new Po(l.positionArray,l.indicesArray);A.offsetArray=l.offsetArray,A.rootNodePacked=l.rootNodePacked;var p=Oo(u,A);o.push(p)}}}else if(u instanceof d.Points&&u.geometry instanceof d.BufferGeometry){var c=u.geometry.getAttribute("position");if(c instanceof d.BufferAttribute){c.array=l.positionArray;var f=u.geometry.getIndex();f&&l.indicesArray&&(f.array=l.indicesArray);var A=new Fo(l.positionArray,l.indicesArray);A.offsetArray=l.offsetArray,A.rootNodePacked=l.rootNodePacked;var p=Vo(u,A);o.push(p)}}}return function(){for(var y=0,v=o;y<v.length;y++){var m=v[y];m()}o.length=0}}):Promise.resolve().then(function(){for(var a,o,s=[],u=0,l=i;u<l.length;u++){var c=l[u];if(c instanceof d.Mesh){if(c.geometry instanceof d.BufferGeometry){var f=c.geometry.getAttribute("position");if(f instanceof d.BufferAttribute){var A=f.array,p=(a=c.geometry.getIndex())===null||a===void 0?void 0:a.array,y=c.geometry.boundingBox,v=y?[y.min.x,y.min.y,y.min.z,y.max.x,y.max.y,y.max.z]:void 0,m=new Po(A,p);m.createTree(e,r,v);var h=Oo(c,m);s.push(h)}}}else if(c instanceof d.Points&&c.geometry instanceof d.BufferGeometry){var f=c.geometry.getAttribute("position");if(f instanceof d.BufferAttribute){var A=f.array,p=(o=c.geometry.getIndex())===null||o===void 0?void 0:o.array,y=c.geometry.boundingBox,v=y?[y.min.x,y.min.y,y.min.z,y.max.x,y.max.y,y.max.z]:void 0,m=new Fo(A,p);m.createTree(e,r,v);var h=Vo(c,m);s.push(h)}}}return function(){for(var g=0,b=s;g<b.length;g++){var w=b[g];w()}s.length=0}})}var Nc=new d.Vector3,Qc=new d.Vector3,Dc=new d.Vector3,vu=function(n){le(t,n);function t(e,r){var i=n.call(this)||this;return i.renderOrder=-4,i.disposers=[r],i.add(e),i}return t.prototype.generateBvhTree=function(){var e=this;return Vc(this,!0,200,10).then(function(r){e.disposers.push(r)})},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,l=s.children.length;u<l;u++)o.push(s.children[u])}return i.forEach(function(c){var f,A,p=0;if((c.object instanceof Mt||c.object instanceof vr)&&c.face){var y=Array.isArray(c.object.material)?c.object.material[c.face.materialIndex]:c.object.material;if(y)if(y.defines.USE_VERTEX_FLOOR){var v=(f=c.object.geometry.attributes.position)===null||f===void 0?void 0:f.array,m=(A=c.object.geometry.attributes.floor)===null||A===void 0?void 0:A.array;if(v&&m){var h=Nc.set(v[c.face.a*3],v[c.face.a*3+1],v[c.face.a*3+2]).applyMatrix4(a.matrixWorld),g=Qc.set(v[c.face.b*3],v[c.face.b*3+1],v[c.face.b*3+2]).applyMatrix4(a.matrixWorld),b=Dc.set(v[c.face.c*3],v[c.face.c*3+1],v[c.face.c*3+2]).applyMatrix4(a.matrixWorld),w=c.point.distanceTo(h),E=c.point.distanceTo(g),C=c.point.distanceTo(b);p=Math.round((w*m[c.face.a]+E*m[c.face.b]+C*m[c.face.c])/(w+E+C))}}else p=y.floor}c.floor=p}),r&&i.sort(function(c,f){return c.distance-f.distance}),i},t.prototype.dispose=function(){for(var e=0,r=this.disposers;e<r.length;e++){var i=r[e];i()}this.disposers.length=0},t}(d.Group);function bt(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(s){return(s!=null?s:"").trim()}).filter(function(s){return s.length>0&&!/^\/+$/.test(s)});for(var r=0;r<n.length;r++){var i=r===0,a=r===n.length-1,o=n[r];i||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),a||(o=o.replace(/\/+$/,"")),e.push(o)}return e.join("/")}function Ar(n){return n.indexOf("//")===0||/^[0-9a-z]+\:/i.test(n)}function Au(n,t){if(n.content&&n.content.uri&&(Ar(n.content.uri)||(n.content.uri=bt(t,n.content.uri))),n.children)for(var e=0,r=n.children;e<r.length;e++){var i=r[e];Au(i,t)}return n}function No(n,t){return n.asset.overview&&(Ar(n.asset.overview.imageFile)||(n.asset.overview.imageFile=bt(t,n.asset.overview.imageFile)),Ar(n.asset.overview.worldFile)||(n.asset.overview.worldFile=bt(t,n.asset.overview.worldFile))),Au(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 Di=4;function gu(n,t,e){var r=new DataView(t);if(n.magic=r.getUint32(e,!0),e+=Di,n.version=r.getUint32(e,!0),e+=Di,n.byteLength=r.getUint32(e,!0),e+=Di,n.version!==1)throw new Error("3D Tile Version ".concat(n.version," not supported"));return e}var $t,_e;(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"})(_e||(_e={}));var Uc=($t={},$t[_e.DOUBLE]=Float64Array,$t[_e.FLOAT]=Float32Array,$t[_e.UNSIGNED_SHORT]=Uint16Array,$t[_e.UNSIGNED_INT]=Uint32Array,$t[_e.UNSIGNED_BYTE]=Uint8Array,$t[_e.BYTE]=Int8Array,$t[_e.SHORT]=Int16Array,$t[_e.INT]=Int32Array,$t),zc={DOUBLE:_e.DOUBLE,FLOAT:_e.FLOAT,UNSIGNED_SHORT:_e.UNSIGNED_SHORT,UNSIGNED_INT:_e.UNSIGNED_INT,UNSIGNED_BYTE:_e.UNSIGNED_BYTE,BYTE:_e.BYTE,SHORT:_e.SHORT,INT:_e.INT};function di(n){var t=Uc[n];if(!t)throw new Error("Failed to convert GL type");return t}function Ui(n){var t=di(n);return t.BYTES_PER_ELEMENT}function Qo(n,t,e,r){e===void 0&&(e=0);var i=di(n);if(e%Ui(n)!==0){var a=r?t.slice(e,e+r*Ui(n)):t.slice(e);return new i(a)}else return new i(t,e,r!=null?r:(t.byteLength-e)/Ui(n))}function Gc(n){var t=zc[n];if(!t)throw new Error("Failed to convert GL type");return t}var yu=function(){function n(t,e){this.featuresLength=0,this.cachedTypedArrays={},this.json=t,this.buffer=e;var r=this.getGlobalProperty("POINTS_LENGTH",_e.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=di(e);return new a([i])}else if(Array.isArray(i)){var a=di(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=Qo(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=Qo(e,r),i[t]=a),a},n}(),_r=4,Do="b3dm tile in legacy format.";function bu(n,t,e){var r=new TextDecoder("utf8"),i=new Uint8Array(n,t,e),a=r.decode(i);return a}function wu(n,t,e){return e=Hc(n,t,e),e=Kc(n,t,e),e=qc(n,t,e),e}function Hc(n,t,e){var r=new DataView(t),i=0;n.header=n.header||{};var a=r.getUint32(e,!0);e+=_r;var o=r.getUint32(e,!0);e+=_r;var s=r.getUint32(e,!0);e+=_r;var u=r.getUint32(e,!0);return e+=_r,s>=570425344?(e-=_r*2,i=a,s=o,u=0,a=0,o=0,console.warn(Do)):u>=570425344&&(e-=_r,i=s,s=a,u=o,a=0,o=0,console.warn(Do)),n.header.featureTableJsonByteLength=a,n.header.featureTableBinaryByteLength=o,n.header.batchTableJsonByteLength=s,n.header.batchTableBinaryByteLength=u,n.header.batchLength=i,e}function Kc(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=bu(t,e,i);n.featureTableJson=JSON.parse(s)}e+=i||0,n.featureTableBinary=new Uint8Array(t,e,a),e+=a||0,n.rtcCenter=[0,0,0];var u=new yu(n.featureTableJson,n.featureTableBinary);if(Array.isArray(u.json.RTC_CENTER)){var l=u.json.RTC_CENTER;n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2]}else{var l=u.getGlobalProperty("RTC_CENTER",_e.FLOAT,3);l&&(n.rtcCenter[0]=l[0],n.rtcCenter[1]=l[1],n.rtcCenter[2]=l[2])}return e}function qc(n,t,e){var r=n.header||{},i=r.batchTableJsonByteLength,a=r.batchTableBinaryByteLength;if(i&&i>0){var o=bu(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 jc(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 Wc(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=jc(t,e,r),n.byteLength}function pa(n){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(n);for(var t="",e=0,r=n.length;e<r;e++)t+=String.fromCharCode(n[e]);try{return decodeURIComponent(escape(t))}catch(i){return t}}var 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},yn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},fi={9728:d.NearestFilter,9729:d.LinearFilter,9984:d.NearestMipmapNearestFilter,9985:d.LinearMipmapNearestFilter,9986:d.NearestMipmapLinearFilter,9987:d.LinearMipmapLinearFilter},hi={33071:d.ClampToEdgeWrapping,33648:d.MirroredRepeatWrapping,10497:d.RepeatWrapping},Uo={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ct={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Cr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Xc={CUBICSPLINE:void 0,LINEAR:d.InterpolateLinear,STEP:d.InterpolateDiscrete},cr={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function dt(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){typeof t.dispose=="function"&&t.dispose(),typeof t.close=="function"&&t.close()}),this.disposeSet.clear(),delete this.cache,delete this.disposeSet,delete this.json,delete this.extensions,delete this.options},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 l=0,c=t.length;l<c;l++){var f=t[l];f.mesh!==void 0&&f.skin!==void 0&&(r[f.mesh].isSkinnedMesh=!0)}},n.prototype.parse=function(){var t=this,e=this.json,r=this.extensions;this.markDefs();for(var i=0,a=dt(r);i<a.length;i++){var o=a[i];o.markDefs(this)}return Promise.all(dt(r).map(function(s){return s.prepare(t)})).then(function(){var s,u,l;return Promise.all([Promise.all(((s=e.scenes)!==null&&s!==void 0?s:[]).map(function(c,f){return t.loadScene(f)})),Promise.all(((u=e.animations)!==null&&u!==void 0?u:[]).map(function(c,f){return t.loadAnimation(f)})),Promise.all(((l=e.cameras)!==null&&l!==void 0?l:[]).map(function(c,f){return t.loadCamera(f)}))])}).then(function(s){var u=s[0],l=s[1],c=s[2],f={json:t.json,scene:u[e.scene||0],scenes:u,animations:l,cameras:c,dispose:function(){return t.dispose()}};return Promise.all(dt(r).map(function(A){return A.emitResult(f,t)})).then(function(){return f})})},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=dt(this.extensions);a<o.length;a++){var s=o[a];if(i=s.loadCamera(t,this),i)break}if(!i){var u=void 0,l=this.json.cameras[t],c=l[l.type];c?l.type==="perspective"?u=new d.PerspectiveCamera(d.MathUtils.radToDeg(c.yfov),c.aspectRatio||1,c.znear||1,c.zfar||2e6):l.type==="orthographic"?u=new d.OrthographicCamera(-c.xmag,c.xmag,c.ymag,-c.ymag,c.znear,c.zfar):(console.warn("glTF: Invalid camera type ".concat(l.type,".")),u=new d.Camera):(console.warn("glTF: Missing camera parameters."),u=new d.Camera),l.name&&(u.name=this.createUniqueName(l.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=dt(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,l=u.animations[t],c=[],f=[],A=[],p=[],y=[],v=0,m=l.channels.length;v<m;v++){var h=l.channels[v],g=l.samplers[h.sampler],b=h.target,w=b.node!==void 0?b.node:b.id,E=l.parameters!==void 0?l.parameters[g.input]:g.input,C=l.parameters!==void 0?l.parameters[g.output]:g.output;c.push(this.loadNode(w)),f.push(this.loadAccessor(E)),A.push(this.loadAccessor(C)),p.push(g),y.push(b)}i=Promise.all([Promise.all(c),Promise.all(f),Promise.all(A),Promise.all(p),Promise.all(y)]).then(function(x){for(var M=x[0],S=x[1],P=x[2],T=x[3],B=x[4],F=[],L=function(H,K){var U=M[H],G=S[H],X=P[H],Z=T[H],q=B[H];if(U===void 0)return"continue";U.updateMatrix(),U.matrixAutoUpdate=!0;var W=void 0;switch(Cr[q.path]){case Cr.weights:W=d.NumberKeyframeTrack;break;case Cr.rotation:W=d.QuaternionKeyframeTrack;break;case Cr.position:case Cr.scale:default:W=d.VectorKeyframeTrack;break}var J=U.name?U.name:U.uuid,ve=Z.interpolation!==void 0?Xc[Z.interpolation]:d.InterpolateLinear,re=[];Cr[q.path]===Cr.weights?U.traverse(function(fe){fe.morphTargetInfluences&&re.push(fe.name?fe.name:fe.uuid)}):re.push(J);var se=X.array;if(X.normalized){for(var ie=zi(se.constructor),pe=new Float32Array(se.length),ne=0,de=se.length;ne<de;ne++)pe[ne]=se[ne]*ie;se=pe}for(var ne=0,de=re.length;ne<de;ne++){var ce=new W(re[ne]+"."+Cr[q.path],G.array,se,ve);F.push(ce)}},O=0,Q=M.length;O<Q;O++)L(O);var N=l.name?l.name:"animation_"+t;return new d.AnimationClip(N,void 0,F)})}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=dt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadBuffer(t,this),a)break}if(!a){var l=this.json.buffers[t];a=this.options.fetcher.ajax(this.resolveResouce(l.uri),{responseType:"arraybuffer"}).then(function(c){return c.body})}return this.cache.set(r,a),a},n.prototype.loadBufferView=function(t){var e="bufferView:"+t,r=this.cache.get(e);if(r)return r;for(var i=null,a=0,o=dt(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(l){var c=u.byteLength||0,f=u.byteOffset||0;return l.slice(f,f+c)})}return this.cache.set(e,i),i},n.prototype.loadAccessor=function(t){var e=this,r="accessor:"+t,i=this.cache.get(r);if(i)return i;var a=null;if(!a){var o=this.json.accessors[t];if(o.bufferView===void 0&&o.sparse===void 0)a=Promise.resolve(null);else{var s=[];o.bufferView!==void 0?s.push(this.loadBufferView(o.bufferView)):s.push(Promise.resolve(null)),o.sparse!==void 0&&(s.push(this.loadBufferView(o.sparse.indices.bufferView)),s.push(this.loadBufferView(o.sparse.values.bufferView))),a=Promise.all(s).then(function(u){var l=u[0],c=Uo[o.type],f=yn[o.componentType],A=f.BYTES_PER_ELEMENT,p=A*c,y=o.byteOffset||0,v=o.bufferView!==void 0?e.json.bufferViews[o.bufferView].byteStride:void 0,m=o.normalized===!0,h,g;if(v&&v!==p){var b=Math.floor(y/v),w="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+b+":"+o.count,E=e.cache.get(w);E||(h=new f(l,b*v,o.count*v/A),E=new d.InterleavedBuffer(h,v/A),e.cache.set(w,E)),g=new d.InterleavedBufferAttribute(E,c,y%v/A,m)}else l===null?h=new f(o.count*c):h=new f(l,y,o.count*c),g=new d.BufferAttribute(h,c,m);if(o.sparse!==void 0){var C=Uo.SCALAR,x=yn[o.sparse.indices.componentType],M=o.sparse.indices.byteOffset||0,S=o.sparse.values.byteOffset||0,P=new x(u[1],M,o.sparse.count*C),T=new f(u[2],S,o.sparse.count*c);l!==null&&(g=new d.BufferAttribute(g.array.slice(),g.itemSize,g.normalized));for(var B=0,F=P.length;B<F;B++){var L=P[B];if(g.setX(L,T[B*c]),c>=2&&g.setY(L,T[B*c+1]),c>=3&&g.setZ(L,T[B*c+2]),c>=4&&g.setW(L,T[B*c+3]),c>=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=dt(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,l=s.length;u<l;u++)o+=s[u]+":"+t.attributes[s[u]]+";";return t.indices+":"+o+":"+t.mode},n.prototype.loadGeometry=function(t){for(var e=this,r=null,i=0,a=dt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadGeometry(t,this),r)break}return r||(r=this.addGeometryPrimitiveAttributes(new d.BufferGeometry,t)),r=r.then(function(s){return e.disposeSet.add(s),s}),r},n.prototype.loadImage=function(t){for(var e=this,r=null,i=0,a=dt(this.extensions);i<a.length;i++){var o=a[i];if(r=o.loadImage(t,this),r)break}if(!r){var s=this.json.images[t];if(s.bufferView!==void 0){var u=this.json.bufferViews[s.bufferView];r=this.loadBuffer(u.buffer).then(function(c){var f=u.byteOffset||0,A=u.byteLength||0,p=new Uint8Array(c,f,A),y=new Blob([p],{type:s.mimeType});return ca(y)})}else if(s.uri){var l=this.resolveResouce(s.uri);r=this.options.fetcher.loadImage(l,{},void 0,void 0,void 0,ci()).then(function(c){return c.body})}else throw new Error("glTF: Invalid image defs.")}return r=r.then(function(c){return e.disposeSet.add(c),c}),r},n.prototype.loadMaterialAsMeshStandardMaterial=function(t){var e=this,r=[],i=new d.MeshStandardMaterial;if(i.color=new d.Color(1,1,1),i.opacity=1,Object.keys(t.attributes).filter(function(c){return Ct[c]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(c){return Ct[c]==="normal"}).length===0&&(i.flatShading=!0),Object.keys(t.attributes).filter(function(c){return Ct[c]==="tangent"}).length===0&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),t.material!==void 0){var a=this.json.materials[t.material];a.name&&(i.name=a.name);var o=a.pbrMetallicRoughness||{};if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;i.color.fromArray(s),i.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(this.createMaterialTexture(o.baseColorTexture).then(function(c){c.encoding=d.sRGBEncoding,i.map=c,e.disposeSet.add(c)})),i.metalness=o.metallicFactor!==void 0?o.metallicFactor:1,i.roughness=o.roughnessFactor!==void 0?o.roughnessFactor:1,o.metallicRoughnessTexture!==void 0&&r.push(this.createMaterialTexture(o.metallicRoughnessTexture).then(function(c){c.encoding=d.sRGBEncoding,i.metalnessMap=c,i.roughnessMap=c,e.disposeSet.add(c)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var u=a.alphaMode||cr.OPAQUE;if(u===cr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===cr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&(r.push(this.createMaterialTexture(a.normalTexture).then(function(c){i.normalMap=c,e.disposeSet.add(c)})),i.normalScale=new d.Vector2(1,1),a.normalTexture.scale!==void 0)){var l=a.normalTexture.scale;i.normalScale.set(l,l)}a.occlusionTexture!==void 0&&(r.push(this.createMaterialTexture(a.occlusionTexture).then(function(c){i.aoMap=c,e.disposeSet.add(c)})),a.occlusionTexture.strength!==void 0&&(i.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&(i.emissive=new d.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&r.push(this.createMaterialTexture(a.emissiveTexture).then(function(c){i.emissiveMap=c,e.disposeSet.add(c)}))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterialAsLineBasicMaterial=function(t){var e=[],r=new d.LineBasicMaterial;if(r.color=new d.Color(1,1,1),r.opacity=1,Object.keys(t.attributes).filter(function(u){return Ct[u]==="color"}).length>0&&(r.vertexColors=!0),Object.keys(t.attributes).filter(function(u){return Ct[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||cr.OPAQUE;s===cr.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,s===cr.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(l){return Ct[l]==="color"}).length>0&&(i.vertexColors=!0),Object.keys(t.attributes).filter(function(l){return Ct[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)})),a.doubleSided===!0&&(i.side=d.DoubleSide);var u=a.alphaMode||cr.OPAQUE;u===cr.BLEND?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,u===cr.MASK&&(i.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5))}return this.disposeSet.add(i),Promise.all(r).then(function(){return i})},n.prototype.loadMaterial=function(t){var e,r=(e=t.mode)!==null&&e!==void 0?e:Re.TRIANGLES,i="material:"+this.createPrimitiveKey(t),a=this.cache.get(i);if(a)return a;for(var o=null,s=0,u=dt(this.extensions);s<u.length;s++){var l=u[s];if(o=l.loadMaterial(t,this),o)break}if(r===Re.TRIANGLES||r===Re.TRIANGLE_STRIP||r===Re.TRIANGLE_FAN)o=this.loadMaterialAsMeshStandardMaterial(t);else if(r===Re.LINES||r===Re.LINE_STRIP||r===Re.LINE_LOOP)o=this.loadMaterialAsLineBasicMaterial(t);else if(r===Re.POINTS)o=this.loadMaterialAsPointsMaterial(t);else throw new Error("glTF: Primitive mode unsupported: "+r);return this.cache.set(i,o),o},n.prototype.loadTexture=function(t){var e=this,r="texture:"+t,i=this.cache.get(r);if(i)return i;for(var a=null,o=0,s=dt(this.extensions);o<s.length;o++){var u=s[o];if(a=u.loadTexture(t,this),a)break}if(!a){var l=this.json.textures[t];a=this.loadImage(l.source).then(function(c){var f=new d.Texture(c);f.needsUpdate=!0,f.flipY=!1,l.name&&(f.name=l.name);var A=e.json.samplers||{},p=A[l.sampler]||{};return f.magFilter=fi[p.magFilter]||d.LinearFilter,f.minFilter=fi[p.minFilter]||d.LinearMipmapLinearFilter,f.wrapS=hi[p.wrapS]||d.RepeatWrapping,f.wrapT=hi[p.wrapT]||d.RepeatWrapping,f.onUpdate=function(){c.close()},f})}return a=a.then(function(c){return e.disposeSet.add(c),c}),this.cache.set(r,a),a},n.prototype.loadMesh=function(t){for(var e=this,r=null,i=0,a=dt(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,l=Promise.all(u.map(function(f){return e.loadGeometry(f)})),c=Promise.all(u.map(function(f){return e.loadMaterial(f)}));r=Promise.all([l,c]).then(function(f){for(var A=f[0],p=f[1],y=[],v=0;v<u.length;v++){var m=u[v],h=A[v],g=p[v],b=m.mode||Re.TRIANGLES,w=void 0;if(b===Re.TRIANGLES||b===Re.TRIANGLE_STRIP||b===Re.TRIANGLE_FAN)if(b===Re.TRIANGLE_STRIP?h=e.toGeometryTrianglesDrawMode(h,d.TriangleStripDrawMode):b===Re.TRIANGLE_FAN&&(h=e.toGeometryTrianglesDrawMode(h,d.TriangleFanDrawMode)),e.disposeSet.add(h),s.isSkinnedMesh){var E=new d.SkinnedMesh(h,g);h.attributes.skinWeight.normalized||E.normalizeSkinWeights(),w=E}else w=new d.Mesh(h,g);else if(b===Re.POINTS)w=new d.Points(h,g);else if(b===Re.LINES)w=new d.LineSegments(h,g);else if(b===Re.LINE_STRIP)w=new d.Line(h,g);else if(b===Re.LINE_LOOP)w=new d.LineLoop(h,g);else throw new Error("glTF: Primitive mode unsupported: "+b);if(Object.keys(h.morphAttributes).length>0){if(s.weights!==void 0)for(var C=0,x=s.weights.length;C<x;C++)w.morphTargetInfluences[C]=s.weights[C];if(s.extras&&Array.isArray(s.extras.targetNames)){var M=s.extras.targetNames;if(w.morphTargetInfluences.length===M.length){w.morphTargetDictionary={};for(var C=0,x=M.length;C<x;C++)w.morphTargetDictionary[M[C]]=C}else console.warn("glTF: Invalid extras.targetNames length. Ignoring names.")}}w.name=e.createUniqueName(s.name||"mesh_"+t),y.push(w)}if(y.length===1)return y[0];for(var S=new d.Group,P=0,T=y;P<T.length;P++){var w=T[P];S.add(w)}return S})}return r},n.prototype.loadNodeAttachments=function(t){for(var e=[],r=0,i=dt(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(A){if(a.weights!==void 0){var p=a.weights;A.traverse(function(y){if(y instanceof d.Mesh||y instanceof d.Line||y instanceof d.Points)for(var v=0,m=p.length;v<m;v++)y.morphTargetInfluences[v]=p[v]})}return A})),a.camera!==void 0&&s.push(this.loadCamera(a.camera));for(var u=this.loadNodeAttachments(t),l=0,c=u;l<c.length;l++){var f=c[l];s.push(f)}return Promise.all(s).then(function(A){var p;if(a.isBone===!0?p=new d.Bone:A.length>1?p=new d.Group:A.length===1?p=A[0]:p=new d.Object3D,p!==A[0])for(var y=0,v=A.length;y<v;y++)p.add(A[y]);if(a.name&&(p.name=o),a.matrix!==void 0){var m=new d.Matrix4;m.fromArray(a.matrix),p.applyMatrix4(m)}else a.translation!==void 0&&p.position.fromArray(a.translation),a.rotation!==void 0&&p.quaternion.fromArray(a.rotation),a.scale!==void 0&&p.scale.fromArray(a.scale);return p})},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=dt(e.extensions);i<a.length;i++){var o=a[i],s=o.extendTexture(r,t,e);s&&(r=s,e.disposeSet.add(r))}return r})},n.prototype.addGeometryPrimitiveAttributes=function(t,e){var r=this,i=e.attributes,a=[],o=function(E){var C=Ct[E]||E.toLowerCase();if(C in t.attributes)return"continue";a.push(s.loadAccessor(i[E]).then(function(x){x&&t.setAttribute(C,x)}))},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 l=new d.Box3;if(i.POSITION!==void 0){var c=this.json.accessors[i.POSITION],f=c.min,A=c.max;if(f!==void 0&&A!==void 0){if(l.set(new d.Vector3(f[0],f[1],f[2]),new d.Vector3(A[0],A[1],A[2])),c.normalized){var p=zi(yn[c.componentType]);l.min.multiplyScalar(p),l.max.multiplyScalar(p)}}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}var y=e.targets;if(y!==void 0){for(var v=new d.Vector3,m=new d.Vector3,h=0,g=y.length;h<g;h++){var b=y[h];if(b.POSITION!==void 0){var c=this.json.accessors[b.POSITION],f=c.min,A=c.max;if(f!==void 0&&A!==void 0){if(m.setX(Math.max(Math.abs(f[0]),Math.abs(A[0]))),m.setY(Math.max(Math.abs(f[1]),Math.abs(A[1]))),m.setZ(Math.max(Math.abs(f[2]),Math.abs(A[2]))),c.normalized){var p=zi(yn[c.componentType]);m.multiplyScalar(p)}v.max(m)}else console.warn("glTF: Missing min/max properties for accessor POSITION.")}}l.expandByVector(v)}t.boundingBox=l;var w=new d.Sphere;return l.getCenter(w.center),w.radius=l.min.distanceTo(l.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,C=!1,x=0,M=e.targets.length;x<M;x++){var S=e.targets[x];if(S.POSITION!==void 0&&(E=!0),S.NORMAL!==void 0&&(C=!0),E&&C)break}if(!E&&!C)return t;var P=[];t.morphTargetsRelative=!0;for(var T=function(B,F){var L=e.targets[B];E?P.push(r.loadAccessor(L.POSITION).then(function(O){O&&(t.morphAttributes.position[B]=O)})):t.morphAttributes.position[B]=t.attributes.position,C?P.push(r.loadAccessor(L.NORMAL).then(function(O){O&&(t.morphAttributes.normal[B]=O)})):t.morphAttributes.normal[B]=t.attributes.normal},x=0,M=e.targets.length;x<M;x++)T(x,M);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=[],l=0,c=o.joints.length;l<c;l++)u.push(r.loadNode(o.joints[l]));return Promise.all(u)}).then(function(s){return a.traverse(function(u){if(u instanceof d.SkinnedMesh){for(var l=[],c=[],f=0,A=s.length;f<A;f++){var p=s[f];if(p instanceof d.Bone){l.push(p);var y=new d.Matrix4;o.inverseBindMatrices!==void 0&&y.fromArray(o.inverseBindMatrices.array,f*16),c.push(y)}else console.warn('glTF: Joint "%s" could not be found.',o.joints[f])}u.bind(new d.Skeleton(l,c),u.matrixWorld)}}),a})}).then(function(a){e.add(a);var o=[];if(i.children)for(var s=i.children,u=0,l=s.length;u<l;u++){var c=s[u];o.push(r.buildNodeHierarchy(c,a))}return Promise.all(o).then(function(){return a})})},n.prototype.createUniqueName=function(t){for(var e=d.PropertyBinding.sanitizeNodeName(t||""),r=e,i=1;this.nodeNamesUsed[r];++i)r=e+"_"+i;return this.nodeNamesUsed[r]=!0,r},n.prototype.resolveResouce=function(t){return bt(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 l=t.clone();return l.setIndex(u),this.disposeSet.add(l),l},n}();function zi(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 mr=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}(),Zc=function(n){le(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 pa(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 l=i.getUint32(a,!0);if(a+=4,l===t.CHUNK_TYPES.JSON){var c=new Uint8Array(e,t.HEADER_LENGTH+a,u);o=pa(c)}else if(l===t.CHUNK_TYPES.BIN){var f=t.HEADER_LENGTH+a;s=e.slice(f,f+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}(mr),Yc="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",zo={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},Go={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},Jc=function(){function n(){this.decoderPath=Yc,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||zo,attributeTypes:i||Go,useUniqueIDs:!!r};this.decodeGeometry(t,a).then(e)},n.prototype.decodeGeometry=function(t,e){var r=this;e===void 0&&(e={attributeIDs:zo,attributeTypes:Go,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,l=this._getWorker(s,u).then(function(c){return o=c,new Promise(function(f,A){o._callbacks[s]={resolve:f,reject:A},o.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])})}).then(function(c){return r._createGeometry(c.geometry)});return l.catch(function(){return!0}).then(function(){o&&s&&r._releaseTask(o,s)}),l},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=nn(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 */",Ho].join(`
418
+ `);t.workerSourceURL=URL.createObjectURL(new Blob([o]))})}else{var r=nn(this.decoderPath+"draco_wasm_wrapper.js",{responseType:"text"}).then(function(o){return o.body}),i=nn(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 l=["/* draco decoder */",s,"","/* worker */",Ho].join(`
419
+ `);t.workerSourceURL=URL.createObjectURL(new Blob([l]))})}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}(),pi=new Jc,Ho=`
420
420
  let decoderConfig;
421
421
  let decoderPending;
422
422
 
@@ -611,8 +611,8 @@ void main() {
611
611
  }
612
612
 
613
613
  }
614
- `,qi="KHR_draco_mesh_compression",$c=function(n){oe(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadGeometry=function(e,r){return e.extensions&&e.extensions[qi]?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[qi].bufferView,o=e.extensions[qi].attributes,s={},u={},c={};for(var l in o){var h=It[l]||l.toLowerCase();s[h]=o[l]}for(var l in e.attributes){var h=It[l]||l.toLowerCase();if(o[l]!==void 0){var v=i.accessors[e.attributes[l]],p=xn[v.componentType];c[h]=p,u[h]=v.normalized===!0}}return r.loadBufferView(a).then(function(m){return new Promise(function(A){Ai.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}(mr),ed=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}(),td="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/basis/1.16/",rd=2,nd=1,id=function(){function n(){this.transcoderPath=td,this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new ed(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=un(this.transcoderPath+"basis_transcoder.js",{responseType:"text"}).then(function(i){return i.body}),r=un(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(sd),"let _TranscoderFormat = "+JSON.stringify(od),"let _BasisFormat = "+JSON.stringify(ad),"/* basis_transcoder.js */",a,"/* worker */",ud].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===rd?d.sRGBEncoding:d.LinearEncoding,l.premultiplyAlpha=!!(c&nd),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}(),kn=new id,ad={ETC1S:0,UASTC_4x4:1},od={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},sd={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},ud=`
614
+ `,Gi="KHR_draco_mesh_compression",$c=function(n){le(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadGeometry=function(e,r){return e.extensions&&e.extensions[Gi]?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[Gi].bufferView,o=e.extensions[Gi].attributes,s={},u={},l={};for(var c in o){var f=Ct[c]||c.toLowerCase();s[f]=o[c]}for(var c in e.attributes){var f=Ct[c]||c.toLowerCase();if(o[c]!==void 0){var A=i.accessors[e.attributes[c]],p=yn[A.componentType];l[f]=p,u[f]=A.normalized===!0}}return r.loadBufferView(a).then(function(y){return new Promise(function(v){pi.decodeDracoFile(y,function(m){for(var h in m.attributes){var g=m.attributes[h],b=u[h];b!==void 0&&(g.normalized=b)}v(m)},s,l)})})},t}(mr),ed=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}(),td="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/basis/1.16/",rd=2,nd=1,id=function(){function n(){this.transcoderPath=td,this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new ed(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=nn(this.transcoderPath+"basis_transcoder.js",{responseType:"text"}).then(function(i){return i.body}),r=nn(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(sd),"let _TranscoderFormat = "+JSON.stringify(od),"let _BasisFormat = "+JSON.stringify(ad),"/* basis_transcoder.js */",a,"/* worker */",ud].join(`
615
+ `);t.workerSourceURL=URL.createObjectURL(new Blob([s])),t.transcoderBinary=o,t.workerPool.setWorkerCreator(function(){var u=new Worker(t.workerSourceURL),l=t.transcoderBinary.slice(0);return u.postMessage({type:"init",config:t.workerConfig,transcoderBinary:l},[l]),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,l=t.dfdFlags;if(o==="error")return Promise.reject(s);var c=new d.CompressedTexture(e,r,i,a,d.UnsignedByteType);return c.minFilter=e.length===1?d.LinearFilter:d.LinearMipmapLinearFilter,c.magFilter=d.LinearFilter,c.generateMipmaps=!1,c.needsUpdate=!0,c.encoding=u===rd?d.sRGBEncoding:d.LinearEncoding,c.premultiplyAlpha=!!(l&nd),Promise.resolve(c)},n.prototype._createTexture=function(t){var e=this,r=this.init().then(function(){return e.workerPool.postMessage({type:"transcode",buffers:t},t)}).then(function(i){return e._createTextureFrom(i.data)});return r},n.prototype.dispose=function(){return URL.revokeObjectURL(this.workerSourceURL),this.workerPool.dispose(),this},n}(),Pn=new id,ad={ETC1S:0,UASTC_4x4:1},od={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},sd={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},ud=`
616
616
 
617
617
  let config;
618
618
  let transcoderPending;
@@ -880,9 +880,9 @@ void main() {
880
880
  return ( value & ( value - 1 ) ) === 0 && value !== 0;
881
881
 
882
882
  }
883
- `,jo="KHR_texture_basisu",ld=function(n){oe(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!==void 0)s=r.loadBufferView(o.bufferView).then(function(u){return kn.parse(u)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(u){return kn.parse(u.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(mr),Wo="KHR_texture_transform",cd=function(n){oe(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[Wo]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+Wo+'" 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}(mr),dd=function(n){oe(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(mr),Ki=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:y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edibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;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 x=0,b=0;b<f.length;++b)g[x++]=g[b]<60?r[g[b]]:(g[b]-60)*64+g[++b];return g.buffer.slice(0,x)}function u(f,g,b,w,x,E){var M=a.exports.sbrk,C=b+3&-4,S=M(C*w),P=M(x.length),I=new Uint8Array(a.exports.memory.buffer);I.set(x,P);var B=f(S,b,w,P,x.length);if(B==0&&E&&E(S,C,w),g.set(I.subarray(S,S+b*w)),M(S-M(0)),B!=0)throw new Error("Malformed buffer data: "+B)}var c={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],v=0;function p(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),x=0;x<f;++x)h[x]=p(w);URL.revokeObjectURL(w)}function A(f,g,b,w,x){for(var E=h[0],M=1;M<h.length;++M)h[M].pending<E.pending&&(E=h[M]);return new Promise(function(C,S){var P=new Uint8Array(b),I=v++;E.pending+=f,E.requests[I]={resolve:C,reject:S},E.object.postMessage({id:I,count:f,size:g,source:P,mode:w,filter:x},[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,x){u(a.exports.meshopt_decodeVertexBuffer,f,g,b,w,a.exports[c[x]])},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,x,E){u(a.exports[l[x]],f,g,b,w,a.exports[c[E]])},decodeGltfBufferAsync:function(f,g,b,w,x){return h.length>0?A(f,g,b,l[w],c[x]):o.then(function(){var E=new Uint8Array(f*g);return u(a.exports[l[w]],E,f,g,b,a.exports[c[x]]),E})}}}(),ji="EXT_meshopt_compression",fd=function(n){oe(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[ji]){var o=a.extensions[ji],s=r.loadBuffer(o.buffer);if(!Ki.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(ji)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,Ki.ready]).then(function(u){var c=u[0],l=o.byteOffset||0,h=o.byteLength||0,v=o.count,p=o.byteStride,m=new ArrayBuffer(v*p),A=new Uint8Array(c,l,h);return Ki.decodeGltfBuffer(new Uint8Array(m),v,p,A,o.mode,o.filter),m})}else return null},t}(mr),Xo="EXT_texture_webp",hd=function(n){oe(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 _s().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[Xo]||!this.supportsWep)return null;var o=a.extensions[Xo];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=pi[l.magFilter]||d.LinearFilter,u.minFilter=pi[l.minFilter]||d.LinearMipmapLinearFilter,u.wrapS=vi[l.wrapS]||d.RepeatWrapping,u.wrapT=vi[l.wrapT]||d.RepeatWrapping,u.onUpdate=function(){s.close()},u})},t}(mr),Wi="CESIUM_RTC",pd=function(n){oe(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[Wi]&&r.json.extensions[Wi].center){var i=r.json.extensions[Wi].center;e.CESIUM_RTC={center:new d.Vector3().fromArray(i)}}},t}(mr);const vd=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@-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-=;EH------\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"),Ad=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\x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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--tyl]|v{`v r-J-pynz}5rny]|v{`v r9-}|v{Zv{]v\x07ry-7-}v\x07ry_nv|9-}|v{Zn\x07]v\x07ry-7-}v\x07ry_nv|6H--]|v{`v r-J-tyl]|v{`v rH--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-|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|{H--0r{qvs\f");var md=new d.Vector4,gd=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)),Mu=function(n){oe(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,c,l,h,v,p,m,A,y,f,g,b,w,x,E,M=n.call(this,{vertexShader:Ad,fragmentShader:vd,uniforms:d.UniformsUtils.clone(gd),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(S){this.uniforms.constantColor.value=S;var P=this.defines.USE_CONSTANT_COLOR,I=S!==null;P!==I&&(this.defines.USE_CONSTANT_COLOR=I,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(S){this.uniforms.opacity.value=S}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(S){this.uniforms.modelAlpha.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(P){var I=typeof P.floorIndex=="number"?P.floorIndex:-1,B=new d.Matrix4().getInverse(P.clippingBoxMatrix);return{matrixInverse:B,floorIndex:I}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(S){var P=S==="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(S){var P=S==="ATTENUATION",I=S==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==I&&(this.defines.USE_POINT_SIZE_GEOMETRIC=I,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(S){var P=S==="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(S){this.uniforms.pointScale.value=S}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(S){var P=S==="HIDDEN",I=S==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==P&&(this.defines.USE_POINT_BACK_HIDDEN=P,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==I&&(this.defines.USE_POINT_BACK_DARK=I,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(S){this.uniforms.pointMinPixel.value=S}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(S){this.uniforms.pointMaxPixel.value=S}},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)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(S){this.uniforms.gradientTexture.value=S}},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:ye.pano0,M.pano1=(i=e.pano1)!==null&&i!==void 0?i:ye.pano1,M.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:ye.modelAlpha,M.progress=(o=e.progress)!==null&&o!==void 0?o:ye.progress,M.useBlackTransition=(s=e.useBlackTransition)!==null&&s!==void 0?s:ye.useBlackTransition,M.constantColor=(u=e.constantColor)!==null&&u!==void 0?u:ye.constantColor,M.opacity=(c=e.opacity)!==null&&c!==void 0?c:ye.opacity,M.shownFloorIndex=(l=e.shownFloorIndex)!==null&&l!==void 0?l:ye.shownFloorIndex,M.clippers=(h=e.clippers)!==null&&h!==void 0?h:ye.clippers,M.useEDL=(v=e.useEDL)!==null&&v!==void 0?v:ye.useEDL,M.useHQWeight=(p=e.useHQWeight)!==null&&p!==void 0?p:ye.useHQWeight,M.useHQDepth=(m=e.useHQDepth)!==null&&m!==void 0?m:ye.useHQDepth,M.pointColor=(A=e.pointColor)!==null&&A!==void 0?A:ye.pointColor,M.pointShape=(y=e.pointShape)!==null&&y!==void 0?y:ye.pointShape,M.pointSize=(f=e.pointSize)!==null&&f!==void 0?f:ye.pointSize,M.pointScale=(g=e.pointScale)!==null&&g!==void 0?g:ye.pointScale,M.pointBack=(b=e.pointBack)!==null&&b!==void 0?b:ye.pointBack,M.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:ye.pointMinPixel,M.pointMaxPixel=(x=e.pointMaxPixel)!==null&&x!==void 0?x:ye.pointMaxPixel,M.gradientTexture=(E=e.gradientTexture)!==null&&E!==void 0?E:ye.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 fi?r.pixelRatio:e.getPixelRatio(),a=r instanceof fi?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),yd=function(n){oe(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],v=l[1],p=[],m=0;m<o.length;m++){var A=o[m],y=h[m],f=v[m];y.attributes.normal===void 0&&(f.flatShading=!0),y.attributes.tangent===void 0&&f.normalScale&&(f.normalScale.y*=-1);var g=A.mode||Be.TRIANGLES,b=void 0;if(g===Be.TRIANGLES||g===Be.TRIANGLE_STRIP||g===Be.TRIANGLE_FAN)g===Be.TRIANGLE_STRIP?y=r.toGeometryTrianglesDrawMode(y,d.TriangleStripDrawMode):g===Be.TRIANGLE_FAN&&(y=r.toGeometryTrianglesDrawMode(y,d.TriangleFanDrawMode)),y.clearGroups(),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,0),y.attributes.normal||y.computeVertexNormals(),r.disposeSet.add(y),b=new Gt(y,[f]);else if(g===Be.POINTS)b=new Fr(y,f);else throw new Error("glTF: Primitive mode unsupported: "+g);b.name=r.createUniqueName(a.name||"mesh_"+e),p.push(b)}if(p.length===1)return p[0];for(var w=new d.Group,x=0,E=p;x<E.length;x++){var b=E[x];w.add(b)}return w});return c},t.prototype.loadPBMMaterial=function(e,r){var i,a=(i=e.mode)!==null&&i!==void 0?i:Be.TRIANGLES,o=null;if(a===Be.TRIANGLES||a===Be.TRIANGLE_STRIP||a===Be.TRIANGLE_FAN)o=this.loadPBMMeshMaterial(e,r);else if(a===Be.POINTS)o=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+a);return o},t.prototype.extendTexture=function(e,r,i){return e.minFilter=d.LinearFilter,e.magFilter=d.LinearFilter,e.generateMipmaps=!1,e},t.prototype.loadPBMPointCloudMaterial=function(e,r){var i=new Mu;return Object.keys(e.attributes).filter(function(a){return It[a]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),r.disposeSet.add(i),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],a=new Un;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 It[l]==="color"}).length>0&&(a.vertexColors=!0),Object.keys(e.attributes).filter(function(l){return It[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){r.disposeSet.add(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){r.disposeSet.add(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 r.disposeSet.add(a),Promise.all(i).then(function(){return a})},t}(mr),en={KHR_binary_glTF:Zc,KHR_draco_mesh_compression:$c,KHR_texture_basisu:ld,KHR_texture_transform:cd,KHR_mesh_quantization:dd,EXT_meshopt_compression:fd,EXT_texture_webp:hd,CESIUM_RTC:pd,PBM_mesh:yd};function Da(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 en[u]}var c;if(typeof n=="string")c=n;else{var l=en.KHR_binary_glTF.getMagic(n);if(l===en.KHR_binary_glTF.HEADER_MAGIC){var h=new en.KHR_binary_glTF;try{h.loadGlbBinary(n)}catch(f){return Promise.reject(f)}a.KHR_binary_glTF=h,c=h.content}else c=Aa(new Uint8Array(n))}var v=JSON.parse(c);if(v.asset===void 0||Number(v.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(v.extensionsUsed)for(var p=v.extensionsRequired||[],m=0;m<v.extensionsUsed.length;m++){var A=v.extensionsUsed[m];a[A]||(en[A]?a[A]=new en[A]:p.indexOf(A)>=0&&console.warn('glTF: Unknown extension "'+A+'".'))}var y=new _c(v,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 bd=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Cu(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 bu(e,r,i)}).then(function(i){return Eu(e,r,i)}).then(function(i){return Wc(e,r,i)})}).then(function(){var r;return Da(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(bd);var o=new d.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);if(a.premultiply(o),i.CESIUM_RTC){var s=new d.Matrix4().setPosition(i.CESIUM_RTC.center);a.premultiply(s)}var u=i.scene;return u.applyMatrix4(a),{type:"b3dm",uri:e.uri,byteLength:e.byteLength,object:u,dispose:function(){return i.dispose()}}})})}const Su="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNzYWdlPWZ1bmN0aW9uKHIpe1Byb21pc2UucmVzb2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3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",_o=typeof window!="undefined"&&window.Blob&&new Blob([atob(Su)],{type:"text/javascript;charset=utf-8"});function wd(n){let t;try{if(t=_o&&(window.URL||window.webkitURL).createObjectURL(_o),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:application/javascript;base64,"+Su,{name:n==null?void 0:n.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var xd=new vu(function(){return new wd},2);function Ed(n,t,e){var r=new wu(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?Md(i,r):xd.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function Md(n,t){return wi(this,void 0,void 0,function(){var e,r,i,a,o,s;return xi(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",RGBA:"Uint8Array"},[2,Ai.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(c){var l=c.getAttribute("POSITION"),h=c.getAttribute("RGB"),v=c.getAttribute("RGBA"),p=c.getAttribute("NORMAL"),m;if(v)m=v;else if(h){for(var A=h.count,y=h.array,f=new Uint8Array(A*4),g=0,b=void 0,w=void 0;g<A;g++)w=g*4,b=g*3,f[w]=y[b],f[++w]=y[++b],f[++w]=y[++b];m=new d.BufferAttribute(f,4,h.normalized)}return{position:l?{array:l.array,itemSize:l.itemSize,normalized:l.normalized}:null,color:m?{array:m.array,itemSize:m.itemSize,normalized:m.normalized}:null,normal:p?{array:p.array,itemSize:p.itemSize,normalized:p.normalized}:null}})]})})}function Iu(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 bu(e,r,i)}).then(function(i){return Eu(e,r,i)}).then(function(i){return Ed(e,r,i)})}).then(function(){var r;return Cd(e.attributes,{computeBoundingBox:(r=t.computeBoundingBox)!==null&&r!==void 0?r:!0})}).then(function(r){var i=new d.Matrix4,a=new d.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);return i.premultiply(a),r.object.applyMatrix4(i),{type:"pnts",uri:e.uri,byteLength:e.byteLength,object:r.object,dispose:function(){return r.dispose()}}})}function Cd(n,t){var e=new Set,r=new d.BufferGeometry;e.add(r);var i=new Mu;e.add(i),n.position&&r.setAttribute("position",new d.BufferAttribute(n.position.array,n.position.itemSize,n.position.normalized)),n.color&&r.setAttribute("color",new d.BufferAttribute(n.color.array,n.color.itemSize,n.color.normalized)),n.normal&&(r.setAttribute("normal",new d.BufferAttribute(n.normal.array,n.normal.itemSize,n.normal.normalized)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var a=new Fr(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 Tu(){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,v,p,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)v=this._literalDecoder.getDecoder(c++,l),i>=7?l=v.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):l=v.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)p=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,i)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(i<<4)+h)===0&&(i=i<7?9:11,p=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),p===0&&(p=2+this._repLenDecoder.decode(this._rangeDecoder,h),i=i<7?8:11);else if(u=s,s=o,o=a,p=2+this._lenDecoder.decode(this._rangeDecoder,h),i=i<7?7:10,A=this._posSlotDecoder[p<=5?p-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,p),c+=p,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 Sd=Tu();function Id(){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,v,p;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)],v=i[e.charCodeAt(u+2)],p=i[e.charCodeAt(u+3)],A[c++]=l<<2|h>>4,A[c++]=(h&15)<<4|v>>2,A[c++]=(v&3)<<6|p&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/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEE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IAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function Td(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 Pd(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),v=h[0],p=h[2],m=h[3];v?e(null,new Uint8Array(i.buffer,m+r,p).slice(0,p)):e(new Error("lzma deocder error"))}catch(A){e(A)}}var Bd=`
883
+ `,Ko="KHR_texture_basisu",ld=function(n){le(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[Ko])return null;var a=i.extensions[Ko],o=r.json.images[a.source],s=null;if(o.bufferView!==void 0)s=r.loadBufferView(o.bufferView).then(function(u){return Pn.parse(u)});else if(o.uri)s=r.options.fetcher.ajax(r.resolveResouce(o.uri),{responseType:"arraybuffer"}).then(function(u){return Pn.parse(u.body)});else throw new Error("glTF: Invalid image defs.");return s},t}(mr),qo="KHR_texture_transform",cd=function(n){le(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[qo]:void 0;return a?(a.texCoord!==void 0&&console.warn('glTF: Custom UV sets in "'+qo+'" 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}(mr),dd=function(n){le(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(mr),Hi=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:9cU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qk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;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(h){a=h.instance,a.exports.__wasm_call_ctors()});function s(h){for(var g=new Uint8Array(h.length),b=0;b<h.length;++b){var w=h.charCodeAt(b);g[b]=w>96?w-97:w>64?w-39:w+4}for(var E=0,b=0;b<h.length;++b)g[E++]=g[b]<60?r[g[b]]:(g[b]-60)*64+g[++b];return g.buffer.slice(0,E)}function u(h,g,b,w,E,C){var x=a.exports.sbrk,M=b+3&-4,S=x(M*w),P=x(E.length),T=new Uint8Array(a.exports.memory.buffer);T.set(E,P);var B=h(S,b,w,P,E.length);if(B==0&&C&&C(S,M,w),g.set(T.subarray(S,S+b*w)),x(S-x(0)),B!=0)throw new Error("Malformed buffer data: "+B)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],A=0;function p(h){var g={object:new Worker(h),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 y(h){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()+m.toString(),b=new Blob([g],{type:"text/javascript"}),w=URL.createObjectURL(b),E=0;E<h;++E)f[E]=p(w);URL.revokeObjectURL(w)}function v(h,g,b,w,E){for(var C=f[0],x=1;x<f.length;++x)f[x].pending<C.pending&&(C=f[x]);return new Promise(function(M,S){var P=new Uint8Array(b),T=A++;C.pending+=h,C.requests[T]={resolve:M,reject:S},C.object.postMessage({id:T,count:h,size:g,source:P,mode:w,filter:E},[P.buffer])})}function m(h){o.then(function(){var g=h.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(h){y(h)},decodeVertexBuffer:function(h,g,b,w,E){u(a.exports.meshopt_decodeVertexBuffer,h,g,b,w,a.exports[l[E]])},decodeIndexBuffer:function(h,g,b,w){u(a.exports.meshopt_decodeIndexBuffer,h,g,b,w)},decodeIndexSequence:function(h,g,b,w){u(a.exports.meshopt_decodeIndexSequence,h,g,b,w)},decodeGltfBuffer:function(h,g,b,w,E,C){u(a.exports[c[E]],h,g,b,w,a.exports[l[C]])},decodeGltfBufferAsync:function(h,g,b,w,E){return f.length>0?v(h,g,b,c[w],l[E]):o.then(function(){var C=new Uint8Array(h*g);return u(a.exports[c[w]],C,h,g,b,a.exports[l[E]]),C})}}}(),Ki="EXT_meshopt_compression",fd=function(n){le(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[Ki]){var o=a.extensions[Ki],s=r.loadBuffer(o.buffer);if(!Hi.supported){if(i.extensionsRequired&&i.extensionsRequired.indexOf(Ki)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,Hi.ready]).then(function(u){var l=u[0],c=o.byteOffset||0,f=o.byteLength||0,A=o.count,p=o.byteStride,y=new ArrayBuffer(A*p),v=new Uint8Array(l,c,f);return Hi.decodeGltfBuffer(new Uint8Array(y),A,p,v,o.mode,o.filter),y})}else return null},t}(mr),jo="EXT_texture_webp",hd=function(n){le(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 Ws().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 l=r.json.samplers||{},c=l[a.sampler]||{};return u.magFilter=fi[c.magFilter]||d.LinearFilter,u.minFilter=fi[c.minFilter]||d.LinearMipmapLinearFilter,u.wrapS=hi[c.wrapS]||d.RepeatWrapping,u.wrapT=hi[c.wrapT]||d.RepeatWrapping,u.onUpdate=function(){s.close()},u})},t}(mr),qi="CESIUM_RTC",pd=function(n){le(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.emitResult=function(e,r){if(r.json.extensions[qi]&&r.json.extensions[qi].center){var i=r.json.extensions[qi].center;e.CESIUM_RTC={center:new d.Vector3().fromArray(i)}}},t}(mr);const vd=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@-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-=;EH------\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"),Ad=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-rp?-r|yv|{H{vs|z-sy|n-}v\x07ry_nv|H{vs|z-sy|n-}|v{`pnyrH{vs|z-sy|n-}|v{Zv{]v\x07ryH{vs|z-sy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r-7-}v\x07ry_nv|H--0vs-qrsv{rq5b`Rl]\\V[al`VgRlTR\\ZRa_VP6----rny]|v{`v r-7J-tr|zrvpR|H----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0ryvs-qrsv{rq5b`Rl]\\V[al`VgRlNaaR[bNaV\\[6----sy|n-urvtu-J->;=-<-}|wrpv|{Znv\x07h>jh>j-7-zv\x075>;=9-:z]|vv|{; 9-:}|wrpv|{Znv\x07h?jh@j6-7-?;=H----rny]|v{`v r-J-r|yv|{;\b-7-rny]|v{`v r-<-urvtuH--0r{qvs--tyl]|v{`v r-J-pynz}5rny]|v{`v r9-}|v{Zv{]v\x07ry-7-}v\x07ry_nv|9-}|v{Zn\x07]v\x07ry-7-}v\x07ry_nv|6H--]|v{`v r-J-tyl]|v{`v rH--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{ar\x07r9-|yq]|vv|{6H--0ryr----P|y|-J-p|y|H--0r{qvs--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----[|zny-J-{|znyv r5zn@5z|qryZnv\x076-7-{|zny6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{; 6H--0r{qvs--0vs-qrsv{rq5b`RlU^lQR]aU6----<<-sy|n-}|wSnp|-J-:=;B-7-r|yv|{;\b-<-5n{5s|-<-?;=6-7-z]|vv|{; 6H----<<-sy|n-_nqv-J-rny]|v{`v r-<-}|wSnp|H----sy|n-|vtv{nyQr}u-J-tyl]|vv|{;H----sy|n-nqwrqQr}u-J-|vtv{nyQr}u-8-=;>H----sy|n-nqw-J-nqwrqQr}u-<-|vtv{nyQr}uH----z]|vv|{;\x07\b -J-z]|vv|{;\x07\b -7-nqwH----tyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H--0r{qvs\f");var md=new d.Vector4,gd=Object.assign({pointScale:new d.Uniform(1),pointMinPixel:new d.Uniform(1),pointMaxPixel:new d.Uniform(1),opacity:new d.Uniform(1),gradientTexture:new d.Uniform(null),modelAlpha:new d.Uniform(0),clippers:new d.Uniform([]),shownFloorIndex:new d.Uniform(-1),constantColor:new d.Uniform(null),geometricError:new d.Uniform(0),pixelRatio:new d.Uniform(1),resolution:new d.Uniform(new d.Vector2(512,512)),floor:new d.Uniform(0)},d.UniformsUtils.clone(d.UniformsLib.common)),Eu=function(n){le(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,f,A,p,y,v,m,h,g,b,w,E,C,x=n.call(this,{vertexShader:Ad,fragmentShader:vd,uniforms:d.UniformsUtils.clone(gd),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,M;return Object.defineProperties(x,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(S){this.uniforms.constantColor.value=S;var P=this.defines.USE_CONSTANT_COLOR,T=S!==null;P!==T&&(this.defines.USE_CONSTANT_COLOR=T,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(S){this.uniforms.opacity.value=S}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(S){this.uniforms.modelAlpha.value=S}},shownFloorIndex:{get:function(){return this.uniforms.shownFloorIndex.value},set:function(S){this.uniforms.shownFloorIndex.value=S}},clippers:{get:function(){return M},set:function(S){M!==S&&(M=S,this.uniforms.clippers.value=(M||[]).map(function(P){var T=typeof P.floorIndex=="number"?P.floorIndex:-1,B=new d.Matrix4().getInverse(P.clippingBoxMatrix);return{matrixInverse:B,floorIndex:T}}),this.needsUpdate=!0)}},pointColor:{get:function(){return this.defines.USE_POINT_COLOR_ALTITUDE===!0?"ALTITUDE":"RGB"},set:function(S){var P=S==="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(S){var P=S==="ATTENUATION",T=S==="GEOMETRIC";this.defines.USE_POINT_SIZE_GEOMETRIC!==T&&(this.defines.USE_POINT_SIZE_GEOMETRIC=T,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(S){var P=S==="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(S){this.uniforms.pointScale.value=S}},pointBack:{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(S){var P=S==="HIDDEN",T=S==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==P&&(this.defines.USE_POINT_BACK_HIDDEN=P,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==T&&(this.defines.USE_POINT_BACK_DARK=T,this.needsUpdate=!0)}},pointMinPixel:{get:function(){return this.uniforms.pointMinPixel.value},set:function(S){this.uniforms.pointMinPixel.value=S}},pointMaxPixel:{get:function(){return this.uniforms.pointMaxPixel.value},set:function(S){this.uniforms.pointMaxPixel.value=S}},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)}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(S){this.uniforms.gradientTexture.value=S}},floor:{get:function(){return this.uniforms.floor.value},set:function(S){this.uniforms.floor.value=S}}}),x.pano0=(r=e.pano0)!==null&&r!==void 0?r:we.pano0,x.pano1=(i=e.pano1)!==null&&i!==void 0?i:we.pano1,x.modelAlpha=(a=e.modelAlpha)!==null&&a!==void 0?a:we.modelAlpha,x.progress=(o=e.progress)!==null&&o!==void 0?o:we.progress,x.transition=(s=e.transition)!==null&&s!==void 0?s:we.transition,x.constantColor=(u=e.constantColor)!==null&&u!==void 0?u:we.constantColor,x.opacity=(l=e.opacity)!==null&&l!==void 0?l:we.opacity,x.shownFloorIndex=(c=e.shownFloorIndex)!==null&&c!==void 0?c:we.shownFloorIndex,x.clippers=(f=e.clippers)!==null&&f!==void 0?f:we.clippers,x.useEDL=(A=e.useEDL)!==null&&A!==void 0?A:we.useEDL,x.useHQWeight=(p=e.useHQWeight)!==null&&p!==void 0?p:we.useHQWeight,x.useHQDepth=(y=e.useHQDepth)!==null&&y!==void 0?y:we.useHQDepth,x.pointColor=(v=e.pointColor)!==null&&v!==void 0?v:we.pointColor,x.pointShape=(m=e.pointShape)!==null&&m!==void 0?m:we.pointShape,x.pointSize=(h=e.pointSize)!==null&&h!==void 0?h:we.pointSize,x.pointScale=(g=e.pointScale)!==null&&g!==void 0?g:we.pointScale,x.pointBack=(b=e.pointBack)!==null&&b!==void 0?b:we.pointBack,x.pointMinPixel=(w=e.pointMinPixel)!==null&&w!==void 0?w:we.pointMinPixel,x.pointMaxPixel=(E=e.pointMaxPixel)!==null&&E!==void 0?E:we.pointMaxPixel,x.gradientTexture=(C=e.gradientTexture)!==null&&C!==void 0?C:we.gradientTexture,x.floor=0,x.transparent=!1,x}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){if(r instanceof Ei)this.uniforms.pixelRatio.value=r.pixelRatio,this.uniforms.resolution.value.copy(r.resolution);else{this.uniforms.pixelRatio.value=e.getPixelRatio();var i=e.getViewport(md);this.uniforms.resolution.value.set(i.z,i.w)}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),yd=function(n){le(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.loadMesh=function(e,r){var i=this,a=r.json.meshes[e],o=a.primitives,s=Promise.all(o.map(function(c){return r.loadGeometry(c)})),u=Promise.all(o.map(function(c){return i.loadPBMMaterial(c,r)})),l=Promise.all([s,u]).then(function(c){for(var f=c[0],A=c[1],p=[],y=0;y<o.length;y++){var v=o[y],m=f[y],h=A[y];m.attributes.normal===void 0&&(h.flatShading=!0),m.attributes.tangent===void 0&&h.normalScale&&(h.normalScale.y*=-1);var g=v.mode||Re.TRIANGLES,b=void 0;if(g===Re.TRIANGLES||g===Re.TRIANGLE_STRIP||g===Re.TRIANGLE_FAN)g===Re.TRIANGLE_STRIP?m=r.toGeometryTrianglesDrawMode(m,d.TriangleStripDrawMode):g===Re.TRIANGLE_FAN&&(m=r.toGeometryTrianglesDrawMode(m,d.TriangleFanDrawMode)),m.clearGroups(),m.addGroup(0,m.index?m.index.count:m.attributes.position.count,0),m.attributes.normal||m.computeVertexNormals(),r.disposeSet.add(m),b=new Mt(m,[h]);else if(g===Re.POINTS)b=new vr(m,h);else throw new Error("glTF: Primitive mode unsupported: "+g);b.name=r.createUniqueName(a.name||"mesh_"+e),p.push(b)}if(p.length===1)return p[0];for(var w=new d.Group,E=0,C=p;E<C.length;E++){var b=C[E];w.add(b)}return w});return l},t.prototype.loadPBMMaterial=function(e,r){var i,a=(i=e.mode)!==null&&i!==void 0?i:Re.TRIANGLES,o=null;if(a===Re.TRIANGLES||a===Re.TRIANGLE_STRIP||a===Re.TRIANGLE_FAN)o=this.loadPBMMeshMaterial(e,r);else if(a===Re.POINTS)o=this.loadPBMPointCloudMaterial(e,r);else throw new Error("glTF: Primitive mode unsupported: "+a);return o},t.prototype.extendTexture=function(e,r,i){return e.minFilter=d.LinearFilter,e.magFilter=d.LinearFilter,e.generateMipmaps=!1,e},t.prototype.loadPBMPointCloudMaterial=function(e,r){var i=new Eu;return Object.keys(e.attributes).filter(function(a){return Ct[a]==="normal"}).length>0&&(i.defines.USE_POINT_NORMAL=!0),r.disposeSet.add(i),Promise.resolve(i)},t.prototype.loadPBMMeshMaterial=function(e,r){var i=[],a=new Qn;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(c){return Ct[c]==="color"}).length>0&&(a.vertexColors=!0),Object.keys(e.attributes).filter(function(c){return Ct[c]==="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(c){r.disposeSet.add(c),a.uniforms.map.value=c,a.defines.USE_MAP=!0})),o.doubleSided===!0&&(a.side=d.DoubleSide),o.normalTexture!==void 0&&(i.push(r.createMaterialTexture(o.normalTexture).then(function(c){r.disposeSet.add(c),a.uniforms.normalMap.value=c})),a.uniforms.normalScale.value=new d.Vector2(1,1),o.normalTexture.scale!==void 0)){var l=o.normalTexture.scale;a.uniforms.normalScale.value.set(l,l)}}return r.disposeSet.add(a),Promise.all(i).then(function(){return a})},t}(mr),Zr={KHR_binary_glTF:Zc,KHR_draco_mesh_compression:$c,KHR_texture_basisu:ld,KHR_texture_transform:cd,KHR_mesh_quantization:dd,EXT_meshopt_compression:fd,EXT_texture_webp:hd,CESIUM_RTC:pd,PBM_mesh:yd};function Da(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 Zr[u]}var l;if(typeof n=="string")l=n;else{var c=Zr.KHR_binary_glTF.getMagic(n);if(c===Zr.KHR_binary_glTF.HEADER_MAGIC){var f=new Zr.KHR_binary_glTF;try{f.loadGlbBinary(n)}catch(h){return Promise.reject(h)}a.KHR_binary_glTF=f,l=f.content}else l=pa(new Uint8Array(n))}var A=JSON.parse(l);if(A.asset===void 0||Number(A.asset.version[0])<2)return Promise.reject(new Error("glTF: Unsupported asset. glTF versions >=2.0 are supported."));if(A.extensionsUsed)for(var p=A.extensionsRequired||[],y=0;y<A.extensionsUsed.length;y++){var v=A.extensionsUsed[y];a[v]||(Zr[v]?a[v]=new Zr[v]:p.indexOf(v)>=0&&console.warn('glTF: Unknown extension "'+v+'".'))}var m=new _c(A,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 m.parse()}var bd=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function xu(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 gu(e,r,i)}).then(function(i){return wu(e,r,i)}).then(function(i){return Wc(e,r,i)})}).then(function(){var r;return Da(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(bd);var o=new d.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);if(a.premultiply(o),i.CESIUM_RTC){var s=new d.Matrix4().setPosition(i.CESIUM_RTC.center);a.premultiply(s)}var u=i.scene;return u.applyMatrix4(a),{type:"b3dm",uri:e.uri,byteLength:e.byteLength,object:u,dispose:function(){return i.dispose()}}})})}const Cu="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEIoYSl7b25tZXNz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04qTitFKkUpLHY9dCo0LGVbdl09QS9UKmgsZVsrK3ZdPU4vVCpoLGVbKyt2XT1FL1QqaDtyZXR1cm57YXJyYXk6ZSxpdGVtU2l6ZTo0LG5vcm1hbGl6ZWQ6ITB9fXJldHVybiBudWxsfX0pKCk7Cg==",Wo=typeof window!="undefined"&&window.Blob&&new Blob([atob(Cu)],{type:"text/javascript;charset=utf-8"});function wd(n){let t;try{if(t=Wo&&(window.URL||window.webkitURL).createObjectURL(Wo),!t)throw"";const e=new Worker(t,{name:n==null?void 0:n.name});return e.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),e}catch(e){return new Worker("data:application/javascript;base64,"+Cu,{name:n==null?void 0:n.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var Ed=new hu(function(){return new wd},2);function xd(n,t,e){var r=new yu(n.featureTableJson,n.featureTableBinary);return Promise.resolve().then(function(){var i=r.getExtension("3DTILES_draco_point_compression");return i?Cd(i,r):Ed.postMessage({featureTableBinary:r.buffer,featureTableJson:r.json},[r.buffer.buffer])}).then(function(i){return n.attributes=i,e})}function Cd(n,t){return yi(this,void 0,void 0,function(){var e,r,i,a,o,s;return bi(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",RGBA:"Uint8Array"},[2,pi.decodeGeometry(a.buffer,{attributeIDs:o,attributeTypes:s,useUniqueIDs:!0}).then(function(l){var c=l.getAttribute("POSITION"),f=l.getAttribute("RGB"),A=l.getAttribute("RGBA"),p=l.getAttribute("NORMAL"),y;if(A)y=A;else if(f){for(var v=f.count,m=f.array,h=new Uint8Array(v*4),g=0,b=void 0,w=void 0;g<v;g++)w=g*4,b=g*3,h[w]=m[b],h[++w]=m[++b],h[++w]=m[++b];y=new d.BufferAttribute(h,4,f.normalized)}return{position:c?{array:c.array,itemSize:c.itemSize,normalized:c.normalized}:null,color:y?{array:y.array,itemSize:y.itemSize,normalized:y.normalized}:null,normal:p?{array:p.array,itemSize:p.itemSize,normalized:p.normalized}:null}})]})})}function Mu(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 gu(e,r,i)}).then(function(i){return wu(e,r,i)}).then(function(i){return xd(e,r,i)})}).then(function(){var r;return Md(e.attributes,{computeBoundingBox:(r=t.computeBoundingBox)!==null&&r!==void 0?r:!0})}).then(function(r){var i=new d.Matrix4,a=new d.Matrix4().setPosition(e.rtcCenter[0],e.rtcCenter[1],e.rtcCenter[2]);return i.premultiply(a),r.object.applyMatrix4(i),{type:"pnts",uri:e.uri,byteLength:e.byteLength,object:r.object,dispose:function(){return r.dispose()}}})}function Md(n,t){var e=new Set,r=new d.BufferGeometry;e.add(r);var i=new Eu;e.add(i),n.position&&r.setAttribute("position",new d.BufferAttribute(n.position.array,n.position.itemSize,n.position.normalized)),n.color&&r.setAttribute("color",new d.BufferAttribute(n.color.array,n.color.itemSize,n.color.normalized)),n.normal&&(r.setAttribute("normal",new d.BufferAttribute(n.normal.array,n.normal.itemSize,n.normal.normalized)),i.defines.USE_POINT_NORMAL=!0),t.computeBoundingBox&&r.computeBoundingBox();var a=new vr(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 Su(){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,l=0,c=0,f,A,p,y,v,m;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||l<r;)if(f=l&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(i<<4)+f)===0)A=this._literalDecoder.getDecoder(l++,c),i>=7?c=A.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(a)):c=A.decodeNormal(this._rangeDecoder),this._outWindow.putByte(c),i=i<4?0:i-(i<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,i)===1)p=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,i)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(i<<4)+f)===0&&(i=i<7?9:11,p=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,i)===0?y=o:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,i)===0?y=s:(y=u,u=s),s=o),o=a,a=y),p===0&&(p=2+this._repLenDecoder.decode(this._rangeDecoder,f),i=i<7?8:11);else if(u=s,s=o,o=a,p=2+this._lenDecoder.decode(this._rangeDecoder,f),i=i<7?7:10,v=this._posSlotDecoder[p<=5?p-2:3].decode(this._rangeDecoder),v>=4){if(m=(v>>1)-1,a=(2|v&1)<<m,v<14)a+=n.reverseDecode2(this._posDecoders,a-v-1,this._rangeDecoder,m);else if(a+=this._rangeDecoder.decodeDirectBits(m-4)<<4,a+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),a<0){if(a===-1)break;return!1}}else a=v;if(a>=l||a>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(a,p),l+=p,c=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},n.Decoder.prototype.setDecoderProperties=function(t){var e,r,i,a,o;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),i=e%5,a=~~(e/5),!this.setLcLpPb(r,i,a))?!1:(o=t.readByte(),o|=t.readByte()<<8,o|=t.readByte()<<16,o+=t.readByte()*16777216,this.setDictionarySize(o))},n.decompress=function(t,e,r,i){var a=new n.Decoder;if(!a.setDecoderProperties(t))throw"Incorrect stream properties";if(!a.decode(e,r,i))throw"Error in data stream";return!0},n.decompressFile=function(t,e){var r=new n.Decoder,i;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(i=t.readByte(),i|=t.readByte()<<8,i|=t.readByte()<<16,i+=t.readByte()*16777216,t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,e,i))throw"Error in data stream";return!0},n}var Sd=Su();function Id(){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,l=0,c,f,A,p;e[e.length-1]==="="&&(o--,e[e.length-2]==="="&&o--);var y=new ArrayBuffer(o),v=new Uint8Array(y);for(u=0;u<s;u+=4)c=i[e.charCodeAt(u)],f=i[e.charCodeAt(u+1)],A=i[e.charCodeAt(u+2)],p=i[e.charCodeAt(u+3)],v[l++]=c<<2|f>>4,v[l++]=(f&15)<<4|A>>2,v[l++]=(A&3)<<6|p&63;return y}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/QRQQASIA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BAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=";return n(t)}function Td(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 l=Math.floor(this.offset/i);this.data[l]||(this.data[l]=new Uint8Array(i)),this.data[l][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 Pd(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),l=new Uint8Array(i.buffer,u+r,t.length);l.set(t);var c=s.decode(u),f=new Uint32Array(i.buffer,c,4),A=f[0],p=f[2],y=f[3];A?e(null,new Uint8Array(i.buffer,y+r,p).slice(0,p)):e(new Error("lzma deocder error"))}catch(v){e(v)}}var Bd=`
884
884
  var decodeLZMA = (function() {
885
- var LZMA = (`.concat(Tu.toString(),`)();
885
+ var LZMA = (`.concat(Su.toString(),`)();
886
886
  return function(data, callback) {
887
887
  return (`).concat(Td.toString(),`)(LZMA, data, callback);
888
888
  }
@@ -925,11 +925,11 @@ self.onmessage = function(event) {
925
925
  }
926
926
  postMessage({ id: packet.id, error: "type never matched." });
927
927
  };
928
- `),ma=typeof Worker!="undefined"&&typeof Blob!="undefined",Pu="";if(ma)try{var Rd=new Blob([Bd],{type:"text/javascript"});Pu=URL.createObjectURL(Rd)}catch(n){}var Bu=function(){function n(){var t=this;if(!ma)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(Pu);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=ma,n}();function Zo(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function Fd(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 v=Math.floor(this.offset/u);this.data[v]||(this.data[v]=new Uint8Array(u)),this.data[v][this.offset%u]=h,this.offset++}};Sd.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 kd(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var u=new Bu;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 Ru(n){var t=new Uint8Array(n),e=Zo(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]=Zo(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 Bu.support?kd(r):Promise.resolve(Fd(r))}var Xi=!1,Fu=[];function ku(n){if(n===void 0&&(n=!1),!(!n&&Xi)){Xi=!0;var t=Fu.shift();if(t){try{t()}catch(e){}ft.shared.add(function(){return ku(!0)},!0,2,-100)}else Xi=!1}}function mi(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};Fu.push(r),ft.shared.add(function(){return ku()},!0,2,-100)})}function nr(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 Ld(n,t){for(var e=F({},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 dn(n){return"hash::".concat(En(n,!1))}const kr=Br.Reader,_t=Br.util,Ut=Br.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(Br.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Lu=Ut.Model=(()=>{function n(t){if(this.chunks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.chunks=_t.emptyArray,n.prototype.createAt=_t.Long?_t.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof kr||(e=kr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ut.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Ut.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})();Ut.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 kr||(e=kr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ut.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=Ut.Vertices.decode(e,e.uint32());break}case 2:{a.faces=Ut.Faces.decode(e,e.uint32());break}case 3:{a.name=e.string();break}case 4:{a.texture=e.string();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("vertices"))throw _t.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw _t.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw _t.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Ut.Vertices=(()=>{function n(t){if(this.xyz=[],this.uvs=[],this.marks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.xyz=_t.emptyArray,n.prototype.uvs=_t.emptyArray,n.prototype.marks=_t.emptyArray,n.decode=function(e,r){e instanceof kr||(e=kr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ut.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})();Ut.Faces=(()=>{function n(t){if(this.indices=[],this.normals=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.indices=_t.emptyArray,n.prototype.normals=_t.emptyArray,n.decode=function(e,r){e instanceof kr||(e=kr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ut.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})();Ut.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function Ou(n,t){var e,r,i,a={byteLength:0},o=za((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]=Ua(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,mi(function(){var v=new Uint8Array(h.body);return Lu.decode(v)})}).then(function(h){return mi(function(){var v,p;return Nu(h,(v=t.textureBaseUri)!==null&&v!==void 0?v: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""}(),((p=t.textureArray)!==null&&p!==void 0?p:[]).slice(),o,s,t.fetcher)})}).then(function(h){var v=new d.Group;v.renderOrder=-4,v.matrixAutoUpdate=!1,v.matrix.compose(v.position,v.quaternion,v.scale),v.name=n;for(var p=0,m=h.objects;p<m.length;p++){var A=m[p];v.add(A)}return h.texturePromise.then(function(){return{type:"pbm",uri:n,byteLength:a.byteLength,object:v,dispose:function(){return h.dispose()}}})})}function Vu(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function ga(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function Od(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function Yo(n){var t=Vu(n.name),e=ga(n.name),r=Od(n.name);return t*1e6+e*1e3+r}function Vd(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 v=0,p=n.chunks;v<p.length;v++){var h=p[v];if(!h.faces.normals||h.faces.normals.length===0){s=!1;break}}for(var m=n.chunks.sort(function(qe,Zt){return Yo(qe)-Yo(Zt)}),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 x=0,E=0;E<w.length;E++){var h=w[E];x+=h.faces.indices.length}for(var M=new Float32Array(x*3),C=new Float32Array(x),S=new Float32Array(x*2),P=new Float32Array(x*3),I=[],B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],L=0,k=0;k<w.length;k++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],h=w[k],N=h.vertices.xyz,D=h.vertices.uvs,H=h.faces.indices,z=h.faces.normals,U=h.vertices.marks,q=H.length,E=0;E<q;E++){var j=H[E],_=M[L*3+E*3]=N[j*3],Z=M[L*3+E*3+1]=N[j*3+1],W=M[L*3+E*3+2]=N[j*3+2];C[L+E]=u?U[j]:0,S[L*2+E*2]=D[j*2],S[L*2+E*2+1]=D[j*2+1];var Y=Math.floor(E/3)*3;P[L*3+E*3]=z[Y],P[L*3+E*3+1]=z[Y+1],P[L*3+E*3+2]=z[Y+2],_<O[0]&&(O[0]=_),Z<O[1]&&(O[1]=Z),W<O[2]&&(O[2]=W),_>O[3]&&(O[3]=_),Z>O[4]&&(O[4]=Z),W>O[5]&&(O[5]=W)}O[0]<B[0]&&(B[0]=O[0]),O[1]<B[1]&&(B[1]=O[1]),O[2]<B[2]&&(B[2]=O[2]),O[3]>B[3]&&(B[3]=O[3]),O[4]>B[4]&&(B[4]=O[4]),O[5]>B[5]&&(B[5]=O[5]),I.push({materialIndex:k,name:h.name,chunkName:ga(h.name),start:L,count:h.faces.indices.length,texture:(e=h.texture)!==null&&e!==void 0?e:void 0}),L+=q}var ce={createAt:i,description:a,vertices:M,uvs:S,normals:P,indices:null,floorIndex:b,groups:I,extents:B,vertexMarks:C};o.push(ce)}else{for(var x=0,te=0,E=0;E<w.length;E++){var h=w[E];te+=h.vertices.xyz.length/3,x+=h.faces.indices.length}for(var M=new Float32Array(te*3),S=new Float32Array(te*2),P=new Float32Array(te*3),se=new Float32Array(te),ue=new Uint32Array(x),C=new Float32Array(x),I=[],B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],pe=0,L=0,k=0;k<w.length;k++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],h=w[k],N=h.vertices.xyz,U=h.vertices.marks,D=h.vertices.uvs,H=h.faces.indices,he=N.length/3,q=H.length,E=0;E<he;E++){var _=M[L*3+E*3]=N[E*3],Z=M[L*3+E*3+1]=N[E*3+1],W=M[L*3+E*3+2]=N[E*3+2];C[L+E]=u?U[E]:0,S[L*2+E*2]=D[E*2],S[L*2+E*2+1]=D[E*2+1],se[L+E]=b,_<O[0]&&(O[0]=_),Z<O[1]&&(O[1]=Z),W<O[2]&&(O[2]=W),_>O[3]&&(O[3]=_),Z>O[4]&&(O[4]=Z),W>O[5]&&(O[5]=W)}O[0]<B[0]&&(B[0]=O[0]),O[1]<B[1]&&(B[1]=O[1]),O[2]<B[2]&&(B[2]=O[2]),O[3]>B[3]&&(B[3]=O[3]),O[4]>B[4]&&(B[4]=O[4]),O[5]>B[5]&&(B[5]=O[5]);for(var E=0;E<q;E++)ue[pe+E]=L+H[E];I.push({materialIndex:k,name:h.name,chunkName:ga(h.name),start:pe,count:h.faces.indices.length,texture:(r=h.texture)!==null&&r!==void 0?r:void 0}),L+=he,pe+=q}for(var E=0;E<x;E+=3){var de=void 0,be=void 0,fe=void 0,Se=void 0,ee=void 0,le=void 0,X=void 0,Te=void 0,Fe=void 0,Ye=void 0,Xe=void 0,Ge=void 0,st=void 0,Ne=void 0,me=void 0,Ae=void 0,nt=void 0,Ce=void 0,He=void 0,Oe=void 0,it=void 0;de=ue[E]*3,be=ue[E+1]*3,fe=ue[E+2]*3,Se=M[de],ee=M[de+1],le=M[de+2],X=M[be],Te=M[be+1],Fe=M[be+2],Ye=M[fe],Xe=M[fe+1],Ge=M[fe+2],st=Ye-X,Ne=Xe-Te,me=Ge-Fe,Ae=Se-X,nt=ee-Te,Ce=le-Fe,He=Ne*Ce-me*nt,Oe=me*Ae-st*Ce,it=st*nt-Ne*Ae,P[de]+=He,P[de+1]+=Oe,P[de+2]+=it,P[be]+=He,P[be+1]+=Oe,P[be+2]+=it,P[fe]+=He,P[fe+1]+=Oe,P[fe+2]+=it}var ce={createAt:i,description:a,vertices:M,uvs:S,normals:P,indices:ue,floorIndex:b,groups:I,extents:B,vertexMarks:C};o.push(ce)}}return o}function Ua(n,t,e,r){var i=F({key:"texture.pbm"},nr(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,u});return Object.assign(o,{url:n,textureOptions:t})}function Nu(n,t,e,r,i,a,o){i===void 0&&(i={});for(var s=Vd(n),u=0,c="",l=[],h={},v=new Set,p=0,m=s;p<m.length;p++){var A=m[p],y=A.createAt,f=A.description,g=A.vertices,b=A.vertexMarks,w=A.uvs,x=A.normals,E=A.indices,M=A.floorIndex,C=A.groups,S=A.extents,P=new d.Box3;P.min.x=S[0],P.min.y=S[1],P.min.z=S[2],P.max.x=S[3],P.max.y=S[4],P.max.z=S[5];var I=new d.BufferGeometry;I.setAttribute("position",new d.BufferAttribute(g,3)),I.setAttribute("uv",new d.BufferAttribute(w,2)),I.setAttribute("normal",new d.BufferAttribute(x,3)),I.setAttribute("isRoofMark",new d.BufferAttribute(b,1)),E&&I.setIndex(new d.BufferAttribute(E,1)),I.boundingBox=P,I.boundingSphere=P.getBoundingSphere(new d.Sphere);for(var B=0,L=C;B<L.length;B++){var k=L[B];I.addGroup(k.start,k.count,k.materialIndex)}v.add(I);for(var O=[],N=0,D=C;N<D.length;N++){var k=D[N],H=e[k.chunkName]||(k.texture?xt(t||"",k.texture):void 0),z=new Un;z.defines.USE_VERTEX_FLOOR=!1,z.floor=M,O.push(z),H?h[H]?h[H].push(z):h[H]=[z]:(z.defines.USE_MAP=!1,z.uniforms.diffuse.value=new d.Color(16777215)),v.add(z)}var U=new Gt(I,O);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 q="",j=function(Z){Z=za(Z,e.length);var W=[],Y=dn(Z);if(q===Y)return Promise.resolve();q=Y;for(var ce=function(pe){var he=null;pe in i&&(dn(i[pe].textureOptions)===dn(Z)?he=i[pe]:i[pe].then(function(de){return de.dispose()})),he||(he=Ua(pe,Z,a)),W.push(he.then(function(de){if(q!==Y){de.dispose();return}for(var be=0,fe=h[pe];be<fe.length;be++){var Se=fe[be];Se.uniforms.map.value&&(v.delete(Se.uniforms.map.value),Se.uniforms.map.value.dispose()),Se.uniforms.map.value=de,v.add(de),Se.uniforms.exposure.value=3.3}}).catch(function(){if(q===Y)for(var de=0,be=h[pe];de<be.length;de++){var fe=be[de];fe.uniforms.map.value&&(v.delete(fe.uniforms.map.value),fe.uniforms.map.value.dispose()),fe.uniforms.map.value=null,fe.defines.USE_MAP=!1,fe.uniforms.diffuse.value=new d.Color(16777215)}}))},te=0,se=Object.keys(h);te<se.length;te++){var ue=se[te];ce(ue)}for(var ue in i)delete i[ue];return Promise.all(W).then(function(){})},_=j(r);return{createAt:u,description:c,objects:l,texturePromise:_,updateTexture:j,dispose:function(){v.forEach(function(Z){Z.dispose()}),v.clear()}}}function za(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=za((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]=Ua(l,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(h){return Ru(h.body)}).then(function(h){return mi(function(){for(var v,p={chunks:[],createAt:void 0,description:void 0},m=0,A=h;m<A.length;m++){var y=A[m],f=Lu.decode(y);f.chunks.length&&((v=p.chunks).push.apply(v,f.chunks),p.createAt=f.createAt,p.description=f.description)}return p})}).then(function(h){return mi(function(){var v,p,m;return Nu(h,(v=t.textureBaseUri)!==null&&v!==void 0?v: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""}(),((p=t.textureArray)!==null&&p!==void 0?p:[]).slice(),(m=t.textureOptions)!==null&&m!==void 0?m:{},s,t.fetcher)})}).then(function(h){var v=new d.Group;v.renderOrder=-4,v.name=n;for(var p=0,m=h.objects;p<m.length;p++){var A=m[p];v.add(A)}return h.texturePromise.then(function(){return{type:"at3d",uri:n,byteLength:a.byteLength,object:v,dispose:function(){return h.dispose()}}})})}const ze=Br.Reader,ot=Br.util,Ee=Br.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(Br.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),Nd=Ee.Model=(()=>{function n(t){if(this.meshes=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.meshes=ot.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ee.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(Ee.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})();Ee.Mesh=(()=>{function n(t){if(this.chunks=[],this.matrix=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.name="",n.prototype.chunks=ot.emptyArray,n.prototype.matrix=ot.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ee.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(Ee.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(Ee.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw ot.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();Ee.Matrix=(()=>{function n(t){if(this.elements=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.elements=ot.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ee.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})();Ee.Chunk=(()=>{function n(t){if(this.material=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.geometry=null,n.prototype.material=ot.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ee.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=Ee.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(Ee.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw ot.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Ee.Geometry=(()=>{function n(t){if(this.groups=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.position=null,n.prototype.uv=null,n.prototype.uv2=null,n.prototype.normal=null,n.prototype.groups=ot.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ee.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=Ee.Position.decode(e,e.uint32());break}case 2:{a.uv=Ee.UV.decode(e,e.uint32());break}case 3:{a.uv2=Ee.UV.decode(e,e.uint32());break}case 4:{a.normal=Ee.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(Ee.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw ot.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw ot.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();Ee.Position=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=ot.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ee.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})();Ee.UV=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=ot.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ee.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})();Ee.Normal=(()=>{function n(t){if(this.array=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.array=ot.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ee.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})();Ee.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 ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ee.Group;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.start=e.uint32();break}case 2:{a.count=e.uint32();break}case 3:{a.materialIndex=e.uint32();break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("start"))throw ot.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw ot.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw ot.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();Ee.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 ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ee.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=Ee.Color.decode(e,e.uint32());break}case 2:{a.ks=Ee.Color.decode(e,e.uint32());break}case 3:{a.ke=Ee.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})();Ee.Color=(()=>{function n(t){if(this.rgb=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.rgb=ot.emptyArray,n.decode=function(e,r){e instanceof ze||(e=ze.create(e));let i=r===void 0?e.len:e.pos+r,a=new Ee.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 Du(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,Uu(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 Qd(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 Dd(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 tn(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Ar(n)||(n=xt(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=F({key:"texture.dome",size:64},nr(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 Ud(n,t,e,r,i,a,o){var s=[],u=new Un;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 v=n.mapkdrepeat.split(/\s+/).map(function(y){return Number(y)}),p=v[0],m=v[1];h=new d.Vector2(p,m)}s.push(tn(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(tn(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(tn(n.mapke,t,e,null,r,i,a).then(function(y){c.emissiveMap.value=y,o.add(y)}).catch(Q)),n.norm&&s.push(tn(n.norm,t,e,null,r,i,a).then(function(y){c.normalMap.value=y,o.add(y)}).catch(Q)),n.mapbump&&s.push(tn(n.mapbump,t,e,null,r,i,a).then(function(y){c.bumpMap.value=y,o.add(y)}).catch(Q)),n.bump&&s.push(tn(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 zd(n){return Nd.decode(n).meshes}function Uu(n,t,e,r){for(var i=[],a=[],o=new Set,s=zd(n),u=new An,c=new d.Matrix4,l=new d.Vector3,h=new d.Quaternion,v=new d.Vector3,p={},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,x=b;w<x.length;w++){var E=x[w];c.elements=E.elements;var M=new d.Group;M.renderOrder=-4;for(var C=0;C<g.length;C++){var S=Dd(g[C].geometry);S.applyMatrix4(c),c.decompose(l,h,v),v.x*v.y*v.z<0&&S.attributes.normal&&S.attributes.position&&S.attributes.uv&&Qd(S),o.add(S);for(var P=[],I=0,B=g[C].material;I<B.length;I++){var L=B[I],k=Ud(L,t||"",e,u,r,p,o),O=k.material,N=k.textureReady;a.push(N),P.push(O)}var D=new Gt(S,P);D.name="chunk_"+C,D.matrix.compose(D.position,D.quaternion,D.scale),D.matrixAutoUpdate=!1,D.frustumCulled=!1,D.renderOrder=-1e3,M.add(D)}M.name=f,i.push(M)}}var H=Promise.all(a).catch(Q),z=function(U){return Promise.resolve()};return{createAt:0,description:"",objects:i,texturePromise:H,updateTexture:z,dispose:function(){o.forEach(function(U){U.dispose()}),o.clear()}}}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,Ru(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 Uu(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 Gd=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Hd(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 Da(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(Gd),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 rn=new d.Vector3,Jo=new d.Matrix4,qd=30;function $o(n,t){var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras)r instanceof Gt?(r.material.forEach(function(g){g.floor=t.extras.floor}),r.renderOrder=-1e3+t.extras.floor):r instanceof Fr&&(r.material.floor=t.extras.floor,r.renderOrder=-1e3+t.extras.floor);else if((r instanceof Gt||r instanceof Fr)&&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];rn.set(a.array[y*3+0],a.array[y*3+1],a.array[y*3+2]),rn.applyMatrix4(r.matrixWorld);var h=rn.y;s[y]=0;for(var v=0;v<e.length;v++){var f=e[v],m=f.ground,A=f.height;if(h<m+A){s[y]=v;break}}u+=s[y]}o=u/c}else{for(var u=0,c=a.count,l=0;l<c;l++){rn.set(a.array[l*3+0],a.array[l*3+1],a.array[l*3+2]),rn.applyMatrix4(r.matrixWorld);var h=rn.y;s[l]=0;for(var v=0;v<e.length;v++){var p=e[v],m=p.ground,A=p.height;if(h<m+A){s[l]=v;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 Qt=function(n){oe(t,n);function t(e,r,i){var a,o,s,u,c=n.call(this)||this;c.model=e,c.search=(a=i.search)!==null&&a!==void 0?a:"",c.unloadTileQueue=[],c.boundingBox=new d.Box3,c.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,c.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,c.needsRefined=!0,c.refined=!1,c.refineProgress=[0,0],c.loaded=!1,c.disposed=!1,c.needsRender=!0,c.matrixAutoUpdate=!1,c.renderOrder=-4,c.lastRefineTime=-1,c.nodes=new Map,c.nodeGroup=new d.Group,c.nodeGroup.matrixAutoUpdate=!1,c.nodeGroup.renderOrder=-4,c.add(c.nodeGroup),c.debugBoundings=new Map,c.debugBoundingGroup=new d.Group,c.debugBoundingGroup.visible=!1,c.debugBoundingGroup.matrixAutoUpdate=!1,c.debugBoundingGroup.renderOrder=-4,c.add(c.debugBoundingGroup),c.cacheCameras=[];var l=Do(r,(o=i.resourcePath)!==null&&o!==void 0?o:"");return c.tileset=new ri((u=(s=c.model.work)===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",l,{contentLoader:function(h){return c.loadContent(h,{fetcher:i.fetcher})},onTileLoad:function(){},onTileUnload:function(h){c.unloadTileQueue.push(h)},onTileError:function(h,v){i.onError&&i.onError(Object.assign(v,{error:v})),console.error("Tile error",h.id,v)}}),c.tileset.root.boundingVolume&&c.tileset.root.boundingVolume.getBoundingBox(c.boundingBox),c}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=yu(a.uri,this.search);if(e.type==="TILESET"){var s=Wt(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 Do(JSON.parse(u),c)}).then(function(u){return e.geometricError=u.geometricError,e.children.length===0&&(e.children=[new Qa("".concat(e.id,".0"),u.root,e.tileset,e)]),!0})}return e.type==="SCENEGRAPH"?Promise.resolve().then(function(){var u,c,l,h,v,p,m,A,y,f,g="",b=o.split("#"),w=b[0],x=b[1],E=(x||w).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(E&&(g=E[1]),g==="b3dm"){var M=Wt(o,{key:"model.".concat(e.siblingIndex)});return Cu(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,$o(C.object,e),C})}if(g==="pnts"){var M=Wt(o,{key:"model.".concat(e.siblingIndex)});return Iu(M,{fetcher:r.fetcher,computeBoundingBox:!1}).then(function(S){if(S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,e.boundingVolume){var P=e.boundingVolume;S.object.traverse(function(I){if(I instanceof Fr){Jo.getInverse(I.matrixWorld);var B=new d.Box3;P.getBoundingBox(B),B.applyMatrix4(Jo),I.geometry.boundingBox=B}})}return S})}if(g==="glb"){var M=Wt(o,{key:"model.".concat(e.siblingIndex)});return Hd(M,{upAxis:e.tileset.asset.gltfUpAxis,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,$o(S.object,e),S})}if(g==="at3d"){var M=e.extras.at3d?o:Wt(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(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}if(g==="pbm"){var M=e.extras.pbm?o:Wt(o,{key:"model.".concat(e.siblingIndex)});return Ou(M,{textureBaseUri:(h=e.extras.pbm)===null||h===void 0?void 0:h.textureBaseUri,textureArray:(v=e.extras.pbm)===null||v===void 0?void 0:v.textureArray,textureOptions:(p=e.extras.pbm)===null||p===void 0?void 0:p.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}if(g==="dome"){var M=e.extras.dome?o:Wt(o,{key:"model.".concat(e.siblingIndex)});return Du(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(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}if(g==="domez"){var M=e.extras.domez?o:Wt(o,{key:"model.".concat(e.siblingIndex)});return zu(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(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}}).then(function(u){if(!u)return Promise.resolve(!1);if(u.type==="pnts"){var c=u.object,l=c.material;l.uniforms.geometricError.value=e.geometricError}var h={type:u.type,uri:u.uri,byteLength:u.byteLength,object:new mu(u.object,u.dispose)};return h.object.generateBvhTree().then(function(){return h})}).then(function(u){if(!u)return!1;if(i.disposed)return u.object.dispose(),a.data=void 0,a.byteLength=0,!1;if(u.object.traverse(function(l){(l instanceof Fr||l instanceof Gt)&&(l.model=i.model)}),a.data=u,a.byteLength=u.byteLength,u.object.traverse(function(l){l.renderOrder>-4&&(l.renderOrder=-4)}),u.object.visible=!1,i.boundingBox.expandByObject(u.object),i.nodes.set(e.id,u.object),i.nodeGroup.add(u.object),e.boundingVolume){var c=Cc(e.boundingVolume,e.state.selectionDepth);c.matrixWorldNeedsUpdate=!0,c.matrixAutoUpdate=!1,c.frustumCulled=!1,c.visible=!1,i.debugBoundings.set(e.id,c),i.debugBoundingGroup.add(c)}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(v,p){return v.distance-p.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>qd){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,refine:r.refineModel},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 Bn().setFromCamera(r)},s=this.cacheCameras.map(function(v){return F(F({},o),{camera:{position:new d.Vector3().copy(v.position),direction:v.getWorldDirection(new d.Vector3),up:new d.Vector3().copy(v.up),visible:v.visible,refine:!0},cullingVolume:new Bn().setFromCamera(v)})});this.tileset.traverse(o,s),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(v){if(i.refineProgress[1]++,v.content&&v.state.visible){var p=v.content.loadState;if(p==="UNLOADED"||p==="LOADING"){i.refined=!1;return}}i.refineProgress[0]++}),this.loaded===!1&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(v){if(i.loaded!==!1&&v.content&&v.state.visible&&v.state.selectionDepth===0){var p=v.content.loadState;(p==="UNLOADED"||p==="LOADING")&&(i.loaded=!1)}}))}for(var u,c;c=this.unloadTileQueue.pop();){var l=c.id,h=c.content;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),h&&h.data&&(h.byteLength=0,h.data.object.dispose(),h.data=void 0)}this.tileset.tiles.forEach(function(v){var p=v.selected,m=v.id;u=i.nodes.get(m),u&&u.visible!==p&&(u.visible=p,i.needsRender=!0),u=i.debugBoundings.get(m),u&&u.visible!==p&&(u.visible=p,i.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;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),o&&o.data&&(o.data.object.dispose(),o.data=void 0,o.byteLength=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=ri.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_MAX_REQUESTS=ri.DEFAULT_MAX_REQUESTS,t}(d.Object3D);function ae(n,t,e){return n<t?t:n>e?e:n}function Kd(n){return-((n-.25)*360+90)/180*Math.PI}function ya(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(!ya(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(!ya(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Kt(n){return typeof n=="number"}function jd(n){return(n&n-1)===0&&n!==0}var es=function(){return new Error("Invalid input.")},ts=function(){return new Error("Invalid certificate.")},rs=function(){return new Error("Invalid signature.")},Wd=function(n){return new Error("date(".concat(n.toString(),") expired."))},Xd=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function _d(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 Mn(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+=Mn(n[a],!1)+",";return i>-1&&(r+=Mn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return Mn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],c=Mn(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 Zd(n){return String(Mn(n,!1))}function Gu(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return es();for(var s=function(x){var E=Gu(n[x]);if(E instanceof Error)return{value:E};if(!i)i=E.issuer;else if(i!==E.issuer)return{value:ts()};a?E.expire.getTime()<a.getTime()&&(a=E.expire):a=E.expire,o?o=o.filter(function(M){return E.allowHosts.indexOf(M)!==-1}):o=E.allowHosts},u=0;u<n.length;u++){var c=s(u);if(typeof c=="object")return c.value}return on({issuer:i,expire:a,allowHosts:o})}var l=JSON.parse(n),h=typeof location!="undefined"?location.hostname:"",v=Date.now();if(typeof l!="object")return es();var p=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||Wr(h)||rr.filter(function(x){return Rr(x,h)}).length>0){var A=String((t=l.certificate)!==null&&t!==void 0?t:"");if(A){var y=new Qe;return y.readCertPEM(A),on({issuer:y.getSubjectString(),expire:p,allowHosts:m})}return on({issuer:"none",expire:p,allowHosts:m})}var f=String((e=l.certificate)!==null&&e!==void 0?e:"");if(!f)return ts();var g=new Qe;g.readCertPEM(f);var b=String((r=l._signature)!==null&&r!==void 0?r:"");if(!b)return rs();var w=Zd(_d(l,["_signature"]));return Pl(w,b,g)===!1?rs():v<p.getTime()?m.filter(function(x){return Rr(x,h)}).length===0?Xd(h):on({issuer:g.getSubjectString(),expire:p,allowHosts:m}):Wd(p)}var ns=new d.Matrix4,Ga=new WeakMap,Ha=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=Yd(t,e,this);if(r instanceof Error)throw new Error("[PARSE FAILED]: "+r.message+`
928
+ `),va=typeof Worker!="undefined"&&typeof Blob!="undefined",Iu="";if(va)try{var Rd=new Blob([Bd],{type:"text/javascript"});Iu=URL.createObjectURL(Rd)}catch(n){}var Tu=function(){function n(){var t=this;if(!va)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(Iu);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=va,n}();function Xo(n){return Array.prototype.reduce.call(n,function(t,e,r){return t|e<<r*8},0)}function Fd(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,l={data:[],offset:0,writeByte:function(f){var A=Math.floor(this.offset/u);this.data[A]||(this.data[A]=new Uint8Array(u)),this.data[A][this.offset%u]=f,this.offset++}};Sd.decompressFile(s,l),i=new Uint8Array(l.offset);for(var c=0;c<l.offset;c++)i[c]=l.data[Math.floor(c/u)][c%u];t.push(i)},i,a=0;a<e;a++)r(a);return t}function kd(n){for(var t=[],e=n.length,r=function(a){t.push(new Promise(function(o,s){var u=new Tu;u.decompress(n[a],function(l,c){if(u.terminate(),l)return s(l);o(c)})}))},i=0;i<e;i++)r(i);return Promise.all(t)}function Pu(n){var t=new Uint8Array(n),e=Xo(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]=Xo(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 Tu.support?kd(r):Promise.resolve(Fd(r))}var ji=!1,Bu=[];function Ru(n){if(n===void 0&&(n=!1),!(!n&&ji)){ji=!0;var t=Bu.shift();if(t){try{t()}catch(e){}lt.shared.add(function(){return Ru(!0)},!0,2,-100)}else ji=!1}}function vi(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(i){e(i)}};Bu.push(r),lt.shared.add(function(){return Ru()},!0,2,-100)})}function gr(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 Ld(n,t){for(var e=k({},n),r=0,i=t;r<i.length;r++){var a=i[r];a in e&&delete e[a]}return e}function bn(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+=bn(n[a],!1)+",";return i>-1&&(r+=bn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return bn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],l=bn(n[u],!0);l!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+l),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 Bn(n){return"hash::".concat(bn(n,!1))}const Fr=Br.Reader,jt=Br.util,Lt=Br.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(Br.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Fu=Lt.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=jt.emptyArray,n.prototype.createAt=jt.Long?jt.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r){e instanceof Fr||(e=Fr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Lt.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.chunks&&a.chunks.length||(a.chunks=[]),a.chunks.push(Lt.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})();Lt.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 Fr||(e=Fr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Lt.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.vertices=Lt.Vertices.decode(e,e.uint32());break}case 2:{a.faces=Lt.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 jt.ProtocolError("missing required 'vertices'",{instance:a});if(!a.hasOwnProperty("faces"))throw jt.ProtocolError("missing required 'faces'",{instance:a});if(!a.hasOwnProperty("name"))throw jt.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Lt.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=jt.emptyArray,n.prototype.uvs=jt.emptyArray,n.prototype.marks=jt.emptyArray,n.decode=function(e,r){e instanceof Fr||(e=Fr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Lt.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})();Lt.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=jt.emptyArray,n.prototype.normals=jt.emptyArray,n.decode=function(e,r){e instanceof Fr||(e=Fr.create(e));let i=r===void 0?e.len:e.pos+r,a=new Lt.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})();Lt.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function ku(n,t){var e,r,i,a={byteLength:0},o=za((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,l=t.textureArray;u<l.length;u++){var c=l[u];s[c]=Ua(c,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return a.byteLength=f.body.byteLength,vi(function(){var A=new Uint8Array(f.body);return Fu.decode(A)})}).then(function(f){return vi(function(){var A,p;return Ou(f,(A=t.textureBaseUri)!==null&&A!==void 0?A:function(){var y=n.lastIndexOf("/");if(y>=0){var v=n.slice(0,y)+"/";return/\/model\/$/.test(v)&&(v=v.replace(/\/model\/$/,"/materials/")),v}return""}(),((p=t.textureArray)!==null&&p!==void 0?p:[]).slice(),o,s,t.fetcher)})}).then(function(f){var A=new d.Group;A.renderOrder=-4,A.matrixAutoUpdate=!1,A.matrix.compose(A.position,A.quaternion,A.scale),A.name=n;for(var p=0,y=f.objects;p<y.length;p++){var v=y[p];A.add(v)}return f.texturePromise.then(function(){return{type:"pbm",uri:n,byteLength:a.byteLength,object:A,dispose:function(){return f.dispose()}}})})}function Lu(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function Aa(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function Od(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function _o(n){var t=Lu(n.name),e=Aa(n.name),r=Od(n.name);return t*1e6+e*1e3+r}function Vd(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,l=0,c=n.chunks;l<c.length;l++){var f=c[l];if(!f.vertices.marks||f.vertices.marks.length===0){u=!1;break}}for(var A=0,p=n.chunks;A<p.length;A++){var f=p[A];if(!f.faces.normals||f.faces.normals.length===0){s=!1;break}}for(var y=n.chunks.sort(function(it,tt){return _o(it)-_o(tt)}),v=[],m=0,h=y;m<h.length;m++){var f=h[m],g=Lu(f.name);v[g]||(v[g]=[]),v[g].push(f)}for(var b=0;b<v.length;b++){var w=v[b];if(w)if(s){for(var E=0,C=0;C<w.length;C++){var f=w[C];E+=f.faces.indices.length}for(var x=new Float32Array(E*3),M=new Float32Array(E),S=new Float32Array(E*2),P=new Float32Array(E*3),T=[],B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],F=0,L=0;L<w.length;L++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=w[L],Q=f.vertices.xyz,N=f.vertices.uvs,H=f.faces.indices,K=f.faces.normals,U=f.vertices.marks,G=H.length,C=0;C<G;C++){var X=H[C],Z=x[F*3+C*3]=Q[X*3],q=x[F*3+C*3+1]=Q[X*3+1],W=x[F*3+C*3+2]=Q[X*3+2];M[F+C]=u?U[X]:0,S[F*2+C*2]=N[X*2],S[F*2+C*2+1]=N[X*2+1];var J=Math.floor(C/3)*3;P[F*3+C*3]=K[J],P[F*3+C*3+1]=K[J+1],P[F*3+C*3+2]=K[J+2],Z<O[0]&&(O[0]=Z),q<O[1]&&(O[1]=q),W<O[2]&&(O[2]=W),Z>O[3]&&(O[3]=Z),q>O[4]&&(O[4]=q),W>O[5]&&(O[5]=W)}O[0]<B[0]&&(B[0]=O[0]),O[1]<B[1]&&(B[1]=O[1]),O[2]<B[2]&&(B[2]=O[2]),O[3]>B[3]&&(B[3]=O[3]),O[4]>B[4]&&(B[4]=O[4]),O[5]>B[5]&&(B[5]=O[5]),T.push({materialIndex:L,name:f.name,chunkName:Aa(f.name),start:F,count:f.faces.indices.length,texture:(e=f.texture)!==null&&e!==void 0?e:void 0}),F+=G}var ve={createAt:i,description:a,vertices:x,uvs:S,normals:P,indices:null,floorIndex:b,groups:T,extents:B,vertexMarks:M};o.push(ve)}else{for(var E=0,re=0,C=0;C<w.length;C++){var f=w[C];re+=f.vertices.xyz.length/3,E+=f.faces.indices.length}for(var x=new Float32Array(re*3),S=new Float32Array(re*2),P=new Float32Array(re*3),se=new Float32Array(re),ie=new Uint32Array(E),M=new Float32Array(E),T=[],B=[1/0,1/0,1/0,-1/0,-1/0,-1/0],pe=0,F=0,L=0;L<w.length;L++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],f=w[L],Q=f.vertices.xyz,U=f.vertices.marks,N=f.vertices.uvs,H=f.faces.indices,ne=Q.length/3,G=H.length,C=0;C<ne;C++){var Z=x[F*3+C*3]=Q[C*3],q=x[F*3+C*3+1]=Q[C*3+1],W=x[F*3+C*3+2]=Q[C*3+2];M[F+C]=u?U[C]:0,S[F*2+C*2]=N[C*2],S[F*2+C*2+1]=N[C*2+1],se[F+C]=b,Z<O[0]&&(O[0]=Z),q<O[1]&&(O[1]=q),W<O[2]&&(O[2]=W),Z>O[3]&&(O[3]=Z),q>O[4]&&(O[4]=q),W>O[5]&&(O[5]=W)}O[0]<B[0]&&(B[0]=O[0]),O[1]<B[1]&&(B[1]=O[1]),O[2]<B[2]&&(B[2]=O[2]),O[3]>B[3]&&(B[3]=O[3]),O[4]>B[4]&&(B[4]=O[4]),O[5]>B[5]&&(B[5]=O[5]);for(var C=0;C<G;C++)ie[pe+C]=F+H[C];T.push({materialIndex:L,name:f.name,chunkName:Aa(f.name),start:pe,count:f.faces.indices.length,texture:(r=f.texture)!==null&&r!==void 0?r:void 0}),F+=ne,pe+=G}for(var C=0;C<E;C+=3){var de=void 0,ce=void 0,fe=void 0,$=void 0,te=void 0,j=void 0,Le=void 0,Ce=void 0,ge=void 0,ke=void 0,Ne=void 0,De=void 0,We=void 0,Ae=void 0,me=void 0,Te=void 0,Ue=void 0,Ee=void 0,Qe=void 0,Be=void 0,Ge=void 0;de=ie[C]*3,ce=ie[C+1]*3,fe=ie[C+2]*3,$=x[de],te=x[de+1],j=x[de+2],Le=x[ce],Ce=x[ce+1],ge=x[ce+2],ke=x[fe],Ne=x[fe+1],De=x[fe+2],We=ke-Le,Ae=Ne-Ce,me=De-ge,Te=$-Le,Ue=te-Ce,Ee=j-ge,Qe=Ae*Ee-me*Ue,Be=me*Te-We*Ee,Ge=We*Ue-Ae*Te,P[de]+=Qe,P[de+1]+=Be,P[de+2]+=Ge,P[ce]+=Qe,P[ce+1]+=Be,P[ce+2]+=Ge,P[fe]+=Qe,P[fe+1]+=Be,P[fe+2]+=Ge}var ve={createAt:i,description:a,vertices:x,uvs:S,normals:P,indices:ie,floorIndex:b,groups:T,extents:B,vertexMarks:M};o.push(ve)}}return o}function Ua(n,t,e,r){var i=k({key:"texture.pbm"},gr(t,["format","quality","size","sharpen","mappings"])),a=new Nn,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,u});return Object.assign(o,{url:n,textureOptions:t})}function Ou(n,t,e,r,i,a,o){i===void 0&&(i={});for(var s=Vd(n),u=0,l="",c=[],f={},A=new Set,p=0,y=s;p<y.length;p++){var v=y[p],m=v.createAt,h=v.description,g=v.vertices,b=v.vertexMarks,w=v.uvs,E=v.normals,C=v.indices,x=v.floorIndex,M=v.groups,S=v.extents,P=new d.Box3;P.min.x=S[0],P.min.y=S[1],P.min.z=S[2],P.max.x=S[3],P.max.y=S[4],P.max.z=S[5];var T=new d.BufferGeometry;T.setAttribute("position",new d.BufferAttribute(g,3)),T.setAttribute("uv",new d.BufferAttribute(w,2)),T.setAttribute("normal",new d.BufferAttribute(E,3)),T.setAttribute("isRoofMark",new d.BufferAttribute(b,1)),C&&T.setIndex(new d.BufferAttribute(C,1)),T.boundingBox=P,T.boundingSphere=P.getBoundingSphere(new d.Sphere);for(var B=0,F=M;B<F.length;B++){var L=F[B];T.addGroup(L.start,L.count,L.materialIndex)}A.add(T);for(var O=[],Q=0,N=M;Q<N.length;Q++){var L=N[Q],H=e[L.chunkName]||(L.texture?bt(t||"",L.texture):void 0),K=new Qn;K.defines.USE_VERTEX_FLOOR=!1,K.floor=x,O.push(K),H?f[H]?f[H].push(K):f[H]=[K]:(K.defines.USE_MAP=!1,K.uniforms.diffuse.value=new d.Color(16777215)),A.add(K)}var U=new Mt(T,O);U.name="model_floor_"+x,U.userData.createAt=m,U.userData.description=h,U.matrix.compose(U.position,U.quaternion,U.scale),U.matrixAutoUpdate=!1,U.frustumCulled=!1,U.renderOrder=-1e3+x,u=m,l=h,c.push(U)}var G="",X=function(q){q=za(q,e.length);var W=[],J=Bn(q);if(G===J)return Promise.resolve();G=J;for(var ve=function(pe){var ne=null;pe in i&&(Bn(i[pe].textureOptions)===Bn(q)?ne=i[pe]:i[pe].then(function(de){return de.dispose()})),ne||(ne=Ua(pe,q,a)),W.push(ne.then(function(de){if(G!==J){de.dispose();return}for(var ce=0,fe=f[pe];ce<fe.length;ce++){var $=fe[ce];$.uniforms.map.value&&(A.delete($.uniforms.map.value),$.uniforms.map.value.dispose()),$.uniforms.map.value=de,A.add(de),$.uniforms.exposure.value=3.3}}).catch(function(){if(G===J)for(var de=0,ce=f[pe];de<ce.length;de++){var fe=ce[de];fe.uniforms.map.value&&(A.delete(fe.uniforms.map.value),fe.uniforms.map.value.dispose()),fe.uniforms.map.value=null,fe.defines.USE_MAP=!1,fe.uniforms.diffuse.value=new d.Color(16777215)}}))},re=0,se=Object.keys(f);re<se.length;re++){var ie=se[re];ve(ie)}for(var ie in i)delete i[ie];return Promise.all(W).then(function(){})},Z=X(r);return{createAt:u,description:l,objects:c,texturePromise:Z,updateTexture:X,dispose:function(){A.forEach(function(q){q.dispose()}),A.clear()}}}function za(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 Vu(n,t){var e,r,i,a={byteLength:0},o=za((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,l=t.textureArray;u<l.length;u++){var c=l[u];s[c]=Ua(c,o,t.fetcher)}return Promise.resolve().then(function(){return t.fetcher.ajax(n,{responseType:"arraybuffer"})}).then(function(f){return Pu(f.body)}).then(function(f){return vi(function(){for(var A,p={chunks:[],createAt:void 0,description:void 0},y=0,v=f;y<v.length;y++){var m=v[y],h=Fu.decode(m);h.chunks.length&&((A=p.chunks).push.apply(A,h.chunks),p.createAt=h.createAt,p.description=h.description)}return p})}).then(function(f){return vi(function(){var A,p,y;return Ou(f,(A=t.textureBaseUri)!==null&&A!==void 0?A:function(){var v=n.lastIndexOf("/");if(v>=0){var m=n.slice(0,v)+"/";return/\/model\/$/.test(m)&&(m=m.replace(/\/model\/$/,"/materials/")),m}return""}(),((p=t.textureArray)!==null&&p!==void 0?p:[]).slice(),(y=t.textureOptions)!==null&&y!==void 0?y:{},s,t.fetcher)})}).then(function(f){var A=new d.Group;A.renderOrder=-4,A.name=n;for(var p=0,y=f.objects;p<y.length;p++){var v=y[p];A.add(v)}return f.texturePromise.then(function(){return{type:"at3d",uri:n,byteLength:a.byteLength,object:A,dispose:function(){return f.dispose()}}})})}const qe=Br.Reader,nt=Br.util,Se=Br.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(Br.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),Nd=Se.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=nt.emptyArray,n.decode=function(e,r){e instanceof qe||(e=qe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Se.Model;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.meshes&&a.meshes.length||(a.meshes=[]),a.meshes.push(Se.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})();Se.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=nt.emptyArray,n.prototype.matrix=nt.emptyArray,n.decode=function(e,r){e instanceof qe||(e=qe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Se.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(Se.Chunk.decode(e,e.uint32()));break}case 3:{a.matrix&&a.matrix.length||(a.matrix=[]),a.matrix.push(Se.Matrix.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("name"))throw nt.ProtocolError("missing required 'name'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Mesh"},n})();Se.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=nt.emptyArray,n.decode=function(e,r){e instanceof qe||(e=qe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Se.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})();Se.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=nt.emptyArray,n.decode=function(e,r){e instanceof qe||(e=qe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Se.Chunk;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 2:{a.geometry=Se.Geometry.decode(e,e.uint32());break}case 3:{a.material&&a.material.length||(a.material=[]),a.material.push(Se.Material.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("geometry"))throw nt.ProtocolError("missing required 'geometry'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();Se.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=nt.emptyArray,n.decode=function(e,r){e instanceof qe||(e=qe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Se.Geometry;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.position=Se.Position.decode(e,e.uint32());break}case 2:{a.uv=Se.UV.decode(e,e.uint32());break}case 3:{a.uv2=Se.UV.decode(e,e.uint32());break}case 4:{a.normal=Se.Normal.decode(e,e.uint32());break}case 5:{a.groups&&a.groups.length||(a.groups=[]),a.groups.push(Se.Group.decode(e,e.uint32()));break}default:e.skipType(o&7);break}}if(!a.hasOwnProperty("position"))throw nt.ProtocolError("missing required 'position'",{instance:a});if(!a.hasOwnProperty("normal"))throw nt.ProtocolError("missing required 'normal'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Geometry"},n})();Se.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=nt.emptyArray,n.decode=function(e,r){e instanceof qe||(e=qe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Se.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})();Se.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=nt.emptyArray,n.decode=function(e,r){e instanceof qe||(e=qe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Se.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})();Se.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=nt.emptyArray,n.decode=function(e,r){e instanceof qe||(e=qe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Se.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})();Se.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 qe||(e=qe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Se.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 nt.ProtocolError("missing required 'start'",{instance:a});if(!a.hasOwnProperty("count"))throw nt.ProtocolError("missing required 'count'",{instance:a});if(!a.hasOwnProperty("materialIndex"))throw nt.ProtocolError("missing required 'materialIndex'",{instance:a});return a},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Group"},n})();Se.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 qe||(e=qe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Se.Material;for(;e.pos<i;){let o=e.uint32();switch(o>>>3){case 1:{a.kd=Se.Color.decode(e,e.uint32());break}case 2:{a.ks=Se.Color.decode(e,e.uint32());break}case 3:{a.ke=Se.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})();Se.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=nt.emptyArray,n.decode=function(e,r){e instanceof qe||(e=qe.create(e));let i=r===void 0?e.len:e.pos+r,a=new Se.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 Nu(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,Qu(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 Qd(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 Dd(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 l=u[s];o.addGroup(l.start,l.count,l.materialIndex)}return o}function Yr(n,t,e,r,i,a,o){if(o.hasOwnProperty(n))return o[n];n=n.split("?")[0],Ar(n)||(n=bt(t,n)),n=n.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/"),n.indexOf("//")===0&&(n="https:"+n);var s=k({key:"texture.dome",size:64},gr(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(l){var c=l.body;return r&&c.repeat.copy(r),c.needsUpdate=!0,c.updateMatrix(),c});return u}function Ud(n,t,e,r,i,a,o){var s=[],u=new Qn;o.add(u);var l=u.uniforms;l.exposure.value=4.3;var c=u.defines;if(c.USE_MAP=!1,c.USE_UV=!1,n.kd&&(l.diffuse.value=new d.Color().fromArray(n.kd.rgb)),n.mapkd){var f=null;if(n.mapkdrepeat){var A=n.mapkdrepeat.split(/\s+/).map(function(m){return Number(m)}),p=A[0],y=A[1];f=new d.Vector2(p,y)}s.push(Yr(n.mapkd,t,e,f,r,i,a).then(function(m){c.USE_MAP=!0,c.USE_UV=!0,l.map.value=m,o.add(m),l.uvTransform.value=m.matrix,u.needsUpdate=!0}).catch(D))}if(n.ks&&(l.specular.value=new d.Color().fromArray(n.ks.rgb)),n.mapks&&s.push(Yr(n.mapks,t,e,null,r,i,a).then(function(m){l.specularMap.value=m,o.add(m)}).catch(D)),n.ke&&(l.emissive.value=new d.Color().fromArray(n.ke.rgb)),n.mapke&&s.push(Yr(n.mapke,t,e,null,r,i,a).then(function(m){l.emissiveMap.value=m,o.add(m)}).catch(D)),n.norm&&s.push(Yr(n.norm,t,e,null,r,i,a).then(function(m){l.normalMap.value=m,o.add(m)}).catch(D)),n.mapbump&&s.push(Yr(n.mapbump,t,e,null,r,i,a).then(function(m){l.bumpMap.value=m,o.add(m)}).catch(D)),n.bump&&s.push(Yr(n.bump,t,e,null,r,i,a).then(function(m){l.bumpMap.value=m,o.add(m)}).catch(D)),typeof n.ns=="number"&&(l.shininess.value=n.ns),typeof n.d=="number"){var v=n.d;v>0&&v<1&&(u.opacity=v)}return u.floor=0,u.defines.USE_VERTEX_FLOOR=!1,{material:u,textureReady:Promise.all(s).then(D)}}function zd(n){return Nd.decode(n).meshes}function Qu(n,t,e,r){for(var i=[],a=[],o=new Set,s=zd(n),u=new Nn,l=new d.Matrix4,c=new d.Vector3,f=new d.Quaternion,A=new d.Vector3,p={},y=0,v=s;y<v.length;y++){var m=v[y],h=m.name,g=m.chunks,b=m.matrix;if(!(h==="Ceiling"||h==="CeilingDrop"))for(var w=0,E=b;w<E.length;w++){var C=E[w];l.elements=C.elements;var x=new d.Group;x.renderOrder=-4;for(var M=0;M<g.length;M++){var S=Dd(g[M].geometry);S.applyMatrix4(l),l.decompose(c,f,A),A.x*A.y*A.z<0&&S.attributes.normal&&S.attributes.position&&S.attributes.uv&&Qd(S),o.add(S);for(var P=[],T=0,B=g[M].material;T<B.length;T++){var F=B[T],L=Ud(F,t||"",e,u,r,p,o),O=L.material,Q=L.textureReady;a.push(Q),P.push(O)}var N=new Mt(S,P);N.name="chunk_"+M,N.matrix.compose(N.position,N.quaternion,N.scale),N.matrixAutoUpdate=!1,N.frustumCulled=!1,N.renderOrder=-1e3,x.add(N)}x.name=h,i.push(x)}}var H=Promise.all(a).catch(D),K=function(U){return Promise.resolve()};return{createAt:0,description:"",objects:i,texturePromise:H,updateTexture:K,dispose:function(){o.forEach(function(U){U.dispose()}),o.clear()}}}function Du(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,Pu(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 Qu(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 Gd=new d.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function Hd(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 Da(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(Gd),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 Jr=new d.Vector3,Zo=new d.Matrix4,Kd=30;function Yo(n,t){var e=t.tileset.properties.floorInfo;n.traverse(function(r){if("floor"in t.extras)r instanceof Mt?(r.material.forEach(function(g){g.floor=t.extras.floor}),r.renderOrder=-1e3+t.extras.floor):r instanceof vr&&(r.material.floor=t.extras.floor,r.renderOrder=-1e3+t.extras.floor);else if((r instanceof Mt||r instanceof vr)&&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,l=i.count,c=0;c<l;c++){var m=i.array[c];Jr.set(a.array[m*3+0],a.array[m*3+1],a.array[m*3+2]),Jr.applyMatrix4(r.matrixWorld);var f=Jr.y;s[m]=0;for(var A=0;A<e.length;A++){var h=e[A],y=h.ground,v=h.height;if(f<y+v){s[m]=A;break}}u+=s[m]}o=u/l}else{for(var u=0,l=a.count,c=0;c<l;c++){Jr.set(a.array[c*3+0],a.array[c*3+1],a.array[c*3+2]),Jr.applyMatrix4(r.matrixWorld);var f=Jr.y;s[c]=0;for(var A=0;A<e.length;A++){var p=e[A],y=p.ground,v=p.height;if(f<y+v){s[c]=A;break}}u+=s[c]}o=u/l}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 en=function(n){le(t,n);function t(e,r,i){var a,o,s,u,l=n.call(this)||this;l.model=e,l.search=(a=i.search)!==null&&a!==void 0?a:"",l.unloadTileQueue=[],l.boundingBox=new d.Box3,l.idle=!1,l.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,l.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,l.needsRefined=!0,l.refined=!1,l.refineProgress=[0,0],l.loaded=!1,l.disposed=!1,l.needsRender=!0,l.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 c=No(r,(o=i.resourcePath)!==null&&o!==void 0?o:"");return l.tileset=new ri((u=(s=l.model.work)===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",c,{contentLoader:function(f){return l.loadContent(f,{fetcher:i.fetcher})},onTileLoad:function(){},onTileUnload:function(f){l.unloadTileQueue.push(f)},onTileError:function(f,A){i.onError&&i.onError(Object.assign(A,{error:A})),console.error("Tile error",f.id,A)}}),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=Ht(o,{key:"model.".concat(e.siblingIndex)});return r.fetcher.ajax(s,{responseType:"text"}).then(function(u){return u.body}).then(function(u){var l=s.slice(0,s.lastIndexOf("/")+1);return No(JSON.parse(u),l)}).then(function(u){return e.geometricError=u.geometricError,e.children.length===0&&(e.children=[new Qa("".concat(e.id,".0"),u.root,e.tileset,e)]),!0})}return e.type==="SCENEGRAPH"?Promise.resolve().then(function(){var u,l,c,f,A,p,y,v,m,h,g="",b=o.split("#"),w=b[0],E=b[1],C=(E||w).split("?")[0].match(/\.([0-9a-zA-Z]+)$/);if(C&&(g=C[1]),g==="b3dm"){var x=Ht(o,{key:"model.".concat(e.siblingIndex)});return xu(x,{upAxis:e.tileset.asset.gltfUpAxis,fetcher:r.fetcher}).then(function(M){return M.object.applyMatrix4(e.transform),M.object.updateWorldMatrix(!1,!0),M.object.matrixAutoUpdate=!1,Yo(M.object,e),M})}if(g==="pnts"){var x=Ht(o,{key:"model.".concat(e.siblingIndex)});return Mu(x,{fetcher:r.fetcher,computeBoundingBox:!1}).then(function(S){if(S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,e.boundingVolume){var P=e.boundingVolume;S.object.traverse(function(T){if(T instanceof vr){Zo.getInverse(T.matrixWorld);var B=new d.Box3;P.getBoundingBox(B),B.applyMatrix4(Zo),T.geometry.boundingBox=B}})}return S})}if(g==="glb"){var x=Ht(o,{key:"model.".concat(e.siblingIndex)});return Hd(x,{upAxis:e.tileset.asset.gltfUpAxis,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,Yo(S.object,e),S})}if(g==="at3d"){var x=e.extras.at3d?o:Ht(o,{key:"model.".concat(e.siblingIndex)});return Vu(x,{textureBaseUri:(u=e.extras.at3d)===null||u===void 0?void 0:u.textureBaseUri,textureArray:(l=e.extras.at3d)===null||l===void 0?void 0:l.textureArray,textureOptions:(c=e.extras.at3d)===null||c===void 0?void 0:c.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}if(g==="pbm"){var x=e.extras.pbm?o:Ht(o,{key:"model.".concat(e.siblingIndex)});return ku(x,{textureBaseUri:(f=e.extras.pbm)===null||f===void 0?void 0:f.textureBaseUri,textureArray:(A=e.extras.pbm)===null||A===void 0?void 0:A.textureArray,textureOptions:(p=e.extras.pbm)===null||p===void 0?void 0:p.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}if(g==="dome"){var x=e.extras.dome?o:Ht(o,{key:"model.".concat(e.siblingIndex)});return Nu(x,{textureBaseUri:(y=e.extras.dome)===null||y===void 0?void 0:y.textureBaseUri,textureOptions:(v=e.extras.dome)===null||v===void 0?void 0:v.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}if(g==="domez"){var x=e.extras.domez?o:Ht(o,{key:"model.".concat(e.siblingIndex)});return Du(x,{textureBaseUri:(m=e.extras.domez)===null||m===void 0?void 0:m.textureBaseUri,textureOptions:(h=e.extras.domez)===null||h===void 0?void 0:h.textureOptions,fetcher:r.fetcher}).then(function(S){return S.object.applyMatrix4(e.transform),S.object.updateWorldMatrix(!1,!0),S.object.matrixAutoUpdate=!1,S})}}).then(function(u){if(!u)return Promise.resolve(!1);u.object.traverse(function(c){if(c instanceof vr)c.material.uniforms.geometricError.value=e.geometricError;else if(c instanceof Mt)for(var f=0,A=c.material;f<A.length;f++){var p=A[f];p.uniforms.geometricError.value=e.geometricError}});var l={type:u.type,uri:u.uri,byteLength:u.byteLength,object:new vu(u.object,u.dispose)};return l.object.generateBvhTree().then(function(){return l})}).then(function(u){if(!u)return!1;if(i.disposed)return u.object.dispose(),a.data=void 0,a.byteLength=0,!1;if(u.object.traverse(function(c){(c instanceof vr||c instanceof Mt)&&(c.model=i.model)}),a.data=u,a.byteLength=u.byteLength,u.object.traverse(function(c){c.renderOrder>-4&&(c.renderOrder=-4)}),u.object.visible=!1,i.boundingBox.expandByObject(u.object),i.nodes.set(e.id,u.object),i.nodeGroup.add(u.object),e.boundingVolume){var l=Mc(e.boundingVolume,e.state.selectionDepth);l.matrixWorldNeedsUpdate=!0,l.matrixAutoUpdate=!1,l.frustumCulled=!1,l.visible=!1,i.debugBoundings.set(e.id,l),i.debugBoundingGroup.add(l)}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 l=s.boundingVolume.clone().applyMatrix4(o);u=l.intersectRay(e.ray,e.far)}else u=!0;if(u){for(var c=0,f=s.children.length;c<f;c++)a.push(s.children[c]);s.selected&&s.content&&s.content.data&&s.content.data.object.intersectRaycaster(e,!1,i)}}return r&&i.sort(function(A,p){return A.distance-p.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=be();if(this.needsRefined&&a-this.lastRefineTime>Kd){this.lastRefineTime=a,this.tileset.cache.reset(),this.tileset.frameNumber++;var o=this.visible&&(this.parent?this.parent.visible:!0),s={camera:{position:new d.Vector3().copy(r.position),direction:r.getDirection(new d.Vector3),up:new d.Vector3().copy(r.up),visible:r.visible,refine:r.refineModel},minLevelOfDetail:o?this.minLevelOfDetail:-1,maxLevelOfDetail:o?this.idle?0:this.maxLevelOfDetail:-1,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:this.tileset.frameNumber,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new In().setFromCamera(r)},u=this.cacheCameras.map(function(p){return k(k({},s),{camera:{position:new d.Vector3().copy(p.position),direction:p.getWorldDirection(new d.Vector3),up:new d.Vector3().copy(p.up),visible:p.visible,refine:!0},cullingVolume:new In().setFromCamera(p)})});this.tileset.traverse(s,u),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 y=p.content.loadState;if(y==="UNLOADED"||y==="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 y=p.content.loadState;(y==="UNLOADED"||y==="LOADING")&&(i.loaded=!1)}}))}for(var l,c;c=this.unloadTileQueue.pop();){var f=c.id,A=c.content;l=this.nodes.get(f),l&&(this.nodeGroup.remove(l),this.nodes.delete(f),this.needsRender=!0),l=this.debugBoundings.get(f),l&&(this.debugBoundingGroup.remove(l),this.debugBoundings.delete(f),this.needsRender=!0),A&&A.data&&(A.byteLength=0,A.data.object.dispose(),A.data=void 0)}this.tileset.tiles.forEach(function(p){var y=p.selected,v=p.id;l=i.nodes.get(v),l&&l.visible!==y&&(l.visible=y,i.needsRender=!0),l=i.debugBoundings.get(v),l&&l.visible!==y&&(l.visible=y,i.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;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),o&&o.data&&(o.data.object.dispose(),o.data=void 0,o.byteLength=0)}this.nodes.forEach(function(s,u,l){e.nodeGroup.remove(s),s.dispose(),l.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=ri.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_MAX_REQUESTS=ri.DEFAULT_MAX_REQUESTS,t}(d.Object3D);function he(n,t,e){return n<t?t:n>e?e:n}function qd(n){return-((n-.25)*360+90)/180*Math.PI}function ma(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(!ma(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(!ma(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function zt(n){return typeof n=="number"}function jd(n){return(n&n-1)===0&&n!==0}var Jo=function(){return new Error("Invalid input.")},$o=function(){return new Error("Invalid certificate.")},es=function(){return new Error("Invalid signature.")},Wd=function(n){return new Error("date(".concat(n.toString(),") expired."))},Xd=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function _d(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 wn(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+=wn(n[a],!1)+",";return i>-1&&(r+=wn(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return wn(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var u=o[a],l=wn(n[u],!0);l!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(u)+":"+l),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 Zd(n){return String(wn(n,!1))}function Uu(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return Jo();for(var s=function(E){var C=Uu(n[E]);if(C instanceof Error)return{value:C};if(!i)i=C.issuer;else if(i!==C.issuer)return{value:$o()};a?C.expire.getTime()<a.getTime()&&(a=C.expire):a=C.expire,o?o=o.filter(function(x){return C.allowHosts.indexOf(x)!==-1}):o=C.allowHosts},u=0;u<n.length;u++){var l=s(u);if(typeof l=="object")return l.value}return tn({issuer:i,expire:a,allowHosts:o})}var c=JSON.parse(n),f=typeof location!="undefined"?location.hostname:"",A=Date.now();if(typeof c!="object")return Jo();var p=new Date(typeof c.expire_at=="string"&&/^\d+$/.test(c.expire_at)?Number(c.expire_at):c.expire_at),y=Array.isArray(c.allow_hosts)?c.allow_hosts:[];if(f.length===0||Hr(f)||rr.filter(function(E){return Rr(E,f)}).length>0){var v=String((t=c.certificate)!==null&&t!==void 0?t:"");if(v){var m=new ze;return m.readCertPEM(v),tn({issuer:m.getSubjectString(),expire:p,allowHosts:y})}return tn({issuer:"none",expire:p,allowHosts:y})}var h=String((e=c.certificate)!==null&&e!==void 0?e:"");if(!h)return $o();var g=new ze;g.readCertPEM(h);var b=String((r=c._signature)!==null&&r!==void 0?r:"");if(!b)return es();var w=Zd(_d(c,["_signature"]));return T0(w,b,g)===!1?es():A<p.getTime()?y.filter(function(E){return Rr(E,f)}).length===0?Xd(f):tn({issuer:g.getSubjectString(),expire:p,allowHosts:y}):Wd(p)}var ts=new d.Matrix4,Ga=new WeakMap,Ha=function(){function n(t,e){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={work:this},this.observers=[],this.issuer="none",this.raw={works:[""],options:""},this.transform=new d.Matrix4;{var r=this;this.options={get transform(){return r.transform},set transform(a){r.transform.copy(a)}}}var i=Yd(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
929
929
  Error work input:
930
- `+JSON.stringify(t))}return n.prototype.toJSON=function(){return this.raw},n.parse=Ln,n}();function is(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function ba(n,t){var e=is(n),r=is(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]=ba(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=ba(n[a],t[a]);return n}function qa(n,t){return n.indexOf(t)===0}function Ka(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=vo("".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=xt(n,vo(u))+(c?"."+c:"")}var l=a.replace(n,"");return r.baseURL&&(a=xt(r.baseURL,l)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:l,type:e}),a}function Ze(n,t,e,r,i){var a=e;return Ar(e)||(t&&(t=xt(t,String(r))),a=xt(t,a)),Ar(a)||(a=xt(n,a)),qa(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),Ka(n,a,"panorama",i)}function wn(n,t,e){var r=t;return Ar(r)||(r=xt(n,t)),qa(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),Ka(n,r,"model",e)}function _n(n,t,e,r){var i=t;return Ar(i)||(i=xt(e,i)),Ar(i)||(i=xt(n,i)),qa(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),Ka(n,i,"texture",r)}function Yd(n,t,e){for(var r,i,a,o,s,u,c,l,h,v,p,m,A,y,f,g,b,w,x=JSON.stringify(t),E=[],M=0,C=[].concat(n);M<C.length;M++){var S=C[M];S instanceof Ha?E.push.apply(E,S.raw.works):typeof S=="string"?E.push(S):E.push(JSON.stringify(S))}var P=Gu(E);if(P instanceof Error)return P;var I={transform:new d.Matrix4};typeof t.debug!="undefined"&&(I.debug=t.debug),t.transform&&(Array.isArray(t.transform)?I.transform.fromArray(t.transform):I.transform.copy(t.transform)),t.viewerRequestVolume&&("clone"in t.viewerRequestVolume?I.viewerRequestVolume=t.viewerRequestVolume.clone():I.viewerRequestVolume=Rn(t.viewerRequestVolume)),typeof t.modelMinLevelOfDetail!="undefined"&&t.modelMinLevelOfDetail>=0&&(I.modelMinLevelOfDetail=t.modelMinLevelOfDetail),typeof t.modelMaxLevelOfDetail!="undefined"&&t.modelMaxLevelOfDetail>=0&&(I.modelMaxLevelOfDetail=t.modelMaxLevelOfDetail),typeof t.modelMaxRequests!="undefined"&&t.modelMaxRequests>=0&&(I.modelMaxRequests=t.modelMaxRequests),typeof t.modelMaxMemoryUsage!="undefined"&&t.modelMaxMemoryUsage>=0&&(I.modelMaxMemoryUsage=t.modelMaxMemoryUsage),typeof t.modelMaxScreenSpaceError!="undefined"&&t.modelMaxScreenSpaceError>=0&&(I.modelMaxScreenSpaceError=t.modelMaxScreenSpaceError),Object.defineProperty(e,"options",{configurable:!1,get:function(){return I}}),n=E.map(function(ee){return JSON.parse(ee)}).reduce(function(ee,le){return ba(ee,le)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:E,options:x}}});{var B;if(t.workCode&&(typeof t.workCode=="string"?B=t.workCode:typeof t.workCode=="function"&&(B=t.workCode(n))),typeof B=="undefined"&&(B=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof B=="undefined")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return B}})}{var L=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return L}})}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 k=(r=n.base_url)!==null&&r!==void 0?r:"";if(k&&k[k.length-1]!=="/"&&(k+="/"),P instanceof Error)return P;if(n.model){var O={work:e,layers:[]},N;n.model.file?N=wn(k,n.model.file,t):n.model.file_url&&(N=wn(k,n.model.file_url,t)),Object.defineProperty(O,"file",{configurable:!1,get:function(){return N}});var D;n.model.textureBase?D=_n(k,"",n.model.textureBase,t):n.model.material_base_url?D=_n(k,"",n.model.material_base_url,t):O.file&&(D=O.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(O,"textureBase",{configurable:!1,get:function(){return D}});var H;Array.isArray(n.model.textures)?(H=n.model.textures.map(function(ee){var le,X;return _n(k,ee,(X=(le=n.model.textureBase)!==null&&le!==void 0?le:n.model.material_base_url)!==null&&X!==void 0?X:"",t)}),Object.freeze(H)):Array.isArray(n.model.material_textures)&&(H=n.model.material_textures.map(function(ee){var le,X;return _n(k,ee,(X=(le=n.model.textureBase)!==null&&le!==void 0?le:n.model.material_base_url)!==null&&X!==void 0?X:"",t)}),Object.freeze(H)),Object.defineProperty(O,"textures",{configurable:!1,get:function(){return H}});var z=[];if(Array.isArray(n.model.tiles))for(var U=0,q=n.model.tiles;U<q.length;U++){var j=q[U];j&&(j.tileset||j.tileset_url)&&z.push(Object.freeze({type:(i=j.type)!==null&&i!==void 0?i:"mesh",name:(a=j.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=j.upAxis)!==null&&o!==void 0?o:j.up_axis)!==null&&s!==void 0?s:"-Y",tileset:wn(k,j.tileset||j.tileset_url,t)}))}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:wn(k,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var _=0,Z=n.model.layers;_<Z.length;_++){var W=Z[_];W&&(W.tileset||W.tileset_url)&&z.push(Object.freeze({type:(v=W.type)!==null&&v!==void 0?v:"mesh",name:(p=W.name)!==null&&p!==void 0?p:"",upAxis:(m=W.upAxis)!==null&&m!==void 0?m:W.up_axis,tileset:wn(k,W.tileset||W.tileset_url,t)}))}Object.freeze(z),Object.defineProperty(O,"layers",{configurable:!1,get:function(){return z}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(O.file||O.layers.length)return O}})}if(P instanceof Error)return P;{var Y=[];if(n.observers&&Array.isArray(n.observers)){var ce=[];n.panorama&&(Array.isArray(n.panorama)?ce=n.panorama:Array.isArray(n.panorama.list)?ce=n.panorama.list:Array.isArray(n.panorama.info)&&(ce=n.panorama.info));for(var te=function(ee){var le={},X=n.observers[ee];if(!X)return"break";var Te=ce[ee];if(!Te)return"break";X=Object.assign({},X,Te,{active:X.active!==!1&&Te.active!==!1}),Object.defineProperty(le,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(le,"index",{configurable:!1,get:function(){return ee}}),Object.defineProperty(le,"panoIndex",{configurable:!1,get:function(){return ee}});var Fe=Re({workCode:e.workCode,panoIndex:ee});Object.defineProperty(le,"panoId",{configurable:!1,get:function(){return Fe}});var Ye=Object.freeze({workCode:e.workCode,panoIndex:ee});Object.defineProperty(le,"pano",{configurable:!1,get:function(){return Ye}});var Xe=X.active!==!1;Object.defineProperty(le,"active",{configurable:!1,get:function(){return Xe}});var Ge=X.loadable===!0;Object.defineProperty(le,"loadable",{configurable:!1,get:function(){return Ge}});var st=X.derived_id;Object.defineProperty(le,"derivedId",{configurable:!1,get:function(){return st}});var Ne=X.derived_id_str;Object.defineProperty(le,"derivedIdStr",{configurable:!1,get:function(){return Ne}});var me=(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:"",Ae={up:Ze(k,me,X.images?X.images.up:X.up,ee,t),down:Ze(k,me,X.images?X.images.down:X.down,ee,t),right:Ze(k,me,X.images?X.images.right:X.right,ee,t),left:Ze(k,me,X.images?X.images.left:X.left,ee,t),front:Ze(k,me,X.images?X.images.front:X.front,ee,t),back:Ze(k,me,X.images?X.images.back:X.back,ee,t)},nt=X.images?X.images.depth:X.depth;nt&&(Ae.depth=Ze(k,me,nt,ee,t));var Ce=X.images?X.images.luminance:X.luminance;Ce&&(Ae.luminance=Object.freeze({up:Ze(k,me,Ce.up,ee,t),down:Ze(k,me,Ce.down,ee,t),right:Ze(k,me,Ce.right,ee,t),left:Ze(k,me,Ce.left,ee,t),front:Ze(k,me,Ce.front,ee,t),back:Ze(k,me,Ce.back,ee,t)}));var He=X.images?X.images.tiles:X.tiles;if(He){for(var Oe=[],it=function(Ke){var Lt=Ke.match(/\/cube_(\d+)\//);if(Lt){var sr=Number(Lt[1]);if(jd(sr))return sr}return!1},qe=function(Ke,Lt){return Ke.replace(/\/cube_(\d+)\//,function(){return"/cube_".concat(Lt,"/")})},Zt=0,Or=He;Zt<Or.length;Zt++){var Je=Or[Zt];if(typeof Je=="number"){var Mt=Je,Xr=it(Ae.front);if(Xr===!1)continue;var $e=Math.max(Xr,Math.pow(2,Mt)*512);if($e>2048){var Bt=qe(Ae.up,$e),Rt=qe(Ae.down,$e),Ht=qe(Ae.right,$e),Yt=qe(Ae.left,$e),pt=qe(Ae.front,$e),Ie=qe(Ae.back,$e);Oe.push(Object.freeze({level:Mt,size:$e,up:Bt,down:Rt,right:Ht,left:Yt,front:pt,back:Ie}))}else{var Bt=Ae.up,Rt=Ae.down,Ht=Ae.right,Yt=Ae.left,pt=Ae.front,Ie=Ae.back;Oe.push(Object.freeze({level:Mt,size:$e,up:Bt,down:Rt,right:Ht,left:Yt,front:pt,back:Ie}))}}else{var Mt=Je.level;if(typeof Mt!="number")continue;var $e=Je.size;if(typeof $e!="number")continue;var Bt=Ze(k,me,Je.up,ee,t),Rt=Ze(k,me,Je.down,ee,t),Ht=Ze(k,me,Je.right,ee,t),Yt=Ze(k,me,Je.left,ee,t),pt=Ze(k,me,Je.front,ee,t),Ie=Ze(k,me,Je.back,ee,t);Oe.push(Object.freeze({level:Mt,size:$e,up:Bt,down:Rt,right:Ht,left:Yt,front:pt,back:Ie}))}}Oe.sort(function(Ke,Lt){return Ke.level-Lt.level}),Object.freeze(Oe),Object.defineProperty(Ae,"tiles",{configurable:!1,get:function(){return Oe}})}Object.freeze(Ae),Object.defineProperty(le,"images",{configurable:!1,get:function(){return Ae}});var gr=new d.Vector3;if(X.position instanceof d.Vector3)gr.copy(X.position);else if(Array.isArray(X.position))gr.fromArray(X.position);else return"break";Object.freeze(gr),Object.defineProperty(le,"position",{configurable:!1,get:function(){return gr}});var Ft=new d.Vector3;if(X.standingPosition instanceof d.Vector3)Ft.copy(X.standingPosition);else if(Array.isArray(X.standingPosition))Ft.fromArray(X.standingPosition);else if(X.standing_position instanceof d.Vector3)Ft.copy(X.standing_position);else if(Array.isArray(X.standing_position))Ft.fromArray(X.standing_position);else return"break";Object.freeze(Ft),Object.defineProperty(le,"standingPosition",{configurable:!1,get:function(){return Ft}});var ir=new d.Quaternion;if(X.quaternion instanceof d.Quaternion)ir.copy(X.quaternion);else if(Array.isArray(X.quaternion))ir.fromArray(X.quaternion);else if(X.quaternion){var kt=X.quaternion,mn=kt.x,Vr=kt.y,Nr=kt.z,ar=kt.w;ir.set(mn,Vr,Nr,ar)}else return"break";Object.freeze(ir),Object.defineProperty(le,"quaternion",{configurable:!1,get:function(){return ir}});var or=0;Kt(X.floorIndex)?or=X.floorIndex:Kt(X.floor_index)?or=X.floor_index:Kt(X.floor)&&(or=X.floor),Object.defineProperty(le,"floorIndex",{configurable:!1,get:function(){return or}});var et;X.video&&(et={},typeof X.video.source=="string"&&(et.source=X.video.source),X.video.matrix instanceof d.Matrix4?et.matrix=X.video.matrix.clone():Array.isArray(X.video.matrix)&&(et.matrix=new d.Matrix4().fromArray(X.video.matrix)),X.video.size instanceof d.Vector2?et.size=X.video.size.clone():Array.isArray(X.video.size)&&(et.size=new d.Vector2().fromArray(X.video.size)),et.source&&et.matrix&&et.size&&(le.video=et)),Object.freeze(et),Object.defineProperty(le,"video",{configurable:!1,get:function(){return et}}),Array.isArray(X.accessibleNodes)?(le.accessibleNodes=X.accessibleNodes.slice(),le.accessibleIds=X.accessibleNodes.map(function(Ke){return Re({workCode:e.workCode,panoIndex:Ke})})):Array.isArray(X.accessible_nodes)&&(le.accessibleNodes=X.accessible_nodes.slice(),le.accessibleIds=X.accessible_nodes.map(function(Ke){return Re({workCode:e.workCode,panoIndex:Ke})})),Array.isArray(X.visibleNodes)?(le.visibleNodes=X.visibleNodes.slice(),le.visibleIds=X.visibleNodes.map(function(Ke){return Re({workCode:e.workCode,panoIndex:Ke})})):Array.isArray(X.visible_nodes)&&(le.visibleNodes=X.visible_nodes.slice(),le.visibleIds=X.visible_nodes.map(function(Ke){return Re({workCode:e.workCode,panoIndex:Ke})})),Y[ee]=le},se=0;se<n.observers.length;se++){var ue=te(se);if(ue==="break")break}}for(var pe=function(ee){if(ee.accessibleIds){var Te=ee.accessibleIds.filter(function(me){return!!Y.find(function(Ae){return Ae.panoId===me})});Object.freeze(Te),Object.defineProperty(ee,"accessibleIds",{configurable:!1,get:function(){return Te}})}else{for(var le=[],X=0;X<Y.length;X++)Y[X]!==ee&&(Math.abs(Y[X].position.y-ee.position.y)>3||Y[X].position.distanceTo(ee.position)>10||le.push(Y[X].panoId));Object.freeze(le),Object.defineProperty(ee,"accessibleIds",{configurable:!1,get:function(){return le}})}if(ee.accessibleNodes){var Ye=ee.accessibleNodes.filter(function(me){return!!Y.find(function(Ae){return Ae.panoIndex===me})});Object.freeze(Ye),Object.defineProperty(ee,"accessibleNodes",{configurable:!1,get:function(){return Ye}})}else{for(var Fe=[],X=0;X<Y.length;X++)Y[X]!==ee&&(Math.abs(Y[X].position.y-ee.position.y)>3||Y[X].position.distanceTo(ee.position)>10||Fe.push(Y[X].panoIndex));Object.freeze(Fe),Object.defineProperty(ee,"accessibleNodes",{configurable:!1,get:function(){return Fe}})}if(ee.visibleIds){var Ge=ee.visibleIds.filter(function(me){return!!Y.find(function(Ae){return Ae.panoId===me})});Object.freeze(Ge),Object.defineProperty(ee,"visibleIds",{configurable:!1,get:function(){return Ge}})}else{var Xe=ee.accessibleIds.slice();Object.freeze(Xe),Object.defineProperty(ee,"visibleIds",{configurable:!1,get:function(){return Xe}})}if(ee.visibleNodes){var Ne=ee.visibleNodes.filter(function(me){return!!Y.find(function(Ae){return Ae.panoIndex===me})});Object.freeze(Ne),Object.defineProperty(ee,"visibleNodes",{configurable:!1,get:function(){return Ne}})}else{var st=ee.accessibleNodes.slice();Object.freeze(st),Object.defineProperty(ee,"visibleNodes",{configurable:!1,get:function(){return st}})}},he=0,de=Y;he<de.length;he++){var be=de[he];pe(be)}Object.freeze(Y),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return Y}})}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),Kt(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),Kt(n.initial.longitude)?e.initial.longitude=n.initial.longitude:Kt(n.initial.heading)&&(e.initial.longitude=Kd(n.initial.heading)),Kt(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var fe=void 0;Kt(n.initial.panoIndex)?fe=n.initial.panoIndex:Kt(n.initial.pano_index)?fe=n.initial.pano_index:Kt(n.initial.pano)&&(fe=n.initial.pano),typeof fe=="number"&&(fe=ae(fe,0,e.observers.length-1),e.initial.panoIndex=fe)}if(Kt(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Se=[0,0,0].map(function(ee,le){var X=Number(n.initial.offset[le]);return isNaN(X)||!isFinite(X)?0:X});e.initial.offset=new d.Vector3().fromArray(Se)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return P instanceof Error?P:(Ga.set(e,{works:E,options:x}),e)}function Ln(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=Ga.get(n);if(e){if(t&&!ya(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new Ha(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
930
+ `+JSON.stringify(t))}return n.prototype.toJSON=function(){return this.raw},n.parse=Rn,n}();function rs(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function ga(n,t){var e=rs(n),r=rs(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]=ga(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=ga(n[a],t[a]);return n}function Ka(n,t){return n.indexOf(t)===0}function qa(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=ho("".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:"",l=s.join(".");a=bt(n,ho(u))+(l?"."+l:"")}var c=a.replace(n,"");return r.baseURL&&(a=bt(r.baseURL,c)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:c,type:e}),a}function et(n,t,e,r,i){var a=e;return Ar(e)||(t&&(t=bt(t,String(r))),a=bt(t,a)),Ar(a)||(a=bt(n,a)),Ka(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),qa(n,a,"panorama",i)}function mn(n,t,e){var r=t;return Ar(r)||(r=bt(n,t)),Ka(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),qa(n,r,"model",e)}function Xn(n,t,e,r){var i=t;return Ar(i)||(i=bt(e,i)),Ar(i)||(i=bt(n,i)),Ka(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),qa(n,i,"texture",r)}function Yd(n,t,e){for(var r,i,a,o,s,u,l,c,f,A,p,y,v,m,h,g,b,w,E=JSON.stringify(t),C=[],x=0,M=[].concat(n);x<M.length;x++){var S=M[x];S instanceof Ha?C.push.apply(C,S.raw.works):typeof S=="string"?C.push(S):C.push(JSON.stringify(S))}var P=Uu(C);if(P instanceof Error)return P;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=C.map(function($){return JSON.parse($)}).reduce(function($,te){return ga($,te)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:C,options:E}}});{var T;if(t.workCode&&(typeof t.workCode=="string"?T=t.workCode:typeof t.workCode=="function"&&(T=t.workCode(n))),typeof T=="undefined"&&(T=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof T=="undefined")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return T}})}{var B=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return B}})}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 F=(r=n.base_url)!==null&&r!==void 0?r:"";if(F&&F[F.length-1]!=="/"&&(F+="/"),P instanceof Error)return P;if(n.model){var L={work:e,layers:[]},O;n.model.file?O=mn(F,n.model.file,t):n.model.file_url&&(O=mn(F,n.model.file_url,t)),Object.defineProperty(L,"file",{configurable:!1,get:function(){return O}});var Q;n.model.textureBase?Q=Xn(F,"",n.model.textureBase,t):n.model.material_base_url?Q=Xn(F,"",n.model.material_base_url,t):L.file&&(Q=L.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(L,"textureBase",{configurable:!1,get:function(){return Q}});var N;Array.isArray(n.model.textures)?(N=n.model.textures.map(function($){var te,j;return Xn(F,$,(j=(te=n.model.textureBase)!==null&&te!==void 0?te:n.model.material_base_url)!==null&&j!==void 0?j:"",t)}),Object.freeze(N)):Array.isArray(n.model.material_textures)&&(N=n.model.material_textures.map(function($){var te,j;return Xn(F,$,(j=(te=n.model.textureBase)!==null&&te!==void 0?te:n.model.material_base_url)!==null&&j!==void 0?j:"",t)}),Object.freeze(N)),Object.defineProperty(L,"textures",{configurable:!1,get:function(){return N}});var H=[];if(Array.isArray(n.model.tiles))for(var K=0,U=n.model.tiles;K<U.length;K++){var G=U[K];G&&(G.tileset||G.tileset_url)&&H.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:mn(F,G.tileset||G.tileset_url,t)}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&H.push(Object.freeze({type:(u=n.model.tiles.type)!==null&&u!==void 0?u:"mesh",name:(l=n.model.tiles.name)!==null&&l!==void 0?l:"lod",upAxis:(f=(c=n.model.tiles.upAxis)!==null&&c!==void 0?c:n.model.tiles.up_axis)!==null&&f!==void 0?f:"-Y",tileset:mn(F,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var X=0,Z=n.model.layers;X<Z.length;X++){var q=Z[X];q&&(q.tileset||q.tileset_url)&&H.push(Object.freeze({type:(A=q.type)!==null&&A!==void 0?A:"mesh",name:(p=q.name)!==null&&p!==void 0?p:"",upAxis:(y=q.upAxis)!==null&&y!==void 0?y:q.up_axis,tileset:mn(F,q.tileset||q.tileset_url,t)}))}Object.freeze(H),Object.defineProperty(L,"layers",{configurable:!1,get:function(){return H}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(L.file||L.layers.length)return L}})}if(P instanceof Error)return P;{var W=[];if(n.observers&&Array.isArray(n.observers)){var J=[];n.panorama&&(Array.isArray(n.panorama)?J=n.panorama:Array.isArray(n.panorama.list)?J=n.panorama.list:Array.isArray(n.panorama.info)&&(J=n.panorama.info));for(var ve=function($){var te={},j=n.observers[$];if(!j)return"break";var Le=J[$];if(!Le)return"break";j=Object.assign({},j,Le,{active:j.active!==!1&&Le.active!==!1}),Object.defineProperty(te,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(te,"index",{configurable:!1,get:function(){return $}}),Object.defineProperty(te,"panoIndex",{configurable:!1,get:function(){return $}});var Ce=Oe({workCode:e.workCode,panoIndex:$});Object.defineProperty(te,"panoId",{configurable:!1,get:function(){return Ce}});var ge=Object.freeze({workCode:e.workCode,panoIndex:$});Object.defineProperty(te,"pano",{configurable:!1,get:function(){return ge}});var ke=j.active!==!1;Object.defineProperty(te,"active",{configurable:!1,get:function(){return ke}});var Ne=j.loadable===!0;Object.defineProperty(te,"loadable",{configurable:!1,get:function(){return Ne}});var De=j.derived_id;Object.defineProperty(te,"derivedId",{configurable:!1,get:function(){return De}});var We=j.derived_id_str;Object.defineProperty(te,"derivedIdStr",{configurable:!1,get:function(){return We}});var Ae=(w=(g=(m=(v=n.panorama)===null||v===void 0?void 0:v.pano_high_cube_base_url)!==null&&m!==void 0?m:(h=n.panorama)===null||h===void 0?void 0:h.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:et(F,Ae,j.images?j.images.up:j.up,$,t),down:et(F,Ae,j.images?j.images.down:j.down,$,t),right:et(F,Ae,j.images?j.images.right:j.right,$,t),left:et(F,Ae,j.images?j.images.left:j.left,$,t),front:et(F,Ae,j.images?j.images.front:j.front,$,t),back:et(F,Ae,j.images?j.images.back:j.back,$,t)},Te=j.images?j.images.luminance:j.luminance;Te&&(me.luminance=Object.freeze({up:et(F,Ae,Te.up,$,t),down:et(F,Ae,Te.down,$,t),right:et(F,Ae,Te.right,$,t),left:et(F,Ae,Te.left,$,t),front:et(F,Ae,Te.front,$,t),back:et(F,Ae,Te.back,$,t)}));var Ue=j.images?j.images.tiles:j.tiles;if(Ue){for(var Ee=[],Qe=function(Je){var Tt=Je.match(/\/cube_(\d+)\//);if(Tt){var sr=Number(Tt[1]);if(jd(sr))return sr}return!1},Be=function(Je,Tt){return Je.replace(/\/cube_(\d+)\//,function(){return"/cube_".concat(Tt,"/")})},Ge=0,it=Ue;Ge<it.length;Ge++){var tt=it[Ge];if(typeof tt=="number"){var Nt=tt,Wt=Qe(me.front);if(Wt===!1)continue;var Ze=Math.max(Wt,Math.pow(2,Nt)*512);if(Ze>2048){var ir=Be(me.up,Ze),Qt=Be(me.down,Ze),St=Be(me.right,Ze),It=Be(me.left,Ze),Dt=Be(me.front,Ze),Xt=Be(me.back,Ze);Ee.push(Object.freeze({level:Nt,size:Ze,up:ir,down:Qt,right:St,left:It,front:Dt,back:Xt}))}else{var ir=me.up,Qt=me.down,St=me.right,It=me.left,Dt=me.front,Xt=me.back;Ee.push(Object.freeze({level:Nt,size:Ze,up:ir,down:Qt,right:St,left:It,front:Dt,back:Xt}))}}else{var Nt=tt.level;if(typeof Nt!="number")continue;var Ze=tt.size;if(typeof Ze!="number")continue;var ir=et(F,Ae,tt.up,$,t),Qt=et(F,Ae,tt.down,$,t),St=et(F,Ae,tt.right,$,t),It=et(F,Ae,tt.left,$,t),Dt=et(F,Ae,tt.front,$,t),Xt=et(F,Ae,tt.back,$,t);Ee.push(Object.freeze({level:Nt,size:Ze,up:ir,down:Qt,right:St,left:It,front:Dt,back:Xt}))}}Ee.sort(function(Je,Tt){return Je.level-Tt.level}),Object.freeze(Ee),Object.defineProperty(me,"tiles",{configurable:!1,get:function(){return Ee}})}Object.freeze(me),Object.defineProperty(te,"images",{configurable:!1,get:function(){return me}});var vt=new d.Vector3;if(j.position instanceof d.Vector3)vt.copy(j.position);else if(Array.isArray(j.position))vt.fromArray(j.position);else return"break";Object.freeze(vt),Object.defineProperty(te,"position",{configurable:!1,get:function(){return vt}});var Pe=new d.Vector3;if(j.standingPosition instanceof d.Vector3)Pe.copy(j.standingPosition);else if(Array.isArray(j.standingPosition))Pe.fromArray(j.standingPosition);else if(j.standing_position instanceof d.Vector3)Pe.copy(j.standing_position);else if(Array.isArray(j.standing_position))Pe.fromArray(j.standing_position);else return"break";Object.freeze(Pe),Object.defineProperty(te,"standingPosition",{configurable:!1,get:function(){return Pe}});var ar=new d.Quaternion;if(j.quaternion instanceof d.Quaternion)ar.copy(j.quaternion);else if(Array.isArray(j.quaternion))ar.fromArray(j.quaternion);else if(j.quaternion){var _t=j.quaternion,dn=_t.x,or=_t.y,fn=_t.z,Lr=_t.w;ar.set(dn,or,fn,Lr)}else return"break";Object.freeze(ar),Object.defineProperty(te,"quaternion",{configurable:!1,get:function(){return ar}});var Zt=0;zt(j.floorIndex)?Zt=j.floorIndex:zt(j.floor_index)?Zt=j.floor_index:zt(j.floor)&&(Zt=j.floor),Object.defineProperty(te,"floorIndex",{configurable:!1,get:function(){return Zt}});var Xe;j.video&&(Xe={},typeof j.video.source=="string"&&(Xe.source=j.video.source),j.video.matrix instanceof d.Matrix4?Xe.matrix=j.video.matrix.clone():Array.isArray(j.video.matrix)&&(Xe.matrix=new d.Matrix4().fromArray(j.video.matrix)),j.video.size instanceof d.Vector2?Xe.size=j.video.size.clone():Array.isArray(j.video.size)&&(Xe.size=new d.Vector2().fromArray(j.video.size)),Xe.source&&Xe.matrix&&Xe.size&&(te.video=Xe)),Object.freeze(Xe),Object.defineProperty(te,"video",{configurable:!1,get:function(){return Xe}}),Array.isArray(j.accessibleNodes)?(te.accessibleNodes=j.accessibleNodes.slice(),te.accessibleIds=j.accessibleNodes.map(function(Je){return Oe({workCode:e.workCode,panoIndex:Je})})):Array.isArray(j.accessible_nodes)&&(te.accessibleNodes=j.accessible_nodes.slice(),te.accessibleIds=j.accessible_nodes.map(function(Je){return Oe({workCode:e.workCode,panoIndex:Je})})),Array.isArray(j.visibleNodes)?(te.visibleNodes=j.visibleNodes.slice(),te.visibleIds=j.visibleNodes.map(function(Je){return Oe({workCode:e.workCode,panoIndex:Je})})):Array.isArray(j.visible_nodes)&&(te.visibleNodes=j.visible_nodes.slice(),te.visibleIds=j.visible_nodes.map(function(Je){return Oe({workCode:e.workCode,panoIndex:Je})})),W[$]=te},re=0;re<n.observers.length;re++){var se=ve(re);if(se==="break")break}}for(var ie=function($){if($.accessibleIds){var Le=$.accessibleIds.filter(function(Ae){return!!W.find(function(me){return me.panoId===Ae})});Object.freeze(Le),Object.defineProperty($,"accessibleIds",{configurable:!1,get:function(){return Le}})}else{for(var te=[],j=0;j<W.length;j++)W[j]!==$&&(Math.abs(W[j].position.y-$.position.y)>3||W[j].position.distanceTo($.position)>10||te.push(W[j].panoId));Object.freeze(te),Object.defineProperty($,"accessibleIds",{configurable:!1,get:function(){return te}})}if($.accessibleNodes){var ge=$.accessibleNodes.filter(function(Ae){return!!W.find(function(me){return me.panoIndex===Ae})});Object.freeze(ge),Object.defineProperty($,"accessibleNodes",{configurable:!1,get:function(){return ge}})}else{for(var Ce=[],j=0;j<W.length;j++)W[j]!==$&&(Math.abs(W[j].position.y-$.position.y)>3||W[j].position.distanceTo($.position)>10||Ce.push(W[j].panoIndex));Object.freeze(Ce),Object.defineProperty($,"accessibleNodes",{configurable:!1,get:function(){return Ce}})}if($.visibleIds){var Ne=$.visibleIds.filter(function(Ae){return!!W.find(function(me){return me.panoId===Ae})});Object.freeze(Ne),Object.defineProperty($,"visibleIds",{configurable:!1,get:function(){return Ne}})}else{var ke=$.accessibleIds.slice();Object.freeze(ke),Object.defineProperty($,"visibleIds",{configurable:!1,get:function(){return ke}})}if($.visibleNodes){var We=$.visibleNodes.filter(function(Ae){return!!W.find(function(me){return me.panoIndex===Ae})});Object.freeze(We),Object.defineProperty($,"visibleNodes",{configurable:!1,get:function(){return We}})}else{var De=$.accessibleNodes.slice();Object.freeze(De),Object.defineProperty($,"visibleNodes",{configurable:!1,get:function(){return De}})}},pe=0,ne=W;pe<ne.length;pe++){var de=ne[pe];ie(de)}Object.freeze(W),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return W}})}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),zt(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),zt(n.initial.longitude)?e.initial.longitude=n.initial.longitude:zt(n.initial.heading)&&(e.initial.longitude=qd(n.initial.heading)),zt(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var ce=void 0;zt(n.initial.panoIndex)?ce=n.initial.panoIndex:zt(n.initial.pano_index)?ce=n.initial.pano_index:zt(n.initial.pano)&&(ce=n.initial.pano),typeof ce=="number"&&(ce=he(ce,0,e.observers.length-1),e.initial.panoIndex=ce)}if(zt(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var fe=[0,0,0].map(function($,te){var j=Number(n.initial.offset[te]);return isNaN(j)||!isFinite(j)?0:j});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:(Ga.set(e,{works:C,options:E}),e)}function Rn(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=Ga.get(n);if(e){if(t&&!ma(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new Ha(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
931
931
  Error work input:
932
- `+JSON.stringify(n))}}function Hu(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(ns.makeRotationFromQuaternion(l.quaternion).premultiply(s))};Object.freeze(h),e.push(h),r[h.panoId]=h}}Object.freeze(e);for(var v=n.slice(),p={},m=0,A=v;m<A.length;m++){var o=A[m];p[o.workCode]=o}return Object.freeze(Object.assign(v,{get initial(){return v.length>0?v[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(y){return p[y]},getResolvedObserver:function(y){var f,g;return Ys(y)?r[y]:typeof y=="number"?r[Re({workCode:(g=(f=n[0])===null||f===void 0?void 0:f.workCode)!==null&&g!==void 0?g:"",panoIndex:y})]:r[Re(y)]},update:function(){for(var y={},f=0,g=v;f<g.length;f++){var b=g[f],w=b.options.transform,x=t[b.workCode];x?x.equals(w)||(x.copy(w),y[b.workCode]=!0):(t[b.workCode]=new d.Matrix4().copy(w),y[b.workCode]=!0)}for(var E=0,M=e;E<M.length;E++){var C=M[E];if(y[C.work.workCode]===!0){var S=C.work.observers[C.index],P=C.work.options.transform;C.position.copy(S.position).applyMatrix4(P),C.standingPosition.copy(S.standingPosition).applyMatrix4(P),C.quaternion.setFromRotationMatrix(ns.makeRotationFromQuaternion(S.quaternion).premultiply(P))}}}}))}var qu=new Map;function dt(n){var t=qu.get(n);if(t)return t;throw new Error("fetcher never registered.")}function Jd(n,t){return qu.set(n,t)}var $d=new d.Vector3,ef=new d.Matrix3,ct=6378137,Ku=298.257223563;function ju(n){for(var t=ct-ct/Ku,e=(ct*ct-t*t)/(ct*ct),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,a=1e3,o=0,s=Math.atan2(n.z,r),u=0;o++<a;){var c=Math.sin(s),l=ct/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)),v=Math.abs(h-s);if(v<i)break;s=h}return{longitude:Math.atan2(n.y,n.x),latitude:s,altitude:u}}function tf(n){var t=ct-ct/Ku,e=(ct*ct-t*t)/(ct*ct),r=Math.sin(n.latitude),i=Math.cos(n.latitude),a=Math.sin(n.longitude),o=Math.cos(n.longitude),s=ct/Math.sqrt(1-e*r*r),u=(s+n.altitude)*i*o,c=(s+n.altitude)*i*a,l=(t*t/(ct*ct)*s+n.altitude)*r;return new d.Vector3(u,c,l)}function rf(n,t){var e=ju(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=ef.setFromMatrix4(l),v=$d.copy(n).applyMatrix3(h).multiplyScalar(-1);l.setPosition(v);var p=new d.Matrix4().fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return l.premultiply(p),l}var as={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 v=new d.Vector3,p=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,q,j){v.fromArray(i,U*3),p.fromArray(i,q*3),m.fromArray(i,j*3),A.fromArray(o,U*2),y.fromArray(o,q*2),f.fromArray(o,j*2);var _=p.x-v.x,Z=m.x-v.x,W=p.y-v.y,Y=m.y-v.y,ce=p.z-v.z,te=m.z-v.z,se=y.x-A.x,ue=f.x-A.x,pe=y.y-A.y,he=f.y-A.y,de=1/(se*he-ue*pe);g.set((he*_-pe*Z)*de,(he*W-pe*Y)*de,(he*ce-pe*te)*de),b.set((se*Z-ue*_)*de,(se*Y-ue*W)*de,(se*te-ue*ce)*de),c[U].add(g),c[q].add(g),c[j].add(g),l[U].add(b),l[q].add(b),l[j].add(b)}var x=n.groups;x.length===0&&(x=[{start:0,count:r.length}]);for(var h=0,E=x.length;h<E;++h)for(var M=x[h],C=M.start,S=M.count,P=C,I=C+S;P<I;P+=3)w(r[P+0],r[P+1],r[P+2]);var B=new d.Vector3,L=new d.Vector3,k=new d.Vector3,O=new d.Vector3,N,D,H;function z(U){k.fromArray(a,U*3),O.copy(k),D=c[U],B.copy(D),B.sub(k.multiplyScalar(k.dot(D))).normalize(),L.crossVectors(O,D),H=L.dot(l[U]),N=H<0?-1:1,u[U*4]=B.x,u[U*4+1]=B.y,u[U*4+2]=B.z,u[U*4+3]=N}for(var h=0,E=x.length;h<E;++h)for(var M=x[h],C=M.start,S=M.count,P=C,I=C+S;P<I;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 v;if(e)v=l.index.count;else if(l.attributes.position!==void 0)v=l.attributes.position.count;else return null;s.addGroup(u,v,c),u+=v}}if(e){for(var p=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)+p);p+=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"],v=0,a=n.length;v<a;v++){var o=n[v],p=o.itemSize,m=o.count,A=new d.InterleavedBufferAttribute(s,p,u,o.normalized);c.push(A),u+=p;for(var y=0;y<m;y++)for(var f=0;f<p;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"],v=0,p=s.length;v<p;v++){var m=s[v];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),v=0;v<a;v++){for(var g=r?r.getX(v):v,b="",w=0,p=s.length;w<p;w++)for(var m=s[w],x=n.getAttribute(m),E=x.itemSize,M=0;M<E;M++)b+="".concat(~~(x[h[M]](g)*f),",");if(b in e)l.push(e[b]);else{for(var w=0,p=s.length;w<p;w++)for(var m=s[w],x=n.getAttribute(m),A=n.morphAttributes[m],E=x.itemSize,C=u[m],S=c[m],M=0;M<E;M++){var P=h[M];if(C.push(x[P](g)),A)for(var I=0,B=A.length;I<B;I++)S[I].push(A[I][P](g))}e[b]=o,l.push(o),o++}}for(var L=n.clone(),v=0,p=s.length;v<p;v++){var m=s[v],k=n.getAttribute(m),O=new k.array.constructor(u[m]),x=new d.BufferAttribute(O,k.itemSize,k.normalized);if(L.setAttribute(m,x),m in c)for(var w=0;w<c[m].length;w++){var N=n.morphAttributes[m][w],O=new N.array.constructor(c[m][w]),D=new d.BufferAttribute(O,N.itemSize,N.normalized);L.morphAttributes[m][w]=D}}return L.setIndex(l),L}};function wa(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function Nn(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 os=new d.Vector3,_i=new d.Sphere,fn=new d.Matrix4,xa=new d.Matrix4,ss=new d.Box3,us=new d.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Wu=new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5));function ls(n,t){return"transformToEarthCentered"in n?Promise.resolve().then(function(){return n.transformToEarthCentered(t)}).then(function(e){var r=new d.Matrix4;return os.copy(t).applyMatrix4(e),r.premultiply(e).premultiply(rf(os,fn)).premultiply(us),r}):"transformToUpAxisZ"in n?Promise.resolve().then(function(){return n.transformToUpAxisZ(t)}).then(function(e){var r=new d.Matrix4;return r.premultiply(e).premultiply(us),r}):Promise.resolve(new d.Matrix4)}function nf(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 ii=function(){function n(t,e,r,i,a,o){this.name=t,this.type=e,this.upAxis=r,this.worldToLocalTransform=i,this.scene=a,this.error=o}return Object.defineProperty(n.prototype,"tileset",{get:function(){var t;return(t=this.scene)===null||t===void 0?void 0:t.tileset},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinates",{get:function(){var t=new d.Vector3;this.scene&&this.scene.getWorldPosition(t);var e=this.worldPointToCoordinates(t),r=e.longitude,i=e.latitude;return[i,r].map(function(a){return(a/Math.PI*180).toFixed(6)}).join(",")},enumerable:!1,configurable:!0}),n.prototype.getTransformMatrix4=function(t){return t===void 0&&(t=new d.Matrix4),t.copy(this.worldToLocalTransform),this.scene&&t.premultiply(this.scene.matrixWorld),t},n.prototype.coordinatesToWorldPoint=function(t){var e=tf(t),r=this.getTransformMatrix4(fn);return e.applyMatrix4(r)},n.prototype.worldPointToCoordinates=function(t){if(!this.scene)throw new Error("ViewLayer Error.");var e=this.getTransformMatrix4(fn),r=xa.getInverse(e),i=new d.Vector3().copy(t).applyMatrix4(r);return ju(i)},n}(),Ea=function(n){oe(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=F({},ye),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 F({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=Js(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?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 Qt){var c=u.tileset.selectedTiles;c.forEach(function(l){var h,v,p;if(!(l.boundingVolume&&l.boundingVolume.distanceTo(e.center)>e.radius)){var m=(v=(h=l.content)===null||h===void 0?void 0:h.data)===null||v===void 0?void 0:v.object;if(m&&m.visible){var A=[];if(m.traverseVisible(function(_){if(_ instanceof d.Mesh){var Z=ni.get(_);if(Z){fn.copy(_.matrixWorld),xa.getInverse(fn),_i.copy(e).applyMatrix4(xa);var W=Z.trianglesInSphere(_i.center,_i.radius),Y=new d.BufferGeometry;Y.setAttribute("position",new d.BufferAttribute(W,3)),Y.applyMatrix4(_.matrixWorld),Y=as.mergeVertices(Y,.01),A.push(Y)}}}),A.length===0)return;for(var y=["a","b","c"],f=as.mergeBufferGeometries(A,!1),g=f.getAttribute("position").array,b=((p=f.getIndex())===null||p===void 0?void 0:p.array)||[],w=[],x=[],E=0,M=g.length;E<M;E+=3){var C=new d.Vector3(g[E],g[E+1],g[E+2]);w.push(C)}for(var E=0,M=b.length;E<M;E+=3){var S=b[E],P=b[E+1],I=b[E+2],B=new d.Vector3().crossVectors(w[P].clone().sub(w[S]),w[I].clone().sub(w[S])).normalize();x.push({a:S,b:P,c:I,normal:B})}for(var L={},E=0,M=x.length;E<M;E++)for(var k=x[E],O=0;O<3;O++){var N=k[y[O]],D=k[y[(O+1)%3]],H=[Math.min(N,D),Math.max(N,D)],z=H[0]+"-"+H[1];L[z]===void 0?L[z]={index1:H[0],index2:H[1],face1:E}:L[z].face2=E}for(var z in L){var U=L[z];if(U.face2===void 0||x[U.face1].normal.dot(x[U.face2].normal)<=i){var q=w[U.index1],j=w[U.index2];a.push(new d.Line3(q,j))}}w.length=0,x.length=0}}})}}return a},t.prototype.intersectRaycaster=function(e,r,i){r===void 0&&(r=null),i===void 0&&(i=!0);for(var a=[],o=0,s=this.children.length;o<s;o++){var u=this.children[o];u.visible&&u instanceof Qt&&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=this,a;if(r===void 0&&(r={}),this.work=e,this.name=this.work.workCode,!e.model)return Promise.resolve();for(var o=e.model,s=e.options,u=0,c=0,l=e.observers;c<l.length;c++){var h=l[c];u=Math.max(u,h.floorIndex)}this.floorLength=u+1;for(var v=!1,p=[],m=function(C){var S=C.tileset,P=C.upAxis,I=C.name,B=C.type;B==="mesh"&&(v=!0);var L=S.split("#"),k=L[0],O=L[1],N=(a=(O||k).split("?")[1])!==null&&a!==void 0?a:"",D=dt(e).ajax(S,{responseType:"text"}).then(function(H){var z=JSON.parse(H.body),U=z.root;"lodVersion"in z&&(P="-Y","floorInfo"in z&&(z.properties=z.properties||{},z.properties.floorInfo=z.floorInfo.map(function(Z){return{ground:-Z.ground,height:Z.height}}),delete z.floorInfo),z.asset.tilesetVersion=String(z.lodVersion),delete z.lodVersion);var q=U.boundingVolume?Rn(U.boundingVolume):void 0;q&&U.transform&&q.applyMatrix4(fn.fromArray(U.transform));var j=i.coordinatesSystemTransformers.find(function(Z){return Z.name===P});if(!j)return Promise.reject(new Error("CoordinatesSystemTransformers: ".concat(P," not found.")));var _=new d.Vector3;return q&&q.getCenter(_),ls(j,_).then(function(Z){var W;return z.root={refine:(W=U.refine)!==null&&W!==void 0?W:"REPLACE",geometricError:z.geometricError,transform:Z.toArray(),boundingVolume:q?q.toJson():void 0,viewerRequestVolume:s.viewerRequestVolume?s.viewerRequestVolume.toJson():void 0,children:[U]},{tilesetHeader:z,worldToLocalTransform:Z}})}).then(function(H){var z=H.tilesetHeader,U=H.worldToLocalTransform,q=S?S.slice(0,S.lastIndexOf("/")+1):"",j=new Qt(i,z,{resourcePath:q,search:N,fetcher:dt(e)});return j.name=S,j.matrix.copy(s.transform),j.matrix.decompose(j.position,j.quaternion,j.scale),j.matrixWorldNeedsUpdate=!0,new ii(I,B,P,U,j,null)});p.push(D.catch(function(H){return i.onError(H),new ii(I,B,P,new d.Matrix4,null,H)}))},A=0,y=o.layers;A<y.length;A++){var f=y[A];m(f)}if(!v&&o.file){var g=o.file,b=o.textureBase,w=o.textures,x=nf(g)||"at3d",E=x==="at3d"||x==="pbm"?"Z":"Y",M=Promise.resolve().then(function(){var C=i.coordinatesSystemTransformers.find(function(P){return P.name===E});if(!C)return Promise.reject(new Error("CoordinatesSystemTransformers: ".concat(E," not found.")));var S=new d.Vector3(0,0,0);return ls(C,S).then(function(P){var I,B,L={asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:P.toArray(),viewerRequestVolume:s.viewerRequestVolume?s.viewerRequestVolume.toJson():void 0,content:{uri:g},extras:(I={},I[x]={textureBaseUri:b,textureArray:w,textureOptions:(B=r.textureOptions)!==null&&B!==void 0?B:{}},I)}};return{tilesetHeader:L,worldToLocalTransform:P}})}).then(function(C){var S=C.tilesetHeader,P=C.worldToLocalTransform,I=new Qt(i,S,{resourcePath:"",fetcher:dt(e)});return I.name=g,I.matrix.copy(s.transform),I.matrix.decompose(I.position,I.quaternion,I.scale),I.matrixWorldNeedsUpdate=!0,new ii("fallback","mesh",E,P,I,null)});p.push(M)}return Promise.all(p).then(function(C){for(var S=[],P=[],I=[],B=0,L=C;B<L.length;B++){var k=L[B];if(i.viewLayers.push(k),k.scene){if(i.disposed){k.scene.dispose();continue}switch(i.add(k.scene),k.scene.visible=!1,k.type){case"mesh":S.push(k.scene);break;case"point_cloud":P.push(k.scene);break;default:I.push(k.scene);break}}}S.length?S[0].visible=!0:P.length?P[0].visible=!0:I.length&&(I[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 v=0,p=this.children;v<p.length;v++){var m=p[v];m instanceof Qt&&(this.work&&(m.minLevelOfDetail=(a=this.work.options.modelMinLevelOfDetail)!==null&&a!==void 0?a:Qt.DEFAULT_MIN_LEVEL_OF_DETAIL,m.maxLevelOfDetail=this.materialParameters.modelAlpha===0||!m.loaded?0:(o=this.work.options.modelMaxLevelOfDetail)!==null&&o!==void 0?o:Qt.DEFAULT_MAX_LEVEL_OF_DETAIL,m.maxScreenSpaceError=(s=this.work.options.modelMaxScreenSpaceError)!==null&&s!==void 0?s:Qt.DEFAULT_MAX_SCREEN_SPACE_ERROR,m.maxRequests=(u=this.work.options.modelMaxRequests)!==null&&u!==void 0?u:Qt.DEFAULT_MAX_REQUESTS,m.maxMemoryUsage=(c=this.work.options.modelMaxMemoryUsage)!==null&&c!==void 0?c:Qt.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:Nn(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()||(ss.copy(m.boundingBox).applyMatrix4(m.matrix),this.bounding.union(ss)),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(Wu),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 Qt&&e.dispose(),this.remove(e)},t}(d.Object3D);function cs(){var n=new d.Box3,t=Ld(ye,["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,v){return h.distance-v.distance})}return o},setMaterial:function(r){var i=Js(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return F({},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(Wu)}}});return e}function ai(n,t,e){return n+(t-n)*e}function af(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 of(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 sf(n,t,e,r){var i=r[1]-r[0];return n=gi(n,r),t=gi(t,r),t-n>i/2?ai(n+i,t,e):n-t>i/2?ai(n-i,t,e):ai(n,t,e)}function gi(n,t){var e=t[1]-t[0];return n<t[0]?gi(n+e,t):n>=t[1]?gi(n-e,t):n}function uf(n,t,e,r){return r?sf(n,t,e,r):ai(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:F({},this.value)},{progress:1,value:F({},this.value)}]}return n.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-af(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]=uf(r.value[o],i.value[o],s,this.config[o].circle)}return a}return F({},this.keyframes[this.keyframes.length-1].value)},n.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:of(1,this.startVelocity,this.duration,e)},n.prototype.update=function(t){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(t))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},n.prototype.getKeyFrameSegment=function(t){for(var e=this.getProgress(t),r=1;r<this.keyframes.length;r++)if(this.keyframes[r].progress>e)return[this.keyframes[r-1],this.keyframes[r]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},n.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},n.prototype.set=function(t,e,r,i){var a;r===void 0&&(r=0),isNaN(e)&&(e=0),isNaN(r)&&(r=0),i=i!=null?i: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!=null?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=F({},t[t.length-1].value)):a.value=F({},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}(),ds=function(n){return n*(2-n)},lf=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}(),cf=`
932
+ `+JSON.stringify(n))}}function ya(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,l=o.observers;u<l.length;u++){var c=l[u],f={isResolved:!0,active:c.active,accessibleIds:c.accessibleIds,visibleIds:c.visibleIds,accessibleNodes:c.accessibleNodes,visibleNodes:c.visibleNodes,floorIndex:c.floorIndex,images:c.images,index:c.index,panoIndex:c.panoIndex,loadable:c.loadable,panoId:c.panoId,pano:c.pano,work:c.work,derivedId:c.derivedId,video:c.video,position:new d.Vector3().copy(c.position).applyMatrix4(s),standingPosition:new d.Vector3().copy(c.standingPosition).applyMatrix4(s),quaternion:new d.Quaternion().setFromRotationMatrix(ts.makeRotationFromQuaternion(c.quaternion).premultiply(s))};Object.freeze(f),e.push(f),r[f.panoId]=f}}Object.freeze(e);for(var A=n.slice(),p={},y=0,v=A;y<v.length;y++){var o=v[y];p[o.workCode]=o}return Object.freeze(Object.assign(A,{get initial(){return A.length>0?A[0].initial:{work:{}}},get resolvedObservers(){return e},getWork:function(m){return p[m]},getResolvedObserver:function(m){var h,g;return _s(m)?r[m]:typeof m=="number"?r[Oe({workCode:(g=(h=n[0])===null||h===void 0?void 0:h.workCode)!==null&&g!==void 0?g:"",panoIndex:m})]:r[Oe(m)]},update:function(){for(var m={},h=0,g=A;h<g.length;h++){var b=g[h],w=b.options.transform,E=t[b.workCode];E?E.equals(w)||(E.copy(w),m[b.workCode]=!0):(t[b.workCode]=new d.Matrix4().copy(w),m[b.workCode]=!0)}for(var C=0,x=e;C<x.length;C++){var M=x[C];if(m[M.work.workCode]===!0){var S=M.work.observers[M.index],P=M.work.options.transform;M.position.copy(S.position).applyMatrix4(P),M.standingPosition.copy(S.standingPosition).applyMatrix4(P),M.quaternion.setFromRotationMatrix(ts.makeRotationFromQuaternion(S.quaternion).premultiply(P))}}}}))}var zu=new Map;function ut(n){var t=zu.get(n);if(t)return t;throw new Error("fetcher never registered.")}function Jd(n,t){return zu.set(n,t)}var $d=new d.Vector3,ef=new d.Matrix3,st=6378137,Gu=298.257223563;function Hu(n){for(var t=st-st/Gu,e=(st*st-t*t)/(st*st),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 l=Math.sin(s),c=st/Math.sqrt(1-e*l*l);u=r/Math.cos(s)-c;var f=Math.atan2(n.z/(c*(1-e)+u),r/(c+u)),A=Math.abs(f-s);if(A<i)break;s=f}return{longitude:Math.atan2(n.y,n.x),latitude:s,altitude:u}}function tf(n){var t=st-st/Gu,e=(st*st-t*t)/(st*st),r=Math.sin(n.latitude),i=Math.cos(n.latitude),a=Math.sin(n.longitude),o=Math.cos(n.longitude),s=st/Math.sqrt(1-e*r*r),u=(s+n.altitude)*i*o,l=(s+n.altitude)*i*a,c=(t*t/(st*st)*s+n.altitude)*r;return new d.Vector3(u,l,c)}function rf(n,t){var e=Hu(n),r=e.longitude,i=e.latitude,a=e.altitude,o=Math.sin(i),s=Math.sin(r),u=Math.cos(i),l=Math.cos(r),c=t.fromArray([-s,-o*l,u*l,0,+l,-o*s,u*s,0,0,u,o,0,0,0,0,1]),f=ef.setFromMatrix4(c),A=$d.copy(n).applyMatrix3(f).multiplyScalar(-1);c.setPosition(A);var p=new d.Matrix4().fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return c.premultiply(p),c}var ns={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,l=[],c=[],f=0;f<s;f++)l[f]=new d.Vector3,c[f]=new d.Vector3;var A=new d.Vector3,p=new d.Vector3,y=new d.Vector3,v=new d.Vector2,m=new d.Vector2,h=new d.Vector2,g=new d.Vector3,b=new d.Vector3;function w(U,G,X){A.fromArray(i,U*3),p.fromArray(i,G*3),y.fromArray(i,X*3),v.fromArray(o,U*2),m.fromArray(o,G*2),h.fromArray(o,X*2);var Z=p.x-A.x,q=y.x-A.x,W=p.y-A.y,J=y.y-A.y,ve=p.z-A.z,re=y.z-A.z,se=m.x-v.x,ie=h.x-v.x,pe=m.y-v.y,ne=h.y-v.y,de=1/(se*ne-ie*pe);g.set((ne*Z-pe*q)*de,(ne*W-pe*J)*de,(ne*ve-pe*re)*de),b.set((se*q-ie*Z)*de,(se*J-ie*W)*de,(se*re-ie*ve)*de),l[U].add(g),l[G].add(g),l[X].add(g),c[U].add(b),c[G].add(b),c[X].add(b)}var E=n.groups;E.length===0&&(E=[{start:0,count:r.length}]);for(var f=0,C=E.length;f<C;++f)for(var x=E[f],M=x.start,S=x.count,P=M,T=M+S;P<T;P+=3)w(r[P+0],r[P+1],r[P+2]);var B=new d.Vector3,F=new d.Vector3,L=new d.Vector3,O=new d.Vector3,Q,N,H;function K(U){L.fromArray(a,U*3),O.copy(L),N=l[U],B.copy(N),B.sub(L.multiplyScalar(L.dot(N))).normalize(),F.crossVectors(O,N),H=F.dot(c[U]),Q=H<0?-1:1,u[U*4]=B.x,u[U*4+1]=B.y,u[U*4+2]=B.z,u[U*4+3]=Q}for(var f=0,C=E.length;f<C;++f)for(var x=E[f],M=x.start,S=x.count,P=M,T=M+S;P<T;P+=3)K(r[P+0]),K(r[P+1]),K(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,l=0;l<n.length;++l){var c=n[l];if(e!==(c.index!==null))return null;for(var f in c.attributes){if(!r.has(f))return null;a[f]===void 0&&(a[f]=[]),a[f].push(c.attributes[f])}for(var f in c.morphAttributes){if(!i.has(f))return null;o[f]===void 0&&(o[f]=[]),o[f].push(c.morphAttributes[f])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(c.userData),t){var A;if(e)A=c.index.count;else if(c.attributes.position!==void 0)A=c.attributes.position.count;else return null;s.addGroup(u,A,l),u+=A}}if(e){for(var p=0,y=[],l=0;l<n.length;++l){for(var v=n[l].index,m=0;m<v.count;++m)y.push(v.getX(m)+p);p+=n[l].attributes.position.count}s.setIndex(y)}for(var f in a){var h=this.mergeBufferAttributes(a[f]);if(!h)return null;s.setAttribute(f,h)}for(var f in o){var g=o[f][0].length;if(g===0)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[f]=[];for(var l=0;l<g;++l){for(var b=[],m=0;m<o[f].length;++m)b.push(o[f][m][l]);var w=this.mergeBufferAttributes(b);if(!w)return null;s.morphAttributes[f].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,l=[],c=["getX","getY","getZ","getW"],f=["setX","setY","setZ","setW"],A=0,a=n.length;A<a;A++){var o=n[A],p=o.itemSize,y=o.count,v=new d.InterleavedBufferAttribute(s,p,u,o.normalized);l.push(v),u+=p;for(var m=0;m<y;m++)for(var h=0;h<p;h++)v[f[h]](m,o[c[h]](m))}return l},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={},l={},c=[],f=["getX","getY","getZ","getW"],A=0,p=s.length;A<p;A++){var y=s[A];u[y]=[];var v=n.morphAttributes[y];v&&(l[y]=new Array(v.length).fill().map(function(){return[]}))}for(var m=Math.log10(1/t),h=Math.pow(10,m),A=0;A<a;A++){for(var g=r?r.getX(A):A,b="",w=0,p=s.length;w<p;w++)for(var y=s[w],E=n.getAttribute(y),C=E.itemSize,x=0;x<C;x++)b+="".concat(~~(E[f[x]](g)*h),",");if(b in e)c.push(e[b]);else{for(var w=0,p=s.length;w<p;w++)for(var y=s[w],E=n.getAttribute(y),v=n.morphAttributes[y],C=E.itemSize,M=u[y],S=l[y],x=0;x<C;x++){var P=f[x];if(M.push(E[P](g)),v)for(var T=0,B=v.length;T<B;T++)S[T].push(v[T][P](g))}e[b]=o,c.push(o),o++}}for(var F=n.clone(),A=0,p=s.length;A<p;A++){var y=s[A],L=n.getAttribute(y),O=new L.array.constructor(u[y]),E=new d.BufferAttribute(O,L.itemSize,L.normalized);if(F.setAttribute(y,E),y in l)for(var w=0;w<l[y].length;w++){var Q=n.morphAttributes[y][w],O=new Q.array.constructor(l[y][w]),N=new d.BufferAttribute(O,Q.itemSize,Q.normalized);F.morphAttributes[y][w]=N}}return F.setIndex(c),F}};function ba(n){switch(n){case"Floorplan":return!0;case"Mapview":return!0;default:return!1}}function Ln(n){switch(n){case"Panorama":return!0;case"VRPanorama":return!0;case"XRPanorama":return!0;case"Model":return!0;default:return!1}}var is=new d.Vector3,Wi=new d.Sphere,sn=new d.Matrix4,wa=new d.Matrix4,as=new d.Box3,os=new d.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Ku=new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5));function ss(n,t){return"transformToEarthCentered"in n?Promise.resolve().then(function(){return n.transformToEarthCentered(t)}).then(function(e){var r=new d.Matrix4;return is.copy(t).applyMatrix4(e),r.premultiply(e).premultiply(rf(is,sn)).premultiply(os),r}):"transformToUpAxisZ"in n?Promise.resolve().then(function(){return n.transformToUpAxisZ(t)}).then(function(e){var r=new d.Matrix4;return r.premultiply(e).premultiply(os),r}):Promise.resolve(new d.Matrix4)}function nf(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 ii=function(){function n(t,e,r,i,a,o){this.name=t,this.type=e,this.upAxis=r,this.worldToLocalTransform=i,this.scene=a,this.error=o}return Object.defineProperty(n.prototype,"tileset",{get:function(){var t;return(t=this.scene)===null||t===void 0?void 0:t.tileset},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinates",{get:function(){var t=new d.Vector3;this.scene&&this.scene.getWorldPosition(t);var e=this.worldPointToCoordinates(t),r=e.longitude,i=e.latitude;return[i,r].map(function(a){return(a/Math.PI*180).toFixed(6)}).join(",")},enumerable:!1,configurable:!0}),n.prototype.getTransformMatrix4=function(t){return t===void 0&&(t=new d.Matrix4),t.copy(this.worldToLocalTransform),this.scene&&t.premultiply(this.scene.matrixWorld),t},n.prototype.coordinatesToWorldPoint=function(t){var e=tf(t),r=this.getTransformMatrix4(sn);return e.applyMatrix4(r)},n.prototype.worldPointToCoordinates=function(t){if(!this.scene)throw new Error("ViewLayer Error.");var e=this.getTransformMatrix4(sn),r=wa.getInverse(e),i=new d.Vector3().copy(t).applyMatrix4(r);return Hu(i)},n}(),Ea=function(n){le(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:D,s.onShownFloorChange=(a=e.onShownFloorChange)!==null&&a!==void 0?a:D,s.onLoad=(o=e.onLoad)!==null&&o!==void 0?o:D,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=k({},we),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 k({},this.materialParameters)},t.prototype.setMaterial=function(e){var r=this.materialParameters.shownFloorIndex,i=Zs(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?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 en){var l=u.tileset.selectedTiles;l.forEach(function(c){var f,A,p;if(!(c.boundingVolume&&c.boundingVolume.distanceTo(e.center)>e.radius)){var y=(A=(f=c.content)===null||f===void 0?void 0:f.data)===null||A===void 0?void 0:A.object;if(y&&y.visible){var v=[];if(y.traverseVisible(function(Z){if(Z instanceof d.Mesh){var q=ni.get(Z);if(q){sn.copy(Z.matrixWorld),wa.getInverse(sn),Wi.copy(e).applyMatrix4(wa);var W=q.trianglesInSphere(Wi.center,Wi.radius),J=new d.BufferGeometry;J.setAttribute("position",new d.BufferAttribute(W,3)),J.applyMatrix4(Z.matrixWorld),J=ns.mergeVertices(J,.01),v.push(J)}}}),v.length===0)return;for(var m=["a","b","c"],h=ns.mergeBufferGeometries(v,!1),g=h.getAttribute("position").array,b=((p=h.getIndex())===null||p===void 0?void 0:p.array)||[],w=[],E=[],C=0,x=g.length;C<x;C+=3){var M=new d.Vector3(g[C],g[C+1],g[C+2]);w.push(M)}for(var C=0,x=b.length;C<x;C+=3){var S=b[C],P=b[C+1],T=b[C+2],B=new d.Vector3().crossVectors(w[P].clone().sub(w[S]),w[T].clone().sub(w[S])).normalize();E.push({a:S,b:P,c:T,normal:B})}for(var F={},C=0,x=E.length;C<x;C++)for(var L=E[C],O=0;O<3;O++){var Q=L[m[O]],N=L[m[(O+1)%3]],H=[Math.min(Q,N),Math.max(Q,N)],K=H[0]+"-"+H[1];F[K]===void 0?F[K]={index1:H[0],index2:H[1],face1:C}:F[K].face2=C}for(var K in F){var U=F[K];if(U.face2===void 0||E[U.face1].normal.dot(E[U.face2].normal)<=i){var G=w[U.index1],X=w[U.index2];a.push(new d.Line3(G,X))}}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 en&&u.intersectRaycaster(e,!1,a)}return r!=null&&(a=a.filter(function(l){return l.floor===r})),i&&a.sort(function(l,c){return l.distance-c.distance}),a},t.prototype.load=function(e,r){var i=this,a;if(r===void 0&&(r={}),this.work=e,this.name=this.work.workCode,!e.model)return Promise.resolve();for(var o=e.model,s=0,u=0,l=e.observers;u<l.length;u++){var c=l[u];s=Math.max(s,c.floorIndex)}this.floorLength=s+1;for(var f=!1,A=[],p=function(x){var M=x.tileset,S=x.upAxis,P=x.name,T=x.type;T==="mesh"&&(f=!0);var B=M.split("#"),F=B[0],L=B[1],O=(a=(L||F).split("?")[1])!==null&&a!==void 0?a:"",Q=ut(e).ajax(M,{responseType:"text"}).then(function(N){var H=JSON.parse(N.body),K=H.root;"lodVersion"in H&&(S="-Y","floorInfo"in H&&(H.properties=H.properties||{},H.properties.floorInfo=H.floorInfo.map(function(Z){return{ground:-Z.ground,height:Z.height}}),delete H.floorInfo),H.asset.tilesetVersion=String(H.lodVersion),delete H.lodVersion);var U=K.boundingVolume?ti(K.boundingVolume):void 0;U&&K.transform&&U.applyMatrix4(sn.fromArray(K.transform));var G=i.coordinatesSystemTransformers.find(function(Z){return Z.name===S});if(!G)return Promise.reject(new Error("CoordinatesSystemTransformers: ".concat(S," not found.")));var X=new d.Vector3;return U&&U.getCenter(X),ss(G,X).then(function(Z){var q,W,J;return H.root={refine:(q=K.refine)!==null&&q!==void 0?q:"REPLACE",geometricError:H.geometricError,transform:Z.toArray(),boundingVolume:U?U.toJson():void 0,viewerRequestVolume:!((W=r["3d-tiles"])===null||W===void 0)&&W.viewerRequestVolume?(J=r["3d-tiles"])===null||J===void 0?void 0:J.viewerRequestVolume.toJson():void 0,children:[K]},{tilesetHeader:H,worldToLocalTransform:Z}})}).then(function(N){var H=N.tilesetHeader,K=N.worldToLocalTransform,U=M?M.slice(0,M.lastIndexOf("/")+1):"",G=new en(i,H,{resourcePath:U,search:O,fetcher:ut(e)});if(G.name=M,G.matrix.copy(e.transform),G.matrix.decompose(G.position,G.quaternion,G.scale),G.matrixWorldNeedsUpdate=!0,r["3d-tiles"]){var X=r["3d-tiles"];typeof X.debug!="undefined"&&(G.debug=X.debug),typeof X.minLevelOfDetail!="undefined"&&(G.minLevelOfDetail=X.minLevelOfDetail),typeof X.maxLevelOfDetail!="undefined"&&(G.maxLevelOfDetail=X.maxLevelOfDetail),typeof X.maxMemoryUsage!="undefined"&&(G.maxMemoryUsage=X.maxMemoryUsage),typeof X.maxRequests!="undefined"&&(G.maxRequests=X.maxRequests),typeof X.maxScreenSpaceError!="undefined"&&(G.maxScreenSpaceError=X.maxScreenSpaceError)}return new ii(P,T,S,K,G,null)});A.push(Q.catch(function(N){return i.onError(N),new ii(P,T,S,new d.Matrix4,null,N)}))},y=0,v=o.layers;y<v.length;y++){var m=v[y];p(m)}if(!f&&o.file){var h=o.file,g=o.textureBase,b=o.textures,w=nf(h)||"at3d",E=w==="at3d"||w==="pbm"?"Z":"Y",C=Promise.resolve().then(function(){var x=i.coordinatesSystemTransformers.find(function(S){return S.name===E});if(!x)return Promise.reject(new Error("CoordinatesSystemTransformers: ".concat(E," not found.")));var M=new d.Vector3(0,0,0);return ss(x,M).then(function(S){var P,T,B,F,L={asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:S.toArray(),viewerRequestVolume:!((T=r["3d-tiles"])===null||T===void 0)&&T.viewerRequestVolume?(B=r["3d-tiles"])===null||B===void 0?void 0:B.viewerRequestVolume.toJson():void 0,content:{uri:h},extras:(P={},P[w]={textureBaseUri:g,textureArray:b,textureOptions:(F=r.textureOptions)!==null&&F!==void 0?F:{}},P)}};return{tilesetHeader:L,worldToLocalTransform:S}})}).then(function(x){var M=x.tilesetHeader,S=x.worldToLocalTransform,P=new en(i,M,{resourcePath:"",fetcher:ut(e)});return P.name=h,P.matrix.copy(e.transform),P.matrix.decompose(P.position,P.quaternion,P.scale),P.matrixWorldNeedsUpdate=!0,new ii("fallback","mesh",E,S,P,null)});A.push(C)}return Promise.all(A).then(function(x){for(var M,S=[],P=[],T=[],B=0,F=x;B<F.length;B++){var L=F[B];if(i.viewLayers.push(L),L.scene){if(i.disposed){L.scene.dispose();continue}switch(i.add(L.scene),L.scene.visible=!1,L.type){case"mesh":S.push(L.scene);break;case"point_cloud":P.push(L.scene);break;default:T.push(L.scene);break}}}S.length?S[0].visible=!0:P.length?P[0].visible=!0:T.length&&(T[0].visible=!0);var O=(M=r["3d-tiles"])===null||M===void 0?void 0:M.showLayers;if(typeof O=="boolean")for(var Q=0,N=x;Q<N.length;Q++){var L=N[Q];L.scene&&(L.scene.visible=O)}else if(Array.isArray(O))for(var H=0,K=x;H<K.length;H++){var L=K[H];L.scene&&(L.scene.visible=O.indexOf(L.name)!==-1)}})},t.prototype.update=function(e,r,i){if(this.children.length){var a=this.loaded;this.refined=this.work!==null,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=this.work!==null,this.bounding.makeEmpty();for(var o=0,s=this.viewLayers;o<s.length;o++){var u=s[o],l=u.scene;l&&(this.work&&(l.idle=this.materialParameters.modelAlpha===0||!l.loaded,l.cacheCameras=this.cacheCameras,this.autoRefine===!1?l.needsRefined=!1:Ln(i)?l.needsRefined=this.materialParameters.modelAlpha===0||this.materialParameters.modelAlpha===1:l.needsRefined=!0,this.work.transform.equals(l.matrix)||(l.matrix.copy(this.work.transform),l.matrix.decompose(l.position,l.quaternion,l.scale),l.matrixWorldNeedsUpdate=!0)),l.update(e,r),l.boundingBox.isEmpty()||(as.copy(l.boundingBox).applyMatrix4(l.matrix),this.bounding.union(as)),l.needsRender===!0&&(l.needsRender=!1,this.needsRender=!0),l.refined===!1&&(this.refined=!1),this.refineProgress[0]+=l.refineProgress[0],this.refineProgress[1]+=l.refineProgress[1],l.loaded===!1&&(this.loaded=!1))}this.bounding.isEmpty()&&this.bounding.copy(Ku),a===!1&&this.loaded===!0&&this.onLoad()}else this.work&&!this.work.model?(this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!0):(this.refined=!1,this.refineProgress[0]=0,this.refineProgress[1]=0,this.loaded=!1),this.bounding.set(new d.Vector3,new d.Vector3)},t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)e instanceof en&&e.dispose(),this.remove(e)},t}(d.Object3D);function us(){var n=new d.Box3,t=Ld(we,["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 l=u[s];if(l.visible){var c=l.intersectRaycaster(r,i,!1);c.length&&o.push.apply(o,c)}}a&&o.sort(function(f,A){return f.distance-A.distance})}return o},setMaterial:function(r){var i=Zs(t,r);i&&(e.materialVersion++,e.needsRender=!0)},getMaterial:function(){return k({},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 l=0,c=e;l<c.length;l++){var f=c[l];f.setMaterial(t),f.cacheCameras=e.cacheCameras,f.update(r,i,a),f.needsRender===!0&&(e.needsRender=!0,f.needsRender=!1),f.refined===!1&&(e.refined=!1),e.refineProgress[0]+=f.refineProgress[0],e.refineProgress[1]+=f.refineProgress[1],f.loaded===!1&&(e.loaded=!1),n.union(f.bounding)}n.isEmpty()&&n.copy(Ku)}}});return e}function ai(n,t,e){return n+(t-n)*e}function af(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 of(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 sf(n,t,e,r){var i=r[1]-r[0];return n=Ai(n,r),t=Ai(t,r),t-n>i/2?ai(n+i,t,e):n-t>i/2?ai(n-i,t,e):ai(n,t,e)}function Ai(n,t){var e=t[1]-t[0];return n<t[0]?Ai(n+e,t):n>=t[1]?Ai(n-e,t):n}function uf(n,t,e,r){return r?sf(n,t,e,r):ai(n,t,e)}var xe=function(){function n(t){this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=be(),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:k({},this.value)},{progress:1,value:k({},this.value)}]}return n.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-af(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]=uf(r.value[o],i.value[o],s,this.config[o].circle)}return a}return k({},this.keyframes[this.keyframes.length-1].value)},n.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:of(1,this.startVelocity,this.duration,e)},n.prototype.update=function(t){return this.ended?!0:(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(t))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},n.prototype.getKeyFrameSegment=function(t){for(var e=this.getProgress(t),r=1;r<this.keyframes.length;r++)if(this.keyframes[r].progress>e)return[this.keyframes[r-1],this.keyframes[r]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},n.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},n.prototype.set=function(t,e,r,i){var a;r===void 0&&(r=0),isNaN(e)&&(e=0),isNaN(r)&&(r=0),i=i!=null?i:be();var o=this.getProgress(i),s=this.getValue(o),u={};for(var l in this.config)u[l]=(a=t[l])!==null&&a!==void 0?a:s[l];var c=[{progress:0,value:s},{progress:1,value:u}];return this.setKeyframes(c,e,r,i)},n.prototype.setKeyframes=function(t,e,r,i){var a=this;if(r===void 0&&(r=0),t.length<2)throw new Error("keyframes invalid.");return isNaN(e)&&(e=0),isNaN(r)&&(r=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise(function(o,s){i=i!=null?i:be(),a.progress=0,a.ended=!1,a.startTime=i,a.startVelocity=r,a.keyframes=t,a.duration=e,e===0?(a.progress=1,a.value=k({},t[t.length-1].value)):a.value=k({},t[0].value),a.callbacks=[o,s]})},n.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},n}(),ls=function(n){return n*(2-n)},lf=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}(),cf=`
933
933
  varying vec2 vUv;
934
934
  void main() {
935
935
  vUv = uv;
@@ -1037,7 +1037,7 @@ void main() {
1037
1037
 
1038
1038
  gl_FragColor = vec4(gl_FragColor.rgb * baseColor, gl_FragColor.a * opacity * opacity);
1039
1039
  }
1040
- `,ja=function(n){oe(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(lf,new d.ShaderMaterial({blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:cf,fragmentShader:df,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=ae(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:ae(e*1.2,0,1)},100).catch(Q)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=ae(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=ds(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=ds(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 v=this.ringMotion.value,s=v.scale,a=v.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),fs=function(n){return n*(2-n)},ff=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}(),hf=`
1040
+ `,qu=function(n){le(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 xe({progress:0}),a.ringMotion=new xe({scale:1,opacity:1}),a.tapMotion=new xe({scale:1,opacity:1}),a.loadingOpacityMotion=new xe({opacity:0}),a.progressMotion=new xe({progress:0}),a.progressOpacityMotion=new xe({opacity:0}),a.opacityMotion=new xe({opacity:0}),a.disableMotion=new xe({progress:0}),a.panoMesh=new d.Mesh(lf,new d.ShaderMaterial({blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:cf,fragmentShader:df,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=be(),a.needsRender=!0,a}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=he(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(D),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(D).then(function(){r.progressMotion.set({progress:0},0).catch(D)}):this.progressMotion.set({progress:he(e*1.2,0,1)},100).catch(D)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=he(e,0,1),this.opacityMotion.set({opacity:e},200).catch(D))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(D),this.current=e,this.current===!0&&(this.currentStartTime=be()))},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(D))},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(D))},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(D),this.progressMotion.set({progress:0},0).catch(D),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(D),e.progressMotion.set({progress:e.progress},120).catch(D)}).catch(D)},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 l=u%1;this.panoMesh.material.uniforms.expand0.value=ls(l)*this.currentMotion.value.progress,this.needsRender=!0}}{var c=(e-this.currentStartTime-1e3)/2e3;if(c%5<2){var l=c%1;this.panoMesh.material.uniforms.expand1.value=ls(l)*this.currentMotion.value.progress,this.needsRender=!0}}}if(this.currentMotion.value.progress>.2&&this.progress===0&&this.loading===!1){var f=(e-this.currentStartTime-1e3)/2e3;f%5<2?this.ringMotion.getTargetKeyframe().value.scale!==.8&&this.ringMotion.set({scale:.8,opacity:0},600).catch(D):this.ringMotion.getTargetKeyframe().value.scale!==1&&this.ringMotion.set({scale:1,opacity:1},600).catch(D)}else this.ringMotion.getTargetKeyframe().value.scale!==1&&this.ringMotion.set({scale:1,opacity:1},600).catch(D);if(!this.ringMotion.ended){var A=this.ringMotion.value,s=A.scale,a=A.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),cs=function(n){return n*(2-n)},ff=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}(),hf=`
1041
1041
  varying vec2 vUv;
1042
1042
  void main() {
1043
1043
  vUv = uv;
@@ -1135,7 +1135,7 @@ void main() {
1135
1135
 
1136
1136
  gl_FragColor = vec4(gl_FragColor.rgb * baseColor, gl_FragColor.a * opacity * opacity);
1137
1137
  }
1138
- `,vf=function(n){oe(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(ff,new d.ShaderMaterial({blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:hf,fragmentShader:pf,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=ae(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:ae(e*1.2,0,1)},100).catch(Q)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=ae(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=fs(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=fs(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),hs=function(n){return n*(2-n)},Af=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}(),mf=`
1138
+ `,vf=function(n){le(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 xe({progress:0}),a.tapMotion=new xe({scale:1,opacity:1}),a.loadingOpacityMotion=new xe({opacity:0}),a.progressMotion=new xe({progress:0}),a.progressOpacityMotion=new xe({opacity:0}),a.opacityMotion=new xe({opacity:0}),a.disableMotion=new xe({progress:0}),a.panoMesh=new d.Mesh(ff,new d.ShaderMaterial({blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:hf,fragmentShader:pf,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=be(),a.needsRender=!0,a}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=he(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(D),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(D).then(function(){r.progressMotion.set({progress:0},0).catch(D)}):this.progressMotion.set({progress:he(e*1.2,0,1)},100).catch(D)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=he(e,0,1),this.opacityMotion.set({opacity:e},200).catch(D))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(D),this.current=e,this.current===!0&&(this.currentStartTime=be()))},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(D))},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(D))},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(D),this.progressMotion.set({progress:0},0).catch(D),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(D),e.progressMotion.set({progress:e.progress},120).catch(D)}).catch(D)},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 l=u%1;this.panoMesh.material.uniforms.expand0.value=cs(l)*this.currentMotion.value.progress,this.needsRender=!0}}{var c=(e-this.currentStartTime-1e3)/2e3;if(c%5<2){var l=c%1;this.panoMesh.material.uniforms.expand1.value=cs(l)*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),ds=function(n){return n*(2-n)},Af=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}(),mf=`
1139
1139
  varying vec2 vUv;
1140
1140
  void main() {
1141
1141
  vUv = uv;
@@ -1274,13 +1274,13 @@ void main() {
1274
1274
 
1275
1275
  gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);
1276
1276
  }
1277
- `,yf=function(n){oe(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,v=(i=e.scale)!==null&&i!==void 0?i:1,p=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(Af,new d.ShaderMaterial({blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:mf,fragmentShader:gf,defines:{USE_COLOR:A,USE_MAP:p!==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:p},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(v,1,v),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=ae(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:ae(e*1.2,0,1)},100).catch(Q)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=ae(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=hs(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=hs(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),bf=new d.CircleBufferGeometry(.1,16),wf=`
1277
+ `,yf=function(n){le(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c=n.call(this)||this,f=(r=e.color)!==null&&r!==void 0?r:16777215,A=(i=e.scale)!==null&&i!==void 0?i:1,p=e.map,y=(a=e.mapAlpha)!==null&&a!==void 0?a:1,v=(o=e.mapUseColor)!==null&&o!==void 0?o:!1,m=(s=e.mapUseReverse)!==null&&s!==void 0?s:!1,h=(u=e.borderWidth)!==null&&u!==void 0?u:.1,g=(l=e.borderColor)!==null&&l!==void 0?l:16777215;return c.progress=0,c.opacity=0,c.loading=!1,c.current=!1,c.disabled=!1,c.currentMotion=new xe({progress:0}),c.tapMotion=new xe({scale:1,opacity:1}),c.loadingOpacityMotion=new xe({opacity:0}),c.progressMotion=new xe({progress:0}),c.progressOpacityMotion=new xe({opacity:0}),c.opacityMotion=new xe({opacity:0}),c.disableMotion=new xe({progress:0}),c.panoMesh=new d.Mesh(Af,new d.ShaderMaterial({blending:d.CustomBlending,blendSrc:d.SrcAlphaFactor,blendDst:d.OneMinusSrcAlphaFactor,blendSrcAlpha:d.OneFactor,blendDstAlpha:d.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:mf,fragmentShader:gf,defines:{USE_COLOR:v,USE_MAP:p!==void 0,USE_BORDER:h>0,USE_REVERSE:m},uniforms:{baseColor:{value:new d.Color(f)},circleScale:{value:1},circleOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0},map:{value:p},mapAlpha:{value:y},borderWidth:{value:h},borderColor:{value:new d.Color(g)}}})),c.renderOrder=-2,c.panoMesh.renderOrder=-2,c.panoMesh.position.y=.004,c.panoMesh.scale.set(A,1,A),c.add(c.panoMesh),c.currentStartTime=be(),c.needsRender=!0,c}return t.prototype.setProgress=function(e){var r=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=he(e,0,1),this.tapMotion.ended&&(this.progress===0&&this.progressOpacityMotion.set({opacity:1},500).catch(D),e===0?this.progressOpacityMotion.set({opacity:0},500).catch(D).then(function(){r.progressMotion.set({progress:0},0).catch(D)}):this.progressMotion.set({progress:he(e*1.2,0,1)},100).catch(D)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=he(e,0,1),this.opacityMotion.set({opacity:e},200).catch(D))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(D),this.current=e,this.current===!0&&(this.currentStartTime=be()))},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(D))},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(D))},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(D),this.progressMotion.set({progress:0},0).catch(D),this.tapMotion.setKeyframes(r,600).then(function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(D),e.progressMotion.set({progress:e.progress},120).catch(D)}).catch(D)},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=ds(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=ds(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),bf=new d.CircleBufferGeometry(.1,16),wf=`
1278
1278
  varying vec2 vUv;
1279
1279
  void main() {
1280
1280
  vUv = uv;
1281
1281
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
1282
1282
  }
1283
- `,xf=`
1283
+ `,Ef=`
1284
1284
  varying vec2 vUv;
1285
1285
 
1286
1286
  float smoothDist = 0.01;
@@ -1301,28 +1301,28 @@ void main() {
1301
1301
 
1302
1302
  gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * outside * inside);
1303
1303
  }
1304
- `,Ef=new d.ShaderMaterial({vertexShader:wf,fragmentShader:xf,transparent:!0}),Mi=function(n){oe(t,n);function t(){var e=n.call(this)||this;return e.ringMesh=new d.Mesh(bf,Ef),e.ringMesh.renderOrder=-2,e.add(e.ringMesh),e}return t.prototype.dispose=function(){this.remove(this.ringMesh)},t}(d.Object3D);function Cr(){return((1+Math.random())*65536|0).toString(16).substring(1)}function ht(){return(Cr()+Cr()+"-"+Cr()+"-4"+Cr().substr(0,3)+"-"+Cr()+"-"+Cr()+Cr()+Cr()).toLowerCase()}function Cn(n,t,e){var r=Math.abs(n-t);return r<.001||typeof e!="undefined"&&Math.abs(e-r)<.001}function Xt(n,t,e){return!Cn(n,t,e)}function Ci(n,t){return n.distanceTo(t)<.001}function Ma(n,t){return!Ci(n,t)}var Xu=new d.Vector3(0,0,0),Mf=function(n){oe(t,n);function t(e,r){r===void 0&&(r=Xu);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 Un;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 Gt(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}($s);function Cf(n,t){return t===void 0&&(t=Xu),new Mf(n,t)}function Sf(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 Lr(n){return n>=0&&n<Zn?n:(n%Zn+Zn)%Zn}var Ca=Math.PI,ps=Ca*2;function Zi(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 If(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 vs(n,t,e){if(n.longitude===t.longitude&&n.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var r=Lr(n.longitude),i=n.latitude,a=Lr(t.longitude),o=t.latitude;a-r>Ca?r+=ps:r-a>Ca&&(r-=ps);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 Tf(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(t){return!1}})();var Sn=function(){var n=typeof navigator!="undefined"?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 K(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 Pf(){return typeof location=="undefined"||location.protocol!=="https:"?Promise.reject(new Error("Request DeviceOrientation Permission denied.")):typeof DeviceOrientationEvent!="undefined"&&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 Bf(){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 dr(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 Gr(n,t){return n.workCode===t.workCode&&n.mode===t.mode&&n.panoIndex===t.panoIndex&&Cn(n.longitude,t.longitude,Math.PI*2)&&Cn(n.latitude,t.latitude)&&Cn(n.fov,t.fov)&&Ci(n.offset,t.offset)&&Cn(n.distance,t.distance)}var Rf=function(n){return Number(n)};function Pt(n,t,e){var r;t===void 0&&(t=Rf),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 Et(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
1304
+ `,xf=new d.ShaderMaterial({vertexShader:wf,fragmentShader:Ef,transparent:!0}),xi=function(n){le(t,n);function t(){var e=n.call(this)||this;return e.ringMesh=new d.Mesh(bf,xf),e.ringMesh.renderOrder=-2,e.add(e.ringMesh),e}return t.prototype.dispose=function(){this.remove(this.ringMesh)},t}(d.Object3D);function Mr(){return((1+Math.random())*65536|0).toString(16).substring(1)}function wt(){return(Mr()+Mr()+"-"+Mr()+"-4"+Mr().substr(0,3)+"-"+Mr()+"-"+Mr()+Mr()+Mr()).toLowerCase()}function En(n,t,e){var r=Math.abs(n-t);return r<.001||typeof e!="undefined"&&Math.abs(e-r)<.001}function Kt(n,t,e){return!En(n,t,e)}function Dn(n,t){return n.distanceTo(t)<.001}function xa(n,t){return!Dn(n,t)}var ju=new d.Vector3(0,0,0),Cf=function(n){le(t,n);function t(e,r){r===void 0&&(r=ju);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 Qn;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 Mt(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}(Ys);function Mf(n,t){return t===void 0&&(t=ju),new Cf(n,t)}function Sf(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 _n=Math.PI*2;function kr(n){return n>=0&&n<_n?n:(n%_n+_n)%_n}var Ca=Math.PI,fs=Ca*2;function Xi(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 If(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 hs(n,t,e){if(n.longitude===t.longitude&&n.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var r=kr(n.longitude),i=n.latitude,a=kr(t.longitude),o=t.latitude;a-r>Ca?r+=fs:r-a>Ca&&(r-=fs);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 Tf(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(t){return!1}})();var xn=function(){var n=typeof navigator!="undefined"?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:be(),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 Pf(){return typeof location=="undefined"||location.protocol!=="https:"?Promise.reject(new Error("Request DeviceOrientation Permission denied.")):typeof DeviceOrientationEvent!="undefined"&&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 Bf(){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 er(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 Sr(n,t){return n.workCode===t.workCode&&n.mode===t.mode&&n.panoIndex===t.panoIndex&&En(n.longitude,t.longitude,Math.PI*2)&&En(n.latitude,t.latitude)&&En(n.fov,t.fov)&&Dn(n.offset,t.offset)&&En(n.distance,t.distance)}var Rf=function(n){return Number(n)};function nr(n,t,e){var r;t===void 0&&(t=Rf),e===void 0&&(e=!1);for(var i,a=1/0,o=0,s=n;o<s.length;o++){var u=s[o],l=t(u);l<=a&&(r=[u,l],i=r[0],a=r[1])}return isFinite(a)||(a=0),e?[i,a]:i}function Vt(n){for(var t in n)return!1;return!0}function je(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
1305
1305
  * http://hammerjs.github.io/
1306
1306
  *
1307
1307
  * Copyright (c) 2016 Jorik Tangelder;
1308
- * 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,R,V){return setTimeout(g(T,V),R)}function h(T,R,V){return Array.isArray(T)?(v(T,V[R],V),!0):!1}function v(T,R,V){var G;if(T)if(T.forEach)T.forEach(R,V);else if(T.length!==r)for(G=0;G<T.length;)R.call(V,T[G],G,T),G++;else for(G in T)T.hasOwnProperty(G)&&R.call(V,T[G],G,T)}function p(T,R,V){var G="DEPRECATED METHOD: "+R+`
1308
+ * Licensed under the MIT license */var Cn=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,l=Date.now;function c(I,R,V){return setTimeout(g(I,V),R)}function f(I,R,V){return Array.isArray(I)?(A(I,V[R],V),!0):!1}function A(I,R,V){var z;if(I)if(I.forEach)I.forEach(R,V);else if(I.length!==r)for(z=0;z<I.length;)R.call(V,I[z],z,I),z++;else for(z in I)I.hasOwnProperty(z)&&R.call(V,I[z],z,I)}function p(I,R,V){var z="DEPRECATED METHOD: "+R+`
1309
1309
  `+V+` AT
1310
- `;return function(){var J=new Error("get-stack-trace"),ne=J&&J.stack?J.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",xe=n.console&&(n.console.warn||n.console.log);return xe&&xe.call(n.console,G,ne),T.apply(this,arguments)}}var m;typeof Object.assign!="function"?m=function(R){if(R===r||R===null)throw new TypeError("Cannot convert undefined or null to object");for(var V=Object(R),G=1;G<arguments.length;G++){var J=arguments[G];if(J!==r&&J!==null)for(var ne in J)J.hasOwnProperty(ne)&&(V[ne]=J[ne])}return V}:m=Object.assign;var A=p(function(R,V,G){for(var J=Object.keys(V),ne=0;ne<J.length;)(!G||G&&R[J[ne]]===r)&&(R[J[ne]]=V[J[ne]]),ne++;return R},"extend","Use `assign`."),y=p(function(R,V){return A(R,V,!0)},"merge","Use `assign`.");function f(T,R,V){var G=R.prototype,J;J=T.prototype=Object.create(G),J.constructor=T,J._super=G,V&&m(J,V)}function g(T,R){return function(){return T.apply(R,arguments)}}function b(T,R){return typeof T==o?T.apply(R&&R[0]||r,R):T}function w(T,R){return T===r?R:T}function x(T,R,V){v(S(R),function(G){T.addEventListener(G,V,!1)})}function E(T,R,V){v(S(R),function(G){T.removeEventListener(G,V,!1)})}function M(T,R){for(;T;){if(T==R)return!0;T=T.parentNode}return!1}function C(T,R){return T.indexOf(R)>-1}function S(T){return T.trim().split(/\s+/g)}function P(T,R,V){if(T.indexOf&&!V)return T.indexOf(R);for(var G=0;G<T.length;){if(V&&T[G][V]==R||!V&&T[G]===R)return G;G++}return-1}function I(T){return Array.prototype.slice.call(T,0)}function B(T,R,V){for(var G=[],J=[],ne=0;ne<T.length;){var xe=R?T[ne][R]:T[ne];P(J,xe)<0&&G.push(T[ne]),J[ne]=xe,ne++}return V&&(R?G=G.sort(function(bt,De){return bt[R]>De[R]}):G=G.sort()),G}function L(T,R){for(var V,G,J=R[0].toUpperCase()+R.slice(1),ne=0;ne<i.length;){if(V=i[ne],G=V?V+J:R,G in T)return G;ne++}return r}var k=1;function O(){return k++}function N(T){var R=T.ownerDocument||T;return R.defaultView||R.parentWindow||n}var D=/mobile|tablet|ip(ad|hone|od)|android/i,H="ontouchstart"in n,z=L(n,"PointerEvent")!==r,U=H&&D.test(navigator.userAgent),q="touch",j="pen",_="mouse",Z="kinect",W=25,Y=1,ce=2,te=4,se=8,ue=1,pe=2,he=4,de=8,be=16,fe=pe|he,Se=de|be,ee=fe|Se,le=["x","y"],X=["clientX","clientY"];function Te(T,R){var V=this;this.manager=T,this.callback=R,this.element=T.element,this.target=T.options.inputTarget,this.domHandler=function(G){b(T.options.enable,[T])&&V.handler(G)},this.init()}Te.prototype={handler:function(){},init: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)},destroy: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)}};function Fe(T){var R,V=T.options.inputClass;return V?R=V:z?R=Rt:U?R=kt:H?R=ar:R=Je,new R(T,Ye)}function Ye(T,R,V){var G=V.pointers.length,J=V.changedPointers.length,ne=R&Y&&G-J===0,xe=R&(te|se)&&G-J===0;V.isFirst=!!ne,V.isFinal=!!xe,ne&&(T.session={}),V.eventType=R,Xe(T,V),T.emit("hammer.input",V),T.recognize(V),T.session.prevInput=V}function Xe(T,R){var V=T.session,G=R.pointers,J=G.length;V.firstInput||(V.firstInput=Ne(R)),J>1&&!V.firstMultiple?V.firstMultiple=Ne(R):J===1&&(V.firstMultiple=!1);var ne=V.firstInput,xe=V.firstMultiple,_e=xe?xe.center:ne.center,bt=R.center=me(G);R.timeStamp=c(),R.deltaTime=R.timeStamp-ne.timeStamp,R.angle=He(_e,bt),R.distance=Ce(_e,bt),Ge(V,R),R.offsetDirection=nt(R.deltaX,R.deltaY);var De=Ae(R.deltaTime,R.deltaX,R.deltaY);R.overallVelocityX=De.x,R.overallVelocityY=De.y,R.overallVelocity=u(De.x)>u(De.y)?De.x:De.y,R.scale=xe?it(xe.pointers,G):1,R.rotation=xe?Oe(xe.pointers,G):0,R.maxPointers=V.prevInput?R.pointers.length>V.prevInput.maxPointers?R.pointers.length:V.prevInput.maxPointers:R.pointers.length,st(V,R);var $t=T.element;M(R.srcEvent.target,$t)&&($t=R.srcEvent.target),R.target=$t}function Ge(T,R){var V=R.center,G=T.offsetDelta||{},J=T.prevDelta||{},ne=T.prevInput||{};(R.eventType===Y||ne.eventType===te)&&(J=T.prevDelta={x:ne.deltaX||0,y:ne.deltaY||0},G=T.offsetDelta={x:V.x,y:V.y}),R.deltaX=J.x+(V.x-G.x),R.deltaY=J.y+(V.y-G.y)}function st(T,R){var V=T.lastInterval||R,G=R.timeStamp-V.timeStamp,J,ne,xe,_e;if(R.eventType!=se&&(G>W||V.velocity===r)){var bt=R.deltaX-V.deltaX,De=R.deltaY-V.deltaY,$t=Ae(G,bt,De);ne=$t.x,xe=$t.y,J=u($t.x)>u($t.y)?$t.x:$t.y,_e=nt(bt,De),T.lastInterval=R}else J=V.velocity,ne=V.velocityX,xe=V.velocityY,_e=V.direction;R.velocity=J,R.velocityX=ne,R.velocityY=xe,R.direction=_e}function Ne(T){for(var R=[],V=0;V<T.pointers.length;)R[V]={clientX:s(T.pointers[V].clientX),clientY:s(T.pointers[V].clientY)},V++;return{timeStamp:c(),pointers:R,center:me(R),deltaX:T.deltaX,deltaY:T.deltaY}}function me(T){var R=T.length;if(R===1)return{x:s(T[0].clientX),y:s(T[0].clientY)};for(var V=0,G=0,J=0;J<R;)V+=T[J].clientX,G+=T[J].clientY,J++;return{x:s(V/R),y:s(G/R)}}function Ae(T,R,V){return{x:R/T||0,y:V/T||0}}function nt(T,R){return T===R?ue:u(T)>=u(R)?T<0?pe:he:R<0?de:be}function Ce(T,R,V){V||(V=le);var G=R[V[0]]-T[V[0]],J=R[V[1]]-T[V[1]];return Math.sqrt(G*G+J*J)}function He(T,R,V){V||(V=le);var G=R[V[0]]-T[V[0]],J=R[V[1]]-T[V[1]];return Math.atan2(J,G)*180/Math.PI}function Oe(T,R){return He(R[1],R[0],X)+He(T[1],T[0],X)}function it(T,R){return Ce(R[0],R[1],X)/Ce(T[0],T[1],X)}var qe={mousedown:Y,mousemove:ce,mouseup:te},Zt="mousedown",Or="mousemove mouseup";function Je(){this.evEl=Zt,this.evWin=Or,this.pressed=!1,Te.apply(this,arguments)}f(Je,Te,{handler:function(R){var V=qe[R.type];V&Y&&(R.button===0||R.button===2)&&(this.pressed=!0),V&ce&&R.which!==1&&(V=te),this.pressed&&(V&te&&(this.pressed=!1),this.callback(this.manager,V,{pointers:[R],changedPointers:[R],pointerType:_,srcEvent:R}))}});var Mt={pointerdown:Y,pointermove:ce,pointerup:te,pointercancel:se,pointerout:se},Xr={2:q,3:j,4:_,5:Z},$e="pointerdown",Bt="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&($e="MSPointerDown",Bt="MSPointerMove MSPointerUp MSPointerCancel");function Rt(){this.evEl=$e,this.evWin=Bt,Te.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}f(Rt,Te,{handler:function(R){var V=this.store,G=!1,J=!1,ne=R.type.toLowerCase().replace("ms",""),xe=Mt[ne],_e=Xr[R.pointerType]||R.pointerType,bt=_e==q,De=P(V,R.pointerId,"pointerId");xe&Y&&(R.button===0||R.button===2||bt)?De<0&&(V.push(R),De=V.length-1):xe&(te|se)?G=!0:!bt&&R.buttons===0&&(G=!0,J=!0,xe=Mt.pointerup),!(De<0)&&(J||(V[De]=R),this.callback(this.manager,xe,{pointers:V,changedPointers:[R],pointerType:_e,srcEvent:V[De]}),G&&V.splice(De,1))}});var Ht={touchstart:Y,touchmove:ce,touchend:te,touchcancel:se},Yt="touchstart",pt="touchstart touchmove touchend touchcancel";function Ie(){this.evTarget=Yt,this.evWin=pt,this.started=!1,Te.apply(this,arguments)}f(Ie,Te,{handler:function(R){var V=Ht[R.type];if(V===Y&&(this.started=!0),!!this.started){var G=gr.call(this,R,V);V&(te|se)&&G[0].length-G[1].length===0&&(this.started=!1),this.callback(this.manager,V,{pointers:G[0],changedPointers:G[1],pointerType:q,srcEvent:R})}}});function gr(T,R){var V=I(T.touches),G=I(T.changedTouches);return R&(te|se)&&(V=B(V.concat(G),"identifier",!0)),[V,G]}var Ft={touchstart:Y,touchmove:ce,touchend:te,touchcancel:se},ir="touchstart touchmove touchend touchcancel";function kt(){this.evTarget=ir,this.targetIds={},Te.apply(this,arguments)}f(kt,Te,{handler:function(R){var V=Ft[R.type],G=mn.call(this,R,V);G&&this.callback(this.manager,V,{pointers:G[0],changedPointers:G[1],pointerType:q,srcEvent:R})}});function mn(T,R){var V=I(T.touches),G=this.targetIds;if(R&(Y|ce)&&V.length===1)return G[V[0].identifier]=!0,[V,V];var J,ne,xe=I(T.changedTouches),_e=[],bt=this.target;if(ne=V.filter(function(De){return M(De.target,bt)}),R===Y)for(J=0;J<ne.length;)G[ne[J].identifier]=!0,J++;for(J=0;J<xe.length;)G[xe[J].identifier]&&_e.push(xe[J]),R&(te|se)&&delete G[xe[J].identifier],J++;if(_e.length)return[B(ne.concat(_e),"identifier",!0),_e]}var Vr=2500,Nr=25;function ar(){Te.apply(this,arguments);var T=g(this.handler,this);this.touch=new kt(this.manager,T),this.mouse=new Je(this.manager,T),this.primaryTouch=null,this.lastTouches=[]}f(ar,Te,{handler:function(R,V,G){var J=G.pointerType==q,ne=G.pointerType==_;if(!(ne&&G.sourceCapabilities&&G.sourceCapabilities.firesTouchEvents)){if(J)or.call(this,V,G);else if(ne&&Ke.call(this,G))return;this.callback(R,V,G)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function or(T,R){T&Y?(this.primaryTouch=R.changedPointers[0].identifier,et.call(this,R)):T&(te|se)&&et.call(this,R)}function et(T){var R=T.changedPointers[0];if(R.identifier===this.primaryTouch){var V={x:R.clientX,y:R.clientY};this.lastTouches.push(V);var G=this.lastTouches,J=function(){var ne=G.indexOf(V);ne>-1&&G.splice(ne,1)};setTimeout(J,Vr)}}function Ke(T){for(var R=T.srcEvent.clientX,V=T.srcEvent.clientY,G=0;G<this.lastTouches.length;G++){var J=this.lastTouches[G],ne=Math.abs(R-J.x),xe=Math.abs(V-J.y);if(ne<=Nr&&xe<=Nr)return!0}return!1}var Lt=a?L(a.style,"touchAction"):r,sr=Lt!==r,gn="compute",Gn="auto",Qr="manipulation",ut="none",at="pan-x",lt="pan-y",gt=Dr();function yt(T,R){this.manager=T,this.set(R)}yt.prototype={set:function(T){T==gn&&(T=this.compute()),sr&&this.manager.element.style&&gt[T]&&(this.manager.element.style[Lt]=T),this.actions=T.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var T=[];return v(this.manager.recognizers,function(R){b(R.options.enable,[R])&&(T=T.concat(R.getTouchAction()))}),Hn(T.join(" "))},preventDefaults:function(T){var R=T.srcEvent,V=T.offsetDirection;if(this.manager.session.prevented){R.preventDefault();return}var G=this.actions,J=C(G,ut)&&!gt[ut],ne=C(G,lt)&&!gt[lt],xe=C(G,at)&&!gt[at];if(J){var _e=T.pointers.length===1,bt=T.distance<2,De=T.deltaTime<250;if(_e&&bt&&De)return}if(!(xe&&ne)&&(J||ne&&V&fe||xe&&V&Se))return this.preventSrc(R)},preventSrc:function(T){this.manager.session.prevented=!0,T.preventDefault()}};function Hn(T){if(C(T,ut))return ut;var R=C(T,at),V=C(T,lt);return R&&V?ut:R||V?R?at:lt:C(T,Qr)?Qr:Gn}function Dr(){if(!sr)return!1;var T={},R=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(V){T[V]=R?n.CSS.supports("touch-action",V):!0}),T}var Ur=1,Ot=2,_r=4,yr=8,ur=yr,yn=16,Jt=32;function lr(T){this.options=m({},this.defaults,T||{}),this.id=O(),this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=Ur,this.simultaneous={},this.requireFail=[]}lr.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 R=this.simultaneous;return T=qn(T,this),R[T.id]||(R[T.id]=T,T.recognizeWith(this)),this},dropRecognizeWith:function(T){return h(T,"dropRecognizeWith",this)?this:(T=qn(T,this),delete this.simultaneous[T.id],this)},requireFailure:function(T){if(h(T,"requireFailure",this))return this;var R=this.requireFail;return T=qn(T,this),P(R,T)===-1&&(R.push(T),T.requireFailure(this)),this},dropRequireFailure:function(T){if(h(T,"dropRequireFailure",this))return this;T=qn(T,this);var R=P(this.requireFail,T);return R>-1&&this.requireFail.splice(R,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(T){return!!this.simultaneous[T.id]},emit:function(T){var R=this,V=this.state;function G(J){R.manager.emit(J,T)}V<yr&&G(R.options.event+io(V)),G(R.options.event),T.additionalEvent&&G(T.additionalEvent),V>=yr&&G(R.options.event+io(V))},tryEmit:function(T){if(this.canEmit())return this.emit(T);this.state=Jt},canEmit:function(){for(var T=0;T<this.requireFail.length;){if(!(this.requireFail[T].state&(Jt|Ur)))return!1;T++}return!0},recognize:function(T){var R=m({},T);if(!b(this.options.enable,[this,R])){this.reset(),this.state=Jt;return}this.state&(ur|yn|Jt)&&(this.state=Ur),this.state=this.process(R),this.state&(Ot|_r|yr|yn)&&this.tryEmit(R)},process:function(T){},getTouchAction:function(){},reset:function(){}};function io(T){return T&yn?"cancel":T&yr?"end":T&_r?"move":T&Ot?"start":""}function ao(T){return T==be?"down":T==de?"up":T==pe?"left":T==he?"right":""}function qn(T,R){var V=R.manager;return V?V.get(T):T}function qt(){lr.apply(this,arguments)}f(qt,lr,{defaults:{pointers:1},attrTest:function(T){var R=this.options.pointers;return R===0||T.pointers.length===R},process:function(T){var R=this.state,V=T.eventType,G=R&(Ot|_r),J=this.attrTest(T);return G&&(V&se||!J)?R|yn:G||J?V&te?R|yr:R&Ot?R|_r:Ot:Jt}});function Kn(){qt.apply(this,arguments),this.pX=null,this.pY=null}f(Kn,qt,{defaults:{event:"pan",threshold:10,pointers:1,direction:ee},getTouchAction:function(){var T=this.options.direction,R=[];return T&fe&&R.push(lt),T&Se&&R.push(at),R},directionTest:function(T){var R=this.options,V=!0,G=T.distance,J=T.direction,ne=T.deltaX,xe=T.deltaY;return J&R.direction||(R.direction&fe?(J=ne===0?ue:ne<0?pe:he,V=ne!=this.pX,G=Math.abs(T.deltaX)):(J=xe===0?ue:xe<0?de:be,V=xe!=this.pY,G=Math.abs(T.deltaY))),T.direction=J,V&&G>R.threshold&&J&R.direction},attrTest:function(T){return qt.prototype.attrTest.call(this,T)&&(this.state&Ot||!(this.state&Ot)&&this.directionTest(T))},emit:function(T){this.pX=T.deltaX,this.pY=T.deltaY;var R=ao(T.direction);R&&(T.additionalEvent=this.options.event+R),this._super.emit.call(this,T)}});function Bi(){qt.apply(this,arguments)}f(Bi,qt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ut]},attrTest:function(T){return this._super.attrTest.call(this,T)&&(Math.abs(T.scale-1)>this.options.threshold||this.state&Ot)},emit:function(T){if(T.scale!==1){var R=T.scale<1?"in":"out";T.additionalEvent=this.options.event+R}this._super.emit.call(this,T)}});function Ri(){lr.apply(this,arguments),this._timer=null,this._input=null}f(Ri,lr,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Gn]},process:function(T){var R=this.options,V=T.pointers.length===R.pointers,G=T.distance<R.threshold,J=T.deltaTime>R.time;if(this._input=T,!G||!V||T.eventType&(te|se)&&!J)this.reset();else if(T.eventType&Y)this.reset(),this._timer=l(function(){this.state=ur,this.tryEmit()},R.time,this);else if(T.eventType&te)return ur;return Jt},reset:function(){clearTimeout(this._timer)},emit:function(T){this.state===ur&&(T&&T.eventType&te?this.manager.emit(this.options.event+"up",T):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}});function Fi(){qt.apply(this,arguments)}f(Fi,qt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ut]},attrTest:function(T){return this._super.attrTest.call(this,T)&&(Math.abs(T.rotation)>this.options.threshold||this.state&Ot)}});function ki(){qt.apply(this,arguments)}f(ki,qt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:fe|Se,pointers:1},getTouchAction:function(){return Kn.prototype.getTouchAction.call(this)},attrTest:function(T){var R=this.options.direction,V;return R&(fe|Se)?V=T.overallVelocity:R&fe?V=T.overallVelocityX:R&Se&&(V=T.overallVelocityY),this._super.attrTest.call(this,T)&&R&T.offsetDirection&&T.distance>this.options.threshold&&T.maxPointers==this.options.pointers&&u(V)>this.options.velocity&&T.eventType&te},emit:function(T){var R=ao(T.offsetDirection);R&&this.manager.emit(this.options.event+R,T),this.manager.emit(this.options.event,T)}});function jn(){lr.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}f(jn,lr,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Qr]},process:function(T){var R=this.options,V=T.pointers.length===R.pointers,G=T.distance<R.threshold,J=T.deltaTime<R.time;if(this.reset(),T.eventType&Y&&this.count===0)return this.failTimeout();if(G&&J&&V){if(T.eventType!=te)return this.failTimeout();var ne=this.pTime?T.timeStamp-this.pTime<R.interval:!0,xe=!this.pCenter||Ce(this.pCenter,T.center)<R.posThreshold;this.pTime=T.timeStamp,this.pCenter=T.center,!xe||!ne?this.count=1:this.count+=1,this._input=T;var _e=this.count%R.taps;if(_e===0)return this.hasRequireFailures()?(this._timer=l(function(){this.state=ur,this.tryEmit()},R.interval,this),Ot):ur}return Jt},failTimeout:function(){return this._timer=l(function(){this.state=Jt},this.options.interval,this),Jt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ur&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Zr(T,R){return R=R||{},R.recognizers=w(R.recognizers,Zr.defaults.preset),new Li(T,R)}Zr.VERSION="2.0.7",Zr.defaults={domEvents:!1,touchAction:gn,enable:!0,inputTarget:null,inputClass:null,preset:[[Fi,{enable:!1}],[Bi,{enable:!1},["rotate"]],[ki,{direction:fe}],[Kn,{direction:fe},["swipe"]],[jn],[jn,{event:"doubletap",taps:2},["tap"]],[Ri]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var h0=1,oo=2;function Li(T,R){this.options=m({},Zr.defaults,R||{}),this.options.inputTarget=this.options.inputTarget||T,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=T,this.input=Fe(this),this.touchAction=new yt(this,this.options.touchAction),so(this,!0),v(this.options.recognizers,function(V){var G=this.add(new V[0](V[1]));V[2]&&G.recognizeWith(V[2]),V[3]&&G.requireFailure(V[3])},this)}Li.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?oo:h0},recognize:function(T){var R=this.session;if(!R.stopped){this.touchAction.preventDefaults(T);var V,G=this.recognizers,J=R.curRecognizer;(!J||J&&J.state&ur)&&(J=R.curRecognizer=null);for(var ne=0;ne<G.length;)V=G[ne],R.stopped!==oo&&(!J||V==J||V.canRecognizeWith(J))?V.recognize(T):V.reset(),!J&&V.state&(Ot|_r|yr)&&(J=R.curRecognizer=V),ne++}},get:function(T){if(T instanceof lr)return T;for(var R=this.recognizers,V=0;V<R.length;V++)if(R[V].options.event==T)return R[V];return null},add:function(T){if(h(T,"add",this))return this;var R=this.get(T.options.event);return R&&this.remove(R),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 R=this.recognizers,V=P(R,T);V!==-1&&(R.splice(V,1),this.touchAction.update())}return this},on:function(T,R){if(T!==r&&R!==r){var V=this.handlers;return v(S(T),function(G){V[G]=V[G]||[],V[G].push(R)}),this}},off:function(T,R){if(T!==r){var V=this.handlers;return v(S(T),function(G){R?V[G]&&V[G].splice(P(V[G],R),1):delete V[G]}),this}},emit:function(T,R){this.options.domEvents&&p0(T,R);var V=this.handlers[T]&&this.handlers[T].slice();if(!(!V||!V.length)){R.type=T,R.preventDefault=function(){R.srcEvent.preventDefault()};for(var G=0;G<V.length;)V[G](R),G++}},destroy:function(){this.element&&so(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function so(T,R){var V=T.element;if(V.style){var G;v(T.options.cssProps,function(J,ne){G=L(V.style,ne),R?(T.oldCssProps[G]=V.style[G],V.style[G]=J):V.style[G]=T.oldCssProps[G]||""}),R||(T.oldCssProps={})}}function p0(T,R){var V=t.createEvent("Event");V.initEvent(T,!0,!0),V.gesture=R,R.target.dispatchEvent(V)}return m(Zr,{INPUT_START:Y,INPUT_MOVE:ce,INPUT_END:te,INPUT_CANCEL:se,STATE_POSSIBLE:Ur,STATE_BEGAN:Ot,STATE_CHANGED:_r,STATE_ENDED:yr,STATE_RECOGNIZED:ur,STATE_CANCELLED:yn,STATE_FAILED:Jt,DIRECTION_NONE:ue,DIRECTION_LEFT:pe,DIRECTION_RIGHT:he,DIRECTION_UP:de,DIRECTION_DOWN:be,DIRECTION_HORIZONTAL:fe,DIRECTION_VERTICAL:Se,DIRECTION_ALL:ee,Manager:Li,Input:Te,TouchAction:yt,TouchInput:kt,MouseInput:Je,PointerEventInput:Rt,TouchMouseInput:ar,SingleTouchInput:Ie,Recognizer:lr,AttrRecognizer:qt,Tap:jn,Pan:Kn,Swipe:ki,Pinch:Bi,Rotate:Fi,Press:Ri,on:x,off:E,each:v,merge:y,extend:A,assign:m,inherit:f,bindFn:g,prefixed:L}),Zr}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function As(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 Wa=function(n){oe(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){ft.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:F({},e)},t.initAnimationEndState=function(e){var r,i,a,o,s,u,c,l,h=this.parseArgs(e),v=h.initial,p=v.state,m=v.currentState,A=typeof p.panoIndex=="number"?{workCode:(a=(r=p.workCode)!==null&&r!==void 0?r:(i=h.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:p.panoIndex}:{workCode:m.workCode,panoIndex:m.panoIndex};return F(F({},A),{mode:"",longitude:(o=p.longitude)!==null&&o!==void 0?o:m.longitude,latitude:(s=p.latitude)!==null&&s!==void 0?s:m.latitude,fov:(u=p.fov)!==null&&u!==void 0?u:m.fov,offset:(c=p.offset)!==null&&c!==void 0?c:m.offset,distance:(l=p.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),Et(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 F(F({},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",K("initAnimation.start",{state:i,userAction:this.userAction})),this.emit("initAnimation.end",K("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,v=(s=e.offset)!==null&&s!==void 0?s:this.camera.pose.offset,p=Xt(u,this.camera.pose.longitude,Math.PI*2)||Xt(c,this.camera.pose.latitude),m=Xt(l,this.camera.pose.fov),A=Xt(h,this.camera.pose.distance),y=Ma(v,this.camera.pose.offset);(m||p||y||A)&&(this.camera.setFromPose({longitude:u,latitude:c,fov:l,distance:h,offset:v}),this.emit("camera.update",K("camera.update",{userAction:this.userAction,state:F(F({},this.currentPano),{mode:this.mode,longitude:u,latitude:c,fov:l,offset:v,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=K("gesture.momentum",F(F({},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 As(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(C){var S=As(C,r.element,r.scissor);return!(Math.abs(S.x)>1||Math.abs(S.y)>1)},a=new In.Manager(e),o=function(C){var S=C.session;return S.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 S=o(a);if(!(S&&!i(S.center))){var P=K("gesture.pan",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(I){var B=r.relativeClientPosition(I),L=new d.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:I.x,y:I.y,delta:0,buttons:0,coords:B,raycaster:L}}),isFirst:C.isFirst,isFinal:C.isFinal,scale:C.scale,center:function(I){var B=r.relativeClientPosition(I),L=new d.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:I.x,y:I.y,delta:0,buttons:0,coords:B,raycaster:L}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:F(F({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 S=o(a);if(!(S&&!i(S.center))){var P=K("gesture.tap",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(I){var B=r.relativeClientPosition(I),L=new d.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:I.x,y:I.y,delta:0,buttons:0,coords:B,raycaster:L}}),isFirst:!0,isFinal:!0,scale:C.scale,center:function(I){var B=r.relativeClientPosition(I),L=new d.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:I.x,y:I.y,delta:0,buttons:0,coords:B,raycaster:L}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:F(F({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onTapGesture(P),y()}}}),a.on("pinchstart pinch pinchend",function(C){var S=o(a);if(!(S&&!i(S.center))){var P=K("gesture.pinch",{target:C.target,pointerType:C.pointerType,srcEvent:C.srcEvent,pointers:C.pointers.map(function(I){var B,L=r.relativeClientPosition(I),k=new d.Raycaster;return k.params.Points={threshold:.1},k.setFromCamera(L,r.camera),{x:I.x,y:I.y,delta:(B=I.delta)!==null&&B!==void 0?B:0,buttons:0,coords:L,raycaster:k}}),isFirst:C.type==="pinchstart",isFinal:C.type==="pinchend",scale:C.scale,center:function(I){var B=r.relativeClientPosition(I),L=new d.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(B,r.camera),{x:I.x,y:I.y,delta:0,buttons:0,coords:B,raycaster:L}}(C.center),velocityX:C.velocityX,velocityY:C.velocityY,overallVelocityX:C.overallVelocityX,overallVelocityY:C.overallVelocityY,userAction:!0,state:F(F({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onPinchGesture(P),y()}});var s=null,u=null,c=function(C,S,P){var I={x:P.clientX,y:P.clientY},B=r.relativeClientPosition(I),L=new d.Raycaster;L.params.Points={threshold:.1},L.setFromCamera(B,r.camera);var k=F(F({},I),{coords:B,raycaster:L,buttons:P.buttons,delta:0}),O=C==="pinchend"?S:S-P.deltaY/280,N=K("gesture.pinch",{target:P.target,pointerType:"mouse",srcEvent:P,pointers:[F({},k)],isFirst:C==="pinchstart",isFinal:C==="pinchend",scale:ae(O,.1,10),center:F({},k),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),Ve(r.camera.pose))});return N},l=function(C){var S,P={x:C.clientX,y:C.clientY};if(i(P)){if(C.preventDefault(),C.ctrlKey){var I=(S=s==null?void 0:s.prevEvent.scale)!==null&&S!==void 0?S:1,B=c(s?"pinch":"pinchstart",I,C);s===null?s={firstEvent:B,prevEvent:B}:s.prevEvent=B,r.onPinchGesture(B),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,q=c("pinchend",U,C);s=null,r.onPinchGesture(q)},200)}else{var L=(Math.abs(C.deltaY)>Math.abs(C.deltaX)?C.deltaY:C.deltaX)/-60,k=r.mouseWheelState!==void 0,O={x:C.clientX,y:C.clientY},N=r.relativeClientPosition(O),D=new d.Raycaster;D.params.Points={threshold:.1},D.setFromCamera(N,r.camera);var H=F(F({},O),{coords:N,raycaster:D,buttons:C.buttons,delta:L}),B=K("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F({},H)],isFirst:k,isFinal:!1,scale:0,center:F({},H),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onMouseWheel(B),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var U=K("gesture.mousewheel",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F(F({},H),{delta:0})],isFirst:!1,isFinal:!0,scale:0,center:F(F({},H),{delta:0}),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.onMouseWheel(U)},100)}}y()}},h=function(C){if(!Sn()){if(!i({x:C.clientX,y:C.clientY})){v();return}var S=!1;r.mouseMoveState||(S=!0);var P={x:C.clientX,y:C.clientY},I=r.relativeClientPosition(P),B=new d.Raycaster;B.params.Points={threshold:.1},B.setFromCamera(I,r.camera);var L=F(F({},P),{coords:I,raycaster:B,buttons:C.buttons,delta:0}),k=K("gesture.mousemove",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F({},L)],isFirst:S,isFinal:!1,scale:0,center:F({},L),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),Ve(r.camera.pose))});r.mouseMoveState||(r.mouseMoveState={timeStamp:ve(),event:k}),r.onMouseMove(k),r.pressState&&Math.abs(C.clientX-r.pressState.event.center.y)>10&&Math.abs(C.clientY-r.pressState.event.center.y)>10&&y()}},v=function(){if(r.mouseMoveState){var C=K(r.mouseMoveState.event.type,F(F({},r.mouseMoveState.event),{isFinal:!0}));r.onMouseMove(C)}y()},p=function(C){if(!i(C.center)){y();return}var S=!1;r.pressState||(S=!0,r.pressState={event:C,timeStamp:ve(),stop:Q});var P=ve()-r.pressState.timeStamp,I=K(r.pressState.event.type,F(F({},r.pressState.event),{isFirst:S,isFinal:!1,center:F(F({},r.pressState.event.center),{delta:P}),pointers:r.pressState.event.pointers.map(function(B){return F(F({},B),{delta:P})})}));r.onPressGesture(I),r.pressState&&(r.pressState.stop=ft.shared.add(function(B){p(C)},!0,1))},m=function(C){if(y(),!(C.touches.length>1||C.changedTouches.length<=0)){var S={x:C.changedTouches[0].clientX,y:C.changedTouches[0].clientY},P=r.relativeClientPosition(S),I=new d.Raycaster;I.params.Points={threshold:.1},I.setFromCamera(P,r.camera);var B=F(F({},S),{coords:P,raycaster:I,buttons:0,delta:0}),L=K("gesture.press",{target:C.target,pointerType:"touch",srcEvent:C,pointers:[F({},B)],isFirst:!1,isFinal:!1,scale:0,center:B,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),Ve(r.camera.pose))});p(L)}},A=function(C){y();var S={x:C.clientX,y:C.clientY},P=r.relativeClientPosition(S),I=new d.Raycaster;I.params.Points={threshold:.1},I.setFromCamera(P,r.camera);var B=F(F({},S),{coords:P,raycaster:I,buttons:C.buttons,delta:0}),L=K("gesture.press",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F({},B)],isFirst:!1,isFinal:!1,scale:0,center:B,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),Ve(r.camera.pose))});p(L)},y=function(){var C;if(r.pressState){var S=ve()-r.pressState.timeStamp,P=K(r.pressState.event.type,F(F({},r.pressState.event),{center:F(F({},r.pressState.event.center),{delta:S}),isFirst:!1,isFinal:!0,pointers:r.pressState.event.pointers.map(function(I){return F(F({},I),{delta:S})})}));r.onPressGesture(P),(C=r.pressState)===null||C===void 0||C.stop(),delete r.pressState}},f=null,g=function(C){var S,P=!1,I=!1;switch(C.type){case"gesturestart":P=!0;break;case"gestureend":I=!0;break}var B={x:C.clientX,y:C.clientY},L=r.relativeClientPosition(B),k=new d.Raycaster;k.params.Points={threshold:.1},k.setFromCamera(L,r.camera);var O=F(F({},B),{coords:L,raycaster:k,buttons:0,delta:0}),N=K("gesture.pinch",{target:C.target,pointerType:"mouse",srcEvent:C,pointers:[F({},O)],isFirst:P,isFinal:I,scale:(S=C.scale)!==null&&S!==void 0?S:1,center:F({},O),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:F(F({mode:r.mode},r.currentPano),Ve(r.camera.pose))});return N},b=function(C){if(C.preventDefault(),!Sn()){var S=g(C);f={firstEvent:S};var P=f.firstEvent;P&&!i(P.center)||r.onPinchGesture(S)}},w=function(C){if(C.preventDefault(),!Sn()&&f){var S=g(C),P=f.firstEvent;P&&!i(P.center)||r.onPinchGesture(S)}},x=function(C){if(C.preventDefault(),!Sn()&&f){var S=g(C),P=f.firstEvent;f=null,!(P&&!i(P.center))&&r.onPinchGesture(S)}},E=function(C){if(C&&typeof C.preventDefault=="function"&&C.currentTarget===e&&C.preventDefault(),typeof getSelection=="function"){var S=getSelection();S&&S.focusNode&&(S.removeAllRanges&&S.removeAllRanges(),S.empty&&S.empty())}};this.enableWheel&&e.addEventListener("wheel",l,{passive:!1}),e.addEventListener("mousemove",h,!1),e.addEventListener("mouseout",v,!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",x,{passive:!1}),e.addEventListener("touchstart",E,{passive:!1}),e.addEventListener("contextmenu",E,!1);var M=function(){a.destroy(),e.removeEventListener("wheel",l,!1),e.removeEventListener("mousemove",h,!1),e.removeEventListener("mouseout",v,!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",x,!1),e.removeEventListener("touchstart",E,!1),e.removeEventListener("contextmenu",E,!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=F({key:"pano.".concat(Re(e),".").concat(s)},nr(i.imageOptions,["size","format","quality","mappings"])),c=a.images[s],l=ci(c,i.imageOptions.transform,u);return dt(a.work).preload(l)})).then(function(){return r(e),e})},t}(Ei),oi=function(n){oe(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 F(F({},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 Mi}})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,c=this.parseArgs(e),l=e.initial,h=l.state,v=l.currentState,p=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:v.workCode,panoIndex:v.panoIndex},m=F(F({},p),{mode:"Floorplan",longitude:(o=h.longitude)!==null&&o!==void 0?o:wa(v.mode)?v.longitude:c.defaultLongitude,latitude:ae((s=h.latitude)!==null&&s!==void 0?s:v.mode==="Floorplan"?v.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!=null?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(ae(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),Et(i)||this.models.setMaterial(i),Et(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return F(F({},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=nr(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",K("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",K("initAnimation.end",{state:s,userAction:e.userAction}))},function(v){var p=F(F(F({},e.currentPano),{mode:e.mode}),Ve(e.camera.pose));e.emit("initAnimation.end",K("initAnimation.end",{state:p,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=Pt(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=F({},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=Lr(this.cameraMotion.value.longitude+u.longitude),h=ae(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),v=F(F({},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}),p=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),m=K("gesture.momentum",F(F({},e),{isFirst:r,isFinal:p,state:v}));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),p?this.inMomentumMovement=null:ft.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=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.relativeClientPosition(e.center),s=this.camera.pose.latitude<Math.PI/6||o.y<0?1:-1;a.x*=s;var u=this.coordinatesForOffset(a),c=Lr(this.cameraMotion.value.longitude+u.longitude),l=ae(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=F(F({},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 v=e.velocityX*s,p=e.velocityY;this.inMomentumMovement={uuid:ht()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:v,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;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&(delete this.panState,delete this.pinchState),typeof i!="undefined"){var a=ae(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=K("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var 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 v=this.camera.position.clone().sub(l);this.intersectMesh.rotation.z=-Math.atan2(v.z,v.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=ae(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=F(F({},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",K("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=ht();this.preloadPano(a.pano).then(function(c){r.currentTapId===u&&r.emit("pano.request",K("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}(Wa),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 Ff(n,t){var e=new d.Vector3().copy(t);return e.multiplyScalar(-n),e}function kf(n,t){var e=new d.Vector3().copy(t);return e.multiplyScalar(n),e}var Lf=function(n){oe(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=F(F({},e.initial),{state:F(F({},e.initial.state),{longitude:0,latitude:Math.PI/2})}),i=F(F({},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 F(F({},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:oi.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",K("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",K("initAnimation.end",{state:s,userAction:e.userAction}))},function(v){var p=F(F(F({},e.currentPano),{mode:e.mode}),Ve(e.camera.pose));e.emit("initAnimation.end",K("initAnimation.end",{state:p,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),v=oi.distanceFromModel(this.models,this.defaultFov,this.camera.aspect),p=v*Math.tan(h),m=l.clone().setLength(v*Math.cos(h)).projectOnPlane(a),A=m.length(),y=u/A*m.x*p,f=u/A*m.z*p,g=u/A*m.y*p;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=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.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(Ff(2*a.x*c/l.y,u.left)),o.add(kf(2*a.y*c/l.y,u.up)),o.clamp(this.models.bounding.min,this.models.bounding.max);var h=F(F({},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!="undefined"){var a=ae(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=ae(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}(oi),Xa=function(n){oe(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 F(F({},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 Mi}})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,c=this.parseArgs(e),l=c.works,h=e.initial,v=h.state,p=h.currentState,m=typeof v.panoIndex=="number"?{workCode:(a=(r=v.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:v.panoIndex}:{workCode:p.workCode,panoIndex:p.panoIndex},A=l.getResolvedObserver(m),y=(o=v.longitude)!==null&&o!==void 0?o:p.longitude,f=ae((s=v.latitude)!==null&&s!==void 0?s:Nn(p.mode)?p.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),g=ae((u=v.fov)!==null&&u!==void 0?u:Nn(p.mode)?p.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 ae(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=F({},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=Lr(this.cameraMotion.value.longitude+u.longitude),h=ae(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),v=F(F({},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}),p=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),m=K("gesture.momentum",F(F({},e),{isFirst:r,isFinal:p,state:v}));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),p?this.inMomentumMovement=null:ft.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=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.coordinatesForOffset(a),s=Lr(this.cameraMotion.value.longitude+o.longitude),u=ae(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=F(F({},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,v=e.velocityY*.6;Math.abs(v)>.5&&Math.abs(h)<.5&&(h=0),this.inMomentumMovement={uuid:ht()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:h,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,a=e.scale;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var o=ae(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=ae(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=K("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var 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 v=this.camera.position.clone().sub(l);this.intersectMesh.rotation.z=-Math.atan2(v.z,v.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t}(Wa),Of="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb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ABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",Yi;function _u(){return Yi||(Yi=new Promise(function(n){var t,e=document.createElement("video");e.muted=!0,e.src=Of,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),_a=new d.BufferGeometry;_a.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));_a.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var Kr=new d.Mesh(_a),Za=new d.Scene;Za.add(Kr);var Vf=`
1310
+ `;return function(){var Y=new Error("get-stack-trace"),oe=Y&&Y.stack?Y.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Me=n.console&&(n.console.warn||n.console.log);return Me&&Me.call(n.console,z,oe),I.apply(this,arguments)}}var y;typeof Object.assign!="function"?y=function(R){if(R===r||R===null)throw new TypeError("Cannot convert undefined or null to object");for(var V=Object(R),z=1;z<arguments.length;z++){var Y=arguments[z];if(Y!==r&&Y!==null)for(var oe in Y)Y.hasOwnProperty(oe)&&(V[oe]=Y[oe])}return V}:y=Object.assign;var v=p(function(R,V,z){for(var Y=Object.keys(V),oe=0;oe<Y.length;)(!z||z&&R[Y[oe]]===r)&&(R[Y[oe]]=V[Y[oe]]),oe++;return R},"extend","Use `assign`."),m=p(function(R,V){return v(R,V,!0)},"merge","Use `assign`.");function h(I,R,V){var z=R.prototype,Y;Y=I.prototype=Object.create(z),Y.constructor=I,Y._super=z,V&&y(Y,V)}function g(I,R){return function(){return I.apply(R,arguments)}}function b(I,R){return typeof I==o?I.apply(R&&R[0]||r,R):I}function w(I,R){return I===r?R:I}function E(I,R,V){A(S(R),function(z){I.addEventListener(z,V,!1)})}function C(I,R,V){A(S(R),function(z){I.removeEventListener(z,V,!1)})}function x(I,R){for(;I;){if(I==R)return!0;I=I.parentNode}return!1}function M(I,R){return I.indexOf(R)>-1}function S(I){return I.trim().split(/\s+/g)}function P(I,R,V){if(I.indexOf&&!V)return I.indexOf(R);for(var z=0;z<I.length;){if(V&&I[z][V]==R||!V&&I[z]===R)return z;z++}return-1}function T(I){return Array.prototype.slice.call(I,0)}function B(I,R,V){for(var z=[],Y=[],oe=0;oe<I.length;){var Me=R?I[oe][R]:I[oe];P(Y,Me)<0&&z.push(I[oe]),Y[oe]=Me,oe++}return V&&(R?z=z.sort(function(gt,He){return gt[R]>He[R]}):z=z.sort()),z}function F(I,R){for(var V,z,Y=R[0].toUpperCase()+R.slice(1),oe=0;oe<i.length;){if(V=i[oe],z=V?V+Y:R,z in I)return z;oe++}return r}var L=1;function O(){return L++}function Q(I){var R=I.ownerDocument||I;return R.defaultView||R.parentWindow||n}var N=/mobile|tablet|ip(ad|hone|od)|android/i,H="ontouchstart"in n,K=F(n,"PointerEvent")!==r,U=H&&N.test(navigator.userAgent),G="touch",X="pen",Z="mouse",q="kinect",W=25,J=1,ve=2,re=4,se=8,ie=1,pe=2,ne=4,de=8,ce=16,fe=pe|ne,$=de|ce,te=fe|$,j=["x","y"],Le=["clientX","clientY"];function Ce(I,R){var V=this;this.manager=I,this.callback=R,this.element=I.element,this.target=I.options.inputTarget,this.domHandler=function(z){b(I.options.enable,[I])&&V.handler(z)},this.init()}Ce.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(Q(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(Q(this.element),this.evWin,this.domHandler)}};function ge(I){var R,V=I.options.inputClass;return V?R=V:K?R=It:U?R=or:H?R=Xe:R=Wt,new R(I,ke)}function ke(I,R,V){var z=V.pointers.length,Y=V.changedPointers.length,oe=R&J&&z-Y===0,Me=R&(re|se)&&z-Y===0;V.isFirst=!!oe,V.isFinal=!!Me,oe&&(I.session={}),V.eventType=R,Ne(I,V),I.emit("hammer.input",V),I.recognize(V),I.session.prevInput=V}function Ne(I,R){var V=I.session,z=R.pointers,Y=z.length;V.firstInput||(V.firstInput=Ae(R)),Y>1&&!V.firstMultiple?V.firstMultiple=Ae(R):Y===1&&(V.firstMultiple=!1);var oe=V.firstInput,Me=V.firstMultiple,Ye=Me?Me.center:oe.center,gt=R.center=me(z);R.timeStamp=l(),R.deltaTime=R.timeStamp-oe.timeStamp,R.angle=Qe(Ye,gt),R.distance=Ee(Ye,gt),De(V,R),R.offsetDirection=Ue(R.deltaX,R.deltaY);var He=Te(R.deltaTime,R.deltaX,R.deltaY);R.overallVelocityX=He.x,R.overallVelocityY=He.y,R.overallVelocity=u(He.x)>u(He.y)?He.x:He.y,R.scale=Me?Ge(Me.pointers,z):1,R.rotation=Me?Be(Me.pointers,z):0,R.maxPointers=V.prevInput?R.pointers.length>V.prevInput.maxPointers?R.pointers.length:V.prevInput.maxPointers:R.pointers.length,We(V,R);var Jt=I.element;x(R.srcEvent.target,Jt)&&(Jt=R.srcEvent.target),R.target=Jt}function De(I,R){var V=R.center,z=I.offsetDelta||{},Y=I.prevDelta||{},oe=I.prevInput||{};(R.eventType===J||oe.eventType===re)&&(Y=I.prevDelta={x:oe.deltaX||0,y:oe.deltaY||0},z=I.offsetDelta={x:V.x,y:V.y}),R.deltaX=Y.x+(V.x-z.x),R.deltaY=Y.y+(V.y-z.y)}function We(I,R){var V=I.lastInterval||R,z=R.timeStamp-V.timeStamp,Y,oe,Me,Ye;if(R.eventType!=se&&(z>W||V.velocity===r)){var gt=R.deltaX-V.deltaX,He=R.deltaY-V.deltaY,Jt=Te(z,gt,He);oe=Jt.x,Me=Jt.y,Y=u(Jt.x)>u(Jt.y)?Jt.x:Jt.y,Ye=Ue(gt,He),I.lastInterval=R}else Y=V.velocity,oe=V.velocityX,Me=V.velocityY,Ye=V.direction;R.velocity=Y,R.velocityX=oe,R.velocityY=Me,R.direction=Ye}function Ae(I){for(var R=[],V=0;V<I.pointers.length;)R[V]={clientX:s(I.pointers[V].clientX),clientY:s(I.pointers[V].clientY)},V++;return{timeStamp:l(),pointers:R,center:me(R),deltaX:I.deltaX,deltaY:I.deltaY}}function me(I){var R=I.length;if(R===1)return{x:s(I[0].clientX),y:s(I[0].clientY)};for(var V=0,z=0,Y=0;Y<R;)V+=I[Y].clientX,z+=I[Y].clientY,Y++;return{x:s(V/R),y:s(z/R)}}function Te(I,R,V){return{x:R/I||0,y:V/I||0}}function Ue(I,R){return I===R?ie:u(I)>=u(R)?I<0?pe:ne:R<0?de:ce}function Ee(I,R,V){V||(V=j);var z=R[V[0]]-I[V[0]],Y=R[V[1]]-I[V[1]];return Math.sqrt(z*z+Y*Y)}function Qe(I,R,V){V||(V=j);var z=R[V[0]]-I[V[0]],Y=R[V[1]]-I[V[1]];return Math.atan2(Y,z)*180/Math.PI}function Be(I,R){return Qe(R[1],R[0],Le)+Qe(I[1],I[0],Le)}function Ge(I,R){return Ee(R[0],R[1],Le)/Ee(I[0],I[1],Le)}var it={mousedown:J,mousemove:ve,mouseup:re},tt="mousedown",Nt="mousemove mouseup";function Wt(){this.evEl=tt,this.evWin=Nt,this.pressed=!1,Ce.apply(this,arguments)}h(Wt,Ce,{handler:function(R){var V=it[R.type];V&J&&(R.button===0||R.button===2)&&(this.pressed=!0),V&ve&&R.which!==1&&(V=re),this.pressed&&(V&re&&(this.pressed=!1),this.callback(this.manager,V,{pointers:[R],changedPointers:[R],pointerType:Z,srcEvent:R}))}});var Ze={pointerdown:J,pointermove:ve,pointerup:re,pointercancel:se,pointerout:se},ir={2:G,3:X,4:Z,5:q},Qt="pointerdown",St="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(Qt="MSPointerDown",St="MSPointerMove MSPointerUp MSPointerCancel");function It(){this.evEl=Qt,this.evWin=St,Ce.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}h(It,Ce,{handler:function(R){var V=this.store,z=!1,Y=!1,oe=R.type.toLowerCase().replace("ms",""),Me=Ze[oe],Ye=ir[R.pointerType]||R.pointerType,gt=Ye==G,He=P(V,R.pointerId,"pointerId");Me&J&&(R.button===0||R.button===2||gt)?He<0&&(V.push(R),He=V.length-1):Me&(re|se)?z=!0:!gt&&R.buttons===0&&(z=!0,Y=!0,Me=Ze.pointerup),!(He<0)&&(Y||(V[He]=R),this.callback(this.manager,Me,{pointers:V,changedPointers:[R],pointerType:Ye,srcEvent:V[He]}),z&&V.splice(He,1))}});var Dt={touchstart:J,touchmove:ve,touchend:re,touchcancel:se},Xt="touchstart",vt="touchstart touchmove touchend touchcancel";function Pe(){this.evTarget=Xt,this.evWin=vt,this.started=!1,Ce.apply(this,arguments)}h(Pe,Ce,{handler:function(R){var V=Dt[R.type];if(V===J&&(this.started=!0),!!this.started){var z=ar.call(this,R,V);V&(re|se)&&z[0].length-z[1].length===0&&(this.started=!1),this.callback(this.manager,V,{pointers:z[0],changedPointers:z[1],pointerType:G,srcEvent:R})}}});function ar(I,R){var V=T(I.touches),z=T(I.changedTouches);return R&(re|se)&&(V=B(V.concat(z),"identifier",!0)),[V,z]}var _t={touchstart:J,touchmove:ve,touchend:re,touchcancel:se},dn="touchstart touchmove touchend touchcancel";function or(){this.evTarget=dn,this.targetIds={},Ce.apply(this,arguments)}h(or,Ce,{handler:function(R){var V=_t[R.type],z=fn.call(this,R,V);z&&this.callback(this.manager,V,{pointers:z[0],changedPointers:z[1],pointerType:G,srcEvent:R})}});function fn(I,R){var V=T(I.touches),z=this.targetIds;if(R&(J|ve)&&V.length===1)return z[V[0].identifier]=!0,[V,V];var Y,oe,Me=T(I.changedTouches),Ye=[],gt=this.target;if(oe=V.filter(function(He){return x(He.target,gt)}),R===J)for(Y=0;Y<oe.length;)z[oe[Y].identifier]=!0,Y++;for(Y=0;Y<Me.length;)z[Me[Y].identifier]&&Ye.push(Me[Y]),R&(re|se)&&delete z[Me[Y].identifier],Y++;if(Ye.length)return[B(oe.concat(Ye),"identifier",!0),Ye]}var Lr=2500,Zt=25;function Xe(){Ce.apply(this,arguments);var I=g(this.handler,this);this.touch=new or(this.manager,I),this.mouse=new Wt(this.manager,I),this.primaryTouch=null,this.lastTouches=[]}h(Xe,Ce,{handler:function(R,V,z){var Y=z.pointerType==G,oe=z.pointerType==Z;if(!(oe&&z.sourceCapabilities&&z.sourceCapabilities.firesTouchEvents)){if(Y)Je.call(this,V,z);else if(oe&&sr.call(this,z))return;this.callback(R,V,z)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Je(I,R){I&J?(this.primaryTouch=R.changedPointers[0].identifier,Tt.call(this,R)):I&(re|se)&&Tt.call(this,R)}function Tt(I){var R=I.changedPointers[0];if(R.identifier===this.primaryTouch){var V={x:R.clientX,y:R.clientY};this.lastTouches.push(V);var z=this.lastTouches,Y=function(){var oe=z.indexOf(V);oe>-1&&z.splice(oe,1)};setTimeout(Y,Lr)}}function sr(I){for(var R=I.srcEvent.clientX,V=I.srcEvent.clientY,z=0;z<this.lastTouches.length;z++){var Y=this.lastTouches[z],oe=Math.abs(R-Y.x),Me=Math.abs(V-Y.y);if(oe<=Zt&&Me<=Zt)return!0}return!1}var hn=a?F(a.style,"touchAction"):r,Kr=hn!==r,pn="compute",zn="auto",Or="manipulation",at="none",rt="pan-x",ot="pan-y",At=Vr();function mt(I,R){this.manager=I,this.set(R)}mt.prototype={set:function(I){I==pn&&(I=this.compute()),Kr&&this.manager.element.style&&At[I]&&(this.manager.element.style[hn]=I),this.actions=I.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var I=[];return A(this.manager.recognizers,function(R){b(R.options.enable,[R])&&(I=I.concat(R.getTouchAction()))}),Gn(I.join(" "))},preventDefaults:function(I){var R=I.srcEvent,V=I.offsetDirection;if(this.manager.session.prevented){R.preventDefault();return}var z=this.actions,Y=M(z,at)&&!At[at],oe=M(z,ot)&&!At[ot],Me=M(z,rt)&&!At[rt];if(Y){var Ye=I.pointers.length===1,gt=I.distance<2,He=I.deltaTime<250;if(Ye&&gt&&He)return}if(!(Me&&oe)&&(Y||oe&&V&fe||Me&&V&$))return this.preventSrc(R)},preventSrc:function(I){this.manager.session.prevented=!0,I.preventDefault()}};function Gn(I){if(M(I,at))return at;var R=M(I,rt),V=M(I,ot);return R&&V?at:R||V?R?rt:ot:M(I,Or)?Or:zn}function Vr(){if(!Kr)return!1;var I={},R=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(V){I[V]=R?n.CSS.supports("touch-action",V):!0}),I}var Nr=1,Pt=2,qr=4,yr=8,ur=yr,vn=16,Yt=32;function lr(I){this.options=y({},this.defaults,I||{}),this.id=O(),this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=Nr,this.simultaneous={},this.requireFail=[]}lr.prototype={defaults:{},set:function(I){return y(this.options,I),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(I){if(f(I,"recognizeWith",this))return this;var R=this.simultaneous;return I=Hn(I,this),R[I.id]||(R[I.id]=I,I.recognizeWith(this)),this},dropRecognizeWith:function(I){return f(I,"dropRecognizeWith",this)?this:(I=Hn(I,this),delete this.simultaneous[I.id],this)},requireFailure:function(I){if(f(I,"requireFailure",this))return this;var R=this.requireFail;return I=Hn(I,this),P(R,I)===-1&&(R.push(I),I.requireFailure(this)),this},dropRequireFailure:function(I){if(f(I,"dropRequireFailure",this))return this;I=Hn(I,this);var R=P(this.requireFail,I);return R>-1&&this.requireFail.splice(R,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(I){return!!this.simultaneous[I.id]},emit:function(I){var R=this,V=this.state;function z(Y){R.manager.emit(Y,I)}V<yr&&z(R.options.event+ro(V)),z(R.options.event),I.additionalEvent&&z(I.additionalEvent),V>=yr&&z(R.options.event+ro(V))},tryEmit:function(I){if(this.canEmit())return this.emit(I);this.state=Yt},canEmit:function(){for(var I=0;I<this.requireFail.length;){if(!(this.requireFail[I].state&(Yt|Nr)))return!1;I++}return!0},recognize:function(I){var R=y({},I);if(!b(this.options.enable,[this,R])){this.reset(),this.state=Yt;return}this.state&(ur|vn|Yt)&&(this.state=Nr),this.state=this.process(R),this.state&(Pt|qr|yr|vn)&&this.tryEmit(R)},process:function(I){},getTouchAction:function(){},reset:function(){}};function ro(I){return I&vn?"cancel":I&yr?"end":I&qr?"move":I&Pt?"start":""}function no(I){return I==ce?"down":I==de?"up":I==pe?"left":I==ne?"right":""}function Hn(I,R){var V=R.manager;return V?V.get(I):I}function Ut(){lr.apply(this,arguments)}h(Ut,lr,{defaults:{pointers:1},attrTest:function(I){var R=this.options.pointers;return R===0||I.pointers.length===R},process:function(I){var R=this.state,V=I.eventType,z=R&(Pt|qr),Y=this.attrTest(I);return z&&(V&se||!Y)?R|vn:z||Y?V&re?R|yr:R&Pt?R|qr:Pt:Yt}});function Kn(){Ut.apply(this,arguments),this.pX=null,this.pY=null}h(Kn,Ut,{defaults:{event:"pan",threshold:10,pointers:1,direction:te},getTouchAction:function(){var I=this.options.direction,R=[];return I&fe&&R.push(ot),I&$&&R.push(rt),R},directionTest:function(I){var R=this.options,V=!0,z=I.distance,Y=I.direction,oe=I.deltaX,Me=I.deltaY;return Y&R.direction||(R.direction&fe?(Y=oe===0?ie:oe<0?pe:ne,V=oe!=this.pX,z=Math.abs(I.deltaX)):(Y=Me===0?ie:Me<0?de:ce,V=Me!=this.pY,z=Math.abs(I.deltaY))),I.direction=Y,V&&z>R.threshold&&Y&R.direction},attrTest:function(I){return Ut.prototype.attrTest.call(this,I)&&(this.state&Pt||!(this.state&Pt)&&this.directionTest(I))},emit:function(I){this.pX=I.deltaX,this.pY=I.deltaY;var R=no(I.direction);R&&(I.additionalEvent=this.options.event+R),this._super.emit.call(this,I)}});function Ti(){Ut.apply(this,arguments)}h(Ti,Ut,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(I){return this._super.attrTest.call(this,I)&&(Math.abs(I.scale-1)>this.options.threshold||this.state&Pt)},emit:function(I){if(I.scale!==1){var R=I.scale<1?"in":"out";I.additionalEvent=this.options.event+R}this._super.emit.call(this,I)}});function Pi(){lr.apply(this,arguments),this._timer=null,this._input=null}h(Pi,lr,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[zn]},process:function(I){var R=this.options,V=I.pointers.length===R.pointers,z=I.distance<R.threshold,Y=I.deltaTime>R.time;if(this._input=I,!z||!V||I.eventType&(re|se)&&!Y)this.reset();else if(I.eventType&J)this.reset(),this._timer=c(function(){this.state=ur,this.tryEmit()},R.time,this);else if(I.eventType&re)return ur;return Yt},reset:function(){clearTimeout(this._timer)},emit:function(I){this.state===ur&&(I&&I.eventType&re?this.manager.emit(this.options.event+"up",I):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Bi(){Ut.apply(this,arguments)}h(Bi,Ut,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(I){return this._super.attrTest.call(this,I)&&(Math.abs(I.rotation)>this.options.threshold||this.state&Pt)}});function Ri(){Ut.apply(this,arguments)}h(Ri,Ut,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:fe|$,pointers:1},getTouchAction:function(){return Kn.prototype.getTouchAction.call(this)},attrTest:function(I){var R=this.options.direction,V;return R&(fe|$)?V=I.overallVelocity:R&fe?V=I.overallVelocityX:R&$&&(V=I.overallVelocityY),this._super.attrTest.call(this,I)&&R&I.offsetDirection&&I.distance>this.options.threshold&&I.maxPointers==this.options.pointers&&u(V)>this.options.velocity&&I.eventType&re},emit:function(I){var R=no(I.offsetDirection);R&&this.manager.emit(this.options.event+R,I),this.manager.emit(this.options.event,I)}});function qn(){lr.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}h(qn,lr,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Or]},process:function(I){var R=this.options,V=I.pointers.length===R.pointers,z=I.distance<R.threshold,Y=I.deltaTime<R.time;if(this.reset(),I.eventType&J&&this.count===0)return this.failTimeout();if(z&&Y&&V){if(I.eventType!=re)return this.failTimeout();var oe=this.pTime?I.timeStamp-this.pTime<R.interval:!0,Me=!this.pCenter||Ee(this.pCenter,I.center)<R.posThreshold;this.pTime=I.timeStamp,this.pCenter=I.center,!Me||!oe?this.count=1:this.count+=1,this._input=I;var Ye=this.count%R.taps;if(Ye===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=ur,this.tryEmit()},R.interval,this),Pt):ur}return Yt},failTimeout:function(){return this._timer=c(function(){this.state=Yt},this.options.interval,this),Yt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ur&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function jr(I,R){return R=R||{},R.recognizers=w(R.recognizers,jr.defaults.preset),new Fi(I,R)}jr.VERSION="2.0.7",jr.defaults={domEvents:!1,touchAction:pn,enable:!0,inputTarget:null,inputClass:null,preset:[[Bi,{enable:!1}],[Ti,{enable:!1},["rotate"]],[Ri,{direction:fe}],[Kn,{direction:fe},["swipe"]],[qn],[qn,{event:"doubletap",taps:2},["tap"]],[Pi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var fl=1,io=2;function Fi(I,R){this.options=y({},jr.defaults,R||{}),this.options.inputTarget=this.options.inputTarget||I,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=I,this.input=ge(this),this.touchAction=new mt(this,this.options.touchAction),ao(this,!0),A(this.options.recognizers,function(V){var z=this.add(new V[0](V[1]));V[2]&&z.recognizeWith(V[2]),V[3]&&z.requireFailure(V[3])},this)}Fi.prototype={set:function(I){return y(this.options,I),I.touchAction&&this.touchAction.update(),I.inputTarget&&(this.input.destroy(),this.input.target=I.inputTarget,this.input.init()),this},stop:function(I){this.session.stopped=I?io:fl},recognize:function(I){var R=this.session;if(!R.stopped){this.touchAction.preventDefaults(I);var V,z=this.recognizers,Y=R.curRecognizer;(!Y||Y&&Y.state&ur)&&(Y=R.curRecognizer=null);for(var oe=0;oe<z.length;)V=z[oe],R.stopped!==io&&(!Y||V==Y||V.canRecognizeWith(Y))?V.recognize(I):V.reset(),!Y&&V.state&(Pt|qr|yr)&&(Y=R.curRecognizer=V),oe++}},get:function(I){if(I instanceof lr)return I;for(var R=this.recognizers,V=0;V<R.length;V++)if(R[V].options.event==I)return R[V];return null},add:function(I){if(f(I,"add",this))return this;var R=this.get(I.options.event);return R&&this.remove(R),this.recognizers.push(I),I.manager=this,this.touchAction.update(),I},remove:function(I){if(f(I,"remove",this))return this;if(I=this.get(I),I){var R=this.recognizers,V=P(R,I);V!==-1&&(R.splice(V,1),this.touchAction.update())}return this},on:function(I,R){if(I!==r&&R!==r){var V=this.handlers;return A(S(I),function(z){V[z]=V[z]||[],V[z].push(R)}),this}},off:function(I,R){if(I!==r){var V=this.handlers;return A(S(I),function(z){R?V[z]&&V[z].splice(P(V[z],R),1):delete V[z]}),this}},emit:function(I,R){this.options.domEvents&&hl(I,R);var V=this.handlers[I]&&this.handlers[I].slice();if(!(!V||!V.length)){R.type=I,R.preventDefault=function(){R.srcEvent.preventDefault()};for(var z=0;z<V.length;)V[z](R),z++}},destroy:function(){this.element&&ao(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function ao(I,R){var V=I.element;if(V.style){var z;A(I.options.cssProps,function(Y,oe){z=F(V.style,oe),R?(I.oldCssProps[z]=V.style[z],V.style[z]=Y):V.style[z]=I.oldCssProps[z]||""}),R||(I.oldCssProps={})}}function hl(I,R){var V=t.createEvent("Event");V.initEvent(I,!0,!0),V.gesture=R,R.target.dispatchEvent(V)}return y(jr,{INPUT_START:J,INPUT_MOVE:ve,INPUT_END:re,INPUT_CANCEL:se,STATE_POSSIBLE:Nr,STATE_BEGAN:Pt,STATE_CHANGED:qr,STATE_ENDED:yr,STATE_RECOGNIZED:ur,STATE_CANCELLED:vn,STATE_FAILED:Yt,DIRECTION_NONE:ie,DIRECTION_LEFT:pe,DIRECTION_RIGHT:ne,DIRECTION_UP:de,DIRECTION_DOWN:ce,DIRECTION_HORIZONTAL:fe,DIRECTION_VERTICAL:$,DIRECTION_ALL:te,Manager:Fi,Input:Ce,TouchAction:mt,TouchInput:or,MouseInput:Wt,PointerEventInput:It,TouchMouseInput:Xe,SingleTouchInput:Pe,Recognizer:lr,AttrRecognizer:Ut,Tap:qn,Pan:Kn,Swipe:Ri,Pinch:Ti,Rotate:Bi,Press:Pi,on:E,off:C,each:A,merge:m,extend:v,assign:y,inherit:h,bindFn:g,prefixed:F}),jr}(typeof window!="undefined"?window:{},typeof document!="undefined"?document:{});function ps(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 ja=function(n){le(t,n);function t(e){var r,i,a,o,s,u,l=n.call(this)||this,c=t.parseArgs(e);return l.mode="",l.pending=new Set,l.userAction=c.initial.userAction,l.destroyed=!1,l.ident=c.ident,l.scene=c.scene,l.xrCustomObjectsScene=c.xrCustomObjectsScene,l.helper=c.helper,l.boundingMesh=c.boundingMesh,l.camera=c.camera,l.renderer=c.renderer,l.scissor=c.scissor,l.element=c.element,l.models=c.models,l.enableWheel=c.enableWheel,l.enableIOSEDR=(r=c.enableIOSEDR)!==null&&r!==void 0?r:!1,l.enableEDL=(i=c.enableEDL)!==null&&i!==void 0?i:!0,l.enableHQ=(a=c.enableHQ)!==null&&a!==void 0?a:!0,l.works=c.works,l.imageOptions=c.imageOptions,l.videoTexture=c.videoTexture,l.extraElements=c.extraElements,l.initial=c.initial,l.currentPano=typeof l.initial.state.panoIndex=="number"?{workCode:(u=(o=l.initial.state.workCode)!==null&&o!==void 0?o:(s=c.works[0])===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",panoIndex:l.initial.state.panoIndex}:{workCode:l.initial.currentState.workCode,panoIndex:l.initial.currentState.panoIndex},l.needsRender=!0,l.cameraMotion=new xe({longitude:{value:l.camera.pose.longitude,circle:[0,Math.PI*2]},latitude:l.camera.pose.latitude,fov:l.camera.pose.fov}),l.inMomentumMovement=null,l.eventUnbinds=[c.element].concat(c.extraElements||[]).map(function(f){return l.bindEvents(f)}),l.pending.add("init-animation"),l.initAnimationReady=new Promise(function(f){lt.shared.add(function(){l.initAnimation().then(function(){l.pending.delete("init-animation"),f()})},!0)}),l}return t.parseArgs=function(e){return e instanceof t?e:k({},e)},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l,c,f=this.parseArgs(e),A=f.initial,p=A.state,y=A.currentState,v=typeof p.panoIndex=="number"?{workCode:(a=(r=p.workCode)!==null&&r!==void 0?r:(i=f.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:p.panoIndex}:{workCode:y.workCode,panoIndex:y.panoIndex};return k(k({},v),{mode:"",longitude:(o=p.longitude)!==null&&o!==void 0?o:y.longitude,latitude:(s=p.latitude)!==null&&s!==void 0?s:y.latitude,fov:(u=p.fov)!==null&&u!==void 0?u:y.fov,offset:(l=p.offset)!==null&&l!==void 0?l:y.offset,distance:(c=p.distance)!==null&&c!==void 0?c:y.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),Vt(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(D)})},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 l=u[s];o.push({key:l.key,progress:l.progress,value:{longitude:l.value.longitude,latitude:l.value.latitude,fov:l.value.fov}})}return a.cameraMotion.setKeyframes(o,r)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(be())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance})},t.prototype.initAnimation=function(){var e=this.initial;e.state,e.currentState,e.duration;var r=e.userAction,i=t.initAnimationEndState(this);return this.userAction=r,this.emit("initAnimation.start",_("initAnimation.start",{state:i,userAction:this.userAction})),this.emit("initAnimation.end",_("initAnimation.end",{state:i,userAction:this.userAction})),Promise.resolve()},t.prototype.setCamera=function(e){var r,i,a,o,s;e===void 0&&(e={});var u=(r=e.longitude)!==null&&r!==void 0?r:this.camera.pose.longitude,l=(i=e.latitude)!==null&&i!==void 0?i:this.camera.pose.latitude,c=(a=e.fov)!==null&&a!==void 0?a:this.camera.pose.fov,f=(o=e.distance)!==null&&o!==void 0?o:this.camera.pose.distance,A=(s=e.offset)!==null&&s!==void 0?s:this.camera.pose.offset,p=Kt(u,this.camera.pose.longitude,Math.PI*2)||Kt(l,this.camera.pose.latitude),y=Kt(c,this.camera.pose.fov),v=Kt(f,this.camera.pose.distance),m=xa(A,this.camera.pose.offset);(y||p||m||v)&&(this.camera.setFromPose({longitude:u,latitude:l,fov:c,distance:f,offset:A}),this.emit("camera.update",_("camera.update",{userAction:this.userAction,state:k(k({},this.currentPano),{mode:this.mode,longitude:u,latitude:l,fov:c,offset:A,distance:f})})),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",k(k({},this.inMomentumMovement.event),{isFirst:!1,isFinal:!0}));this.emit("gesture.momentum",e)}this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.pan",e)},t.prototype.onTapGesture=function(e){this.stopMomentumMovement(),this.emit("gesture.tap",e)},t.prototype.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 ps(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var r=this,i=function(M){var S=ps(M,r.element,r.scissor);return!(Math.abs(S.x)>1||Math.abs(S.y)>1)},a=new Cn.Manager(e),o=function(M){var S=M.session;return S.firstInput||null};a.add(new Cn.Pan({threshold:10,pointers:0})),a.add(new Cn.Tap({interval:410})),a.add(new Cn.Pinch({threshold:0,pointers:2})),a.on("panstart pan",function(M){var S=o(a);if(!(S&&!i(S.center))){var P=_("gesture.pan",{target:M.target,pointerType:M.pointerType,srcEvent:M.srcEvent,pointers:M.pointers.map(function(T){var B=r.relativeClientPosition(T),F=new d.Raycaster;return F.params.Points={threshold:.1},F.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:F}}),isFirst:M.isFirst,isFinal:M.isFinal,scale:M.scale,center:function(T){var B=r.relativeClientPosition(T),F=new d.Raycaster;return F.params.Points={threshold:.1},F.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:F}}(M.center),velocityX:M.velocityX,velocityY:M.velocityY,overallVelocityX:M.overallVelocityX,overallVelocityY:M.overallVelocityY,userAction:!0,state:k(k({mode:r.mode},r.currentPano),je(r.camera.pose))});r.onPanGesture(P),m()}}),a.on("tap",function(M){if(!(M.pointerType==="mouse"&&M.srcEvent.button!==0)){var S=o(a);if(!(S&&!i(S.center))){var P=_("gesture.tap",{target:M.target,pointerType:M.pointerType,srcEvent:M.srcEvent,pointers:M.pointers.map(function(T){var B=r.relativeClientPosition(T),F=new d.Raycaster;return F.params.Points={threshold:.1},F.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:F}}),isFirst:!0,isFinal:!0,scale:M.scale,center:function(T){var B=r.relativeClientPosition(T),F=new d.Raycaster;return F.params.Points={threshold:.1},F.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:F}}(M.center),velocityX:M.velocityX,velocityY:M.velocityY,overallVelocityX:M.overallVelocityX,overallVelocityY:M.overallVelocityY,userAction:!0,state:k(k({mode:r.mode},r.currentPano),je(r.camera.pose))});r.onTapGesture(P),m()}}}),a.on("pinchstart pinch pinchend",function(M){var S=o(a);if(!(S&&!i(S.center))){var P=_("gesture.pinch",{target:M.target,pointerType:M.pointerType,srcEvent:M.srcEvent,pointers:M.pointers.map(function(T){var B,F=r.relativeClientPosition(T),L=new d.Raycaster;return L.params.Points={threshold:.1},L.setFromCamera(F,r.camera),{x:T.x,y:T.y,delta:(B=T.delta)!==null&&B!==void 0?B:0,buttons:0,coords:F,raycaster:L}}),isFirst:M.type==="pinchstart",isFinal:M.type==="pinchend",scale:M.scale,center:function(T){var B=r.relativeClientPosition(T),F=new d.Raycaster;return F.params.Points={threshold:.1},F.setFromCamera(B,r.camera),{x:T.x,y:T.y,delta:0,buttons:0,coords:B,raycaster:F}}(M.center),velocityX:M.velocityX,velocityY:M.velocityY,overallVelocityX:M.overallVelocityX,overallVelocityY:M.overallVelocityY,userAction:!0,state:k(k({mode:r.mode},r.currentPano),je(r.camera.pose))});r.onPinchGesture(P),m()}});var s=null,u=null,l=function(M,S,P){var T={x:P.clientX,y:P.clientY},B=r.relativeClientPosition(T),F=new d.Raycaster;F.params.Points={threshold:.1},F.setFromCamera(B,r.camera);var L=k(k({},T),{coords:B,raycaster:F,buttons:P.buttons,delta:0}),O=M==="pinchend"?S:S-P.deltaY/280,Q=_("gesture.pinch",{target:P.target,pointerType:"mouse",srcEvent:P,pointers:[k({},L)],isFirst:M==="pinchstart",isFinal:M==="pinchend",scale:he(O,.1,10),center:k({},L),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),je(r.camera.pose))});return Q},c=function(M){var S,P={x:M.clientX,y:M.clientY};if(i(P)){if(M.preventDefault(),M.ctrlKey){var T=(S=s==null?void 0:s.prevEvent.scale)!==null&&S!==void 0?S:1,B=l(s?"pinch":"pinchstart",T,M);s===null?s={firstEvent:B,prevEvent:B}:s.prevEvent=B,r.onPinchGesture(B),u!==null&&window.clearTimeout(u),u=window.setTimeout(function(){var K;u=null;var U=(K=s==null?void 0:s.prevEvent.scale)!==null&&K!==void 0?K:1,G=l("pinchend",U,M);s=null,r.onPinchGesture(G)},200)}else{var F=(Math.abs(M.deltaY)>Math.abs(M.deltaX)?M.deltaY:M.deltaX)/-60,L=r.mouseWheelState!==void 0,O={x:M.clientX,y:M.clientY},Q=r.relativeClientPosition(O),N=new d.Raycaster;N.params.Points={threshold:.1},N.setFromCamera(Q,r.camera);var H=k(k({},O),{coords:Q,raycaster:N,buttons:M.buttons,delta:F}),B=_("gesture.mousewheel",{target:M.target,pointerType:"mouse",srcEvent:M,pointers:[k({},H)],isFirst:L,isFinal:!1,scale:0,center:k({},H),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),je(r.camera.pose))});r.onMouseWheel(B),r.mouseWheelState&&clearTimeout(r.mouseWheelState.timer),r.mouseWheelState={timer:setTimeout(function(){delete r.mouseWheelState;var U=_("gesture.mousewheel",{target:M.target,pointerType:"mouse",srcEvent:M,pointers:[k(k({},H),{delta:0})],isFirst:!1,isFinal:!0,scale:0,center:k(k({},H),{delta:0}),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),je(r.camera.pose))});r.onMouseWheel(U)},100)}}m()}},f=function(M){if(!xn()){if(!i({x:M.clientX,y:M.clientY})){A();return}var S=!1;r.mouseMoveState||(S=!0);var P={x:M.clientX,y:M.clientY},T=r.relativeClientPosition(P),B=new d.Raycaster;B.params.Points={threshold:.1},B.setFromCamera(T,r.camera);var F=k(k({},P),{coords:T,raycaster:B,buttons:M.buttons,delta:0}),L=_("gesture.mousemove",{target:M.target,pointerType:"mouse",srcEvent:M,pointers:[k({},F)],isFirst:S,isFinal:!1,scale:0,center:k({},F),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),je(r.camera.pose))});r.mouseMoveState||(r.mouseMoveState={timeStamp:be(),event:L}),r.onMouseMove(L),r.pressState&&Math.abs(M.clientX-r.pressState.event.center.y)>10&&Math.abs(M.clientY-r.pressState.event.center.y)>10&&m()}},A=function(){if(r.mouseMoveState){var M=_(r.mouseMoveState.event.type,k(k({},r.mouseMoveState.event),{isFinal:!0}));r.onMouseMove(M)}m()},p=function(M){if(!i(M.center)){m();return}var S=!1;r.pressState||(S=!0,r.pressState={event:M,timeStamp:be(),stop:D});var P=be()-r.pressState.timeStamp,T=_(r.pressState.event.type,k(k({},r.pressState.event),{isFirst:S,isFinal:!1,center:k(k({},r.pressState.event.center),{delta:P}),pointers:r.pressState.event.pointers.map(function(B){return k(k({},B),{delta:P})})}));r.onPressGesture(T),r.pressState&&(r.pressState.stop=lt.shared.add(function(B){p(M)},!0,1))},y=function(M){if(m(),!(M.touches.length>1||M.changedTouches.length<=0)){var S={x:M.changedTouches[0].clientX,y:M.changedTouches[0].clientY},P=r.relativeClientPosition(S),T=new d.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(P,r.camera);var B=k(k({},S),{coords:P,raycaster:T,buttons:0,delta:0}),F=_("gesture.press",{target:M.target,pointerType:"touch",srcEvent:M,pointers:[k({},B)],isFirst:!1,isFinal:!1,scale:0,center:B,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),je(r.camera.pose))});p(F)}},v=function(M){m();var S={x:M.clientX,y:M.clientY},P=r.relativeClientPosition(S),T=new d.Raycaster;T.params.Points={threshold:.1},T.setFromCamera(P,r.camera);var B=k(k({},S),{coords:P,raycaster:T,buttons:M.buttons,delta:0}),F=_("gesture.press",{target:M.target,pointerType:"mouse",srcEvent:M,pointers:[k({},B)],isFirst:!1,isFinal:!1,scale:0,center:B,velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),je(r.camera.pose))});p(F)},m=function(){var M;if(r.pressState){var S=be()-r.pressState.timeStamp,P=_(r.pressState.event.type,k(k({},r.pressState.event),{center:k(k({},r.pressState.event.center),{delta:S}),isFirst:!1,isFinal:!0,pointers:r.pressState.event.pointers.map(function(T){return k(k({},T),{delta:S})})}));r.onPressGesture(P),(M=r.pressState)===null||M===void 0||M.stop(),delete r.pressState}},h=null,g=function(M){var S,P=!1,T=!1;switch(M.type){case"gesturestart":P=!0;break;case"gestureend":T=!0;break}var B={x:M.clientX,y:M.clientY},F=r.relativeClientPosition(B),L=new d.Raycaster;L.params.Points={threshold:.1},L.setFromCamera(F,r.camera);var O=k(k({},B),{coords:F,raycaster:L,buttons:0,delta:0}),Q=_("gesture.pinch",{target:M.target,pointerType:"mouse",srcEvent:M,pointers:[k({},O)],isFirst:P,isFinal:T,scale:(S=M.scale)!==null&&S!==void 0?S:1,center:k({},O),velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0,userAction:!0,state:k(k({mode:r.mode},r.currentPano),je(r.camera.pose))});return Q},b=function(M){if(M.preventDefault(),!xn()){var S=g(M);h={firstEvent:S};var P=h.firstEvent;P&&!i(P.center)||r.onPinchGesture(S)}},w=function(M){if(M.preventDefault(),!xn()&&h){var S=g(M),P=h.firstEvent;P&&!i(P.center)||r.onPinchGesture(S)}},E=function(M){if(M.preventDefault(),!xn()&&h){var S=g(M),P=h.firstEvent;h=null,!(P&&!i(P.center))&&r.onPinchGesture(S)}},C=function(M){if(M&&typeof M.preventDefault=="function"&&M.currentTarget===e&&M.preventDefault(),typeof getSelection=="function"){var S=getSelection();S&&S.focusNode&&(S.removeAllRanges&&S.removeAllRanges(),S.empty&&S.empty())}};this.enableWheel&&e.addEventListener("wheel",c,{passive:!1}),e.addEventListener("mousemove",f,!1),e.addEventListener("mouseout",A,!1),e.addEventListener("touchstart",y,{passive:!0}),e.addEventListener("touchend",m,!1),e.addEventListener("touchcancel",m,!1),e.addEventListener("mousedown",v,!1),e.addEventListener("mouseup",m,!1),e.addEventListener("gesturestart",b,{passive:!1}),e.addEventListener("gesturechange",w,{passive:!1}),e.addEventListener("gestureend",E,{passive:!1}),e.addEventListener("touchstart",C,{passive:!1}),e.addEventListener("contextmenu",C,!1);var x=function(){a.destroy(),e.removeEventListener("wheel",c,!1),e.removeEventListener("mousemove",f,!1),e.removeEventListener("mouseout",A,!1),e.removeEventListener("touchstart",y,!1),e.removeEventListener("touchend",m,!1),e.removeEventListener("touchcancel",m,!1),e.removeEventListener("mousedown",v,!1),e.removeEventListener("mouseup",m,!1),e.removeEventListener("gesturestart",b,!1),e.removeEventListener("gesturechange",w,!1),e.removeEventListener("gestureend",E,!1),e.removeEventListener("touchstart",C,!1),e.removeEventListener("contextmenu",C,!1)};return Object.assign(x,{element:e})},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=D);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=k({key:"pano.".concat(Oe(e),".").concat(s)},gr(i.imageOptions,["size","format","quality","mappings"])),l=a.images[s],c=li(l,i.imageOptions.transform,u);return ut(a.work).preload(c)})).then(function(){return r(e),e})},t}(wi),Ma=function(n){le(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 xe({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 xe({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new xe({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,l,c;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return k(k({},f),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,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:(l=e.minLatitude)!==null&&l!==void 0?l:-Math.PI/2,intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new xi}})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l=this.parseArgs(e),c=e.initial,f=c.state,A=c.currentState,p=typeof f.panoIndex=="number"?{workCode:(a=(r=f.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:f.panoIndex}:{workCode:A.workCode,panoIndex:A.panoIndex},y=k(k({},p),{mode:"Floorplan",longitude:(o=f.longitude)!==null&&o!==void 0?o:ba(A.mode)?A.longitude:l.defaultLongitude,latitude:he((s=f.latitude)!==null&&s!==void 0?s:A.mode==="Floorplan"?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),fov:(u=f.fov)!==null&&u!==void 0?u:l.defaultFov,offset:e.models.bounding.getCenter(new d.Vector3),distance:t.distanceFromModel(l.models,l.defaultFov,l.camera.aspect)});return y},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){var o;return this.works=e,this.updateCamera(r,(o=i.duration)!==null&&o!==void 0?o:0,a),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.bounding.getCenter(new d.Vector3),i=t.distanceFromModel(e,this.defaultFov,this.camera.aspect);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:i},0).catch(D)},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(D),a.cameraMotion.set(s,r).catch(D)})},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,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(D),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(he(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),Vt(i)||this.models.setMaterial(i),Vt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(be())[1],r=this.locationMotion.getKeyFrameSegment(be())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new d.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),u=gr(s,["longitude","latitude","fov"]),l={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(c,a/3).catch(D),e.perspToOrthoMotion.set(f,a).catch(D),e.cameraMotion.set(u,a).catch(D),e.locationMotion.set(l,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var p=k(k(k({},e.currentPano),{mode:e.mode}),je(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:p,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(D)},t.prototype.getForwardObserverOrNot=function(e){var r=this.models.intersectRaycaster(e)[0];if(!r)return null;var i=this.works.resolvedObservers,a=nr(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=k({},i),u={longitude:0,latitude:0},l=0;l<a;l++)s.longitude*=.996,s.latitude*=.996*.998,u.longitude+=s.longitude,u.latitude+=s.latitude;var c=kr(this.cameraMotion.value.longitude+u.longitude),f=he(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),A=k(k({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),p=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),y=_("gesture.momentum",k(k({},e),{isFirst:r,isFinal:p,state:A}));if(this.inMomentumMovement.event=y,this.emit("gesture.momentum",y),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(D),p?this.inMomentumMovement=null:lt.shared.add(function(v,m){o.requestMomentumMovement(e,!1,s,m|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.relativeClientPosition(e.center),s=this.camera.pose.latitude<Math.PI/6||o.y<0?1:-1;a.x*=s;var u=this.coordinatesForOffset(a),l=kr(this.cameraMotion.value.longitude+u.longitude),c=he(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&&(c=this.cameraMotion.value.latitude);var f=k(k({},this.currentPano),{mode:this.mode,longitude:l,latitude:c,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.state=f,this.emit("gesture.pan",e),!e.defaultPrevented&&(this.cameraMotion.set({longitude:f.longitude,latitude:f.latitude},0).catch(D),e.isFinal)){var A=e.velocityX*s,p=e.velocityY;this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:A,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;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&(delete this.panState,delete this.pinchState),typeof i!="undefined"){var a=he(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(D),this.onPanGesture(e))}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState){if(this.emit("gesture.mousemove",e),e.defaultPrevented){this.hideIntersectMesh();return}var a=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=_("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var 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),l=u.clone().multiplyScalar(.05),c=o.point.clone().add(l);this.intersectMesh.position.copy(c);var f=c.clone().add(l);if(this.intersectMesh.lookAt(f),Math.abs(u.y)>.99){var A=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(A.z,A.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=he(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(D)},t.prototype.onTapGesture=function(e){var r=this;this.userAction=!0,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=k(k({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new d.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=wt();this.preloadPano(a.pano).then(function(l){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}(ja),Ff=function(n){le(t,n);function t(e){var r=this,i=t.parseArgs(e);return r=n.call(this,i)||this,r.mode="Topview",r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=k(k({},e),{defaultLongitude:0,defaultLatitude:Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{longitude:0,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:Ma.distanceFromModel(this.models,this.defaultFov,this.camera.aspect)},0).catch(D)},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(D),a.cameraMotion.set(s,r).catch(D)})},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,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.y,z:c.value.offset.z}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(D),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},l={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:1};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.modelAlphaMotion.set(c,a/3).catch(D),e.perspToOrthoMotion.set(f,a).catch(D),e.cameraMotion.set(u,a).catch(D),e.locationMotion.set(l,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var p=k(k(k({},e.currentPano),{mode:e.mode}),je(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:p,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.requestMomentumMovement=function(){this.inMomentumMovement=null},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=this.locationMotion.value.distance;s*=Math.tan(this.cameraMotion.value.fov/2*Math.PI/180);var u=this.renderer.getSize(new d.Vector2),l=2*a.x*s/u.y,c=2*a.y*s/u.y,f=new d.Vector3;f.setFromMatrixColumn(this.camera.matrix,0),f.multiplyScalar(-l),o.add(f),f.setFromMatrixColumn(this.camera.matrix,0),f.crossVectors(this.camera.up,f),f.multiplyScalar(c),o.add(f),o.clamp(this.models.bounding.min,this.models.bounding.max);var A=k(k({},this.currentPano),{mode:this.mode,longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:o,distance:this.locationMotion.value.distance});e.state=A,this.emit("gesture.pan",e),!e.defaultPrevented&&this.locationMotion.set({x:o.x,y:o.y,z:o.z},0).catch(D)}},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!="undefined"){var a=he(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(D),e.type="gesture.pan",this.onPanGesture(e))}},t.prototype.onMouseWheel=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=he(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(D)},t}(Ma),Wu=function(n){le(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,l,c;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return k(k({},f),{defaultLatitude:(r=e.defaultLatitude)!==null&&r!==void 0?r:0,defaultFov:(i=e.defaultFov)!==null&&i!==void 0?i:90,maxFov:(a=e.maxFov)!==null&&a!==void 0?a:120,minFov:(o=e.minFov)!==null&&o!==void 0?o: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:(l=e.moveSpeed)!==null&&l!==void 0?l:3.4,intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new xi}})},t.initAnimationEndState=function(e){var r,i,a,o,s,u,l=this.parseArgs(e),c=l.works,f=e.initial,A=f.state,p=f.currentState,y=typeof A.panoIndex=="number"?{workCode:(a=(r=A.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:A.panoIndex}:{workCode:p.workCode,panoIndex:p.panoIndex},v=c.getResolvedObserver(y),m=(o=A.longitude)!==null&&o!==void 0?o:p.longitude,h=he((s=A.latitude)!==null&&s!==void 0?s:Ln(p.mode)?p.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),g=he((u=A.fov)!==null&&u!==void 0?u:Ln(p.mode)?p.fov:l.defaultFov,l.minFov,l.maxFov),b=v?v.position.clone():new d.Vector3;return{workCode:y.workCode,panoIndex:y.panoIndex,mode:"PanoramaLike",longitude:m,latitude:h,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 he(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(D)},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=k({},i),u={longitude:0,latitude:0},l=0;l<a;l++)s.longitude*=.996,s.latitude*=.996*.99,u.longitude+=s.longitude,u.latitude+=s.latitude;var c=kr(this.cameraMotion.value.longitude+u.longitude),f=he(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),A=k(k({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}),p=!(s.longitude>1e-4||s.longitude<-1e-4||s.latitude>1e-4||s.latitude<-1e-4),y=_("gesture.momentum",k(k({},e),{isFirst:r,isFinal:p,state:A}));if(this.inMomentumMovement.event=y,this.emit("gesture.momentum",y),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(D),p?this.inMomentumMovement=null:lt.shared.add(function(v,m){o.requestMomentumMovement(e,!1,s,m|0)},!0,1))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},!(typeof r=="undefined"||r.pointerLength!==i)){var a={x:e.center.x-r.x,y:e.center.y-r.y},o=this.coordinatesForOffset(a),s=kr(this.cameraMotion.value.longitude+o.longitude),u=he(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 l=k(k({},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=l,this.emit("gesture.pan",e),!e.defaultPrevented){var c={longitude:l.longitude,latitude:l.latitude,fov:l.fov};if(this.cameraMotion.set(c,0).catch(D),e.isFinal){var f=e.velocityX,A=e.velocityY*.6;Math.abs(A)>.5&&Math.abs(f)<.5&&(f=0),this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,this.coordinatesForOffset({x:f,y:A}),0)}}}},t.prototype.onPinchGesture=function(e){var r;this.userAction=e.userAction,this.stopMomentumMovement();var i=(r=this.pinchState)===null||r===void 0?void 0:r.fov,a=e.scale;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov};return}if(e.isFinal&&delete this.pinchState,typeof i!="undefined"){var o=he(i/a,this.minFov,this.maxFov);e.state.fov=o,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.cameraMotion.set({fov:o},0).catch(D),e.type="gesture.pan",this.onPanGesture(e))}},t.prototype.onMouseWheel=function(e){this.userAction=e.userAction,this.stopMomentumMovement();var r=he(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(D)},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?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),l=u.clone().multiplyScalar(.05),c=o.point.clone().add(l);this.intersectMesh.position.copy(c);var f=c.clone().add(l);if(this.intersectMesh.lookAt(f),Math.abs(u.y)>.99){var A=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(A.z,A.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t}(ja),kf="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZ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hkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",_i;function Xu(){return _i||(_i=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 _u=new d.OrthographicCamera(-1,1,1,-1,0,1),Wa=new d.BufferGeometry;Wa.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Wa.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var zr=new d.Mesh(Wa),Xa=new d.Scene;Xa.add(zr);var Lf=`
1311
1311
  varying vec2 vUv;
1312
1312
  void main() {
1313
1313
  vUv = uv;
1314
1314
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
1315
1315
  }
1316
- `,Si=function(){function n(t,e){var r;this.renderer=t,this.material=new d.ShaderMaterial({vertexShader:(r=e.vertex)!==null&&r!==void 0?r:Vf,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=Kr.material;this.material.uniforms.inputBuffer.value=t.texture,Kr.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(Za,Zu),this.renderer.setRenderTarget(r),Kr.material=i},n.prototype.dispose=function(){this.material.dispose()},n}(),Nf=`
1316
+ `,Ci=function(){function n(t,e){var r;this.renderer=t,this.material=new d.ShaderMaterial({vertexShader:(r=e.vertex)!==null&&r!==void 0?r:Lf,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=zr.material;this.material.uniforms.inputBuffer.value=t.texture,zr.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(Xa,_u),this.renderer.setRenderTarget(r),zr.material=i},n.prototype.dispose=function(){this.material.dispose()},n}(),Of=`
1317
1317
  void main() {
1318
1318
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
1319
1319
  }
1320
- `,Qf=`
1320
+ `,Vf=`
1321
1321
  uniform vec3 inputValue;
1322
1322
  void main() {
1323
1323
  gl_FragColor = vec4(inputValue, 1.0);
1324
1324
  }
1325
- `,Df=function(){function n(t){this.renderer=t,this.material=new d.ShaderMaterial({vertexShader:Nf,fragmentShader:Qf,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=Kr.material;this.material.uniforms.inputValue.value.copy(t),Kr.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(Za,Zu),this.renderer.setRenderTarget(r),Kr.material=i},n.prototype.dispose=function(){this.material.dispose()},n}(),Uf=`
1325
+ `,Nf=function(){function n(t){this.renderer=t,this.material=new d.ShaderMaterial({vertexShader:Of,fragmentShader:Vf,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=zr.material;this.material.uniforms.inputValue.value.copy(t),zr.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(Xa,_u),this.renderer.setRenderTarget(r),zr.material=i},n.prototype.dispose=function(){this.material.dispose()},n}(),Qf=`
1326
1326
  #include <common>
1327
1327
  uniform sampler2D inputBuffer;
1328
1328
  uniform float scale;
@@ -1335,13 +1335,13 @@ void main() {
1335
1335
  float luminance = clamp(linearToRelativeLuminance(rgb), 0.1, 0.9);
1336
1336
  gl_FragColor = vec4(luminance);
1337
1337
  }
1338
- `,zf=function(n){oe(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:Uf})||this}return t}(Si),Gf=`
1338
+ `,Df=function(n){le(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:Qf})||this}return t}(Ci),Uf=`
1339
1339
  uniform sampler2D inputBuffer;
1340
1340
  varying vec2 vUv;
1341
1341
  void main() {
1342
1342
  gl_FragColor = texture2D(inputBuffer, vUv);
1343
1343
  }
1344
- `,Hf=function(n){oe(t,n);function t(e){return n.call(this,e,{fragment:Gf})||this}return t}(Si),Ii=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 Hf(this.renderer)}return n.prototype.render=function(t,e){},n.prototype.dispose=function(){this.copyPass.dispose()},n}(),qf=function(n){oe(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:`
1344
+ `,zf=function(n){le(t,n);function t(e){return n.call(this,e,{fragment:Uf})||this}return t}(Ci),Mi=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}(),Gf=function(n){le(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:`
1345
1345
  uniform sampler2D targetBuffer;
1346
1346
  uniform sampler2D inputBuffer;
1347
1347
  uniform float step;
@@ -1369,7 +1369,7 @@ void main() {
1369
1369
  }
1370
1370
  gl_FragColor = vec4(result, result, result, 1.0);
1371
1371
  }
1372
- `})||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}(Si),Kf=function(n){oe(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:`
1372
+ `})||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}(Ci),Hf=function(n){le(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:`
1373
1373
  #include <common>
1374
1374
  uniform sampler2D inputBuffer;
1375
1375
  uniform sampler2D luminanceAdaptiveBuffer;
@@ -1391,14 +1391,14 @@ void main() {
1391
1391
  rgb = clamp(lumCompressed * rgb, 0.0, 1.0);
1392
1392
  gl_FragColor = mix(inputColor, vec4(rgb, alpha), progress * 0.9);
1393
1393
  }
1394
- `})||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}(Si),jf=function(n){oe(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 Df(o.renderer),o.luminancePass=new zf(o.renderer,Math.sqrt(1/3)),o.nextStepPass=new qf(o.renderer,.01),o.luminanceAdaptivePass=new Kf(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}(Ii),Ji,Yn=512,Wf=32,Sr=(Ji=Math.SQRT1_2)!==null&&Ji!==void 0?Ji:Math.sqrt(2),Xf={up:new d.Quaternion(Sr,0,0,Sr),down:new d.Quaternion(-Sr,0,0,Sr),left:new d.Quaternion(0,Sr,0,Sr),right:new d.Quaternion(0,-Sr,0,Sr),front:new d.Quaternion(0,0,0,1),back:new d.Quaternion(0,1,0,0)},_f=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Zf=new Float32Array([0,0,1,0,0,1,1,1]),Yf=new Uint8Array([0,1,2,1,3,2]),Ti=new d.BufferGeometry;Ti.setAttribute("position",new d.BufferAttribute(_f,3));Ti.setAttribute("uv",new d.BufferAttribute(Zf,2));Ti.setIndex(new d.BufferAttribute(Yf,1));var Jf=`
1394
+ `})||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}(Ci),Kf=function(n){le(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.enableTime=be(),o.renderer=e,o.valuePass=new Nf(o.renderer),o.luminancePass=new Df(o.renderer,Math.sqrt(1/3)),o.nextStepPass=new Gf(o.renderer,.01),o.luminanceAdaptivePass=new Hf(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=be()),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((be()-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}(Mi),Zi,Zn=512,qf=32,Ir=(Zi=Math.SQRT1_2)!==null&&Zi!==void 0?Zi:Math.sqrt(2),jf={up:new d.Quaternion(Ir,0,0,Ir),down:new d.Quaternion(-Ir,0,0,Ir),left:new d.Quaternion(0,Ir,0,Ir),right:new d.Quaternion(0,-Ir,0,Ir),front:new d.Quaternion(0,0,0,1),back:new d.Quaternion(0,1,0,0)},Wf=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Xf=new Float32Array([0,0,1,0,0,1,1,1]),_f=new Uint8Array([0,1,2,1,3,2]),Si=new d.BufferGeometry;Si.setAttribute("position",new d.BufferAttribute(Wf,3));Si.setAttribute("uv",new d.BufferAttribute(Xf,2));Si.setIndex(new d.BufferAttribute(_f,1));var Zf=`
1395
1395
  uniform float flipY;
1396
1396
  varying vec2 vUv;
1397
1397
  void main() {
1398
1398
  vUv = vec2(uv.x, mix(uv.y, (1.0 - uv.y), flipY));
1399
1399
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
1400
1400
  }
1401
- `,$f=`
1401
+ `,Yf=`
1402
1402
  #if defined(USE_LUMINANCE)
1403
1403
  uniform sampler2D luminanceMap;
1404
1404
  #endif
@@ -1411,7 +1411,7 @@ void main() {
1411
1411
  gl_FragColor.a = 1.0 - texture2D(luminanceMap, vUv).r;
1412
1412
  #endif
1413
1413
  }
1414
- `,eh=function(n){oe(t,n);function t(){var e=n.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null},flipY:{value:0}},vertexShader:Jf,fragmentShader:$f})||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),th=function(n){oe(t,n);function t(e,r){var i=n.call(this,Ti,new eh)||this;return e.box.getCenter(i.position),i.quaternion.multiplyQuaternions(new d.Quaternion().setFromAxisAngle(new d.Vector3(0,1,0),-Math.PI),Xf[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),rh=function(n){oe(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!1,e.name="tiling",e}return t}(d.Group),nh=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=la(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=r,this.fetcher=t,this.object=new rh,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=la(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&&Va(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 x=w.size,E=l.imageOptions.transform,M=Math.pow(2,b.level)*b.position.y,C=Math.pow(2,b.level)*b.position.x,S="".concat(l.panoId,".").concat(b.face,".").concat(b.level,".").concat(M,".").concat(C),P=F(F({key:"pano_tile.".concat(S)},nr(l.imageOptions,["format","size","quality","sharpen","mappings"])),{size:x*b.size===Yn?void 0:Yn,cut:[x*b.position.x,x*b.position.y,x*b.size,x*b.size]}),I=l.textureLoader.loadTexture(w[b.face],{imageURL:{transform:E,options:P},minFilter:d.NearestFilter,magFilter:d.LinearFilter,generateMipmaps:!1,fetcher:l.fetcher}).then(function(z){return z.body}),B=null;if(l.luminance){var L=l.luminance[b.face],k=L.match(/\/cube_(\d+)\//),O=k?Number(k[1]):!1;if(O!==!1){var N=F(F({},P),{size:O*b.size===Yn/2?void 0:Yn/2,cut:[O*b.position.x,O*b.position.y,O*b.size,O*b.size],key:"pano_tile_luminance.".concat(S)});B=l.textureLoader.loadTexture(L,{imageURL:{transform:l.imageOptions.transform,options:N},magFilter:d.NearestFilter,fetcher:l.fetcher}).then(function(z){return z.body}).catch(function(){return null})}}l.pedding++;var D=Promise.all([I,B]).then(function(z){return i.pedding--,z},function(z){return i.pedding--,Promise.reject(z)}),H=new th(b,D);H.name="tiling:tile-".concat(S),H.activeTime=r,H.renderOrder=b.level,l.tileMeshes.set(b,H),l.object.needsRender=!0,l.object.add(H)},l=this,h=0,v=o;h<v.length;h++){var p=v[h];c(p)}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 x,E,M,C;return((E=(x=i.tileMeshes.get(w))===null||x===void 0?void 0:x.activeTime)!==null&&E!==void 0?E: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,Wf-u.size)),y=0,f=A;y<f.length;y++){var p=f[y],g=this.tileMeshes.get(p);g&&(g.dispose(),this.object.remove(g),this.object.needsRender=!0),this.tileMeshes.delete(p)}}},n.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},n}(),ih=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]),ah=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]),Ya=new d.BufferGeometry;Ya.setAttribute("position",new d.BufferAttribute(ih,3));Ya.setIndex(new d.BufferAttribute(ah,1));var oh=`
1414
+ `,Jf=function(n){le(t,n);function t(){var e=n.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null},flipY:{value:0}},vertexShader:Zf,fragmentShader:Yf})||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),$f=function(n){le(t,n);function t(e,r){var i=n.call(this,Si,new Jf)||this;return e.box.getCenter(i.position),i.quaternion.multiplyQuaternions(new d.Quaternion().setFromAxisAngle(new d.Vector3(0,1,0),-Math.PI),jf[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(D),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),eh=function(n){le(t,n);function t(){var e=n.call(this)||this;return e.needsRender=!1,e.name="tiling",e}return t}(d.Group),th=function(){function n(t,e,r){this.disposed=!1,this.textureLoader=new Nn,this.minLevel=e,this.level=0,this.panoId="[0]",this.pedding=0,this.tileTree=sa(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=r,this.fetcher=t,this.object=new eh,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=sa(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&&Va(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,l=function(b){var w=c.resource.filter(function(K){return K.level===b.level})[0];if(!w)return"continue";if(u.add(b),c.tileMeshes.has(b))return c.tileMeshes.get(b).activeTime=r,"continue";var E=w.size,C=c.imageOptions.transform,x=Math.pow(2,b.level)*b.position.y,M=Math.pow(2,b.level)*b.position.x,S="".concat(c.panoId,".").concat(b.face,".").concat(b.level,".").concat(x,".").concat(M),P=k(k({key:"pano_tile.".concat(S)},gr(c.imageOptions,["format","size","quality","sharpen","mappings"])),{size:E*b.size===Zn?void 0:Zn,cut:[E*b.position.x,E*b.position.y,E*b.size,E*b.size]}),T=c.textureLoader.loadTexture(w[b.face],{imageURL:{transform:C,options:P},minFilter:d.NearestFilter,magFilter:d.LinearFilter,generateMipmaps:!1,fetcher:c.fetcher}).then(function(K){return K.body}),B=null;if(c.luminance){var F=c.luminance[b.face],L=F.match(/\/cube_(\d+)\//),O=L?Number(L[1]):!1;if(O!==!1){var Q=k(k({},P),{size:O*b.size===Zn/2?void 0:Zn/2,cut:[O*b.position.x,O*b.position.y,O*b.size,O*b.size],key:"pano_tile_luminance.".concat(S)});B=c.textureLoader.loadTexture(F,{imageURL:{transform:c.imageOptions.transform,options:Q},magFilter:d.NearestFilter,fetcher:c.fetcher}).then(function(K){return K.body}).catch(function(){return null})}}c.pedding++;var N=Promise.all([T,B]).then(function(K){return i.pedding--,K},function(K){return i.pedding--,Promise.reject(K)}),H=new $f(b,N);H.name="tiling:tile-".concat(S),H.activeTime=r,H.renderOrder=b.level,c.tileMeshes.set(b,H),c.object.needsRender=!0,c.object.add(H)},c=this,f=0,A=o;f<A.length;f++){var p=A[f];l(p)}var y=[];this.tileMeshes.forEach(function(b,w){u.has(w)||y.push(w),b.visible=w.level<=e});for(var v=y.sort(function(b,w){var E,C,x,M;return((C=(E=i.tileMeshes.get(w))===null||E===void 0?void 0:E.activeTime)!==null&&C!==void 0?C:0)-((M=(x=i.tileMeshes.get(b))===null||x===void 0?void 0:x.activeTime)!==null&&M!==void 0?M:0)}).slice(Math.max(0,qf-u.size)),m=0,h=v;m<h.length;m++){var p=h[m],g=this.tileMeshes.get(p);g&&(g.dispose(),this.object.remove(g),this.object.needsRender=!0),this.tileMeshes.delete(p)}}},n.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},n}(),rh=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]),nh=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]),_a=new d.BufferGeometry;_a.setAttribute("position",new d.BufferAttribute(rh,3));_a.setIndex(new d.BufferAttribute(nh,1));var ih=`
1415
1415
  #if defined(USE_PANO_VIDEO)
1416
1416
  varying vec3 worldPosition;
1417
1417
  #endif
@@ -1422,7 +1422,7 @@ void main() {
1422
1422
  #endif
1423
1423
  gl_Position = projectionMatrix * modelViewMatrix * transformed;
1424
1424
  }
1425
- `,sh=`
1425
+ `,ah=`
1426
1426
  uniform vec2 size;
1427
1427
  uniform mat4 matrix;
1428
1428
  uniform float alpha;
@@ -1446,7 +1446,7 @@ void main() {
1446
1446
  gl_FragColor = vec4(videoColor.rgb, match * blendAlpha * alpha);
1447
1447
  #endif
1448
1448
  }
1449
- `,uh=function(){function n(){this.material=new d.ShaderMaterial({vertexShader:oh,fragmentShader:sh,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(Ya,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}(),lh=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),ms=new d.Vector3(-1,1,1),gs=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}(),Ja=function(n){oe(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 gs,r.luminanceCubeRenderTargetPool=new gs;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 Le&&l.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(l.map.cubeRenderTarget),l.luminanceMap&&(l.luminanceMap.dispose(),l.luminanceMap instanceof Le&&l.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(l.luminanceMap.cubeRenderTarget)));for(var v=r.colorCubeRenderTargetPool.size;v<2;v++){var p=Math.max(1024*r.TILED_CUBE_TEXTURE_LEVEL,512),m=r.colorCubeRenderTargetPool.create();m.setSize(p,p),da(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=ht()]={panoId:Re(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 nh(A?dt(A.work):li,r.TILED_CUBE_TEXTURE_LEVEL+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new uh,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 F(F({},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 ja},tileLevelForFov:(o=e.tileLevelForFov)!==null&&o!==void 0?o:function(c,l){var h=function(y){return y/Math.PI*180},v=function(y){return y/180*Math.PI},p=l.height/2/Math.tan(v(c/2)),m=l.width>l.height?c:h(Math.atan(Math.tan(v(c/2))*(l.width/l.height))*2),A=p*(Math.tan(v(m/2))-Math.tan(v(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 F(F({},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,v=l.pano1,p=0,m=Object.keys(this.panoResources);p<m.length;p++){var A=m[p],y=this.panoResources[A];if(y.panoPicture){var f=y.panoPicture.map;f&&f!==(h==null?void 0:h.map)&&f!==(v==null?void 0:v.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 Le&&(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(F(F({},this),{initial:{currentState:F(F({},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?dt(c):li),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,v,p,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(ae(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),x=w[0],E=w[1],M=this.panoResourceFromLocationMotionKeyframe(x),C=this.panoResourceFromLocationMotionKeyframe(E),S=new d.Vector3().copy(M.position),P=new d.Vector3().copy(C.position),I=this.locationMotion.value.count-E.value.count+1;A.progress=I,C.panoPicture&&(I<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)}),S.copy(P)),y.distance=this.locationMotion.value.distance,y.offset=new d.Vector3(S.x+(P.x-S.x)*I,S.y+(P.y-S.y)*I,S.z+(P.z-S.z)*I);for(var B=[],L=[],k=0,O=this.locationMotion.keyframes;k<O.length;k++){var N=O[k],D=N.key,H=N.progress;D!==void 0&&(B.push(D),H>=this.locationMotion.progress&&L.push(D))}for(var z=0,U=Object.keys(this.panoResources);z<U.length;z++){var q=U[z];if(!(L.indexOf(q)>=0)){var j=this.panoResources[q];if(j.panoPicture){var _=j.panoPicture.map,Z=j.panoPicture.luminanceMap;if(_){if(_===((a=A.pano0)===null||a===void 0?void 0:a.map)||_===((o=A.pano1)===null||o===void 0?void 0:o.map))continue;_ instanceof Le&&_.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(_.cubeRenderTarget),_.dispose(),Z&&(Z instanceof Le&&Z.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(Z.cubeRenderTarget),Z.dispose()),j.panoPicture=null}}B.indexOf(q)>=0||delete this.panoResources[q]}}this.currentPano=We(C.panoId),this.emit("pano.moving",K("pano.moving",{userAction:this.userAction,prevPano:We(f.panoId),state:F(F(F(F({},We(g.panoId)),{mode:this.mode}),Ve(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}Et(A)===!1&&(!((s=A.pano0)===null||s===void 0)&&s.map&&A.pano0.map instanceof Le&&!A.pano0.map.cubeRenderTarget&&(A.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=A.pano0)===null||u===void 0)&&u.luminanceMap&&A.pano0.luminanceMap instanceof Le&&!A.pano0.luminanceMap.cubeRenderTarget&&(A.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((c=A.pano1)===null||c===void 0)&&c.map&&A.pano1.map instanceof Le&&!A.pano1.map.cubeRenderTarget&&(A.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=A.pano1)===null||l===void 0)&&l.luminanceMap&&A.pano1.luminanceMap instanceof Le&&!A.pano1.luminanceMap.cubeRenderTarget&&(A.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(A)),Et(y)===!1&&this.setCamera(y);var W=this.works.getResolvedObserver(this.currentPano),Y=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||b){if(W)for(var ce=0,te=Object.keys(this.panoMeshes);ce<te.length;ce++){var se=te[ce],ue=this.panoMeshes[se];ue.setOpacity(0),ue.setCurrent(!1),ue.updateTime&&ue.updateTime(e,r)}}else if(W){var pe=Pt(W.visibleIds,function(me){var Ae=i.works.getResolvedObserver(me);return Ae?W.standingPosition.distanceTo(Ae.standingPosition):1/0},!0),he=pe[1];he=ae(he,2.5,1/0);for(var de=W.visibleIds.concat(Re(this.currentPano)),be=this.camera.getDirection(new d.Vector3),fe=0,Se=Object.keys(this.panoMeshes);fe<Se.length;fe++){var se=Se[fe],ue=this.panoMeshes[se],ee=this.works.getResolvedObserver(se);if(de.indexOf(se)===-1)ue.setCurrent(!1),ue.setOpacity(0);else if(!ee)ue.setCurrent(!1),ue.setOpacity(0);else if(!ee.loadable&&!ee.active)ue.setCurrent(!1),ue.setOpacity(0);else{var le=ue.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ue.setCurrent(!ue.loading&&ue.progress===0&&Y!==null&&Y.panoId===se),ue.setOpacity(le<.01?0:ae(he/le*1.2,.4,.85));var X=this.camera.position.clone().setY(ue.position.y),Te=new d.Vector3().copy(ue.position).sub(X).normalize();if(se===Re(this.currentPano)){var Fe=ae((.5-X.distanceTo(ue.position))/.5,0,1);Te.multiplyScalar(1-Fe).add(be.clone().multiplyScalar(Fe))}Te.length()>0&&ue.quaternion.setFromEuler(new d.Euler(0,Math.atan2(Te.x,Te.z),0))}ue.updateTime&&ue.updateTime(e,r)}}var Ye=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var me=i.renderer.getDrawingBufferSize(new d.Vector2);me.width*=i.scissor.width,me.height*=i.scissor.height;var Ae=g.panoId,nt=i.works.getResolvedObserver(Ae),Ce=i.imageOptions.size;if(typeof Ce=="undefined"&&nt){var He=nt.images.up.match(/\/cube_(\d+)\//);He&&(Ce=Number(He[1]))}typeof Ce=="undefined"&&(Ce=2048);var Oe=0;Ce>=1024&&(Oe=1),Ce>=2048&&(Oe=2),Ce>=4096&&(Oe=3),Ce>=8192&&(Oe=4);var it=i.tileLevelForFov(i.camera.fov,me);return it>Oe?it:0}(),Xe=function(){var me=i.camera.quaternion.clone(),Ae=i.works.getResolvedObserver(g.panoId),nt=Ae!=null?Ae:W;nt&&me.premultiply(nt.quaternion.clone().inverse());var Ce=new d.Matrix4().makeRotationFromQuaternion(me),He=new d.Matrix4().getInverse(Ce),Oe=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(i.camera.projectionMatrix,He));return Oe}();g.panoId===Re(this.currentPano)&&(((h=g.panoPicture)===null||h===void 0?void 0:h.map)instanceof Le&&(g.panoPicture.map.update(Xe,Ye),g.panoPicture.map.needsRender===!0&&(g.panoPicture.map.needsRender=!1,this.needsRender=!0)),((v=g.panoPicture)===null||v===void 0?void 0:v.luminanceMap)instanceof Le&&(g.panoPicture.luminanceMap.update(Xe,Ye),g.panoPicture.luminanceMap.needsRender===!0&&(g.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0)));{var Ge=this.tiling.object.visible;if(this.initAnimationed){var st=g.panoId,Ne=this.works.getResolvedObserver(st);Ne?Ci(this.camera.position,Ne.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==st&&this.tiling.cleanup(),this.tiling.panoId=st,this.tiling.setResource((m=(p=Ne.images)===null||p===void 0?void 0:p.tiles)!==null&&m!==void 0?m:[],this.enableIOSEDR&&Ne.images.luminance?Ne.images.luminance:null),this.tiling.setFetcher(dt(Ne.work)),this.tiling.setRotation(Ne.quaternion),this.tiling.setPosition(Ne.position),Ye>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Xe,Ye,e):this.tiling.update(Xe,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ge!==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 jf(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=="undefined"&&l){var v=l.images.up.match(/\/cube_(\d+)\//);v&&(h=Number(v[1]))}typeof h=="undefined"&&(h=2048);var p=this.imageOptions.transform,m=F({key:"pano.".concat(l.panoId)},nr(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(k){return k.size>h}))!==null&&s!==void 0?s:null,f=p,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 k=b.up.match(/\/cube_(\d+)\//),O=k?Number(k[1]):!1;return O===!1?null:y==null?void 0:y.map(function(N){return{level:N.level,size:O,back:b.back,front:b.front,left:b.left,right:b.right,up:b.up,down:b.down}})}(),x="pano:"+dn([A,m,p]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===x)return;var E=this.pendingTextureTask.panoId;(u=this.panoMeshes[E])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",K("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()||{},S=C.pano0,P=C.pano1,I;if(S&&S.map.name===x&&S.luminanceMap!==null===this.enableIOSEDR?I=S:(P==null?void 0:P.map.name)===x&&P.luminanceMap!==null===this.enableIOSEDR&&(I=P),I){var B={panoId:l.panoId,effect:(c=r.effect)!==null&&c!==void 0?c:"fly",panoPicture:{map:I.map,luminanceMap:I.luminanceMap,matrix:new d.Matrix4().compose(l.position,l.quaternion,ms)},position:l.position.clone()};ft.shared.add(function(){a.pending.delete(M),a.doMoveToPano(l.pano,B,r)},!0,1);return}this.pendingTextureTask={panoId:l.panoId,hash:x,onLoad:function(k,O){var N,D;if(a.pending.delete(M),a.destroyed)k.body.dispose();else{k.body.name=x;var H={panoId:l.panoId,effect:(N=r.effect)!==null&&N!==void 0?N:"fly",panoPicture:{map:k.body,luminanceMap:(D=O==null?void 0:O.body)!==null&&D!==void 0?D:null,matrix:new d.Matrix4().compose(l.position,l.quaternion,ms)},position:l.position.clone()};a.doMoveToPano(l.pano,H,r)}},onError:function(k){a.pending.delete(M);var O=F(F(F({},l.pano),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.error",K("pano.error",{error:k,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:O})),a.emit("pano.cancel",K("pano.cancel",{error:k,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:O})),a.emit("error",k),r.moveCancelCallback&&r.moveCancelCallback()}};var L=this.panoMeshes[l.panoId];L&&L.tap&&L.tap(),Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(A,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:m},minFilter:d.NearestFilter,magFilter:d.LinearFilter,generateMipmaps:!1,format:d.RGBAFormat,viaAjax:!0,fetcher:dt(l.work)},void 0,void 0,function(k){var O,N;a.emit("pano.texture.progress",K("pano.texture.progress",{error:null,progress:k,meta:null,pano:l.pano})),((O=a.pendingTextureTask)===null||O===void 0?void 0:O.hash)===x&&((N=a.panoMeshes[l.panoId])===null||N===void 0||N.setProgress(k))},this.renderer):this.textureLoader.loadCubeTexture(A,{imageURL:{transform:p,options:m},format:d.RGBAFormat,viaAjax:!0,fetcher:dt(l.work)},void 0,void 0,function(k){var O,N;a.emit("pano.texture.progress",K("pano.texture.progress",{error:null,progress:k,meta:null,pano:l.pano})),((O=a.pendingTextureTask)===null||O===void 0?void 0:O.hash)===x&&((N=a.panoMeshes[l.panoId])===null||N===void 0||N.setProgress(k))},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},minFilter:d.NearestFilter,magFilter:d.LinearFilter,generateMipmaps:!1,fetcher:dt(l.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(b,{imageURL:{transform:f,options:g},fetcher:dt(l.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(k){var O,N,D=k[0],H=k[1];((O=a.pendingTextureTask)===null||O===void 0?void 0:O.hash)===x?(a.pendingTextureTask.onLoad(D,H),(N=a.panoMeshes[l.panoId])===null||N===void 0||N.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",K("pano.texture.success",{error:null,progress:1,meta:D.meta,pano:l.pano}))):(D.body.dispose(),H==null||H.body.dispose())}).catch(function(k){var O,N;((O=a.pendingTextureTask)===null||O===void 0?void 0:O.hash)===x&&(a.pendingTextureTask.onError(k),(N=a.panoMeshes[l.panoId])===null||N===void 0||N.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",K("pano.texture.error",{error:k,progress:0,meta:null,pano:l.pano})),a.emit("error",k))}),this.emit("pano.texture.load",K("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(v){h=!0,e.perspToOrthoMotion.set(l,a).catch(Q),e.modelAlphaMotion.setKeyframes([{progress:0,value:F({},e.modelAlphaMotion.value)},{progress:.6,value:F({},e.modelAlphaMotion.value)},{progress:1,value:c}],a).catch(Q),e.emit("initAnimation.start",K("initAnimation.start",{state:v,userAction:e.userAction}))},moveEndCallback:function(v){e.emit("initAnimation.end",K("initAnimation.end",{state:v,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var v=F(F(F({},u),{mode:e.mode}),Ve(e.camera.pose));h===!1&&e.emit("initAnimation.start",K("initAnimation.start",{state:v,userAction:e.userAction})),e.emit("initAnimation.end",K("initAnimation.end",{state:v,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(E){var M=Pt(E.accessibleIds,function(S){var P=e.works.getResolvedObserver(S);if(!P)return 1/0;var I=P.standingPosition.distanceTo(E.standingPosition);return ae(I,1,1/0)},!0),C=M[1];l[E.panoId]===void 0&&(l[E.panoId]=C)},v=0,p=this.works.resolvedObservers;v<p.length;v++){var m=p[v];h(m)}var A=Object.keys(l).map(function(E){return l[E]});if(A.length){var y=A.reduce(function(E,M){return E+M},0)/A.length;c=ae(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 x=w[b];this.helper.remove(r[x]),r[x].dispose(),delete r[x]}},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,c;i===void 0&&(i={});var l=ve(),h=ht();this.tiling.cleanup(),this.panoResources[h]=r;var v=1,p,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;p=Math.max(b.distanceTo(w),v),m=[{key:f.key,progress:0,value:F(F({},g),{count:0})},{key:h,progress:1,value:{distance:0,count:1}}],A=0}else{var x=this.locationMotion.getKeyFrameSegment(l),E=x[0],f=x[1],g=this.locationMotion.value,M=this.panoResourceFromLocationMotionKeyframe(E).position,b=this.panoResourceFromLocationMotionKeyframe(f).position,w=r.position,C=f.value.count-g.count,S=Math.max(M.distanceTo(b),v)*C,P=Math.max(b.distanceTo(w),v);p=S+P,m=[{key:E.key,progress:0,value:F({},g)},{key:f.key,progress:S/p,value:f.value},{key:h,progress:1,value:{count:f.value.count+1,distance:0}}];var I=this.locationMotionKeyframesLength(this.locationMotion.keyframes),B=this.locationMotionKeyframesLength(m);I===0||I===0?A=0:A=this.locationMotion.getProgressVelocity(l)*I/B}var L=this.calculateMovingDuration(i.duration,i.effect==="fade"||i.effect==="montage"?0:p),k={longitude:i.longitude,latitude:i.latitude,fov:i.fov},O=F(F({},e),{mode:this.mode,longitude:(s=k.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(u=k.latitude)!==null&&u!==void 0?u:this.camera.pose.latitude,fov:(c=k.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",K("pano.moveTo",{options:i,prevPano:N,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,L).catch(Q);var D=this.locationMotion.setKeyframes(m,L,A);D.then(function(){var H,z,U=F(F({},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",K("pano.arrived",{options:i,prevPano:N,progress:1,state:U,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(U);var q=a.works.getResolvedObserver(e);if(q&&q.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var j=lh.clone().multiply((z=(H=a.models.getMaterial().pano1)===null||H===void 0?void 0:H.matrix)!==null&&z!==void 0?z:new d.Matrix4).multiply(q.video.matrix),_={map:a.videoTexture,size:q.video.size,matrix:j,alpha:1},Z=ht(),W=a.videoTexture.image;W.setAttribute("uuid",Z),_u().then(function(Y){Y&&q.video&&W.getAttribute("uuid")===Z&&(W.oncanplay=function(){W.oncanplay=Q,W.play()},W.ontimeupdate=function(){W.currentTime>.5&&(W.ontimeupdate=Q,a.panoVideo.setMaterial(_))},W.src=q.video.source)}).catch(function(){W.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",K("pano.cancel",{options:i,prevPano:N,progress:0,state:O,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.works.getResolvedObserver(this.currentPano);if(!i)return null;var a=e!=null?e:new d.Raycaster(this.camera.position.clone(),this.camera.getDirection(new d.Vector3));a.params.Points={threshold:.1};var o=i.standingPosition.clone();if(i.position.distanceTo(a.ray.origin)>1){var s=this.models.intersectRaycaster(new d.Raycaster(a.ray.origin,new d.Vector3(0,-1,0)))[0];s&&s.distance<=2?o.copy(s.point):o.copy(a.ray.origin).add(new d.Vector3(0,-1.5,0))}var 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(x){if(x===Re(r.currentPano))return!1;var E=r.works.getResolvedObserver(x);if(!E)return!1;var M=E.standingPosition.clone().project(r.camera);return Math.abs(M.z)>1||Math.abs(M.x)>1||Math.abs(M.y)>1?!1:E.loadable||E.active}),v=h.slice().sort(function(x,E){var M=r.works.getResolvedObserver(x).standingPosition.clone().distanceTo(o),C=r.works.getResolvedObserver(E).standingPosition.clone().distanceTo(o);return M-C}),p=0,m=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];p<m.length;p++)for(var A=m[p],y=0,f=v;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!==Re(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===Re(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 v=Pt(l,function(z){var U=r.works.getResolvedObserver(z);if(!U)return 1/0;var q=U.standingPosition.clone();return q.distanceTo(h.point)},!0),p=v[0],m=v[1];p&&m<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(p))!==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,x=Math.PI/12,E=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),M=[],C=[],S=[],P=0,I=u.accessibleIds;P<I.length;P++){var p=I[P],B=We(p);if(!(Tt(B,this.currentPano)||Tt(B,u.pano))){var L=this.works.getResolvedObserver(p);if(L){var k=L.position.clone().sub(u.position).setY(0);E.angleTo(k)<w&&S.push(k)}}}var O=S.length>0?S:rt(rt([],M,!0),C,!0),N=O.slice().sort(function(z,U){return z.angleTo(E)-U.angleTo(E)})[0];N&&N.angleTo(s)>x&&(b.longitude=Math.atan2(-N.x,-N.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(b.latitude=ae(0,this.minLatitude,this.maxLatitude));var D=F({},e.state);if(D.workCode=u.pano.workCode,D.panoIndex=u.pano.panoIndex,b.longitude!==void 0&&(D.longitude=b.longitude),b.latitude!==void 0&&(D.latitude=b.latitude),b.fov!==void 0&&(D.fov=b.fov),D.distance=0,D.offset=u.position.clone(),e.state=D,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",K("pano.select",{prevPano:this.currentPano,state:D,userAction:e.userAction,options:b,progress:0,error:null})),u&&!u.active){var H=u.panoId;this.panoMeshes[H]&&(this.panoMeshes[H].setDisabled(!1),this.panoMeshes[H].setLoading(!0))}u&&u.active&&this.emit("pano.request",K("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:D,options:b,error:null}))}}}}},t}(Xa),fr=Math.PI/180,sn=180/Math.PI,Yu=.001,Ju=1,On=function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),ch=function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),dh=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),$u=function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),fh=function(){var n=!1;if($u()===65){var t=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var e=t[1].split(".");e[0],e[1];var r=e[2],i=e[3];n=parseInt(r,10)===3325&&parseInt(i,10)<148}}return function(){return n}}(),hh=function(){var n=On()&&ch()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),e0=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function ys(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return e0()?!n:n}function ph(n){return!(isNaN(n)||n<=Yu||n>Ju)}function vh(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var bs=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function ws(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 Ah(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=ws(document.referrer),e=ws(window.location.href);return n&&t!==e}var xs=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,v=u+u,p=o*l,m=o*h,A=o*v,y=s*h,f=s*v,g=u*v,b=c*l,w=c*h,x=c*v;return r[0]=1-(y+g),r[1]=m+x,r[2]=A-w,r[3]=0,r[4]=m-x,r[5]=1-(p+g),r[6]=f+b,r[7]=0,r[8]=A+w,r[9]=f-b,r[10]=1-(p+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,v,p,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],v=i[3],p=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]=v,r[4]=p,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+p*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]=v*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],v=i[7],p=i[8],m=i[9],A=i[10],y=i[11],f=i[12],g=i[13],b=i[14],w=i[15],x=a*l-o*c,E=a*h-s*c,M=a*v-u*c,C=o*h-s*l,S=o*v-u*l,P=s*v-u*h,I=p*g-m*f,B=p*b-A*f,L=p*w-y*f,k=m*b-A*g,O=m*w-y*g,N=A*w-y*b,D=x*N-E*O+M*k+C*L-S*B+P*I;return D?(D=1/D,r[0]=(l*N-h*O+v*k)*D,r[1]=(s*O-o*N-u*k)*D,r[2]=(g*P-b*S+w*C)*D,r[3]=(A*S-m*P-y*C)*D,r[4]=(h*L-c*N-v*B)*D,r[5]=(a*N-s*L+u*B)*D,r[6]=(b*M-f*P-w*E)*D,r[7]=(p*P-A*M+y*E)*D,r[8]=(c*O-l*L+v*I)*D,r[9]=(o*L-a*O-u*I)*D,r[10]=(f*S-g*M+w*x)*D,r[11]=(m*M-p*S-y*x)*D,r[12]=(l*B-c*k-h*I)*D,r[13]=(a*k-o*B+s*I)*D,r[14]=(g*E-f*C-b*x)*D,r[15]=(p*C-m*E+A*x)*D,r):null}return function(r,i,a){n(r,i),a&&t(r,r,a),e(r,r)}}(),$i=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}(),mh=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new $i,this.currentGyroMeasurement=new $i,this.previousGyroMeasurement=new $i,On()?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;ph(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)",sn*vh(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}(),gh=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<fr*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(sn*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}(),yh=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}(),bh=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),Es=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),wh=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 mh(t,i),this.posePredictor=new gh(e,i),this.isFirefoxAndroid=dh(),this.isIOS=On();var a=$u();this.isDeviceMotionInRadians=!this.isIOS&&a!==null&&a<66,this.isWithoutDeviceMotion=fh()||hh(),this.filterToWorldQ=new d.Quaternion,On()?this.filterToWorldQ.setFromAxisAngle(new d.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new d.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new d.Quaternion,this.worldToScreenQ=new d.Quaternion,this.originalPoseAdjustQ=new d.Quaternion;var o=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new d.Vector3(0,0,1),o),this.setScreenTransform_(),ys()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new d.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return n.prototype.getPosition=function(){return null},n.prototype.getOrientation=function(){var t;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||function(){var a=new d.Quaternion().setFromAxisAngle(new d.Vector3(0,0,-1),0),o=new d.Quaternion;return typeof window!="undefined"&&window.orientation===-90?o.setFromAxisAngle(new d.Vector3(0,1,0),Math.PI/-2):o.setFromAxisAngle(new d.Vector3(0,1,0),Math.PI/2),a.multiply(o)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||function(){var a=new d.Quaternion;return a.setFromAxisAngle(new d.Vector3(1,0,0),-Math.PI/2),a}(),t=this._deviceOrientationQ;var e=new d.Quaternion;return e.copy(t),e.multiply(this.deviceOrientationFilterToWorldQ),e.multiply(this.resetQ),e.multiply(this.worldToScreenQ),e.multiplyQuaternions(this.deviceOrientationFixQ,e),this.yawOnly&&(e.x=0,e.z=0,e.normalize()),this.orientationOut_[0]=e.x,this.orientationOut_[1]=e.y,this.orientationOut_[2]=e.z,this.orientationOut_[3]=e.w,this.orientationOut_}else{var r=this.filter.getOrientation();t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS)}var i=new d.Quaternion;return i.copy(this.filterToWorldQ),i.multiply(this.resetQ),i.multiply(t),i.multiply(this.worldToScreenQ),this.yawOnly&&(i.x=0,i.z=0,i.normalize()),this.orientationOut_[0]=i.x,this.orientationOut_[1]=i.y,this.orientationOut_[2]=i.z,this.orientationOut_[3]=i.w,this.orientationOut_},n.prototype.getPose=function(){var t=new bh;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(),ys()&&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),xs(t.leftViewMatrix,e,r.left),xs(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window=="undefined")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),i=this.onDeviceOrientation_.bind(this);return On()&&Ah()&&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*fr,o=t.left.downDegrees*fr,s=t.left.leftDegrees*fr,u=t.left.rightDegrees*fr,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*fr,o=t.right.downDegrees*fr,s=t.right.leftDegrees*fr,u=t.right.rightDegrees*fr,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 yh(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=sn*Math.atan(r.distort(a/i)),l=sn*Math.atan(r.distort(o/i)),h=sn*Math.atan(r.distort(s/i)),v=sn*Math.atan(r.distort(u/i)),p=new Es,m=new Es;return p.leftDegrees=Math.min(c,t.fov),p.rightDegrees=Math.min(l,t.fov),p.downDegrees=Math.min(h,t.fov),p.upDegrees=Math.min(v,t.fov),m.leftDegrees=p.rightDegrees,m.rightDegrees=p.leftDegrees,m.upDegrees=p.upDegrees,m.downDegrees=p.downDegrees,{left:p,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){bs("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(a<=Yu||a>Ju){bs("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&&(e0()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,i)),this.filter.addAccelMeasurement(this.accelerometer,i)),this.previousTimestampS=i},n.prototype.onOrientationChange_=function(){this.setScreenTransform_()},n.prototype.onMessage_=function(t){var e=t.data;if(!(!e||!e.type)){var r=e.type.toLowerCase();r==="devicemotion"&&this.updateDeviceMotion_(e.deviceMotionEvent)}},n.prototype.setScreenTransform_=function(){this.worldToScreenQ.set(0,0,0,1);var t=typeof window!="undefined"?window.orientation:0;switch(t){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new d.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new d.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n}(),Jn=[0,0,.5,1],$n=[.5,0,.5,1],xh=function(){function n(t){var e=this;this.renderer=t,this.sensor=new wh(.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*Jn[0]),y:Math.round(r.height*Jn[1]),width:Math.round(r.width*Jn[2]),height:Math.round(r.height*Jn[3])},o={x:Math.round(r.width*$n[0]),y:Math.round(r.height*$n[1]),width:Math.round(r.width*$n[2]),height:Math.round(r.height*$n[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 Eh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6Dg4OAgICCgoKKioqEhISIiIhqamqCgoKIiIiQkJCIiIiWlpawsLBmZmaAgICenp6Li4uBgYGTk5OMjIyVlZWFhYWCgoKvr6+Ojo59fX2SkpKvr6+Ojo6QkJCurq6BgYGxsbF8fHx4eHitra2enp6srKyJiYmurq54eHj5+fl+fn57e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Bc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var ea,ta={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},Ms=typeof navigator!="undefined"&&(ea=ta[navigator.language.split("-")[0]])!==null&&ea!==void 0?ea:ta.zh,Ch=`
1449
+ `,oh=function(){function n(){this.material=new d.ShaderMaterial({vertexShader:ih,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(_a,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new xe({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(D),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(D));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}(),sh=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),vs=new d.Vector3(-1,1,1),As=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}(),Za=function(n){le(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 As,r.luminanceCubeRenderTargetPool=new As;var l=r.models.getMaterial()||{},c=l.pano0,f=l.pano1;c&&(f==null?void 0:f.map)!==c.map&&(r.models.setMaterial({pano0:f}),c.map.dispose(),c.map instanceof Fe&&c.map.cubeRenderTarget&&r.colorCubeRenderTargetPool.push(c.map.cubeRenderTarget),c.luminanceMap&&(c.luminanceMap.dispose(),c.luminanceMap instanceof Fe&&c.luminanceMap.cubeRenderTarget&&r.luminanceCubeRenderTargetPool.push(c.luminanceMap.cubeRenderTarget)));for(var A=r.colorCubeRenderTargetPool.size;A<2;A++){var p=Math.max(1024*r.TILED_CUBE_TEXTURE_LEVEL,512),y=r.colorCubeRenderTargetPool.create();y.setSize(p,p),la(null,y,r.renderer),r.colorCubeRenderTargetPool.push(y)}r.panoMeshes={},r.updatePanoMeshes(),r.locationMotion=new xe({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new xe({modelAlpha:(a=(i=r.models.getMaterial())===null||i===void 0?void 0:i.modelAlpha)!==null&&a!==void 0?a:0}),r.perspToOrthoMotion=new xe({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=wt()]={panoId:Oe(r.currentPano),panoPicture:(s=(o=r.models.getMaterial())===null||o===void 0?void 0:o.pano1)!==null&&s!==void 0?s:null,position:r.camera.pose.offset.clone(),effect:"fly",fixCameraTransform:new d.Matrix4};var v=r.works.getResolvedObserver(r.currentPano);return r.textureLoader=new Nn,r.tiling=new th(v?ut(v.work):ui,r.TILED_CUBE_TEXTURE_LEVEL+1,r.imageOptions),r.scene.add(r.tiling.object),r.panoVideo=new oh,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 k(k({},u),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:5,panoTapTriggerRadius:(i=e.panoTapTriggerRadius)!==null&&i!==void 0?i:.5,panoCircleMeshCreator:(a=e.panoCircleMeshCreator)!==null&&a!==void 0?a:function(l){return new qu},tileLevelForFov:(o=e.tileLevelForFov)!==null&&o!==void 0?o:function(l,c){var f=function(m){return m/Math.PI*180},A=function(m){return m/180*Math.PI},p=c.height/2/Math.tan(A(l/2)),y=c.width>c.height?l:f(Math.atan(Math.tan(A(l/2))*(c.width/c.height))*2),v=p*(Math.tan(A(y/2))-Math.tan(A(y/2-1)));return v>60?4:v>30?3:v>18?2:v>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 k(k({},i),{mode:"Panorama"})},t.prototype.destroy=function(){var e,r;if(n.prototype.destroy.call(this),this.scene.remove(this.tiling.object),this.tiling.dispose(),this.locationMotion.dispose(),this.colorCubeRenderTargetPool.clear(),this.luminanceCubeRenderTargetPool.clear(),delete this.pendingTextureTask,this.panoMeshes)for(var i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],u=this.panoMeshes[s];this.helper.remove(u),u.dispose(),delete this.panoMeshes[s]}var l=this.videoTexture.image;l.pause(),l.oncanplay=function(){},l.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var c=(e=this.models.getMaterial())!==null&&e!==void 0?e:{},f=c.pano0,A=c.pano1,p=0,y=Object.keys(this.panoResources);p<y.length;p++){var v=y[p],m=this.panoResources[v];if(m.panoPicture){var h=m.panoPicture.map;h&&h!==(f==null?void 0:f.map)&&h!==(A==null?void 0:A.map)&&(h.dispose(),(r=m.panoPicture.luminanceMap)===null||r===void 0||r.dispose(),m.panoPicture=null)}delete this.panoResources[v]}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 Fe&&(i=(r=a.panoPicture)===null||r===void 0?void 0:r.map.tilePending)!==null&&i!==void 0?i:0,s=this.tiling.pedding;return this.initAnimationed&&o<=0&&s<=0},t.prototype.updateWork=function(e,r,i,a){var o=this;this.userAction=a,this.works=e;var s=t.initAnimationEndState(k(k({},this),{initial:{currentState:k(k({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}})),u={workCode:s.workCode,panoIndex:s.panoIndex},l=this.works.getWork(u.workCode);return this.tiling.setFetcher(l?ut(l):ui),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(u,{effect:i.effect,duration:i.duration,longitude:r.longitude,latitude:r.latitude,fov:r.fov,moveEndCallback:function(){o.initAnimationed=!0},moveCancelCallback:function(){o.initAnimationed=!0}},a),!0},t.prototype.updateModel=function(e){this.models=e,this.updatePanoMeshes()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,u,l,c,f,A,p,y;if(!this.destroyed){var v={},m={},h=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),m.longitude=this.cameraMotion.value.longitude,m.latitude=this.cameraMotion.value.latitude,m.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),E=w[0],C=w[1],x=this.panoResourceFromLocationMotionKeyframe(E),M=this.panoResourceFromLocationMotionKeyframe(C),S=new d.Vector3().copy(x.position),P=new d.Vector3().copy(M.position),T=this.locationMotion.value.count-C.value.count+1;v.progress=T,M.panoPicture&&(T<1?x.panoPicture&&(v.pano0=x.panoPicture):v.pano0=M.panoPicture,v.pano1=M.panoPicture),M.effect==="montage"?v.transition="BLACK":M.effect==="spread"?v.transition="SPREAD":v.transition="FADE",T<1&&M.effect!=="fly"&&(v.pano0&&x.panoPicture&&(v.pano0={map:v.pano0.map,luminanceMap:v.pano0.luminanceMap,matrix:x.panoPicture.matrix.clone().premultiply(x.fixCameraTransform).setPosition(M.position)}),S.copy(P),b=!0),m.distance=this.locationMotion.value.distance,m.offset=new d.Vector3(S.x+(P.x-S.x)*T,S.y+(P.y-S.y)*T,S.z+(P.z-S.z)*T);for(var B=[],F=[],L=0,O=this.locationMotion.keyframes;L<O.length;L++){var Q=O[L],N=Q.key,H=Q.progress;N!==void 0&&(B.push(N),H>this.locationMotion.progress&&F.push(N))}for(var K=0,U=Object.keys(this.panoResources);K<U.length;K++){var G=U[K];if(!(F.indexOf(G)>=0)){var X=this.panoResources[G];if(X.panoPicture){var Z=X.panoPicture.map,q=X.panoPicture.luminanceMap;if(Z){if(Z===((a=v.pano0)===null||a===void 0?void 0:a.map)||Z===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;Z instanceof Fe&&Z.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(Z.cubeRenderTarget),Z.dispose(),q&&(q instanceof Fe&&q.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(q.cubeRenderTarget),q.dispose()),X.panoPicture=null}}B.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=ht(M.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:ht(h.panoId),state:k(k(k(k({},ht(g.panoId)),{mode:this.mode}),je(this.camera.pose)),m),options:{},progress:this.locationMotion.progress,error:null}))}Vt(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof Fe&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=v.pano0)===null||u===void 0)&&u.luminanceMap&&v.pano0.luminanceMap instanceof Fe&&!v.pano0.luminanceMap.cubeRenderTarget&&(v.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((l=v.pano1)===null||l===void 0)&&l.map&&v.pano1.map instanceof Fe&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=v.pano1)===null||c===void 0)&&c.luminanceMap&&v.pano1.luminanceMap instanceof Fe&&!v.pano1.luminanceMap.cubeRenderTarget&&(v.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(v)),Vt(m)===!1&&this.setCamera(m);var W=this.works.getResolvedObserver(this.currentPano),J=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||b)for(var ve=0,re=Object.keys(this.panoMeshes);ve<re.length;ve++){var se=re[ve],ie=this.panoMeshes[se];ie.setOpacity(0),ie.setCurrent(!1),ie.updateTime&&ie.updateTime(e,r),ie.visible=!1}else if(W){var pe=nr(W.visibleIds,function(me){var Te=i.works.getResolvedObserver(me);return Te?W.standingPosition.distanceTo(Te.standingPosition):1/0},!0),ne=pe[1];ne=he(ne,2.5,1/0);for(var de=W.visibleIds.concat(Oe(this.currentPano)),ce=this.camera.getDirection(new d.Vector3),fe=0,$=Object.keys(this.panoMeshes);fe<$.length;fe++){var se=$[fe],ie=this.panoMeshes[se],te=this.works.getResolvedObserver(se);if(de.indexOf(se)===-1)ie.setCurrent(!1),ie.setOpacity(0);else if(!te)ie.setCurrent(!1),ie.setOpacity(0);else if(!te.loadable&&!te.active)ie.setCurrent(!1),ie.setOpacity(0);else{var j=ie.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ie.setCurrent(!ie.loading&&ie.progress===0&&J!==null&&J.panoId===se),ie.setOpacity(j<.01?0:he(ne/j*1.2,.4,.85));var Le=this.camera.position.clone().setY(ie.position.y),Ce=new d.Vector3().copy(ie.position).sub(Le).normalize();if(se===Oe(this.currentPano)){var ge=he((.5-Le.distanceTo(ie.position))/.5,0,1);Ce.multiplyScalar(1-ge).add(ce.clone().multiplyScalar(ge))}Ce.length()>0&&ie.quaternion.setFromEuler(new d.Euler(0,Math.atan2(Ce.x,Ce.z),0))}ie.updateTime&&ie.updateTime(e,r)}}var ke=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var me=i.renderer.getDrawingBufferSize(new d.Vector2);me.width*=i.scissor.width,me.height*=i.scissor.height;var Te=g.panoId,Ue=i.works.getResolvedObserver(Te),Ee=i.imageOptions.size;if(typeof Ee=="undefined"&&Ue){var Qe=Ue.images.up.match(/\/cube_(\d+)\//);Qe&&(Ee=Number(Qe[1]))}typeof Ee=="undefined"&&(Ee=2048);var Be=0;Ee>=1024&&(Be=1),Ee>=2048&&(Be=2),Ee>=4096&&(Be=3),Ee>=8192&&(Be=4);var Ge=i.tileLevelForFov(i.camera.fov,me);return Ge>Be?Ge:0}(),Ne=function(){var me=i.camera.quaternion.clone(),Te=i.works.getResolvedObserver(g.panoId),Ue=Te!=null?Te:W;Ue&&me.premultiply(Ue.quaternion.clone().inverse());var Ee=new d.Matrix4().makeRotationFromQuaternion(me),Qe=new d.Matrix4().getInverse(Ee),Be=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Qe));return Be}();g.panoId===Oe(this.currentPano)&&(((f=g.panoPicture)===null||f===void 0?void 0:f.map)instanceof Fe&&(g.panoPicture.map.update(Ne,ke),g.panoPicture.map.needsRender===!0&&(g.panoPicture.map.needsRender=!1,this.needsRender=!0)),((A=g.panoPicture)===null||A===void 0?void 0:A.luminanceMap)instanceof Fe&&(g.panoPicture.luminanceMap.update(Ne,ke),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,Ae=this.works.getResolvedObserver(We);Ae?Dn(this.camera.position,Ae.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==We&&this.tiling.cleanup(),this.tiling.panoId=We,this.tiling.setResource((y=(p=Ae.images)===null||p===void 0?void 0:p.tiles)!==null&&y!==void 0?y:[],this.enableIOSEDR&&Ae.images.luminance?Ae.images.luminance:null),this.tiling.setFetcher(ut(Ae.work)),this.tiling.setRotation(Ae.quaternion),this.tiling.setPosition(Ae.position),ke>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ne,ke,e):this.tiling.update(Ne,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 Kf(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(be())[1],r=this.locationMotion.getKeyFrameSegment(be())[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,l,c=(o=r.effect)!==null&&o!==void 0?o:"fly";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));var A=this.imageOptions.size;if(typeof A=="undefined"&&f){var p=f.images.up.match(/\/cube_(\d+)\//);p&&(A=Number(p[1]))}typeof A=="undefined"&&(A=2048);var y=this.imageOptions.transform,v=k({key:"pano.".concat(f.panoId)},gr(this.imageOptions,["format","size","quality","sharpen","mappings"])),m=f.images,h=(u=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(O){return O.size>A}))!==null&&u!==void 0?u:null,g=y,b={key:"pano_luminance.".concat(f.panoId),size:v.size?v.size/2:1024},w=this.enableIOSEDR&&f.images.luminance?f.images.luminance:null,E=function(){if(!f.images.tiles||!w)return null;var O=w.up.match(/\/cube_(\d+)\//),Q=O?Number(O[1]):!1;return Q===!1?null:h==null?void 0:h.map(function(N){return{level:N.level,size:Q,back:w.back,front:w.front,left:w.left,right:w.right,up:w.up,down:w.down}})}(),C="pano:"+Bn([m,v,y]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===C)return;var x=this.pendingTextureTask.panoId;(l=this.panoMeshes[x])===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var M="move-to-pano-"+f.panoId;this.pending.add(M);var S=this.models.getMaterial()||{},P=S.pano0,T=S.pano1,B;if(P&&P.map.name===C&&P.luminanceMap!==null===this.enableIOSEDR?B=P:(T==null?void 0:T.map.name)===C&&T.luminanceMap!==null===this.enableIOSEDR&&(B=T),B){var F={panoId:f.panoId,effect:c,panoPicture:{map:B.map,luminanceMap:B.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,vs)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};lt.shared.add(function(){a.pending.delete(M),a.doMoveToPano(f.pano,F,r)},!0,1);return}this.pendingTextureTask={panoId:f.panoId,hash:C,onLoad:function(O,Q){var N;if(a.pending.delete(M),a.destroyed)O.body.dispose();else{O.body.name=C;var H={panoId:f.panoId,effect:c,panoPicture:{map:O.body,luminanceMap:(N=Q==null?void 0:Q.body)!==null&&N!==void 0?N:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,vs)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,H,r)}},onError:function(O){a.pending.delete(M);var Q=k(k(k({},f.pano),{mode:a.mode}),je(a.camera.pose));a.emit("pano.error",_("pano.error",{error:O,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:Q})),a.emit("pano.cancel",_("pano.cancel",{error:O,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:Q})),a.emit("error",O),r.moveCancelCallback&&r.moveCancelCallback()}};var L=this.panoMeshes[f.panoId];L&&L.tap&&L.tap(),Promise.all([this.tileLevelForFov&&h&&h.length?this.textureLoader.loadTiledCubeTexture(m,h,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:y,options:v},minFilter:d.NearestFilter,magFilter:d.LinearFilter,generateMipmaps:!1,format:d.RGBAFormat,viaAjax:!0,fetcher:ut(f.work)},void 0,void 0,function(O){var Q,N;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:O,meta:null,pano:f.pano})),((Q=a.pendingTextureTask)===null||Q===void 0?void 0:Q.hash)===C&&((N=a.panoMeshes[f.panoId])===null||N===void 0||N.setProgress(O))},this.renderer):this.textureLoader.loadCubeTexture(m,{imageURL:{transform:y,options:v},format:d.RGBAFormat,viaAjax:!0,fetcher:ut(f.work)},void 0,void 0,function(O){var Q,N;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:O,meta:null,pano:f.pano})),((Q=a.pendingTextureTask)===null||Q===void 0?void 0:Q.hash)===C&&((N=a.panoMeshes[f.panoId])===null||N===void 0||N.setProgress(O))},this.renderer),w?this.tileLevelForFov&&E&&E.length?this.textureLoader.loadTiledCubeTexture(w,E,{tileImageSize:256,tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:g,options:b},minFilter:d.NearestFilter,magFilter:d.LinearFilter,generateMipmaps:!1,fetcher:ut(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):this.textureLoader.loadCubeTexture(w,{imageURL:{transform:g,options:b},fetcher:ut(f.work)},void 0,void 0,void 0,this.renderer).catch(function(){return null}):Promise.resolve(null)]).then(function(O){var Q,N,H=O[0],K=O[1];((Q=a.pendingTextureTask)===null||Q===void 0?void 0:Q.hash)===C?(a.pendingTextureTask.onLoad(H,K),(N=a.panoMeshes[f.panoId])===null||N===void 0||N.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:H.meta,pano:f.pano}))):(H.body.dispose(),K==null||K.body.dispose())}).catch(function(O){var Q,N;((Q=a.pendingTextureTask)===null||Q===void 0?void 0:Q.hash)===C&&(a.pendingTextureTask.onError(O),(N=a.panoMeshes[f.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:f.pano})),a.emit("error",O))}),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial,a=i.duration,o=i.effect,s=i.userAction;e.userAction=s;var u=t.initAnimationEndState(e),l={workCode:u.workCode,panoIndex:u.panoIndex},c={modelAlpha:0},f={perspToOrtho:0},A=!1;e.moveToPano(l,{longitude:u.longitude,latitude:u.latitude,fov:u.fov,effect:o,duration:a,moveStartCallback:function(p){A=!0,e.perspToOrthoMotion.set(f,a).catch(D),e.modelAlphaMotion.setKeyframes([{progress:0,value:k({},e.modelAlphaMotion.value)},{progress:.6,value:k({},e.modelAlphaMotion.value)},{progress:1,value:c}],a).catch(D),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=k(k(k({},l),{mode:e.mode}),je(e.camera.pose));A===!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()}},s)})},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var r=0,i=1;i<e.length;i++){var a=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,o=this.panoResourceFromLocationMotionKeyframe(e[i]).position,s=a.distanceTo(o)*(e[i].value.count-e[i-1].value.count);r+=s}return r},t.prototype.updatePanoMeshes=function(){for(var e=this,r={},i=Object.keys(this.panoMeshes),a=0,o=i;a<o.length;a++){var s=o[a],u=this.panoMeshes[s];r[s]=u,delete this.panoMeshes[s]}for(var l=1,c={},f=function(C){var x=nr(C.accessibleIds,function(S){var P=e.works.getResolvedObserver(S);if(!P)return 1/0;var T=P.standingPosition.distanceTo(C.standingPosition);return he(T,1,1/0)},!0),M=x[1];c[C.panoId]===void 0&&(c[C.panoId]=M)},A=0,p=this.works.resolvedObservers;A<p.length;A++){var y=p[A];f(y)}var v=Object.keys(c).map(function(C){return c[C]});if(v.length){var m=v.reduce(function(C,x){return C+x},0)/v.length;l=he(m*.6,1,3)}for(var h=0,g=this.works.resolvedObservers;h<g.length;h++){var y=g[h],u=void 0;r[y.panoId]?(u=r[y.panoId],u.loading===!0&&y.loadable===!1&&u.setLoading(!1),delete r[y.panoId]):(u=this.panoCircleMeshCreator(y.pano),u.name="PanoCircleMesh_"+y.panoId,this.helper.add(u)),u.scale.set(l,1,l),u.position.copy(y.standingPosition),this.panoMeshes[y.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,l,c,f,A,p,y,v,m;i===void 0&&(i={});var h=be(),g=wt();this.tiling.cleanup(),this.panoResources[g]=r;var b=1,w,E,C;if(this.locationMotion.ended){var x=this.locationMotion.getKeyFrameSegment(h);x[0];var M=x[1],S=this.locationMotion.value,P=((o=this.panoResourceFromLocationMotionKeyframe(M))!==null&&o!==void 0?o:this.camera).position,T=r.position;w=Math.max(P.distanceTo(T),b),E=[{key:M.key,progress:0,value:k(k({},S),{count:0})},{key:g,progress:1,value:{distance:0,count:1}}],C=0}else{var B=this.locationMotion.getKeyFrameSegment(h),F=B[0],M=B[1],S=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(F).position,P=this.panoResourceFromLocationMotionKeyframe(M).position,T=r.position,O=M.value.count-S.count,Q=Math.max(L.distanceTo(P),b)*O,N=Math.max(P.distanceTo(T),b);w=Q+N,E=[{key:F.key,progress:0,value:k({},S)},{key:M.key,progress:Q/w,value:M.value},{key:g,progress:1,value:{count:M.value.count+1,distance:0}}];var H=this.locationMotionKeyframesLength(this.locationMotion.keyframes),K=this.locationMotionKeyframesLength(E);H===0||H===0?C=0:C=this.locationMotion.getProgressVelocity(h)*H/K}var U=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?w:0),G={longitude:i.longitude,latitude:i.latitude,fov:i.fov},X=k(k({},e),{mode:this.mode,longitude:(s=G.longitude)!==null&&s!==void 0?s:this.camera.pose.longitude,latitude:(u=G.latitude)!==null&&u!==void 0?u:this.camera.pose.latitude,fov:(l=G.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),Z=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:Z,progress:0,state:X,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(X),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=D,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null);var q=kt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),W=kt({longitude:(c=G.longitude)!==null&&c!==void 0?c:this.cameraMotion.value.longitude,latitude:(f=G.latitude)!==null&&f!==void 0?f:this.cameraMotion.value.latitude}),J=new d.Object3D;J.lookAt(q);var ve=new d.Matrix4().makeRotationFromQuaternion(J.quaternion);J.lookAt(W);for(var re=new d.Matrix4().makeRotationFromQuaternion(J.quaternion),se=new d.Matrix4().getInverse(ve).premultiply(re),ie=0;ie<E.length-1;ie++){var pe=E[ie].key;if(pe){var ne=this.panoResources[pe];ne&&ne.fixCameraTransform.copy(se)}}r.effect==="fly"?this.cameraMotion.set(G,U).catch(D):this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(A=G.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(p=G.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:1,value:{longitude:(y=G.longitude)!==null&&y!==void 0?y:this.cameraMotion.value.longitude,latitude:(v=G.latitude)!==null&&v!==void 0?v:this.cameraMotion.value.latitude,fov:(m=G.fov)!==null&&m!==void 0?m:this.cameraMotion.value.fov}}],U).catch(D);var de=this.locationMotion.setKeyframes(E,U,C);de.then(function(){var ce,fe,$=k(k({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:a.camera.pose.distance});a.emit("pano.arrived",_("pano.arrived",{options:i,prevPano:Z,progress:1,state:$,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback($);var te=a.works.getResolvedObserver(e);if(te&&te.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var j=sh.clone().multiply((fe=(ce=a.models.getMaterial().pano1)===null||ce===void 0?void 0:ce.matrix)!==null&&fe!==void 0?fe:new d.Matrix4).multiply(te.video.matrix),Le={map:a.videoTexture,size:te.video.size,matrix:j,alpha:1},Ce=wt(),ge=a.videoTexture.image;ge.setAttribute("uuid",Ce),Xu().then(function(ke){ke&&te.video&&ge.getAttribute("uuid")===Ce&&(ge.oncanplay=function(){ge.oncanplay=D,ge.play()},ge.ontimeupdate=function(){ge.currentTime>.5&&(ge.ontimeupdate=D,a.panoVideo.setMaterial(Le))},ge.src=te.video.source)}).catch(function(){ge.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:Z,progress:0,state:X,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.works.getResolvedObserver(this.currentPano);if(!i)return null;var a=e!=null?e:new d.Raycaster(this.camera.position.clone(),this.camera.getDirection(new d.Vector3));a.params.Points={threshold:.1};var o=i.standingPosition.clone();if(i.position.distanceTo(a.ray.origin)>1){var s=this.models.intersectRaycaster(new d.Raycaster(a.ray.origin,new d.Vector3(0,-1,0)))[0];s&&s.distance<=2?o.copy(s.point):o.copy(a.ray.origin).add(new d.Vector3(0,-1.5,0))}var u=this.models.intersectRaycaster(a)[0],l=u?u.point:a.ray.origin.clone().add(a.ray.direction.clone().normalize().multiplyScalar(3)),c=l.clone().sub(o).normalize();if(c.length()===0)return null;for(var f=i.accessibleIds.filter(function(E){if(E===Oe(r.currentPano))return!1;var C=r.works.getResolvedObserver(E);if(!C)return!1;var x=C.standingPosition.clone().project(r.camera);return Math.abs(x.z)>1||Math.abs(x.x)>1||Math.abs(x.y)>1?!1:C.loadable||C.active}),A=f.slice().sort(function(E,C){var x=r.works.getResolvedObserver(E).standingPosition.clone().distanceTo(o),M=r.works.getResolvedObserver(C).standingPosition.clone().distanceTo(o);return x-M}),p=0,y=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];p<y.length;p++)for(var v=y[p],m=0,h=A;m<h.length;m++){var g=h[m],b=this.works.getResolvedObserver(g);if(b){var w=b.standingPosition.clone().sub(o);if(w&&w.length()!==0&&c.angleTo(w)<v)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!==Oe(this.currentPano))return}var o=e.center.raycaster,s=this.camera.getDirection(new d.Vector3).setY(0),u=null,l=this.works.getResolvedObserver(this.currentPano);if(l){var c=l.accessibleIds.filter(function(K){if(K===Oe(r.currentPano))return!1;var U=r.works.getResolvedObserver(K);return!U||U.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:U.loadable||U.active}),f=this.models.intersectRaycaster(o)[0];if(f){var A=nr(c,function(K){var U=r.works.getResolvedObserver(K);if(!U)return 1/0;var G=U.standingPosition.clone();return G.distanceTo(f.point)},!0),p=A[0],y=A[1];p&&y<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(p))!==null&&i!==void 0?i:null)}u||(u=this.getForwardObserverOrNot(o));for(var v=0,m=this.locationMotion.keyframes;v<m.length;v++){var h=m[v],g=this.panoResourceFromLocationMotionKeyframe(h);if(!(h.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,C=u.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),x=[],M=[],S=[],P=0,T=u.accessibleIds;P<T.length;P++){var p=T[P],B=ht(p);if(!(qt(B,this.currentPano)||qt(B,u.pano))){var F=this.works.getResolvedObserver(p);if(F){var L=F.position.clone().sub(u.position).setY(0);C.angleTo(L)<w&&S.push(L)}}}var O=S.length>0?S:pt(pt([],x,!0),M,!0),Q=O.slice().sort(function(K,U){return K.angleTo(C)-U.angleTo(C)})[0];Q&&Q.angleTo(s)>E&&(b.longitude=Math.atan2(-Q.x,-Q.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(b.latitude=he(0,this.minLatitude,this.maxLatitude));var N=k({},e.state);if(N.workCode=u.pano.workCode,N.panoIndex=u.pano.panoIndex,b.longitude!==void 0&&(N.longitude=b.longitude),b.latitude!==void 0&&(N.latitude=b.latitude),b.fov!==void 0&&(N.fov=b.fov),N.distance=0,N.offset=u.position.clone(),e.state=N,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:N,userAction:e.userAction,options:b,progress:0,error:null})),u&&!u.active){var H=u.panoId;this.panoMeshes[H]&&(this.panoMeshes[H].setDisabled(!1),this.panoMeshes[H].setLoading(!0))}u&&u.active&&this.emit("pano.request",_("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:N,options:b,error:null}))}}}}},t}(Wu),dr=Math.PI/180,rn=180/Math.PI,Zu=.001,Yu=1,Fn=function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}}(),uh=function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}}(),lh=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}}(),Ju=function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}}(),ch=function(){var n=!1;if(Ju()===65){var t=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var e=t[1].split(".");e[0],e[1];var r=e[2],i=e[3];n=parseInt(r,10)===3325&&parseInt(i,10)<148}}return function(){return n}}(),dh=function(){var n=Fn()&&uh()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}}(),$u=function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}}();function ms(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return $u()?!n:n}function fh(n){return!(isNaN(n)||n<=Zu||n>Yu)}function hh(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var gs=function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}}();function ys(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 ph(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=ys(document.referrer),e=ys(window.location.href);return n&&t!==e}var bs=function(){function n(r,i,a){var o=i?i[0]:0,s=i?i[1]:0,u=i?i[2]:0,l=i?i[3]:1,c=o+o,f=s+s,A=u+u,p=o*c,y=o*f,v=o*A,m=s*f,h=s*A,g=u*A,b=l*c,w=l*f,E=l*A;return r[0]=1-(m+g),r[1]=y+E,r[2]=v-w,r[3]=0,r[4]=y-E,r[5]=1-(p+g),r[6]=h+b,r[7]=0,r[8]=v+w,r[9]=h-b,r[10]=1-(p+m),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],l,c,f,A,p,y,v,m,h,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]):(l=i[0],c=i[1],f=i[2],A=i[3],p=i[4],y=i[5],v=i[6],m=i[7],h=i[8],g=i[9],b=i[10],w=i[11],r[0]=l,r[1]=c,r[2]=f,r[3]=A,r[4]=p,r[5]=y,r[6]=v,r[7]=m,r[8]=h,r[9]=g,r[10]=b,r[11]=w,r[12]=l*o+p*s+h*u+i[12],r[13]=c*o+y*s+g*u+i[13],r[14]=f*o+v*s+b*u+i[14],r[15]=A*o+m*s+w*u+i[15]),r}function e(r,i){var a=i[0],o=i[1],s=i[2],u=i[3],l=i[4],c=i[5],f=i[6],A=i[7],p=i[8],y=i[9],v=i[10],m=i[11],h=i[12],g=i[13],b=i[14],w=i[15],E=a*c-o*l,C=a*f-s*l,x=a*A-u*l,M=o*f-s*c,S=o*A-u*c,P=s*A-u*f,T=p*g-y*h,B=p*b-v*h,F=p*w-m*h,L=y*b-v*g,O=y*w-m*g,Q=v*w-m*b,N=E*Q-C*O+x*L+M*F-S*B+P*T;return N?(N=1/N,r[0]=(c*Q-f*O+A*L)*N,r[1]=(s*O-o*Q-u*L)*N,r[2]=(g*P-b*S+w*M)*N,r[3]=(v*S-y*P-m*M)*N,r[4]=(f*F-l*Q-A*B)*N,r[5]=(a*Q-s*F+u*B)*N,r[6]=(b*x-h*P-w*C)*N,r[7]=(p*P-v*x+m*C)*N,r[8]=(l*O-c*F+A*T)*N,r[9]=(o*F-a*O-u*T)*N,r[10]=(h*S-g*x+w*E)*N,r[11]=(y*x-p*S-m*E)*N,r[12]=(c*B-l*L-f*T)*N,r[13]=(a*L-o*B+s*T)*N,r[14]=(g*C-h*M-b*E)*N,r[15]=(p*M-y*C+v*E)*N,r):null}return function(r,i,a){n(r,i),a&&t(r,r,a),e(r,r)}}(),Yi=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}(),vh=function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new Yi,this.currentGyroMeasurement=new Yi,this.previousGyroMeasurement=new Yi,Fn()?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;fh(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)",rn*hh(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}(),Ah=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<dr*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(rn*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}(),mh=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}(),gh=function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n}(),ws=function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n}(),yh=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 vh(t,i),this.posePredictor=new Ah(e,i),this.isFirefoxAndroid=lh(),this.isIOS=Fn();var a=Ju();this.isDeviceMotionInRadians=!this.isIOS&&a!==null&&a<66,this.isWithoutDeviceMotion=ch()||dh(),this.filterToWorldQ=new d.Quaternion,Fn()?this.filterToWorldQ.setFromAxisAngle(new d.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new d.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new d.Quaternion,this.worldToScreenQ=new d.Quaternion,this.originalPoseAdjustQ=new d.Quaternion;var o=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new d.Vector3(0,0,1),o),this.setScreenTransform_(),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!="undefined"&&window.orientation===-90?o.setFromAxisAngle(new d.Vector3(0,1,0),Math.PI/-2):o.setFromAxisAngle(new d.Vector3(0,1,0),Math.PI/2),a.multiply(o)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||function(){var a=new d.Quaternion;return a.setFromAxisAngle(new d.Vector3(1,0,0),-Math.PI/2),a}(),t=this._deviceOrientationQ;var e=new d.Quaternion;return e.copy(t),e.multiply(this.deviceOrientationFilterToWorldQ),e.multiply(this.resetQ),e.multiply(this.worldToScreenQ),e.multiplyQuaternions(this.deviceOrientationFixQ,e),this.yawOnly&&(e.x=0,e.z=0,e.normalize()),this.orientationOut_[0]=e.x,this.orientationOut_[1]=e.y,this.orientationOut_[2]=e.z,this.orientationOut_[3]=e.w,this.orientationOut_}else{var r=this.filter.getOrientation();t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS)}var i=new d.Quaternion;return i.copy(this.filterToWorldQ),i.multiply(this.resetQ),i.multiply(t),i.multiply(this.worldToScreenQ),this.yawOnly&&(i.x=0,i.z=0,i.normalize()),this.orientationOut_[0]=i.x,this.orientationOut_[1]=i.y,this.orientationOut_[2]=i.z,this.orientationOut_[3]=i.w,this.orientationOut_},n.prototype.getPose=function(){var t=new gh;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),bs(t.leftViewMatrix,e,r.left),bs(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window=="undefined")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),i=this.onDeviceOrientation_.bind(this);return Fn()&&ph()&&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*dr,o=t.left.downDegrees*dr,s=t.left.leftDegrees*dr,u=t.left.rightDegrees*dr,l=2/(s+u),c=2/(a+o);i.left[0]=l,i.left[1]=0,i.left[2]=0,i.left[3]=0,i.left[4]=0,i.left[5]=c,i.left[6]=0,i.left[7]=0,i.left[8]=-((s-u)*l*.5),i.left[9]=(a-o)*c*.5,i.left[10]=r/(e-r),i.left[11]=-1,i.left[12]=0,i.left[13]=0,i.left[14]=r*e/(e-r),i.left[15]=0}{var a=t.right.upDegrees*dr,o=t.right.downDegrees*dr,s=t.right.leftDegrees*dr,u=t.right.rightDegrees*dr,l=2/(s+u),c=2/(a+o);i.right[0]=l,i.right[1]=0,i.right[2]=0,i.right[3]=0,i.right[4]=0,i.right[5]=c,i.right[6]=0,i.right[7]=0,i.right[8]=-((s-u)*l*.5),i.right[9]=(a-o)*c*.5,i.right[10]=r/(e-r),i.right[11]=-1,i.right[12]=0,i.right[13]=0,i.right[14]=r*e/(e-r),i.right[15]=0}return i},n.prototype.getEyeFieldOfView=function(){var t=this.viewer,e=this.device,r=new mh(t.distortionCoefficients),i=t.screenLensDistance,a=(e.widthMeters-t.interLensDistance)/2,o=t.interLensDistance/2,s=t.baselineLensDistance-e.bevelMeters,u=e.heightMeters-s,l=rn*Math.atan(r.distort(a/i)),c=rn*Math.atan(r.distort(o/i)),f=rn*Math.atan(r.distort(s/i)),A=rn*Math.atan(r.distort(u/i)),p=new ws,y=new ws;return p.leftDegrees=Math.min(l,t.fov),p.rightDegrees=Math.min(c,t.fov),p.downDegrees=Math.min(f,t.fov),p.upDegrees=Math.min(A,t.fov),y.leftDegrees=p.rightDegrees,y.rightDegrees=p.leftDegrees,y.upDegrees=p.upDegrees,y.downDegrees=p.downDegrees,{left:p,right:y}},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){gs("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=i;return}else if(a<=Zu||a>Yu){gs("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&&($u()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,i)),this.filter.addAccelMeasurement(this.accelerometer,i)),this.previousTimestampS=i},n.prototype.onOrientationChange_=function(){this.setScreenTransform_()},n.prototype.onMessage_=function(t){var e=t.data;if(!(!e||!e.type)){var r=e.type.toLowerCase();r==="devicemotion"&&this.updateDeviceMotion_(e.deviceMotionEvent)}},n.prototype.setScreenTransform_=function(){this.worldToScreenQ.set(0,0,0,1);var t=typeof window!="undefined"?window.orientation:0;switch(t){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new d.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new d.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n}(),Yn=[0,0,.5,1],Jn=[.5,0,.5,1],bh=function(){function n(t){var e=this;this.renderer=t,this.sensor=new yh(.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*Yn[0]),y:Math.round(r.height*Yn[1]),width:Math.round(r.width*Yn[2]),height:Math.round(r.height*Yn[3])},o={x:Math.round(r.width*Jn[0]),y:Math.round(r.height*Jn[1]),width:Math.round(r.width*Jn[2]),height:Math.round(r.height*Jn[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 wh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExM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4C/UAO/k6hKwBptJgn8fgmVckgFXML9YEEFLUKMvlqAp0eWyDEAL65dLqyWo6RekTZ2XNCsD6rgpTK/4p3WcrrPH1ghWJGhONC3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var Ji,$i={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},Es=typeof navigator!="undefined"&&(Ji=$i[navigator.language.split("-")[0]])!==null&&Ji!==void 0?Ji:$i.zh,xh=`
1450
1450
  <style>
1451
1451
  .$id {
1452
1452
  all: initial;
@@ -1529,7 +1529,7 @@ void main() {
1529
1529
  .$id-modal-content-guide-cardboard-image {
1530
1530
  width: 100px;
1531
1531
  height: 82px;
1532
- background-image: url(`.concat(Eh,`);
1532
+ background-image: url(`.concat(wh,`);
1533
1533
  background-size: 100%;
1534
1534
  background-repeat: no-repeat;
1535
1535
  }
@@ -1571,7 +1571,7 @@ void main() {
1571
1571
  .$id-modal-content-guide-phone-image {
1572
1572
  width: 58px;
1573
1573
  height: 56px;
1574
- background-image: url(`).concat(Mh,`);
1574
+ background-image: url(`).concat(Eh,`);
1575
1575
  background-size: 100%;
1576
1576
  background-repeat: no-repeat;
1577
1577
  }
@@ -1648,8 +1648,8 @@ Z
1648
1648
  </div>
1649
1649
  </div>
1650
1650
  <div class="$id-modal-content">
1651
- <div class="$id-modal-content-title">`).concat(Ms.TITLE,`</div>
1652
- <div class="$id-modal-content-hit">`).concat(Ms.HIT,`</div>
1651
+ <div class="$id-modal-content-title">`).concat(Es.TITLE,`</div>
1652
+ <div class="$id-modal-content-hit">`).concat(Es.HIT,`</div>
1653
1653
  <div class="$id-modal-content-guide">
1654
1654
  <div class="$id-modal-content-guide-phone">
1655
1655
  <div class="$id-modal-content-guide-phone-move-x">
@@ -1707,13 +1707,13 @@ Z
1707
1707
  </svg>
1708
1708
  </div>
1709
1709
  </div>
1710
- `);function Sh(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 Ch.replace(/\n/g," ").replace(/\ +/g," ").replace(/\$id/g,n).replace(/(\d+)px/g,function(u,c){return s(Number(c))})}function Ih(){var n="five_vr_helper_"+ht(),t=Sh(n),e=document.createElement("div");return e.className=n,e.innerHTML=t,e}var ra=new d.CircleBufferGeometry(.12,16),Th=`
1710
+ `);function Ch(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 xh.replace(/\n/g," ").replace(/\ +/g," ").replace(/\$id/g,n).replace(/(\d+)px/g,function(u,l){return s(Number(l))})}function Mh(){var n="five_vr_helper_"+wt(),t=Ch(n),e=document.createElement("div");return e.className=n,e.innerHTML=t,e}var ea=new d.CircleBufferGeometry(.12,16),Sh=`
1711
1711
  varying vec2 vUv;
1712
1712
  void main() {
1713
1713
  vUv = uv;
1714
1714
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
1715
1715
  }
1716
- `,Ph=`
1716
+ `,Ih=`
1717
1717
  uniform float circleScale;
1718
1718
  uniform float circleFade;
1719
1719
  uniform float circleOpacity;
@@ -1769,13 +1769,13 @@ void main() {
1769
1769
 
1770
1770
  gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);
1771
1771
  }
1772
- `,Bh=`
1772
+ `,Th=`
1773
1773
  varying vec2 vUv;
1774
1774
  void main() {
1775
1775
  vUv = uv;
1776
1776
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
1777
1777
  }
1778
- `,Rh=`
1778
+ `,Ph=`
1779
1779
  varying vec2 vUv;
1780
1780
  uniform float opacity;
1781
1781
 
@@ -1797,16 +1797,8 @@ void main() {
1797
1797
 
1798
1798
  gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity * outside * inside);
1799
1799
  }
1800
- `,Fh=function(n){oe(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(ra,new d.MeshBasicMaterial(F(F({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new d.Mesh(ra,new d.ShaderMaterial(F(F({},r),{vertexShader:Bh,fragmentShader:Rh,uniforms:{opacity:{value:0}}}))),e.panoMesh=new d.Mesh(ra,new d.ShaderMaterial(F(F({},r),{vertexShader:Th,fragmentShader:Ph,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=ae(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:F({},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),kh=1500,Lh=function(n){oe(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new xh(r.renderer);var a=Ih();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",K("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=F(F({},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 F(F({},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(Re(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 Fh;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={},v={};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(ae(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var p=this.locationMotion.getKeyFrameSegment(e),m=p[0],A=p[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,x=f.position,E=this.locationMotion.value.count-A.value.count+1;h.useBlackTransition=f.effect==="instant",f.panoPicture&&(E<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(x)),h.progress=E,v.distance=this.locationMotion.value.distance,v.offset=new d.Vector3(w.x+(x.x-w.x)*E,w.y+(x.y-w.y)*E,w.z+(x.z-w.z)*E);for(var M=[],C=[],S=0,P=this.locationMotion.keyframes;S<P.length;S++){var I=P[S],B=I.key,L=I.progress;B!==void 0&&(M.push(B),L>=this.locationMotion.progress&&C.push(B))}for(var k=0,O=Object.keys(this.panoResources);k<O.length;k++){var N=O[k];if(!(C.indexOf(N)>=0)){var D=this.panoResources[N];if(D.panoPicture){var H=D.panoPicture.map;if(H){if(H===((i=h.pano0)===null||i===void 0?void 0:i.map)||H===((a=h.pano1)===null||a===void 0?void 0:a.map))continue;H.dispose(),D.panoPicture=null}}M.indexOf(N)>=0||delete this.panoResources[N]}}this.currentPano=We(f.panoId),this.emit("pano.moving",K("pano.moving",{userAction:this.userAction,prevPano:We(g.panoId),state:F(F(F(F({},We(b.panoId)),{mode:this.mode}),Ve(this.camera.pose)),v),options:{},progress:this.locationMotion.progress,error:null}))}Et(h)===!1&&(!((o=h.pano0)===null||o===void 0)&&o.map&&h.pano0.map instanceof Le&&!h.pano0.map.cubeRenderTarget&&(h.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((s=h.pano0)===null||s===void 0)&&s.luminanceMap&&h.pano0.luminanceMap instanceof Le&&!h.pano0.luminanceMap.cubeRenderTarget&&(h.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((u=h.pano1)===null||u===void 0)&&u.map&&h.pano1.map instanceof Le&&!h.pano1.map.cubeRenderTarget&&(h.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=h.pano1)===null||c===void 0)&&c.luminanceMap&&h.pano1.luminanceMap instanceof Le&&!h.pano1.luminanceMap.cubeRenderTarget&&(h.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(h)),v.offset&&this.camera.position.copy(v.offset),Tt(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 q=this.works.getResolvedObserver(this.currentPano);if(q)for(var j=q.visibleIds.concat(Re(this.currentPano)),_=0,Z=j;_<Z.length;_++){var W=Z[_],Y=We(W),ce=this.works.getResolvedObserver(Y);if(ce){var te=this.panoMeshes[W];if(!ce.loadable&&!ce.active){te.setOpacity(0);continue}var se=te.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);se<.05?te.setOpacity(0):te.setOpacity(ae(1.5/se,0,1)),Tt(this.currentPano,Y)&&te.setOpacity(0),te.lookAt(this.camera.position)}}for(var ue=this.intersect(e),pe=0,he=this.works.resolvedObservers;pe<he.length;pe++){var ce=he[pe],te=this.panoMeshes[ce.panoId];te&&(te.setCurrent(te===ue),te.updateTime&&te.updateTime(e,r))}(z!==this.camera.pose.longitude||U!==this.camera.pose.latitude)&&(this.cameraMotion.set(nr(this.camera.pose,["longitude","latitude"]),0).catch(Q),this.emit("camera.update",K("camera.update",{userAction:!0,state:F(F(F({},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>kh){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(We(s),{},!0),delete this.activePanoMesh,delete this.activeTime,a}var h=this.camera.getDirection(new d.Vector3),v=new d.Raycaster(this.camera.position,h);v.params.Points={threshold:.1};for(var p=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=v.intersectObject((r=b.hitTestMesh)!==null&&r!==void 0?r:b,!0)[0];w&&m.push({panoMesh:b,intersection:F({floor:(i=A==null?void 0:A.floorIndex)!==null&&i!==void 0?i:0},w)})}var x=m.sort(function(I,B){return I.intersection.distance-B.intersection.distance})[0];x?(p=x.intersection,this.activePanoMesh!==x.panoMesh&&(this.activePanoMesh=x.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(x.panoMesh.position),this.intersectMesh.lookAt(this.camera.position),this.intersectMesh.visible=!1):(this.activePanoMesh=void 0,this.activeTime=void 0),p||(p=this.models.intersectRaycaster(v)[0]);var E=K("intersect.update",{raycaster:v,intersection:p!=null?p:null,object:this.intersectMesh});if(this.emit("intersect.update",E),E.defaultPrevented){this.hideIntersectMesh();return}if(p&&p.face){var M=p.face.normal,C=new d.Quaternion;C.setFromUnitVectors(new d.Vector3(0,0,1),M),this.intersectMesh.quaternion.copy(C);var S=M.clone().multiplyScalar(.05),P=p.point.clone().add(S);this.intersectMesh.position.copy(P),this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return x==null?void 0:x.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(Ja),Oh=new d.Vector3(0,1.6,0),Vh=function(n){oe(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,v=h.state,p=h.currentState,m=typeof v.panoIndex=="number"?{workCode:(a=(r=v.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:v.panoIndex}:{workCode:p.workCode,panoIndex:p.panoIndex},A=l.getResolvedObserver(m),y=(o=v.longitude)!==null&&o!==void 0?o:p.longitude,f=ae((s=v.latitude)!==null&&s!==void 0?s:!A||Nn(p.mode)?p.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),g=ae((u=v.fov)!==null&&u!==void 0?u:!A||Nn(p.mode)?p.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=Tr(p).setLength(p.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(F(F({},this),{initial:{currentState:F(F({},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(ae(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=Pt(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),Et(i)||this.models.setMaterial(i),Et(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",K("initAnimation.start",{state:h,userAction:e.userAction}))},moveEndCallback:function(h){e.emit("initAnimation.end",K("initAnimation.end",{state:h,userAction:e.userAction})),r()},moveCancelCallback:function(){var h=e.currentPano,v=F(F({},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",K("initAnimation.end",{state:v,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 F(F({},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),v=this.locationMotion.getProgressVelocity(c),p=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,x=b.y,E=b.z;p+=Math.sqrt(Math.pow(w-y,2)+Math.pow(x-f,2)+Math.pow(E-g,2))}var M=h===0?0:v*p/h,C=this.calculateMovingDuration(r.duration,h),S={x:e.x,y:e.y,z:e.z,distance:0},P={longitude:r.longitude,latitude:r.latitude,fov:r.fov},I=this.works.resolvedObservers,B=Pt(I,function(N){return N.position.distanceTo(l)}),L=B?{workCode:B.work.workCode,panoIndex:B.panoIndex}:{workCode:"",panoIndex:0},k=F(F({},L),{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}),O=this.currentPano;this.emit("pano.moveTo",K("pano.moveTo",{options:r,prevPano:O,progress:0,state:k,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(k),this.cameraMotion.set(P,C).catch(Q),this.locationMotion.set(S,C,M).then(function(){var N=F(F(F({},L),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.arrived",K("pano.arrived",{options:r,prevPano:O,progress:0,state:N,userAction:a.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(N)},function(){r.moveCancelCallback&&r.moveCancelCallback(),a.emit("pano.cancel",K("pano.cancel",{options:r,prevPano:O,progress:0,state:k,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(Oh),c=this.works.resolvedObservers,l=Pt(c,function(p){return p.position.distanceTo(u)},!0),h=l[0],v=l[1];h&&v<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}(Xa);const Nh=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-
1801
- --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-
1802
- --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-
1803
- ----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-
1804
- ----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
1805
- ------qvn{pr-J-pnyrH----\fryr
1806
- ------qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;\x07H----\f--\f-ryr-
1807
- ----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`),Qh=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-
1808
- --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 Dh=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),Uh=new d.SphereBufferGeometry(.01,128,128);function zh(n,t,e,r){var i=new d.ShaderMaterial({side:d.BackSide,vertexShader:Nh,fragmentShader:Qh,transparent:!0,uniforms:d.UniformsUtils.clone(Dh)}),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(Uh,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 Gh=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,v){u[v]=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 v=h[0],p=h[1],m=zh(v.body,p.body,r.position,r.matrix),A=rt([v.meta],p.meta,!0),y={body:m,meta:A};return i(y),y}).catch(function(h){for(var v=0,p=l;v<p.length;v++){var m=p[v];m.then(function(A){return A.body.dispose()}).catch(Q)}return a(h),Promise.reject(h)})},n}(),Hh=new d.Vector3(-1,1,1),qh=function(n){oe(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=ht()]={panoId:Re(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 Gh,r}return t.parseArgs=function(e){var r,i,a;if(e instanceof t)return e;var o=n.parseArgs.call(this,e);return F(F({},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 ja}})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return F(F({},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:{},v=h.pano0,p=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!==(v==null?void 0:v.map)&&f.panoModel.material.uniforms.panoMap.value!==(p==null?void 0:p.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(F(F({},this),{initial:{currentState:F(F({},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(ae(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var v=this.locationMotion.getKeyFrameSegment(e),p=v[0],m=v[1],A=this.panoResourceFromLocationMotionKeyframe(p),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,x=this.panoModelGroup.children;w<x.length;w++){var E=x[w];E.visible=E===A.panoModel||E===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=[],S=0,P=this.locationMotion.keyframes;S<P.length;S++){var I=P[S],B=I.key,L=I.progress;B!==void 0&&(M.push(B),L>=this.locationMotion.progress&&C.push(B))}for(var k=0,O=Object.keys(this.panoResources);k<O.length;k++){var N=O[k];if(!(C.indexOf(N)>=0)){var D=this.panoResources[N];if(D.panoModel){if(D.panoModel.material.uniforms.panoMap.value===((a=s.pano0)===null||a===void 0?void 0:a.map)||D.panoModel.material.uniforms.panoMap.value===((o=s.pano1)===null||o===void 0?void 0:o.map))continue;this.panoModelGroup.remove(D.panoModel),D.panoModel.material.uniforms.panoMap.value.dispose(),D.panoModel.dispose(),delete D.panoModel}M.indexOf(N)>=0||delete this.panoResources[N]}}this.currentPano=We(y.panoId),this.emit("pano.moving",K("pano.moving",{userAction:this.userAction,prevPano:We(c.panoId),state:F(F(F(F({},We(l.panoId)),{mode:this.mode}),Ve(this.camera.pose)),u),options:{},progress:this.locationMotion.progress,error:null}))}Et(s)===!1&&this.models.setMaterial(s),Et(u)===!1&&this.setCamera(u);var H=this.works.getResolvedObserver(this.currentPano),z=this.locationMotion.ended?this.getForwardObserverOrNot():null;if(this.camera.pose.distance>.1||h){if(H)for(var U=0,q=Object.keys(this.panoMeshes);U<q.length;U++){var j=q[U],_=this.panoMeshes[j];_.setOpacity(0),_.setCurrent(!1),_.updateTime&&_.updateTime(e,r)}}else if(H){var Z=Pt(H.visibleIds,function(fe){var Se=i.works.getResolvedObserver(fe);return Se?H.standingPosition.distanceTo(Se.standingPosition):1/0},!0),W=Z[1];W=ae(W,2.5,1/0);for(var Y=H.visibleIds.concat(Re(this.currentPano)),ce=this.camera.getDirection(new d.Vector3),te=0,se=Object.keys(this.panoMeshes);te<se.length;te++){var j=se[te],_=this.panoMeshes[j],ue=this.works.getResolvedObserver(j);if(Y.indexOf(j)===-1)_.setCurrent(!1),_.setOpacity(0);else if(!ue)_.setCurrent(!1),_.setOpacity(0);else if(!ue.loadable&&!ue.active)_.setCurrent(!1),_.setOpacity(0);else{var pe=_.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);_.setCurrent(!_.loading&&_.progress===0&&z!==null&&z.panoId===j),_.setOpacity(pe<.01?0:ae(W/pe*1.2,.4,.85));var he=this.camera.position.clone().setY(_.position.y),de=new d.Vector3().copy(_.position).sub(he).normalize();if(j===Re(this.currentPano)){var be=ae((.5-he.distanceTo(_.position))/.5,0,1);de.multiplyScalar(1-be).add(ce.clone().multiplyScalar(be))}de.length()>0&&_.quaternion.setFromEuler(new d.Euler(0,Math.atan2(de.x,de.z),0))}_.updateTime&&_.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=F({key:"pano.".concat(s.panoId)},nr(this.imageOptions,["format","size","quality","sharpen","mappings"])),l=this.imageOptions.transform,h=s.images,v=s.position,p=s.quaternion,m=new d.Matrix4().compose(v,p,new d.Vector3(-1,1,1)),A="pano:"+dn(h);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===A)return;var y=this.pendingTextureTask.panoId,f=We(y);(o=this.panoMeshes[y])===null||o===void 0||o.setProgress(0),this.emit("pano.texture.abort",K("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 x=F(F(F({},s.pano),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.error",K("pano.error",{error:w,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:x})),a.emit("pano.cancel",K("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:x})),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:v,matrix:m,fetcher:dt(s.work)},function(w){var x,E;((x=a.pendingTextureTask)===null||x===void 0?void 0:x.hash)===A?(a.pendingTextureTask.onLoad(w),(E=a.panoMeshes[s.panoId])===null||E===void 0||E.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",K("pano.texture.success",{error:null,progress:1,meta:w.meta,pano:s.pano}))):w.body.dispose()},function(w){var x,E;((x=a.pendingTextureTask)===null||x===void 0?void 0:x.hash)===A&&(a.pendingTextureTask.onError(w),(E=a.panoMeshes[s.panoId])===null||E===void 0||E.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",K("pano.texture.error",{error:w,progress:0,meta:null,pano:s.pano})),a.emit("error",w))},function(w){var x,E;a.emit("pano.texture.progress",K("pano.texture.progress",{error:null,progress:w,meta:null,pano:s.pano})),((x=a.pendingTextureTask)===null||x===void 0?void 0:x.hash)===A&&((E=a.panoMeshes[s.panoId])===null||E===void 0||E.setProgress(w))},this.renderer),this.emit("pano.texture.load",K("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(v){c=!0,e.perspToOrthoMotion.set(h,a).catch(Q),e.modelAlphaMotion.set(l,a).catch(Q),e.emit("initAnimation.start",K("initAnimation.start",{state:v,userAction:o}))},moveEndCallback:function(v){e.emit("initAnimation.end",K("initAnimation.end",{state:v,userAction:e.userAction})),r()},moveCancelCallback:function(){var v=F(F(F({},u),{mode:e.mode}),Ve(e.camera.pose));c===!1&&e.emit("initAnimation.start",K("initAnimation.start",{state:v,userAction:e.userAction})),e.emit("initAnimation.end",K("initAnimation.end",{state:v,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(E){var M=Pt(E.accessibleIds,function(S){var P=e.works.getResolvedObserver(S);if(!P)return 1/0;var I=P.standingPosition.distanceTo(E.standingPosition);return ae(I,1,1/0)},!0),C=M[1];l[E.panoId]===void 0&&(l[E.panoId]=C)},v=0,p=this.works.resolvedObservers;v<p.length;v++){var m=p[v];h(m)}var A=Object.keys(l).map(function(E){return l[E]});if(A.length){var y=A.reduce(function(E,M){return E+M},0)/A.length;c=ae(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 x=w[b];this.helper.remove(r[x]),r[x].dispose(),delete r[x]}},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,c;i===void 0&&(i={});var l=ve(),h=ht(),v=this.works.getResolvedObserver(e);if(!v)throw new Error("panoId ".concat(JSON.stringify(e)," never found"));var p=this.panoResources[h]={panoId:v.panoId,effect:(o=i.effect)!==null&&o!==void 0?o:"fly",panoModel:r,matrix:new d.Matrix4().compose(v.position,v.quaternion,Hh),position:v.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,x=this.panoResourceFromLocationMotionKeyframe(b).position,E=p.position;A=Math.max(x.distanceTo(E),m),y=[{key:b.key,progress:0,value:F(F({},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,S=this.panoResourceFromLocationMotionKeyframe(C).position,x=this.panoResourceFromLocationMotionKeyframe(b).position,E=p.position,P=b.value.count-w.count,I=Math.max(S.distanceTo(x),m)*P,B=Math.max(x.distanceTo(E),m);A=I+B,y=[{key:C.key,progress:0,value:F({},w)},{key:b.key,progress:I/A,value:b.value},{key:h,progress:1,value:{count:b.value.count+1,distance:0}}];var L=this.locationMotionKeyframesLength(this.locationMotion.keyframes),k=this.locationMotionKeyframesLength(y);L===0||L===0?f=0:f=this.locationMotion.getProgressVelocity(l)*L/k}var O=this.calculateMovingDuration(i.duration,i.effect==="fade"||i.effect==="montage"?0:A),N={longitude:i.longitude,latitude:i.latitude,fov:i.fov},D=F(F({},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:v.position.clone(),distance:this.camera.pose.distance}),H=this.currentPano;this.emit("pano.moveTo",K("pano.moveTo",{options:i,prevPano:H,progress:0,state:D,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(D),this.cameraMotion.set(N,O).catch(Q);var z=this.locationMotion.setKeyframes(y,O,f);z.then(function(){var U=F(F({},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",K("pano.arrived",{options:i,prevPano:H,progress:1,state:U,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(U)},function(){a.emit("pano.cancel",K("pano.cancel",{options:i,prevPano:H,progress:0,state:D,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===Re(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),x=r.works.getResolvedObserver(b).position.clone().setY(a.y);return w.distanceTo(a)-x.distanceTo(a)}),l=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];l<h.length;l++)for(var v=h[l],p=0,m=c;p<m.length;p++){var A=m[p],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)<v)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(q){if(q===Re(r.currentPano))return!1;var j=r.works.getResolvedObserver(q);return!j||j.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:j.loadable||j.active}),l=a.intersectObject(this.boundingMesh,!0)[0];if(l){var h=Pt(c,function(q){var j=r.works.getResolvedObserver(q).standingPosition.clone(),_=j.clone().sub(r.camera.position).setY(0).angleTo(o);return _>Math.PI/2?1/0:j.distanceTo(l.point)},!0),v=h[0],p=h[1];v&&p<this.panoTapTriggerRadius&&(s=(i=this.works.getResolvedObserver(v))!==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,x=new d.Vector3(0,1,0),E=s.position.clone().setY(0).sub(u.position.clone().setY(0)).normalize(),M=E.clone().applyAxisAngle(x,b),C=E.clone().applyAxisAngle(x,-b),S=[],P=[],I=[],B=0,L=s.accessibleIds;B<L.length;B++){var v=L[B],k=We(v);if(!(Tt(k,this.currentPano)||Tt(k,s.pano))){var O=this.works.getResolvedObserver(v);if(O){var N=O.position.clone().sub(s.position).setY(0);E.angleTo(N)<b?I.push(N):M.angleTo(N)<b?S.push(N):C.angleTo(N)<b&&P.push(N)}}}var D=I.length>0?I:rt(rt([],S,!0),P,!0),H=D.slice().sort(function(q,j){return q.angleTo(E)-j.angleTo(E)})[0];H&&H.angleTo(o)>w&&(g.longitude=Math.atan2(-H.x,-H.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(g.latitude=ae(0,this.minLatitude,this.maxLatitude));var z=F({},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",K("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",K("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:z,options:g,error:null}))}}}},t}(Xa);const 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)}(`}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-
1809
- b-J-HrpA-z]|vv|{-J-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H\f`),jh=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`0r\x07r{v|{-TYlRealsntlqr}u-G-r{noyr<<<<-nqn}rq-s|z-ur-RQY-unqr-p|qr-s|z-Puvvn{-O|pur{\b-v{-py|q-p|z}nrG<<-u}G<<tvuo;p|z<py|qp|z}nr<{x<rr<znr<}ytv{<\0RQY<unqr<RQY<<}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{H{vs|z-sy|n-prr{dvquH{vs|z-sy|n-prr{UrvtuH{vs|z-rp?-{rvtuo|h[RVTUO\\b_lP\\b[ajH{vs|z-sy|n-rqy\`r{tuH{vs|z-sy|n-nqvH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-[rnH{vs|z-sy|n-SnH{vs|z-znA-]|wH{vs|z-nz}yr?Q-RQYP|y|Hn\bv{t-rp?-bHsy|n-r}|{r5sy|n-qr}u6
1800
+ `,Bh=function(n){le(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 xe({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new xe({opacity:0}),e.loadingMotion=new xe({opacity:0}),e.disableMotion=new xe({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(ea,new d.MeshBasicMaterial(k(k({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new d.Mesh(ea,new d.ShaderMaterial(k(k({},r),{vertexShader:Th,fragmentShader:Ph,uniforms:{opacity:{value:0}}}))),e.panoMesh=new d.Mesh(ea,new d.ShaderMaterial(k(k({},r),{vertexShader:Sh,fragmentShader:Ih,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=he(e,0,1),this.opacityMotion.set({opacity:e},30).catch(D))},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(D)}else{var r=[{progress:0,value:k({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(r,200).catch(D)}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(D):this.loadingMotion.set({opacity:0},0).catch(D),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(D),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,l=a.circleOpacity,c=a.circleScale;this.ringMesh.scale.set(o,1,o),this.ringMesh.material.uniforms.opacity.value=s*i,this.panoMesh.material.uniforms.opacity.value=i,this.panoMesh.material.uniforms.circleOpacity.value=l,this.panoMesh.material.uniforms.circleScale.value=c,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),Rh=1500,Fh=function(n){le(t,n);function t(e){var r=this,i=t.parseArgs(e);r=n.call(this,i)||this,r.mode="VRPanorama",r.cardboard=new bh(r.renderer);var a=Mh();r.helperElement=a;var o=new Cn(a);return r.element.parentNode&&(r.element.parentNode.insertBefore(a,r.element),r.setHelperElementSize(),o.on("tap",function(){return r.emit("vr.requestExit",_("vr.requestExit",{}))})),r.destroyHelper=function(){o.destroy(),a.parentNode&&a.parentNode.removeChild(a),delete r.helperElement},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=k(k({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{mode:"VRPanorama"})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper();for(var e=Object.keys(this.panoMeshes),r=0,i=e;r<i.length;r++){var a=i[r],o=this.panoMeshes[a];this.helper.remove(o),o.dispose(),delete this.panoMeshes[a]}},t.prototype.isReady=function(){return!1},t.prototype.updateRenderSize=function(){this.needsRender=!0,this.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(Oe(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 l=u[s],c=l.panoId,f=new Bh;f.name="panoSphere_".concat(c),f.position.copy(l.position),f.needsRender=!0,this.panoMeshes[c]=f}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,r){var i=this,a,o,s,u,l,c,f,A,p,y;if(!this.destroyed){var v=this.currentPano;this.userAction=!0,this.needsRender=!0;var m={},h={},g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),b=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),w=!1;if(this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),m.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var E=this.locationMotion.getKeyFrameSegment(e),C=E[0],x=E[1],M=this.panoResourceFromLocationMotionKeyframe(C),S=this.panoResourceFromLocationMotionKeyframe(x),P=M.position,T=S.position,B=this.locationMotion.value.count-x.value.count+1;m.progress=B,S.panoPicture&&(B<1?M.panoPicture&&(m.pano0=M.panoPicture):m.pano0=S.panoPicture,m.pano1=S.panoPicture),S.effect==="montage"?m.transition="BLACK":S.effect==="spread"?m.transition="SPREAD":m.transition="FADE",B<1&&S.effect!=="fly"&&(m.pano0&&M.panoPicture&&(m.pano0={map:m.pano0.map,luminanceMap:m.pano0.luminanceMap,matrix:M.panoPicture.matrix.clone().premultiply(M.fixCameraTransform).setPosition(S.position)}),P.copy(T),w=!0),h.distance=this.locationMotion.value.distance,h.offset=new d.Vector3(P.x+(T.x-P.x)*B,P.y+(T.y-P.y)*B,P.z+(T.z-P.z)*B);for(var F=[],L=[],O=0,Q=this.locationMotion.keyframes;O<Q.length;O++){var N=Q[O],H=N.key,K=N.progress;H!==void 0&&(F.push(H),K>this.locationMotion.progress&&L.push(H))}for(var U=0,G=Object.keys(this.panoResources);U<G.length;U++){var X=G[U];if(!(L.indexOf(X)>=0)){var Z=this.panoResources[X];if(Z.panoPicture){var q=Z.panoPicture.map,W=Z.panoPicture.luminanceMap;if(q){if(q===((a=m.pano0)===null||a===void 0?void 0:a.map)||q===((o=m.pano1)===null||o===void 0?void 0:o.map))continue;q instanceof Fe&&q.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(q.cubeRenderTarget),q.dispose(),W&&(W instanceof Fe&&W.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(W.cubeRenderTarget),W.dispose()),Z.panoPicture=null}}F.indexOf(X)>=0||delete this.panoResources[X]}}this.currentPano=ht(S.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:ht(g.panoId),state:k(k(k(k({},ht(b.panoId)),{mode:this.mode}),je(this.camera.pose)),h),options:{},progress:this.locationMotion.progress,error:null}))}Vt(m)===!1&&(!((s=m.pano0)===null||s===void 0)&&s.map&&m.pano0.map instanceof Fe&&!m.pano0.map.cubeRenderTarget&&(m.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=m.pano0)===null||u===void 0)&&u.luminanceMap&&m.pano0.luminanceMap instanceof Fe&&!m.pano0.luminanceMap.cubeRenderTarget&&(m.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),!((l=m.pano1)===null||l===void 0)&&l.map&&m.pano1.map instanceof Fe&&!m.pano1.map.cubeRenderTarget&&(m.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((c=m.pano1)===null||c===void 0)&&c.luminanceMap&&m.pano1.luminanceMap instanceof Fe&&!m.pano1.luminanceMap.cubeRenderTarget&&(m.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.models.setMaterial(m)),h.offset&&this.camera.position.copy(h.offset),qt(this.currentPano,v)&&this.updatePanoMeshesVisible();var J=this.camera.pose.longitude,ve=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose();var re=this.works.getResolvedObserver(this.currentPano);if(this.camera.pose.distance>.1||w)for(var se=0,ie=Object.keys(this.panoMeshes);se<ie.length;se++){var pe=ie[se],ne=this.panoMeshes[pe];ne.setOpacity(0),ne.updateTime&&ne.updateTime(e,r),ne.visible=!1}else if(re)for(var de=re.visibleIds.concat(Oe(this.currentPano)),ce=0,fe=de;ce<fe.length;ce++){var pe=fe[ce],$=ht(pe),te=this.works.getResolvedObserver($);if(te){var ne=this.panoMeshes[pe];if(!te.loadable&&!te.active){ne.setOpacity(0);continue}var j=ne.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);j<.05?ne.setOpacity(0):ne.setOpacity(he(1.5/j,0,1)),qt(this.currentPano,$)&&ne.setOpacity(0),ne.lookAt(this.camera.position)}}if(this.locationMotion.ended)for(var Le=this.intersect(e),Ce=0,ge=this.works.resolvedObservers;Ce<ge.length;Ce++){var te=ge[Ce],ne=this.panoMeshes[te.panoId];ne&&(ne.setCurrent(ne===Le),ne.updateTime&&ne.updateTime(e,r))}(J!==this.camera.pose.longitude||ve!==this.camera.pose.latitude)&&(this.cameraMotion.set(gr(this.camera.pose,["longitude","latitude"]),0).catch(D),this.emit("camera.update",_("camera.update",{userAction:!0,state:k(k(k({},this.currentPano),{mode:this.mode}),je(this.camera.pose))})));var ke=this.tileLevel=function(){if(i.tileLevelForFov===!1)return 0;var me=i.renderer.getDrawingBufferSize(new d.Vector2);me.width*=i.scissor.width,me.height*=i.scissor.height;var Te=b.panoId,Ue=i.works.getResolvedObserver(Te),Ee=i.imageOptions.size;if(typeof Ee=="undefined"&&Ue){var Qe=Ue.images.up.match(/\/cube_(\d+)\//);Qe&&(Ee=Number(Qe[1]))}typeof Ee=="undefined"&&(Ee=2048);var Be=0;Ee>=1024&&(Be=1),Ee>=2048&&(Be=2),Ee>=4096&&(Be=3),Ee>=8192&&(Be=4);var Ge=i.tileLevelForFov(i.camera.fov,me);return Ge>Be?Ge:0}(),Ne=function(){var me=i.camera.quaternion.clone(),Te=i.works.getResolvedObserver(b.panoId),Ue=Te!=null?Te:re;Ue&&me.premultiply(Ue.quaternion.clone().inverse());var Ee=new d.Matrix4().makeRotationFromQuaternion(me),Qe=new d.Matrix4().getInverse(Ee),Be=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(i.camera.projectionMatrix,Qe));return Be}();b.panoId===Oe(this.currentPano)&&(((f=b.panoPicture)===null||f===void 0?void 0:f.map)instanceof Fe&&(b.panoPicture.map.update(Ne,ke),b.panoPicture.map.needsRender===!0&&(b.panoPicture.map.needsRender=!1,this.needsRender=!0)),((A=b.panoPicture)===null||A===void 0?void 0:A.luminanceMap)instanceof Fe&&(b.panoPicture.luminanceMap.update(Ne,ke),b.panoPicture.luminanceMap.needsRender===!0&&(b.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0)));{var De=this.tiling.object.visible;if(this.initAnimationed){var We=b.panoId,Ae=this.works.getResolvedObserver(We);Ae?Dn(this.camera.position,Ae.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==We&&this.tiling.cleanup(),this.tiling.panoId=We,this.tiling.setResource((y=(p=Ae.images)===null||p===void 0?void 0:p.tiles)!==null&&y!==void 0?y:[],this.enableIOSEDR&&Ae.images.luminance?Ae.images.luminance:null),this.tiling.setFetcher(ut(Ae.work)),this.tiling.setRotation(Ae.quaternion),this.tiling.setPosition(Ae.position),ke>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ne,ke,e):this.tiling.update(Ne,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(){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>Rh){for(var a=this.activePanoMesh,o=Object.keys(this.panoMeshes),s=null,u=0,l=o;u<l.length;u++){var c=l[u];if(this.panoMeshes[c]===a){s=c;break}}return s!==null&&this.moveToPano(ht(s),{},!0),delete this.activePanoMesh,delete this.activeTime,a}var f=this.camera.getDirection(new d.Vector3),A=new d.Raycaster(this.camera.position,f);A.params.Points={threshold:.1};for(var p=void 0,y=[],v=this.works.getResolvedObserver(this.currentPano),m=v?v.visibleIds:[],h=0,g=m;h<g.length;h++){var s=g[h],b=this.panoMeshes[s],w=A.intersectObject((r=b.hitTestMesh)!==null&&r!==void 0?r:b,!0)[0];w&&y.push({panoMesh:b,intersection:k({floor:(i=v==null?void 0:v.floorIndex)!==null&&i!==void 0?i:0},w)})}var E=y.sort(function(T,B){return T.intersection.distance-B.intersection.distance})[0];E?(p=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.activePanoMesh=void 0,this.activeTime=void 0),p||(p=this.models.intersectRaycaster(A)[0]);var C=_("intersect.update",{raycaster:A,intersection:p!=null?p:null,object:this.intersectMesh});if(this.emit("intersect.update",C),C.defaultPrevented){this.hideIntersectMesh();return}if(p&&p.face){var x=p.face.normal,M=new d.Quaternion;M.setFromUnitVectors(new d.Vector3(0,0,1),x),this.intersectMesh.quaternion.copy(M);var S=x.clone().multiplyScalar(.05),P=p.point.clone().add(S);this.intersectMesh.position.copy(P),E?this.intersectMesh.visible=!1: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}(Za),kh=new d.Vector3(0,1.6,0),Lh=function(n){le(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 xe({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 xe({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new xe({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,l=this.parseArgs(e),c=l.works,f=e.initial,A=f.state,p=f.currentState,y=typeof A.panoIndex=="number"?{workCode:(a=(r=A.workCode)!==null&&r!==void 0?r:(i=l.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:A.panoIndex}:{workCode:p.workCode,panoIndex:p.panoIndex},v=c.getResolvedObserver(y),m=(o=A.longitude)!==null&&o!==void 0?o:p.longitude,h=he((s=A.latitude)!==null&&s!==void 0?s:!v||Ln(p.mode)?p.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),g=he((u=A.fov)!==null&&u!==void 0?u:!v||Ln(p.mode)?p.fov:l.defaultFov,l.minFov,l.maxFov),b=new d.Vector3;if(l.initial.state.offset)b.copy(l.initial.state.offset);else if(v)b.copy(v.position);else{var w=kt(p).setLength(p.distance);b.copy(l.initial.currentState.offset).sub(w)}return{workCode:y.workCode,panoIndex:y.panoIndex,mode:"Model",longitude:m,latitude:h,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(k(k({},this),{initial:{currentState:k(k({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));return this.hideIntersectMesh(),this.moveToPosition(o.offset,{duration:0,longitude:o.longitude,latitude:o.latitude,fov:o.fov},a),!0},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return o.distance=0,e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(D),a.cameraMotion.set(s,r).catch(D)})},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,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:0,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(D),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(he(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=nr(s,function(l){return l.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),Vt(i)||this.models.setMaterial(i),Vt(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},l={perspToOrtho:0},c={longitude:s.longitude,latitude:s.latitude,fov:s.fov,duration:a,moveStartCallback:function(f){e.perspToOrthoMotion.set(l,a).catch(D),e.modelAlphaMotion.set(u,a).catch(D),e.emit("initAnimation.start",_("initAnimation.start",{state:f,userAction:e.userAction}))},moveEndCallback:function(f){e.emit("initAnimation.end",_("initAnimation.end",{state:f,userAction:e.userAction})),r()},moveCancelCallback:function(){var f=e.currentPano,A=k(k({},f),{mode:e.mode,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance});e.emit("initAnimation.end",_("initAnimation.end",{state:A,userAction:e.userAction})),r()}};e.moveToPosition(s.offset,c,o)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(be())[1],r=this.locationMotion.getKeyFrameSegment(be())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new d.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.moveToPano=function(e,r,i){r===void 0&&(r={});var a=this.works.getResolvedObserver(e);a&&this.moveToPosition(a.position,r,i)},t.prototype.moveToPosition=function(e,r,i){var a=this,o,s,u;r===void 0&&(r={}),this.userAction=i,this.stopMomentumMovement();for(var l=be(),c=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),f=c.distanceTo(e),A=this.locationMotion.getProgressVelocity(l),p=0,y=1;y<this.locationMotion.keyframes.length;y++){var v=this.locationMotion.keyframes[y-1].value,m=v.x,h=v.y,g=v.z,b=this.locationMotion.keyframes[y].value,w=b.x,E=b.y,C=b.z;p+=Math.sqrt(Math.pow(w-m,2)+Math.pow(E-h,2)+Math.pow(C-g,2))}var x=f===0?0:A*p/f,M=this.calculateMovingDuration(r.duration,f),S={x:e.x,y:e.y,z:e.z,distance:0},P={longitude:r.longitude,latitude:r.latitude,fov:r.fov},T=this.works.resolvedObservers,B=nr(T,function(Q){return Q.position.distanceTo(c)}),F=B?{workCode:B.work.workCode,panoIndex:B.panoIndex}:{workCode:"",panoIndex:0},L=k(k({},F),{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}),O=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:r,prevPano:O,progress:0,state:L,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(L),this.cameraMotion.set(P,M).catch(D),this.locationMotion.set(S,M,x).then(function(){var Q=k(k(k({},F),{mode:a.mode}),je(a.camera.pose));a.emit("pano.arrived",_("pano.arrived",{options:r,prevPano:O,progress:0,state:Q,userAction:a.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(Q)},function(){r.moveCancelCallback&&r.moveCancelCallback(),a.emit("pano.cancel",_("pano.cancel",{options:r,prevPano:O,progress:0,state:L,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),l=this.works.resolvedObservers,c=nr(l,function(p){return p.position.distanceTo(u)},!0),f=c[0],A=c[1];f&&A<5&&(u.y=f.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}(Wu);const Oh=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-
1801
+ b-J-HrpA-z]|vv|{-J-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z]|vv|{H\f`),Vh=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`0r\x07r{v|{-TYlRealsntlqr}u-G-r{noyr<<<<-nqn}rq-s|z-ur-RQY-unqr-p|qr-s|z-Puvvn{-O|pur{\b-v{-py|q-p|z}nrG<<-u}G<<tvuo;p|z<py|qp|z}nr<{x<rr<znr<}ytv{<\0RQY<unqr<RQY<<}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{H{vs|z-sy|n-prr{dvquH{vs|z-sy|n-prr{UrvtuH{vs|z-rp?-{rvtuo|h[RVTUO\\b_lP\\b[ajH{vs|z-sy|n-rqy\`r{tuH{vs|z-sy|n-nqvH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-[rnH{vs|z-sy|n-SnH{vs|z-znA-]|wH{vs|z-nz}yr?Q-RQYP|y|Hn\bv{t-rp?-bHsy|n-r}|{r5sy|n-qr}u6
1810
1802
  --rp?-_nqv-J-nqv-<-rp?5prr{dvqu9-prr{Urvtu6H--sy|n-z-J-=;=H--s|5v{-v-J-=H-v-I-[RVTUO\\b_lP\\b[aH-v886
1811
1803
  ----rp?-[rvtuo|-J-b-8-_nqv-7-{rvtuo|hvjH----sy|n-{rvtuo|Qr}u-J-r\x07r?Q5RQYP|y|9-[rvtuo|6;nH----{rvtuo|Qr}u-J-5{rvtuo|Qr}u-JJ->;=6-L-=;=-G-{rvtuo|Qr}uH----vs5{rvtuo|Qr}u-.J-=;=6
1812
1804
  ------vs5qr}u-JJ-=;=6
@@ -1814,11 +1806,11 @@ void main() {
1814
1806
  --------z-8J-zn\x075=;=9-qr}u-:-{rvtuo|Qr}u6H------\f----\f--\f--r{-z-<-sy|n5[RVTUO\\b_lP\\b[a6H\f|vq-znv{56
1815
1807
  --rpA-pRQY-J-r\x07r?Q5RQYP|y|9-b6H--sy|n-qr}u-J-pRQY;nH--qr}u-J-5qr}u-JJ->;=6-L-=;=-G-qr}uH--sy|n-r-J-r}|{r5qr}u6H--sy|n-unqr-J-r\x07}5:r-7-@==;=-7-rqy\`r{tu6H--tylSntP|y|-J-rpA5pRQY;to-7-unqr9-|}npv\b6H--
1816
1808
  -<<-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
1817
- ----qvpnqH--\f\f`);var Wh=function(n){oe(t,n);function t(e){var r=n.call(this)||this;return r.uniforms={screenWidth:Vt("f",0),screenHeight:Vt("f",0),edlStrength:Vt("f",1),uNear:Vt("f",1),uFar:Vt("f",1),radius:Vt("f",1),neighbours:Vt("2fv",new Float32Array),depthMap:Vt("t",new d.Texture),uEDLColor:Vt("t",new d.Texture),uEDLDepth:Vt("t",new d.Texture),opacity:Vt("f",1),uProj:Vt("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+`
1818
- `,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+Kh,r=this.getDefines()+jh;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Ct([jt("screenWidth"),St("design:type",Number)],t.prototype,"screenWidth",void 0),Ct([jt("screenHeight"),St("design:type",Number)],t.prototype,"screenHeight",void 0),Ct([jt("edlStrength"),St("design:type",Number)],t.prototype,"edlStrength",void 0),Ct([jt("uNear"),St("design:type",Number)],t.prototype,"uNear",void 0),Ct([jt("uFar"),St("design:type",Number)],t.prototype,"uFar",void 0),Ct([jt("radius"),St("design:type",Number)],t.prototype,"radius",void 0),Ct([jt("neighbours",!0),St("design:type",Float32Array)],t.prototype,"neighbours",void 0),Ct([jt("depthMap"),St("design:type",d.Texture)],t.prototype,"depthMap",void 0),Ct([jt("uEDLColor"),St("design:type",d.Texture)],t.prototype,"uEDLColor",void 0),Ct([jt("uEDLDepth"),St("design:type",d.Texture)],t.prototype,"uEDLDepth",void 0),Ct([jt("uProj"),St("design:type",Array)],t.prototype,"uProj",void 0),t}(d.RawShaderMaterial);function Vt(n,t){return{type:n,value:t}}function jt(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 Xh=new d.OrthographicCamera(-1,1,1,-1,0,1),$a=new d.BufferGeometry;$a.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));$a.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var t0=new d.Mesh($a),r0=new d.Scene;r0.add(t0);var _h=function(n){oe(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 Wh,t0.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(r0,Xh)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Ii);const Zh=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-
1809
+ ----qvpnqH--\f\f`);var Nh=function(n){le(t,n);function t(e){var r=n.call(this)||this;return r.uniforms={screenWidth:Bt("f",0),screenHeight:Bt("f",0),edlStrength:Bt("f",1),uNear:Bt("f",1),uFar:Bt("f",1),radius:Bt("f",1),neighbours:Bt("2fv",new Float32Array),depthMap:Bt("t",new d.Texture),uEDLColor:Bt("t",new d.Texture),uEDLDepth:Bt("t",new d.Texture),opacity:Bt("f",1),uProj:Bt("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+`
1810
+ `,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+Oh,r=this.getDefines()+Vh;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Et([Gt("screenWidth"),xt("design:type",Number)],t.prototype,"screenWidth",void 0),Et([Gt("screenHeight"),xt("design:type",Number)],t.prototype,"screenHeight",void 0),Et([Gt("edlStrength"),xt("design:type",Number)],t.prototype,"edlStrength",void 0),Et([Gt("uNear"),xt("design:type",Number)],t.prototype,"uNear",void 0),Et([Gt("uFar"),xt("design:type",Number)],t.prototype,"uFar",void 0),Et([Gt("radius"),xt("design:type",Number)],t.prototype,"radius",void 0),Et([Gt("neighbours",!0),xt("design:type",Float32Array)],t.prototype,"neighbours",void 0),Et([Gt("depthMap"),xt("design:type",d.Texture)],t.prototype,"depthMap",void 0),Et([Gt("uEDLColor"),xt("design:type",d.Texture)],t.prototype,"uEDLColor",void 0),Et([Gt("uEDLDepth"),xt("design:type",d.Texture)],t.prototype,"uEDLDepth",void 0),Et([Gt("uProj"),xt("design:type",Array)],t.prototype,"uProj",void 0),t}(d.RawShaderMaterial);function Bt(n,t){return{type:n,value:t}}function Gt(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 Qh=new d.OrthographicCamera(-1,1,1,-1,0,1),Ya=new d.BufferGeometry;Ya.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Ya.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var el=new d.Mesh(Ya),tl=new d.Scene;tl.add(el);var Dh=function(n){le(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 Nh,el.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),l=0;l<this.material.neighbourCount;l++)u[2*l+0]=Math.cos(2*l*Math.PI/this.material.neighbourCount),u[2*l+1]=Math.sin(2*l*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(tl,Qh)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Mi);const Uh=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-
1819
1811
  sy|n-qr}u-J-r\x07r?Q5Qr}uZn}9-b6;Hvs5qr}u-KJ->;=6
1820
- 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`),Yh=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-
1821
- b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var Jh=function(n){oe(t,n);function t(e){var r=n.call(this,{vertexShader:Yh,fragmentShader:Zh})||this;return r.uniforms={uDepthMap:Cs("t",null),uWeightMap:Cs("t",null)},r.depthTest=!0,r.depthWrite=!0,r.opacity=1,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},Ct([Ss("uDepthMap"),St("design:type",Number)],t.prototype,"uDepthMap",void 0),Ct([Ss("uWeightMap"),St("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(d.RawShaderMaterial);function Cs(n,t){return{type:n,value:t}}function Ss(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 $h=new d.OrthographicCamera(-1,1,1,-1,0,1),eo=new d.BufferGeometry;eo.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));eo.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var n0=new d.Mesh(eo),i0=new d.Scene;i0.add(n0);var ep=function(n){oe(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 Jh,o.scene=r,o.camera=i,n0.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(i0,$h),this.models.setMaterial({useHQWeight:!1,useHQDepth:!0}),this.models.update(this.renderer,this.camera,"Mapview")},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Ii),na=.5,ia=0,tp=function(n){oe(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 _h(r.renderer,r.scene,r.camera,r.models),r.hqEffect=new ep(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 F(F({},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 Mi}})},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,v=l.models,p=e.initial,m=p.state,A=p.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=ae((s=m.latitude)!==null&&s!==void 0?s:wa(A.mode)?A.latitude:l.defaultLatitude,l.minLatitude,l.maxLatitude),w=t.distanceFromModel(l.models,g,l.camera.aspect),x=new d.Vector3,E=(u=m.distance)!==null&&u!==void 0?u:Math.min(l.defaultDistance,w),M=(c=m.longitude)!==null&&c!==void 0?c:wa(A.mode)?A.longitude:l.defaultLongitude;return m.offset?x.copy(m.offset):l.defaultDistance<w&&f?(x.copy(f.position),m.longitude===void 0&&(M=A.longitude)):x.copy(v.bounding.getCenter(x)),v.bounding.containsPoint(x)||v.bounding.getCenter(x),F(F({},y),{mode:"Mapview",longitude:M,latitude:b,fov:g,offset:x,distance:E})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(F(F({},this),{initial:{currentState:F(F({},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(ae(this.perspToOrthoMotion.value.perspToOrtho,0,1))),Et(i)||this.models.setMaterial(i),Et(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(ve())[1],r=this.locationMotion.getKeyFrameSegment(ve())[1];return F(F({},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",K("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",K("initAnimation.end",{state:s,userAction:e.userAction}))},function(v){var p=F(F(F({},e.currentPano),{mode:e.mode}),Ve(e.camera.pose));e.emit("initAnimation.end",K("initAnimation.end",{state:p,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=Pt(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=F({},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=Lr(this.cameraMotion.value.longitude+u.longitude),h=ae(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),v=ae(this.locationMotion.value.x+u.x,this.models.bounding.min.x,this.models.bounding.max.x),p=ae(this.locationMotion.value.y+u.y,this.models.bounding.min.y,this.models.bounding.max.y),m=ae(this.locationMotion.value.z+u.z,this.models.bounding.min.z,this.models.bounding.max.z),A=F(F({},this.currentPano),{mode:this.mode,longitude:l,latitude:h,offset:new d.Vector3(v,p,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=K("gesture.momentum",F(F({},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:ft.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=Tr(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=na;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),-this.models.bounding.min.y),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=ae(o.distance,ia,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=na,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 v=h.distanceTo(u.ray.origin);v<1e4&&v>=u.near&&(c={distance:v,floor:0,point:h,object:this.scene})}}if(c)o.copy(c.point);else{var p=new d.Vector3().copy(this.camera.pose.offset).sub(this.camera.position),l=new d.Plane().setFromNormalAndCoplanarPoint(p,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=="undefined"||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=Tr(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,x=2*A.y*g/b.y,E=new d.Vector3;E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-w),y.add(E),this.camera.pose.latitude<Math.PI/9?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(x),y.add(E),y.clamp(this.models.bounding.min,this.models.bounding.max);var M=F(F({},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),S=2*e.velocityX*g/C.y,P=2*e.velocityY*g/C.y,I=new d.Vector3,B=new d.Vector3;I.setFromMatrixColumn(this.camera.matrix,0),I.multiplyScalar(-S),B.add(I),this.camera.pose.latitude<Math.PI/4?I.setFromMatrixColumn(this.camera.matrix,1):(I.setFromMatrixColumn(this.camera.matrix,0),I.crossVectors(this.camera.up,I)),I.multiplyScalar(P),B.add(I),this.inMomentumMovement={uuid:ht()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:B.x,y:B.y,z:B.z},0)}}else{var A={x:e.center.x-i.x,y:e.center.y-i.y},L=this.coordinatesForOffset(A),k=Lr(this.cameraMotion.value.longitude+L.longitude),O=ae(this.cameraMotion.value.latitude+L.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(O=this.cameraMotion.value.latitude);var M=F(F({},this.currentPano),{mode:this.mode,longitude:k,latitude:O,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,D=e.velocityY;this.inMomentumMovement={uuid:ht()},this.requestMomentumMovement(e,!0,F(F({},this.coordinatesForOffset({x:N,y:D})),{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!="undefined"){var a=this.models.bounding.getCenter(new d.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=ae(i/e.scale,ia,1/0),u=e.state.offset.clone().sub(Tr(e.state).setLength(s)),c=this.models.bounding.containsPoint(u),l;!c&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(u)>o?l=e.state.distance:(l=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=l,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=na,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=K("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var 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 v=this.camera.position.clone().sub(l);this.intersectMesh.rotation.z=-Math.atan2(v.z,v.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=this.models.bounding.getCenter(new d.Vector3),s=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),u=ae(this.locationMotion.value.distance-a,ia,1/0),c=e.state.offset.clone().sub(Tr(e.state).setLength(u)),l=this.models.bounding.containsPoint(c),h=!l&&a<0&&o.distanceTo(c)>s?e.state.distance:u;if(e.state.distance=u,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:h},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=F(F({},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",K("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=ht();this.preloadPano(a.pano).then(function(c){r.currentTapId===u&&r.emit("pano.request",K("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}(Wa);function Is(n){return n==null}var rp={type:"move"},Ts=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(rp))),c&&t.hand){o=!0;for(var l=0,h=t.hand.values();l<h.length;l++){var v=h[l],p=e.getJointPose(v,r);if(c.joints[v.jointName]===void 0){var m=new d.Group;m.matrixAutoUpdate=!1,m.visible=!1,c.joints[v.jointName]=m,c.add(m)}var A=c.joints[v.jointName];p!==null&&(A.matrix.fromArray(p.transform.matrix),A.matrix.decompose(A.position,A.rotation,A.scale),A.jointRadius=p.radius),A.visible=p!==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}(),np=1,ip=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 Ts,new Ts],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],v=(o[8]+1)/o[0],p=s*h,m=s*v,A=i/(-h+v),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=p-y,w=m+(i-y),x=c*u/g*f,E=l*u/g*f;t.projectionMatrix.makePerspective(b,w,x,E,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,ft.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:np};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}(),to=function(n){oe(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(to.prototype,{isLineSegmentsGeometry:!0});var aa={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:`
1812
+ 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`),zh=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-
1813
+ b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var Gh=function(n){le(t,n);function t(e){var r=n.call(this,{vertexShader:zh,fragmentShader:Uh})||this;return r.uniforms={uDepthMap:xs("t",null),uWeightMap:xs("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}},Et([Cs("uDepthMap"),xt("design:type",Number)],t.prototype,"uDepthMap",void 0),Et([Cs("uWeightMap"),xt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(d.RawShaderMaterial);function xs(n,t){return{type:n,value:t}}function Cs(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 Hh=new d.OrthographicCamera(-1,1,1,-1,0,1),Ja=new d.BufferGeometry;Ja.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Ja.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var rl=new d.Mesh(Ja),nl=new d.Scene;nl.add(rl);var Kh=function(n){le(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 Gh,o.scene=r,o.camera=i,rl.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(nl,Hh),this.models.setMaterial({useHQWeight:!1,useHQDepth:!0}),this.models.update(this.renderer,this.camera,"Mapview")},t.prototype.dispose=function(){this.copyPass.dispose()},t}(Mi),ta=.5,ra=0,qh=function(n){le(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 xe({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 xe({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new xe({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 Dh(r.renderer,r.scene,r.camera,r.models),r.hqEffect=new Kh(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 l=n.parseArgs.call(this,e);return k(k({},l),{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 xi}})},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,l,c=this.parseArgs(e),f=c.works,A=c.models,p=e.initial,y=p.state,v=p.currentState,m=typeof y.panoIndex=="number"?{workCode:(a=(r=y.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:y.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},h=f.getResolvedObserver(m),g=(o=y.fov)!==null&&o!==void 0?o:60,b=he((s=y.latitude)!==null&&s!==void 0?s:ba(v.mode)?v.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),w=t.distanceFromModel(c.models,g,c.camera.aspect),E=new d.Vector3,C=(u=y.distance)!==null&&u!==void 0?u:Math.min(c.defaultDistance,w),x=(l=y.longitude)!==null&&l!==void 0?l:ba(v.mode)?v.longitude:c.defaultLongitude;return y.offset?E.copy(y.offset):c.defaultDistance<w&&h?(E.copy(h.position),y.longitude===void 0&&(x=v.longitude)):E.copy(A.bounding.getCenter(E)),A.bounding.containsPoint(E)||A.bounding.getCenter(E),k(k({},m),{mode:"Mapview",longitude:x,latitude:b,fov:g,offset:E,distance:C})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(k(k({},this),{initial:{currentState:k(k({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},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.duration).catch(D),this.cameraMotion.set(s,i.duration).catch(D),!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(D),a.cameraMotion.set(s,r).catch(D)})},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,l=e;u<l.length;u++){var c=l[u];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(D),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(D)}this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),Vt(i)||this.models.setMaterial(i),Vt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(be())[1],r=this.locationMotion.getKeyFrameSegment(be())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new d.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),u={longitude:s.longitude,latitude:s.latitude,fov:s.fov},l={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",_("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(f,a).catch(D),e.modelAlphaMotion.set(c,a/3).catch(D),e.cameraMotion.set(u,a).catch(D),e.locationMotion.set(l,a).then(function(){e.emit("initAnimation.end",_("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var p=k(k(k({},e.currentPano),{mode:e.mode}),je(e.camera.pose));e.emit("initAnimation.end",_("initAnimation.end",{state:p,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=nr(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=k({},i),u={longitude:0,latitude:0,x:0,y:0,z:0},l=0;l<a;l++)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 c=kr(this.cameraMotion.value.longitude+u.longitude),f=he(this.cameraMotion.value.latitude+u.latitude,this.minLatitude,this.maxLatitude),A=he(this.locationMotion.value.x+u.x,this.models.bounding.min.x,this.models.bounding.max.x),p=he(this.locationMotion.value.y+u.y,this.models.bounding.min.y,this.models.bounding.max.y),y=he(this.locationMotion.value.z+u.z,this.models.bounding.min.z,this.models.bounding.max.z),v=k(k({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,offset:new d.Vector3(A,p,y),fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),m=!(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),h=_("gesture.momentum",k(k({},e),{isFirst:r,isFinal:m,state:v}));if(this.inMomentumMovement.event=h,this.emit("gesture.momentum",h),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(D),this.locationMotion.set({x:v.offset.x,y:v.offset.y,z:v.offset.z},0).catch(D),m?this.inMomentumMovement=null:lt.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=kt(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=ta;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),-this.models.bounding.min.y),u=a.ray.intersectPlane(s,new d.Vector3);if(u){var l=u.distanceTo(a.ray.origin);l<1e4&&l>=a.near&&(o={distance:l,floor:0,point:u,object:this.scene,face:null})}}o&&(e.distance=he(o.distance,ra,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=ta,o=new d.Vector3().copy(u.ray.direction).multiplyScalar(3).add(u.ray.origin);var l=this.models.intersectRaycaster(u)[0];if(!l&&u.ray.direction.y<-.3){var c=new d.Plane(new d.Vector3(0,1,0),0),f=u.ray.intersectPlane(c,new d.Vector3);if(f){var A=f.distanceTo(u.ray.origin);A<1e4&&A>=u.near&&(l={distance:A,floor:0,point:f,object:this.scene})}}if(l)o.copy(l.point);else{var p=new d.Vector3().copy(this.camera.pose.offset).sub(this.camera.position),c=new d.Plane().setFromNormalAndCoplanarPoint(p,this.camera.pose.offset);u.ray.intersectPlane(c,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var y=r>1||a===2;if(y){var v={x:e.center.x-i.x,y:e.center.y-i.y},m=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),h=kt(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(m),g=new d.Vector3().copy(h).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*v.x*g/b.y,E=2*v.y*g/b.y,C=new d.Vector3;C.setFromMatrixColumn(this.camera.matrix,0),C.multiplyScalar(-w),m.add(C),this.camera.pose.latitude<Math.PI/9?C.setFromMatrixColumn(this.camera.matrix,1):(C.setFromMatrixColumn(this.camera.matrix,0),C.crossVectors(this.camera.up,C)),C.multiplyScalar(E),m.add(C),m.clamp(this.models.bounding.min,this.models.bounding.max);var x=k(k({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:m,distance:this.camera.pose.distance});if(e.state=x,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:x.offset.x,y:x.offset.y,z:x.offset.z},0).catch(D),e.isFinal&&(this.fixFinalState(x),this.locationMotion.set({distance:x.distance,x:x.offset.x,y:x.offset.y,z:x.offset.z},0).catch(D)),e.isFinal){var M=this.renderer.getSize(new d.Vector2),S=2*e.velocityX*g/M.y,P=2*e.velocityY*g/M.y,T=new d.Vector3,B=new d.Vector3;T.setFromMatrixColumn(this.camera.matrix,0),T.multiplyScalar(-S),B.add(T),this.camera.pose.latitude<Math.PI/4?T.setFromMatrixColumn(this.camera.matrix,1):(T.setFromMatrixColumn(this.camera.matrix,0),T.crossVectors(this.camera.up,T)),T.multiplyScalar(P),B.add(T),this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:B.x,y:B.y,z:B.z},0)}}else{var v={x:e.center.x-i.x,y:e.center.y-i.y},F=this.coordinatesForOffset(v),L=kr(this.cameraMotion.value.longitude+F.longitude),O=he(this.cameraMotion.value.latitude+F.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&&(O=this.cameraMotion.value.latitude);var x=k(k({},this.currentPano),{mode:this.mode,longitude:L,latitude:O,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&this.fixFinalState(x),e.state=x,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:x.distance,x:x.offset.x,y:x.offset.y,z:x.offset.z},0).catch(D):this.cameraMotion.set({longitude:x.longitude,latitude:x.latitude},0).catch(D),e.isFinal){var Q=e.velocityX,N=e.velocityY;this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,k(k({},this.coordinatesForOffset({x:Q,y:N})),{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!="undefined"){var a=this.models.bounding.getCenter(new d.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=he(i/e.scale,ra,1/0),u=e.state.offset.clone().sub(kt(e.state).setLength(s)),l=this.models.bounding.containsPoint(u),c;!l&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(u)>o?c=e.state.distance:(c=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=c,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(D),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=ta,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=_("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var 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),l=u.clone().multiplyScalar(.05),c=o.point.clone().add(l);this.intersectMesh.position.copy(c);var f=c.clone().add(l);if(this.intersectMesh.lookAt(f),Math.abs(u.y)>.99){var A=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(A.z,A.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(D)}else{var a=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1),o=this.models.bounding.getCenter(new d.Vector3),s=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),u=he(this.locationMotion.value.distance-a,ra,1/0),l=e.state.offset.clone().sub(kt(e.state).setLength(u)),c=this.models.bounding.containsPoint(l),f=!c&&a<0&&o.distanceTo(l)>s?e.state.distance:u;if(e.state.distance=u,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:f},0).catch(D)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=k(k({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new d.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var u=this.currentTapId=wt();this.preloadPano(a.pano).then(function(l){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}(ja);function Ms(n){return n==null}var jh={type:"move"},Ss=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,l=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(jh))),l&&t.hand){o=!0;for(var c=0,f=t.hand.values();c<f.length;c++){var A=f[c],p=e.getJointPose(A,r);if(l.joints[A.jointName]===void 0){var y=new d.Group;y.matrixAutoUpdate=!1,y.visible=!1,l.joints[A.jointName]=y,l.add(y)}var v=l.joints[A.jointName];p!==null&&(v.matrix.fromArray(p.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=p.radius),v.visible=p!==null}var m=l.joints["index-finger-tip"],h=l.joints["thumb-tip"],g=m.position.distanceTo(h.position),b=.02,w=.005;l.inputState.pinching&&g>b+w?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&g<=b-w&&(l.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),l!==null&&(l.visible=o!==null),this},n}(),Wh=1,Xh=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:D,this.onSessionEndCallback=(u=r==null?void 0:r.onSessionEnd)!==null&&u!==void 0?u:D,this.controllers=[new Ss,new Ss],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),l=(a[9]+1)/a[5],c=(a[9]-1)/a[5],f=(a[8]-1)/a[0],A=(o[8]+1)/o[0],p=s*f,y=s*A,v=i/(-f+A),m=v*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(v),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var h=s+v,g=u+v,b=p-m,w=y+(i-m),E=l*u/g*h,C=c*u/g*h;t.projectionMatrix.makePerspective(b,w,E,C,h,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,lt.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:Wh};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}(),$a=function(n){le(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($a.prototype,{isLineSegmentsGeometry:!0});var na={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:`
1822
1814
  #include <common>
1823
1815
  #include <color_pars_vertex>
1824
1816
  #include <fog_pars_vertex>
@@ -2017,7 +2009,7 @@ void main() {
2017
2009
  #include <premultiplied_alpha_fragment>
2018
2010
 
2019
2011
  }
2020
- `},ro=function(n){oe(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(aa.uniforms),vertexShader:aa.vertexShader,fragmentShader:aa.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(ro.prototype,{isLineMaterial:!0});var a0=function(n){oe(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new to,i.material=r!==void 0?r:new ro({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,v=s.attributes.instanceEnd,p=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 x=0,E=h.count;x<E;x++){p.fromBufferAttribute(h,x),m.fromBufferAttribute(v,x),p.w=1,m.w=1,p.applyMatrix4(f),m.applyMatrix4(f),p.applyMatrix4(o),m.applyMatrix4(o),p.multiplyScalar(1/p.w),m.multiplyScalar(1/m.w);var M=p.z<-1&&m.z<-1,C=p.z>1&&m.z>1;if(!(M||C)){p.x*=c.x/2,p.y*=c.y/2,m.x*=c.x/2,m.y*=c.y/2,g.start.copy(p),g.start.z=0,g.end.copy(m),g.end.z=0;var S=g.closestPointToPointParameter(y,!0);g.at(S,b);var P=d.MathUtils.lerp(p.z,m.z,S),I=P>=-1&&P<=1,B=y.distanceTo(b)<l*.5;if(I&&B){g.start.fromBufferAttribute(h,x),g.end.fromBufferAttribute(v,x),g.start.applyMatrix4(w),g.end.applyMatrix4(w);var L=new d.Vector3,k=new d.Vector3;i.distanceSqToSegment(g.start,g.end,k,L),r.push({point:k,pointOnLine:L,distance:i.origin.distanceTo(k),object:this,faceIndex:x})}}}},t}(d.Mesh);Object.assign(a0.prototype,{isLineSegments2:!0});var o0=function(n){oe(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(a0);Object.assign(o0.prototype,{isLine2:!0});var s0=function(n){oe(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}(to);Object.assign(s0.prototype,{isLineGeometry:!0});var ap="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hX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Ps=14467195,op=8,sp=2,up=20,Bs=null,Sa=function(n){oe(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 s0,o=new ro({color:Ps,linewidth:sp,dashScale:up,dashed:!1});i.line=new o0(a,o);var s=new d.BufferGeometry,u=new d.PointsMaterial({color:Ps,size:op,map:Bs||(Bs=new d.TextureLoader().load(ap)),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.82"},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(Sa.prototype,{isFiveLine:!0});var Ue={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 u0(n){return wi(this,void 0,void 0,function(){var t;return xi(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 lp(n){return wi(this,void 0,void 0,function(){var t,e;return xi(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,u0("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function cp(n,t,e,r){return e===void 0&&(e=null),r===void 0&&(r=!0),wi(this,void 0,void 0,function(){var i,a,o,s,u,c;return xi(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,lp(t)];case 1:if(i=l.sent(),n.profiles.some(function(h){var v=i[h];return v&&(a={profileId:h,profilePath:"".concat(t,"/").concat(v.path),deprecated:!!v.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,u0(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 dp={xAxis:0,yAxis:0,button:0,state:Ue.ComponentState.DEFAULT};function fp(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 hp=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Ue.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(dp)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=fp(e,r),s=o.normalizedXAxis,u=o.normalizedYAxis;switch(this.componentProperty){case Ue.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Ue.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?u:.5;break;case Ue.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Ue.ComponentProperty.STATE:this.valueNodeProperty===Ue.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}(),pp=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 hp(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Ue.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=F({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Ue.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=Ue.ComponentState.PRESSED:(r.touched||this.values.button>Ue.ButtonTouchThreshold)&&(this.values.state=Ue.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===Ue.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Ue.AxisTouchThreshold&&(this.values.state=Ue.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===Ue.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Ue.AxisTouchThreshold&&(this.values.state=Ue.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),vp=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 pp(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}(),Ap="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",mp="generic-trigger",gp=function(n){oe(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===Ue.VisualResponseProperty.VISIBILITY?a.visible=u:c===Ue.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,u),a.position.lerpVectors(o.position,s.position,u)))})}))},t}(Tn.Object3D);function yp(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Ue.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Tn.SphereGeometry(.001),s=new Tn.MeshBasicMaterial({color:255}),u=new Tn.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,v=c.maxNodeName,p=c.valueNodeProperty;if(p===Ue.VisualResponseProperty.TRANSFORM){if(c.minNode=t.getObjectByName(h),c.maxNode=t.getObjectByName(v),!c.minNode){console.warn("Could not find ".concat(h," in the model"));return}if(!c.maxNode){console.warn("Could not find ".concat(v," in the model"));return}}c.valueNode=t.getObjectByName(l),c.valueNode||console.warn("Could not find ".concat(l," in the model"))})})}function Rs(n,t){yp(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 bp=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=Ap,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new gp,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||cp(o,e.path,mp).then(function(s){var u=s.profile,c=s.assetPath;r.motionController=new vp(o,u,c);var l=e._assetCache[r.motionController.assetUrl];if(l)i=l.scene.clone(),Rs(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(),Rs(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function wp(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 Fs=300,xp=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),ks=new d.Vector3(-1,1,1),Ep=function(n){oe(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new ip(r.renderer,r.renderer.getContext(),{onSessionStart:function(u){r.emit("xr.session.start",K("xr.session.start",{session:u,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",K("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.pointerLines={left:new Sa,right:new Sa},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.scene.add(r.pointerLines.left,r.pointerLines.right),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=ht()]={panoId:Re(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade"},r.parallaxCameraMatrixs=[];var i=ft.shared.getContext();if(!i)return console.error("获取session失败,请退出重试"),r;r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(i),r.controllerWrappers=[new d.Group,new d.Group],r.scene.add(r.controllerWrappers[0],r.controllerWrappers[1]);var a=r.xrManager.getController(0);r.controllerWrappers[0].add(a);var o=r.xrManager.getController(1);r.controllerWrappers[1].add(o);var s=new bp;return s.gltfLoader={load:function(u,c){li.ajax(u,{responseType:"arraybuffer"}).then(function(l){var h;return Da(l.body,{resourcePath:u.slice(0,u.lastIndexOf("/")+1),search:(h=u.split("?")[1])!==null&&h!==void 0?h:"",fetcher:li})}).then(function(l){return c(l)})}},r.on("xr.session.start",function(){var u=r.xrManager.getControllerGrip(0);u.add(s.createControllerModel(u)),r.controllerWrappers[0].add(u);var c=r.xrManager.getControllerGrip(1);c.add(s.createControllerModel(c)),r.controllerWrappers[1].add(c)}),r.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}},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=F(F({},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 F(F({},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=="undefined"&&l){var v=l.images.up.match(/\/cube_(\d+)\//);v&&(h=Number(v[1]))}typeof h=="undefined"&&(h=2048);var p=this.imageOptions.transform,m=function(P,I){return wp(ci(P,p,I))},A=F({key:"pano.".concat(l.panoId)},nr(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:"+dn([y,A,p]);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",K("pano.texture.abort",{error:null,progress:0,meta:null,pano:l.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var w=this.models.getMaterial()||{},x=w.pano0,E=w.pano1,M;if((x==null?void 0:x.map.name)===g?M=x:(E==null?void 0:E.map.name)===g&&(M=E),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,ks)},position:l.position.clone()};this.doMoveToPano(l.pano,C,r);return}var S="move-to-pano-"+l.panoId;this.pending.add(S),this.pendingTextureTask={panoId:l.panoId,hash:g,onLoad:function(P){var I;if(a.pending.delete(S),a.destroyed)P.body.dispose();else{P.body.name=g;var B={panoId:l.panoId,effect:(I=r.effect)!==null&&I!==void 0?I:"fade",leftPanoPicture:{map:P.body,luminanceMap:null,matrix:new d.Matrix4().compose(l.position,l.quaternion,ks)},position:l.position.clone()};a.doMoveToPano(l.pano,B,r)}},onError:function(P){a.pending.delete(S);var I=F(F(F({},l.pano),{mode:a.mode}),Ve(a.camera.pose));a.emit("pano.error",K("pano.error",{error:P,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),a.emit("pano.cancel",K("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:I})),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,minFilter:d.NearestFilter,magFilter:d.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:dt(l.work)},void 0,void 0,function(P){var I,B;a.emit("pano.texture.progress",K("pano.texture.progress",{error:null,progress:P,meta:null,pano:l.pano})),((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===g&&((B=a.panoMeshes[l.panoId])===null||B===void 0||B.setProgress(P))},this.renderer):this.textureLoader.loadCubeTexture(y,{imageURL:{transform:m,options:A},format:d.RGBAFormat,fetcher:dt(l.work)},void 0,void 0,function(P){var I,B;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===g&&((B=a.panoMeshes[l.panoId])===null||B===void 0||B.setProgress(P)),a.emit("pano.texture.progress",K("pano.texture.progress",{error:null,progress:P,meta:null,pano:l.pano}))},this.renderer)]).then(function(P){var I,B,L=P[0];((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===g?(a.pendingTextureTask.onLoad(L),(B=a.panoMeshes[l.panoId])===null||B===void 0||B.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",K("pano.texture.success",{error:null,progress:1,meta:L.meta,pano:l.pano}))):L.body.dispose()}).catch(function(P){var I,B;((I=a.pendingTextureTask)===null||I===void 0?void 0:I.hash)===g&&(a.pendingTextureTask.onError(P),(B=a.panoMeshes[l.panoId])===null||B===void 0||B.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",K("pano.texture.error",{error:P,progress:0,meta:null,pano:l.pano})),a.emit("error",P))}),this.emit("pano.texture.load",K("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=ht();this.panoResources[l]=r;var h=1,v,p,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;v=Math.max(g.distanceTo(b),h),p=[{key:y.key,progress:0,value:F(F({},f),{count:0})},{key:l,progress:1,value:{distance:0,count:1}}],m=0}else{var w=this.locationMotion.getKeyFrameSegment(c),x=w[0],y=w[1],f=this.locationMotion.value,E=this.panoResourceFromLocationMotionKeyframe(x).position,g=this.panoResourceFromLocationMotionKeyframe(y).position,b=r.position,M=y.value.count-f.count,C=Math.max(E.distanceTo(g),h)*M,S=Math.max(g.distanceTo(b),h);v=C+S,p=[{key:x.key,progress:0,value:F({},f)},{key:y.key,progress:C/v,value:y.value},{key:l,progress:1,value:{count:y.value.count+1,distance:0}}];var P=this.locationMotionKeyframesLength(this.locationMotion.keyframes),I=this.locationMotionKeyframesLength(p);m=this.locationMotion.getProgressVelocity(c)*P/I}var B=this.calculateMovingDuration(i.duration,v),L={longitude:i.longitude,latitude:i.latitude,fov:i.fov},k=F(F({},e),{mode:this.mode,longitude:(o=L.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=L.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=L.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:0}),O=this.currentPano;this.emit("pano.moveTo",K("pano.moveTo",{options:i,prevPano:O,progress:0,state:k,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(k),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(L,B).catch(Q);var N=this.locationMotion.setKeyframes(p,B,m);N.then(function(){var D,H,z,U=F(F({},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",K("pano.arrived",{options:i,prevPano:O,progress:1,state:U,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(U);var q=a.works.getResolvedObserver(a.currentPano);if(q&&q.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var j=xp.clone().multiply((z=(H=(D=a.models.getMaterial())===null||D===void 0?void 0:D.pano1)===null||H===void 0?void 0:H.matrix)!==null&&z!==void 0?z:new d.Matrix4).multiply(q.video.matrix),_={map:a.videoTexture,size:q.video.size,matrix:j,alpha:1},Z=ht(),W=a.videoTexture.image;W.setAttribute("uuid",Z),_u().then(function(Y){Y&&q.video&&W.getAttribute("uuid")===Z&&(W.oncanplay=function(){W.oncanplay=Q,W.play()},W.ontimeupdate=function(){W.currentTime>.5&&(W.ontimeupdate=Q,a.panoVideo.setMaterial(_))},W.src=q.video.source)}).catch(function(){W.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",K("pano.cancel",{options:i,prevPano:O,progress:0,state:k,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var 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(Z){var W=We(Z);if(Tt(W,r.currentPano))return!1;var Y=r.works.getResolvedObserver(W);return!Y||Y.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:Y.loadable||Y.active}),v=this.models.intersectRaycaster(e)[0];if(v){var p=Pt(h,function(Z){var W=r.works.getResolvedObserver(Z);if(!W)return 1/0;var Y=W.standingPosition.clone();return Y.distanceTo(v.point)},!0),m=p[0],A=p[1];m&&A<this.panoTapTriggerRadius&&(c=(i=this.works.getResolvedObserver(m))!==null&&i!==void 0?i:null)}if(Is(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(Is(c))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(c&&!c.active){var x=c.panoId;this.panoMeshes[x]&&(this.panoMeshes[x].setDisabled(!1),this.panoMeshes[x].setLoading(!0))}var E={};if(c){E.effect="fade";for(var M=Math.PI/6,C=Math.PI/12,S=new d.Vector3(0,1,0),P=c.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),I=P.clone().applyAxisAngle(S,M),B=P.clone().applyAxisAngle(S,-M),L=[],k=[],O=[],N=0,D=c.accessibleIds;N<D.length;N++){var m=D[N],H=We(m);if(!(Tt(H,this.currentPano)||Tt(H,c.pano))){var z=this.works.getResolvedObserver(m);if(z){var U=z.position.clone().sub(c.position).setY(0);P.angleTo(U)<M?O.push(U):I.angleTo(U)<M?L.push(U):B.angleTo(U)<M&&k.push(U)}}}var q=O.length>0?O:rt(rt([],L,!0),k,!0),j=q.slice().sort(function(Z,W){return Z.angleTo(P)-W.angleTo(P)})[0];j&&j.angleTo(u)>C&&(E.longitude=Math.atan2(-j.x,-j.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=ae(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var _={workCode:c.pano.workCode,panoIndex:c.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:c?c.position.clone():new d.Vector3};return this.emit("pano.select",K("pano.select",{prevPano:this.currentPano,state:_,userAction:!0,options:E,progress:0,error:null})),c&&c.active?(this.emit("pano.request",K("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:_,options:E,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,v,p=[],m=2;m<arguments.length;m++)p[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(ae(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),x=w[0],E=w[1],M=this.panoResourceFromLocationMotionKeyframe(x),C=this.panoResourceFromLocationMotionKeyframe(E),S=new d.Vector3().copy(M.position),P=new d.Vector3().copy(C.position),I=this.locationMotion.value.count-E.value.count+1;A.progress=I,C.leftPanoPicture&&(I<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)}),S.copy(P)),y.distance=this.locationMotion.value.distance,y.offset=new d.Vector3(S.x+(P.x-S.x)*I,S.y+(P.y-S.y)*I,S.z+(P.z-S.z)*I);for(var B=[],L=[],k=0,O=this.locationMotion.keyframes;k<O.length;k++){var N=O[k],D=N.key,H=N.progress;D!==void 0&&(B.push(D),H>=this.locationMotion.progress&&L.push(D))}for(var z=0,U=Object.keys(this.panoResources);z<U.length;z++){var q=U[z];if(!(L.indexOf(q)>=0)){var j=this.panoResources[q];if(j.leftPanoPicture){var _=j.leftPanoPicture.map;if(_){if(_===((a=A.pano0)===null||a===void 0?void 0:a.map)||_===((o=A.pano1)===null||o===void 0?void 0:o.map))continue;_ instanceof Le&&_.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(_.cubeRenderTarget),_.dispose(),j.leftPanoPicture=null}}B.indexOf(q)>=0||delete this.panoResources[q]}}this.currentPano=We(C.panoId),this.emit("pano.moving",K("pano.moving",{userAction:this.userAction,prevPano:We(f.panoId),state:F(F(F(F({},We(g.panoId)),{mode:this.mode}),Ve(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}Et(A)===!1&&(!((s=A.pano0)===null||s===void 0)&&s.map&&A.pano0.map instanceof Le&&!A.pano0.map.cubeRenderTarget&&(A.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=A.pano1)===null||u===void 0)&&u.map&&A.pano1.map instanceof Le&&!A.pano1.map.cubeRenderTarget&&(A.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(A)),Et(y)===!1&&this.setCamera(y);var Z=this.works.getResolvedObserver(this.currentPano),W=p[1];if(!W){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var Y=this.xrManager.referenceSpace;if(Y){var ce=this.xrManager.cameraVR,te=this.xrManager.cameraL,se=this.xrManager.cameraR,ue=[te,se],pe=W.getViewerPose(Y),he=new d.Vector3(0,0,0);if(pe){var de;de=this.xrManager.session.renderState.baseLayer;var be=pe.views;if(!de){console.error("no layer found");return}this.renderer.setFramebuffer(de.framebuffer);var fe=!1;be.length!==ce.cameras.length&&(ce.cameras.length=0,fe=!0),this.parallaxCameraMatrixs=[];var Se=new d.Vector3,ee=new d.Vector3;new d.Matrix4().fromArray(be[0].transform.matrix).decompose(Se,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(be[1].transform.matrix).decompose(ee,new d.Quaternion,new d.Vector3),ee.clone().sub(Se).normalize();var le=new d.Vector3,X=new d.Quaternion,Te=new d.Vector3;this.camera.matrix.decompose(le,X,Te);for(var Fe=0;Fe<be.length;Fe++){var Ye=be[Fe],Xe=de.getViewport(Ye),Ge=ue[Fe];Ge.matrix.fromArray(Ye.transform.matrix);var st=new d.Vector3,Ne=new d.Quaternion,me=new d.Vector3;Ge.matrix.decompose(st,Ne,me),he.copy(le),Ge.position.copy(le),Ge.quaternion.copy(Ne),Ge.scale.copy(me),Ge.updateMatrix(),Ge.projectionMatrix.fromArray(Ye.projectionMatrix),Ge.viewport.set(Xe.x,Xe.y,Xe.width,Xe.height),fe===!0&&ce.cameras.push(Ge)}pe.views[0].transform.position,pe.views[1].transform.position;for(var Ae=this.xrManager.session.inputSources,Fe=0;Fe<this.xrManager.controllers.length;Fe++){var nt=this.xrManager.controllers[Fe],Ce=Ae[Fe];if(Ce){nt.update(Ce,W,Y);var He=this.xrManager.getController(Fe),Oe=new d.Vector3(0,1.2,0),it=He.position.clone().add(he).sub(Oe);Ce.handedness==="left"?this.xrControllerRay.left.set(it,new d.Vector3(0,0,-1).applyEuler(He.rotation)):Ce.handedness==="right"&&this.xrControllerRay.right.set(it,new d.Vector3(0,0,-1).applyEuler(He.rotation)),this.controllerWrappers[Fe].position.copy(new d.Vector3(0,0,0).add(he).sub(Oe));var qe=this.models.intersectRaycaster(this.xrControllerRay.right);if(qe.length===0&&(qe=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(lt){var gt;return F({floor:(gt=Z==null?void 0:Z.floorIndex)!==null&&gt!==void 0?gt:0},lt)})),qe.length>=1&&qe[0].face)if(Ce.handedness==="right"){var Zt=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Or=qe[0].face.normal,Je=Or.clone().multiplyScalar(.05),Mt=qe[0].point.clone().add(Je);this.intersectMesh.position.copy(Mt);var Xr=Mt.clone().add(Je);if(this.intersectMesh.lookAt(Xr),Math.abs(Or.y)>.99){var $e=this.camera.position.clone().sub(Mt);this.intersectMesh.rotation.z=-Math.atan2($e.z,$e.x)}this.intersectMesh.visible=!0,this.needsRender=!0,Zt.length>0?(this.pointerLines.right.setPoints(it,Zt[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(it,qe[0].point));var Bt=qe[0],Rt=K("intersect.update",{raycaster:(c=this.xrControllerRay.right)!==null&&c!==void 0?c:null,intersection:Bt!=null?Bt:null,object:this.intersectMesh});if(this.emit("intersect.update",Rt),Rt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(it,qe[0].point)}}if(this.camera.pose.distance>.1||b){if(Z)for(var Ht=0,Yt=Object.keys(this.panoMeshes);Ht<Yt.length;Ht++){var pt=Yt[Ht],Ie=this.panoMeshes[pt];Ie.setOpacity(0),Ie.setCurrent(!1),Ie.updateTime&&Ie.updateTime(e,r)}}else if(Z){var gr=Pt(Z.visibleIds,function(at){var lt=i.works.getResolvedObserver(at);return lt?Z.standingPosition.distanceTo(lt.standingPosition):1/0},!0),Ft=gr[1];Ft=ae(Ft,2.5,1/0);for(var ir=Z.visibleIds.concat(Re(this.currentPano)),kt=this.getForwardObserverOrNot(),mn=this.camera.getDirection(new d.Vector3),Vr=0,Nr=Object.keys(this.panoMeshes);Vr<Nr.length;Vr++){var pt=Nr[Vr],Ie=this.panoMeshes[pt],ar=this.works.getResolvedObserver(pt);if(ir.indexOf(pt)===-1)Ie.setCurrent(!1),Ie.setOpacity(0);else if(!ar)Ie.setCurrent(!1),Ie.setOpacity(0);else if(!ar.loadable&&!ar.active)Ie.setCurrent(!1),Ie.setOpacity(0);else{var or=Ie.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Ie.setCurrent(!Ie.loading&&Ie.progress===0&&kt!==null&&kt.panoId===pt),Ie.setOpacity(or<.01?0:ae(Ft/or*1.2,.65,.98));var et=this.camera.position.clone().setY(Ie.position.y),Ke=new d.Vector3().copy(Ie.position).sub(et).normalize();if(pt===Re(this.currentPano)){var Lt=ae((.5-et.distanceTo(Ie.position))/.5,0,1);Ke.multiplyScalar(1-Lt).add(mn.clone().multiplyScalar(Lt))}Ke.length()>0&&Ie.quaternion.setFromEuler(new d.Euler(0,Math.atan2(Ke.x,Ke.z),0))}Ie.updateTime&&Ie.updateTime(e,r)}}var sr=function(){if(i.tileLevelForFov===!1)return 0;var at=new d.Vector2(4e3,4e3),lt=g.panoId,gt=i.works.getResolvedObserver(lt),yt=i.imageOptions.size;if(typeof yt=="undefined"&&gt){var Hn=gt.images.up.match(/\/cube_(\d+)\//);Hn&&(yt=Number(Hn[1]))}typeof yt=="undefined"&&(yt=2048);var Dr=0;yt>=1024&&(Dr=1),yt>=2048&&(Dr=2),yt>=4096&&(Dr=3),yt>=8192&&(Dr=4);var Ur=i.tileLevelForFov(te.fov,at);return Ur>Dr?Ur:0}(),gn=function(){var at=new d.PerspectiveCamera;at.applyMatrix4(ce.matrix),at.position.set(0,0,0);var lt=i.works.getResolvedObserver(g.panoId),gt=lt!=null?lt:Z;gt&&at.quaternion.premultiply(gt.quaternion.clone().inverse()),at.updateProjectionMatrix(),at.updateMatrixWorld(!0);var yt=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(at.projectionMatrix,at.matrixWorldInverse));return yt}();g.panoId===Re(this.currentPano)&&((l=g.leftPanoPicture)===null||l===void 0?void 0:l.map)instanceof Le&&(g.leftPanoPicture.map.update(gn,sr),g.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0));{var Gn=this.tiling.object.visible;if(sr>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var Qr=g.panoId,ut=this.works.getResolvedObserver(Qr);ut?Ci(this.camera.position,ut.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Qr&&this.tiling.cleanup(),this.tiling.panoId=Qr,this.tiling.setResource((v=(h=ut.images)===null||h===void 0?void 0:h.tiles)!==null&&v!==void 0?v:[],this.enableIOSEDR&&ut.images.luminance?ut.images.luminance:null),this.tiling.setFetcher(dt(ut.work)),this.tiling.setRotation(ut.quaternion),this.tiling.setPosition(ut.position),this.tiling.update(gn,sr,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Gn!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),!(!Ae||Ae.length<1)&&this.updateControllerHelper(Ae,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 v={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=v,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",K("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",K("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>Fs&&this.emit("xr.gesture.press",K("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",K("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<=Fs){var u=this.emit("xr.gesture.tap",K("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}(Ja),Nt={Floorplan:oi,Topview:Lf,Panorama:Ja,VRPanorama:Lh,Model:Vh,DepthPanorama:qh,Mapview:tp,XRPanorama:Ep},l0=["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 Mp(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=Tr(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 Cp(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function Sp(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 Ip(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 c0(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=Ip((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const Tp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR/1XPxwJhp5DAV67T9ZPwFdovhBMIGUYoRBN4wim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o64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var Ls=[351,63],Os=[20,20],Pp=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Bp=new Float32Array([0,0,1,0,0,1,1,1]),Rp=new Uint8Array([0,1,2,1,3,2]),Pi=new d.BufferGeometry;Pi.setAttribute("position",new d.BufferAttribute(Pp,3));Pi.setAttribute("uv",new d.BufferAttribute(Bp,2));Pi.setIndex(new d.BufferAttribute(Rp,1));var si=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),d0=new d.Mesh(Pi,si);d0.matrixAutoUpdate=!1;var no=new d.Scene;no.add(d0);no.matrixAutoUpdate=!1;var zn=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);zn.position.set(0,0,.5);zn.lookAt(0,0,0);zn.updateMatrixWorld(!0);zn.matrixAutoUpdate=!1;var Fp=new d.Vector4,kp=new d.Vector4;function Vs(n){if(si.map){var r=n.getViewport(Fp),i=n.getScissor(kp),a=n.getScissorTest(),o=n.autoClear,s=i.x+Os[0]/3,u=i.y+Os[1]/3,c=Ls[0]/3,l=Ls[1]/3;n.setViewport(s,u,c,l),n.setScissor(s,u,c,l),n.setScissorTest(!0),n.autoClear=!1,n.render(no,zn),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,si.needsUpdate=!0,e.onload=Q},e.src=Tp,si.map=t}}var Lp=800,Op=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/")},Vp=[{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}}],nn=new d.Vector2,ei=new d.Frustum,ti=new d.Matrix4,Ns=new WeakMap,Qs=new WeakMap,Ds=Hu([]),f0=function(n){oe(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,c,l,h,v,p=n.call(this)||this;p.ident=ht(),typeof window!="undefined"&&(Ia.instances[p.ident]=p),p.renderSwitch01=0,p.currentMode="Panorama",p.pano={workCode:"",panoIndex:0},p.needsRender=!1,p.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,p.imageOptions=F({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),p.textureOptions=F({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),p.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,p.extraElements=[],p.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)},p.coordinatesSystemTransformers=rt([],(s=e.coordinatesSystemTransformers)!==null&&s!==void 0?s:[],!0);for(var m=function(L){var k=A.coordinatesSystemTransformers.find(function(O){return O.name===L.name});k||A.coordinatesSystemTransformers.push(F({},L))},A=this,y=0,f=Vp;y<f.length;y++){var g=f[y];m(g)}if(p.fps={testCount:0,testTime:ve()},p.info=null,p.modeChangeDuration=(u=e.modeChangeDuration)!==null&&u!==void 0?u:Lp,p.enableWheel=(c=e.enableWheel)!==null&&c!==void 0?c:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof Hr&&p.throwError(new Error("cannot render a internal renderer")),p.renderer=e.renderer;else try{p.renderer=new Hr({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e==null?void 0:e.webgl2});var b=c0();p.renderer.setPixelRatio(b===1?window.devicePixelRatio:1),p.renderer.setSize(512,512)}catch(L){L instanceof Error&&p.throwError(L)}p.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(h=(l=p.renderer)===null||l===void 0?void 0:l.outputEncoding)!==null&&h!==void 0?h:d.sRGBEncoding}),p.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),p.camera=new fi(90),p.scene=new iu,p.xrCustomObjectsScene=new d.Scene,p.scene.add(p.xrCustomObjectsScene),p.scene.matrixAutoUpdate=!1,p.lastLoadWorkTask=Promise.resolve(),p.requestProxy=(v=e.requestProxy)!==null&&v!==void 0?v:Op,p.networkSubscribe=new Ws,p.networkSubscribe.on("network",function(L,k,O,N){var D;p.emit("network.resource",K("network.resource",{source:L,requestType:k,requestState:O,detail:N})),(D=p.analysis)===null||D===void 0||D.network(p.works,L,k,O,N)}),p.boundingMesh=Cf(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),p.boundingMesh.name="bounding",p.scene.add(p.boundingMesh),p.models=cs(),p.models.push(new Ea),p.lastModels=cs(),p.readyCallbacks=[],p.syncingState=!1,p.modelGroup=new d.Group,p.modelGroup.visible=!1,p.modelGroup.name="model",p.modelGroup.matrixAutoUpdate=!1,p.modelGroup.renderOrder=-4,p.scene.add(p.modelGroup),p.helperGroup=new d.Group,p.helperGroup.name="helper",p.helperGroup.matrixAutoUpdate=!1,p.scene.add(p.helperGroup),p.videoTexture=new d.VideoTexture(e.videoInstance||Cp()),Sp(p.scene),p.copyEffect=new Ii(p.renderer,p.scene,p.camera,p.models),p.state={mode:p.currentMode,workCode:p.pano.workCode,panoIndex:p.pano.panoIndex,longitude:p.camera.pose.longitude,latitude:p.camera.pose.latitude,fov:p.camera.pose.fov,offset:p.camera.pose.offset.clone(),distance:p.camera.pose.distance},p.stateSynced=!1,p._enableIOSEDR=!1,p.destroyed=!1,p.paused=!0,typeof window!="undefined"&&(e.play!==!1&&p.play(),p.stopAnimationLoop=ft.shared.add(function(L,k){for(var O=[],N=2;N<arguments.length;N++)O[N-2]=arguments[N];p.updateTime.apply(p,rt([L,k],O,!1))},!1,0,10));var w=function(){typeof document!="undefined"&&document.fullscreenElement===null&&p.currentMode==="VRPanorama"&&p.controller.emit("vr.requestExit",K("vr.requestExit",{}))},x=function(){p.needsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",w,!1),p.renderer&&p.renderer.domElement.addEventListener("webglcontextrestored",x,!1),p.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",w,!1),p.renderer&&p.renderer.domElement.removeEventListener("webglcontextrestored",x,!1)},p.plugins={},e.plugins&&e.plugins.length)for(var E=0,M=e.plugins;E<M.length;E++){var C=M[E];if(typeof C=="function")C(p);else if(Array.isArray(C)){var S=C[0],P=C[1],I=C[2];if(typeof S=="function"){var B=S(p,I);typeof P=="string"&&(p.plugins[P]?p.throwError(new Error("plugin name ".concat(P," is exists."))):p.plugins[P]=B)}}}return p.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1),p.meshReplaceMaterialMap=new Map,p.meshOriginMaterialMap=new Map,Mp(p),p}return Object.defineProperty(t,"version",{get:function(){return"6.0.0-alpha.82"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Ai.decoderPath},set:function(e){Ai.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return kn.transcoderPath},set:function(e){kn.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new d.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(h){if(!(!(h instanceof d.Mesh)||h instanceof Gt)){var v=Object.keys(i).filter(function(m){return m===h.uuid})[0];if(v)if(s.meshOriginMaterialMap.set(v,h.material),s.meshReplaceMaterialMap.get(v))h.material=s.meshReplaceMaterialMap.get(v);else{var p=new d.ShaderMaterial({uniforms:{color:{value:i[v]}},vertexShader:`
2012
+ `},eo=function(n){le(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(na.uniforms),vertexShader:na.vertexShader,fragmentShader:na.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(eo.prototype,{isLineMaterial:!0});var il=function(n){le(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new $a,i.material=r!==void 0?r:new eo({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,l=0,c=r.count;u<c;u++,l+=2)o.fromBufferAttribute(r,u),s.fromBufferAttribute(i,u),a[l]=l===0?0:a[l-1],a[l+1]=a[l]+o.distanceTo(s);var f=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(f,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,u=this.material,l=u.resolution,c=u.linewidth,f=s.attributes.instanceStart,A=s.attributes.instanceEnd,p=new d.Vector4,y=new d.Vector4,v=new d.Vector4,m=new d.Vector3,h=new d.Matrix4,g=new d.Line3,b=new d.Vector3;i.at(1,v),v.w=1,v.applyMatrix4(a.matrixWorldInverse),v.applyMatrix4(o),v.multiplyScalar(1/v.w),v.x*=l.x/2,v.y*=l.y/2,v.z=0,m.copy(v);var w=this.matrixWorld;h.multiplyMatrices(a.matrixWorldInverse,w);for(var E=0,C=f.count;E<C;E++){p.fromBufferAttribute(f,E),y.fromBufferAttribute(A,E),p.w=1,y.w=1,p.applyMatrix4(h),y.applyMatrix4(h),p.applyMatrix4(o),y.applyMatrix4(o),p.multiplyScalar(1/p.w),y.multiplyScalar(1/y.w);var x=p.z<-1&&y.z<-1,M=p.z>1&&y.z>1;if(!(x||M)){p.x*=l.x/2,p.y*=l.y/2,y.x*=l.x/2,y.y*=l.y/2,g.start.copy(p),g.start.z=0,g.end.copy(y),g.end.z=0;var S=g.closestPointToPointParameter(m,!0);g.at(S,b);var P=d.MathUtils.lerp(p.z,y.z,S),T=P>=-1&&P<=1,B=m.distanceTo(b)<c*.5;if(T&&B){g.start.fromBufferAttribute(f,E),g.end.fromBufferAttribute(A,E),g.start.applyMatrix4(w),g.end.applyMatrix4(w);var F=new d.Vector3,L=new d.Vector3;i.distanceSqToSegment(g.start,g.end,L,F),r.push({point:L,pointOnLine:F,distance:i.origin.distanceTo(L),object:this,faceIndex:E})}}}},t}(d.Mesh);Object.assign(il.prototype,{isLineSegments2:!0});var al=function(n){le(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(il);Object.assign(al.prototype,{isLine2:!0});var ol=function(n){le(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}($a);Object.assign(ol.prototype,{isLineGeometry:!0});var _h="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAA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W8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",Is=14467195,Zh=8,Yh=2,Jh=20,Ts=null,Sa=function(n){le(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 ol,o=new eo({color:Is,linewidth:Yh,dashScale:Jh,dashed:!1});i.line=new al(a,o);var s=new d.BufferGeometry,u=new d.PointsMaterial({color:Is,size:Zh,map:Ts||(Ts=new d.TextureLoader().load(_h)),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.84"},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(Sa.prototype,{isFiveLine:!0});var Ke={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 sl(n){return yi(this,void 0,void 0,function(){var t;return bi(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 $h(n){return yi(this,void 0,void 0,function(){var t,e;return bi(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,sl("".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),yi(this,void 0,void 0,function(){var i,a,o,s,u,l;return bi(this,function(c){switch(c.label){case 0:if(!n)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");return[4,$h(t)];case 1:if(i=c.sent(),n.profiles.some(function(f){var A=i[f];return A&&(a={profileId:f,profilePath:"".concat(t,"/").concat(A.path),deprecated:!!A.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,sl(a.profilePath)];case 2:if(s=c.sent(),r){if(l=void 0,l=s.layouts[n.handedness],!l)throw new Error("No matching handedness, ".concat(n.handedness,", in profile ").concat(a.profileId));l.assetPath&&(u=a.profilePath.replace("profile.json",l.assetPath))}return[2,{profile:s,assetPath:u}]}})})}var tp={xAxis:0,yAxis:0,button:0,state:Ke.ComponentState.DEFAULT};function rp(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 np=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Ke.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(tp)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=rp(e,r),s=o.normalizedXAxis,u=o.normalizedYAxis;switch(this.componentProperty){case Ke.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Ke.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?u:.5;break;case Ke.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Ke.ComponentProperty.STATE:this.valueNodeProperty===Ke.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 np(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Ke.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=k({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Ke.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=Ke.ComponentState.PRESSED:(r.touched||this.values.button>Ke.ButtonTouchThreshold)&&(this.values.state=Ke.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===Ke.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Ke.AxisTouchThreshold&&(this.values.state=Ke.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===Ke.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Ke.AxisTouchThreshold&&(this.values.state=Ke.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),ap=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}(),op="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",sp="generic-trigger",up=function(n){le(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,l=i.valueNodeProperty;a&&(l===Ke.VisualResponseProperty.VISIBILITY?a.visible=u:l===Ke.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,u),a.position.lerpVectors(o.position,s.position,u)))})}))},t}(Mn.Object3D);function lp(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Ke.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Mn.SphereGeometry(.001),s=new Mn.MeshBasicMaterial({color:255}),u=new Mn.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(l){var c=l.valueNodeName,f=l.minNodeName,A=l.maxNodeName,p=l.valueNodeProperty;if(p===Ke.VisualResponseProperty.TRANSFORM){if(l.minNode=t.getObjectByName(f),l.maxNode=t.getObjectByName(A),!l.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!l.maxNode){console.warn("Could not find ".concat(A," in the model"));return}}l.valueNode=t.getObjectByName(c),l.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function Ps(n,t){lp(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 cp=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=op,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new up,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||ep(o,e.path,sp).then(function(s){var u=s.profile,l=s.assetPath;r.motionController=new ap(o,u,l);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),Ps(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(f){e._assetCache[r.motionController.assetUrl]=f,i=f.scene.clone(),Ps(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function dp(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 Bs=300,fp=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),Rs=new d.Vector3(-1,1,1),hp=function(n){le(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new Xh(r.renderer,r.renderer.getContext(),{onSessionStart:function(u){r.emit("xr.session.start",_("xr.session.start",{session:u,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",_("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.pointerLines={left:new Sa,right:new Sa},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.scene.add(r.pointerLines.left,r.pointerLines.right),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=wt()]={panoId:Oe(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new d.Matrix4},r.parallaxCameraMatrixs=[];var i=lt.shared.getContext();if(!i)return console.error("获取session失败,请退出重试"),r;r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(i),r.controllerWrappers=[new d.Group,new d.Group],r.scene.add(r.controllerWrappers[0],r.controllerWrappers[1]);var a=r.xrManager.getController(0);r.controllerWrappers[0].add(a);var o=r.xrManager.getController(1);r.controllerWrappers[1].add(o);var s=new cp;return s.gltfLoader={load:function(u,l){ui.ajax(u,{responseType:"arraybuffer"}).then(function(c){var f;return Da(c.body,{resourcePath:u.slice(0,u.lastIndexOf("/")+1),search:(f=u.split("?")[1])!==null&&f!==void 0?f:"",fetcher:ui})}).then(function(c){return l(c)})}},r.on("xr.session.start",function(){var u=r.xrManager.getControllerGrip(0);u.add(s.createControllerModel(u)),r.controllerWrappers[0].add(u);var l=r.xrManager.getControllerGrip(1);l.add(s.createControllerModel(l)),r.controllerWrappers[1].add(l)}),r.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}},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=k(k({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,u,l,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var A=this.imageOptions.size;if(typeof A=="undefined"&&f){var p=f.images.up.match(/\/cube_(\d+)\//);p&&(A=Number(p[1]))}typeof A=="undefined"&&(A=2048);var y=this.imageOptions.transform,v=function(T,B){return dp(li(T,y,B))},m=k({key:"pano.".concat(f.panoId)},gr(this.imageOptions,["format","size","quality"])),h=f.images,g=(u=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(T){return T.size>A}))!==null&&u!==void 0?u:null,b="pano:"+Bn([h,m,y]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var w=this.pendingTextureTask.panoId;(l=this.panoMeshes[w])===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",_("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var E=this.models.getMaterial()||{},C=E.pano0,x=E.pano1,M;if((C==null?void 0:C.map.name)===b?M=C:(x==null?void 0:x.map.name)===b&&(M=x),M){var S={panoId:f.panoId,effect:c,leftPanoPicture:{map:M.map,luminanceMap:M.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,Rs)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};this.doMoveToPano(f.pano,S,r);return}var P="move-to-pano-"+f.panoId;this.pending.add(P),this.pendingTextureTask={panoId:f.panoId,hash:b,onLoad:function(T){if(a.pending.delete(P),a.destroyed)T.body.dispose();else{T.body.name=b;var B={panoId:f.panoId,effect:c,leftPanoPicture:{map:T.body,luminanceMap:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,Rs)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,B,r)}},onError:function(T){a.pending.delete(P);var B=k(k(k({},f.pano),{mode:a.mode}),je(a.camera.pose));a.emit("pano.error",_("pano.error",{error:T,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:B})),a.emit("pano.cancel",_("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:B})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&g&&g.length?this.textureLoader.loadTiledCubeTexture(h,g,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:m},format:d.RGBAFormat,minFilter:d.NearestFilter,magFilter:d.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:ut(f.work)},void 0,void 0,function(T){var B,F;a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:T,meta:null,pano:f.pano})),((B=a.pendingTextureTask)===null||B===void 0?void 0:B.hash)===b&&((F=a.panoMeshes[f.panoId])===null||F===void 0||F.setProgress(T))},this.renderer):this.textureLoader.loadCubeTexture(h,{imageURL:{transform:v,options:m},format:d.RGBAFormat,fetcher:ut(f.work)},void 0,void 0,function(T){var B,F;((B=a.pendingTextureTask)===null||B===void 0?void 0:B.hash)===b&&((F=a.panoMeshes[f.panoId])===null||F===void 0||F.setProgress(T)),a.emit("pano.texture.progress",_("pano.texture.progress",{error:null,progress:T,meta:null,pano:f.pano}))},this.renderer)]).then(function(T){var B,F,L=T[0];((B=a.pendingTextureTask)===null||B===void 0?void 0:B.hash)===b?(a.pendingTextureTask.onLoad(L),(F=a.panoMeshes[f.panoId])===null||F===void 0||F.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",_("pano.texture.success",{error:null,progress:1,meta:L.meta,pano:f.pano}))):L.body.dispose()}).catch(function(T){var B,F;((B=a.pendingTextureTask)===null||B===void 0?void 0:B.hash)===b&&(a.pendingTextureTask.onError(T),(F=a.panoMeshes[f.panoId])===null||F===void 0||F.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",_("pano.texture.error",{error:T,progress:0,meta:null,pano:f.pano})),a.emit("error",T))}),this.emit("pano.texture.load",_("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,u,l,c,f,A,p,y,v;i===void 0&&(i={});var m=be(),h=wt();this.panoResources[h]=r;var g=1,b,w,E;if(this.locationMotion.ended){var C=this.locationMotion.getKeyFrameSegment(m);C[0];var x=C[1],M=this.locationMotion.value,S=this.panoResourceFromLocationMotionKeyframe(x).position,P=r.position;b=Math.max(S.distanceTo(P),g),w=[{key:x.key,progress:0,value:k(k({},M),{count:0})},{key:h,progress:1,value:{distance:0,count:1}}],E=0}else{var T=this.locationMotion.getKeyFrameSegment(m),B=T[0],x=T[1],M=this.locationMotion.value,F=this.panoResourceFromLocationMotionKeyframe(B).position,S=this.panoResourceFromLocationMotionKeyframe(x).position,P=r.position,L=x.value.count-M.count,O=Math.max(F.distanceTo(S),g)*L,Q=Math.max(S.distanceTo(P),g);b=O+Q,w=[{key:B.key,progress:0,value:k({},M)},{key:x.key,progress:O/b,value:x.value},{key:h,progress:1,value:{count:x.value.count+1,distance:0}}];var N=this.locationMotionKeyframesLength(this.locationMotion.keyframes),H=this.locationMotionKeyframesLength(w);E=this.locationMotion.getProgressVelocity(m)*N/H}var K=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?b:0),U={longitude:i.longitude,latitude:i.latitude,fov:i.fov},G=k(k({},e),{mode:this.mode,longitude:(o=U.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=U.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(u=U.fov)!==null&&u!==void 0?u:this.camera.pose.fov,offset:r.position.clone(),distance:0}),X=this.currentPano;this.emit("pano.moveTo",_("pano.moveTo",{options:i,prevPano:X,progress:0,state:G,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(G),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=D,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null);var Z=kt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),q=kt({longitude:(l=U.longitude)!==null&&l!==void 0?l:this.cameraMotion.value.longitude,latitude:(c=U.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),W=new d.Object3D;W.lookAt(Z);var J=new d.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(q);for(var ve=new d.Matrix4().makeRotationFromQuaternion(W.quaternion),re=new d.Matrix4().getInverse(J).premultiply(ve),se=0;se<w.length-1;se++){var ie=w[se].key;if(ie){var pe=this.panoResources[ie];pe&&pe.fixCameraTransform.copy(re)}}r.effect==="fly"?this.cameraMotion.set(U,K).catch(D):this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(f=U.longitude)!==null&&f!==void 0?f:this.cameraMotion.value.longitude,latitude:(A=U.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:1,value:{longitude:(p=U.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(y=U.latitude)!==null&&y!==void 0?y:this.cameraMotion.value.latitude,fov:(v=U.fov)!==null&&v!==void 0?v:this.cameraMotion.value.fov}}],K).catch(D);var ne=this.locationMotion.setKeyframes(w,K,E);ne.then(function(){var de,ce,fe,$=k(k({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",_("pano.arrived",{options:i,prevPano:X,progress:1,state:$,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback($);var te=a.works.getResolvedObserver(a.currentPano);if(te&&te.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var j=fp.clone().multiply((fe=(ce=(de=a.models.getMaterial())===null||de===void 0?void 0:de.pano1)===null||ce===void 0?void 0:ce.matrix)!==null&&fe!==void 0?fe:new d.Matrix4).multiply(te.video.matrix),Le={map:a.videoTexture,size:te.video.size,matrix:j,alpha:1},Ce=wt(),ge=a.videoTexture.image;ge.setAttribute("uuid",Ce),Xu().then(function(ke){ke&&te.video&&ge.getAttribute("uuid")===Ce&&(ge.oncanplay=function(){ge.oncanplay=D,ge.play()},ge.ontimeupdate=function(){ge.currentTime>.5&&(ge.ontimeupdate=D,a.panoVideo.setMaterial(Le))},ge.src=te.video.source)}).catch(function(){ge.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",_("pano.cancel",{options:i,prevPano:X,progress:0,state:G,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),l=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var f=c.accessibleIds.filter(function(q){var W=ht(q);if(qt(W,r.currentPano))return!1;var J=r.works.getResolvedObserver(W);return!J||J.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:J.loadable||J.active}),A=this.models.intersectRaycaster(e)[0];if(A){var p=nr(f,function(q){var W=r.works.getResolvedObserver(q);if(!W)return 1/0;var J=W.standingPosition.clone();return J.distanceTo(A.point)},!0),y=p[0],v=p[1];y&&v<this.panoTapTriggerRadius&&(l=(i=this.works.getResolvedObserver(y))!==null&&i!==void 0?i:null)}if(Ms(l)){var m=this.getForwardObserverOrNot(e);m&&(l=m)}for(var h=0,g=this.locationMotion.keyframes;h<g.length;h++){var b=g[h],w=this.panoResourceFromLocationMotionKeyframe(b);if(!(b.progress<this.locationMotion.progress)&&l&&w.panoId===l.panoId){l=null;break}}if(Ms(l))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(l&&!l.active){var E=l.panoId;this.panoMeshes[E]&&(this.panoMeshes[E].setDisabled(!1),this.panoMeshes[E].setLoading(!0))}var C={};if(l){for(var x=Math.PI/6,M=Math.PI/12,S=new d.Vector3(0,1,0),P=l.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),T=P.clone().applyAxisAngle(S,x),B=P.clone().applyAxisAngle(S,-x),F=[],L=[],O=[],Q=0,N=l.accessibleIds;Q<N.length;Q++){var y=N[Q],H=ht(y);if(!(qt(H,this.currentPano)||qt(H,l.pano))){var K=this.works.getResolvedObserver(y);if(K){var U=K.position.clone().sub(l.position).setY(0);P.angleTo(U)<x?O.push(U):T.angleTo(U)<x?F.push(U):B.angleTo(U)<x&&L.push(U)}}}var G=O.length>0?O:pt(pt([],F,!0),L,!0),X=G.slice().sort(function(q,W){return q.angleTo(P)-W.angleTo(P)})[0];X&&X.angleTo(u)>M&&(C.longitude=Math.atan2(-X.x,-X.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(C.latitude=he(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(C.fov=this.defaultFov);var Z={workCode:l.pano.workCode,panoIndex:l.pano.panoIndex,mode:this.mode,longitude:(a=C.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=C.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=C.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:l?l.position.clone():new d.Vector3};return this.emit("pano.select",_("pano.select",{prevPano:this.currentPano,state:Z,userAction:!0,options:C,progress:0,error:null})),l&&l.active?(this.emit("pano.request",_("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:Z,options:C,error:null})),l.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,l,c,f,A,p=[],y=2;y<arguments.length;y++)p[y-2]=arguments[y];this.userAction=!0;var v={},m={},h=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),m.longitude=this.cameraMotion.value.longitude,m.latitude=this.cameraMotion.value.latitude,m.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),E=w[0],C=w[1],x=this.panoResourceFromLocationMotionKeyframe(E),M=this.panoResourceFromLocationMotionKeyframe(C),S=new d.Vector3().copy(x.position),P=new d.Vector3().copy(M.position),T=this.locationMotion.value.count-C.value.count+1;v.progress=T,M.leftPanoPicture&&(T<1?x.leftPanoPicture&&(v.pano0=x.leftPanoPicture):v.pano0=M.leftPanoPicture,v.pano1=M.leftPanoPicture),M.effect==="montage"?v.transition="BLACK":M.effect==="spread"?v.transition="SPREAD":v.transition="FADE",T<1&&M.effect!=="fly"&&(v.pano0&&x.leftPanoPicture&&(v.pano0={map:v.pano0.map,luminanceMap:v.pano0.luminanceMap,matrix:x.leftPanoPicture.matrix.clone().setPosition(M.position)}),S.copy(P),b=!0),m.distance=this.locationMotion.value.distance,m.offset=new d.Vector3(S.x+(P.x-S.x)*T,S.y+(P.y-S.y)*T,S.z+(P.z-S.z)*T);for(var B=[],F=[],L=0,O=this.locationMotion.keyframes;L<O.length;L++){var Q=O[L],N=Q.key,H=Q.progress;N!==void 0&&(B.push(N),H>this.locationMotion.progress&&F.push(N))}for(var K=0,U=Object.keys(this.panoResources);K<U.length;K++){var G=U[K];if(!(F.indexOf(G)>=0)){var X=this.panoResources[G];if(X.leftPanoPicture){var Z=X.leftPanoPicture.map;if(Z){if(Z===((a=v.pano0)===null||a===void 0?void 0:a.map)||Z===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;Z instanceof Fe&&Z.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(Z.cubeRenderTarget),Z.dispose(),X.leftPanoPicture=null}}B.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=ht(M.panoId),this.emit("pano.moving",_("pano.moving",{userAction:this.userAction,prevPano:ht(h.panoId),state:k(k(k(k({},ht(g.panoId)),{mode:this.mode}),je(this.camera.pose)),m),options:{},progress:this.locationMotion.progress,error:null}))}Vt(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof Fe&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((u=v.pano1)===null||u===void 0)&&u.map&&v.pano1.map instanceof Fe&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(v)),Vt(m)===!1&&this.setCamera(m);var q=this.works.getResolvedObserver(this.currentPano),W=p[1];if(!W){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var J=this.xrManager.referenceSpace;if(J){var ve=this.xrManager.cameraVR,re=this.xrManager.cameraL,se=this.xrManager.cameraR,ie=[re,se],pe=W.getViewerPose(J),ne=new d.Vector3(0,0,0);if(pe){var de;de=this.xrManager.session.renderState.baseLayer;var ce=pe.views;if(!de){console.error("no layer found");return}this.renderer.setFramebuffer(de.framebuffer);var fe=!1;ce.length!==ve.cameras.length&&(ve.cameras.length=0,fe=!0),this.parallaxCameraMatrixs=[];var $=new d.Vector3,te=new d.Vector3;new d.Matrix4().fromArray(ce[0].transform.matrix).decompose($,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(ce[1].transform.matrix).decompose(te,new d.Quaternion,new d.Vector3),te.clone().sub($).normalize();var j=new d.Vector3,Le=new d.Quaternion,Ce=new d.Vector3;this.camera.matrix.decompose(j,Le,Ce);for(var ge=0;ge<ce.length;ge++){var ke=ce[ge],Ne=de.getViewport(ke),De=ie[ge];De.matrix.fromArray(ke.transform.matrix);var We=new d.Vector3,Ae=new d.Quaternion,me=new d.Vector3;De.matrix.decompose(We,Ae,me),ne.copy(j),De.position.copy(j),De.quaternion.copy(Ae),De.scale.copy(me),De.updateMatrix(),De.projectionMatrix.fromArray(ke.projectionMatrix),De.viewport.set(Ne.x,Ne.y,Ne.width,Ne.height),fe===!0&&ve.cameras.push(De)}pe.views[0].transform.position,pe.views[1].transform.position;for(var Te=this.xrManager.session.inputSources,ge=0;ge<this.xrManager.controllers.length;ge++){var Ue=this.xrManager.controllers[ge],Ee=Te[ge];if(Ee){Ue.update(Ee,W,J);var Qe=this.xrManager.getController(ge),Be=new d.Vector3(0,1.2,0),Ge=Qe.position.clone().add(ne).sub(Be);Ee.handedness==="left"?this.xrControllerRay.left.set(Ge,new d.Vector3(0,0,-1).applyEuler(Qe.rotation)):Ee.handedness==="right"&&this.xrControllerRay.right.set(Ge,new d.Vector3(0,0,-1).applyEuler(Qe.rotation)),this.controllerWrappers[ge].position.copy(new d.Vector3(0,0,0).add(ne).sub(Be));var it=this.models.intersectRaycaster(this.xrControllerRay.right);if(it.length===0&&(it=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(ot){var At;return k({floor:(At=q==null?void 0:q.floorIndex)!==null&&At!==void 0?At:0},ot)})),it.length>=1&&it[0].face)if(Ee.handedness==="right"){var tt=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Nt=it[0].face.normal,Wt=Nt.clone().multiplyScalar(.05),Ze=it[0].point.clone().add(Wt);this.intersectMesh.position.copy(Ze);var ir=Ze.clone().add(Wt);if(this.intersectMesh.lookAt(ir),Math.abs(Nt.y)>.99){var Qt=this.camera.position.clone().sub(Ze);this.intersectMesh.rotation.z=-Math.atan2(Qt.z,Qt.x)}this.intersectMesh.visible=!0,this.needsRender=!0,tt.length>0?(this.pointerLines.right.setPoints(Ge,tt[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Ge,it[0].point));var St=it[0],It=_("intersect.update",{raycaster:(l=this.xrControllerRay.right)!==null&&l!==void 0?l:null,intersection:St!=null?St:null,object:this.intersectMesh});if(this.emit("intersect.update",It),It.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Ge,it[0].point)}}if(this.camera.pose.distance>.1||b)for(var Dt=0,Xt=Object.keys(this.panoMeshes);Dt<Xt.length;Dt++){var vt=Xt[Dt],Pe=this.panoMeshes[vt];Pe.setOpacity(0),Pe.setCurrent(!1),Pe.updateTime&&Pe.updateTime(e,r),Pe.visible=!1}else if(q){var ar=nr(q.visibleIds,function(rt){var ot=i.works.getResolvedObserver(rt);return ot?q.standingPosition.distanceTo(ot.standingPosition):1/0},!0),_t=ar[1];_t=he(_t,2.5,1/0);for(var dn=q.visibleIds.concat(Oe(this.currentPano)),or=this.getForwardObserverOrNot(),fn=this.camera.getDirection(new d.Vector3),Lr=0,Zt=Object.keys(this.panoMeshes);Lr<Zt.length;Lr++){var vt=Zt[Lr],Pe=this.panoMeshes[vt],Xe=this.works.getResolvedObserver(vt);if(dn.indexOf(vt)===-1)Pe.setCurrent(!1),Pe.setOpacity(0);else if(!Xe)Pe.setCurrent(!1),Pe.setOpacity(0);else if(!Xe.loadable&&!Xe.active)Pe.setCurrent(!1),Pe.setOpacity(0);else{var Je=Pe.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Pe.setCurrent(!Pe.loading&&Pe.progress===0&&or!==null&&or.panoId===vt),Pe.setOpacity(Je<.01?0:he(_t/Je*1.2,.65,.98));var Tt=this.camera.position.clone().setY(Pe.position.y),sr=new d.Vector3().copy(Pe.position).sub(Tt).normalize();if(vt===Oe(this.currentPano)){var hn=he((.5-Tt.distanceTo(Pe.position))/.5,0,1);sr.multiplyScalar(1-hn).add(fn.clone().multiplyScalar(hn))}sr.length()>0&&Pe.quaternion.setFromEuler(new d.Euler(0,Math.atan2(sr.x,sr.z),0))}Pe.updateTime&&Pe.updateTime(e,r)}}var Kr=function(){if(i.tileLevelForFov===!1)return 0;var rt=new d.Vector2(4e3,4e3),ot=g.panoId,At=i.works.getResolvedObserver(ot),mt=i.imageOptions.size;if(typeof mt=="undefined"&&At){var Gn=At.images.up.match(/\/cube_(\d+)\//);Gn&&(mt=Number(Gn[1]))}typeof mt=="undefined"&&(mt=2048);var Vr=0;mt>=1024&&(Vr=1),mt>=2048&&(Vr=2),mt>=4096&&(Vr=3),mt>=8192&&(Vr=4);var Nr=i.tileLevelForFov(re.fov,rt);return Nr>Vr?Nr:0}(),pn=function(){var rt=new d.PerspectiveCamera;rt.applyMatrix4(ve.matrix),rt.position.set(0,0,0);var ot=i.works.getResolvedObserver(g.panoId),At=ot!=null?ot:q;At&&rt.quaternion.premultiply(At.quaternion.clone().inverse()),rt.updateProjectionMatrix(),rt.updateMatrixWorld(!0);var mt=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(rt.projectionMatrix,rt.matrixWorldInverse));return mt}();g.panoId===Oe(this.currentPano)&&((c=g.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Fe&&(g.leftPanoPicture.map.update(pn,Kr),g.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0));{var zn=this.tiling.object.visible;if(Kr>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var Or=g.panoId,at=this.works.getResolvedObserver(Or);at?Dn(this.camera.position,at.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==Or&&this.tiling.cleanup(),this.tiling.panoId=Or,this.tiling.setResource((A=(f=at.images)===null||f===void 0?void 0:f.tiles)!==null&&A!==void 0?A:[],this.enableIOSEDR&&at.images.luminance?at.images.luminance:null),this.tiling.setFetcher(ut(at.work)),this.tiling.setRotation(at.quaternion),this.tiling.setPosition(at.position),this.tiling.update(pn,Kr,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;zn!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),!(!Te||Te.length<1)&&this.updateControllerHelper(Te,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 l=e[u].handedness,c=e[u].gamepad;switch(l){case"left":c.axes&&(this.emitEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitEvent(c.buttons[1].pressed,"LeftPinch",r));var f={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=f;break;case"right":c.axes&&(this.emitEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitEvent(c.axes[2]===1,"RightAxesRight",r),this.emitEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitEvent(c.buttons[1].pressed,"RightPinch",r));var A={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=A,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",_("xr.controller.update",s))}},t.prototype.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>Bs&&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<=Bs){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}(Za),Rt={Floorplan:Ma,Topview:Ff,Panorama:Za,VRPanorama:Fh,Model:Lh,Mapview:qh,XRPanorama:hp},ul=["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 pp(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=kt(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 vp(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function Ap(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 mp(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],u=s.split("="),l=(t=u[0])===null||t===void 0?void 0:t.trim(),c=(e=u[1])===null||e===void 0?void 0:e.trim();l&&c&&(r[l]=c)}return r}function ll(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=mp((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const gp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0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42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var Fs=[351,63],ks=[20,20],yp=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),bp=new Float32Array([0,0,1,0,0,1,1,1]),wp=new Uint8Array([0,1,2,1,3,2]),Ii=new d.BufferGeometry;Ii.setAttribute("position",new d.BufferAttribute(yp,3));Ii.setAttribute("uv",new d.BufferAttribute(bp,2));Ii.setIndex(new d.BufferAttribute(wp,1));var oi=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),cl=new d.Mesh(Ii,oi);cl.matrixAutoUpdate=!1;var to=new d.Scene;to.add(cl);to.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 Ep=new d.Vector4,xp=new d.Vector4;function Ls(n){if(oi.map){var r=n.getViewport(Ep),i=n.getScissor(xp),a=n.getScissorTest(),o=n.autoClear,s=i.x+ks[0]/3,u=i.y+ks[1]/3,l=Fs[0]/3,c=Fs[1]/3;n.setViewport(s,u,l,c),n.setScissor(s,u,l,c),n.setScissorTest(!0),n.autoClear=!1,n.render(to,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,oi.needsUpdate=!0,e.onload=D},e.src=gp,oi.map=t}}var Cp=800,Mp=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/")},Sp=[{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}}],gn=new d.Vector2,$n=new d.Frustum,ei=new d.Matrix4,Os=new WeakMap,Vs=new WeakMap,Ns=ya([]),dl=function(n){le(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,u,l,c,f,A,p=n.call(this)||this;p.ident=wt(),typeof window!="undefined"&&(Ia.instances[p.ident]=p),p.renderSwitch01=0,p.currentMode="Panorama",p.pano={workCode:"",panoIndex:0},p.needsRender=!1,p.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,p.imageOptions=k({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),p.textureOptions=k({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),p.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,p.extraElements=[],p.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},p.coordinatesSystemTransformers=pt([],(s=e.coordinatesSystemTransformers)!==null&&s!==void 0?s:[],!0);for(var y=function(F){var L=v.coordinatesSystemTransformers.find(function(O){return O.name===F.name});L||v.coordinatesSystemTransformers.push(k({},F))},v=this,m=0,h=Sp;m<h.length;m++){var g=h[m];y(g)}if(p.fps={testCount:0,testTime:be()},p.info=null,p.modeChangeDuration=(u=e.modeChangeDuration)!==null&&u!==void 0?u:Cp,p.enableWheel=(l=e.enableWheel)!==null&&l!==void 0?l:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof Dr&&p.throwError(new Error("cannot render a internal renderer")),p.renderer=e.renderer;else try{p.renderer=new Dr({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e==null?void 0:e.webgl2});var b=ll();p.renderer.setPixelRatio(b===1?window.devicePixelRatio:1),p.renderer.setSize(512,512)}catch(F){F instanceof Error&&p.throwError(F)}p.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(f=(c=p.renderer)===null||c===void 0?void 0:c.outputEncoding)!==null&&f!==void 0?f:d.sRGBEncoding}),p.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),p.camera=new Ei(90),p.scene=new ru,p.xrCustomObjectsScene=new d.Scene,p.scene.add(p.xrCustomObjectsScene),p.scene.matrixAutoUpdate=!1,p.lastLoadWorkTask=Promise.resolve(),p.requestProxy=(A=e.requestProxy)!==null&&A!==void 0?A:Mp,p.networkSubscribe=new qs,p.networkSubscribe.on("network",function(F,L,O,Q){var N;p.emit("network.resource",_("network.resource",{source:F,requestType:L,requestState:O,detail:Q})),(N=p.analysis)===null||N===void 0||N.network(p.works,F,L,O,Q)}),p.boundingMesh=Mf(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),p.boundingMesh.name="bounding",p.scene.add(p.boundingMesh),p.models=us(),p.models.push(new Ea),p.lastModels=us(),p.lastWorks=ya([]),p.readyCallbacks=[],p.syncingState=!1,p.modelGroup=new d.Group,p.modelGroup.visible=!1,p.modelGroup.name="model",p.modelGroup.matrixAutoUpdate=!1,p.modelGroup.renderOrder=-4,p.scene.add(p.modelGroup),p.helperGroup=new d.Group,p.helperGroup.name="helper",p.helperGroup.matrixAutoUpdate=!1,p.scene.add(p.helperGroup),p.videoTexture=new d.VideoTexture(e.videoInstance||vp()),Ap(p.scene),p.copyEffect=new Mi(p.renderer,p.scene,p.camera,p.models),p.state={mode:p.currentMode,workCode:p.pano.workCode,panoIndex:p.pano.panoIndex,longitude:p.camera.pose.longitude,latitude:p.camera.pose.latitude,fov:p.camera.pose.fov,offset:p.camera.pose.offset.clone(),distance:p.camera.pose.distance},p.stateSynced=!1,p._enableIOSEDR=!1,p.destroyed=!1,p.paused=!0,typeof window!="undefined"&&(e.play!==!1&&p.play(),p.stopAnimationLoop=lt.shared.add(function(F,L){for(var O=[],Q=2;Q<arguments.length;Q++)O[Q-2]=arguments[Q];p.updateTime.apply(p,pt([F,L],O,!1))},!1,0,10));var w=function(){typeof document!="undefined"&&document.fullscreenElement===null&&p.currentMode==="VRPanorama"&&p.controller.emit("vr.requestExit",_("vr.requestExit",{}))},E=function(){p.needsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",w,!1),p.renderer&&p.renderer.domElement.addEventListener("webglcontextrestored",E,!1),p.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",w,!1),p.renderer&&p.renderer.domElement.removeEventListener("webglcontextrestored",E,!1)},p.plugins={},e.plugins&&e.plugins.length)for(var C=0,x=e.plugins;C<x.length;C++){var M=x[C];if(typeof M=="function")M(p);else if(Array.isArray(M)){var S=M[0],P=M[1],T=M[2];if(typeof S=="function"){var B=S(p,T);typeof P=="string"&&(p.plugins[P]?p.throwError(new Error("plugin name ".concat(P," is exists."))):p.plugins[P]=B)}}}return p.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1),p.meshReplaceMaterialMap=new Map,p.meshOriginMaterialMap=new Map,pp(p),p}return Object.defineProperty(t,"version",{get:function(){return"6.0.0-alpha.84"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return pi.decoderPath},set:function(e){pi.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Pn.transcoderPath},set:function(e){Pn.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new d.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(f){if(!(!(f instanceof d.Mesh)||f instanceof Mt)){var A=Object.keys(i).filter(function(y){return y===f.uuid})[0];if(A)if(s.meshOriginMaterialMap.set(A,f.material),s.meshReplaceMaterialMap.get(A))f.material=s.meshReplaceMaterialMap.get(A);else{var p=new d.ShaderMaterial({uniforms:{color:{value:i[A]}},vertexShader:`
2021
2013
  void main() {
2022
2014
  vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
2023
2015
  gl_Position = projectionMatrix * mvPosition;
@@ -2027,4 +2019,4 @@ void main() {
2027
2019
  void main() {
2028
2020
  gl_FragColor = vec4( color, 1.0 );
2029
2021
  }
2030
- `});p.depthTest=h.material.depthTest,p.side=h.material.side,s.meshReplaceMaterialMap.set(v,p),h.material=p}}});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 Gt||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 Ia.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 Hr&&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",K("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(nn);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(nn),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(nn);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 Hr)){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 Hr&&(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,Sf(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=Qs.get(this);if(!e)return Ds;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!Ga.has(a))return Ds}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 Tf(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,v;a===void 0&&(a=!0);var p=[];if(Array.isArray(e))for(var m=0,A=e;m<A.length;m++){var y=A[m];typeof y!="string"&&"work"in y?p.push(Ln(y.work,y)):p.push(Ln(y))}else p.push(Ln(e));for(var f=Hu(p),g=function(U){var q=b,j=new Oa({allowHosts:U.allowHosts,get requestProxy(){return q.requestProxy},get networkSubscribe(){return q.networkSubscribe}});Jd(U,j)},b=this,w=0,x=f;w<x.length;w++){var E=x[w];g(E)}var M=this.works;r===void 0&&(r=M.length!==0?"inherit":"initial");var C=f.initial,S=C.work.observers[0],P=S?{workCode:S.work.workCode,panoIndex:S.panoIndex}:{workCode:C.work.workCode,panoIndex:0},I=(s=C.mode)!==null&&s!==void 0?s:S?"Panorama":"Mapview",B={};if(r==="inherit"){I=this.currentMode;var L=f.resolvedObservers[this.panoIndex];L?P={workCode:L.work.workCode,panoIndex:L.panoIndex}:typeof f.initial.panoIndex=="number"?P={workCode:f.initial.work.workCode,panoIndex:f.initial.panoIndex}:(I==="Panorama"||I==="DepthPanorama"||I==="VRPanorama"||I==="XRPanorama")&&(I="Mapview"),B={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&&(I=C.mode),B={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(I=(c=r.mode)!==null&&c!==void 0?c:this.currentMode,typeof r.panoIndex=="number"){var L=f.getResolvedObserver({workCode:(h=(l=r.workCode)!==null&&l!==void 0?l:C.work.workCode)!==null&&h!==void 0?h:"",panoIndex:r.panoIndex});L&&(P={workCode:L.work.workCode,panoIndex:L.panoIndex})}B={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var k=F(F(F({},P),{mode:I}),B);this.emit("works.request",K("works.request",{input:e,works:f,state:k,userAction:a}));var O=function(){o.pano=P;var U=o.controller?i!=null?i:o.modeChangeDuration:0,q=F(F({initial:{state:k,currentState:o.getCurrentState(),duration:U,userAction:a}},o.commonParams()),o.controllerInits[I]);if(o.controller&&o.currentMode===I)o.controller.updateWork(f,k,U,a)===!1&&(o.controller.destroy(),o.controller=o.applyController(I,q));else{var j=o.currentMode,_=Nt[I].initAnimationEndState(q);if(o.controller)o.controller.destroy();else{var Z=Nt[I].initAnimationEndState(q);o.camera.setFromPose(Z),o.modelGroup.visible=!0,o.emit("camera.update",K("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(I,q);var W=K("mode.change",{prevMode:j,mode:I,state:_,userAction:a});o.emit("mode.change",W)}};if(Qs.set(this,f),!this.controller){var N=F(F({initial:{state:k,currentState:this.getCurrentState(),duration:0,userAction:a}},this.commonParams()),this.controllerInits[I]),D=Nt[I].initAnimationEndState(N);this.camera.setFromPose(D),this.emit("camera.update",K("camera.update",{state:this.getCurrentState(),userAction:a}))}if(I===t.Mode.Floorplan||I===t.Mode.Topview||I===t.Mode.Mapview||I===t.Mode.Model)this.loadModel(f).then(function(){o.needsRender=!0,O(),o.emit("camera.update",K("camera.update",{state:o.getCurrentState(),userAction:a}))});else{if(!this.controller){var H=new d.Vector3,z=f.getResolvedObserver(P);z&&H.copy(z.position),this.camera.setFromPose({fov:B.fov,longitude:B.longitude,latitude:B.latitude,distance:B.distance,offset:(v=B.offset)!==null&&v!==void 0?v:H}),this.needsRender=!0}O(),this.controller.once("pano.moveTo",function(){o.needsRender=!0,o.emit("camera.update",K("camera.update",{state:o.getCurrentState(),userAction:a})),o.loadModel(f)})}return this.emit("works.load",K("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:f})),this.ready().then(function(){var U;o.emit("works.ready",K("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,v;if(!s.renderer)throw new Error("renderer is not initialized.");r=F({},r);var p=typeof r.panoIndex=="number"?{workCode:(v=(l=r.workCode)!==null&&l!==void 0?l:(h=s.work)===null||h===void 0?void 0:h.workCode)!==null&&v!==void 0?v:"",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(p)){var m=new Error("PanoId ".concat(Re(p)," 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?Tt(s.pano,p)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(p,F({duration:i},r),a):s.controller.updateCamera(r,i,a).catch(Q):(Tt(s.pano,p)||(s.pano=p),s.controller.updateCamera(r,i,a).catch(Q));else{var b=F(F({},r),p),w=F(F({initial:{state:b,currentState:s.getCurrentState(),duration:i,userAction:a}},s.commonParams()),s.controllerInits[e]),x=Nt[e].initAnimationEndState(w),E=K("mode.change.request",{prevMode:s.currentMode,mode:e,state:x,userAction:a});if(s.emit("mode.change.request",E),!E.defaultPrevented){A&&A.destroy(),s.controller=s.applyController(e,w);var M=K("mode.change",{prevMode:s.currentMode,mode:e,state:x,userAction:a});s.emit("mode.change",M)}}u()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),Pf().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=ft.shared.getContext();g?g.end():Bf().then(function(b){ft.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=ae(e,Math.floor(i/2),Math.floor(u.x-i)),r=ae(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(nn);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(nn);return this.screenBuffers.forEach(function(s){s.setSize(o.x,o.y)}),this.renderer.setRenderTarget(this.screenBuffers[0]),this.controller.render(),this.info={memory:F({},this.controller.renderer.info.memory),render:F({},this.controller.renderer.info.render)},this.currentMode!=="VRPanorama"&&this.currentMode!=="XRPanorama"&&this.poweredByRealsee&&Vs(this.renderer),e&&ft.shared.add(e,!0),this.screenBuffers[0]}else return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(),i.info={memory:F({},i.controller.renderer.info.memory),render:F({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:F({},i.renderer.info.memory),render:F({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&Vs(i.renderer)),e&&ft.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,rt([e,r],u,!1)),this.renderer){var l=this.getSize(nn),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){kn.detectSupport(this.renderer);var v=this.models.loaded,p=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),v===!1&&this.models.loaded===!0&&this.emit("models.load",K("models.load",{models:this.models})),p===!1&&this.models.refined===!0&&this.emit("models.refined",K("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 x=new d.Box3,E=new d.Box3,M=new d.Vector3(4,4,4),C=0,S=this.works.resolvedObservers;C<S.length;C++){var P=S[C];E.setFromCenterAndSize(P.position,M),x.union(E)}x.union(this.models.bounding),x.getCenter(this.boundingMesh.position),x.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(x);var I=(o=this.models.getMaterial())!==null&&o!==void 0?o:{},B=1-((s=I.modelAlpha)!==null&&s!==void 0?s:0);I.opacity=ae(B*4-3,0,1),I.clippers=null,I.shownFloorIndex=-2,this.boundingMesh.setMaterial(I),this.boundingMesh.needsRender=!1}var L=K("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",L),!L.defaultPrevented){var k=[];ti.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ei.setFromProjectionMatrix(ti);for(var O=0,N=this.scene.children;O<N.length;O++){var D=N[O];D!==this.modelGroup&&D!==this.boundingMesh&&D instanceof d.Object3D&&D.traverseVisible(function(W){if(W.setResolution&&W.setResolution(b.x,b.y),W.setTime&&W.setTime(e),W.mixer instanceof d.AnimationMixer){var Y=Ns.get(W.mixer);Y||(Y=new d.Clock,Ns.set(W.mixer,Y)),W.mixer.update(Y.getDelta())}(W instanceof d.Mesh||W instanceof d.Line||W instanceof d.Points)&&(W instanceof d.ImmediateRenderObject||!W.frustumCulled||ei.intersectsObject(W))&&k.push(W)})}if(w.width*w.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var H=void 0;if(this.onlyRenderIfNeeds!==!0)H=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=k;z<U.length;z++){var q=U[z],j=function(W){W.needsRender===!0?(W.needsRender=!1,a.needsRender=!0):W.mixer&&W.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};j(q),q.traverseAncestors(j)}this.needsRender!==!1&&(H=this.render())}if(this.needsRender=!1,this.controller&&this.screenBuffers){var _=this.controller,Z=this.screenBuffers;this.aroundScissor(function(){_.postProcessing(Z,a.postProcessingType)})}this.hasListener("render")&&this.emit("render",K("render",{needsRender:H!==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 Hr&&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=F({key:"pano.".concat(a.panoId,".").concat(u)},nr(i.imageOptions,["size","format","quality","mappings"])),l=a.images[u],h=i.imageOptions.transform?i.imageOptions.transform(l,c):Wt(l,c);return dt(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,v=c.x*this.scissor.left+(u.x+1)/2*l,p=c.y*(1-this.scissor.bottom-this.scissor.height)+(-u.y+1)/2*h;return new d.Vector2(v,p)},t.prototype.getRenderObjects=function(e){ti.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),ei.setFromProjectionMatrix(ti),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||ei.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return F(F({},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,v,p,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,x;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 E={workCode:A==null?void 0:A.workCode,panoIndex:A==null?void 0:A.panoIndex};typeof e.longitude=="number"&&(E.longitude=e.longitude),typeof e.latitude=="number"&&(E.latitude=e.latitude),typeof e.fov=="number"&&(E.fov=e.fov),typeof e.distance=="number"&&(E.distance=e.distance),e.offset instanceof d.Vector3&&(E.offset=e.offset);var M=F(F({initial:{state:E,currentState:this.getCurrentState(),duration:this.modeChangeDuration,userAction:!1}},this.commonParams()),this.controllerInits[y]),C=Nt[y].initAnimationEndState(M);f=C.longitude,g=C.latitude,b=C.fov,w=C.offset,x=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,x=(v=e.distance)!==null&&v!==void 0?v:this.state.distance;var S={workCode:(A!=null?A:this.pano).workCode,panoIndex:(A!=null?A:this.pano).panoIndex,mode:y,longitude:f,latitude:g,fov:b,offset:w,distance:x};this.emit("state.set",K("state.set",{userAction:i,state:S})),Gr(this.state,S)||(this.controller&&S.mode==="VRPanorama"&&S.mode!==this.state.mode?(dr(this.state,S),this.changeMode("VRPanorama")):this.controller&&S.mode==="XRPanorama"&&S.mode!==this.state.mode?(dr(this.state,S),this.changeMode("XRPanorama")):(dr(this.state,S),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===S.mode&&(this.syncingState=this.syncState(ve(),0,r),this.syncingState&&((p=this.controller)===null||p===void 0||p.updateTime(ve(),0),this.syncingState=!1)),this.emit("state.change",K("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 Nt.Model){if(Ma(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,F(F({},s),{duration:i?0:void 0}),!1),!0}}else{var u={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!Tt(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 Nt.Floorplan||this.controller instanceof Nt.Topview||this.controller instanceof Nt.Mapview){var c=1,l=.2,h=.2,v=Math.PI/45,p=i?this.state.fov:Zi(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:Zi(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):If(this.camera.pose.offset,this.state.offset,g),w=i?{longitude:this.state.longitude,latitude:this.state.latitude}:vs({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},v),x=w.longitude,E=w.latitude;if(Xt(p,this.camera.pose.fov)||Ma(b,this.camera.pose.offset)||Xt(y,this.camera.pose.distance)||Xt(x,this.camera.pose.longitude,Math.PI*2)||Xt(E,this.camera.pose.latitude)){var M={x:b.x,y:b.y,z:b.z},C={fov:p};return Object.assign(M,{distance:y}),Object.assign(C,{longitude:x,latitude:E}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(C,0).catch(Q),this.controller.locationMotion.set(M,0).catch(Q),!0}}else{var S=1,P=Math.PI/45,p=i?this.state.fov:Zi(this.camera.pose.fov,this.state.fov,S),I=i?{longitude:this.state.longitude,latitude:this.state.latitude}:vs({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},P),x=I.longitude,E=I.latitude;if(Xt(x,this.camera.pose.longitude,Math.PI*2)||Xt(E,this.camera.pose.latitude)||Xt(p,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:x,latitude:E,fov:p},0).catch(Q),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",K("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var B=this.currentMode,L=B===t.Mode.Floorplan||B===t.Mode.Topview||B===t.Mode.Mapview||B===t.Mode.Model;if(!L||this.models.loaded){var k=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var O=0,N=k;O<N.length;O++){var D=N[O];this.controller instanceof Nt.Panorama&&D.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(D):D()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(i){var a;r.readyCallbacks.push(Object.assign(i,{tile:(a=e.tile)!==null&&a!==void 0?a:!1}))})},t.prototype.requestFullscreen=function(){var e;if(Sn()){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e){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 Ea({coordinatesSystemTransformers:o.coordinatesSystemTransformers,onError:function(g){r.emit("model.error",K("model.request",{work:A,model:f,error:g}))},onShownFloorChange:function(g){r.emit("model.changeShownFloor",K("model.request",{work:A,model:f,error:null}))},onLoad:function(){r.emit("model.load",K("model.request",{work:A,model:f,error:null}))}});i.push(f),o.emit("model.request",K("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 v=h[l];i.indexOf(v)===-1&&this.lastModels.push(v)}this.models.length=0}for(var p=0,m=i;p<m.length;p++){var v=m[p];this.models.push(v)}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=Nt[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,rt([y],f,!1));if(b)return!1})},h=0,v=l0;h<v.length;h++){var p=v[h];l(p)}{var m=Nt[e].initAnimationEndState(r),A=r.initial.userAction;Gr(this.state,m)||(dr(this.state,m),this.emit("state.change",K("state.change",{userAction:A,state:this.state}))),this.emit("currentState.change",K("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&&!Gr(i.state,g)&&(dr(i.state,g),i.emit("state.change",K("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",K("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&&!Gr(i.state,g)&&(dr(i.state,g),i.emit("state.change",K("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&&!Gr(i.state,g)&&(dr(i.state,g),i.emit("state.change",K("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&&!Gr(i.state,g)&&(dr(i.state,g),i.emit("state.change",K("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&&!Gr(i.state,g)&&(dr(i.state,g),i.emit("state.change",K("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",K("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}(Ei),Ia={instances:{},constructor:f0};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:Ia});var Np=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=ft;exports.Camera=fi;exports.Fetcher=Oa;exports.Five=f0;exports.InternalWebGLRenderer=Hr;exports.IntersectMesh=Mi;exports.Model=Ea;exports.ModelViewLayer=ii;exports.NetworkSubscribe=Ws;exports.PBMContainer=$s;exports.PBMGroup=_l;exports.PBMMesh=Gt;exports.PBMMeshMaterial=Un;exports.PROXY_CONTROLLER_EVENT_NAMES=l0;exports.PanoCircleMesh=ja;exports.PanoCircleMeshCustom=yf;exports.PanoCircleMeshSolid=vf;exports.RequestScheduler=pa;exports.Scene=iu;exports.Subscribe=Ei;exports.TextureLoader=An;exports.Tile=Qa;exports.Tile3DModel=Qt;exports.TileCubeTextureTarget=Le;exports.TileNode=mu;exports.Tileset=ri;exports.TilesetCache=lu;exports.TilesetTraverser=va;exports.Work=Ha;exports.XRButton=Np;exports.defaultImageURLTransform=Wt;exports.defaultPbmParameters=ye;exports.getViewportScale=c0;exports.imageSupport=_s;exports.isPanoId=Ys;exports.loadAt3d=Qu;exports.loadB3dm=Cu;exports.loadDome=Du;exports.loadDomez=zu;exports.loadPbm=Ou;exports.loadPnts=Iu;exports.panoEqual=Tt;exports.panoParse=We;exports.panoStringify=Re;exports.parseWork=Ln;
2022
+ `});p.depthTest=f.material.depthTest,p.side=f.material.side,s.meshReplaceMaterialMap.set(A,p),f.material=p}}});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 l=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,l),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse(function(f){!(f instanceof d.Mesh)||f instanceof Mt||s.meshOriginMaterialMap.get(f.uuid)&&(f.material=s.meshOriginMaterialMap.get(f.uuid))}),this.models.setMaterial({constantColor:null});var c=Object.keys(i).filter(function(f){return i[f].equals(new d.Color().setRGB(l[0]/255,l[1]/255,l[2]/255))})[0];return c||!1},t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete Ia.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(l){l.dispose()}),this.meshOriginMaterialMap.forEach(function(l){l.dispose()}),this.renderer instanceof Dr&&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(gn);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(gn),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(gn);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,r){r===void 0&&(r=!0);var i=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),this.currentMode==="Panorama"&&(i=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),this.currentMode==="Model"&&(i=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),this.currentMode==="Floorplan"&&(i=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),this.currentMode==="Topview"&&(i=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.topview),this.currentMode==="Mapview"&&(i=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),this.currentMode==="VRPanorama"&&(i=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(i=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&i&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof Dr)){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,l=u===void 0?a.offsetHeight:u;this.renderer instanceof Dr&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(s,l))}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,Sf(this.camera,r)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=Vs.get(this);if(!e)return Ns;for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!Ga.has(a))return Ns}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 Tf(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,l,c,f,A,p,y;a===void 0&&(a=!0);var v={};typeof i=="number"?v.duration=i:typeof i=="object"&&Object.assign(v,i),this.controller||(v.duration=0,v.effect="instant");var m=[];if(Array.isArray(e))for(var h=0,g=e;h<g.length;h++){var b=g[h];typeof b!="string"&&"work"in b?m.push(Rn(b.work,b)):m.push(Rn(b))}else m.push(Rn(e));for(var w=ya(m),E=function(q){var W=C,J=new Oa({allowHosts:q.allowHosts,get requestProxy(){return W.requestProxy},get networkSubscribe(){return W.networkSubscribe}});Jd(q,J)},C=this,x=0,M=w;x<M.length;x++){var S=M[x];E(S)}this.lastWorks=this.works,r===void 0&&(r="inherit"),r==="inherit"&&this.lastWorks.length===0&&(r="initial");var P=w.initial,T=P.work.observers[0],B=T?{workCode:T.work.workCode,panoIndex:T.panoIndex}:{workCode:P.work.workCode,panoIndex:0},F=(s=P.mode)!==null&&s!==void 0?s:T?"Panorama":"Mapview",L={};if(r==="inherit"){F=this.currentMode;var O=w.resolvedObservers[this.panoIndex];O?B={workCode:O.work.workCode,panoIndex:O.panoIndex}:typeof w.initial.panoIndex=="number"?B={workCode:w.initial.work.workCode,panoIndex:w.initial.panoIndex}:(F==="Panorama"||F==="VRPanorama"||F==="XRPanorama")&&(F="Mapview"),L={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 P.panoIndex=="number"&&(B={workCode:P.work.workCode,panoIndex:P.panoIndex}),P.mode&&(F=P.mode),L={longitude:P.longitude,latitude:P.latitude,fov:P.fov,distance:P.distance,offset:(u=P.offset)===null||u===void 0?void 0:u.clone()};else{if(F=(l=r.mode)!==null&&l!==void 0?l:this.currentMode,typeof r.panoIndex=="number"){var O=w.getResolvedObserver({workCode:(f=(c=r.workCode)!==null&&c!==void 0?c:P.work.workCode)!==null&&f!==void 0?f:"",panoIndex:r.panoIndex});O&&(B={workCode:O.work.workCode,panoIndex:O.panoIndex})}L={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var Q=k(k(k({},B),{mode:F}),L);this.emit("works.request",_("works.request",{input:e,works:w,state:Q,userAction:a}));var N=function(){var q,W;o.pano=B;var J=(q=v.duration)!==null&&q!==void 0?q:o.modeChangeDuration,ve=(W=v.effect)!==null&&W!==void 0?W:"fade",re=k(k({initial:{state:Q,currentState:o.getCurrentState(),duration:J,effect:ve,userAction:a}},o.commonParams()),o.controllerInits[F]);if(o.controller&&o.currentMode===F)o.controller.updateWork(w,Q,{effect:ve,duration:J},a)===!1&&(o.controller.destroy(),o.controller=o.applyController(F,re));else{var se=o.currentMode,ie=Rt[F].initAnimationEndState(re);if(o.controller)o.controller.destroy();else{var pe=Rt[F].initAnimationEndState(re);o.camera.setFromPose(pe),o.modelGroup.visible=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))}o.controller=o.applyController(F,re);var ne=_("mode.change",{prevMode:se,mode:F,state:ie,userAction:a});o.emit("mode.change",ne)}};if(Vs.set(this,w),!this.controller){var H=k(k({initial:{state:Q,currentState:this.getCurrentState(),duration:(A=v.duration)!==null&&A!==void 0?A:this.modeChangeDuration,effect:(p=v.effect)!==null&&p!==void 0?p:"fade",userAction:a}},this.commonParams()),this.controllerInits[F]),K=Rt[F].initAnimationEndState(H);this.camera.setFromPose(K),this.emit("camera.update",_("camera.update",{state:this.getCurrentState(),userAction:a}))}if(this.updateConfiguration(v,!1),F===t.Mode.Floorplan||F===t.Mode.Topview||F===t.Mode.Mapview||F===t.Mode.Model)this.loadModel(w,v).then(function(){o.needsRender=!0,N(),o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a}))});else{if(!this.controller){var U=new d.Vector3,G=w.getResolvedObserver(B);G&&U.copy(G.position),this.camera.setFromPose({fov:L.fov,longitude:L.longitude,latitude:L.latitude,distance:L.distance,offset:(y=L.offset)!==null&&y!==void 0?y:U}),this.needsRender=!0}N();var X=!1,Z=function(){o.needsRender=!0,o.emit("camera.update",_("camera.update",{state:o.getCurrentState(),userAction:a})),setTimeout(function(){X===!1&&(o.loadModel(w,v),X=!0)},v.duration)};this.controller.once("pano.moveTo",Z),this.controller.once("pano.cancel",Z)}return this.emit("works.load",_("works.load",{input:e,state:this.getCurrentState(),userAction:a,works:w})),this.ready().then(function(){var q;o.emit("works.ready",_("works.ready",{input:e,state:o.getCurrentState(),userAction:a,works:w})),(q=o.analysis)===null||q===void 0||q.work(w)})},t.prototype.changeMode=function(e,r,i,a,o){var s=this;return r===void 0&&(r={}),a===void 0&&(a=!0),o===void 0&&(o=!1),new Promise(function(u,l){var c,f,A,p;if(!s.renderer)throw new Error("renderer is not initialized.");r=k({},r);var y=0;s.controller&&(typeof i=="number"?y=i:y=(c=i==null?void 0:i.duration)!==null&&c!==void 0?c:s.modeChangeDuration);var v="fly";s.controller&&typeof i=="object"&&i.effect&&(v=i.effect);var m=typeof r.panoIndex=="number"?{workCode:(p=(f=r.workCode)!==null&&f!==void 0?f:(A=s.work)===null||A===void 0?void 0:A.workCode)!==null&&p!==void 0?p:"",panoIndex:r.panoIndex}:s.pano;if(!t.Mode.hasOwnProperty(e)){var h=new Error('mode "'.concat(e,'" is not existed'));s.throwError(h),l(h);return}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&!s.models.loaded){var h=new Error("model is not ready.");s.throwError(h),l(h);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(m)){var h=new Error("PanoId ".concat(Oe(m)," not existed."));s.throwError(h),l(h);return}var g=s.controller,b=s.currentMode,w=function(){if(s.controller&&s.controller.stopMomentumMovement(),s.controller&&o===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?qt(s.pano,m)&&"moveToPano"in s.controller&&typeof s.controller.moveToPano=="function"?s.controller.moveToPano(m,k({duration:y},r),a):s.controller.updateCamera(r,y,a).catch(D):(qt(s.pano,m)||(s.pano=m),s.controller.updateCamera(r,y,a).catch(D));else{var C=k(k({},r),m),x=k(k({initial:{state:C,currentState:s.getCurrentState(),duration:y,effect:v,userAction:a}},s.commonParams()),s.controllerInits[e]),M=Rt[e].initAnimationEndState(x),S=_("mode.change.request",{prevMode:s.currentMode,mode:e,state:M,userAction:a});if(s.emit("mode.change.request",S),!S.defaultPrevented){g&&g.destroy(),s.controller=s.applyController(e,x);var P=_("mode.change",{prevMode:s.currentMode,mode:e,state:M,userAction:a});s.emit("mode.change",P)}}u()};if(e===t.Mode.VRPanorama)s.requestFullscreen(),Pf().then(function(){return w()}).catch(function(C){C instanceof Error&&(s.exitFullscreen(),s.throwError(C),l(C))});else if(e===t.Mode.XRPanorama){var E=lt.shared.getContext();E?E.end():Bf().then(function(C){lt.shared.setContext(C),w()}).catch(function(C){C instanceof Error&&(s.throwError(C),l(C))})}else w()})},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=he(e,Math.floor(i/2),Math.floor(u.x-i)),r=he(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 l=new Uint8Array(i*o*a*o*4);return this.renderer.readRenderTargetPixels(s,0,0,i*o,a*o,l),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),l},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},Object.defineProperty(t.prototype,"observers",{get:function(){return this.works.resolvedObservers},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){var i=this;if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var a=this.renderer.getSize(gn);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(gn);return this.screenBuffers.forEach(function(s){s.setSize(o.x,o.y)}),this.renderer.setRenderTarget(this.screenBuffers[0]),this.controller.render(),this.info={memory:k({},this.controller.renderer.info.memory),render:k({},this.controller.renderer.info.render)},this.currentMode!=="VRPanorama"&&this.currentMode!=="XRPanorama"&&this.poweredByRealsee&&Ls(this.renderer),e&&lt.shared.add(e,!0),this.screenBuffers[0]}else return this.aroundScissor(function(){i.renderer&&(i.controller?(i.controller.render(),i.info={memory:k({},i.controller.renderer.info.memory),render:k({},i.controller.renderer.info.render)}):(i.renderer.render(i.scene,i.camera),i.info={memory:k({},i.renderer.info.memory),render:k({},i.renderer.info.render)}),i.poweredByRealsee&&i.currentMode!=="VRPanorama"&&i.currentMode!=="XRPanorama"&&Ls(i.renderer)),e&&lt.shared.add(e,!0)}),null},t.prototype.updateTime=function(e,r){for(var i,a=this,o,s,u=[],l=2;l<arguments.length;l++)u[l-2]=arguments[l];if(!this.destroyed){if(this.works.update(),this.syncingState=this.syncState(e,r),this.controller&&(i=this.controller).updateTime.apply(i,pt([e,r],u,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.updateTime(e,r),this.renderer){Pn.detectSupport(this.renderer);var c=this.models.loaded,f=this.models.refined;if(this.models.update(this.renderer,this.camera,this.currentMode),c===!1&&this.models.loaded===!0&&this.emit("models.load",_("models.load",{models:this.models})),f===!1&&this.models.refined===!0&&this.emit("models.refined",_("models.refined",{models:this.models})),this.models.loaded){for(var A=0,p=this.models;A<p.length;A++){var y=p[A];y.parent!==this.modelGroup&&(this.modelGroup.add(y),this.needsRender=!0)}if(this.lastModels.length>0){for(var v=0,m=this.lastModels;v<m.length;v++){var y=m[v];this.modelGroup.remove(y),y.dispose(),this.needsRender=!0}this.lastModels.length=0}this.lastWorks&&delete this.lastWorks}this.lastModels.setMaterial(this.models.getMaterial()),this.lastModels.materialVersion=this.models.materialVersion,this.lastModels.update(this.renderer,this.camera,this.currentMode)}this.syncingState=!1;var h=new d.Vector2(512,512),g=new d.Vector2(512,512);this.renderer&&(this.renderer.getSize(h),h.x*=this.scissor.width,h.y*=this.scissor.height,this.renderer.getDrawingBufferSize(g),g.x*=this.scissor.width,g.y*=this.scissor.height);{for(var b=new d.Box3,w=new d.Box3,E=new d.Vector3(4,4,4),C=0,x=this.works.resolvedObservers;C<x.length;C++){var M=x[C];w.setFromCenterAndSize(M.position,E),b.union(w)}if(b.union(this.models.bounding),this.lastWorks)for(var S=0,P=this.lastWorks.resolvedObservers;S<P.length;S++){var M=P[S];w.setFromCenterAndSize(M.position,E),b.union(w)}b.union(this.lastModels.bounding),b.getCenter(this.boundingMesh.position),b.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(b);var T=(o=this.models.getMaterial())!==null&&o!==void 0?o:{},B=1-((s=T.modelAlpha)!==null&&s!==void 0?s:0);T.opacity=he(B*4-3,0,1),T.clippers=null,T.shownFloorIndex=-2,this.boundingMesh.setMaterial(T),this.boundingMesh.needsRender=!1}var F=_("render.prepare",{needsRender:!0,info:null});if(this.emit("render.prepare",F),!F.defaultPrevented){var L=[];ei.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),$n.setFromProjectionMatrix(ei);for(var O=0,Q=this.scene.children;O<Q.length;O++){var N=Q[O];N!==this.modelGroup&&N!==this.boundingMesh&&N instanceof d.Object3D&&N.traverseVisible(function(W){if(W.setResolution&&W.setResolution(h.x,h.y),W.setTime&&W.setTime(e),W.mixer instanceof d.AnimationMixer){var J=Os.get(W.mixer);J||(J=new d.Clock,Os.set(W.mixer,J)),W.mixer.update(J.getDelta())}(W instanceof d.Mesh||W instanceof d.Line||W instanceof d.Points)&&(W instanceof d.ImmediateRenderObject||!W.frustumCulled||$n.intersectsObject(W))&&L.push(W)})}if(g.width*g.height>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderer&&this.paused===!1&&this.renderSwitch01===0){var H=void 0;if(this.onlyRenderIfNeeds!==!0)H=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 K=0,U=L;K<U.length;K++){var G=U[K],X=function(W){W.needsRender===!0?(W.needsRender=!1,a.needsRender=!0):W.mixer&&W.mixer.stats.actions.inUse>0&&(a.needsRender=!0)};X(G),G.traverseAncestors(X)}this.needsRender!==!1&&(H=this.render())}if(this.needsRender=!1,this.controller&&this.screenBuffers){var Z=this.controller,q=this.screenBuffers;this.aroundScissor(function(){Z.postProcessing(q,a.postProcessingType)})}this.hasListener("render")&&this.emit("render",_("render",{needsRender:H!==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 Dr&&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 l={workCode:u.work.workCode,panoIndex:u.panoIndex};return"moveToPano"in o&&typeof o.moveToPano=="function"?o.moveToPano(l,r,i):u&&(this.pano=l,this.once("initAnimation.start",function(c){r.moveStartCallback&&r.moveStartCallback(c.state)}),this.once("initAnimation.end",function(c){r.moveEndCallback&&r.moveEndCallback(c.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},i)),this.ready()},t.prototype.preloadPano=function(e,r){var i=this;r===void 0&&(r=D);var a=this.works.getResolvedObserver(e);if(!a)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var o=["right","left","up","down","front","back"],s=be();return Promise.all(o.map(function(u){var l=k({key:"pano.".concat(a.panoId,".").concat(u)},gr(i.imageOptions,["size","format","quality","mappings"])),c=a.images[u],f=i.imageOptions.transform?i.imageOptions.transform(c,l):Ht(c,l);return ut(a.work).preload(f)})).then(function(){var u=be()-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 l=this.renderer.getSize(new d.Vector2),c=l.x*this.scissor.width,f=l.y*this.scissor.height,A=l.x*this.scissor.left+(u.x+1)/2*c,p=l.y*(1-this.scissor.bottom-this.scissor.height)+(-u.y+1)/2*f;return new d.Vector2(A,p)},t.prototype.getRenderObjects=function(e){ei.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),$n.setFromProjectionMatrix(ei),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||$n.intersectsObject(i))&&r.push(i)}),r},t.prototype.getCurrentState=function(){return k(k({},this.getPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,i){var a,o,s,u,l,c,f,A,p,y;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 v;typeof e.panoIndex=="number"&&(e.workCode?v={workCode:e.workCode,panoIndex:e.panoIndex}:v={workCode:(o=(a=this.work)===null||a===void 0?void 0:a.workCode)!==null&&o!==void 0?o:"",panoIndex:e.panoIndex});var m=(s=e.mode)!==null&&s!==void 0?s:this.state.mode,h,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!==m){if(m==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var C={workCode:v==null?void 0:v.workCode,panoIndex:v==null?void 0:v.panoIndex};typeof e.longitude=="number"&&(C.longitude=e.longitude),typeof e.latitude=="number"&&(C.latitude=e.latitude),typeof e.fov=="number"&&(C.fov=e.fov),typeof e.distance=="number"&&(C.distance=e.distance),e.offset instanceof d.Vector3&&(C.offset=e.offset);var x=k(k({initial:{state:C,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[m]),M=Rt[m].initAnimationEndState(x);h=M.longitude,g=M.latitude,b=M.fov,w=M.offset,E=M.distance}else h=(u=e.longitude)!==null&&u!==void 0?u:this.state.longitude,g=(l=e.latitude)!==null&&l!==void 0?l:this.state.latitude,b=(c=e.fov)!==null&&c!==void 0?c:this.state.fov,w=(f=e.offset)!==null&&f!==void 0?f:this.state.offset,E=(A=e.distance)!==null&&A!==void 0?A:this.state.distance;var S={workCode:(v!=null?v:this.pano).workCode,panoIndex:(v!=null?v:this.pano).panoIndex,mode:m,longitude:h,latitude:g,fov:b,offset:w,distance:E};this.emit("state.set",_("state.set",{userAction:i,state:S})),Sr(this.state,S)||(this.controller&&S.mode==="VRPanorama"&&S.mode!==this.state.mode?(er(this.state,S),this.changeMode("VRPanorama")):this.controller&&S.mode==="XRPanorama"&&S.mode!==this.state.mode?(er(this.state,S),this.changeMode("XRPanorama")):(er(this.state,S),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===S.mode&&(this.syncingState=this.syncState(be(),0,r),this.syncingState&&((p=this.controller)===null||p===void 0||p.updateTime(be(),0),this.syncingState=!1)),this.emit("state.change",_("state.change",{userAction:i,state:this.state})),(y=this.analysis)===null||y===void 0||y.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 Rt.Model){if(xa(this.camera.pose.offset,this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,k(k({},s),{duration:i?0:void 0}),!1),!0}}else{var u={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!qt(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 Rt.Floorplan||this.controller instanceof Rt.Topview||this.controller instanceof Rt.Mapview){var l=1,c=.2,f=.2,A=Math.PI/45,p=i?this.state.fov:Xi(this.camera.pose.fov,this.state.fov,l),y=Math.abs(this.camera.pose.distance-this.state.distance),v=y>f*15?y/15:c,m=i?this.state.distance:Xi(this.camera.pose.distance,this.state.distance,v),h=this.camera.pose.offset.distanceTo(this.state.offset),g=h>f*15?h/15:f,b=i?new d.Vector3().copy(this.state.offset):If(this.camera.pose.offset,this.state.offset,g),w=i?{longitude:this.state.longitude,latitude:this.state.latitude}:hs({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},A),E=w.longitude,C=w.latitude;if(Kt(p,this.camera.pose.fov)||xa(b,this.camera.pose.offset)||Kt(m,this.camera.pose.distance)||Kt(E,this.camera.pose.longitude,Math.PI*2)||Kt(C,this.camera.pose.latitude)){var x={x:b.x,y:b.y,z:b.z},M={fov:p};return Object.assign(x,{distance:m}),Object.assign(M,{longitude:E,latitude:C}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(M,0).catch(D),this.controller.locationMotion.set(x,0).catch(D),!0}}else{var S=1,P=Math.PI/45,p=i?this.state.fov:Xi(this.camera.pose.fov,this.state.fov,S),T=i?{longitude:this.state.longitude,latitude:this.state.latitude}:hs({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},P),E=T.longitude,C=T.latitude;if(Kt(E,this.camera.pose.longitude,Math.PI*2)||Kt(C,this.camera.pose.latitude)||Kt(p,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:E,latitude:C,fov:p},0).catch(D),!0}if(this.stateSynced=!0,a===!1&&this.emit("state.synced",_("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var B=this.currentMode,F=B===t.Mode.Floorplan||B===t.Mode.Topview||B===t.Mode.Mapview||B===t.Mode.Model;if(!F||this.models.loaded){var L=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var O=0,Q=L;O<Q.length;O++){var N=Q[O];this.controller instanceof Rt.Panorama&&N.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(N):N()}}}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(xn()){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e,r){for(var i=this,a=[],o=function(m){var h=s.models.filter(function(b){var w;return((w=b.work)===null||w===void 0?void 0:w.workCode)===m.workCode})[0];if(h)h.work=m,a.push(h);else{var g=new Ea({coordinatesSystemTransformers:s.coordinatesSystemTransformers,onError:function(b){i.emit("model.error",_("model.request",{work:m,model:g,error:b}))},onShownFloorChange:function(b){i.emit("model.changeShownFloor",_("model.request",{work:m,model:g,error:null}))},onLoad:function(){i.emit("model.load",_("model.request",{work:m,model:g,error:null}))}});a.push(g),s.emit("model.request",_("model.request",{work:m,model:g,error:null})),g.load(m,{textureOptions:s.textureOptions,"3d-tiles":r["3d-tiles"]})}},s=this,u=0,l=e;u<l.length;u++){var c=l[u];o(c)}if(this.models.length>0){for(var f=0,A=this.models;f<A.length;f++){var p=A[f];a.indexOf(p)===-1&&this.lastModels.push(p)}this.models.length=0}for(var y=0,v=a;y<v.length;y++){var p=v[y];this.models.push(p)}return this.renderer&&(this.models.loaded=!1),new Promise(function(m){i.on("models.load",function(){m()})})},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=Rt[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 l=new a(r),c=function(m){l.on(m,function(){for(var h=[],g=0;g<arguments.length;g++)h[g]=arguments[g];var b=i.emit.apply(i,pt([m],h,!1));if(b)return!1})},f=0,A=ul;f<A.length;f++){var p=A[f];c(p)}{var y=Rt[e].initAnimationEndState(r),v=r.initial.userAction;Sr(this.state,y)||(er(this.state,y),this.emit("state.change",_("state.change",{userAction:v,state:this.state}))),this.emit("currentState.change",_("currentState.change",{userAction:v,state:this.getCurrentState()}))}return l.on("camera.update",function(m){var h;if(i.controller){var g=i.controller.getTargetState();m.userAction&&i.syncingState===!1&&i.state.mode===g.mode&&!Sr(i.state,g)&&(er(i.state,g),i.emit("state.change",_("state.change",{userAction:m.userAction,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}i.emit("currentState.change",_("currentState.change",{userAction:m.userAction,state:i.getCurrentState()}))}),l.on("initAnimation.start",function(m){var h,g=m.state,b=m.userAction;b&&i.state.mode===g.mode&&!Sr(i.state,g)&&(er(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),l.on("initAnimation.end",function(m){var h,g=m.state,b=m.userAction;b&&i.state.mode===g.mode&&!Sr(i.state,g)&&(er(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),l.on("pano.moveTo",function(m){var h,g=m.state,b=m.userAction;i.pano={workCode:g.workCode,panoIndex:g.panoIndex},b&&i.state.mode===g.mode&&!Sr(i.state,g)&&(er(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),l.on("pano.arrived",function(m){var h,g=m.state,b=m.userAction;b&&i.state.mode===g.mode&&!Sr(i.state,g)&&(er(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),l.on("pano.cancel",function(m){var h,g=m.state,b=m.userAction;b&&i.state.mode===g.mode&&!Sr(i.state,g)&&(er(i.state,g),i.emit("state.change",_("state.change",{userAction:b,state:i.state})),(h=i.analysis)===null||h===void 0||h.state(i.works,i.state))}),l.on("pano.moveTo",function(m){var h=m.userAction;i.emit("currentState.change",_("currentState.change",{userAction:h,state:i.getCurrentState()}))}),l.on("pano.request",function(m){i.emit("pano.request",m),m.defaultPrevented||i.moveToPano(m.state,m.options,m.userAction)}),l.on("vr.requestExit",function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))}),l.on("error",function(m){return i.throwError(m)}),l},t.prototype.removeEventListeners=function(){},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(wi),Ia={instances:{},constructor:dl};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__:Ia});var Ip=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=lt;exports.Camera=Ei;exports.Fetcher=Oa;exports.Five=dl;exports.InternalWebGLRenderer=Dr;exports.IntersectMesh=xi;exports.Model=Ea;exports.ModelViewLayer=ii;exports.NetworkSubscribe=qs;exports.PBMContainer=Ys;exports.PBMGroup=X0;exports.PBMMesh=Mt;exports.PBMMeshMaterial=Qn;exports.PROXY_CONTROLLER_EVENT_NAMES=ul;exports.PanoCircleMesh=qu;exports.PanoCircleMeshCustom=yf;exports.PanoCircleMeshSolid=vf;exports.RequestScheduler=fa;exports.Scene=ru;exports.Subscribe=wi;exports.TextureLoader=Nn;exports.Tile=Qa;exports.Tile3DModel=en;exports.TileCubeTextureTarget=Fe;exports.TileNode=vu;exports.Tileset=ri;exports.TilesetCache=su;exports.TilesetTraverser=ha;exports.Work=Ha;exports.XRButton=Ip;exports.defaultImageURLTransform=Ht;exports.defaultPbmParameters=we;exports.getViewportScale=ll;exports.imageSupport=Ws;exports.isPanoId=_s;exports.loadAt3d=Vu;exports.loadB3dm=xu;exports.loadDome=Nu;exports.loadDomez=Du;exports.loadPbm=ku;exports.loadPnts=Mu;exports.panoEqual=qt;exports.panoParse=ht;exports.panoStringify=Oe;exports.parseWork=Rn;