@realsee/five 5.0.0-alpha.36 → 5.0.0-alpha.40

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 (77) hide show
  1. package/README.md +14 -6
  2. package/docs/classes/five.Camera.html +4 -4
  3. package/docs/classes/five.Five.html +4 -4
  4. package/docs/classes/five.HashCubeTexture.html +4 -4
  5. package/docs/classes/five.InternalWebGLRenderer.html +4 -4
  6. package/docs/classes/five.Model.html +4 -4
  7. package/docs/classes/five.NetworkSubscribe.html +4 -4
  8. package/docs/classes/five.PBMContainer.html +4 -4
  9. package/docs/classes/five.PBMGroup.html +4 -4
  10. package/docs/classes/five.PBMMaterial.html +4 -4
  11. package/docs/classes/five.PBMMesh.html +4 -4
  12. package/docs/classes/five.Scene.html +4 -4
  13. package/docs/classes/five.Subscribe.html +4 -4
  14. package/docs/classes/gltf_loader.GLTFLoader.html +4 -4
  15. package/docs/classes/gltf_loader.GLTFObject.html +4 -4
  16. package/docs/classes/line.Line.html +4 -4
  17. package/docs/classes/line.LineGeometry.html +4 -4
  18. package/docs/classes/line.LineMaterial.html +4 -4
  19. package/docs/classes/line.LineSegmentsGeometry.html +4 -4
  20. package/docs/classes/line.THREE_Line2.html +4 -4
  21. package/docs/classes/line.THREE_LineSegments2.html +4 -4
  22. package/docs/classes/react.Store.html +4 -4
  23. package/docs/classes/server.Model.html +4 -4
  24. package/docs/classes/server.PBMGroup.html +4 -4
  25. package/docs/classes/server.PBMMesh.html +4 -4
  26. package/docs/classes/sticker.Sticker.html +4 -4
  27. package/docs/index.html +33 -10
  28. package/docs/interfaces/five.AddableObject.html +4 -4
  29. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +4 -4
  30. package/docs/interfaces/five.EventCallback.html +4 -4
  31. package/docs/interfaces/five.FiveInitArgs.html +4 -4
  32. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +4 -4
  33. package/docs/interfaces/five.ImageOptions.html +4 -4
  34. package/docs/interfaces/five.IntersectMeshInterface.html +4 -4
  35. package/docs/interfaces/five.Intersection.html +4 -4
  36. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +4 -4
  37. package/docs/interfaces/five.ModelEventCallback.html +4 -4
  38. package/docs/interfaces/five.MovePanoOptions.html +4 -4
  39. package/docs/interfaces/five.PBMParameters.html +4 -4
  40. package/docs/interfaces/five.PanoCircleMeshInterface.html +4 -4
  41. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +8 -8
  42. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +4 -4
  43. package/docs/interfaces/five.Pose.html +4 -4
  44. package/docs/interfaces/five.Scissor.html +4 -4
  45. package/docs/interfaces/five.State.html +4 -4
  46. package/docs/interfaces/five.SubscribeMixinType.emit.html +4 -4
  47. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +4 -4
  48. package/docs/interfaces/five.SubscribeMixinType.off.html +4 -4
  49. package/docs/interfaces/five.SubscribeMixinType.on.html +4 -4
  50. package/docs/interfaces/five.SubscribeMixinType.once.html +4 -4
  51. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +4 -4
  52. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +9 -9
  53. package/docs/interfaces/gltf_loader.GLTF.html +4 -4
  54. package/docs/interfaces/react.FiveActionReactCallbacks.html +4 -4
  55. package/docs/interfaces/react.FiveInjectionTypes.html +4 -4
  56. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +4 -4
  57. package/docs/interfaces/server.Intersection.html +4 -4
  58. package/docs/interfaces/server.ModelEventCallback.html +4 -4
  59. package/docs/interfaces/sticker.IntersectionLike.html +4 -4
  60. package/docs/modules/five.SubscribeMixinType.html +4 -4
  61. package/docs/modules/five.html +4 -4
  62. package/docs/modules/gltf_loader.html +4 -4
  63. package/docs/modules/line.html +4 -4
  64. package/docs/modules/react.html +4 -4
  65. package/docs/modules/server.html +4 -4
  66. package/docs/modules/sticker.html +4 -4
  67. package/docs/modules.html +4 -4
  68. package/exporters/staticify.js +1 -1
  69. package/five/index.js +13 -13
  70. package/gltf-loader/index.js +2 -2
  71. package/line/index.js +2 -2
  72. package/package.json +1 -1
  73. package/react/index.js +3 -3
  74. package/server/index.js +3 -3
  75. package/sticker/index.js +2 -2
  76. package/umd/five-react.js +1 -1
  77. package/umd/five.js +1 -1
package/five/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @realsee/five
3
3
  *
4
- * Generated: 2021-09-21
5
- * Version: 5.0.0-alpha.36
4
+ * Generated: 2021-09-26
5
+ * Version: 5.0.0-alpha.40
6
6
  *
7
7
  * Terms:
8
8
  * Realsee SDK License Agreement
@@ -347,29 +347,29 @@
347
347
  *
348
348
  * https://code.google.com/p/crypto-js/wiki/License
349
349
  * PART: ext/cryptojs
350
- */var d,p={},M={},f=f||function(e,t){var i={},n=i.lib={},r=n.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var i=new e;return t&&i.mixIn(t),i.hasOwnProperty("init")||(i.init=function(){i.$super.init.apply(this,arguments)}),i.init.prototype=i,i.$super=this,i},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=n.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes,r=e.sigBytes;if(this.clamp(),n%4)for(var s=0;s<r;s++){var o=i[s>>>2]>>>24-s%4*8&255;t[n+s>>>2]|=o<<24-(n+s)%4*8}else for(s=0;s<r;s+=4)t[n+s>>>2]=i[s>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=r.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var i=[],n=0;n<t;n+=4)i.push(4294967296*e.random()|0);return new s.init(i,t)}}),o=i.enc={},a=o.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var s=t[r>>>2]>>>24-r%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new s.init(i,t/2)}},u=o.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var s=t[r>>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new s.init(i,t)}},c=o.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},l=n.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i=this._data,n=i.words,r=i.sigBytes,o=this.blockSize,a=r/(4*o),u=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,c=e.min(4*u,r);if(u){for(var l=0;l<u;l+=o)this._doProcessBlock(n,l);var h=n.splice(0,u);i.sigBytes-=c}return new s.init(h,c)},clone:function(){var e=r.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=l.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new h.HMAC.init(e,i).finalize(t)}}});var h=i.algo={};return i}(Math);function g(e,t,i){null!=e&&("number"==typeof e?this.fromNumber(e,t,i):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function A(){return new g(null)}!function(e){for(var t=f,i=(r=t.lib).WordArray,n=r.Hasher,r=t.algo,s=[],o=[],a=function(e){return 4294967296*(e-(0|e))|0},u=2,c=0;64>c;){var l;e:{l=u;for(var h=e.sqrt(l),d=2;d<=h;d++)if(!(l%d)){l=!1;break e}l=!0}l&&(8>c&&(s[c]=a(e.pow(u,.5))),o[c]=a(e.pow(u,1/3)),c++),u++}var p=[];r=r.SHA256=n.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],r=i[1],s=i[2],a=i[3],u=i[4],c=i[5],l=i[6],h=i[7],d=0;64>d;d++){if(16>d)p[d]=0|e[t+d];else{var M=p[d-15],f=p[d-2];p[d]=((M<<25|M>>>7)^(M<<14|M>>>18)^M>>>3)+p[d-7]+((f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10)+p[d-16]}M=h+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+o[d]+p[d],f=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&r^n&s^r&s),h=l,l=c,c=u,u=a+M|0,a=s,s=r,r=n,n=M+f|0}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+s|0,i[3]=i[3]+a|0,i[4]=i[4]+u|0,i[5]=i[5]+c|0,i[6]=i[6]+l|0,i[7]=i[7]+h|0},_doFinalize:function(){var t=this._data,i=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=e.floor(n/4294967296),i[15+(r+64>>>9<<4)]=n,t.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=n._createHelper(r),t.HmacSHA256=n._createHmacHelper(r)}(Math),f.lib.Cipher||function(e){var t=(p=f).lib,i=t.Base,n=t.WordArray,r=t.BufferedBlockAlgorithm,s=p.enc.Base64,o=p.algo.EvpKDF,a=t.Cipher=r.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,i){this.cfg=this.cfg.extend(i),this._xformMode=e,this._key=t,this.reset()},reset:function(){r.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,i,n){return("string"==typeof i?M:d).encrypt(e,t,i,n)},decrypt:function(t,i,n){return("string"==typeof i?M:d).decrypt(e,t,i,n)}}}});t.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=p.mode={},c=function(e,t,i){var n=this._iv;n?this._iv=undefined:n=this._prevBlock;for(var r=0;r<i;r++)e[t+r]^=n[r]},l=(t.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();l.Encryptor=l.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize;c.call(this,e,t,n),i.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}),l.Decryptor=l.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,r=e.slice(t,t+n);i.decryptBlock(e,t),c.call(this,e,t,n),this._prevBlock=r}}),u=u.CBC=l,l=(p.pad={}).Pkcs7={pad:function(e,t){for(var i,r=(i=(i=4*t)-e.sigBytes%i)<<24|i<<16|i<<8|i,s=[],o=0;o<i;o+=4)s.push(r);i=n.create(s,i),e.concat(i)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},t.BlockCipher=a.extend({cfg:a.cfg.extend({mode:u,padding:l}),reset:function(){a.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=t.createEncryptor;else i=t.createDecryptor,this._minBufferSize=1;this._mode=i.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var h=t.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),d=(u=(p.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?n.create([1398893684,1701076831]).concat(e).concat(t):t).toString(s)},parse:function(e){var t=(e=s.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var i=n.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return h.create({ciphertext:e,salt:i})}},t.SerializableCipher=i.extend({cfg:i.extend({format:u}),encrypt:function(e,t,i,n){n=this.cfg.extend(n);var r=e.createEncryptor(i,n);return t=r.finalize(t),r=r.cfg,h.create({ciphertext:t,key:i,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,i,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(i,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),p=(p.kdf={}).OpenSSL={execute:function(e,t,i,r){return r||(r=n.random(8)),e=o.create({keySize:t+i}).compute(e,r),i=n.create(e.words.slice(t),4*i),e.sigBytes=4*t,h.create({key:e,iv:i,salt:r})}},M=t.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:p}),encrypt:function(e,t,i,n){return i=(n=this.cfg.extend(n)).kdf.execute(i,e.keySize,e.ivSize),n.iv=i.iv,(e=d.encrypt.call(this,e,t,i.key,n)).mixIn(i),e},decrypt:function(e,t,i,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),i=n.kdf.execute(i,e.keySize,e.ivSize,t.salt),n.iv=i.iv,d.decrypt.call(this,e,t,i.key,n)}})}(),function(){for(var e=f,t=e.lib.BlockCipher,i=e.algo,n=[],r=[],s=[],o=[],a=[],u=[],c=[],l=[],h=[],d=[],p=[],M=0;256>M;M++)p[M]=128>M?M<<1:M<<1^283;var g=0,A=0;for(M=0;256>M;M++){var y=(y=A^A<<1^A<<2^A<<3^A<<4)>>>8^255&y^99;n[g]=y,r[y]=g;var v=p[g],m=p[v],N=p[m],D=257*p[y]^16843008*y;s[g]=D<<24|D>>>8,o[g]=D<<16|D>>>16,a[g]=D<<8|D>>>24,u[g]=D,D=16843009*N^65537*m^257*v^16843008*g,c[y]=D<<24|D>>>8,l[y]=D<<16|D>>>16,h[y]=D<<8|D>>>24,d[y]=D,g?(g=v^p[p[p[N^v]]],A^=p[p[A]]):g=A=1}var w=[0,1,2,4,8,16,32,64,128,27,54];i=i.AES=t.extend({_doReset:function(){for(var e=(i=this._key).words,t=i.sigBytes/4,i=4*((this._nRounds=t+6)+1),r=this._keySchedule=[],s=0;s<i;s++)if(s<t)r[s]=e[s];else{var o=r[s-1];s%t?6<t&&4==s%t&&(o=n[o>>>24]<<24|n[o>>>16&255]<<16|n[o>>>8&255]<<8|n[255&o]):(o=n[(o=o<<8|o>>>24)>>>24]<<24|n[o>>>16&255]<<16|n[o>>>8&255]<<8|n[255&o],o^=w[s/t|0]<<24),r[s]=r[s-t]^o}for(e=this._invKeySchedule=[],t=0;t<i;t++)s=i-t,o=t%4?r[s]:r[s-4],e[t]=4>t||4>=s?o:c[n[o>>>24]]^l[n[o>>>16&255]]^h[n[o>>>8&255]]^d[n[255&o]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,o,a,u,n)},decryptBlock:function(e,t){var i=e[t+1];e[t+1]=e[t+3],e[t+3]=i,this._doCryptBlock(e,t,this._invKeySchedule,c,l,h,d,r),i=e[t+1],e[t+1]=e[t+3],e[t+3]=i},_doCryptBlock:function(e,t,i,n,r,s,o,a){for(var u=this._nRounds,c=e[t]^i[0],l=e[t+1]^i[1],h=e[t+2]^i[2],d=e[t+3]^i[3],p=4,M=1;M<u;M++){var f=n[c>>>24]^r[l>>>16&255]^s[h>>>8&255]^o[255&d]^i[p++],g=n[l>>>24]^r[h>>>16&255]^s[d>>>8&255]^o[255&c]^i[p++],A=n[h>>>24]^r[d>>>16&255]^s[c>>>8&255]^o[255&l]^i[p++];d=n[d>>>24]^r[c>>>16&255]^s[l>>>8&255]^o[255&h]^i[p++],c=f,l=g,h=A}f=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^i[p++],g=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&c])^i[p++],A=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^i[p++],d=(a[d>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^i[p++],e[t]=f,e[t+1]=g,e[t+2]=A,e[t+3]=d},keySize:8});e.AES=t._createHelper(i)}(),
350
+ */var d,A={},p={},M=M||function(e,t){var i={},n=i.lib={},r=n.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var i=new e;return t&&i.mixIn(t),i.hasOwnProperty("init")||(i.init=function(){i.$super.init.apply(this,arguments)}),i.init.prototype=i,i.$super=this,i},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=n.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes,r=e.sigBytes;if(this.clamp(),n%4)for(var s=0;s<r;s++){var o=i[s>>>2]>>>24-s%4*8&255;t[n+s>>>2]|=o<<24-(n+s)%4*8}else for(s=0;s<r;s+=4)t[n+s>>>2]=i[s>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=r.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var i=[],n=0;n<t;n+=4)i.push(4294967296*e.random()|0);return new s.init(i,t)}}),o=i.enc={},a=o.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var s=t[r>>>2]>>>24-r%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new s.init(i,t/2)}},u=o.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var s=t[r>>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new s.init(i,t)}},c=o.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},l=n.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i=this._data,n=i.words,r=i.sigBytes,o=this.blockSize,a=r/(4*o),u=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,c=e.min(4*u,r);if(u){for(var l=0;l<u;l+=o)this._doProcessBlock(n,l);var h=n.splice(0,u);i.sigBytes-=c}return new s.init(h,c)},clone:function(){var e=r.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=l.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new h.HMAC.init(e,i).finalize(t)}}});var h=i.algo={};return i}(Math);function f(e,t,i){null!=e&&("number"==typeof e?this.fromNumber(e,t,i):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function g(){return new f(null)}!function(e){for(var t=M,i=(r=t.lib).WordArray,n=r.Hasher,r=t.algo,s=[],o=[],a=function(e){return 4294967296*(e-(0|e))|0},u=2,c=0;64>c;){var l;e:{l=u;for(var h=e.sqrt(l),d=2;d<=h;d++)if(!(l%d)){l=!1;break e}l=!0}l&&(8>c&&(s[c]=a(e.pow(u,.5))),o[c]=a(e.pow(u,1/3)),c++),u++}var A=[];r=r.SHA256=n.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],r=i[1],s=i[2],a=i[3],u=i[4],c=i[5],l=i[6],h=i[7],d=0;64>d;d++){if(16>d)A[d]=0|e[t+d];else{var p=A[d-15],M=A[d-2];A[d]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+A[d-7]+((M<<15|M>>>17)^(M<<13|M>>>19)^M>>>10)+A[d-16]}p=h+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+o[d]+A[d],M=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&r^n&s^r&s),h=l,l=c,c=u,u=a+p|0,a=s,s=r,r=n,n=p+M|0}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+s|0,i[3]=i[3]+a|0,i[4]=i[4]+u|0,i[5]=i[5]+c|0,i[6]=i[6]+l|0,i[7]=i[7]+h|0},_doFinalize:function(){var t=this._data,i=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=e.floor(n/4294967296),i[15+(r+64>>>9<<4)]=n,t.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=n._createHelper(r),t.HmacSHA256=n._createHmacHelper(r)}(Math),M.lib.Cipher||function(e){var t=(A=M).lib,i=t.Base,n=t.WordArray,r=t.BufferedBlockAlgorithm,s=A.enc.Base64,o=A.algo.EvpKDF,a=t.Cipher=r.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,i){this.cfg=this.cfg.extend(i),this._xformMode=e,this._key=t,this.reset()},reset:function(){r.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,i,n){return("string"==typeof i?p:d).encrypt(e,t,i,n)},decrypt:function(t,i,n){return("string"==typeof i?p:d).decrypt(e,t,i,n)}}}});t.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=A.mode={},c=function(e,t,i){var n=this._iv;n?this._iv=undefined:n=this._prevBlock;for(var r=0;r<i;r++)e[t+r]^=n[r]},l=(t.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();l.Encryptor=l.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize;c.call(this,e,t,n),i.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}),l.Decryptor=l.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,r=e.slice(t,t+n);i.decryptBlock(e,t),c.call(this,e,t,n),this._prevBlock=r}}),u=u.CBC=l,l=(A.pad={}).Pkcs7={pad:function(e,t){for(var i,r=(i=(i=4*t)-e.sigBytes%i)<<24|i<<16|i<<8|i,s=[],o=0;o<i;o+=4)s.push(r);i=n.create(s,i),e.concat(i)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},t.BlockCipher=a.extend({cfg:a.cfg.extend({mode:u,padding:l}),reset:function(){a.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=t.createEncryptor;else i=t.createDecryptor,this._minBufferSize=1;this._mode=i.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var h=t.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),d=(u=(A.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?n.create([1398893684,1701076831]).concat(e).concat(t):t).toString(s)},parse:function(e){var t=(e=s.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var i=n.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return h.create({ciphertext:e,salt:i})}},t.SerializableCipher=i.extend({cfg:i.extend({format:u}),encrypt:function(e,t,i,n){n=this.cfg.extend(n);var r=e.createEncryptor(i,n);return t=r.finalize(t),r=r.cfg,h.create({ciphertext:t,key:i,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,i,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(i,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),A=(A.kdf={}).OpenSSL={execute:function(e,t,i,r){return r||(r=n.random(8)),e=o.create({keySize:t+i}).compute(e,r),i=n.create(e.words.slice(t),4*i),e.sigBytes=4*t,h.create({key:e,iv:i,salt:r})}},p=t.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:A}),encrypt:function(e,t,i,n){return i=(n=this.cfg.extend(n)).kdf.execute(i,e.keySize,e.ivSize),n.iv=i.iv,(e=d.encrypt.call(this,e,t,i.key,n)).mixIn(i),e},decrypt:function(e,t,i,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),i=n.kdf.execute(i,e.keySize,e.ivSize,t.salt),n.iv=i.iv,d.decrypt.call(this,e,t,i.key,n)}})}(),function(){for(var e=M,t=e.lib.BlockCipher,i=e.algo,n=[],r=[],s=[],o=[],a=[],u=[],c=[],l=[],h=[],d=[],A=[],p=0;256>p;p++)A[p]=128>p?p<<1:p<<1^283;var f=0,g=0;for(p=0;256>p;p++){var y=(y=g^g<<1^g<<2^g<<3^g<<4)>>>8^255&y^99;n[f]=y,r[y]=f;var v=A[f],m=A[v],N=A[m],D=257*A[y]^16843008*y;s[f]=D<<24|D>>>8,o[f]=D<<16|D>>>16,a[f]=D<<8|D>>>24,u[f]=D,D=16843009*N^65537*m^257*v^16843008*f,c[y]=D<<24|D>>>8,l[y]=D<<16|D>>>16,h[y]=D<<8|D>>>24,d[y]=D,f?(f=v^A[A[A[N^v]]],g^=A[A[g]]):f=g=1}var w=[0,1,2,4,8,16,32,64,128,27,54];i=i.AES=t.extend({_doReset:function(){for(var e=(i=this._key).words,t=i.sigBytes/4,i=4*((this._nRounds=t+6)+1),r=this._keySchedule=[],s=0;s<i;s++)if(s<t)r[s]=e[s];else{var o=r[s-1];s%t?6<t&&4==s%t&&(o=n[o>>>24]<<24|n[o>>>16&255]<<16|n[o>>>8&255]<<8|n[255&o]):(o=n[(o=o<<8|o>>>24)>>>24]<<24|n[o>>>16&255]<<16|n[o>>>8&255]<<8|n[255&o],o^=w[s/t|0]<<24),r[s]=r[s-t]^o}for(e=this._invKeySchedule=[],t=0;t<i;t++)s=i-t,o=t%4?r[s]:r[s-4],e[t]=4>t||4>=s?o:c[n[o>>>24]]^l[n[o>>>16&255]]^h[n[o>>>8&255]]^d[n[255&o]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,o,a,u,n)},decryptBlock:function(e,t){var i=e[t+1];e[t+1]=e[t+3],e[t+3]=i,this._doCryptBlock(e,t,this._invKeySchedule,c,l,h,d,r),i=e[t+1],e[t+1]=e[t+3],e[t+3]=i},_doCryptBlock:function(e,t,i,n,r,s,o,a){for(var u=this._nRounds,c=e[t]^i[0],l=e[t+1]^i[1],h=e[t+2]^i[2],d=e[t+3]^i[3],A=4,p=1;p<u;p++){var M=n[c>>>24]^r[l>>>16&255]^s[h>>>8&255]^o[255&d]^i[A++],f=n[l>>>24]^r[h>>>16&255]^s[d>>>8&255]^o[255&c]^i[A++],g=n[h>>>24]^r[d>>>16&255]^s[c>>>8&255]^o[255&l]^i[A++];d=n[d>>>24]^r[c>>>16&255]^s[l>>>8&255]^o[255&h]^i[A++],c=M,l=f,h=g}M=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^i[A++],f=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&c])^i[A++],g=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^i[A++],d=(a[d>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^i[A++],e[t]=M,e[t+1]=f,e[t+2]=g,e[t+3]=d},keySize:8});e.AES=t._createHelper(i)}(),
351
351
  /*!
352
352
  Copyright (c) 2011, Yahoo! Inc. All rights reserved.
353
353
  Code licensed under the BSD License:
354
354
  http://developer.yahoo.com/yui/license.html
355
355
  version: 2.9.0
356
356
  */
357
- M.lang={extend:function(e,t,i){if(!t||!e)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var n=function(){};if(n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t),i){var r;for(r in i)e.prototype[r]=i[r];var s=function(){},o=["toString","valueOf"];try{/MSIE/.test("undefined"!=typeof navigator?navigator.userAgent:"node")&&(s=function(e,t){for(r=0;r<o.length;r+=1){var i=o[r],n=t[i];"function"==typeof n&&n!=Object.prototype[i]&&(e[i]=n)}})}catch(e){}s(e.prototype,i)}}},"undefined"!=typeof navigator&&"Microsoft Internet Explorer"==navigator.appName?(g.prototype.am=function(e,t,i,n,r,s){for(var o=32767&t,a=t>>15;--s>=0;){var u=32767&this[e],c=this[e++]>>15,l=a*u+c*o;r=((u=o*u+((32767&l)<<15)+i[n]+(1073741823&r))>>>30)+(l>>>15)+a*c+(r>>>30),i[n++]=1073741823&u}return r},d=30):"undefined"!=typeof navigator&&"Netscape"!=navigator.appName?(g.prototype.am=function(e,t,i,n,r,s){for(;--s>=0;){var o=t*this[e++]+i[n]+r;r=Math.floor(o/67108864),i[n++]=67108863&o}return r},d=26):(g.prototype.am=function(e,t,i,n,r,s){for(var o=16383&t,a=t>>14;--s>=0;){var u=16383&this[e],c=this[e++]>>14,l=a*u+c*o;r=((u=o*u+((16383&l)<<14)+i[n]+r)>>28)+(l>>14)+a*c,i[n++]=268435455&u}return r},d=28),g.prototype.DB=d,g.prototype.DM=(1<<d)-1,g.prototype.DV=1<<d;g.prototype.FV=Math.pow(2,52),g.prototype.F1=52-d,g.prototype.F2=2*d-52;var y,v,m=new Array;for(y="0".charCodeAt(0),v=0;v<=9;++v)m[y++]=v;for(y="a".charCodeAt(0),v=10;v<36;++v)m[y++]=v;for(y="A".charCodeAt(0),v=10;v<36;++v)m[y++]=v;function N(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function D(e,t){var i=m[e.charCodeAt(t)];return null==i?-1:i}function w(e){var t=A();return t.fromInt(e),t}function T(e){var t,i=1;return 0!=(t=e>>>16)&&(e=t,i+=16),0!=(t=e>>8)&&(e=t,i+=8),0!=(t=e>>4)&&(e=t,i+=4),0!=(t=e>>2)&&(e=t,i+=2),0!=(t=e>>1)&&(e=t,i+=1),i}function x(e){this.m=e}function E(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function j(e,t){return e&t}function z(e,t){return e|t}function I(e,t){return e^t}function b(e,t){return e&~t}function L(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function S(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function O(){}function C(e){return e}function P(e){this.r2=A(),this.q3=A(),g.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}x.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},x.prototype.revert=function(e){return e},x.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},x.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},x.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},E.prototype.convert=function(e){var t=A();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(g.ZERO)>0&&this.m.subTo(t,t),t},E.prototype.revert=function(e){var t=A();return e.copyTo(t),this.reduce(t),t},E.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var i=32767&e[t],n=i*this.mpl+((i*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[i=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[i]>=e.DV;)e[i]-=e.DV,e[++i]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},E.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},E.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},g.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},g.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},g.prototype.fromString=function(e,t){var i;if(16==t)i=4;else if(8==t)i=3;else if(256==t)i=8;else if(2==t)i=1;else if(32==t)i=5;else{if(4!=t)return void this.fromRadix(e,t);i=2}this.t=0,this.s=0;for(var n=e.length,r=!1,s=0;--n>=0;){var o=8==i?255&e[n]:D(e,n);o<0?"-"==e.charAt(n)&&(r=!0):(r=!1,0==s?this[this.t++]=o:s+i>this.DB?(this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this[this.t++]=o>>this.DB-s):this[this.t-1]|=o<<s,(s+=i)>=this.DB&&(s-=this.DB))}8==i&&0!=(128&e[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),r&&g.ZERO.subTo(this,this)},g.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},g.prototype.dlShiftTo=function(e,t){var i;for(i=this.t-1;i>=0;--i)t[i+e]=this[i];for(i=e-1;i>=0;--i)t[i]=0;t.t=this.t+e,t.s=this.s},g.prototype.drShiftTo=function(e,t){for(var i=e;i<this.t;++i)t[i-e]=this[i];t.t=Math.max(this.t-e,0),t.s=this.s},g.prototype.lShiftTo=function(e,t){var i,n=e%this.DB,r=this.DB-n,s=(1<<r)-1,o=Math.floor(e/this.DB),a=this.s<<n&this.DM;for(i=this.t-1;i>=0;--i)t[i+o+1]=this[i]>>r|a,a=(this[i]&s)<<n;for(i=o-1;i>=0;--i)t[i]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},g.prototype.rShiftTo=function(e,t){t.s=this.s;var i=Math.floor(e/this.DB);if(i>=this.t)t.t=0;else{var n=e%this.DB,r=this.DB-n,s=(1<<n)-1;t[0]=this[i]>>n;for(var o=i+1;o<this.t;++o)t[o-i-1]|=(this[o]&s)<<r,t[o-i]=this[o]>>n;n>0&&(t[this.t-i-1]|=(this.s&s)<<r),t.t=this.t-i,t.clamp()}},g.prototype.subTo=function(e,t){for(var i=0,n=0,r=Math.min(e.t,this.t);i<r;)n+=this[i]-e[i],t[i++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;i<this.t;)n+=this[i],t[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<e.t;)n-=e[i],t[i++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[i++]=this.DV+n:n>0&&(t[i++]=n),t.t=i,t.clamp()},g.prototype.multiplyTo=function(e,t){var i=this.abs(),n=e.abs(),r=i.t;for(t.t=r+n.t;--r>=0;)t[r]=0;for(r=0;r<n.t;++r)t[r+i.t]=i.am(0,n[r],t,r,0,i.t);t.s=0,t.clamp(),this.s!=e.s&&g.ZERO.subTo(t,t)},g.prototype.squareTo=function(e){for(var t=this.abs(),i=e.t=2*t.t;--i>=0;)e[i]=0;for(i=0;i<t.t-1;++i){var n=t.am(i,t[i],e,2*i,0,1);(e[i+t.t]+=t.am(i+1,2*t[i],e,2*i+1,n,t.t-i-1))>=t.DV&&(e[i+t.t]-=t.DV,e[i+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(i,t[i],e,2*i,0,1)),e.s=0,e.clamp()},g.prototype.divRemTo=function(e,t,i){var n=e.abs();if(!(n.t<=0)){var r=this.abs();if(r.t<n.t)return null!=t&&t.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=A());var s=A(),o=this.s,a=e.s,u=this.DB-T(n[n.t-1]);u>0?(n.lShiftTo(u,s),r.lShiftTo(u,i)):(n.copyTo(s),r.copyTo(i));var c=s.t,l=s[c-1];if(0!=l){var h=l*(1<<this.F1)+(c>1?s[c-2]>>this.F2:0),d=this.FV/h,p=(1<<this.F1)/h,M=1<<this.F2,f=i.t,y=f-c,v=null==t?A():t;for(s.dlShiftTo(y,v),i.compareTo(v)>=0&&(i[i.t++]=1,i.subTo(v,i)),g.ONE.dlShiftTo(c,v),v.subTo(s,s);s.t<c;)s[s.t++]=0;for(;--y>=0;){var m=i[--f]==l?this.DM:Math.floor(i[f]*d+(i[f-1]+M)*p);if((i[f]+=s.am(0,m,i,y,0,c))<m)for(s.dlShiftTo(y,v),i.subTo(v,i);i[f]<--m;)i.subTo(v,i)}null!=t&&(i.drShiftTo(c,t),o!=a&&g.ZERO.subTo(t,t)),i.t=c,i.clamp(),u>0&&i.rShiftTo(u,i),o<0&&g.ZERO.subTo(i,i)}}},g.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},g.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},g.prototype.exp=function(e,t){if(e>4294967295||e<1)return g.ONE;var i=A(),n=A(),r=t.convert(this),s=T(e)-1;for(r.copyTo(i);--s>=0;)if(t.sqrTo(i,n),(e&1<<s)>0)t.mulTo(n,r,i);else{var o=i;i=n,n=o}return t.revert(i)},g.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var i,n=(1<<t)-1,r=!1,s="",o=this.t,a=this.DB-o*this.DB%t;if(o-- >0)for(a<this.DB&&(i=this[o]>>a)>0&&(r=!0,s=N(i));o>=0;)a<t?(i=(this[o]&(1<<a)-1)<<t-a,i|=this[--o]>>(a+=this.DB-t)):(i=this[o]>>(a-=t)&n,a<=0&&(a+=this.DB,--o)),i>0&&(r=!0),r&&(s+=N(i));return r?s:"0"},g.prototype.negate=function(){var e=A();return g.ZERO.subTo(this,e),e},g.prototype.abs=function(){return this.s<0?this.negate():this},g.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var i=this.t;if(0!=(t=i-e.t))return this.s<0?-t:t;for(;--i>=0;)if(0!=(t=this[i]-e[i]))return t;return 0},g.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+T(this[this.t-1]^this.s&this.DM)},g.prototype.mod=function(e){var t=A();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(g.ZERO)>0&&e.subTo(t,t),t},g.prototype.modPowInt=function(e,t){var i;return i=e<256||t.isEven()?new x(t):new E(t),this.exp(e,i)},g.ZERO=w(0),g.ONE=w(1),O.prototype.convert=C,O.prototype.revert=C,O.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i)},O.prototype.sqrTo=function(e,t){e.squareTo(t)},P.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=A();return e.copyTo(t),this.reduce(t),t},P.prototype.revert=function(e){return e},P.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},P.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},P.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var k=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],U=(1<<26)/k[k.length-1];g.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},g.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),i=Math.pow(e,t),n=w(i),r=A(),s=A(),o="";for(this.divRemTo(n,r,s);r.signum()>0;)o=(i+s.intValue()).toString(e).substr(1)+o,r.divRemTo(n,r,s);return s.intValue().toString(e)+o},g.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var i=this.chunkSize(t),n=Math.pow(t,i),r=!1,s=0,o=0,a=0;a<e.length;++a){var u=D(e,a);u<0?"-"==e.charAt(a)&&0==this.signum()&&(r=!0):(o=t*o+u,++s>=i&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(o,0)),r&&g.ZERO.subTo(this,this)},g.prototype.fromNumber=function(e,t,i){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(g.ONE.shiftLeft(e-1),z,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(g.ONE.shiftLeft(e-1),this);else{var n=new Array,r=7&e;n.length=1+(e>>3),t.nextBytes(n),r>0?n[0]&=(1<<r)-1:n[0]=0,this.fromString(n,256)}},g.prototype.bitwiseTo=function(e,t,i){var n,r,s=Math.min(e.t,this.t);for(n=0;n<s;++n)i[n]=t(this[n],e[n]);if(e.t<this.t){for(r=e.s&this.DM,n=s;n<this.t;++n)i[n]=t(this[n],r);i.t=this.t}else{for(r=this.s&this.DM,n=s;n<e.t;++n)i[n]=t(r,e[n]);i.t=e.t}i.s=t(this.s,e.s),i.clamp()},g.prototype.changeBit=function(e,t){var i=g.ONE.shiftLeft(e);return this.bitwiseTo(i,t,i),i},g.prototype.addTo=function(e,t){for(var i=0,n=0,r=Math.min(e.t,this.t);i<r;)n+=this[i]+e[i],t[i++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;i<this.t;)n+=this[i],t[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<e.t;)n+=e[i],t[i++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[i++]=n:n<-1&&(t[i++]=this.DV+n),t.t=i,t.clamp()},g.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},g.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},g.prototype.multiplyLowerTo=function(e,t,i){var n,r=Math.min(this.t+e.t,t);for(i.s=0,i.t=r;r>0;)i[--r]=0;for(n=i.t-this.t;r<n;++r)i[r+this.t]=this.am(0,e[r],i,r,0,this.t);for(n=Math.min(e.t,t);r<n;++r)this.am(0,e[r],i,r,0,t-r);i.clamp()},g.prototype.multiplyUpperTo=function(e,t,i){--t;var n=i.t=this.t+e.t-t;for(i.s=0;--n>=0;)i[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)i[this.t+n-t]=this.am(t-n,e[n],i,0,0,this.t+n-t);i.clamp(),i.drShiftTo(1,i)},g.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,i=this.s<0?e-1:0;if(this.t>0)if(0==t)i=this[0]%e;else for(var n=this.t-1;n>=0;--n)i=(t*i+this[n])%e;return i},g.prototype.millerRabin=function(e){var t=this.subtract(g.ONE),i=t.getLowestSetBit();if(i<=0)return!1;var n=t.shiftRight(i);(e=e+1>>1)>k.length&&(e=k.length);for(var r=A(),s=0;s<e;++s){r.fromInt(k[Math.floor(Math.random()*k.length)]);var o=r.modPow(n,this);if(0!=o.compareTo(g.ONE)&&0!=o.compareTo(t)){for(var a=1;a++<i&&0!=o.compareTo(t);)if(0==(o=o.modPowInt(2,this)).compareTo(g.ONE))return!1;if(0!=o.compareTo(t))return!1}}return!0},g.prototype.clone=
357
+ p.lang={extend:function(e,t,i){if(!t||!e)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var n=function(){};if(n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t),i){var r;for(r in i)e.prototype[r]=i[r];var s=function(){},o=["toString","valueOf"];try{/MSIE/.test("undefined"!=typeof navigator?navigator.userAgent:"node")&&(s=function(e,t){for(r=0;r<o.length;r+=1){var i=o[r],n=t[i];"function"==typeof n&&n!=Object.prototype[i]&&(e[i]=n)}})}catch(e){}s(e.prototype,i)}}},"undefined"!=typeof navigator&&"Microsoft Internet Explorer"==navigator.appName?(f.prototype.am=function(e,t,i,n,r,s){for(var o=32767&t,a=t>>15;--s>=0;){var u=32767&this[e],c=this[e++]>>15,l=a*u+c*o;r=((u=o*u+((32767&l)<<15)+i[n]+(1073741823&r))>>>30)+(l>>>15)+a*c+(r>>>30),i[n++]=1073741823&u}return r},d=30):"undefined"!=typeof navigator&&"Netscape"!=navigator.appName?(f.prototype.am=function(e,t,i,n,r,s){for(;--s>=0;){var o=t*this[e++]+i[n]+r;r=Math.floor(o/67108864),i[n++]=67108863&o}return r},d=26):(f.prototype.am=function(e,t,i,n,r,s){for(var o=16383&t,a=t>>14;--s>=0;){var u=16383&this[e],c=this[e++]>>14,l=a*u+c*o;r=((u=o*u+((16383&l)<<14)+i[n]+r)>>28)+(l>>14)+a*c,i[n++]=268435455&u}return r},d=28),f.prototype.DB=d,f.prototype.DM=(1<<d)-1,f.prototype.DV=1<<d;f.prototype.FV=Math.pow(2,52),f.prototype.F1=52-d,f.prototype.F2=2*d-52;var y,v,m=new Array;for(y="0".charCodeAt(0),v=0;v<=9;++v)m[y++]=v;for(y="a".charCodeAt(0),v=10;v<36;++v)m[y++]=v;for(y="A".charCodeAt(0),v=10;v<36;++v)m[y++]=v;function N(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function D(e,t){var i=m[e.charCodeAt(t)];return null==i?-1:i}function w(e){var t=g();return t.fromInt(e),t}function T(e){var t,i=1;return 0!=(t=e>>>16)&&(e=t,i+=16),0!=(t=e>>8)&&(e=t,i+=8),0!=(t=e>>4)&&(e=t,i+=4),0!=(t=e>>2)&&(e=t,i+=2),0!=(t=e>>1)&&(e=t,i+=1),i}function x(e){this.m=e}function E(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function j(e,t){return e&t}function I(e,t){return e|t}function z(e,t){return e^t}function b(e,t){return e&~t}function L(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function S(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function O(){}function C(e){return e}function P(e){this.r2=g(),this.q3=g(),f.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}x.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},x.prototype.revert=function(e){return e},x.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},x.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},x.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},E.prototype.convert=function(e){var t=g();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(f.ZERO)>0&&this.m.subTo(t,t),t},E.prototype.revert=function(e){var t=g();return e.copyTo(t),this.reduce(t),t},E.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var i=32767&e[t],n=i*this.mpl+((i*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[i=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[i]>=e.DV;)e[i]-=e.DV,e[++i]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},E.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},E.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},f.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},f.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},f.prototype.fromString=function(e,t){var i;if(16==t)i=4;else if(8==t)i=3;else if(256==t)i=8;else if(2==t)i=1;else if(32==t)i=5;else{if(4!=t)return void this.fromRadix(e,t);i=2}this.t=0,this.s=0;for(var n=e.length,r=!1,s=0;--n>=0;){var o=8==i?255&e[n]:D(e,n);o<0?"-"==e.charAt(n)&&(r=!0):(r=!1,0==s?this[this.t++]=o:s+i>this.DB?(this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this[this.t++]=o>>this.DB-s):this[this.t-1]|=o<<s,(s+=i)>=this.DB&&(s-=this.DB))}8==i&&0!=(128&e[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),r&&f.ZERO.subTo(this,this)},f.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},f.prototype.dlShiftTo=function(e,t){var i;for(i=this.t-1;i>=0;--i)t[i+e]=this[i];for(i=e-1;i>=0;--i)t[i]=0;t.t=this.t+e,t.s=this.s},f.prototype.drShiftTo=function(e,t){for(var i=e;i<this.t;++i)t[i-e]=this[i];t.t=Math.max(this.t-e,0),t.s=this.s},f.prototype.lShiftTo=function(e,t){var i,n=e%this.DB,r=this.DB-n,s=(1<<r)-1,o=Math.floor(e/this.DB),a=this.s<<n&this.DM;for(i=this.t-1;i>=0;--i)t[i+o+1]=this[i]>>r|a,a=(this[i]&s)<<n;for(i=o-1;i>=0;--i)t[i]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},f.prototype.rShiftTo=function(e,t){t.s=this.s;var i=Math.floor(e/this.DB);if(i>=this.t)t.t=0;else{var n=e%this.DB,r=this.DB-n,s=(1<<n)-1;t[0]=this[i]>>n;for(var o=i+1;o<this.t;++o)t[o-i-1]|=(this[o]&s)<<r,t[o-i]=this[o]>>n;n>0&&(t[this.t-i-1]|=(this.s&s)<<r),t.t=this.t-i,t.clamp()}},f.prototype.subTo=function(e,t){for(var i=0,n=0,r=Math.min(e.t,this.t);i<r;)n+=this[i]-e[i],t[i++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;i<this.t;)n+=this[i],t[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<e.t;)n-=e[i],t[i++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[i++]=this.DV+n:n>0&&(t[i++]=n),t.t=i,t.clamp()},f.prototype.multiplyTo=function(e,t){var i=this.abs(),n=e.abs(),r=i.t;for(t.t=r+n.t;--r>=0;)t[r]=0;for(r=0;r<n.t;++r)t[r+i.t]=i.am(0,n[r],t,r,0,i.t);t.s=0,t.clamp(),this.s!=e.s&&f.ZERO.subTo(t,t)},f.prototype.squareTo=function(e){for(var t=this.abs(),i=e.t=2*t.t;--i>=0;)e[i]=0;for(i=0;i<t.t-1;++i){var n=t.am(i,t[i],e,2*i,0,1);(e[i+t.t]+=t.am(i+1,2*t[i],e,2*i+1,n,t.t-i-1))>=t.DV&&(e[i+t.t]-=t.DV,e[i+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(i,t[i],e,2*i,0,1)),e.s=0,e.clamp()},f.prototype.divRemTo=function(e,t,i){var n=e.abs();if(!(n.t<=0)){var r=this.abs();if(r.t<n.t)return null!=t&&t.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=g());var s=g(),o=this.s,a=e.s,u=this.DB-T(n[n.t-1]);u>0?(n.lShiftTo(u,s),r.lShiftTo(u,i)):(n.copyTo(s),r.copyTo(i));var c=s.t,l=s[c-1];if(0!=l){var h=l*(1<<this.F1)+(c>1?s[c-2]>>this.F2:0),d=this.FV/h,A=(1<<this.F1)/h,p=1<<this.F2,M=i.t,y=M-c,v=null==t?g():t;for(s.dlShiftTo(y,v),i.compareTo(v)>=0&&(i[i.t++]=1,i.subTo(v,i)),f.ONE.dlShiftTo(c,v),v.subTo(s,s);s.t<c;)s[s.t++]=0;for(;--y>=0;){var m=i[--M]==l?this.DM:Math.floor(i[M]*d+(i[M-1]+p)*A);if((i[M]+=s.am(0,m,i,y,0,c))<m)for(s.dlShiftTo(y,v),i.subTo(v,i);i[M]<--m;)i.subTo(v,i)}null!=t&&(i.drShiftTo(c,t),o!=a&&f.ZERO.subTo(t,t)),i.t=c,i.clamp(),u>0&&i.rShiftTo(u,i),o<0&&f.ZERO.subTo(i,i)}}},f.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},f.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},f.prototype.exp=function(e,t){if(e>4294967295||e<1)return f.ONE;var i=g(),n=g(),r=t.convert(this),s=T(e)-1;for(r.copyTo(i);--s>=0;)if(t.sqrTo(i,n),(e&1<<s)>0)t.mulTo(n,r,i);else{var o=i;i=n,n=o}return t.revert(i)},f.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var i,n=(1<<t)-1,r=!1,s="",o=this.t,a=this.DB-o*this.DB%t;if(o-- >0)for(a<this.DB&&(i=this[o]>>a)>0&&(r=!0,s=N(i));o>=0;)a<t?(i=(this[o]&(1<<a)-1)<<t-a,i|=this[--o]>>(a+=this.DB-t)):(i=this[o]>>(a-=t)&n,a<=0&&(a+=this.DB,--o)),i>0&&(r=!0),r&&(s+=N(i));return r?s:"0"},f.prototype.negate=function(){var e=g();return f.ZERO.subTo(this,e),e},f.prototype.abs=function(){return this.s<0?this.negate():this},f.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var i=this.t;if(0!=(t=i-e.t))return this.s<0?-t:t;for(;--i>=0;)if(0!=(t=this[i]-e[i]))return t;return 0},f.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+T(this[this.t-1]^this.s&this.DM)},f.prototype.mod=function(e){var t=g();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(f.ZERO)>0&&e.subTo(t,t),t},f.prototype.modPowInt=function(e,t){var i;return i=e<256||t.isEven()?new x(t):new E(t),this.exp(e,i)},f.ZERO=w(0),f.ONE=w(1),O.prototype.convert=C,O.prototype.revert=C,O.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i)},O.prototype.sqrTo=function(e,t){e.squareTo(t)},P.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=g();return e.copyTo(t),this.reduce(t),t},P.prototype.revert=function(e){return e},P.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},P.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},P.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var k=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],B=(1<<26)/k[k.length-1];f.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},f.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),i=Math.pow(e,t),n=w(i),r=g(),s=g(),o="";for(this.divRemTo(n,r,s);r.signum()>0;)o=(i+s.intValue()).toString(e).substr(1)+o,r.divRemTo(n,r,s);return s.intValue().toString(e)+o},f.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var i=this.chunkSize(t),n=Math.pow(t,i),r=!1,s=0,o=0,a=0;a<e.length;++a){var u=D(e,a);u<0?"-"==e.charAt(a)&&0==this.signum()&&(r=!0):(o=t*o+u,++s>=i&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(o,0)),r&&f.ZERO.subTo(this,this)},f.prototype.fromNumber=function(e,t,i){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(f.ONE.shiftLeft(e-1),I,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(f.ONE.shiftLeft(e-1),this);else{var n=new Array,r=7&e;n.length=1+(e>>3),t.nextBytes(n),r>0?n[0]&=(1<<r)-1:n[0]=0,this.fromString(n,256)}},f.prototype.bitwiseTo=function(e,t,i){var n,r,s=Math.min(e.t,this.t);for(n=0;n<s;++n)i[n]=t(this[n],e[n]);if(e.t<this.t){for(r=e.s&this.DM,n=s;n<this.t;++n)i[n]=t(this[n],r);i.t=this.t}else{for(r=this.s&this.DM,n=s;n<e.t;++n)i[n]=t(r,e[n]);i.t=e.t}i.s=t(this.s,e.s),i.clamp()},f.prototype.changeBit=function(e,t){var i=f.ONE.shiftLeft(e);return this.bitwiseTo(i,t,i),i},f.prototype.addTo=function(e,t){for(var i=0,n=0,r=Math.min(e.t,this.t);i<r;)n+=this[i]+e[i],t[i++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;i<this.t;)n+=this[i],t[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<e.t;)n+=e[i],t[i++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[i++]=n:n<-1&&(t[i++]=this.DV+n),t.t=i,t.clamp()},f.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},f.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},f.prototype.multiplyLowerTo=function(e,t,i){var n,r=Math.min(this.t+e.t,t);for(i.s=0,i.t=r;r>0;)i[--r]=0;for(n=i.t-this.t;r<n;++r)i[r+this.t]=this.am(0,e[r],i,r,0,this.t);for(n=Math.min(e.t,t);r<n;++r)this.am(0,e[r],i,r,0,t-r);i.clamp()},f.prototype.multiplyUpperTo=function(e,t,i){--t;var n=i.t=this.t+e.t-t;for(i.s=0;--n>=0;)i[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)i[this.t+n-t]=this.am(t-n,e[n],i,0,0,this.t+n-t);i.clamp(),i.drShiftTo(1,i)},f.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,i=this.s<0?e-1:0;if(this.t>0)if(0==t)i=this[0]%e;else for(var n=this.t-1;n>=0;--n)i=(t*i+this[n])%e;return i},f.prototype.millerRabin=function(e){var t=this.subtract(f.ONE),i=t.getLowestSetBit();if(i<=0)return!1;var n=t.shiftRight(i);(e=e+1>>1)>k.length&&(e=k.length);for(var r=g(),s=0;s<e;++s){r.fromInt(k[Math.floor(Math.random()*k.length)]);var o=r.modPow(n,this);if(0!=o.compareTo(f.ONE)&&0!=o.compareTo(t)){for(var a=1;a++<i&&0!=o.compareTo(t);)if(0==(o=o.modPowInt(2,this)).compareTo(f.ONE))return!1;if(0!=o.compareTo(t))return!1}}return!0},f.prototype.clone=
358
358
  /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */
359
- function(){var e=A();return this.copyTo(e),e},g.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},g.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},g.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},g.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},g.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var i,n=this.DB-e*this.DB%8,r=0;if(e-- >0)for(n<this.DB&&(i=this[e]>>n)!=(this.s&this.DM)>>n&&(t[r++]=i|this.s<<this.DB-n);e>=0;)n<8?(i=(this[e]&(1<<n)-1)<<8-n,i|=this[--e]>>(n+=this.DB-8)):(i=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&i)&&(i|=-256),0==r&&(128&this.s)!=(128&i)&&++r,(r>0||i!=this.s)&&(t[r++]=i);return t},g.prototype.equals=function(e){return 0==this.compareTo(e)},g.prototype.min=function(e){return this.compareTo(e)<0?this:e},g.prototype.max=function(e){return this.compareTo(e)>0?this:e},g.prototype.and=function(e){var t=A();return this.bitwiseTo(e,j,t),t},g.prototype.or=function(e){var t=A();return this.bitwiseTo(e,z,t),t},g.prototype.xor=function(e){var t=A();return this.bitwiseTo(e,I,t),t},g.prototype.andNot=function(e){var t=A();return this.bitwiseTo(e,b,t),t},g.prototype.not=function(){for(var e=A(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},g.prototype.shiftLeft=function(e){var t=A();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},g.prototype.shiftRight=function(e){var t=A();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},g.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+L(this[e]);return this.s<0?this.t*this.DB:-1},g.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,i=0;i<this.t;++i)e+=S(this[i]^t);return e},g.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},g.prototype.setBit=function(e){return this.changeBit(e,z)},g.prototype.clearBit=function(e){return this.changeBit(e,b)},g.prototype.flipBit=function(e){return this.changeBit(e,I)},g.prototype.add=function(e){var t=A();return this.addTo(e,t),t},g.prototype.subtract=function(e){var t=A();return this.subTo(e,t),t},g.prototype.multiply=function(e){var t=A();return this.multiplyTo(e,t),t},g.prototype.divide=function(e){var t=A();return this.divRemTo(e,t,null),t},g.prototype.remainder=function(e){var t=A();return this.divRemTo(e,null,t),t},g.prototype.divideAndRemainder=function(e){var t=A(),i=A();return this.divRemTo(e,t,i),new Array(t,i)},g.prototype.modPow=function(e,t){var i,n,r=e.bitLength(),s=w(1);if(r<=0)return s;i=r<18?1:r<48?3:r<144?4:r<768?5:6,n=r<8?new x(t):t.isEven()?new P(t):new E(t);var o=new Array,a=3,u=i-1,c=(1<<i)-1;if(o[1]=n.convert(this),i>1){var l=A();for(n.sqrTo(o[1],l);a<=c;)o[a]=A(),n.mulTo(l,o[a-2],o[a]),a+=2}var h,d,p=e.t-1,M=!0,f=A();for(r=T(e[p])-1;p>=0;){for(r>=u?h=e[p]>>r-u&c:(h=(e[p]&(1<<r+1)-1)<<u-r,p>0&&(h|=e[p-1]>>this.DB+r-u)),a=i;0==(1&h);)h>>=1,--a;if((r-=a)<0&&(r+=this.DB,--p),M)o[h].copyTo(s),M=!1;else{for(;a>1;)n.sqrTo(s,f),n.sqrTo(f,s),a-=2;a>0?n.sqrTo(s,f):(d=s,s=f,f=d),n.mulTo(f,o[h],s)}for(;p>=0&&0==(e[p]&1<<r);)n.sqrTo(s,f),d=s,s=f,f=d,--r<0&&(r=this.DB-1,--p)}return n.revert(s)},g.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return g.ZERO;for(var i=e.clone(),n=this.clone(),r=w(1),s=w(0),o=w(0),a=w(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),t?(r.isEven()&&s.isEven()||(r.addTo(this,r),s.subTo(e,s)),r.rShiftTo(1,r)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),t?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(e,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);i.compareTo(n)>=0?(i.subTo(n,i),t&&r.subTo(o,r),s.subTo(a,s)):(n.subTo(i,n),t&&o.subTo(r,o),a.subTo(s,a))}return 0!=n.compareTo(g.ONE)?g.ZERO:a.compareTo(e)>=0?a.subtract(e):a.signum()<0?(a.addTo(e,a),a.signum()<0?a.add(e):a):a},g.prototype.pow=function(e){return this.exp(e,new O)},g.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),i=e.s<0?e.negate():e.clone();if(t.compareTo(i)<0){var n=t;t=i,i=n}var r=t.getLowestSetBit(),s=i.getLowestSetBit();if(s<0)return t;for(r<s&&(s=r),s>0&&(t.rShiftTo(s,t),i.rShiftTo(s,i));t.signum()>0;)(r=t.getLowestSetBit())>0&&t.rShiftTo(r,t),(r=i.getLowestSetBit())>0&&i.rShiftTo(r,i),t.compareTo(i)>=0?(t.subTo(i,t),t.rShiftTo(1,t)):(i.subTo(t,i),i.rShiftTo(1,i));return s>0&&i.lShiftTo(s,i),i},g.prototype.isProbablePrime=function(e){var t,i=this.abs();if(1==i.t&&i[0]<=k[k.length-1]){for(t=0;t<k.length;++t)if(i[0]==k[t])return!0;return!1}if(i.isEven())return!1;for(t=1;t<k.length;){for(var n=k[t],r=t+1;r<k.length&&n<U;)n*=k[r++];for(n=i.modInt(n);t<r;)if(n%k[t++]==0)return!1}return i.millerRabin(e)},g.prototype.square=function(){var e=A();return this.squareTo(e),e};
359
+ function(){var e=g();return this.copyTo(e),e},f.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},f.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},f.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},f.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},f.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var i,n=this.DB-e*this.DB%8,r=0;if(e-- >0)for(n<this.DB&&(i=this[e]>>n)!=(this.s&this.DM)>>n&&(t[r++]=i|this.s<<this.DB-n);e>=0;)n<8?(i=(this[e]&(1<<n)-1)<<8-n,i|=this[--e]>>(n+=this.DB-8)):(i=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&i)&&(i|=-256),0==r&&(128&this.s)!=(128&i)&&++r,(r>0||i!=this.s)&&(t[r++]=i);return t},f.prototype.equals=function(e){return 0==this.compareTo(e)},f.prototype.min=function(e){return this.compareTo(e)<0?this:e},f.prototype.max=function(e){return this.compareTo(e)>0?this:e},f.prototype.and=function(e){var t=g();return this.bitwiseTo(e,j,t),t},f.prototype.or=function(e){var t=g();return this.bitwiseTo(e,I,t),t},f.prototype.xor=function(e){var t=g();return this.bitwiseTo(e,z,t),t},f.prototype.andNot=function(e){var t=g();return this.bitwiseTo(e,b,t),t},f.prototype.not=function(){for(var e=g(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},f.prototype.shiftLeft=function(e){var t=g();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},f.prototype.shiftRight=function(e){var t=g();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},f.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+L(this[e]);return this.s<0?this.t*this.DB:-1},f.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,i=0;i<this.t;++i)e+=S(this[i]^t);return e},f.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},f.prototype.setBit=function(e){return this.changeBit(e,I)},f.prototype.clearBit=function(e){return this.changeBit(e,b)},f.prototype.flipBit=function(e){return this.changeBit(e,z)},f.prototype.add=function(e){var t=g();return this.addTo(e,t),t},f.prototype.subtract=function(e){var t=g();return this.subTo(e,t),t},f.prototype.multiply=function(e){var t=g();return this.multiplyTo(e,t),t},f.prototype.divide=function(e){var t=g();return this.divRemTo(e,t,null),t},f.prototype.remainder=function(e){var t=g();return this.divRemTo(e,null,t),t},f.prototype.divideAndRemainder=function(e){var t=g(),i=g();return this.divRemTo(e,t,i),new Array(t,i)},f.prototype.modPow=function(e,t){var i,n,r=e.bitLength(),s=w(1);if(r<=0)return s;i=r<18?1:r<48?3:r<144?4:r<768?5:6,n=r<8?new x(t):t.isEven()?new P(t):new E(t);var o=new Array,a=3,u=i-1,c=(1<<i)-1;if(o[1]=n.convert(this),i>1){var l=g();for(n.sqrTo(o[1],l);a<=c;)o[a]=g(),n.mulTo(l,o[a-2],o[a]),a+=2}var h,d,A=e.t-1,p=!0,M=g();for(r=T(e[A])-1;A>=0;){for(r>=u?h=e[A]>>r-u&c:(h=(e[A]&(1<<r+1)-1)<<u-r,A>0&&(h|=e[A-1]>>this.DB+r-u)),a=i;0==(1&h);)h>>=1,--a;if((r-=a)<0&&(r+=this.DB,--A),p)o[h].copyTo(s),p=!1;else{for(;a>1;)n.sqrTo(s,M),n.sqrTo(M,s),a-=2;a>0?n.sqrTo(s,M):(d=s,s=M,M=d),n.mulTo(M,o[h],s)}for(;A>=0&&0==(e[A]&1<<r);)n.sqrTo(s,M),d=s,s=M,M=d,--r<0&&(r=this.DB-1,--A)}return n.revert(s)},f.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return f.ZERO;for(var i=e.clone(),n=this.clone(),r=w(1),s=w(0),o=w(0),a=w(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),t?(r.isEven()&&s.isEven()||(r.addTo(this,r),s.subTo(e,s)),r.rShiftTo(1,r)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),t?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(e,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);i.compareTo(n)>=0?(i.subTo(n,i),t&&r.subTo(o,r),s.subTo(a,s)):(n.subTo(i,n),t&&o.subTo(r,o),a.subTo(s,a))}return 0!=n.compareTo(f.ONE)?f.ZERO:a.compareTo(e)>=0?a.subtract(e):a.signum()<0?(a.addTo(e,a),a.signum()<0?a.add(e):a):a},f.prototype.pow=function(e){return this.exp(e,new O)},f.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),i=e.s<0?e.negate():e.clone();if(t.compareTo(i)<0){var n=t;t=i,i=n}var r=t.getLowestSetBit(),s=i.getLowestSetBit();if(s<0)return t;for(r<s&&(s=r),s>0&&(t.rShiftTo(s,t),i.rShiftTo(s,i));t.signum()>0;)(r=t.getLowestSetBit())>0&&t.rShiftTo(r,t),(r=i.getLowestSetBit())>0&&i.rShiftTo(r,i),t.compareTo(i)>=0?(t.subTo(i,t),t.rShiftTo(1,t)):(i.subTo(t,i),i.rShiftTo(1,i));return s>0&&i.lShiftTo(s,i),i},f.prototype.isProbablePrime=function(e){var t,i=this.abs();if(1==i.t&&i[0]<=k[k.length-1]){for(t=0;t<k.length;++t)if(i[0]==k[t])return!0;return!1}if(i.isEven())return!1;for(t=1;t<k.length;){for(var n=k[t],r=t+1;r<k.length&&n<B;)n*=k[r++];for(n=i.modInt(n);t<r;)if(n%k[t++]==0)return!1}return i.millerRabin(e)},f.prototype.square=function(){var e=g();return this.squareTo(e),e};
360
360
  /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */
361
- var B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function _(e){var t,i,n="";for(t=0;t+3<=e.length;t+=3)i=parseInt(e.substring(t,t+3),16),n+=B.charAt(i>>6)+B.charAt(63&i);for(t+1==e.length?(i=parseInt(e.substring(t,t+1),16),n+=B.charAt(i<<2)):t+2==e.length&&(i=parseInt(e.substring(t,t+2),16),n+=B.charAt(i>>2)+B.charAt((3&i)<<4));(3&n.length)>0;)n+="=";return n}function R(e){var t,i,n,r="",s=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t)(n=B.indexOf(e.charAt(t)))<0||(0==s?(r+=N(n>>2),i=3&n,s=1):1==s?(r+=N(i<<2|n>>4),i=15&n,s=2):2==s?(r+=N(i),r+=N(n>>2),i=3&n,s=3):(r+=N(i<<2|n>>4),r+=N(15&n),s=0));return 1==s&&(r+=N(i<<2)),r}
362
- /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function Q(){this.i=0,this.j=0,this.S=new Array}Q.prototype.init=function(e){var t,i,n;for(t=0;t<256;++t)this.S[t]=t;for(i=0,t=0;t<256;++t)i=i+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[i],this.S[i]=n;this.i=0,this.j=0},Q.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var Y,F,V;
363
- /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function H(){var e;e=(new Date).getTime(),F[V++]^=255&e,F[V++]^=e>>8&255,F[V++]^=e>>16&255,F[V++]^=e>>24&255,V>=256&&(V-=256)}if(null==F){var G;if(F=new Array,V=0,"undefined"!=typeof window&&(void 0!==window.crypto||void 0!==window.msCrypto)){var q=window.crypto||window.msCrypto;if(q.getRandomValues){var W=new Uint8Array(32);for(q.getRandomValues(W),G=0;G<32;++G)F[V++]=W[G]}else if("undefined"!=typeof navigator&&"Netscape"==navigator.appName&&navigator.appVersion<"5"){var K=window.crypto.random(32);for(G=0;G<K.length;++G)F[V++]=255&K.charCodeAt(G)}}for(;V<256;)G=Math.floor(65536*Math.random()),F[V++]=G>>>8,F[V++]=255&G;V=0,H()}function Z(){if(null==Y){for(H(),(Y=new Q).init(F),V=0;V<F.length;++V)F[V]=0;V=0}return Y.next()}function X(){}
361
+ var U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Q(e){var t,i,n="";for(t=0;t+3<=e.length;t+=3)i=parseInt(e.substring(t,t+3),16),n+=U.charAt(i>>6)+U.charAt(63&i);for(t+1==e.length?(i=parseInt(e.substring(t,t+1),16),n+=U.charAt(i<<2)):t+2==e.length&&(i=parseInt(e.substring(t,t+2),16),n+=U.charAt(i>>2)+U.charAt((3&i)<<4));(3&n.length)>0;)n+="=";return n}function _(e){var t,i,n,r="",s=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t)(n=U.indexOf(e.charAt(t)))<0||(0==s?(r+=N(n>>2),i=3&n,s=1):1==s?(r+=N(i<<2|n>>4),i=15&n,s=2):2==s?(r+=N(i),r+=N(n>>2),i=3&n,s=3):(r+=N(i<<2|n>>4),r+=N(15&n),s=0));return 1==s&&(r+=N(i<<2)),r}
362
+ /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function R(){this.i=0,this.j=0,this.S=new Array}R.prototype.init=function(e){var t,i,n;for(t=0;t<256;++t)this.S[t]=t;for(i=0,t=0;t<256;++t)i=i+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[i],this.S[i]=n;this.i=0,this.j=0},R.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var Y,F,V;
363
+ /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function H(){var e;e=(new Date).getTime(),F[V++]^=255&e,F[V++]^=e>>8&255,F[V++]^=e>>16&255,F[V++]^=e>>24&255,V>=256&&(V-=256)}if(null==F){var G;if(F=new Array,V=0,"undefined"!=typeof window&&(void 0!==window.crypto||void 0!==window.msCrypto)){var q=window.crypto||window.msCrypto;if(q.getRandomValues){var W=new Uint8Array(32);for(q.getRandomValues(W),G=0;G<32;++G)F[V++]=W[G]}else if("undefined"!=typeof navigator&&"Netscape"==navigator.appName&&navigator.appVersion<"5"){var Z=window.crypto.random(32);for(G=0;G<Z.length;++G)F[V++]=255&Z.charCodeAt(G)}}for(;V<256;)G=Math.floor(65536*Math.random()),F[V++]=G>>>8,F[V++]=255&G;V=0,H()}function X(){if(null==Y){for(H(),(Y=new R).init(F),V=0;V<F.length;++V)F[V]=0;V=0}return Y.next()}function K(){}
364
364
  /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */
365
- function J(e,t){return new g(e,t)}function $(e,t,i){for(var n="",r=0;n.length<t;)n+=i(String.fromCharCode.apply(String,e.concat([(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r]))),r+=1;return n}function ee(){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 te(e,t,i){for(var n="",r=0;n.length<t;)n+=i(e+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])),r+=1;return n}function ie(e){for(var t="",i=0;i<e.length;i++){var n=e[i].toString(16);1==n.length&&(n="0"+n),t+=n}return t}function ne(e){return ie(function(e){for(var t=new Array,i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}(e))}function re(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),e=(e=e.replace(/-/g,"+")).replace(/_/g,"/")}function se(e){return e.length%2==1&&(e="0"+e),function(e){return(e=(e=e.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}(_(e))}function oe(e){return R(re(e))}function ae(e){return function(e){return e.replace(/%/g,"")}(function(e){for(var t=encodeURIComponent(e),i="",n=0;n<t.length;n++)"%"==t[n]?(i+=t.substr(n,3),n+=2):i=i+"%"+ne(t[n]);return i}(e))}function ue(e){return decodeURIComponent(function(e){return e.replace(/(..)/g,"%$1")}(e))}function ce(e){for(var t="",i=0;i<e.length-1;i+=2)t+=String.fromCharCode(parseInt(e.substr(i,2),16));return t}function le(e){for(var t="",i=0;i<e.length;i++)t+=("0"+e.charCodeAt(i).toString(16)).slice(-2);return t}function he(e){var t=function(e){return _(e)}(e).replace(/(.{64})/g,"$1\r\n");return t=t.replace(/\r\n$/,"")}function de(e,t){return"-----BEGIN "+t+"-----\r\n"+he(e)+"\r\n-----END "+t+"-----\r\n"}function pe(e,t){if(-1==e.indexOf("-----BEGIN "))throw"can't find PEM header: "+t;return function(e){return R(e.replace(/[^0-9A-Za-z\/+=]*/g,""))}(e=void 0!==t?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Me(e){var t="malformed hex value";if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(8!=e.length)return 32==e.length?function(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var t=(e=e.toLowerCase()).match(/.{1,4}/g),i=0;i<8;i++)t[i]=t[i].replace(/^0+/,""),""==t[i]&&(t[i]="0");var n=(e=":"+t.join(":")+":").match(/:(0:){2,}/g);if(null===n)return e.slice(1,-1);var r="";for(i=0;i<n.length;i++)n[i].length>r.length&&(r=n[i]);return(e=e.replace(r,"::")).slice(1,-1)}(e):e;try{return parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16)}catch(e){throw t}}function fe(e){return e.match(/.{4}/g).map((function(e){var t=parseInt(e.substr(0,2),16),i=parseInt(e.substr(2),16);if(0==t&i<128)return String.fromCharCode(i);if(t<8){var n=128|63&i;return ue((192|(7&t)<<3|(192&i)>>6).toString(16)+n.toString(16))}n=128|(15&t)<<2|(192&i)>>6;var r=128|63&i;return ue((224|(240&t)>>4).toString(16)+n.toString(16)+r.toString(16))})).join("")}function ge(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function Ae(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}X.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;++t)e[t]=Z()},ee.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},ee.prototype.setPublic=function(e,t){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof e)this.n=e,this.e=t;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA public key";this.n=J(e,16),this.e=parseInt(t,16)}},ee.prototype.encrypt=function(e){var t=function(e,t){if(t<e.length+11)throw"Message too long for RSA";for(var i=new Array,n=e.length-1;n>=0&&t>0;){var r=e.charCodeAt(n--);r<128?i[--t]=r:r>127&&r<2048?(i[--t]=63&r|128,i[--t]=r>>6|192):(i[--t]=63&r|128,i[--t]=r>>6&63|128,i[--t]=r>>12|224)}i[--t]=0;for(var s=new X,o=new Array;t>2;){for(o[0]=0;0==o[0];)s.nextBytes(o);i[--t]=o[0]}return i[--t]=2,i[--t]=0,new g(i)}(e,this.n.bitLength()+7>>3);if(null==t)return null;var i=this.doPublic(t);if(null==i)return null;var n=i.toString(16);return 0==(1&n.length)?n:"0"+n},ee.prototype.encryptOAEP=function(e,t,i){var n=function(e,t,i,n){var r=p.crypto.MessageDigest,s=p.crypto.Util,o=null;if(i||(i="sha1"),"string"==typeof i&&(o=r.getCanonicalAlgName(i),n=r.getHashLength(o),i=function(e){return ce(s.hashHex(le(e),o))}),e.length+2*n+2>t)throw"Message too long for RSA";var a,u="";for(a=0;a<t-e.length-2*n-2;a+=1)u+="\0";var c=i("")+u+""+e,l=new Array(n);(new X).nextBytes(l);var h=$(l,c.length,i),d=[];for(a=0;a<c.length;a+=1)d[a]=c.charCodeAt(a)^h.charCodeAt(a);var M=$(d,l.length,i),f=[0];for(a=0;a<l.length;a+=1)f[a+1]=l[a]^M.charCodeAt(a);return new g(f.concat(d))}(e,this.n.bitLength()+7>>3,t,i);if(null==n)return null;var r=this.doPublic(n);if(null==r)return null;var s=r.toString(16);return 0==(1&s.length)?s:"0"+s},ee.prototype.type="RSA",ee.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),i=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(i)<0;)t=t.add(this.p);return t.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)},ee.prototype.setPrivate=function(e,t,i){if(this.isPrivate=!0,"string"!=typeof e)this.n=e,this.e=t,this.d=i;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA private key";this.n=J(e,16),this.e=parseInt(t,16),this.d=J(i,16)}},ee.prototype.setPrivateEx=function(e,t,i,n,r,s,o,a){if(this.isPrivate=!0,this.isPublic=!1,null==e)throw"RSASetPrivateEx N == null";if(null==t)throw"RSASetPrivateEx E == null";if(0==e.length)throw"RSASetPrivateEx N.length == 0";if(0==t.length)throw"RSASetPrivateEx E.length == 0";if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA private key in RSASetPrivateEx";this.n=J(e,16),this.e=parseInt(t,16),this.d=J(i,16),this.p=J(n,16),this.q=J(r,16),this.dmp1=J(s,16),this.dmq1=J(o,16),this.coeff=J(a,16)},ee.prototype.generate=function(e,t){var i=new X,n=e>>1;this.e=parseInt(t,16);for(var r=new g(t,16);;){for(;this.p=new g(e-n,1,i),0!=this.p.subtract(g.ONE).gcd(r).compareTo(g.ONE)||!this.p.isProbablePrime(10););for(;this.q=new g(n,1,i),0!=this.q.subtract(g.ONE).gcd(r).compareTo(g.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q,this.q=s}var o=this.p.subtract(g.ONE),a=this.q.subtract(g.ONE),u=o.multiply(a);if(0==u.gcd(r).compareTo(g.ONE)&&(this.n=this.p.multiply(this.q),this.n.bitLength()==e)){this.d=r.modInverse(u),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);break}}this.isPrivate=!0},ee.prototype.decrypt=function(e){if(e.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=J(e,16),i=this.doPrivate(t);return null==i?null:
365
+ function J(e,t){return new f(e,t)}function $(e,t,i){for(var n="",r=0;n.length<t;)n+=i(String.fromCharCode.apply(String,e.concat([(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r]))),r+=1;return n}function ee(){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 te(e,t,i){for(var n="",r=0;n.length<t;)n+=i(e+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])),r+=1;return n}function ie(e){for(var t="",i=0;i<e.length;i++){var n=e[i].toString(16);1==n.length&&(n="0"+n),t+=n}return t}function ne(e){return ie(function(e){for(var t=new Array,i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}(e))}function re(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),e=(e=e.replace(/-/g,"+")).replace(/_/g,"/")}function se(e){return e.length%2==1&&(e="0"+e),function(e){return(e=(e=e.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}(Q(e))}function oe(e){return _(re(e))}function ae(e){return function(e){return e.replace(/%/g,"")}(function(e){for(var t=encodeURIComponent(e),i="",n=0;n<t.length;n++)"%"==t[n]?(i+=t.substr(n,3),n+=2):i=i+"%"+ne(t[n]);return i}(e))}function ue(e){return decodeURIComponent(function(e){return e.replace(/(..)/g,"%$1")}(e))}function ce(e){for(var t="",i=0;i<e.length-1;i+=2)t+=String.fromCharCode(parseInt(e.substr(i,2),16));return t}function le(e){for(var t="",i=0;i<e.length;i++)t+=("0"+e.charCodeAt(i).toString(16)).slice(-2);return t}function he(e){var t=function(e){return Q(e)}(e).replace(/(.{64})/g,"$1\r\n");return t=t.replace(/\r\n$/,"")}function de(e,t){return"-----BEGIN "+t+"-----\r\n"+he(e)+"\r\n-----END "+t+"-----\r\n"}function Ae(e,t){if(-1==e.indexOf("-----BEGIN "))throw"can't find PEM header: "+t;return function(e){return _(e.replace(/[^0-9A-Za-z\/+=]*/g,""))}(e=void 0!==t?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function pe(e){var t="malformed hex value";if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(8!=e.length)return 32==e.length?function(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var t=(e=e.toLowerCase()).match(/.{1,4}/g),i=0;i<8;i++)t[i]=t[i].replace(/^0+/,""),""==t[i]&&(t[i]="0");var n=(e=":"+t.join(":")+":").match(/:(0:){2,}/g);if(null===n)return e.slice(1,-1);var r="";for(i=0;i<n.length;i++)n[i].length>r.length&&(r=n[i]);return(e=e.replace(r,"::")).slice(1,-1)}(e):e;try{return parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16)}catch(e){throw t}}function Me(e){return e.match(/.{4}/g).map((function(e){var t=parseInt(e.substr(0,2),16),i=parseInt(e.substr(2),16);if(0==t&i<128)return String.fromCharCode(i);if(t<8){var n=128|63&i;return ue((192|(7&t)<<3|(192&i)>>6).toString(16)+n.toString(16))}n=128|(15&t)<<2|(192&i)>>6;var r=128|63&i;return ue((224|(240&t)>>4).toString(16)+n.toString(16)+r.toString(16))})).join("")}function fe(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function ge(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}K.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;++t)e[t]=X()},ee.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},ee.prototype.setPublic=function(e,t){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof e)this.n=e,this.e=t;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA public key";this.n=J(e,16),this.e=parseInt(t,16)}},ee.prototype.encrypt=function(e){var t=function(e,t){if(t<e.length+11)throw"Message too long for RSA";for(var i=new Array,n=e.length-1;n>=0&&t>0;){var r=e.charCodeAt(n--);r<128?i[--t]=r:r>127&&r<2048?(i[--t]=63&r|128,i[--t]=r>>6|192):(i[--t]=63&r|128,i[--t]=r>>6&63|128,i[--t]=r>>12|224)}i[--t]=0;for(var s=new K,o=new Array;t>2;){for(o[0]=0;0==o[0];)s.nextBytes(o);i[--t]=o[0]}return i[--t]=2,i[--t]=0,new f(i)}(e,this.n.bitLength()+7>>3);if(null==t)return null;var i=this.doPublic(t);if(null==i)return null;var n=i.toString(16);return 0==(1&n.length)?n:"0"+n},ee.prototype.encryptOAEP=function(e,t,i){var n=function(e,t,i,n){var r=A.crypto.MessageDigest,s=A.crypto.Util,o=null;if(i||(i="sha1"),"string"==typeof i&&(o=r.getCanonicalAlgName(i),n=r.getHashLength(o),i=function(e){return ce(s.hashHex(le(e),o))}),e.length+2*n+2>t)throw"Message too long for RSA";var a,u="";for(a=0;a<t-e.length-2*n-2;a+=1)u+="\0";var c=i("")+u+""+e,l=new Array(n);(new K).nextBytes(l);var h=$(l,c.length,i),d=[];for(a=0;a<c.length;a+=1)d[a]=c.charCodeAt(a)^h.charCodeAt(a);var p=$(d,l.length,i),M=[0];for(a=0;a<l.length;a+=1)M[a+1]=l[a]^p.charCodeAt(a);return new f(M.concat(d))}(e,this.n.bitLength()+7>>3,t,i);if(null==n)return null;var r=this.doPublic(n);if(null==r)return null;var s=r.toString(16);return 0==(1&s.length)?s:"0"+s},ee.prototype.type="RSA",ee.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),i=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(i)<0;)t=t.add(this.p);return t.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)},ee.prototype.setPrivate=function(e,t,i){if(this.isPrivate=!0,"string"!=typeof e)this.n=e,this.e=t,this.d=i;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA private key";this.n=J(e,16),this.e=parseInt(t,16),this.d=J(i,16)}},ee.prototype.setPrivateEx=function(e,t,i,n,r,s,o,a){if(this.isPrivate=!0,this.isPublic=!1,null==e)throw"RSASetPrivateEx N == null";if(null==t)throw"RSASetPrivateEx E == null";if(0==e.length)throw"RSASetPrivateEx N.length == 0";if(0==t.length)throw"RSASetPrivateEx E.length == 0";if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA private key in RSASetPrivateEx";this.n=J(e,16),this.e=parseInt(t,16),this.d=J(i,16),this.p=J(n,16),this.q=J(r,16),this.dmp1=J(s,16),this.dmq1=J(o,16),this.coeff=J(a,16)},ee.prototype.generate=function(e,t){var i=new K,n=e>>1;this.e=parseInt(t,16);for(var r=new f(t,16);;){for(;this.p=new f(e-n,1,i),0!=this.p.subtract(f.ONE).gcd(r).compareTo(f.ONE)||!this.p.isProbablePrime(10););for(;this.q=new f(n,1,i),0!=this.q.subtract(f.ONE).gcd(r).compareTo(f.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q,this.q=s}var o=this.p.subtract(f.ONE),a=this.q.subtract(f.ONE),u=o.multiply(a);if(0==u.gcd(r).compareTo(f.ONE)&&(this.n=this.p.multiply(this.q),this.n.bitLength()==e)){this.d=r.modInverse(u),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);break}}this.isPrivate=!0},ee.prototype.decrypt=function(e){if(e.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=J(e,16),i=this.doPrivate(t);return null==i?null:
366
366
  /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */
367
- function(e,t){for(var i=e.toByteArray(),n=0;n<i.length&&0==i[n];)++n;if(i.length-n!=t-1||2!=i[n])return null;for(++n;0!=i[n];)if(++n>=i.length)return null;for(var r="";++n<i.length;){var s=255&i[n];s<128?r+=String.fromCharCode(s):s>191&&s<224?(r+=String.fromCharCode((31&s)<<6|63&i[n+1]),++n):(r+=String.fromCharCode((15&s)<<12|(63&i[n+1])<<6|63&i[n+2]),n+=2)}return r}(i,this.n.bitLength()+7>>3)},ee.prototype.decryptOAEP=function(e,t,i){if(e.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var n=J(e,16),r=this.doPrivate(n);return null==r?null:function(e,t,i,n){var r=p.crypto.MessageDigest,s=p.crypto.Util,o=null;for(i||(i="sha1"),"string"==typeof i&&(o=r.getCanonicalAlgName(i),n=r.getHashLength(o),i=function(e){return ce(s.hashHex(le(e),o))}),e=e.toByteArray(),a=0;a<e.length;a+=1)e[a]&=255;for(;e.length<t;)e.unshift(0);if((e=String.fromCharCode.apply(String,e)).length<2*n+2)throw"Cipher too short";var a,u=e.substr(1,n),c=e.substr(n+1),l=te(c,n,i),h=[];for(a=0;a<u.length;a+=1)h[a]=u.charCodeAt(a)^l.charCodeAt(a);var d=te(String.fromCharCode.apply(String,h),e.length-n,i),M=[];for(a=0;a<c.length;a+=1)M[a]=c.charCodeAt(a)^d.charCodeAt(a);if((M=String.fromCharCode.apply(String,M)).substr(0,n)!==i(""))throw"Hash mismatch";var f=(M=M.substr(n)).indexOf("");if((-1!=f?M.substr(0,f).lastIndexOf("\0"):-1)+1!=f)throw"Malformed data";return M.substr(f+1)}(r,this.n.bitLength()+7>>3,t,i)},void 0!==p.lang&&p.lang||(p.lang={}),p.lang.String=function(){},p.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},p.lang.String.isHex=function(e){return ge(e)},p.lang.String.isBase64=function(e){return!(!(e=e.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},p.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=re(e),p.lang.String.isBase64(e))},p.lang.String.isIntegerArray=function(e){return!!(e=e.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},p.lang.String.isPrintable=function(e){return null!==e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},p.lang.String.isIA5=function(e){return null!==e.match(/^[\x20-\x21\x23-\x7f]*$/)},p.lang.String.isMail=function(e){return null!==e.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var ye=function(e,t,i){return null==i&&(i="0"),e.length>=t?e:new Array(t-e.length+1).join(i)+e};function ve(e,t){var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}void 0!==p.crypto&&p.crypto||(p.crypto={}),p.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:f.algo.MD5,sha1:f.algo.SHA1,sha224:f.algo.SHA224,sha256:f.algo.SHA256,sha384:f.algo.SHA384,sha512:f.algo.SHA512,ripemd160:f.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,i){var n=this.getDigestInfoHex(e,t),r=i/4;if(n.length+22>r)throw"key is too short for SigAlg: keylen="+i+","+t;for(var s="0001",o="00"+n,a="",u=r-s.length-o.length,c=0;c<u;c+=2)a+="ff";return s+a+o},this.hashString=function(e,t){return new p.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new p.crypto.MessageDigest({alg:t}).digestHex(e)},this.sha1=function(e){return this.hashString(e,"sha1")},this.sha256=function(e){return this.hashString(e,"sha256")},this.sha256Hex=function(e){return this.hashHex(e,"sha256")},this.sha512=function(e){return this.hashString(e,"sha512")},this.sha512Hex=function(e){return this.hashHex(e,"sha512")},this.isKey=function(e){return e instanceof ee||e instanceof p.crypto.DSA||e instanceof p.crypto.ECDSA}},p.crypto.Util.md5=function(e){return new p.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(e)},p.crypto.Util.ripemd160=function(e){return new p.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(e)},p.crypto.Util.SECURERANDOMGEN=new X,p.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return p.crypto.Util.SECURERANDOMGEN.nextBytes(t),ie(t)},p.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new g(p.crypto.Util.getRandomHexOfNbytes(e),16)},p.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,i=new Array((e-t)/8+1);return p.crypto.Util.SECURERANDOMGEN.nextBytes(i),i[0]=(255<<t&255^255)&i[0],ie(i)},p.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new g(p.crypto.Util.getRandomHexOfNbits(e),16)},p.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var i=p.crypto.Util.getRandomBigIntegerOfNbits(t);if(-1!=e.compareTo(i))return i}},p.crypto.Util.getRandomBigIntegerMinToMax=function(e,t){var i=e.compareTo(t);if(1==i)throw"biMin is greater than biMax";if(0==i)return e;var n=t.subtract(e);return p.crypto.Util.getRandomBigIntegerZeroToMax(n).add(e)},p.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=p.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=p.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=p.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[e].create()}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=f.enc.Hex.parse(e);this.md.update(t)},this.digest=function(){return this.md.finalize().toString(f.enc.Hex)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}if(-1!=":sha256:".indexOf(e)&&"sjcl"==t){try{this.md=new sjcl.hash.sha256}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=sjcl.codec.hex.toBits(e);this.md.update(t)},this.digest=function(){var e=this.md.finalize();return sjcl.codec.hex.fromBits(e)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(e){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(e){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==e&&void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=p.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},p.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},p.crypto.MessageDigest.getHashLength=function(e){var t=p.crypto.MessageDigest,i=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[i])throw"not supported algorithm: "+e;return t.HASHLENGTH[i]},p.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},p.crypto.Mac=function(e){this.setAlgAndProvider=function(e,t){if(null==(e=e.toLowerCase())&&(e="hmacsha1"),"hmac"!=(e=e.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+e;void 0===t&&(t=p.crypto.Util.DEFAULTPROVIDER[e]),this.algProv=e+"/"+t;var i=e.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(i)&&"cryptojs"==t){try{var n=p.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[i];this.mac=f.algo.HMAC.create(n,this.pass)}catch(e){throw"setAlgAndProvider hash alg set fail hashAlg="+i+"/"+e}this.updateString=function(e){this.mac.update(e)},this.updateHex=function(e){var t=f.enc.Hex.parse(e);this.mac.update(t)},this.doFinal=function(){return this.mac.finalize().toString(f.enc.Hex)},this.doFinalString=function(e){return this.updateString(e),this.doFinal()},this.doFinalHex=function(e){return this.updateHex(e),this.doFinal()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(e){if("string"==typeof e){var t=e;return e.length%2!=1&&e.match(/^[0-9A-Fa-f]+$/)||(t=le(e)),void(this.pass=f.enc.Hex.parse(t))}if("object"!=typeof e)throw"KJUR.crypto.Mac unsupported password type: "+e;t=null;if(void 0!==e.hex){if(e.hex.length%2!=0||!e.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+e.hex;t=e.hex}if(void 0!==e.utf8&&(t=ae(e.utf8)),void 0!==e.rstr&&(t=le(e.rstr)),void 0!==e.b64&&(t=R(e.b64)),void 0!==e.b64u&&(t=oe(e.b64u)),null==t)throw"KJUR.crypto.Mac unsupported password type: "+e;this.pass=f.enc.Hex.parse(t)},void 0!==e&&(void 0!==e.pass&&this.setPassword(e.pass),void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=p.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},p.crypto.Signature=function(e){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,t){for(var i="",n=t/4-e.length,r=0;r<n;r++)i+="0";return i+e},this.setAlgAndProvider=function(e,t){if(this._setAlgNames(),"cryptojs/jsrsa"!=t)throw new Error("provider not supported: "+t);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new p.crypto.MessageDigest({alg:this.mdAlgName})}catch(e){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+e)}this.init=function(e,t){var i=null;try{i=void 0===t?ze.getKey(e):ze.getKey(e,t)}catch(e){throw"init failed:"+e}if(!0===i.isPrivate)this.prvKey=i,this.state="SIGN";else{if(!0!==i.isPublic)throw"init failed.:"+i;this.pubKey=i,this.state="VERIFY"}},this.updateString=function(e){this.md.updateString(e)},this.updateHex=function(e){this.md.updateHex(e)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==p.crypto.ECDSA&&(this.prvKey=new p.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof ee&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof ee&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof p.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof p.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(e){return this.updateString(e),this.sign()},this.signHex=function(e){return this.updateHex(e),this.sign()},this.verify=function(e){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==p.crypto.ECDSA&&(this.pubKey=new p.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof ee&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ee&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==p.crypto.ECDSA&&this.pubKey instanceof p.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==p.crypto.DSA&&this.pubKey instanceof p.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,t){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.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(e){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(e){throw"digestHex(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=e,void 0!==e&&(void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov?this.provName=p.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==e.psssaltlen&&(this.pssSaltLen=e.psssaltlen),void 0!==e.prvkeypem)){if(void 0!==e.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{t=ze.getKey(e.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},p.crypto.Cipher=function(e){},p.crypto.Cipher.encrypt=function(e,t,i){if(t instanceof ee&&t.isPublic){var n=p.crypto.Cipher.getAlgByKeyAndName(t,i);if("RSA"===n)return t.encrypt(e);if("RSAOAEP"===n)return t.encryptOAEP(e,"sha1");var r=n.match(/^RSAOAEP(\d+)$/);if(null!==r)return t.encryptOAEP(e,"sha"+r[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+i}throw"Cipher.encrypt: unsupported key or algorithm"},p.crypto.Cipher.decrypt=function(e,t,i){if(t instanceof ee&&t.isPrivate){var n=p.crypto.Cipher.getAlgByKeyAndName(t,i);if("RSA"===n)return t.decrypt(e);if("RSAOAEP"===n)return t.decryptOAEP(e,"sha1");var r=n.match(/^RSAOAEP(\d+)$/);if(null!==r)return t.decryptOAEP(e,"sha"+r[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+i}throw"Cipher.decrypt: unsupported key or algorithm"},p.crypto.Cipher.getAlgByKeyAndName=function(e,t){if(e instanceof ee){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(t))return t;if(null==t)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+t}throw"getAlgByKeyAndName: not supported algorithm name: "+t},p.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 me,Ne,De,we,Te,xe,Ee,je,ze=(me=function(e,t,i){return Ne(f.AES,e,t,i)},Ne=function(e,t,i,n){var r=f.enc.Hex.parse(t),s=f.enc.Hex.parse(i),o=f.enc.Hex.parse(n),a={};a.key=s,a.iv=o,a.ciphertext=r;var u=e.decrypt(a,s,{iv:o});return f.enc.Hex.stringify(u)},De=function(e,t,i){return we(f.AES,e,t,i)},we=function(e,t,i,n){var r=f.enc.Hex.parse(t),s=f.enc.Hex.parse(i),o=f.enc.Hex.parse(n),a=e.encrypt(r,s,{iv:o}),u=f.enc.Hex.parse(a.toString());return f.enc.Base64.stringify(u)},Te={"AES-256-CBC":{proc:me,eproc:De,keylen:32,ivlen:16},"AES-192-CBC":{proc:me,eproc:De,keylen:24,ivlen:16},"AES-128-CBC":{proc:me,eproc:De,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,t,i){return Ne(f.TripleDES,e,t,i)},eproc:function(e,t,i){return we(f.TripleDES,e,t,i)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,t,i){return Ne(f.DES,e,t,i)},eproc:function(e,t,i){return we(f.DES,e,t,i)},keylen:8,ivlen:8}},xe=function(e){var t={},i=e.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));i&&(t.cipher=i[1],t.ivsalt=i[2]);var n=e.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(t.type=n[1]);var r=-1,s=0;-1!=e.indexOf("\r\n\r\n")&&(r=e.indexOf("\r\n\r\n"),s=2),-1!=e.indexOf("\n\n")&&(r=e.indexOf("\n\n"),s=1);var o=e.indexOf("-----END");if(-1!=r&&-1!=o){var a=e.substring(r+2*s,o-s);a=a.replace(/\s+/g,""),t.data=a}return t},Ee=function(e,t,i){for(var n=i.substring(0,16),r=f.enc.Hex.parse(n),s=f.enc.Utf8.parse(t),o=Te[e].keylen+Te[e].ivlen,a="",u=null;;){var c=f.algo.MD5.create();if(null!=u&&c.update(u),c.update(s),c.update(r),u=c.finalize(),(a+=f.enc.Hex.stringify(u)).length>=2*o)break}var l={};return l.keyhex=a.substr(0,2*Te[e].keylen),l.ivhex=a.substr(2*Te[e].keylen,2*Te[e].ivlen),l},je=function(e,t,i,n){var r=f.enc.Base64.parse(e),s=f.enc.Hex.stringify(r);return(0,Te[t].proc)(s,i,n)},{version:"1.0.0",parsePKCS5PEM:function(e){return xe(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,i){return Ee(e,t,i)},decryptKeyB64:function(e,t,i,n){return je(e,t,i,n)},getDecryptedKeyHex:function(e,t){var i=xe(e);i.type;var n=i.cipher,r=i.ivsalt,s=i.data,o=Ee(n,t,r).keyhex;return je(s,n,o,r)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,i,n,r){var s="";if(void 0!==n&&null!=n||(n="AES-256-CBC"),void 0===Te[n])throw"KEYUTIL unsupported algorithm: "+n;void 0!==r&&null!=r||(r=function(e){var t=f.lib.WordArray.random(e);return f.enc.Hex.stringify(t)}(Te[n].ivlen).toUpperCase());var o=function(e,t,i,n){return(0,Te[t].eproc)(e,i,n)}(t,n,Ee(n,i,r).keyhex,r);return s="-----BEGIN "+e+" PRIVATE KEY-----\r\n",s+="Proc-Type: 4,ENCRYPTED\r\n",s+="DEK-Info: "+n+","+r+"\r\n",s+="\r\n",s+=o.replace(/(.{64})/g,"$1\r\n"),s+="\r\n-----END "+e+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(e){var t=Ie,i=t.getChildIdx,n=t.getV,r={},s=i(e,0);if(2!=s.length)throw"malformed format: SEQUENCE(0).items != 2: "+s.length;r.ciphertext=n(e,s[1]);var o=i(e,s[0]);if(2!=o.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+o.length;if("2a864886f70d01050d"!=n(e,o[0]))throw"this only supports pkcs5PBES2";var a=i(e,o[1]);if(2!=o.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+a.length;var u=i(e,a[1]);if(2!=u.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length;if("2a864886f70d0307"!=n(e,u[0]))throw"this only supports TripleDES";r.encryptionSchemeAlg="TripleDES",r.encryptionSchemeIV=n(e,u[1]);var c=i(e,a[0]);if(2!=c.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length;if("2a864886f70d01050c"!=n(e,c[0]))throw"this only supports pkcs5PBKDF2";var l=i(e,c[1]);if(l.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+l.length;r.pbkdf2Salt=n(e,l[0]);var h=n(e,l[1]);try{r.pbkdf2Iter=parseInt(h,16)}catch(e){throw"malformed format pbkdf2Iter: "+h}return r},getPBKDF2KeyHexFromParam:function(e,t){var i=f.enc.Hex.parse(e.pbkdf2Salt),n=e.pbkdf2Iter,r=f.PBKDF2(t,i,{keySize:6,iterations:n});return f.enc.Hex.stringify(r)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var i=pe(e,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(i),r=ze.getPBKDF2KeyHexFromParam(n,t),s={};s.ciphertext=f.enc.Hex.parse(n.ciphertext);var o=f.enc.Hex.parse(r),a=f.enc.Hex.parse(n.encryptionSchemeIV),u=f.TripleDES.decrypt(s,o,{iv:a});return f.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(e,t){var i=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(i)},parsePlainPrivatePKCS8Hex:function(e){var t=Ie,i=t.getChildIdx,n=t.getV,r={algparam:null};if("30"!=e.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var s=i(e,0);if(s.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(s[1],2))throw new Error("malformed PKCS8 private key(code:003)");var o=i(e,s[1]);if(2!=o.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(o[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(r.algoid=n(e,o[0]),"06"==e.substr(o[1],2)&&(r.algparam=n(e,o[1])),"04"!=e.substr(s[2],2))throw new Error("malformed PKCS8 private key(code:006)");return r.keyidx=t.getVidx(e,s[2]),r},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=pe(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,i=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==i.algoid)t=new ee;else if("2a8648ce380401"==i.algoid)t=new p.crypto.DSA;else{if("2a8648ce3d0201"!=i.algoid)throw"unsupported private key algorithm";t=new p.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,i=Ie.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===i)t=new ee;else if("2a8648ce380401"===i)t=new p.crypto.DSA;else{if("2a8648ce3d0201"!==i)throw"unsupported PKCS#8 public key hex";t=new p.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=Ie,i=t.getChildIdx,n=t.getV,r={};if("30"!=e.substr(0,2))throw"malformed RSA key(code:001)";var s=i(e,0);if(2!=s.length)throw"malformed RSA key(code:002)";if("02"!=e.substr(s[0],2))throw"malformed RSA key(code:003)";if(r.n=n(e,s[0]),"02"!=e.substr(s[1],2))throw"malformed RSA key(code:004)";return r.e=n(e,s[1]),r},parsePublicPKCS8Hex:function(e){var t=Ie,i=t.getChildIdx,n=t.getV,r={algparam:null},s=i(e,0);if(2!=s.length)throw"outer DERSequence shall have 2 elements: "+s.length;var o=s[0];if("30"!=e.substr(o,2))throw"malformed PKCS8 public key(code:001)";var a=i(e,o);if(2!=a.length)throw"malformed PKCS8 public key(code:002)";if("06"!=e.substr(a[0],2))throw"malformed PKCS8 public key(code:003)";if(r.algoid=n(e,a[0]),"06"==e.substr(a[1],2)?r.algparam=n(e,a[1]):"30"==e.substr(a[1],2)&&(r.algparam={},r.algparam.p=t.getVbyList(e,a[1],[0],"02"),r.algparam.q=t.getVbyList(e,a[1],[1],"02"),r.algparam.g=t.getVbyList(e,a[1],[2],"02")),"03"!=e.substr(s[1],2))throw"malformed PKCS8 public key(code:004)";return r.key=n(e,s[1]).substr(2),r}});ze.getKey=function(e,t,i){var n=(y=Ie).getChildIdx;y.getV;var r=y.getVbyList,s=p.crypto,o=s.ECDSA,a=s.DSA,u=ee,c=pe,l=ze;if(void 0!==u&&e instanceof u)return e;if(void 0!==o&&e instanceof o)return e;if(void 0!==a&&e instanceof a)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new o({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new o({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(I=new u).setPublic(e.n,e.e),I;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.co&&void 0===e.qi)return(I=new u).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),I;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(I=new u).setPrivate(e.n,e.e,e.d),I;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(I=new a).setPublic(e.p,e.q,e.g,e.y),I;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(I=new a).setPrivate(e.p,e.q,e.g,e.y,e.x),I;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(I=new u).setPublic(oe(e.n),oe(e.e)),I;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.qi)return(I=new u).setPrivateEx(oe(e.n),oe(e.e),oe(e.d),oe(e.p),oe(e.q),oe(e.dp),oe(e.dq),oe(e.qi)),I;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(I=new u).setPrivate(oe(e.n),oe(e.e),oe(e.d)),I;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var h=(z=new o({curve:e.crv})).ecparams.keylen/4,d="04"+("0000000000"+oe(e.x)).slice(-h)+("0000000000"+oe(e.y)).slice(-h);return z.setPublicKeyHex(d),z}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){h=(z=new o({curve:e.crv})).ecparams.keylen/4,d="04"+("0000000000"+oe(e.x)).slice(-h)+("0000000000"+oe(e.y)).slice(-h);var M=("0000000000"+oe(e.d)).slice(-h);return z.setPublicKeyHex(d),z.setPrivateKeyHex(M),z}if("pkcs5prv"===i){var f,A=e,y=Ie;if(9===(f=n(A,0)).length)(I=new u).readPKCS5PrvKeyHex(A);else if(6===f.length)(I=new a).readPKCS5PrvKeyHex(A);else{if(!(f.length>2&&"04"===A.substr(f[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";(I=new o).readPKCS5PrvKeyHex(A)}return I}if("pkcs8prv"===i)return I=l.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===i)return l._getKeyFromPublicPKCS8Hex(e);if("x509pub"===i)return Oe.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return Oe.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var v=pe(e,"PUBLIC KEY");return l._getKeyFromPublicPKCS8Hex(v)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var m=c(e,"RSA PRIVATE KEY");return l.getKey(m,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var N=r(S=c(e,"DSA PRIVATE KEY"),0,[1],"02"),D=r(S,0,[2],"02"),w=r(S,0,[3],"02"),T=r(S,0,[4],"02"),x=r(S,0,[5],"02");return(I=new a).setPrivate(new g(N,16),new g(D,16),new g(w,16),new g(T,16),new g(x,16)),I}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){m=c(e,"EC PRIVATE KEY");return l.getKey(m,null,"pkcs5prv")}if(-1!=e.indexOf("-END PRIVATE KEY-"))return l.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var E=l.getDecryptedKeyHex(e,t),j=new ee;return j.readPKCS5PrvKeyHex(E),j}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var z,I=r(S=l.getDecryptedKeyHex(e,t),0,[1],"04"),b=r(S,0,[2,0],"06"),L=r(S,0,[3,0],"03").substr(2);if(void 0===p.crypto.OID.oidhex2name[b])throw"undefined OID(hex) in KJUR.crypto.OID: "+b;return(z=new o({curve:p.crypto.OID.oidhex2name[b]})).setPublicKeyHex(L),z.setPrivateKeyHex(I),z.isPublic=!1,z}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var S;N=r(S=l.getDecryptedKeyHex(e,t),0,[1],"02"),D=r(S,0,[2],"02"),w=r(S,0,[3],"02"),T=r(S,0,[4],"02"),x=r(S,0,[5],"02");return(I=new a).setPrivate(new g(N,16),new g(D,16),new g(w,16),new g(T,16),new g(x,16)),I}if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return l.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},ze.generateKeypair=function(e,t){if("RSA"==e){var i=t;(o=new ee).generate(i,"10001"),o.isPrivate=!0,o.isPublic=!0;var n=new ee,r=o.n.toString(16),s=o.e.toString(16);return n.setPublic(r,s),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=n,a}if("EC"==e){var o,a,u=t,c=new p.crypto.ECDSA({curve:u}).generateKeyPairHex();return(o=new p.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),o.setPrivateKeyHex(c.ecprvhex),o.isPrivate=!0,o.isPublic=!1,(n=new p.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=n,a}throw"unknown algorithm: "+e},ze.getPEM=function(e,t,i,n,r,s){var o=p,a=o.asn1,u=a.DERObjectIdentifier,c=a.DERInteger,l=a.ASN1Util.newObject,h=a.x509.SubjectPublicKeyInfo,d=o.crypto,M=d.DSA,g=d.ECDSA,A=ee;function y(e){return l({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function v(e){return l({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function m(e){return l({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==A&&e instanceof A||void 0!==M&&e instanceof M||void 0!==g&&e instanceof g)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return de(T=new h(e).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==A&&e instanceof A&&(void 0===i||null==i)&&1==e.isPrivate)return de(T=y(e).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==g&&e instanceof g&&(void 0===i||null==i)&&1==e.isPrivate){var N=new u({name:e.curveName}).getEncodedHex(),D=v(e).getEncodedHex(),w="";return w+=de(N,"EC PARAMETERS"),w+=de(D,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==M&&e instanceof M&&(void 0===i||null==i)&&1==e.isPrivate)return de(T=m(e).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==A&&e instanceof A&&void 0!==i&&null!=i&&1==e.isPrivate){var T=y(e).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",T,i,n,s)}if("PKCS5PRV"==t&&void 0!==g&&e instanceof g&&void 0!==i&&null!=i&&1==e.isPrivate){T=v(e).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",T,i,n,s)}if("PKCS5PRV"==t&&void 0!==M&&e instanceof M&&void 0!==i&&null!=i&&1==e.isPrivate){T=m(e).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",T,i,n,s)}var x=function(e,t){var i=E(e,t);return new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:i.pbkdf2Salt}},{int:i.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:i.encryptionSchemeIV}}]}]}]},{octstr:{hex:i.ciphertext}}]}).getEncodedHex()},E=function(e,t){var i=f.lib.WordArray.random(8),n=f.lib.WordArray.random(8),r=f.PBKDF2(t,i,{keySize:6,iterations:100}),s=f.enc.Hex.parse(e),o=f.TripleDES.encrypt(s,r,{iv:n})+"",a={};return a.ciphertext=o,a.pbkdf2Salt=f.enc.Hex.stringify(i),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=f.enc.Hex.stringify(n),a};if("PKCS8PRV"==t&&null!=A&&e instanceof A&&1==e.isPrivate){var j=y(e).getEncodedHex();T=l({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:j}}]}).getEncodedHex();return void 0===i||null==i?de(T,"PRIVATE KEY"):de(D=x(T,i),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==g&&e instanceof g&&1==e.isPrivate){j=new l({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]}).getEncodedHex(),T=l({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:j}}]}).getEncodedHex();return void 0===i||null==i?de(T,"PRIVATE KEY"):de(D=x(T,i),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==M&&e instanceof M&&1==e.isPrivate){j=new c({bigint:e.x}).getEncodedHex(),T=l({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:j}}]}).getEncodedHex();return void 0===i||null==i?de(T,"PRIVATE KEY"):de(D=x(T,i),"ENCRYPTED PRIVATE KEY")}throw new Error("unsupported object nor format")},ze.getKeyFromCSRPEM=function(e){var t=pe(e,"CERTIFICATE REQUEST");return ze.getKeyFromCSRHex(t)},ze.getKeyFromCSRHex=function(e){var t=ze.parseCSRHex(e);return ze.getKey(t.p8pubkeyhex,null,"pkcs8pub")},ze.parseCSRHex=function(e){var t=Ie,i=t.getChildIdx,n=t.getTLV,r={},s=e;if("30"!=s.substr(0,2))throw"malformed CSR(code:001)";var o=i(s,0);if(o.length<1)throw"malformed CSR(code:002)";if("30"!=s.substr(o[0],2))throw"malformed CSR(code:003)";var a=i(s,o[0]);if(a.length<3)throw"malformed CSR(code:004)";return r.p8pubkeyhex=n(s,a[2]),r},ze.getKeyID=function(e){var t=ze,i=Ie;"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=t.getKey(e));var n=pe(t.getPEM(e)),r=i.getIdxbyList(n,0,[1]),s=i.getV(n,r).substring(2);return p.crypto.Util.hashHex(s,"sha1")},ze.getJWKFromKey=function(e){var t={};if(e instanceof ee&&e.isPrivate)return t.kty="RSA",t.n=se(e.n.toString(16)),t.e=se(e.e.toString(16)),t.d=se(e.d.toString(16)),t.p=se(e.p.toString(16)),t.q=se(e.q.toString(16)),t.dp=se(e.dmp1.toString(16)),t.dq=se(e.dmq1.toString(16)),t.qi=se(e.coeff.toString(16)),t;if(e instanceof ee&&e.isPublic)return t.kty="RSA",t.n=se(e.n.toString(16)),t.e=se(e.e.toString(16)),t;if(e instanceof p.crypto.ECDSA&&e.isPrivate){if("P-256"!==(n=e.getShortNISTPCurveName())&&"P-384"!==n)throw"unsupported curve name for JWT: "+n;var i=e.getPublicKeyXYHex();return t.kty="EC",t.crv=n,t.x=se(i.x),t.y=se(i.y),t.d=se(e.prvKeyHex),t}if(e instanceof p.crypto.ECDSA&&e.isPublic){var n;if("P-256"!==(n=e.getShortNISTPCurveName())&&"P-384"!==n)throw"unsupported curve name for JWT: "+n;i=e.getPublicKeyXYHex();return t.kty="EC",t.crv=n,t.x=se(i.x),t.y=se(i.y),t}throw"not supported key object"},void 0!==p.asn1&&p.asn1||(p.asn1={}),p.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var i=t.substr(1).length;i%2==1?i+=1:t.match(/^[0-7]/)||(i+=2);for(var n="",r=0;r<i;r++)n+="f";t=new g(n,16).xor(e).add(g.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return de(e,t)},this.newObject=function(e){var t=p.asn1,i=t.ASN1Object,n=t.DERBoolean,r=t.DERInteger,s=t.DERBitString,o=t.DEROctetString,a=t.DERNull,u=t.DERObjectIdentifier,c=t.DEREnumerated,l=t.DERUTF8String,h=t.DERNumericString,d=t.DERPrintableString,M=t.DERTeletexString,f=t.DERIA5String,g=t.DERUTCTime,A=t.DERGeneralizedTime,y=t.DERVisibleString,v=t.DERBMPString,m=t.DERSequence,N=t.DERSet,D=t.DERTaggedObject,w=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var T=Object.keys(e);if(1!=T.length)throw new Error("key of param shall be only one.");var x=T[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+x+":"))throw new Error("undefined key: "+x);if("bool"==x)return new n(e[x]);if("int"==x)return new r(e[x]);if("bitstr"==x)return new s(e[x]);if("octstr"==x)return new o(e[x]);if("null"==x)return new a(e[x]);if("oid"==x)return new u(e[x]);if("enum"==x)return new c(e[x]);if("utf8str"==x)return new l(e[x]);if("numstr"==x)return new h(e[x]);if("prnstr"==x)return new d(e[x]);if("telstr"==x)return new M(e[x]);if("ia5str"==x)return new f(e[x]);if("utctime"==x)return new g(e[x]);if("gentime"==x)return new A(e[x]);if("visstr"==x)return new y(e[x]);if("bmpstr"==x)return new v(e[x]);if("asn1"==x)return new i(e[x]);if("seq"==x){for(var E=e[x],j=[],z=0;z<E.length;z++){var I=w(E[z]);j.push(I)}return new m({array:j})}if("set"==x){for(E=e[x],j=[],z=0;z<E.length;z++){I=w(E[z]);j.push(I)}return new N({array:j})}if("tag"==x){var b=e[x];if("[object Array]"===Object.prototype.toString.call(b)&&3==b.length){var L=w(b[2]);return new D({tag:b[0],explicit:b[1],obj:L})}return new D(b)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},p.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",i=parseInt(e.substr(0,2),16),n=(t=Math.floor(i/40)+"."+i%40,""),r=2;r<e.length;r+=2){var s=("00000000"+parseInt(e.substr(r,2),16).toString(2)).slice(-8);if(n+=s.substr(1,7),"0"==s.substr(0,1))t=t+"."+new g(n,2).toString(10),n=""}return t},p.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},i=function(e){var i="",n=new g(e,10).toString(2),r=7-n.length%7;7==r&&(r=0);for(var s="",o=0;o<r;o++)s+="0";n=s+n;for(o=0;o<n.length-1;o+=7){var a=n.substr(o,7);o!=n.length-7&&(a="1"+a),i+=t(parseInt(a,2))}return i};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",r=e.split("."),s=40*parseInt(r[0])+parseInt(r[1]);n+=t(s),r.splice(0,2);for(var o=0;o<r.length;o++)n+=i(r[o]);return n},p.asn1.ASN1Object=function(e){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+"".length+",v="+this.hV);var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var i=t.length/2;if(i>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+i).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},null!=e&&null!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},p.asn1.DERAbstractString=function(e){p.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=ae(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},M.lang.extend(p.asn1.DERAbstractString,p.asn1.ASN1Object),p.asn1.DERAbstractTime=function(e){p.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,i){var n=this.zeroPadding,r=this.localDateToUTC(e),s=String(r.getFullYear());"utc"==t&&(s=s.substr(2,2));var o=s+n(String(r.getMonth()+1),2)+n(String(r.getDate()),2)+n(String(r.getHours()),2)+n(String(r.getMinutes()),2)+n(String(r.getSeconds()),2);if(!0===i){var a=r.getMilliseconds();if(0!=a){var u=n(String(a),3);o=o+"."+(u=u.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=ne(e)},this.setByDateValue=function(e,t,i,n,r,s){var o=new Date(Date.UTC(e,t-1,i,n,r,s,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},M.lang.extend(p.asn1.DERAbstractTime,p.asn1.ASN1Object),p.asn1.DERAbstractStructured=function(e){p.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},M.lang.extend(p.asn1.DERAbstractStructured,p.asn1.ASN1Object),p.asn1.DERBoolean=function(e){p.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},M.lang.extend(p.asn1.DERBoolean,p.asn1.ASN1Object),p.asn1.DERInteger=function(e){p.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=p.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new g(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},M.lang.extend(p.asn1.DERInteger,p.asn1.ASN1Object),p.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=p.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}p.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var i="0"+e;this.hTLV=null,this.isModified=!0,this.hV=i+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var i=0;i<=t;i++)e+="0";var n="";for(i=0;i<e.length-1;i+=8){var r=e.substr(i,8),s=parseInt(r,2).toString(16);1==s.length&&(s="0"+s),n+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",i=0;i<e.length;i++)1==e[i]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),i=0;i<e;i++)t[i]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},M.lang.extend(p.asn1.DERBitString,p.asn1.ASN1Object),p.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=p.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}p.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},M.lang.extend(p.asn1.DEROctetString,p.asn1.DERAbstractString),p.asn1.DERNull=function(){p.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},M.lang.extend(p.asn1.DERNull,p.asn1.ASN1Object),p.asn1.DERObjectIdentifier=function(e){p.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){var t=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},i=function(e){var i="",n=parseInt(e,10).toString(2),r=7-n.length%7;7==r&&(r=0);for(var s="",o=0;o<r;o++)s+="0";for(n=s+n,o=0;o<n.length-1;o+=7){var a=n.substr(o,7);o!=n.length-7&&(a="1"+a),i+=t(parseInt(a,2))}return i};try{if(!e.match(/^[0-9.]+$/))return null;var n="",r=e.split("."),s=40*parseInt(r[0],10)+parseInt(r[1],10);n+=t(s),r.splice(0,2);for(var o=0;o<r.length;o++)n+=i(r[o]);return n}catch(e){return null}}(e);if(null==t)throw new Error("malformed oid string: "+e);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueName=function(e){var t=p.asn1.x509.OID.name2oid(e);if(""===t)throw new Error("DERObjectIdentifier oidName undefined: "+e);this.setValueOidString(t)},this.setValueNameOrOid=function(e){e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){"string"==typeof e?this.setValueNameOrOid(e):void 0!==e.oid?this.setValueNameOrOid(e.oid):void 0!==e.name?this.setValueNameOrOid(e.name):void 0!==e.hex&&this.setValueHex(e.hex)},void 0!==e&&this.setByParam(e)},M.lang.extend(p.asn1.DERObjectIdentifier,p.asn1.ASN1Object),p.asn1.DEREnumerated=function(e){p.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=p.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new g(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},M.lang.extend(p.asn1.DEREnumerated,p.asn1.ASN1Object),p.asn1.DERUTF8String=function(e){p.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},M.lang.extend(p.asn1.DERUTF8String,p.asn1.DERAbstractString),p.asn1.DERNumericString=function(e){p.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},M.lang.extend(p.asn1.DERNumericString,p.asn1.DERAbstractString),p.asn1.DERPrintableString=function(e){p.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},M.lang.extend(p.asn1.DERPrintableString,p.asn1.DERAbstractString),p.asn1.DERTeletexString=function(e){p.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},M.lang.extend(p.asn1.DERTeletexString,p.asn1.DERAbstractString),p.asn1.DERIA5String=function(e){p.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},M.lang.extend(p.asn1.DERIA5String,p.asn1.DERAbstractString),p.asn1.DERVisibleString=function(e){p.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"},M.lang.extend(p.asn1.DERVisibleString,p.asn1.DERAbstractString),p.asn1.DERBMPString=function(e){p.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"},M.lang.extend(p.asn1.DERBMPString,p.asn1.DERAbstractString),p.asn1.DERUTCTime=function(e){p.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=ne(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=ne(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},M.lang.extend(p.asn1.DERUTCTime,p.asn1.DERAbstractTime),p.asn1.DERGeneralizedTime=function(e){p.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=ne(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=ne(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},M.lang.extend(p.asn1.DERGeneralizedTime,p.asn1.DERAbstractTime),p.asn1.DERSequence=function(e){p.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++){e+=this.asn1Array[t].getEncodedHex()}return this.hV=e,this.hV}},M.lang.extend(p.asn1.DERSequence,p.asn1.DERAbstractStructured),p.asn1.DERSet=function(e){p.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var i=this.asn1Array[t];e.push(i.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},M.lang.extend(p.asn1.DERSet,p.asn1.DERAbstractStructured),p.asn1.DERTaggedObject=function(e){p.asn1.DERTaggedObject.superclass.constructor.call(this);var t=p.asn1;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,i){this.hT=t,this.isExplicit=e,this.asn1Object=i,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=i.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){null!=e.tag&&(this.hT=e.tag),null!=e.explicit&&(this.isExplicit=e.explicit),null!=e.tage&&(this.hT=e.tage,this.isExplicit=!0),null!=e.tagi&&(this.hT=e.tagi,this.isExplicit=!1),null!=e.obj&&(e.obj instanceof t.ASN1Object?(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)):"object"==typeof e.obj&&(this.asn1Object=t.ASN1Util.newObject(e.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},null!=e&&this.setByParam(e)},M.lang.extend(p.asn1.DERTaggedObject,p.asn1.ASN1Object);var Ie=new function(){};function be(e,t){for(var i="",n=t/4-e.length,r=0;r<n;r++)i+="0";return i+e}function Le(e,t,i){for(var n="",r=0;n.length<t;)n+=ce(i(le(e+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])))),r+=1;return n}function Se(e){for(var t in p.crypto.Util.DIGESTINFOHEAD){var i=p.crypto.Util.DIGESTINFOHEAD[t],n=i.length;if(e.substring(0,n)==i)return[t,e.substring(n)]}return[]}function Oe(e){var t,i=Ie,n=i.getChildIdx,r=i.getV,s=i.getTLV,o=i.getVbyList,a=i.getVbyListEx,u=i.getTLVbyList,c=i.getTLVbyListEx,l=i.getIdxbyList,h=i.getIdxbyListEx,d=i.getVidx,M=i.getInt,f=i.oidname,g=i.hextooidstr,A=pe;try{t=p.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}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(null===this.hex||0!==this.version)return this.version;var e=u(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=u(e,0,[0]),i=M(t,0);if(i<0||2<i)throw new Error("malformed version field");return this.version=i+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return a(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var e=c(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(e)},this.getAlgorithmIdentifierName=function(e){for(var i in t)if(e===t[i])return i;return f(a(e,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return u(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return u(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var e=o(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getNotAfter=function(){var e=o(this.hex,0,[0,4+this.foffset,1]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getPublicKeyHex=function(){return i.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 e=this.getPublicKeyIdx();return l(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return ze.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=u(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return o(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),i=this.getSignatureValueHex(),n=u(this.hex,0,[0],"30"),r=new p.crypto.Signature({alg:t});return r.init(e),r.updateHex(n),r.verify(i)},this.parseExt=function(e){var t,s,a;if(void 0===e){if(a=this.hex,3!==this.version)return-1;t=l(a,0,[0,7,0],"30"),s=n(a,t)}else{a=pe(e);var u=l(a,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=r(a,u))return void(this.aExtInfo=new Array);t=l(a,0,[0,3,0,1,0],"30"),s=n(a,t),this.hex=a}this.aExtInfo=new Array;for(var c=0;c<s.length;c++){var h={critical:!1},p=0;3===n(a,s[c]).length&&(h.critical=!0,p=1),h.oid=i.hextooidstr(o(a,s[c],[0],"06"));var M=l(a,s[c],[1+p]);h.vidx=d(a,M),this.aExtInfo.push(h)}},this.getExtInfo=function(e){var t=this.aExtInfo,i=e;if(e.match(/^[0-9.]+$/)||(i=p.asn1.x509.OID.name2oid(e)),""!==i)for(var n=0;n<t.length;n++)if(t[n].oid===i)return t[n]},this.getExtBasicConstraints=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("basicConstraints");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var n={extname:"basicConstraints"};if(t&&(n.critical=!0),"3000"===e)return n;if("30030101ff"===e)return n.cA=!0,n;if("30060101ff02"===e.substr(0,12)){var o=r(e,10),a=parseInt(o,16);return n.cA=!0,n.pathLen=a,n}throw new Error("hExtV parse error: "+e)},this.getExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("keyUsage");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var n={extname:"keyUsage"};return t&&(n.critical=!0),n.names=this.getExtKeyUsageString(e).split(","),n},this.getExtKeyUsageBin=function(e){if(void 0===e){var t=this.getExtInfo("keyUsage");if(void 0===t)return"";e=s(this.hex,t.vidx)}if(8!=e.length&&10!=e.length)throw new Error("malformed key usage value: "+e);var i="000000000000000"+parseInt(e.substr(6),16).toString(2);return 8==e.length&&(i=i.slice(-8)),10==e.length&&(i=i.slice(-16)),""==(i=i.replace(/0+$/,""))&&(i="0"),i},this.getExtKeyUsageString=function(e){for(var t=this.getExtKeyUsageBin(e),i=new Array,n=0;n<t.length;n++)"1"==t.substr(n,1)&&i.push(Oe.KEYUSAGE_NAME[n]);return i.join(",")},this.getExtSubjectKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("subjectKeyIdentifier");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var n={extname:"subjectKeyIdentifier"};t&&(n.critical=!0);var o=r(e,0);return n.kid={hex:o},n},this.getExtAuthorityKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("authorityKeyIdentifier");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var o={extname:"authorityKeyIdentifier"};t&&(o.critical=!0);for(var a=n(e,0),u=0;u<a.length;u++){var c=e.substr(a[u],2);if("80"===c&&(o.kid={hex:r(e,a[u])}),"a1"===c){var l=s(e,a[u]),h=this.getGeneralNames(l);o.issuer=h[0].dn}"82"===c&&(o.sn={hex:r(e,a[u])})}return o},this.getExtExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("extKeyUsage");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var o={extname:"extKeyUsage",array:[]};t&&(o.critical=!0);for(var a=n(e,0),u=0;u<a.length;u++)o.array.push(f(r(e,a[u])));return o},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var t=new Array,i=s(this.hex,e.vidx);if(""===i)return t;for(var o=n(i,0),a=0;a<o.length;a++)t.push(f(r(i,o[a])));return t},this.getExtSubjectAltName=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("subjectAltName");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var n={extname:"subjectAltName",array:[]};return t&&(n.critical=!0),n.array=this.getGeneralNames(e),n},this.getExtIssuerAltName=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("issuerAltName");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var n={extname:"issuerAltName",array:[]};return t&&(n.critical=!0),n.array=this.getGeneralNames(e),n},this.getGeneralNames=function(e){for(var t=n(e,0),i=[],r=0;r<t.length;r++){var o=this.getGeneralName(s(e,t[r]));void 0!==o&&i.push(o)}return i},this.getGeneralName=function(e){var t=e.substr(0,2),i=r(e,0),n=ce(i);return"81"==t?{rfc822:n}:"82"==t?{dns:n}:"86"==t?{uri:n}:"87"==t?{ip:Me(i)}:"a4"==t?{dn:this.getX500Name(i)}:void 0},this.getExtSubjectAltName2=function(){var e,t,i,o=this.getExtInfo("subjectAltName");if(void 0===o)return o;for(var a=new Array,u=s(this.hex,o.vidx),c=n(u,0),l=0;l<c.length;l++)i=u.substr(c[l],2),e=r(u,c[l]),"81"===i&&(t=ue(e),a.push(["MAIL",t])),"82"===i&&(t=ue(e),a.push(["DNS",t])),"84"===i&&(t=Oe.hex2dn(e,0),a.push(["DN",t])),"86"===i&&(t=ue(e),a.push(["URI",t])),"87"===i&&(t=Me(e),a.push(["IP",t]));return a},this.getExtCRLDistributionPoints=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("cRLDistributionPoints");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var r={extname:"cRLDistributionPoints",array:[]};t&&(r.critical=!0);for(var o=n(e,0),a=0;a<o.length;a++){var u=s(e,o[a]);r.array.push(this.getDistributionPoint(u))}return r},this.getDistributionPoint=function(e){for(var t={},i=n(e,0),r=0;r<i.length;r++){var o=e.substr(i[r],2),a=s(e,i[r]);"a0"==o&&(t.dpname=this.getDistributionPointName(a))}return t},this.getDistributionPointName=function(e){for(var t={},i=n(e,0),r=0;r<i.length;r++){var o=e.substr(i[r],2),a=s(e,i[r]);"a0"==o&&(t.full=this.getGeneralNames(a))}return t},this.getExtCRLDistributionPointsURI=function(){var e=this.getExtInfo("cRLDistributionPoints");if(void 0===e)return e;for(var t=new Array,i=n(this.hex,e.vidx),r=0;r<i.length;r++)try{var s=ue(o(this.hex,i[r],[0,0,0],"86"));t.push(s)}catch(e){}return t},this.getExtAIAInfo=function(){var e=this.getExtInfo("authorityInfoAccess");if(void 0===e)return e;for(var t={ocsp:[],caissuer:[]},i=n(this.hex,e.vidx),r=0;r<i.length;r++){var s=o(this.hex,i[r],[0],"06"),a=o(this.hex,i[r],[1],"86");"2b06010505073001"===s&&t.ocsp.push(ue(a)),"2b06010505073002"===s&&t.caissuer.push(ue(a))}return t},this.getExtAuthorityInfoAccess=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("authorityInfoAccess");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var r={extname:"authorityInfoAccess",array:[]};t&&(r.critical=!0);for(var u=n(e,0),c=0;c<u.length;c++){var l=a(e,u[c],[0],"06"),h=ue(o(e,u[c],[1],"86"));if("2b06010505073001"==l)r.array.push({ocsp:h});else{if("2b06010505073002"!=l)throw new Error("unknown method: "+l);r.array.push({caissuer:h})}}return r},this.getExtCertificatePolicies=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("certificatePolicies");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var r={extname:"certificatePolicies",array:[]};t&&(r.critical=!0);for(var o=n(e,0),a=0;a<o.length;a++){var u=s(e,o[a]),c=this.getPolicyInformation(u);r.array.push(c)}return r},this.getPolicyInformation=function(e){var t={},i=o(e,0,[0],"06");t.policyoid=f(i);var r=h(e,0,[1],"30");if(-1!=r){t.array=[];for(var a=n(e,r),u=0;u<a.length;u++){var c=s(e,a[u]),l=this.getPolicyQualifierInfo(c);t.array.push(l)}}return t},this.getPolicyQualifierInfo=function(e){var t={},i=o(e,0,[0],"06");if("2b06010505070201"===i){var n=a(e,0,[1],"16");t.cps=ce(n)}else if("2b06010505070202"===i){var r=u(e,0,[1],"30");t.unotice=this.getUserNotice(r)}return t},this.getUserNotice=function(e){for(var t={},i=n(e,0),r=0;r<i.length;r++){var o=s(e,i[r]);"30"!=o.substr(0,2)&&(t.exptext=this.getDisplayText(o))}return t},this.getDisplayText=function(e){var t={};return t.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[e.substr(0,2)],t.str=ce(r(e,0)),t},this.getExtCRLNumber=function(e,t){var i={extname:"cRLNumber"};if(t&&(i.critical=!0),"02"==e.substr(0,2))return i.num={hex:r(e,0)},i;throw new Error("hExtV parse error: "+e)},this.getExtCRLReason=function(e,t){var i={extname:"cRLReason"};if(t&&(i.critical=!0),"0a"==e.substr(0,2))return i.code=parseInt(r(e,0),16),i;throw new Error("hExtV parse error: "+e)},this.getExtOcspNonce=function(e,t){var i={extname:"ocspNonce"};t&&(i.critical=!0);var n=r(e,0);return i.hex=n,i},this.getExtOcspNoCheck=function(e,t){var i={extname:"ocspNoCheck"};return t&&(i.critical=!0),i},this.getExtAdobeTimeStamp=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("adobeTimeStamp");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var r={extname:"adobeTimeStamp"};t&&(r.critical=!0);var o=n(e,0);if(o.length>1){var a=s(e,o[1]),u=this.getGeneralName(a);null!=u.uri&&(r.uri=u.uri)}if(o.length>2){var c=s(e,o[2]);"0101ff"==c&&(r.reqauth=!0),"010100"==c&&(r.reqauth=!1)}return r},this.getX500NameRule=function(e){for(var t=null,i=[],n=0;n<e.length;n++)for(var r=e[n],s=0;s<r.length;s++)i.push(r[s]);for(n=0;n<i.length;n++){var o=i[n],a=o.ds,u=o.value,c=o.type;if("prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=c)return"mixed";if(p.lang.String.isMail(u))continue;return"mixed"}if("C"==c){if("prn"==a)continue;return"mixed"}if(null==t)t=a;else if(t!==a)return"mixed"}return null==t?"prn":t},this.getX500Name=function(e){var t=this.getX500NameArray(e);return{array:t,str:this.dnarraytostr(t)}},this.getX500NameArray=function(e){for(var t=[],i=n(e,0),r=0;r<i.length;r++)t.push(this.getRDN(s(e,i[r])));return t},this.getRDN=function(e){for(var t=[],i=n(e,0),r=0;r<i.length;r++)t.push(this.getAttrTypeAndValue(s(e,i[r])));return t},this.getAttrTypeAndValue=function(e){var t={type:null,value:null,ds:null},i=n(e,0),r=o(e,i[0],[],"06"),s=o(e,i[1],[]),a=p.asn1.ASN1Util.oidHexToInt(r);return t.type=p.asn1.x509.OID.oid2atype(a),t.ds=this.HEX2STAG[e.substr(i[1],2)],"bmp"!=t.ds?t.value=ue(s):t.value=fe(s),t},this.readCertPEM=function(e){this.readCertHex(A(e))},this.readCertHex=function(e){this.hex=e,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(e){}},this.getParam=function(){var e={};return e.version=this.getVersion(),e.serial={hex:this.getSerialNumberHex()},e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(),e.notbefore=this.getNotBefore(),e.notafter=this.getNotAfter(),e.subject=this.getSubject(),e.sbjpubkey=de(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),e},this.getExtParamArray=function(e){null==e&&(-1!=h(this.hex,0,[0,"[3]"])&&(e=c(this.hex,0,[0,"[3]",0],"30")));for(var t=[],i=n(e,0),r=0;r<i.length;r++){var o=s(e,i[r]),a=this.getExtParam(o);null!=a&&t.push(a)}return t},this.getExtParam=function(e){var t=n(e,0).length;if(2!=t&&3!=t)throw new Error("wrong number elements in Extension: "+t+" "+e);var i=g(o(e,0,[0],"06")),r=!1;3==t&&"0101ff"==u(e,0,[1])&&(r=!0);var s=u(e,0,[t-1,0]),a=void 0;if("2.5.29.14"==i?a=this.getExtSubjectKeyIdentifier(s,r):"2.5.29.15"==i?a=this.getExtKeyUsage(s,r):"2.5.29.17"==i?a=this.getExtSubjectAltName(s,r):"2.5.29.18"==i?a=this.getExtIssuerAltName(s,r):"2.5.29.19"==i?a=this.getExtBasicConstraints(s,r):"2.5.29.31"==i?a=this.getExtCRLDistributionPoints(s,r):"2.5.29.32"==i?a=this.getExtCertificatePolicies(s,r):"2.5.29.35"==i?a=this.getExtAuthorityKeyIdentifier(s,r):"2.5.29.37"==i?a=this.getExtExtKeyUsage(s,r):"1.3.6.1.5.5.7.1.1"==i?a=this.getExtAuthorityInfoAccess(s,r):"2.5.29.20"==i?a=this.getExtCRLNumber(s,r):"2.5.29.21"==i?a=this.getExtCRLReason(s,r):"1.3.6.1.5.5.7.48.1.2"==i?a=this.getExtOcspNonce(s,r):"1.3.6.1.5.5.7.48.1.5"==i?a=this.getExtOcspNoCheck(s,r):"1.2.840.113583.1.1.9.1"==i&&(a=this.getExtAdobeTimeStamp(s,r)),null!=a)return a;var c={extname:i,extn:s};return r&&(c.critical=!0),c},this.findExt=function(e,t){for(var i=0;i<e.length;i++)if(e[i].extname==t)return e[i];return null},this.updateExtCDPFullURI=function(e,t){var i=this.findExt(e,"cRLDistributionPoints");if(null!=i&&null!=i.array)for(var n=i.array,r=0;r<n.length;r++)if(null!=n[r].dpname&&null!=n[r].dpname.full)for(var s=n[r].dpname.full,o=0;o<s.length;o++){var a=s[r];null!=a.uri&&(a.uri=t)}},this.updateExtAIAOCSP=function(e,t){var i=this.findExt(e,"authorityInfoAccess");if(null!=i&&null!=i.array)for(var n=i.array,r=0;r<n.length;r++)null!=n[r].ocsp&&(n[r].ocsp=t)},this.updateExtAIACAIssuer=function(e,t){var i=this.findExt(e,"authorityInfoAccess");if(null!=i&&null!=i.array)for(var n=i.array,r=0;r<n.length;r++)null!=n[r].caissuer&&(n[r].caissuer=t)},this.dnarraytostr=function(e){return"/"+e.map((function(e){return function(e){return e.map((function(e){return function(e){return e.type+"="+e.value}(e).replace(/\+/,"\\+")})).join("+")}(e).replace(/\//,"\\/")})).join("/")},this.getInfo=function(){var e,t,i,n,r=function(e){for(var t="",i=e.array,n=0;n<i.length;n++){var r=i[n];if(t+=" policy oid: "+r.policyoid+"\n",void 0!==r.array)for(var s=0;s<r.array.length;s++){var o=r.array[s];void 0!==o.cps&&(t+=" cps: "+o.cps+"\n")}}return t},s=function(e){for(var t="",i=e.array,n=0;n<i.length;n++){var r=i[n];try{void 0!==r.dpname.full[0].uri&&(t+=" "+r.dpname.full[0].uri+"\n")}catch(e){}try{void 0!==r.dname.full[0].dn.hex&&(t+=" "+Oe.hex2dn(r.dpname.full[0].dn.hex)+"\n")}catch(e){}}return t},o=function(e){for(var t="",i=e.array,n=0;n<i.length;n++){var r=i[n];void 0!==r.caissuer&&(t+=" caissuer: "+r.caissuer+"\n"),void 0!==r.ocsp&&(t+=" ocsp: "+r.ocsp+"\n")}return t};if(e="Basic Fields\n",e+=" serial number: "+this.getSerialNumberHex()+"\n",e+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",e+=" issuer: "+this.getIssuerString()+"\n",e+=" notBefore: "+this.getNotBefore()+"\n",e+=" notAfter: "+this.getNotAfter()+"\n",e+=" subject: "+this.getSubjectString()+"\n",e+=" subject public key info: \n",e+=" key algorithm: "+(t=this.getPublicKey()).type+"\n","RSA"===t.type&&(e+=" n="+Ae(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+Ae(t.e.toString(16))+"\n"),null!=(i=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var a=0;a<i.length;a++){var u=i[a],c=p.asn1.x509.OID.oid2name(u.oid);""===c&&(c=u.oid);var l="";if(!0===u.critical&&(l="CRITICAL"),e+=" "+c+" "+l+":\n","basicConstraints"===c){var h=this.getExtBasicConstraints();void 0===h.cA?e+=" {}\n":(e+=" cA=true",void 0!==h.pathLen&&(e+=", pathLen="+h.pathLen),e+="\n")}else if("keyUsage"===c)e+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===c)e+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===c){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(e+=" kid="+d.kid.hex+"\n")}else{if("extKeyUsage"===c)e+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"===c)e+=" "+(n=this.getExtSubjectAltName(),JSON.stringify(n.array).replace(/[\[\]\{\}\"]/g,""))+"\n";else if("cRLDistributionPoints"===c)e+=s(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"===c)e+=o(this.getExtAuthorityInfoAccess());else"certificatePolicies"===c&&(e+=r(this.getExtCertificatePolicies()))}}}return e+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n",e+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?this.readCertPEM(e):p.lang.String.isHex(e)&&this.readCertHex(e))}function Ce(e){return f.SHA256(e).toString()}Ie.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var i=parseInt(e.substr(t+3,1));return 0==i?-1:0<i&&i<10?i+1:-2},Ie.getL=function(e,t){var i=Ie.getLblen(e,t);return i<1?"":e.substr(t+2,2*i)},Ie.getVblen=function(e,t){var i;return""==(i=Ie.getL(e,t))?-1:("8"===i.substr(0,1)?new g(i.substr(2),16):new g(i,16)).intValue()},Ie.getVidx=function(e,t){var i=Ie.getLblen(e,t);return i<0?i:t+2*(i+1)},Ie.getV=function(e,t){var i=Ie.getVidx(e,t),n=Ie.getVblen(e,t);return e.substr(i,2*n)},Ie.getTLV=function(e,t){return e.substr(t,2)+Ie.getL(e,t)+Ie.getV(e,t)},Ie.getTLVblen=function(e,t){return 2+2*Ie.getLblen(e,t)+2*Ie.getVblen(e,t)},Ie.getNextSiblingIdx=function(e,t){return Ie.getVidx(e,t)+2*Ie.getVblen(e,t)},Ie.getChildIdx=function(e,t){var i,n,r,s=Ie,o=[];i=s.getVidx(e,t),n=2*s.getVblen(e,t),"03"==e.substr(t,2)&&(i+=2,n-=2),r=0;for(var a=i;r<=n;){var u=s.getTLVblen(e,a);if((r+=u)<=n&&o.push(a),a+=u,r>=n)break}return o},Ie.getNthChildIdx=function(e,t,i){return Ie.getChildIdx(e,t)[i]},Ie.getIdxbyList=function(e,t,i,n){var r,s,o=Ie;return 0==i.length?void 0!==n&&e.substr(t,2)!==n?-1:t:(r=i.shift())>=(s=o.getChildIdx(e,t)).length?-1:o.getIdxbyList(e,s[r],i,n)},Ie.getIdxbyListEx=function(e,t,i,n){var r,s,o=Ie;if(0==i.length)return void 0!==n&&e.substr(t,2)!==n?-1:t;r=i.shift(),s=o.getChildIdx(e,t);for(var a=0,u=0;u<s.length;u++){var c=e.substr(s[u],2);if("number"==typeof r&&!o.isContextTag(c)&&a==r||"string"==typeof r&&o.isContextTag(c,r))return o.getIdxbyListEx(e,s[u],i,n);o.isContextTag(c)||a++}return-1},Ie.getTLVbyList=function(e,t,i,n){var r=Ie,s=r.getIdxbyList(e,t,i,n);return-1==s||s>=e.length?null:r.getTLV(e,s)},Ie.getTLVbyListEx=function(e,t,i,n){var r=Ie,s=r.getIdxbyListEx(e,t,i,n);return-1==s?null:r.getTLV(e,s)},Ie.getVbyList=function(e,t,i,n,r){var s,o,a=Ie;return-1==(s=a.getIdxbyList(e,t,i,n))||s>=e.length?null:(o=a.getV(e,s),!0===r&&(o=o.substr(2)),o)},Ie.getVbyListEx=function(e,t,i,n,r){var s,o,a=Ie;return-1==(s=a.getIdxbyListEx(e,t,i,n))?null:(o=a.getV(e,s),"03"==e.substr(s,2)&&!1!==r&&(o=o.substr(2)),o)},Ie.getInt=function(e,t,i){null==i&&(i=-1);try{var n=e.substr(t,2);if("02"!=n&&"03"!=n)return i;var r=Ie.getV(e,t);return"02"==n?parseInt(r,16):function(e){try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var i=parseInt(t,16),n=e.substr(2),r=parseInt(n,16).toString(2);return"0"==r&&(r="00000000"),r=r.slice(0,0-i),parseInt(r,2)}catch(e){return-1}}(r)}catch(e){return i}},Ie.getOID=function(e,t,i){null==i&&(i=null);try{return"06"!=e.substr(t,2)?i:function(e){if(!ge(e))return null;try{var t=[],i=e.substr(0,2),n=parseInt(i,16);t[0]=new String(Math.floor(n/40)),t[1]=new String(n%40);for(var r=e.substr(2),s=[],o=0;o<r.length/2;o++)s.push(parseInt(r.substr(2*o,2),16));var a=[],u="";for(o=0;o<s.length;o++)128&s[o]?u+=ye((127&s[o]).toString(2),7):(u+=ye((127&s[o]).toString(2),7),a.push(new String(parseInt(u,2))),u="");var c=t.join(".");return a.length>0&&(c=c+"."+a.join(".")),c}catch(e){return null}}(Ie.getV(e,t))}catch(e){return i}},Ie.getOIDName=function(e,t,i){null==i&&(i=null);try{var n=Ie.getOID(e,t,i);if(n==i)return i;var r=p.asn1.x509.OID.oid2name(n);return""==r?n:r}catch(e){return i}},Ie.getString=function(e,t,i){null==i&&(i=null);try{return ce(Ie.getV(e,t))}catch(e){return i}},Ie.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},i=[],n=e.substr(0,2),r=parseInt(n,16);i[0]=new String(Math.floor(r/40)),i[1]=new String(r%40);for(var s=e.substr(2),o=[],a=0;a<s.length/2;a++)o.push(parseInt(s.substr(2*a,2),16));var u=[],c="";for(a=0;a<o.length;a++)128&o[a]?c+=t((127&o[a]).toString(2),7):(c+=t((127&o[a]).toString(2),7),u.push(new String(parseInt(c,2))),c="");var l=i.join(".");return u.length>0&&(l=l+"."+u.join(".")),l},Ie.dump=function(e,t,i,n){var r=Ie,s=r.getV,o=r.dump,a=r.getChildIdx,u=e;e instanceof p.asn1.ASN1Object&&(u=e.getEncodedHex());var c=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===i&&(i=0),void 0===n&&(n="");var l,h=t.ommit_long_octet;if("01"==(l=u.substr(i,2)))return"00"==(d=s(u,i))?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n";if("02"==l)return n+"INTEGER "+c(d=s(u,i),h)+"\n";if("03"==l){var d=s(u,i);if(r.isASN1HEX(d.substr(2))){var M=n+"BITSTRING, encapsulates\n";return M+=o(d.substr(2),t,0,n+" ")}return n+"BITSTRING "+c(d,h)+"\n"}if("04"==l){d=s(u,i);if(r.isASN1HEX(d)){M=n+"OCTETSTRING, encapsulates\n";return M+=o(d,t,0,n+" ")}return n+"OCTETSTRING "+c(d,h)+"\n"}if("05"==l)return n+"NULL\n";if("06"==l){var f=s(u,i),g=p.asn1.ASN1Util.oidHexToInt(f),A=p.asn1.x509.OID.oid2name(g),y=g.replace(/\./g," ");return""!=A?n+"ObjectIdentifier "+A+" ("+y+")\n":n+"ObjectIdentifier ("+y+")\n"}if("0a"==l)return n+"ENUMERATED "+parseInt(s(u,i))+"\n";if("0c"==l)return n+"UTF8String '"+ue(s(u,i))+"'\n";if("13"==l)return n+"PrintableString '"+ue(s(u,i))+"'\n";if("14"==l)return n+"TeletexString '"+ue(s(u,i))+"'\n";if("16"==l)return n+"IA5String '"+ue(s(u,i))+"'\n";if("17"==l)return n+"UTCTime "+ue(s(u,i))+"\n";if("18"==l)return n+"GeneralizedTime "+ue(s(u,i))+"\n";if("1a"==l)return n+"VisualString '"+ue(s(u,i))+"'\n";if("1e"==l)return n+"BMPString '"+fe(s(u,i))+"'\n";if("30"==l){if("3000"==u.substr(i,4))return n+"SEQUENCE {}\n";M=n+"SEQUENCE\n";var v=t;if((2==(D=a(u,i)).length||3==D.length)&&"06"==u.substr(D[0],2)&&"04"==u.substr(D[D.length-1],2)){A=r.oidname(s(u,D[0]));var m=JSON.parse(JSON.stringify(t));m.x509ExtName=A,v=m}for(var N=0;N<D.length;N++)M+=o(u,v,D[N],n+" ");return M}if("31"==l){M=n+"SET\n";var D=a(u,i);for(N=0;N<D.length;N++)M+=o(u,t,D[N],n+" ");return M}if(0!=(128&(l=parseInt(l,16)))){var w=31&l;if(0!=(32&l)){for(M=n+"["+w+"]\n",D=a(u,i),N=0;N<D.length;N++)M+=o(u,t,D[N],n+" ");return M}d=s(u,i);if(Ie.isASN1HEX(d)){var M=n+"["+w+"]\n";return M+=o(d,t,0,n+" ")}return("68747470"==d.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==w)&&(d=ue(d)),M=n+"["+w+"] "+d+"\n"}return n+"UNKNOWN("+l+") "+s(u,i)+"\n"},Ie.isContextTag=function(e,t){var i,n;e=e.toLowerCase();try{i=parseInt(e,16)}catch(e){return-1}if(void 0===t)return 128==(192&i);try{return null!=t.match(/^\[[0-9]+\]$/)&&(!((n=parseInt(t.substr(1,t.length-1),10))>31)&&(128==(192&i)&&(31&i)==n))}catch(e){return!1}},Ie.isASN1HEX=function(e){var t=Ie;if(e.length%2==1)return!1;var i=t.getVblen(e,0),n=e.substr(0,2),r=t.getL(e,0);return e.length-n.length-r.length==2*i},Ie.checkStrictDER=function(e,t,i,n,r){var s=Ie;if(void 0===i){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!p.lang.String.isHex(e))throw new Error("not hex string");i=e.length,r=(n=e.length/2)<128?1:Math.ceil(n.toString(16))+1}if(s.getL(e,t).length>2*r)throw new Error("L of TLV too long: idx="+t);var o=s.getVblen(e,t);if(o>n)throw new Error("value of L too long than hex: idx="+t);var a=s.getTLV(e,t),u=a.length-2-s.getL(e,t).length;if(u!==2*o)throw new Error("V string length and L's value not the same:"+u+"/"+2*o);if(0===t&&e.length!=a.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+a.length);var c=e.substr(t,2);if("02"===c){var l=s.getVidx(e,t);if("00"==e.substr(l,2)&&e.charCodeAt(l+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(c,16)){for(var h=s.getVblen(e,t),d=0,M=s.getChildIdx(e,t),f=0;f<M.length;f++){d+=s.getTLV(e,M[f]).length,s.checkStrictDER(e,M[f],i,n,r)}if(2*h!=d)throw new Error("sum of children's TLV length and L unmatch: "+2*h+"!="+d)}},Ie.oidname=function(e){var t=p.asn1;p.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var i=t.x509.OID.oid2name(e);return""===i&&(i=e),i},void 0!==p.asn1&&p.asn1||(p.asn1={}),void 0!==p.asn1.x509&&p.asn1.x509||(p.asn1.x509={}),p.asn1.x509.Certificate=function(e){p.asn1.x509.Certificate.superclass.constructor.call(this);var t=p.asn1,i=t.DERBitString,n=t.DERSequence,r=t.x509,s=r.TBSCertificate,o=r.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(e){this.params=e},this.sign=function(){var e=this.params,t=e.sigalg;null!=e.sigalg.name&&(t=e.sigalg.name);var i=e.tbsobj.getEncodedHex(),n=new p.crypto.Signature({alg:t});n.init(e.cakey),n.updateHex(i),e.sighex=n.sign()},this.getPEM=function(){return de(this.getEncodedHex(),"CERTIFICATE")},this.getEncodedHex=function(){var e=this.params;if(null!=e.tbsobj&&null!=e.tbsobj||(e.tbsobj=new s(e)),null==e.sighex&&null!=e.cakey&&this.sign(),null==e.sighex)throw new Error("sighex or cakey parameter not defined");var t=[];return t.push(e.tbsobj),t.push(new o({name:e.sigalg})),t.push(new i({hex:"00"+e.sighex})),new n({array:t}).getEncodedHex()},null!=e&&(this.params=e)},ve(p.asn1.x509.Certificate,p.asn1.ASN1Object),p.asn1.x509.TBSCertificate=function(e){p.asn1.x509.TBSCertificate.superclass.constructor.call(this);var t=p.asn1,i=t.x509,n=t.DERTaggedObject,r=t.DERInteger,s=t.DERSequence,o=i.AlgorithmIdentifier,a=i.Time,u=i.X500Name,c=i.Extensions,l=i.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(e){this.params=e},this.getEncodedHex=function(){var e=[],t=this.params;if(null!=t.version||1!=t.version){var i=2;null!=t.version&&(i=t.version-1);var h=new n({obj:new r({int:i})});e.push(h)}return e.push(new r(t.serial)),e.push(new o({name:t.sigalg})),e.push(new u(t.issuer)),e.push(new s({array:[new a(t.notbefore),new a(t.notafter)]})),e.push(new u(t.subject)),e.push(new l(ze.getKey(t.sbjpubkey))),void 0!==t.ext&&t.ext.length>0&&e.push(new n({tag:"a3",obj:new c(t.ext)})),new p.asn1.DERSequence({array:e}).getEncodedHex()},void 0!==e&&this.setByParam(e)},ve(p.asn1.x509.TBSCertificate,p.asn1.ASN1Object),p.asn1.x509.Extensions=function(e){p.asn1.x509.Extensions.superclass.constructor.call(this);var t=p.asn1,i=t.DERSequence,n=t.x509;this.aParam=[],this.setByParam=function(e){this.aParam=e},this.getEncodedHex=function(){for(var e=[],t=0;t<this.aParam.length;t++){var r=this.aParam[t],s=r.extname,o=null;if(null!=r.extn)o=new n.PrivateExtension(r);else if("subjectKeyIdentifier"==s)o=new n.SubjectKeyIdentifier(r);else if("keyUsage"==s)o=new n.KeyUsage(r);else if("subjectAltName"==s)o=new n.SubjectAltName(r);else if("issuerAltName"==s)o=new n.IssuerAltName(r);else if("basicConstraints"==s)o=new n.BasicConstraints(r);else if("cRLDistributionPoints"==s)o=new n.CRLDistributionPoints(r);else if("certificatePolicies"==s)o=new n.CertificatePolicies(r);else if("authorityKeyIdentifier"==s)o=new n.AuthorityKeyIdentifier(r);else if("extKeyUsage"==s)o=new n.ExtKeyUsage(r);else if("authorityInfoAccess"==s)o=new n.AuthorityInfoAccess(r);else if("cRLNumber"==s)o=new n.CRLNumber(r);else if("cRLReason"==s)o=new n.CRLReason(r);else if("ocspNonce"==s)o=new n.OCSPNonce(r);else if("ocspNoCheck"==s)o=new n.OCSPNoCheck(r);else if("adobeTimeStamp"==s)o=new n.AdobeTimeStamp(r);else{if("subjectDirectoryAttributes"!=s)throw new Error("extension not supported:"+JSON.stringify(r));o=new n.SubjectDirectoryAttributes(r)}null!=o&&e.push(o)}return new i({array:e}).getEncodedHex()},null!=e&&this.setByParam(e)},ve(p.asn1.x509.Extensions,p.asn1.ASN1Object),p.asn1.x509.Extension=function(e){p.asn1.x509.Extension.superclass.constructor.call(this);var t=p.asn1,i=t.DERObjectIdentifier,n=t.DEROctetString;t.DERBitString;var r=t.DERBoolean,s=t.DERSequence;this.getEncodedHex=function(){var e=new i({oid:this.oid}),t=new n({hex:this.getExtnValueHex()}),o=new Array;return o.push(e),this.critical&&o.push(new r),o.push(t),new s({array:o}).getEncodedHex()},this.critical=!1,void 0!==e&&void 0!==e.critical&&(this.critical=e.critical)},ve(p.asn1.x509.Extension,p.asn1.ASN1Object),p.asn1.x509.KeyUsage=function(e){p.asn1.x509.KeyUsage.superclass.constructor.call(this,e);var t=Oe.KEYUSAGE_NAME;if(this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.15",void 0!==e&&(void 0!==e.bin&&(this.asn1ExtnValue=new p.asn1.DERBitString(e)),void 0!==e.names&&void 0!==e.names.length)){for(var i=e.names,n="000000000",r=0;r<i.length;r++)for(var s=0;s<t.length;s++)i[r]===t[s]&&(n=n.substring(0,s)+"1"+n.substring(s+1,n.length));this.asn1ExtnValue=new p.asn1.DERBitString({bin:n})}},ve(p.asn1.x509.KeyUsage,p.asn1.x509.Extension),p.asn1.x509.BasicConstraints=function(e){p.asn1.x509.BasicConstraints.superclass.constructor.call(this,e);var t=p.asn1,i=t.DERBoolean,n=t.DERInteger,r=t.DERSequence;this.getExtnValueHex=function(){var e=new Array;this.cA&&e.push(new i),this.pathLen>-1&&e.push(new n({int:this.pathLen}));var t=new r({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==e&&(void 0!==e.cA&&(this.cA=e.cA),void 0!==e.pathLen&&(this.pathLen=e.pathLen))},ve(p.asn1.x509.BasicConstraints,p.asn1.x509.Extension),p.asn1.x509.CRLDistributionPoints=function(e){p.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=p.asn1,i=t.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.setByDPArray=function(e){for(var n=[],r=0;r<e.length;r++)if(e[r]instanceof p.asn1.ASN1Object)n.push(e[r]);else{var s=new i.DistributionPoint(e[r]);n.push(s)}this.asn1ExtnValue=new t.DERSequence({array:n})},this.setByOneURI=function(e){var t=new i.DistributionPoint({fulluri:e});this.setByDPArray([t])},this.oid="2.5.29.31",void 0!==e&&(void 0!==e.array?this.setByDPArray(e.array):void 0!==e.uri&&this.setByOneURI(e.uri))},ve(p.asn1.x509.CRLDistributionPoints,p.asn1.x509.Extension),p.asn1.x509.DistributionPoint=function(e){p.asn1.x509.DistributionPoint.superclass.constructor.call(this);var t=p.asn1,i=t.x509.DistributionPointName;this.getEncodedHex=function(){var e=new t.DERSequence;if(null!=this.asn1DP){var i=new t.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});e.appendASN1Object(i)}return this.hTLV=e.getEncodedHex(),this.hTLV},void 0!==e&&(void 0!==e.dpobj?this.asn1DP=e.dpobj:void 0!==e.dpname?this.asn1DP=new i(e.dpname):void 0!==e.fulluri&&(this.asn1DP=new i({full:[{uri:e.fulluri}]})))},ve(p.asn1.x509.DistributionPoint,p.asn1.ASN1Object),p.asn1.x509.DistributionPointName=function(e){p.asn1.x509.DistributionPointName.superclass.constructor.call(this);var t=p.asn1,i=t.DERTaggedObject;if(this.getEncodedHex=function(){if("full"!=this.type)throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new i({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.getEncodedHex(),this.hTLV},void 0!==e)if(t.x509.GeneralNames.prototype.isPrototypeOf(e))this.type="full",this.tag="a0",this.asn1V=e;else{if(void 0===e.full)throw new Error("This class supports GeneralNames only as argument");this.type="full",this.tag="a0",this.asn1V=new t.x509.GeneralNames(e.full)}},ve(p.asn1.x509.DistributionPointName,p.asn1.ASN1Object),p.asn1.x509.CertificatePolicies=function(e){p.asn1.x509.CertificatePolicies.superclass.constructor.call(this,e);var t=p.asn1,i=t.x509,n=t.DERSequence,r=i.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var e=[],t=0;t<this.params.array.length;t++)e.push(new r(this.params.array[t]));var i=new n({array:e});return this.asn1ExtnValue=i,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.32",void 0!==e&&(this.params=e)},ve(p.asn1.x509.CertificatePolicies,p.asn1.x509.Extension),p.asn1.x509.PolicyInformation=function(e){p.asn1.x509.PolicyInformation.superclass.constructor.call(this,e);var t=p.asn1,i=t.DERSequence,n=t.DERObjectIdentifier,r=t.x509.PolicyQualifierInfo;this.params=null,this.getEncodedHex=function(){if(void 0===this.params.policyoid&&void 0===this.params.array)throw new Error("parameter oid and array missing");var e=[new n(this.params.policyoid)];if(void 0!==this.params.array){for(var t=[],s=0;s<this.params.array.length;s++)t.push(new r(this.params.array[s]));t.length>0&&e.push(new i({array:t}))}return new i({array:e}).getEncodedHex()},void 0!==e&&(this.params=e)},ve(p.asn1.x509.PolicyInformation,p.asn1.ASN1Object),p.asn1.x509.PolicyQualifierInfo=function(e){p.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=p.asn1,i=t.DERSequence,n=t.DERIA5String,r=t.DERObjectIdentifier,s=t.x509.UserNotice;this.params=null,this.getEncodedHex=function(){return void 0!==this.params.cps?new i({array:[new r({oid:"1.3.6.1.5.5.7.2.1"}),new n({str:this.params.cps})]}).getEncodedHex():null!=this.params.unotice?new i({array:[new r({oid:"1.3.6.1.5.5.7.2.2"}),new s(this.params.unotice)]}).getEncodedHex():void 0},void 0!==e&&(this.params=e)},ve(p.asn1.x509.PolicyQualifierInfo,p.asn1.ASN1Object),p.asn1.x509.UserNotice=function(e){p.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=p.asn1.DERSequence;p.asn1.DERInteger;var i=p.asn1.x509.DisplayText,n=p.asn1.x509.NoticeReference;this.params=null,this.getEncodedHex=function(){var e=[];return void 0!==this.params.noticeref&&e.push(new n(this.params.noticeref)),void 0!==this.params.exptext&&e.push(new i(this.params.exptext)),new t({array:e}).getEncodedHex()},void 0!==e&&(this.params=e)},ve(p.asn1.x509.UserNotice,p.asn1.ASN1Object),p.asn1.x509.NoticeReference=function(e){p.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=p.asn1.DERSequence,i=p.asn1.DERInteger,n=p.asn1.x509.DisplayText;this.params=null,this.getEncodedHex=function(){var e=[];if(void 0!==this.params.org&&e.push(new n(this.params.org)),void 0!==this.params.noticenum){for(var r=[],s=this.params.noticenum,o=0;o<s.length;o++)r.push(new i(s[o]));e.push(new t({array:r}))}if(0==e.length)throw new Error("parameter is empty");return new t({array:e}).getEncodedHex()},void 0!==e&&(this.params=e)},ve(p.asn1.x509.NoticeReference,p.asn1.ASN1Object),p.asn1.x509.DisplayText=function(e){p.asn1.x509.DisplayText.superclass.constructor.call(this,e),this.hT="0c",void 0!==e&&("ia5"===e.type?this.hT="16":"vis"===e.type?this.hT="1a":"bmp"===e.type&&(this.hT="1e"))},ve(p.asn1.x509.DisplayText,p.asn1.DERAbstractString),p.asn1.x509.ExtKeyUsage=function(e){p.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,e);var t=p.asn1;this.setPurposeArray=function(e){this.asn1ExtnValue=new t.DERSequence;for(var i=0;i<e.length;i++){var n=new t.DERObjectIdentifier(e[i]);this.asn1ExtnValue.appendASN1Object(n)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.37",void 0!==e&&void 0!==e.array&&this.setPurposeArray(e.array)},ve(p.asn1.x509.ExtKeyUsage,p.asn1.x509.Extension),p.asn1.x509.AuthorityKeyIdentifier=function(e){p.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,e);var t=p,i=t.asn1,n=i.DERTaggedObject,r=i.x509.GeneralNames;t.crypto.Util.isKey,this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var e=new Array;this.asn1KID&&e.push(new n({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&e.push(new n({explicit:!1,tag:"a1",obj:new r([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&e.push(new n({explicit:!1,tag:"82",obj:this.asn1CertSN}));var t=new i.DERSequence({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.getEncodedHex()},this.setKIDByParam=function(e){if(void 0!==e.str||void 0!==e.hex)this.asn1KID=new p.asn1.DEROctetString(e);else if("object"==typeof e&&p.crypto.Util.isKey(e)||"string"==typeof e&&-1!=e.indexOf("BEGIN ")){var t=e;"string"==typeof e&&(t=ze.getKey(e));var i=ze.getKeyID(t);this.asn1KID=new p.asn1.DEROctetString({hex:i})}},this.setCertIssuerByParam=function(e){void 0!==e.str||void 0!==e.ldapstr||void 0!==e.hex||void 0!==e.certsubject||void 0!==e.certissuer?this.asn1CertIssuer=new p.asn1.x509.X500Name(e):"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&-1!=e.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new p.asn1.x509.X500Name({certissuer:e}))},this.setCertSNByParam=function(e){if(void 0!==e.str||void 0!==e.bigint||void 0!==e.hex)this.asn1CertSN=new p.asn1.DERInteger(e);else if("string"==typeof e&&-1!=e.indexOf("BEGIN ")&&e.indexOf("CERTIFICATE")){var t=new Oe;t.readCertPEM(e);var i=t.getSerialNumberHex();this.asn1CertSN=new p.asn1.DERInteger({hex:i})}},this.oid="2.5.29.35",void 0!==e&&(void 0!==e.kid&&this.setKIDByParam(e.kid),void 0!==e.issuer&&this.setCertIssuerByParam(e.issuer),void 0!==e.sn&&this.setCertSNByParam(e.sn),void 0!==e.issuersn&&"string"==typeof e.issuersn&&-1!=e.issuersn.indexOf("BEGIN ")&&e.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(e.issuersn),this.setCertIssuerByParam(e.issuersn)))},ve(p.asn1.x509.AuthorityKeyIdentifier,p.asn1.x509.Extension),p.asn1.x509.SubjectKeyIdentifier=function(e){p.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,e);var t=p.asn1.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.getEncodedHex()},this.setKIDByParam=function(e){if(void 0!==e.str||void 0!==e.hex)this.asn1KID=new t(e);else if("object"==typeof e&&p.crypto.Util.isKey(e)||"string"==typeof e&&-1!=e.indexOf("BEGIN")){var i=e;"string"==typeof e&&(i=ze.getKey(e));var n=ze.getKeyID(i);this.asn1KID=new p.asn1.DEROctetString({hex:n})}},this.oid="2.5.29.14",void 0!==e&&void 0!==e.kid&&this.setKIDByParam(e.kid)},ve(p.asn1.x509.SubjectKeyIdentifier,p.asn1.x509.Extension),p.asn1.x509.AuthorityInfoAccess=function(e){p.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,e),this.setAccessDescriptionArray=function(e){for(var t=new Array,i=p.asn1,n=i.DERSequence,r=i.DERObjectIdentifier,s=i.x509.GeneralName,o=0;o<e.length;o++){var a,u=e[o];if(void 0!==u.ocsp)a=new n({array:[new r({oid:"1.3.6.1.5.5.7.48.1"}),new s({uri:u.ocsp})]});else{if(void 0===u.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(u));a=new n({array:[new r({oid:"1.3.6.1.5.5.7.48.2"}),new s({uri:u.caissuer})]})}t.push(a)}this.asn1ExtnValue=new n({array:t})},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==e&&void 0!==e.array&&this.setAccessDescriptionArray(e.array)},ve(p.asn1.x509.AuthorityInfoAccess,p.asn1.x509.Extension),p.asn1.x509.SubjectAltName=function(e){p.asn1.x509.SubjectAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new p.asn1.x509.GeneralNames(e)},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.17",void 0!==e&&void 0!==e.array&&this.setNameArray(e.array)},ve(p.asn1.x509.SubjectAltName,p.asn1.x509.Extension),p.asn1.x509.IssuerAltName=function(e){p.asn1.x509.IssuerAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new p.asn1.x509.GeneralNames(e)},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.18",void 0!==e&&void 0!==e.array&&this.setNameArray(e.array)},ve(p.asn1.x509.IssuerAltName,p.asn1.x509.Extension),p.asn1.x509.SubjectDirectoryAttributes=function(e){p.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,e);var t=p.asn1,i=t.DERSequence,n=t.ASN1Util.newObject,r=t.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var e=[],t=0;t<this.params.array.length;t++){var s=this.params.array[t],o={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==s.attr)o.seq[0].oid=r(s.attr),o.seq[1].set[0]={gentime:s.str};else if("placeOfBirth"==s.attr)o.seq[0].oid=r(s.attr),o.seq[1].set[0]={utf8str:s.str};else if("gender"==s.attr)o.seq[0].oid=r(s.attr),o.seq[1].set[0]={prnstr:s.str};else if("countryOfCitizenship"==s.attr)o.seq[0].oid=r(s.attr),o.seq[1].set[0]={prnstr:s.str};else{if("countryOfResidence"!=s.attr)throw new Error("unsupported attribute: "+s.attr);o.seq[0].oid=r(s.attr),o.seq[1].set[0]={prnstr:s.str}}e.push(new n(o))}var a=new i({array:e});return this.asn1ExtnValue=a,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.9",void 0!==e&&(this.params=e)},ve(p.asn1.x509.SubjectDirectoryAttributes,p.asn1.x509.Extension),p.asn1.x509.PrivateExtension=function(e){p.asn1.x509.PrivateExtension.superclass.constructor.call(this,e);var t=p,i=t.lang.String.isHex,n=t.asn1,r=n.x509.OID.name2oid,s=n.ASN1Util.newObject;this.params=null,this.setByParam=function(e){this.oid=r(e.extname),this.params=e},this.getExtnValueHex=function(){if(null==this.params.extname||null==this.params.extn)throw new Error("extname or extnhex not specified");var e=this.params.extn;if("string"==typeof e&&i(e))return e;if("object"==typeof e)try{return s(e).getEncodedHex()}catch(e){}throw new Error("unsupported extn value")},null!=e&&this.setByParam(e)},ve(p.asn1.x509.PrivateExtension,p.asn1.x509.Extension),p.asn1.x509.CRL=function(e){p.asn1.x509.CRL.superclass.constructor.call(this);var t=p.asn1,i=t.DERSequence,n=t.DERBitString,r=t.x509,s=r.AlgorithmIdentifier,o=r.TBSCertList;this.params=void 0,this.setByParam=function(e){this.params=e},this.sign=function(){var e=new o(this.params).getEncodedHex(),t=new p.crypto.Signature({alg:this.params.sigalg});t.init(this.params.cakey),t.updateHex(e);var i=t.sign();this.params.sighex=i},this.getPEM=function(){return de(this.getEncodedHex(),"X509 CRL")},this.getEncodedHex=function(){var e=this.params;if(null==e.tbsobj&&(e.tbsobj=new o(e)),null==e.sighex&&null!=e.cakey&&this.sign(),null==e.sighex)throw new Error("sighex or cakey parameter not defined");var t=[];return t.push(e.tbsobj),t.push(new s({name:e.sigalg})),t.push(new n({hex:"00"+e.sighex})),new i({array:t}).getEncodedHex()},null!=e&&(this.params=e)},ve(p.asn1.x509.CRL,p.asn1.ASN1Object),p.asn1.x509.TBSCertList=function(e){p.asn1.x509.TBSCertList.superclass.constructor.call(this);var t=p.asn1,i=t.DERInteger,n=t.DERSequence,r=t.DERTaggedObject;t.DERObjectIdentifier;var s=t.x509,o=s.AlgorithmIdentifier,a=s.Time,u=s.Extensions,c=s.X500Name;this.params=null,this.setByParam=function(e){this.params=e},this.getRevCertSequence=function(){for(var e=[],t=this.params.revcert,r=0;r<t.length;r++){var s=[new i(t[r].sn),new a(t[r].date)];null!=t[r].ext&&s.push(new u(t[r].ext)),e.push(new n({array:s}))}return new n({array:e})},this.getEncodedHex=function(){var e=[],t=this.params;if(null!=t.version){var s=t.version-1,l=new i({int:s});e.push(l)}if(e.push(new o({name:t.sigalg})),e.push(new c(t.issuer)),e.push(new a(t.thisupdate)),null!=t.nextupdate&&e.push(new a(t.nextupdate)),null!=t.revcert&&e.push(this.getRevCertSequence()),null!=t.ext){var h=new u(t.ext);e.push(new r({tag:"a0",explicit:!0,obj:h}))}return new n({array:e}).getEncodedHex()},void 0!==e&&this.setByParam(e)},ve(p.asn1.x509.TBSCertList,p.asn1.ASN1Object),p.asn1.x509.CRLEntry=function(e){p.asn1.x509.CRLEntry.superclass.constructor.call(this);var t=p.asn1;this.setCertSerial=function(e){this.sn=new t.DERInteger(e)},this.setRevocationDate=function(e){this.time=new t.x509.Time(e)},this.getEncodedHex=function(){var e=new t.DERSequence({array:[this.sn,this.time]});return this.TLV=e.getEncodedHex(),this.TLV},void 0!==e&&(void 0!==e.time&&this.setRevocationDate(e.time),void 0!==e.sn&&this.setCertSerial(e.sn))},ve(p.asn1.x509.CRLEntry,p.asn1.ASN1Object),p.asn1.x509.CRLNumber=function(e){p.asn1.x509.CRLNumber.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new p.asn1.DERInteger(this.params.num),this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.20",null!=e&&(this.params=e)},ve(p.asn1.x509.CRLNumber,p.asn1.x509.Extension),p.asn1.x509.CRLReason=function(e){p.asn1.x509.CRLReason.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new p.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.21",null!=e&&(this.params=e)},ve(p.asn1.x509.CRLReason,p.asn1.x509.Extension),p.asn1.x509.OCSPNonce=function(e){p.asn1.x509.OCSPNonce.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new p.asn1.DEROctetString(this.params),this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=e&&(this.params=e)},ve(p.asn1.x509.OCSPNonce,p.asn1.x509.Extension),p.asn1.x509.OCSPNoCheck=function(e){p.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new p.asn1.DERNull,this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=e&&(this.params=e)},ve(p.asn1.x509.OCSPNoCheck,p.asn1.x509.Extension),p.asn1.x509.AdobeTimeStamp=function(e){p.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,e);var t=p.asn1,i=t.DERInteger,n=t.DERBoolean,r=t.DERSequence,s=t.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var e=this.params,t=[new i(1)];return t.push(new s({uri:e.uri})),null!=e.reqauth&&t.push(new n(e.reqauth)),this.asn1ExtnValue=new r({array:t}),this.asn1ExtnValue.getEncodedHex()},this.oid="1.2.840.113583.1.1.9.1",void 0!==e&&this.setByParam(e)},ve(p.asn1.x509.AdobeTimeStamp,p.asn1.x509.Extension),p.asn1.x509.X500Name=function(e){p.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=p.asn1,i=t.x509,n=i.RDN;this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var i=e.split("/");i.shift();for(var r=[],s=0;s<i.length;s++)if(i[s].match(/^[^=]+=.+$/))r.push(i[s]);else{var o=r.length-1;r[o]=r[o]+"/"+i[s]}for(s=0;s<r.length;s++)this.asn1Array.push(new n({str:r[s],rule:this.sRule}))},this.setByLdapString=function(e,t){void 0!==t&&(this.sRule=t);var n=i.X500Name.ldapToCompat(e);this.setByString(n,t)},this.setByObject=function(e,t){for(var i in void 0!==t&&(this.sRule=t),e)if(e.hasOwnProperty(i)){var r=new n({str:i+"="+e[i],rule:this.sRule});this.asn1Array?this.asn1Array.push(r):this.asn1Array=[r]}},this.setByParam=function(e){var t;(void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.array)?this.paramArray=e.array:void 0!==e.str?this.setByString(e.str):void 0!==e.ldapstr?this.setByLdapString(e.ldapstr):void 0!==e.hex?this.hTLV=e.hex:void 0!==e.certissuer?((t=new Oe).readCertPEM(e.certissuer),this.hTLV=t.getIssuerHex()):void 0!==e.certsubject?((t=new Oe).readCertPEM(e.certsubject),this.hTLV=t.getSubjectHex()):"object"==typeof e&&void 0===e.certsubject&&void 0===e.certissuer&&this.setByObject(e)},this.getEncodedHex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(0==this.asn1Array.length&&this.paramArray.length>0)for(var e=0;e<this.paramArray.length;e++){var i={array:this.paramArray[e]};"utf8"!=this.sRule&&(i.rule=this.sRule);var r=new n(i);this.asn1Array.push(r)}var s=new t.DERSequence({array:this.asn1Array});return this.hTLV=s.getEncodedHex(),this.hTLV},void 0!==e&&this.setByParam(e)},ve(p.asn1.x509.X500Name,p.asn1.ASN1Object),p.asn1.x509.X500Name.compatToLDAP=function(e){if("/"!==e.substr(0,1))throw"malformed input";var t=(e=e.substr(1)).split("/");return t.reverse(),(t=t.map((function(e){return e.replace(/,/,"\\,")}))).join(",")},p.asn1.x509.X500Name.onelineToLDAP=function(e){return p.asn1.x509.X500Name.compatToLDAP(e)},p.asn1.x509.X500Name.ldapToCompat=function(e){for(var t=e.split(","),i=!1,n=[],r=0;t.length>0;r++){var s=t.shift();if(!0===i){var o=(n.pop()+","+s).replace(/\\,/g,",");n.push(o),i=!1}else n.push(s);"\\"===s.substr(-1,1)&&(i=!0)}return(n=n.map((function(e){return e.replace("/","\\/")}))).reverse(),"/"+n.join("/")},p.asn1.x509.X500Name.ldapToOneline=function(e){return p.asn1.x509.X500Name.ldapToCompat(e)},p.asn1.x509.RDN=function(e){p.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=p.asn1.x509.AttributeTypeAndValue;this.setByParam=function(e){void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.str&&this.addByMultiValuedString(e.str),void 0!==e.array&&(this.paramArray=e.array)},this.addByString=function(e){this.asn1Array.push(new p.asn1.x509.AttributeTypeAndValue({str:e,rule:this.sRule}))},this.addByMultiValuedString=function(e){for(var t=p.asn1.x509.RDN.parseString(e),i=0;i<t.length;i++)this.addByString(t[i])},this.getEncodedHex=function(){if(0==this.asn1Array.length&&this.paramArray.length>0)for(var e=0;e<this.paramArray.length;e++){var i=this.paramArray[e];void 0!==i.rule&&"utf8"!=this.sRule&&(i.rule=this.sRule);var n=new t(i);this.asn1Array.push(n)}var r=new p.asn1.DERSet({array:this.asn1Array});return this.TLV=r.getEncodedHex(),this.TLV},void 0!==e&&this.setByParam(e)},ve(p.asn1.x509.RDN,p.asn1.ASN1Object),p.asn1.x509.RDN.parseString=function(e){for(var t=e.split(/\+/),i=!1,n=[],r=0;t.length>0;r++){var s=t.shift();if(!0===i){var o=(n.pop()+"+"+s).replace(/\\\+/g,"+");n.push(o),i=!1}else n.push(s);"\\"===s.substr(-1,1)&&(i=!0)}var a=!1,u=[];for(r=0;n.length>0;r++){s=n.shift();if(!0===a){var c=u.pop();if(s.match(/"$/)){o=(c+"+"+s).replace(/^([^=]+)="(.*)"$/,"$1=$2");u.push(o),a=!1}else u.push(c+"+"+s)}else u.push(s);s.match(/^[^=]+="/)&&(a=!0)}return u},p.asn1.x509.AttributeTypeAndValue=function(e){p.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=p,i=t.asn1,n=i.DERSequence,r=i.DERUTF8String,s=i.DERPrintableString,o=i.DERTeletexString,a=i.DERIA5String,u=i.DERVisibleString,c=i.DERBMPString,l=t.lang.String.isMail,h=t.lang.String.isPrintable;this.setByParam=function(e){if(void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.ds&&(this.dsType=e.ds),void 0===e.value&&void 0!==e.str){var t=e.str.match(/^([^=]+)=(.+)$/);if(!t)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=t[1],this.sValue=t[2]}else this.sType=e.type,this.sValue=e.value},this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var i=e.match(/^([^=]+)=(.+)$/);if(!i)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(i[1],i[2])},this._getDsType=function(){var e=this.sType,t=this.sValue,i=this.sRule;return"prn"===i?"CN"==e&&l(t)?"ia5":h(t)?"prn":"utf8":"utf8"===i?"CN"==e&&l(t)?"ia5":"C"==e?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(e,t,i){void 0!==i&&(this.sRule=i),this.sType=e,this.sValue=t},this.getValueObj=function(e,t){if("utf8"==e)return new r({str:t});if("prn"==e)return new s({str:t});if("tel"==e)return new o({str:t});if("ia5"==e)return new a({str:t});if("vis"==e)return new u({str:t});if("bmp"==e)return new c({str:t});throw new Error("unsupported directory string type: type="+e+" value="+t)},this.getEncodedHex=function(){null==this.dsType&&(this.dsType=this._getDsType());var e=p.asn1.x509.OID.atype2obj(this.sType),t=this.getValueObj(this.dsType,this.sValue),i=new n({array:[e,t]});return this.TLV=i.getEncodedHex(),this.TLV},void 0!==e&&this.setByParam(e)},ve(p.asn1.x509.AttributeTypeAndValue,p.asn1.ASN1Object),p.asn1.x509.SubjectPublicKeyInfo=function(e){p.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=p,i=t.asn1,n=i.DERInteger,r=i.DERBitString,s=i.DERObjectIdentifier,o=i.DERSequence,a=i.ASN1Util.newObject,u=i.x509.AlgorithmIdentifier,c=t.crypto;c.ECDSA,c.DSA,this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new o({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.getEncodedHex=function(){var e=this.getASN1Object();return this.hTLV=e.getEncodedHex(),this.hTLV},this.setPubKey=function(e){try{if(e instanceof ee){var t=a({seq:[{int:{bigint:e.n}},{int:{int:e.e}}]}).getEncodedHex();this.asn1AlgId=new u({name:"rsaEncryption"}),this.asn1SubjPKey=new r({hex:"00"+t})}}catch(e){}try{if(e instanceof p.crypto.ECDSA){var i=new s({name:e.curveName});this.asn1AlgId=new u({name:"ecPublicKey",asn1params:i}),this.asn1SubjPKey=new r({hex:"00"+e.pubKeyHex})}}catch(e){}try{if(e instanceof p.crypto.DSA){i=new a({seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]});this.asn1AlgId=new u({name:"dsa",asn1params:i});var o=new n({bigint:e.y});this.asn1SubjPKey=new r({hex:"00"+o.getEncodedHex()})}}catch(e){}},void 0!==e&&this.setPubKey(e)},ve(p.asn1.x509.SubjectPublicKeyInfo,p.asn1.ASN1Object),p.asn1.x509.Time=function(e){p.asn1.x509.Time.superclass.constructor.call(this);var t=p.asn1,i=t.DERUTCTime,n=t.DERGeneralizedTime;this.setTimeParams=function(e){this.timeParams=e},this.getEncodedHex=function(){var e=null;return e=null!=this.timeParams?"utc"==this.type?new i(this.timeParams):new n(this.timeParams):"utc"==this.type?new i:new n,this.TLV=e.getEncodedHex(),this.TLV},this.type="utc",void 0!==e&&(void 0!==e.type?this.type=e.type:void 0!==e.str&&(e.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),e.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=e)},ve(p.asn1.x509.Time,p.asn1.ASN1Object),p.asn1.x509.AlgorithmIdentifier=function(e){p.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=p.asn1,i=t.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.getEncodedHex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw new Error("algorithm not specified");if(null!==this.nameAlg){var e=null;for(var n in i)n===this.nameAlg&&(e=i[n]);if(null!==e)return this.hTLV=e,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=t.x509.OID.name2obj(this.nameAlg));var r=[this.asn1Alg];null!==this.asn1Params&&r.push(this.asn1Params);var s=new t.DERSequence({array:r});return this.hTLV=s.getEncodedHex(),this.hTLV},void 0!==e&&(void 0!==e.name&&(this.nameAlg=e.name),void 0!==e.asn1params&&(this.asn1Params=e.asn1params),void 0!==e.paramempty&&(this.paramEmpty=e.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var n=this.nameAlg.toLowerCase();"withdsa"!==n.substr(-7,7)&&"withecdsa"!==n.substr(-9,9)&&(this.asn1Params=new t.DERNull)}},ve(p.asn1.x509.AlgorithmIdentifier,p.asn1.ASN1Object),p.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},p.asn1.x509.GeneralName=function(e){p.asn1.x509.GeneralName.superclass.constructor.call(this);var t={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},i=p.asn1;i.DERSequence;var n=i.DEROctetString,r=i.DERIA5String,s=i.DERTaggedObject,o=i.ASN1Object,a=i.x509.X500Name,u=pe;this.explicit=!1,this.setByParam=function(e){var i=null;if(void 0!==e){if(void 0!==e.rfc822&&(this.type="rfc822",i=new r({str:e[this.type]})),void 0!==e.dns&&(this.type="dns",i=new r({str:e[this.type]})),void 0!==e.uri&&(this.type="uri",i=new r({str:e[this.type]})),void 0!==e.dn&&(this.type="dn",this.explicit=!0,i="string"==typeof e.dn?new a({str:e.dn}):e.dn instanceof p.asn1.x509.X500Name?e.dn:new a(e.dn)),void 0!==e.ldapdn&&(this.type="dn",this.explicit=!0,i=new a({ldapstr:e.ldapdn})),void 0!==e.certissuer){this.type="dn",this.explicit=!0;var c=null;if((h=e.certissuer).match(/^[0-9A-Fa-f]+$/),-1!=h.indexOf("-----BEGIN ")&&(c=u(h)),null==c)throw"certissuer param not cert";(d=new Oe).hex=c;var l=d.getIssuerHex();(i=new o).hTLV=l}if(void 0!==e.certsubj){this.type="dn",this.explicit=!0;var h,d;c=null;if((h=e.certsubj).match(/^[0-9A-Fa-f]+$/),-1!=h.indexOf("-----BEGIN ")&&(c=u(h)),null==c)throw"certsubj param not cert";(d=new Oe).hex=c;l=d.getSubjectHex();(i=new o).hTLV=l}if(void 0!==e.ip){this.type="ip",this.explicit=!1;var M,f=e.ip,g="malformed IP address";if(f.match(/^[0-9.]+[.][0-9.]+$/)){if(8!==(M=function(e){e=(e=(e=e.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return e.split(/,/).map((function(e,t,i){var n=parseInt(e);if(n<0||255<n)throw"integer not in range 0-255";return("00"+n.toString(16)).slice(-2)})).join("")}catch(e){throw"malformed integer array string: "+e}}("["+f.split(".").join(",")+"]")).length)throw g}else if(f.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/))M=function(e){var t="malformed IPv6 address";if(!e.match(/^[0-9A-Fa-f:]+$/))throw t;var i=(e=e.toLowerCase()).split(":").length-1;if(i<2)throw t;var n=":".repeat(7-i+2),r=(e=e.replace("::",n)).split(":");if(8!=r.length)throw t;for(var s=0;s<8;s++)r[s]=("0000"+r[s]).slice(-4);return r.join("")}(f);else{if(!f.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw g;M=f}i=new n({hex:M})}if(null==this.type)throw"unsupported type in params="+e;this.asn1Obj=new s({explicit:this.explicit,tag:t[this.type],obj:i})}},this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()},void 0!==e&&this.setByParam(e)},ve(p.asn1.x509.GeneralName,p.asn1.ASN1Object),p.asn1.x509.GeneralNames=function(e){p.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=p.asn1;this.setByParamArray=function(e){for(var i=0;i<e.length;i++){var n=new t.x509.GeneralName(e[i]);this.asn1Array.push(n)}},this.getEncodedHex=function(){return new t.DERSequence({array:this.asn1Array}).getEncodedHex()},this.asn1Array=new Array,void 0!==e&&this.setByParamArray(e)},ve(p.asn1.x509.GeneralNames,p.asn1.ASN1Object),p.asn1.x509.OID=new function(e){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(e){if(void 0!==this.objCache[e])return this.objCache[e];if(void 0===this.name2oidList[e])throw"Name of ObjectIdentifier not defined: "+e;var t=this.name2oidList[e],i=new p.asn1.DERObjectIdentifier({oid:t});return this.objCache[e]=i,i},this.atype2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];var t;if(e.match(/^\d+\.\d+\.[0-9.]+$/))t=e;else if(void 0!==this.atype2oidList[e])t=this.atype2oidList[e];else{if(void 0===this.name2oidList[e])throw"AttributeType name undefined: "+e;t=this.name2oidList[e]}var i=new p.asn1.DERObjectIdentifier({oid:t});return this.objCache[e]=i,i}},p.asn1.x509.OID.oid2name=function(e){var t=p.asn1.x509.OID.name2oidList;for(var i in t)if(t[i]==e)return i;return""},p.asn1.x509.OID.oid2atype=function(e){var t=p.asn1.x509.OID.atype2oidList;for(var i in t)if(t[i]==e)return i;return e},p.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=p.asn1.x509.OID.name2oidList;return void 0===t[e]?"":t[e]},p.asn1.x509.X509Util={},p.asn1.x509.X509Util.newCertPEM=function(e){var t=p.asn1.x509;return t.TBSCertificate,new(0,t.Certificate)(e).getPEM()},ee.getPosArrayOfChildrenFromHex=function(e){return Ie.getChildIdx(e,0)},ee.getHexValueArrayOfChildrenFromHex=function(e){var t,i=Ie.getV,n=i(e,(t=ee.getPosArrayOfChildrenFromHex(e))[0]),r=i(e,t[1]),s=i(e,t[2]),o=i(e,t[3]),a=i(e,t[4]),u=i(e,t[5]),c=i(e,t[6]),l=i(e,t[7]),h=i(e,t[8]);return(t=new Array).push(n,r,s,o,a,u,c,l,h),t},ee.prototype.readPrivateKeyFromPEMString=function(e){var t=pe(e),i=ee.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8])},ee.prototype.readPKCS5PrvKeyHex=function(e){var t=ee.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},ee.prototype.readPKCS8PrvKeyHex=function(e){var t,i,n,r,s,o,a,u,c=Ie,l=c.getVbyListEx;if(!1===c.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=l(e,0,[2,0,1],"02"),i=l(e,0,[2,0,2],"02"),n=l(e,0,[2,0,3],"02"),r=l(e,0,[2,0,4],"02"),s=l(e,0,[2,0,5],"02"),o=l(e,0,[2,0,6],"02"),a=l(e,0,[2,0,7],"02"),u=l(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,i,n,r,s,o,a,u)},ee.prototype.readPKCS5PubKeyHex=function(e){var t=Ie,i=t.getV;if(!1===t.isASN1HEX(e))throw new Error("keyHex is not ASN.1 hex string");var n=t.getChildIdx(e,0);if(2!==n.length||"02"!==e.substr(n[0],2)||"02"!==e.substr(n[1],2))throw new Error("wrong hex for PKCS#5 public key");var r=i(e,n[0]),s=i(e,n[1]);this.setPublic(r,s)},ee.prototype.readPKCS8PubKeyHex=function(e){var t=Ie;if(!1===t.isASN1HEX(e))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(e,0,[0,0]))throw new Error("not PKCS8 RSA public key");var i=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(i)},ee.prototype.readCertPubKeyHex=function(e,t){var i,n;(i=new Oe).readCertHex(e),n=i.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},ee.prototype.sign=function(e,t){var i,n=(i=e,p.crypto.Util.hashString(i,t));return this.signWithMessageHash(n,t)},ee.prototype.signWithMessageHash=function(e,t){var i=J(p.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return be(this.doPrivate(i).toString(16),this.n.bitLength())},ee.prototype.signPSS=function(e,t,i){var n,r=(n=le(e),p.crypto.Util.hashHex(n,t));return void 0===i&&(i=-1),this.signWithMessageHashPSS(r,t,i)},ee.prototype.signWithMessageHashPSS=function(e,t,i){var n,r=ce(e),s=r.length,o=this.n.bitLength()-1,a=Math.ceil(o/8),u=function(e){return p.crypto.Util.hashHex(e,t)};if(-1===i||void 0===i)i=s;else if(-2===i)i=a-s-2;else if(i<-2)throw new Error("invalid salt length");if(a<s+i+2)throw new Error("data too long");var c="";i>0&&(c=new Array(i),(new X).nextBytes(c),c=String.fromCharCode.apply(String,c));var l=ce(u(le("\0\0\0\0\0\0\0\0"+r+c))),h=[];for(n=0;n<a-i-s-2;n+=1)h[n]=0;var d=String.fromCharCode.apply(String,h)+""+c,M=Le(l,d.length,u),f=[];for(n=0;n<d.length;n+=1)f[n]=d.charCodeAt(n)^M.charCodeAt(n);var A=65280>>8*a-o&255;for(f[0]&=~A,n=0;n<s;n++)f.push(l.charCodeAt(n));return f.push(188),be(this.doPrivate(new g(f)).toString(16),this.n.bitLength())},ee.prototype.verify=function(e,t){if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var i=J(t,16),n=this.n.bitLength();if(i.bitLength()>n)return!1;var r=this.doPublic(i).toString(16);if(r.length+3!=n/4)return!1;var s=Se(r.replace(/^1f+00/,""));if(0==s.length)return!1;var o,a=s[0];return s[1]==(o=e,p.crypto.Util.hashString(o,a))},ee.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=J(t,16);if(i.bitLength()>this.n.bitLength())return 0;var n=Se(this.doPublic(i).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==e)},ee.prototype.verifyPSS=function(e,t,i,n){var r=function(e){return p.crypto.Util.hashHex(e,i)}(le(e));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(r,t,i,n)},ee.prototype.verifyWithMessageHashPSS=function(e,t,i,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r,s=new g(t,16),o=function(e){return p.crypto.Util.hashHex(e,i)},a=ce(e),u=a.length,c=this.n.bitLength()-1,l=Math.ceil(c/8);if(-1===n||void 0===n)n=u;else if(-2===n)n=l-u-2;else if(n<-2)throw new Error("invalid salt length");if(l<u+n+2)throw new Error("data too long");var h=this.doPublic(s).toByteArray();for(r=0;r<h.length;r+=1)h[r]&=255;for(;h.length<l;)h.unshift(0);if(188!==h[l-1])throw new Error("encoded message does not end in 0xbc");var d=(h=String.fromCharCode.apply(String,h)).substr(0,l-u-1),M=h.substr(d.length,u),f=65280>>8*l-c&255;if(0!=(d.charCodeAt(0)&f))throw new Error("bits beyond keysize not zero");var A=Le(M,d.length,o),y=[];for(r=0;r<d.length;r+=1)y[r]=d.charCodeAt(r)^A.charCodeAt(r);y[0]&=~f;var v=l-u-n-2;for(r=0;r<v;r+=1)if(0!==y[r])throw new Error("leftmost octets not zero");if(1!==y[v])throw new Error("0x01 marker not found");return M===ce(o(le("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,y.slice(-n)))))},ee.SALT_LEN_HLEN=-1,ee.SALT_LEN_MAX=-2,ee.SALT_LEN_RECOVER=-2,Oe.hex2dn=function(e,t){void 0===t&&(t=0);var i=new Oe;return Ie.getTLV(e,t),i.getX500Name(e).str},Oe.hex2rdn=function(e,t){if(void 0===t&&(t=0),"31"!==e.substr(t,2))throw new Error("malformed RDN");for(var i=new Array,n=Ie.getChildIdx(e,t),r=0;r<n.length;r++)i.push(Oe.hex2attrTypeValue(e,n[r]));return(i=i.map((function(e){return e.replace("+","\\+")}))).join("+")},Oe.hex2attrTypeValue=function(e,t){var i=Ie,n=i.getV;if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw new Error("malformed attribute type and value");var r=i.getChildIdx(e,t);2!==r.length||e.substr(r[0],2);var s=n(e,r[0]),o=p.asn1.ASN1Util.oidHexToInt(s);return p.asn1.x509.OID.oid2atype(o)+"="+ce(n(e,r[1]))},Oe.getPublicKeyFromCertHex=function(e){var t=new Oe;return t.readCertHex(e),t.getPublicKey()},Oe.getPublicKeyFromCertPEM=function(e){var t=new Oe;return t.readCertPEM(e),t.getPublicKey()},Oe.getPublicKeyInfoPropOfCertPEM=function(e){var t,i,n=Ie.getVbyList,r={};return r.algparam=null,(t=new Oe).readCertPEM(e),i=t.getPublicKeyHex(),r.keyhex=n(i,0,[1],"03").substr(2),r.algoid=n(i,0,[0,0],"06"),"2a8648ce3d0201"===r.algoid&&(r.algparam=n(i,0,[0,1],"06")),r},Oe.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];var Pe,ke=[(Pe=new Oe,Pe.readCertPEM(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVS@\tPPNErtNVONtVWNZR}@]nU\0ZaZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg\tR^ZNATN>bROU^zc}nzyg\tR]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\\QN>Z\tN\\Q^B[QqnS=\b\\QN>Zwp\\Q^B[QqnZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg\tR^ZNATN>bROU^zc}nzyg\tR]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaPPNvVQ^fWX|gVup[N^ROO^NQttV]NQPPNt|PttVONZU|C\b\\@@e^Xv{[vTtd8`nyO@ebN[bqx=ng?\tS^w@|XAz|qUTwfzn]Bu<qs_ae\\y<}u`eRAoE`_\\s\0r|b{rp_o<oC@o=x\bw_cUUZPApQevD\\FxFoFgE=<sq[p<coqyn>TEpP@aSC_YDU8\0|8TB?c>r\\=rp`pcwP}c\0PP_\\RS\\EPVSy8x`\0?R|NP\tP>}A^VP}Ex\bUZa=syDw}>Ya8wPp[pRnn\brU^dE8U?a\bcW|<FEbbupn^`ZNr\tsof[wA}e{\\z}w[YDQ|dt=wC\tNvbRZ@@U|ZAYpFs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tC^d_{ZC@\by]gY@E\tBFY?OsaqbDcVgQbZeFc\tovtucxnq|<TnuyXRveYFOegCpAs{YTe|>bE<OXsSqCBWD_SVepfvCCUg]z\tZvQ[\0s|U>pFz\b=OwT``fNJJ:::::R[Q-PR_aVSVPNaR:::::")),Pe)];function Ue(e,t){var i=e.getIssuerHex();if(i===e.getSubjectHex())return e.verifySignature(e.getPublicKey());var n=function(e,t){for(var i=0,n=t;i<n.length;i++){var r=n[i];if(r.getSubjectHex()===e)return r}}(i,t);return!!n&&(!1!==e.verifySignature(n.getPublicKey())&&Ue(n,t))}function Be(e){return e.getIssuerHex()!==e.getSubjectHex()&&Ue(e,ke)}!function(e){var t=new Oe;"string"==typeof e?t.readCertPEM(e):t.readCertHex(e.hex);var i=Be(t);ke.push(t)}(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVTU\tPPONrtNVONtVWNW=_SVw\tVE=ZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg\tR^ZNATN>bROU^zc}nzyg\tR]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\bZQNAZaN\\aZ\t[QSnS=\b[aNBZQZ\\aZ\t[QSnZVTaZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg\tR^ZNATN>bROU^zc}nzyg\tRbZOVTN>bRPtYoTyuoz}}f`Bwo?=RQN\\Ot[cONZO>Wyfd\tgdbRaN]Ot[cONZZPRuupz_@feWyZ`bVfWX|gVup[N^xOSugnec|fdyndB{^T}fdB\0ndRf?FZVVPVwN[Otx\0uxvTF=ON^RS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ne\\t8oou=guC>>gvb}ACd\t``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\tXSq\t{\0DvAVBbnTqEE[QzDyqF`bF}R=Q?VeDo<Vzb\0w}D}NZ\0t}^?OyFP\bVaVNrTNYqe?[NRYTSQby@yzWvT`wQo}y]c_WgxBYCy\tRNRg@NZCaaq8?`\t^`?ryD\t=obzw?E]Ou]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{ug8^f[YQAWad8FNqxFQE?ZOo\t}RnO\bsQc\txyccn=nxvs>bDBf\b\bW\\TuTnvAO^U\0QXC>xx8FxRFf<tJ:::::R[Q-PR_aVSVPNaR:::::"));var _e=2*Math.PI;function Re(e){return(e%_e+_e)%_e}var Qe=function(e){function i(t){var i=e.call(this,t,1,.1,1e3)||this;return i.pose={longitude:0,latitude:0,fov:t,offset:new a.Vector3},i.computePose(),i}return t.__extends(i,e),i.prototype.computePose=function(){var e=this.getWorldDirection(new a.Vector3);this.pose.longitude=Re(-Math.atan2(e.x,-e.z)),this.pose.latitude=-Math.asin(e.y/1),this.pose.fov=this.fov,this.pose.offset.copy(this.position)},i.prototype.setFromPose=function(e){var t,i,n,r,s=Re(null!==(t=e.longitude)&&void 0!==t?t:this.pose.longitude),o=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,null!==(i=e.latitude)&&void 0!==i?i:this.pose.latitude)),u=null!==(n=e.fov)&&void 0!==n?n:this.pose.fov,c=null!==(r=e.offset)&&void 0!==r?r:this.pose.offset;this.position.copy(c);var l=Math.abs(Math.cos(o)),h=new a.Vector3(-Math.sin(s)*l,-Math.sin(o),-Math.cos(s)*l);this.lookAt(c.clone().add(h)),this.fov!==u&&(this.fov=u,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=s,this.pose.latitude=o,this.pose.fov=u,this.pose.offset.copy(c)},i.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,offset:this.pose.offset.clone()}},i}(a.PerspectiveCamera),Ye=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(i,e),i.prototype.add=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e.prototype.add.apply(this,t)},i.prototype.remove=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e.prototype.remove.apply(this,t)},i}(a.Scene),Fe=function(e){function i(t){var i=t.preserveDrawingBuffer,n=void 0===i||i,r=t.backgroundColor,s=void 0===r?1579548:r,o=t.backgroundAlpha,u=void 0===o?1:o,c=t.pixelRatio,l=void 0===c?1:c,h=t.antialias,d=void 0!==h&&h,p=e.call(this,{antialias:d,preserveDrawingBuffer:n,alpha:u<1})||this;return p.setPixelRatio(l),p.setClearColor(s,u),p.outputEncoding=a.sRGBEncoding,p.autoClear=!0,p}return t.__extends(i,e),i}(a.WebGLRenderer);function Ve(e){return null==e}function He(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}function Ge(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function qe(){return(Ge()+Ge()+"-"+Ge()+"-4"+Ge().substr(0,3)+"-"+Ge()+"-"+Ge()+Ge()+Ge()).toLowerCase()}var We="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),Ke="undefined"!=typeof performance?function(){return We+performance.now()}:function(){return Date.now()},Ze=function(){if("undefined"!=typeof window){var e=window;return e.requestAnimationFrame||e.mozRequestAnimationFrame||e.webkitRequestAnimationFrame||e.msRequestAnimationFrame||function(e){return setTimeout(e,16)}}return function(e){return setTimeout(e,16)}}();function Xe(e,t){void 0===e&&(e=He),void 0===t&&(t=0),Ze(t<=0?e:function(){return Xe(e,t-1)})}function Je(e,i){void 0===e&&(e=He);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=!1,o=function(r){e.call.apply(e,t.__spreadArray([i,r],n,!1)),s||"function"!=typeof o||Ze(o)};return Ze(o),function(){o=null,s=!0}}var $e=0;function et(e){$e&&e($e);var t=Ke();Ze((function(){e($e=Ke()-t)}))}et(He);var tt=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.floorIndex=0,t.needsRender=!0,t}return t.__extends(i,e),i}(a.Mesh),it=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.needsRender=!0,t}return t.__extends(i,e),i.prototype.getTransparent=function(){var e;return this.traverse((function(t){void 0===e&&t instanceof tt&&t.material.forEach((function(t){void 0===e&&1===t.uniforms.originOpacity.value&&(e=t.transparent)}))})),null!=e&&e},i.prototype.setTransparent=function(e){this.traverse((function(t){t instanceof tt&&t.material.forEach((function(t){1===t.uniforms.originOpacity.value&&(t.transparent=e)}))}))},i.prototype.getMaterial=function(){var e=null;return this.traverse((function(t){if(null===e&&t instanceof tt){var i=t.material[0];e={pano0Map:i.pano0Map,pano0Matrix:i.pano0Matrix,pano1Map:i.pano1Map,pano1Matrix:i.pano1Matrix,modelAlpha:i.modelAlpha,progress:i.progress,useBlackTransition:i.useBlackTransition,perspToOrtho:i.perspToOrtho,opacity:i.opacity,pano0DepthMap:i.pano0DepthMap,panoVideoMap:i.panoVideoMap,panoVideoSize:i.panoVideoSize,panoVideoMatrix:i.panoVideoMatrix,panoVideoAlpha:i.panoVideoAlpha,panoTileMap:i.panoTileMap,panoTileMappings:i.panoTileMappings}}})),e},i.prototype.setMaterial=function(e){this.traverse((function(t){t instanceof tt&&t.material.forEach((function(t){void 0!==e.pano0Map&&(t.pano0Map=e.pano0Map),void 0!==e.pano0Matrix&&(t.pano0Matrix=e.pano0Matrix),void 0!==e.pano1Map&&(t.pano1Map=e.pano1Map),void 0!==e.pano1Matrix&&(t.pano1Matrix=e.pano1Matrix),void 0!==e.modelAlpha&&(t.modelAlpha=e.modelAlpha),void 0!==e.progress&&(t.progress=e.progress),void 0!==e.useBlackTransition&&(t.useBlackTransition=e.useBlackTransition),void 0!==e.perspToOrtho&&(t.perspToOrtho=e.perspToOrtho),void 0!==e.opacity&&(t.opacity=e.opacity),void 0!==e.pano0DepthMap&&(t.pano0DepthMap=e.pano0DepthMap),void 0!==e.panoVideoMap&&(t.panoVideoMap=e.panoVideoMap),void 0!==e.panoVideoSize&&(t.panoVideoSize=e.panoVideoSize),void 0!==e.panoVideoMatrix&&(t.panoVideoMatrix=e.panoVideoMatrix),void 0!==e.panoVideoAlpha&&(t.panoVideoAlpha=e.panoVideoAlpha),void 0!==e.panoTileMap&&(t.panoTileMap=e.panoTileMap),void 0!==e.panoTileMappings&&(t.panoTileMappings=e.panoTileMappings)}))}))},i.prototype.disposeMaterial=function(){this.traverse((function(e){if(e instanceof tt){var t=[];e.material.forEach((function(e){var i=e.uniforms;Object.keys(i).map((function(e){if(["pano0Map","pano1Map","pano0DepthMap","panoVideoMap","panoTileMap"].indexOf(e)>=0)i[e].value=null;else{var n=i[e].value;n&&"function"==typeof n.dispose&&-1===t.indexOf(n)&&(i[e].value=null,t.push(n))}})),e.dispose()})),t.forEach((function(e){return e.dispose()}))}}))},i.prototype.disposeGeometry=function(){this.traverse((function(e){e instanceof tt&&e.geometry.dispose()}))},i}(a.Group),nt=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.floorIndex=0,t}return t.__extends(i,e),i}(it),rt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}("n\bv{t-rp@-[|znyHn\bv{t-rp@-cvr]|vv|{H{vs|z-znA-}n{|=ZnvH{vs|z-znA-}n{|>ZnvH{vs|z-rp@-z|qryPr{rH{vs|z-sy|n-}r}a|\\u|Hn\bv{t-r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-|u|Qvn{pr-69-}r}a|\\u|-6H\f"),st=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}("{vs|z-rp@-qvssrH{vs|z-rp@-rzvvrH{vs|z-rp@-}rpynH{vs|z-sy|n-uv{v{rH{vs|z-sy|n-r}|rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-|vtv{\\}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH{vs|z-nz}yrPor-}n{|=Zn}H{vs|z-nz}yrPor-}n{|>Zn}H{vs|z-nz}yrPor-}n{|=Qr}uZn}H{vs|z-rp?-}n{|cvqr|`v\trH{vs|z-znA-}n{|cvqr|ZnvH{vs|z-sy|n-}n{|cvqr|Ny}unH{vs|z-nz}yr?Q-}n{|cvqr|Zn}H0vs-qrsv{rq5b`RlaVYR6--{vs|z-nz}yr?Q-}n{|avyrZn}H--{vs|z-rpA-}n{|avyrPyv}Zn}}v{thaVYRlZN]]V[TlYR[TaUjH--{vs|z-rpA-}n{|avyrQnNZn}}v{thaVYRlZN]]V[TlYR[TaUjH0r{qvs0vs-.qrsv{rq5b`RlOYNPXla_N[`VaV\\[6-33-qrsv{rq5b`Rl]N[\\=lQR]aUlZN]6--n\bv{t-rp@-pnzrna|crrH0r{qvsn\bv{t-rp@-}n{|=a|crrHn\bv{t-rp@-}n{|>a|crrH0v{pyqr-Ip|zz|{K0v{pyqr-I}npxv{tK0v{pyqr-Ip|y|l}nlsntzr{K0v{pyqr-Il}nlsntzr{K0v{pyqr-I?l}nlsntzr{K0v{pyqr-Izn}l}nlsntzr{K0v{pyqr-Iny}unzn}l}nlsntzr{K0v{pyqr-In|zn}l}nlsntzr{K0v{pyqr-Iyvtuzn}l}nlsntzr{K0v{pyqr-Irzvvrzn}l}nlsntzr{K0v{pyqr-Ir{zn}l}nlsntzr{K0v{pyqr-Itnqvr{zn}l}nlsntzr{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-IoqsK0v{pyqr-Iyvtul}nlortv{K0v{pyqr-Iyvtul}u|{tl}nlsntzr{K0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=9-=;=9-=;=9->;=60qrsv{r-]Vl?-C;?E@>EB?rp?-|P||q5rp@-rp|6-\n--sy|n--J-yr{tu5rp|6H--sy|n-urn-J-np|5rp|;\b-<-6H--sy|n-}uv-J-nn{5rp|;9-rp|;\t6H--r{-rp?5=;B-8-}uv-<-]Vl?9-urn-<-]V6H\f|vq-znv{56-\n--rpA-qvssrP|y|-J-rpA5qvssr9-|vtv{\\}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}|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\\_;\b\t9-qvssrP|y|;n6H--\f--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-rrPor5}n{|=Zn}9-}n{|=a|crr6H--0vs-qrsv{rq5b`RlaVYR6----rp?-vyrlp||q-J-|P||q5}n{|=a|crr6H----rpA-vyrlpyv}H----rpA-vyrlqnNH----rp?-vyrlH----sy|n-vyrlny}unH----0}ntzn-{|yyly||}lnH----s|-5v{-v-J-=H-v-I-aVYRlZN]]V[TlYR[TaUH-v886-\n------vyrlpyv}-J-}n{|avyrPyv}Zn}}v{thvjH------vyrlqnN-J-}n{|avyrQnNZn}}v{thvjH------vyrl;-J-5vyrlp||q;-:-vyrlpyv}h=j6-<-vyrlpyv}h?jH------vyrl;\b-J-5vyrlp||q;\b-:-vyrlpyv}h>j6-<-vyrlpyv}h@jH------vyrlny}un-J-5>;=-:-r}5=;B9-no5vyrl;-:-=;B666-7-5>;=-:-r}5=;B9-no5vyrl;\b-:-=;B666H------vyrl;-J-vyrlqnNh=j-8-vyrl;-7-vyrlqnNh?jH------vyrl;\b-J-vyrlqnNh>j-8-vyrl;\b-7-vyrlqnNh@jH------vyrlny}un-J-prvy5vyrlny}un-7-vyrlqnNh?j6H------}n{|=P|y|-J-zv5}n{|=P|y|9-rr?Q5}n{|avyrZn}9-vyrl69-vyrlny}un6H----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--rpA-}n{|>P|y|-J-rrPor5}n{|>Zn}9-}n{|>a|crr6H--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv5}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv5}n{|P|y|9-}n{|>P|y|9-zn5=;=9-oynpx]|tr-:-?;=66H--0ryr----0vs-qrsv{rq5b`Rl]N[\\=lQR]aUlZN]6------rpA-}n{|=Qr}uP|y|-J-rrPor5}n{|=Qr}uZn}9-pnzrna|crr6H------sy|n-qrynQvn{pr=-J-no5{}npx_TONa|Qr}u5}n{|=Qr}uP|y|6-7->=;=-:-yr{tu5}n{|=a|crr66H------sy|n-ynry-J-pynz}5}|tr-7-5>;=-8-qrynQvn{pr=-7-=;FB69-=;=9->;=6H----0ryr------sy|n-ynry-J-}|trH----0r{qvs----}n{|P|y|-J-zv5}n{|=P|y|9-}n{|>P|y|9-ynry6H--0r{qvs--0vs-qrsv{rq5b`Rl]N[\\lcVQR\\lZN]6----rpA-zn}P||q-J-rpA5pnzrna|crr9->;=6-7-}n{|cvqr|ZnvH----rp?--J-rp?5------=;B-8-zn}P||q;-<-zn}P||q;\t-<-}n{|cvqr|`v\tr;9------=;B-:-zn}P||q;\b-<-zn}P||q;\t-<-}n{|cvqr|`v\tr;\b----6H----rpA-vqr|P|y|-J-rr?Q5}n{|cvqr|Zn}9-6H----sy|n-znpu-J-5>;=-:-r}5=;=9-zn}P||q;\t66-7-5>;=-:-r}5=;B9-no5;-:-=;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-zv5}n{|P|y|9-vqr|P|y|9-znpu-7-ny}un-7-}n{|cvqr|Ny}un6H--0r{qvs--tylSntP|y|-J-zv5}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--tylSntP|y|-J-rpA5tylSntP|y|;to9-|}npv\b6H\f"),ot=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.hash=qe(),t.meta=[null,null,null,null,null,null],t}return t.__extends(i,e),i}(a.CubeTexture);function at(){return"undefined"==typeof document?{}:document.createElementNS("http://www.w3.org/1999/xhtml","img")}var ut=at();ut.width=ut.height=8;var ct=new a.Texture(ut),lt=new ot([ut,ut,ut,ut,ut,ut]);ct.dispose=lt.dispose=function(){};var ht=Object.assign({modelAlpha:new a.Uniform(0),originOpacity:new a.Uniform(1),progress:new a.Uniform(0),pano0Map:new a.Uniform(null),pano0Matrix:new a.Uniform(new a.Matrix4),pano1Map:new a.Uniform(null),pano1Matrix:new a.Uniform(new a.Matrix4),pano0DepthMap:new a.Uniform(null),panoVideoMap:new a.Uniform(null),panoVideoSize:new a.Uniform(new a.Vector2),panoVideoMatrix:new a.Uniform(new a.Matrix4),panoVideoAlpha:new a.Uniform(0),modelCenter:new a.Uniform(new a.Vector3),perspToOrtho:new a.Uniform(0),panoTileMap:new a.Uniform(null),panoTileClipMappings:new a.Uniform([]),panoTileDrawAtMappings:new a.Uniform([])},{exposure:new a.Uniform(1),emissive:new a.Uniform(new a.Color(0)),emissiveMap:new a.Uniform(null),specular:new a.Uniform(new a.Color(1118481)),specularMap:new a.Uniform(null),normalMap:new a.Uniform(null),bumpMap:new a.Uniform(null),shininess:new a.Uniform(30)},a.UniformsLib.common,a.UniformsLib.lights),dt=function(e){function i(t){var i,n,r,s,o,u,c,l,h,d,p,M,f,g,A,y;void 0===t&&(t={});var v=e.call(this,{vertexShader:rt,fragmentShader:st,uniforms:a.UniformsUtils.clone(ht),defines:{USE_MAP:!0,USE_UV:!0,USE_TILE:!1,TILE_MAPPING_LENGTH:0,USE_BLACK_TRANSITION:!1,USE_PANO0_DEPTH_MAP:!1,USE_PANO_VIDEO_MAP:!1},lights:!0})||this;return Object.defineProperties(v,{pano0Map:{get:function(){var e=this.uniforms.pano0Map.value;return e===lt?null:e},set:function(e){this.uniforms.pano0Map.value=null===e?lt:e}},pano0Matrix:{get:function(){return this.uniforms.pano0Matrix.value.clone()},set:function(e){this.uniforms.pano0Matrix.value.copy(e)}},pano1Map:{get:function(){var e=this.uniforms.pano1Map.value;return e===lt?null:e},set:function(e){this.uniforms.pano1Map.value=null===e?lt:e}},pano1Matrix:{get:function(){return this.uniforms.pano1Matrix.value.clone()},set:function(e){this.uniforms.pano1Matrix.value.copy(e)}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(e){this.uniforms.modelAlpha.value=e}},progress:{get:function(){return this.uniforms.progress.value},set:function(e){this.uniforms.progress.value=e}},useBlackTransition:{get:function(){return this.defines.USE_BLACK_TRANSITION},set:function(e){this.defines.USE_BLACK_TRANSITION!==e&&(this.defines.USE_BLACK_TRANSITION=e,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},perspToOrtho:{get:function(){return this.uniforms.perspToOrtho.value},set:function(e){this.uniforms.perspToOrtho.value=e}},pano0DepthMap:{get:function(){return this.uniforms.pano0DepthMap.value},set:function(e){this.uniforms.pano0DepthMap.value=e;var t=null!==e;t!==this.defines.USE_PANO0_DEPTH_MAP&&(this.defines.USE_PANO0_DEPTH_MAP=t,this.needsUpdate=!0)}},panoVideoMap:{get:function(){return this.uniforms.panoVideoMap.value},set:function(e){this.uniforms.panoVideoMap.value=e;var t=null!==e;t!==this.defines.USE_PANO_VIDEO_MAP&&(this.defines.USE_PANO_VIDEO_MAP=t,this.needsUpdate=!0)}},panoVideoSize:{get:function(){return this.uniforms.panoVideoSize.value.clone()},set:function(e){this.uniforms.panoVideoSize.value.copy(e)}},panoVideoMatrix:{get:function(){return this.uniforms.panoVideoMatrix.value.clone()},set:function(e){this.uniforms.panoVideoMatrix.value.copy(e)}},panoVideoAlpha:{get:function(){return this.uniforms.panoVideoAlpha.value},set:function(e){this.uniforms.panoVideoAlpha.value=e}},panoTileMap:{get:function(){return this.uniforms.panoTileMap.value},set:function(e){this.uniforms.panoTileMap.value=e;var t=null!==e;t!==this.defines.USE_TILE&&(this.defines.USE_TILE=t,this.needsUpdate=!0)}},panoTileMappings:{get:function(){var e=this.uniforms.panoTileClipMappings.value,t=this.uniforms.panoTileDrawAtMappings.value;if(null===e)return null;for(var i=[],n=0;n<e.length;n++)i[n]=[e[n].clone(),t[n].clone()];return i},set:function(e){var t=this.defines.TILE_MAPPING_LENGTH;if(null===e)this.uniforms.panoTileClipMappings.value=null,this.uniforms.panoTileDrawAtMappings.value=null;else{for(var i=[],n=[],r=0;r<e.length;r++)i[r]=e[r][0].clone(),n[r]=e[r][1].clone();this.uniforms.panoTileClipMappings.value=i,this.uniforms.panoTileDrawAtMappings.value=n}var s=null!==e?e.length:0;s!==t&&(this.defines.TILE_MAPPING_LENGTH=s,this.needsUpdate=!0)}}}),v.pano0Map=null!==(i=t.pano0Map)&&void 0!==i?i:lt,v.pano0Matrix=null!==(n=t.pano0Matrix)&&void 0!==n?n:new a.Matrix4,v.pano1Map=null!==(r=t.pano1Map)&&void 0!==r?r:lt,v.pano1Matrix=null!==(s=t.pano1Matrix)&&void 0!==s?s:new a.Matrix4,v.modelAlpha=null!==(o=t.modelAlpha)&&void 0!==o?o:1,v.progress=null!==(u=t.progress)&&void 0!==u?u:0,v.useBlackTransition=null!==(c=t.useBlackTransition)&&void 0!==c&&c,v.perspToOrtho=null!==(l=t.perspToOrtho)&&void 0!==l?l:0,v.opacity=null!==(h=t.opacity)&&void 0!==h?h:1,v.pano0DepthMap=null!==(d=t.pano0DepthMap)&&void 0!==d?d:null,v.panoVideoSize=null!==(p=t.panoVideoSize)&&void 0!==p?p:new a.Vector2,v.panoVideoMap=null!==(M=t.panoVideoMap)&&void 0!==M?M:null,v.panoVideoMatrix=null!==(f=t.panoVideoMatrix)&&void 0!==f?f:new a.Matrix4,v.panoVideoAlpha=null!==(g=t.panoVideoAlpha)&&void 0!==g?g:0,v.panoTileMap=null!==(A=t.panoTileMap)&&void 0!==A?A:null,v.panoTileMappings=null!==(y=t.panoTileMappings)&&void 0!==y?y:null,v}return t.__extends(i,e),i}(a.ShaderMaterial),pt=new a.Vector3(0,0,0),Mt=function(e){function i(t,i){void 0===i&&(i=pt);var n=e.call(this)||this,r=new a.BoxBufferGeometry(t.max.x-t.min.x+2*i.x,t.max.y-t.min.y+2*i.y,t.max.z-t.min.z+2*i.z,1,1);r.groups.length=0,r.groups.push({start:0,count:36,materialIndex:0}),r.applyMatrix4((new a.Matrix4).makeScale(-1,1,1));var s=new dt;s.defines.USE_MAP=!1,s.defines.USE_UV=!1,s.uniforms.diffuse.value=new a.Color(16777215);var o=new tt(r,[s]);return o.floorIndex=-1,o.position.copy(t.getCenter(new a.Vector3)),o.frustumCulled=!1,n.add(o),n}return t.__extends(i,e),i.prototype.dispose=function(){this.disposeMaterial(),this.disposeGeometry()},i}(nt);function ft(e,t){return void 0===t&&(t=pt),new Mt(e,t)}var gt,At,yt,vt,mt={};mt.EPSILON=1e-6,mt.BVHVector3=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0},mt.BVHVector3.prototype={constructor:mt.BVHVector3,copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},setFromArray:function(e,t){this.x=e[t],this.y=e[t+1],this.z=e[t+2]},add:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},cross:function(e){var t=this.x,i=this.y,n=this.z;return this.x=i*e.z-n*e.y,this.y=n*e.x-t*e.z,this.z=t*e.y-i*e.x,this},crossVectors:function(e,t){var i=e.x,n=e.y,r=e.z,s=t.x,o=t.y,a=t.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this},clone:function(){return new mt.BVHVector3(this.x,this.y,this.z)}},mt.BVH=function(e,t){this._trianglesArray=e,this._maxTrianglesPerNode=t||10,this._bboxArray=this.calcBoundingBoxes(e),this._bboxHelper=new Float32Array(this._bboxArray.length),this._bboxHelper.set(this._bboxArray);var i=e.length/9,n=this.calcExtents(0,i,mt.EPSILON);this._rootNode=new mt.BVHNode(n[0],n[1],0,i,0),this._nodesToSplit=[this._rootNode]},mt.BVH.prototype.splitNode=function(e){if(e){var t=0,i=function(){t++;var n=this._nodesToSplit.pop();n?(this._splitNode(n),t%255==0?setTimeout(i):i()):(t=0,e())}.bind(this);i()}else for(;this._nodesToSplit.length>0;)this._splitNode(this._nodesToSplit.pop())},mt.BVH.prototype.dispose=function(){this._trianglesArray=new Float32Array,this._bboxArray=new Float32Array,this._bboxHelper=new Float32Array,this._rootNode=null,this._nodesToSplit=null},mt.BVH.prototype.intersectRay=function(e,t,i){for(var n,r=[this._rootNode],s=[],o=[],a=new mt.BVHVector3(1/t.x,1/t.y,1/t.z);r.length>0;){var u=r.pop();if(mt.BVH.intersectNodeBox(e,a,u))for(u._node0&&r.push(u._node0),u._node1&&r.push(u._node1),n=u._startIndex;n<u._endIndex;n++)s.push(this._bboxArray[7*n])}var c=new mt.BVHVector3,l=new mt.BVHVector3,h=new mt.BVHVector3,d=new mt.BVHVector3(e.x,e.y,e.z),p=new mt.BVHVector3(t.x,t.y,t.z);for(n=0;n<s.length;n++){var M=s[n];c.setFromArray(this._trianglesArray,9*M),l.setFromArray(this._trianglesArray,9*M+3),h.setFromArray(this._trianglesArray,9*M+6);var f=mt.BVH.intersectRayTriangle(c,l,h,d,p,i);f&&o.push({triangle:[c.clone(),l.clone(),h.clone()],triangleIndex:M,intersectionPoint:f})}return o},mt.BVH.prototype.calcBoundingBoxes=function(e){for(var t,i,n,r,s,o,a,u,c,l,h,d,p,M,f,g=e.length/9,A=new Float32Array(7*g),y=0;y<g;y++)t=e[9*y],i=e[9*y+1],n=e[9*y+2],r=e[9*y+3],s=e[9*y+4],o=e[9*y+5],a=e[9*y+6],u=e[9*y+7],c=e[9*y+8],l=Math.min(Math.min(t,r),a),h=Math.min(Math.min(i,s),u),d=Math.min(Math.min(n,o),c),p=Math.max(Math.max(t,r),a),M=Math.max(Math.max(i,s),u),f=Math.max(Math.max(n,o),c),mt.BVH.setBox(A,y,y,l,h,d,p,M,f);return A},mt.BVH.prototype.calcExtents=function(e,t,i){if(i=i||0,e>=t)return[{x:0,y:0,z:0},{x:0,y:0,z:0}];for(var n=Number.MAX_VALUE,r=Number.MAX_VALUE,s=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=-Number.MAX_VALUE,u=-Number.MAX_VALUE,c=e;c<t;c++)n=Math.min(this._bboxArray[7*c+1],n),r=Math.min(this._bboxArray[7*c+2],r),s=Math.min(this._bboxArray[7*c+3],s),o=Math.max(this._bboxArray[7*c+4],o),a=Math.max(this._bboxArray[7*c+5],a),u=Math.max(this._bboxArray[7*c+6],u);return[{x:n-i,y:r-i,z:s-i},{x:o+i,y:a+i,z:u+i}]},mt.BVH.prototype._splitNode=function(e){if(!(e.elementCount()<=this._maxTrianglesPerNode||0===e.elementCount())){var t=e._startIndex,i=e._endIndex,n=[[],[],[]],r=[[],[],[]],s=[e.centerX(),e.centerY(),e.centerZ()],o=[e._extentsMax.x-e._extentsMin.x,e._extentsMax.y-e._extentsMin.y,e._extentsMax.z-e._extentsMin.z],a=[];a.length=3;for(var u=t;u<i;u++){a[0]=.5*(this._bboxArray[7*u+1]+this._bboxArray[7*u+4]),a[1]=.5*(this._bboxArray[7*u+2]+this._bboxArray[7*u+5]),a[2]=.5*(this._bboxArray[7*u+3]+this._bboxArray[7*u+6]);for(var c=0;c<3;c++)a[c]<s[c]?n[c].push(u):r[c].push(u)}var l=[];if(l.length=3,l[0]=0===n[0].length||0===r[0].length,l[1]=0===n[1].length||0===r[1].length,l[2]=0===n[2].length||0===r[2].length,!(l[0]&&l[1]&&l[2])){var h,d,p=[0,1,2];for(p.sort((function(e,t){return o[t]-o[e]})),c=0;c<3;c++){var M=p[c];if(!l[M]){h=n[M],d=r[M];break}}var f,g=t,A=g+h.length,y=A,v=i,m=e._startIndex,N=h.concat(d);for(u=0;u<N.length;u++)f=N[u],mt.BVH.copyBox(this._bboxArray,f,this._bboxHelper,m),m++;var D=this._bboxHelper.subarray(7*e._startIndex,7*e._endIndex);this._bboxArray.set(D,7*e._startIndex);var w=this.calcExtents(g,A,mt.EPSILON),T=this.calcExtents(y,v,mt.EPSILON),x=new mt.BVHNode(w[0],w[1],g,A,e._level+1),E=new mt.BVHNode(T[0],T[1],y,v,e._level+1);e._node0=x,e._node1=E,e.clearShapes(),this._nodesToSplit.push(x),this._nodesToSplit.push(E)}}},mt.BVH._calcTValues=function(e,t,i,n){var r={min:0,max:0};return n>=0?(r.min=(e-i)*n,r.max=(t-i)*n):(r.min=(t-i)*n,r.max=(e-i)*n),r},mt.BVH.intersectNodeBox=function(e,t,i){var n=mt.BVH._calcTValues(i._extentsMin.x,i._extentsMax.x,e.x,t.x),r=mt.BVH._calcTValues(i._extentsMin.y,i._extentsMax.y,e.y,t.y);if(n.min>r.max||r.min>n.max)return!1;(r.min>n.min||n.min!=n.min)&&(n.min=r.min),(r.max<n.max||n.max!=n.max)&&(n.max=r.max);var s=mt.BVH._calcTValues(i._extentsMin.z,i._extentsMax.z,e.z,t.z);return!(n.min>s.max||s.min>n.max)&&((s.min>n.min||n.min!=n.min)&&(n.min=s.min),(s.max<n.max||n.max!=n.max)&&(n.max=s.max),!(n.max<0))},mt.BVH.intersectRayTriangle=(gt=new mt.BVHVector3,At=new mt.BVHVector3,yt=new mt.BVHVector3,vt=new mt.BVHVector3,function(e,t,i,n,r,s){At.subVectors(t,e),yt.subVectors(i,e),vt.crossVectors(At,yt);var o,a=r.dot(vt);if(a>0){if(s)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}gt.subVectors(n,e);var u=o*r.dot(yt.crossVectors(gt,yt));if(u<0)return null;var c=o*r.dot(At.cross(gt));if(c<0)return null;if(u+c>a)return null;var l=-o*gt.dot(vt);if(l<0)return null;var h=l/a;return(new mt.BVHVector3).copy(r).multiplyScalar(h).add(n)}),mt.BVH.setBox=function(e,t,i,n,r,s,o,a,u){e[7*t]=i,e[7*t+1]=n,e[7*t+2]=r,e[7*t+3]=s,e[7*t+4]=o,e[7*t+5]=a,e[7*t+6]=u},mt.BVH.copyBox=function(e,t,i,n){i[7*n]=e[7*t],i[7*n+1]=e[7*t+1],i[7*n+2]=e[7*t+2],i[7*n+3]=e[7*t+3],i[7*n+4]=e[7*t+4],i[7*n+5]=e[7*t+5],i[7*n+6]=e[7*t+6]},mt.BVH.getBox=function(e,t,i){i.triangleId=e[7*t],i.minX=e[7*t+1],i.minY=e[7*t+2],i.minZ=e[7*t+3],i.maxX=e[7*t+4],i.maxY=e[7*t+5],i.maxZ=e[7*t+6]},mt.BVHNode=function(e,t,i,n,r){this._extentsMin=e,this._extentsMax=t,this._startIndex=i,this._endIndex=n,this._level=r,this._node0=null,this._node1=null},mt.BVHNode.prototype.elementCount=function(){return this._endIndex-this._startIndex},mt.BVHNode.prototype.centerX=function(){return.5*(this._extentsMin.x+this._extentsMax.x)},mt.BVHNode.prototype.centerY=function(){return.5*(this._extentsMin.y+this._extentsMax.y)},mt.BVHNode.prototype.centerZ=function(){return.5*(this._extentsMin.z+this._extentsMax.z)},mt.BVHNode.prototype.clearShapes=function(){this._startIndex=-1,this._endIndex=-1},mt.BVHNode.calcBoundingSphereRadius=function(e,t){var i=.5*(e.x+t.x),n=.5*(e.y+t.y),r=.5*(e.z+t.z),s=(i-e.x)*(i-e.x)+(n-e.y)*(n-e.y)+(r-e.z)*(r-e.z),o=(i-t.x)*(i-t.x)+(n-t.y)*(n-t.y)+(r-t.z)*(r-t.z);return Math.sqrt(Math.max(s,o))};var Nt=mt.BVH;var Dt,wt=(Dt="$$FIVE_EVENT$$","undefined"==typeof Symbol?"$Symbol<"+Dt+">$":Symbol(Dt));function Tt(e){return e[wt]||(e[wt]={}),e[wt]}var xt=function(){function e(){}return e.prototype.hasListener=function(e){var t=Tt(this);return t&&t[e]&&t[e].length>0},e.prototype.on=function(e,t,i){var n=this,r=Tt(this);return r[e]||(r[e]=[]),r[e].push([t,i||!1]),function(){return n.off(e,t)}},e.prototype.once=function(e,t){return this.on(e,t,!0)},e.prototype.off=function(e,t){if(void 0!==e){var i,n=Tt(this);if(n[e]||(n[e]=[]),void 0!==t){for(var r=0;r<n[e].length&&n[e][r][0]!==t;r++);r<n[e].length&&n[e].splice(r,1)}else n[e].length=0}else(i=this)[wt]||delete i[wt]},e.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];for(var n=!1,r=Tt(this),s=r[e]||[],o=0,a=s.slice();o<a.length;o++){var u=a[o],c=u[0],l=u[1],h=void 0!==l&&l,d=c.apply(void 0,t);h&&this.off(e,c),!1===d&&(n=!0)}return n},e}();function Et(e){Object.freeze(e);var t="function"==typeof e,i=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(e).forEach((function(n){!i.call(e,n)||t&&("caller"===n||"callee"===n||"arguments"===n)||null===e[n]||"object"!=typeof e[n]&&"function"!=typeof e[n]||Object.isFrozen(e[n])||Et(e[n])})),e}var jt=/^([^.]+)(\.([^.]+))*$/;function zt(e){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(e)}function It(e,t){return jt.test(e)&&function(e){if("*"===e)return/^(.+)$/i;var t="^"+e.split(".").map((function(e){return"*"===e?"([^.]+)":e})).join(".")+"$";return new RegExp(t,"i")}(e).test(t)}var bt=Et(JSON.parse(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}("h--/y|pnyu|/9--/xr;p|z/9-------/7;xr;p|z/9-------/7;7;xr;p|z/9--/yvn{wvn;p|z/9--/7;yvn{wvn;p|z/9--/7;7;yvn{wvn;p|z/9--/rnyrr;p|z/9--/7;rnyrr;p|z/9--/7;7;rnyrr;p|z/9--/rnyrr;p{/9---/7;rnyrr;p{/9---/7;7;rnyrr;p{/9--/uv;p|z/9--/7;uv;p|z/9--/7;7;uv;p|z/9--/uv;p{/9---/7;uv;p{/9---/7;7;uv;p{/9--/ywpq{;p|z/9----/7;ywpq{;p|z/9----/7;7;ywpq{;p|z/j"))),Lt=function(e){function i(t,i){var n=e.call(this,"[NETWORK]: response error(status: "+i+"): "+t)||this;return n.httpStatus=i,n}return t.__extends(i,e),i}(Error),St=function(e){function i(t){return e.call(this,"[NETWORK]: request abort: "+t)||this}return t.__extends(i,e),i}(Error),Ot=function(e){function i(t,i){return e.call(this,"[NETWORK]: request timeout("+i+"ms): "+t)||this}return t.__extends(i,e),i}(Error),Ct=function(e){function i(t,i){return e.call(this,"[NETWORK]: request forbidden: "+t+", "+i)||this}return t.__extends(i,e),i}(Error);var Pt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(i,e),i}(xt);function kt(e,t,i,n){void 0===t&&(t={}),void 0===i&&(i=He),void 0===n&&(n=He);var r,s=t.allowHosts?bt.concat(t.allowHosts):bt.slice(),o=(r=e.match(/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/))?r[2]:location.hostname;if(0!==location.hostname.length&&!zt(location.hostname)&&0===bt.filter((function(e){return It(e,location.hostname)})).length&&!zt(o)&&0===s.filter((function(e){return It(e,o)})).length){var a=He,u=new Ct(e,"request host("+o+") is not allowed");return Xe((function(){var n;i(u,null),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"forbidden",u.message)})),{abort:a}}var c=function(e){for(var t=0,i=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i];t<i.length;t++){var n=i[t],r=e.match(n);if(r)return"jsonp_"+r[1]}return null}(e);if(c){var l=window,h=null,d=!1,p=Ke(),M=document.createElement("script");return l[c]=function(n){var r,s=Ke(),o=s-p;if(delete l[c],M.parentNode&&M.parentNode.removeChild(M),null!==h&&(window.clearTimeout(h),h=null),!0!==d){if(0!==n.indexOf("data:")){var a=new Lt(e,500);return i(a,null),void(null===(r=t.networkSubscribe)||void 0===r||r.emit("network",e,"error",a.message))}var u=n.split(","),f=(u[0].match(/:(.*?);/)||[])[1],g=u[1];if("arraybuffer"===t.responseType||"blob"===t.responseType){for(var A=atob(u[1]),y=A.length,v=new Uint8Array(y),m=0;m<y;m++)v[m]=A.charCodeAt(m);g="arraybuffer"===t.responseType?v.buffer:new Blob([v],{type:f})}var N={body:g,meta:{source:e,requestTime:p,responseTime:s,costs:o,headers:{}}};Xe((function(){var n;i(null,N),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"ok",JSON.stringify(N.meta))})),d=!0}},M.src=e,document.body.appendChild(M),"number"==typeof t.timeout&&(h=window.setTimeout((function(){var n;if(h=null,!0!==d){var r=new Ot(e,t.timeout||NaN);i(r,null),d=!0,null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"timeout",r.message)}}),t.timeout)),{abort:function(){var n;if(delete l[c],M.parentNode&&M.parentNode.removeChild(M),null!==h&&(window.clearTimeout(h),h=null),!0!==d){var r=new St(e);i(r,null),d=!0,null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"abort",r.message)}}}}var f=Ke(),g=!1,A=new XMLHttpRequest,y=function(){A&&(A.removeEventListener("timeout",v,!1),A.removeEventListener("progress",m,!1),A.removeEventListener("abort",N,!1),A.removeEventListener("load",D,!1),A.removeEventListener("error",w,!1)),A=null,y=He},v=function(){var n,r=new Ot(e,t.timeout||NaN);i(r,null),g=!0,y(),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"timeout",r.message)},m=function(e){if(!0!==g&&e.lengthComputable){var t=e.loaded,i=e.total;n(t/i,t,i)}},N=function(){var n;if(!0!==g){var r=new St(e);i(r,null),g=!0,y(),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"abort",r.message)}},D=function(){var n,r=Ke(),s=r-f,o=function(e){if(!e)return{};for(var t={},i=e.trim().split("\n"),n=0;n<i.length;n++){var r=i[n],s=r.indexOf(":"),o=r.slice(0,s).trim().toLowerCase(),a=r.slice(s+1).trim();a&&(t[o]?t[o]+=", "+a:t[o]=a)}return t}(this.getAllResponseHeaders()),a={body:this.response,meta:{source:e,requestTime:f,responseTime:r,costs:s,headers:o}};i(null,a),g=!0,y(),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"ok",JSON.stringify(a.meta))},w=function(){var n,r=new Lt(e,this.status);i(r,null),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"error",r.message),g=!0,y()};return A.addEventListener("timeout",v,!1),A.addEventListener("progress",m,!1),A.addEventListener("abort",N,!1),A.addEventListener("load",D,!1),A.addEventListener("error",w,!1),t.responseType&&(A.responseType=t.responseType),"number"==typeof t.timeout&&(A.timeout=t.timeout),A.open("GET",e,!0),A.send(null),{abort:N}}kt.async=function(e,t){return new Promise((function(i,n){kt(e,t,(function(e,t){e?n(e):i(t)}))}))};var Ut={};function Bt(e,t){if(void 0===t&&(t={}),"function"==typeof t.transform)return t.transform(e,t);if(e.indexOf("//vrlab-public.ljcdn.com")>=0&&(/\.basis(\?|$)/.test(e)&&!0!==t.basisLoaderInitialized&&(e=e.replace(/\.basis(\?|$)/,".jpg$1")),/\.(jpg|png)$/.test(e))){var i=t.size,n=t.quality,r=t.format;if(i||n||r){var s="?imageMogr2";n&&(s+="/quality/"+n),i&&(s+="/thumbnail/"+i+"x"),r&&(s+="/format/"+r),e=e.replace("//vrlab-public.ljcdn.com","//vrlab-image4.ljcdn.com")+s}}return e}var _t=function(){function e(e){void 0===e&&(e={}),this.allowHosts=e.allowHosts,this.networkSubscribe=e.networkSubscribe}return e.prototype.load=function(e,t,i,n){return void 0===t&&(t=He),void 0===i&&(i=He),void 0===n&&(n=He),this.loadToImage(at(),e,t,i,n)},e.prototype.loadToImage=function(e,t,i,n,r){if(void 0===i&&(i=He),void 0===r&&(r=He),e.src)throw new Error("image is loaded");var s={responseType:"blob",allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe};kt(t,s,(function(n,s){n?r(n):(e.onload=function(){i(e),e.onload=e.onerror=function(){}},e.onerror=function(){r(new Error("image parse error "+t)),e.onload=e.onerror=function(){}},e.src=URL.createObjectURL(s.body))}))},e}(),Rt=null,Qt=!1,Yt=[];function Ft(e){if(void 0===e&&(e=!1),e||!Qt)if(Rt)Qt=!1;else{Qt=!0;var t=Yt.shift();if(t){try{t()}catch(e){}Xe((function(){return Ft(!0)}))}else Qt=!1}}function Vt(){Rt=null,Ft()}function Ht(){(Rt||0!==Yt.length)&&(Rt&&clearTimeout(Rt),Rt=window.setTimeout(Vt,200))}function Gt(e){return new Promise((function(t){Yt.push((function(){return t(e())})),Ft()}))}var qt,Wt={computeTangents:function(e){var t=e.index,i=e.attributes;if(null!==t&&void 0!==i.position&&void 0!==i.normal&&void 0!==i.uv){var n=t.array,r=i.position.array,s=i.normal.array,o=i.uv.array,u=r.length/3;void 0===i.tangent&&e.setAttribute("tangent",new a.BufferAttribute(new Float32Array(4*u),4));for(var c=i.tangent.array,l=[],h=[],d=0;d<u;d++)l[d]=new a.Vector3,h[d]=new a.Vector3;var p=new a.Vector3,M=new a.Vector3,f=new a.Vector3,g=new a.Vector2,A=new a.Vector2,y=new a.Vector2,v=new a.Vector3,m=new a.Vector3,N=e.groups;0===N.length&&(N=[{start:0,count:n.length}]);d=0;for(var D=N.length;d<D;++d)for(var w=O=(S=N[d]).start,T=O+S.count;w<T;w+=3)C(n[w+0],n[w+1],n[w+2]);var x,E,j,z=new a.Vector3,I=new a.Vector3,b=new a.Vector3,L=new a.Vector3;for(d=0,D=N.length;d<D;++d){var S,O;for(w=O=(S=N[d]).start,T=O+S.count;w<T;w+=3)P(n[w+0]),P(n[w+1]),P(n[w+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function C(e,t,i){p.fromArray(r,3*e),M.fromArray(r,3*t),f.fromArray(r,3*i),g.fromArray(o,2*e),A.fromArray(o,2*t),y.fromArray(o,2*i);var n=M.x-p.x,s=f.x-p.x,a=M.y-p.y,u=f.y-p.y,c=M.z-p.z,d=f.z-p.z,N=A.x-g.x,D=y.x-g.x,w=A.y-g.y,T=y.y-g.y,x=1/(N*T-D*w);v.set((T*n-w*s)*x,(T*a-w*u)*x,(T*c-w*d)*x),m.set((N*s-D*n)*x,(N*u-D*a)*x,(N*d-D*c)*x),l[e].add(v),l[t].add(v),l[i].add(v),h[e].add(m),h[t].add(m),h[i].add(m)}function P(e){b.fromArray(s,3*e),L.copy(b),E=l[e],z.copy(E),z.sub(b.multiplyScalar(b.dot(E))).normalize(),I.crossVectors(L,E),j=I.dot(h[e]),x=j<0?-1:1,c[4*e]=z.x,c[4*e+1]=z.y,c[4*e+2]=z.z,c[4*e+3]=x}},mergeBufferGeometries:function(e,t){for(var i=null!==e[0].index,n=new Set(Object.keys(e[0].attributes)),r=new Set(Object.keys(e[0].morphAttributes)),s={},o={},u=new a.BufferGeometry,c=0,l=0;l<e.length;++l){var h=e[l];if(i!==(null!==h.index))return null;for(var d in h.attributes){if(!n.has(d))return null;void 0===s[d]&&(s[d]=[]),s[d].push(h.attributes[d])}for(var d in h.morphAttributes){if(!r.has(d))return null;void 0===o[d]&&(o[d]=[]),o[d].push(h.morphAttributes[d])}if(u.userData.mergedUserData=u.userData.mergedUserData||[],u.userData.mergedUserData.push(h.userData),t){var p;if(i)p=h.index.count;else{if(void 0===h.attributes.position)return null;p=h.attributes.position.count}u.addGroup(c,p,l),c+=p}}if(i){var M=0,f=[];for(l=0;l<e.length;++l){for(var g=e[l].index,A=0;A<g.count;++A)f.push(g.getX(A)+M);M+=e[l].attributes.position.count}u.setIndex(f)}for(var d in s){var y=this.mergeBufferAttributes(s[d]);if(!y)return null;u.setAttribute(d,y)}for(var d in o){var v=o[d][0].length;if(0===v)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[d]=[];for(l=0;l<v;++l){var m=[];for(A=0;A<o[d].length;++A)m.push(o[d][A][l]);var N=this.mergeBufferAttributes(m);if(!N)return null;u.morphAttributes[d].push(N)}}return u},mergeBufferAttributes:function(e){for(var t,i,n,r=0,s=0;s<e.length;++s){var o=e[s];if(o.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return null;if(void 0===i&&(i=o.itemSize),i!==o.itemSize)return null;if(void 0===n&&(n=o.normalized),n!==o.normalized)return null;r+=o.array.length}var u=new t(r),c=0;for(s=0;s<e.length;++s)u.set(e[s].array,c),c+=e[s].array.length;return new a.BufferAttribute(u,i,n)},interleaveAttributes:function(e){for(var t,i=0,n=0,r=0,s=e.length;r<s;++r){var o=e[r];if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;i+=o.array.length,n+=o.itemSize}var u=new a.InterleavedBuffer(new t(i),n),c=0,l=[],h=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"],p=0;for(s=e.length;p<s;p++){var M=(o=e[p]).itemSize,f=o.count,g=new a.InterleavedBufferAttribute(u,M,c,o.normalized);l.push(g),c+=M;for(var A=0;A<f;A++)for(var y=0;y<M;y++)g[d[y]](A,o[h[y]](A))}return l},estimateBytesUsed:function(e){var t=0;for(var i in e.attributes){var n=e.getAttribute(i);t+=n.count*n.itemSize*n.array.BYTES_PER_ELEMENT}var r=e.getIndex();return t+=r?r.count*r.itemSize*r.array.BYTES_PER_ELEMENT:0},mergeVertices:function(e,t){void 0===t&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var i={},n=e.getIndex(),r=e.getAttribute("position"),s=n?n.count:r.count,o=0,u=Object.keys(e.attributes),c={},l={},h=[],d=["getX","getY","getZ","getW"],p=0,M=u.length;p<M;p++){c[m=u[p]]=[],(T=e.morphAttributes[m])&&(l[m]=new Array(T.length).fill().map((function(){return[]})))}var f=Math.log10(1/t),g=Math.pow(10,f);for(p=0;p<s;p++){var A=n?n.getX(p):p,y="",v=0;for(M=u.length;v<M;v++)for(var m=u[v],N=(w=e.getAttribute(m)).itemSize,D=0;D<N;D++)y+=~~(w[d[D]](A)*g)+",";if(y in i)h.push(i[y]);else{for(v=0,M=u.length;v<M;v++){m=u[v];var w=e.getAttribute(m),T=e.morphAttributes[m],x=(N=w.itemSize,c[m]),E=l[m];for(D=0;D<N;D++){var j=d[D];if(x.push(w[j](A)),T)for(var z=0,I=T.length;z<I;z++)E[z].push(T[z][j](A))}}i[y]=o,h.push(o),o++}}var b=e.clone();for(p=0,M=u.length;p<M;p++){m=u[p];var L=e.getAttribute(m),S=new L.array.constructor(c[m]);w=new a.BufferAttribute(S,L.itemSize,L.normalized);if(b.setAttribute(m,w),m in l)for(v=0;v<l[m].length;v++){var O=e.morphAttributes[m][v],C=(S=new O.array.constructor(l[m][v]),new a.BufferAttribute(S,O.itemSize,O.normalized));b.morphAttributes[m][v]=C}}return b.setIndex(h),b}};var Kt='\nvar config, transcoderPending, _BasisFile;\nself.onmessage = function(e) {\n var message = e.data;\n switch (message.type) {\n case "init":\n config = message.config;\n init(message.transcoderBinary);\n break;\n case "transcode":\n transcoderPending.then(function() {\n try {\n var result = transcode(message.buffer);\n var width = result.width;\n var height = result.height;\n var hasAlpha = result.hasAlpha;\n var mipmaps = result.mipmaps;\n var format = result.format;\n var buffers = [];\n for (var i = 0; i < mipmaps.length; ++i) {\n buffers.push(mipmaps[i].data.buffer);\n }\n self.postMessage({ type: "transcode", id: message.id, width, height, hasAlpha, mipmaps, format }, buffers);\n } catch (error) {\n console.error(error);\n self.postMessage({ type: "error", id: message.id, error: error.message });\n }\n });\n break;\n default: break;\n }\n};\n\nfunction init(wasmBinary) {\n var BasisModule;\n transcoderPending = new Promise(function(resolve) {\n BasisModule = { wasmBinary, onRuntimeInitialized: resolve };\n BASIS(BasisModule); // eslint-disable-line no-undef\n }).then(function() {\n _BasisFile = BasisModule.BasisFile;\n BasisModule.initializeBasis();\n self.postMessage({ type: "initialized" });\n });\n}\n\nfunction transcode(buffer) {\n var basisFile = new _BasisFile(new Uint8Array(buffer));\n var width = basisFile.getImageWidth(0, 0);\n var height = basisFile.getImageHeight(0, 0);\n var levels = basisFile.getNumLevels(0);\n var hasAlpha = basisFile.getHasAlpha();\n function cleanup() {\n basisFile.close();\n basisFile.delete();\n }\n if (!hasAlpha) {\n switch (config.format) {\n case 9: // Hardcoded: BasisTextureLoader.BASIS_FORMAT.cTFPVRTC1_4_RGBA\n config.format = 8; // Hardcoded: BasisTextureLoader.BASIS_FORMAT.cTFPVRTC1_4_RGB;\n break;\n default: break;\n }\n }\n if (!width || !height || !levels) {\n cleanup();\n throw new Error("BasisTextureLoader: Invalid .basis file");\n }\n if (!basisFile.startTranscoding()) {\n cleanup();\n throw new Error("BasisTextureLoader: .startTranscoding failed");\n }\n var mipmaps = [];\n for (var mip = 0; mip < levels; mip++) {\n var mipWidth = basisFile.getImageWidth(0, mip);\n var mipHeight = basisFile.getImageHeight(0, mip);\n var dst = new Uint8Array(basisFile.getImageTranscodedSizeInBytes(0, mip, config.format));\n var status = basisFile.transcodeImage(dst, 0, mip, config.format, 0, hasAlpha);\n if (!status) {\n cleanup();\n throw new Error("BasisTextureLoader: .transcodeImage failed.");\n }\n mipmaps.push({ data: dst, width: mipWidth, height: mipHeight });\n }\n cleanup();\n return { width, height, hasAlpha, mipmaps, format: config.format };\n}\n',Zt={cTFETC1:0,cTFETC2:1,cTFBC1:2,cTFBC3:3,cTFBC4:4,cTFBC5:5,cTFBC7_M6_OPAQUE_ONLY:6,cTFBC7_M5:7,cTFPVRTC1_4_RGB:8,cTFPVRTC1_4_RGBA:9,cTFASTC_4x4:10,cTFATC_RGB:11,cTFATC_RGBA_INTERPOLATED_ALPHA:12,cTFRGBA32:13,cTFRGB565:14,cTFBGR565:15,cTFRGBA4444:16},Xt={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779},Jt=((qt={})[Zt.cTFBC1]=Xt.COMPRESSED_RGB_S3TC_DXT1_EXT,qt[Zt.cTFBC3]=Xt.COMPRESSED_RGBA_S3TC_DXT5_EXT,qt),$t=function(e){function i(t){void 0===t&&(t={});var i=e.call(this)||this;return i.allowHosts=t.allowHosts,i.networkSubscribe=t.networkSubscribe,i}return t.__extends(i,e),i.setTranscoderPath=function(e){return this.transcoderPath=e,this},i.setWorkerLimit=function(e){return this.workerLimit=e,this},i.isInitialized=function(){return 0!==this.workerPool.filter((function(e){return e._initialized})).length},i.detectSupport=function(e){var t=this.workerConfig;if(t.astcSupported=!!e.extensions.get("WEBGL_compressed_texture_astc"),t.bptcSupported=!!e.extensions.get("EXT_texture_compression_bptc"),t.etcSupported=!!e.extensions.get("WEBGL_compressed_texture_etc1"),t.dxtSupported=!!e.extensions.get("WEBGL_compressed_texture_s3tc"),t.pvrtcSupported=!!e.extensions.get("WEBGL_compressed_texture_pvrtc")||!!e.extensions.get("WEBKIT_WEBGL_compressed_texture_pvrtc"),t.astcSupported)t.format=i.BASIS_FORMAT.cTFASTC_4x4;else if(t.bptcSupported)t.format=i.BASIS_FORMAT.cTFBC7_M5;else if(t.dxtSupported)t.format=i.BASIS_FORMAT.cTFBC3;else if(t.pvrtcSupported)t.format=i.BASIS_FORMAT.cTFPVRTC1_4_RGBA;else{if(!t.etcSupported)throw new Error("BasisTextureLoader: No suitable compressed texture format found.");t.format=i.BASIS_FORMAT.cTFETC1}return this},i.prototype.load=function(e,t,n,r){return kt(e,{responseType:"arraybuffer",allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe},(function(n,s){if(n)r(n);else{var o=function(e){return t(e,s.meta)},a=s.body;if(i.taskCache.has(a))return i.taskCache.get(a).promise.then(o).catch(r);i._createTexture(a,e).then(o).catch(r)}}),n)},i._createTexture=function(e,t){var n,r,s=this,o=e.byteLength,u=this._allocateWorker(o).then((function(t){return n=t,r=s.workerNextTaskID++,new Promise((function(t,i){n._callbacks[r]={resolve:t,reject:i},n.postMessage({type:"transcode",id:r,buffer:e},[e])}))})).then((function(e){var t,i=s.workerConfig,n=e.width,r=e.height,o=e.mipmaps;switch(e.format){case Zt.cTFASTC_4x4:t=new a.CompressedTexture(o,n,r,a.RGBA_ASTC_4x4_Format);break;case Zt.cTFBC1:case Zt.cTFBC3:t=new a.CompressedTexture(o,n,r,Jt[i.format],a.UnsignedByteType);break;case Zt.cTFETC1:t=new a.CompressedTexture(o,n,r,a.RGB_ETC1_Format);break;case Zt.cTFPVRTC1_4_RGB:t=new a.CompressedTexture(o,n,r,a.RGB_PVRTC_4BPPV1_Format);break;case Zt.cTFPVRTC1_4_RGBA:t=new a.CompressedTexture(o,n,r,a.RGBA_PVRTC_4BPPV1_Format);break;default:throw new Error("BasisTextureLoader: No supported format available.")}return t.minFilter=1===o.length?a.LinearFilter:a.LinearMipmapLinearFilter,t.magFilter=a.LinearFilter,t.generateMipmaps=!1,t.needsUpdate=!0,t}));return u.catch((function(){return!0})).then((function(){n&&r&&(n._taskLoad-=o,delete n._callbacks[r])})),i.taskCache.set(e,{url:t,promise:u}),u},i._initTranscoder=function(){var e=this;if(!this.transcoderPending){var t=new a.FileLoader;t.setPath(this.transcoderPath);var i=new Promise((function(e,i){t.load("basis_transcoder.js",e,void 0,i)})),n=new a.FileLoader;n.setPath(this.transcoderPath),n.setResponseType("arraybuffer");var r=new Promise((function(e,t){n.load("basis_transcoder.wasm",e,void 0,t)}));this.transcoderPending=Promise.all([i,r]).then((function(t){var i=t[0],n=t[1],r=["/* basis_transcoder.js */",i,"/* worker */",Kt].join("\n");e.workerSourceURL=URL.createObjectURL(new Blob([r])),e.transcoderBinary=n}))}return this.transcoderPending},i._allocateWorker=function(e){var t=this;return this._initTranscoder().then((function(){if(t.workerPool.length<t.workerLimit){var i=function(e){var t=new Worker(e);return Object.assign(t,{_callbacks:{},_initialized:!1,_taskLoad:0})}(t.workerSourceURL);i._callbacks={},i._initialized=!1,i._taskLoad=0,i.postMessage({type:"init",config:t.workerConfig,transcoderBinary:t.transcoderBinary}),i.onmessage=function(e){var t=e.data;switch(t.type){case"initialized":i._initialized=!0,console.log("BasisTextureLoader: basis loader initialized");break;case"transcode":i._callbacks[t.id].resolve(t);break;case"error":i._callbacks[t.id].reject(t);break;default:console.error('BasisTextureLoader: Unexpected message, "'+t.type+'"')}},t.workerPool.push(i)}else t.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));var n=t.workerPool[t.workerPool.length-1];return n._taskLoad+=e,n}))},i.prototype.dispose=function(){for(var e=0;e<i.workerPool.length;e++)i.workerPool[e].terminate();return i.workerPool.length=0,this},i.taskCache=new WeakMap,i.BASIS_FORMAT=Zt,i.DXT_FORMAT=Xt,i.DXT_FORMAT_MAP=Jt,i.transcoderPath="https://vrlab-public.ljcdn.com/release/static/image/release/five/basis/",i.transcoderBinary=null,i.transcoderPending=null,i.workerLimit=1,i.workerPool=[],i.workerNextTaskID=1,i.workerSourceURL="",i.workerConfig={format:null,astcSupported:!1,bptcSupported:!1,etcSupported:!1,dxtSupported:!1,pvrtcSupported:!1},i}(a.Loader),ei=(new a.Matrix4).set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);function ti(e,t){return new a.BufferAttribute(e,t)}function ii(e){var t=e.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function ni(e){var t=e.indices,i=e.vertices,n=e.uvs,r=new a.BufferGeometry;return r.setIndex(ti(new Uint32Array(t),1)),r.setAttribute("position",ti(new Float32Array(i),3)),Ve(n)||r.setAttribute("uv",ti(new Float32Array(n),2)),r.applyMatrix4(ei),r.computeVertexNormals(),r}function ri(e,t,i,n){var r=$t.isInitialized();e=Bt(e,Object.assign({key:"texture",basisLoaderInitialized:r},t));var s=new $t({allowHosts:i,networkSubscribe:n});if(/\.basis(\?|$)/.test(e)){var o={sourceFile:e,needsUpdate:!0,wrapS:a.ClampToEdgeWrapping,wrapT:a.ClampToEdgeWrapping,minFilter:a.LinearFilter};return new Promise((function(t,i){s.load(e,(function(e){t(Object.assign(e,o))}),(function(){}),(function(e){i(e)}))}))}var u={sourceFile:e,needsUpdate:!0,wrapS:a.ClampToEdgeWrapping,wrapT:a.ClampToEdgeWrapping,minFilter:a.LinearFilter},c=new _t({allowHosts:i,networkSubscribe:n});return new Promise((function(t,i){c.load(e,(function(e){var i=new a.Texture(e),n=i.dispose;i.dispose=function(){n.call(i),/^blob\:/.test(e.src)&&URL.revokeObjectURL(e.src)},t(Object.assign(i,u))}),He,(function(e){return i(e)}))}))}function si(e){var t=new dt;return e.catch((function(){return null})).then((function(e){t.uniforms.map.value=e,t.uniforms.exposure.value=3.3})),t}var oi=u.parse("\nmessage Model {\n repeated Chunk chunks = 1;\n}\nmessage Chunk {\n required Vertices vertices = 1;\n required Faces faces = 2;\n required string name = 3;\n optional string texture = 4;\n}\nmessage Vertices {\n repeated float xyz = 1 [packed=true];\n repeated float uvs = 2 [packed=true];\n}\nmessage Faces {\n repeated uint32 indices = 1 [packed=true];\n}\n").root.lookup("Model");function ai(e,t,i,n,r,s,o){void 0===r&&(r={});for(var u=0,c=e;u<c.length;u++){var l=c[u];l.chunkName=(h=l.name,d=void 0,(d=h.match(/(chunk)-?(\d+)/))?parseInt(d[2],10):0),l.floorName=ii(l.name),l.texture&&(l.texture=i[l.chunkName]=i[l.chunkName]||t+l.texture)}var h,d;e.sort((function(e,t){return 1e3*e.floorName+e.chunkName-(1e3*t.floorName+t.chunkName)}));var p=[],M=[],f=Promise.resolve();return(f=(f=f.then((function(){return Gt((function(){for(var t=0;t<e.length;t++){var i=e[t],u=ii(i.name),c=p[u]=p[u]||{geometries:[],materials:[]},l=ni({vertices:i.vertices.xyz,uvs:i.vertices.uvs,indices:i.faces.indices});if(l.name="model_geo_chunk_"+t,c.geometries.push(l),i.texture){(h=si(i.texture in r?r[i.texture]:r[i.texture]=ri(i.texture,n,s,o))).name="model_mtl_chunk_"+t,c.materials.push(h)}else{var h;(h=new dt).defines.USE_MAP=!1,h.uniforms.color.value=new a.Color(16777215),h.name="model_mtl_chunk_"+t,c.materials.push(h)}}}))}))).then((function(){return Gt((function(){for(var e=0;e<p.length;e++){var t=p[e];if(t){var i=Wt.mergeBufferGeometries(t.geometries,!0);t.geometries.forEach((function(e){return e.dispose()}));var n=new tt(i,t.materials);n.floorIndex=e,n.name="model_floor_"+e,M.push(n)}}}))}))).then((function(){var e=Object.keys(r).map((function(e){return r[e].then((function(){}))}));return Promise.all(e).then((function(){return M}))}))}function ui(e,t){return!1!==(e=Object.assign({},e)).autoResize&&(t>96?e.size=Math.min(e.size||1/0,100):t>48?e.size=Math.min(e.size||1/0,200):t>24?e.size=Math.min(e.size||1/0,400):t>12&&(e.size=Math.min(e.size||1/0,800))),e}var ci={OutWindow:function(){this._windowSize=0}};ci.OutWindow.prototype.create=function(e){this._buffer&&this._windowSize===e||(this._buffer=[]),this._windowSize=e,this._pos=0,this._streamPos=0},ci.OutWindow.prototype.flush=function(){var e=this._pos-this._streamPos;if(0!==e){for(;e--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},ci.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},ci.OutWindow.prototype.setStream=function(e){this.releaseStream(),this._stream=e},ci.OutWindow.prototype.init=function(e){e||(this._streamPos=0,this._pos=0)},ci.OutWindow.prototype.copyBlock=function(e,t){var i=this._pos-e-1;for(i<0&&(i+=this._windowSize);t--;)i>=this._windowSize&&(i=0),this._buffer[this._pos++]=this._buffer[i++],this._pos>=this._windowSize&&this.flush()},ci.OutWindow.prototype.putByte=function(e){this._buffer[this._pos++]=e,this._pos>=this._windowSize&&this.flush()},ci.OutWindow.prototype.getByte=function(e){var t=this._pos-e-1;return t<0&&(t+=this._windowSize),this._buffer[t]},ci.RangeDecoder=function(){},ci.RangeDecoder.prototype.setStream=function(e){this._stream=e},ci.RangeDecoder.prototype.releaseStream=function(){this._stream=null},ci.RangeDecoder.prototype.init=function(){var e=5;for(this._code=0,this._range=-1;e--;)this._code=this._code<<8|this._stream.readByte()},ci.RangeDecoder.prototype.decodeDirectBits=function(e){for(var t,i=0,n=e;n--;)this._range>>>=1,t=this._code-this._range>>>31,this._code-=this._range&t-1,i=i<<1|1-t,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return i},ci.RangeDecoder.prototype.decodeBit=function(e,t){var i=e[t],n=(this._range>>>11)*i;return(2147483648^this._code)<(2147483648^n)?(this._range=n,e[t]+=2048-i>>>5,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=n,this._code-=n,e[t]-=i>>>5,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},ci.initBitModels=function(e,t){for(;t--;)e[t]=1024},ci.BitTreeDecoder=function(e){this._models=[],this._numBitLevels=e},ci.BitTreeDecoder.prototype.init=function(){ci.initBitModels(this._models,1<<this._numBitLevels)},ci.BitTreeDecoder.prototype.decode=function(e){for(var t=1,i=this._numBitLevels;i--;)t=t<<1|e.decodeBit(this._models,t);return t-(1<<this._numBitLevels)},ci.BitTreeDecoder.prototype.reverseDecode=function(e){for(var t,i=1,n=0,r=0;r<this._numBitLevels;++r)i=i<<1|(t=e.decodeBit(this._models,i)),n|=t<<r;return n},ci.reverseDecode2=function(e,t,i,n){for(var r,s=1,o=0,a=0;a<n;++a)s=s<<1|(r=i.decodeBit(e,t+s)),o|=r<<a;return o},ci.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new ci.BitTreeDecoder(8),this._numPosStates=0},ci.LenDecoder.prototype.create=function(e){for(;this._numPosStates<e;++this._numPosStates)this._lowCoder[this._numPosStates]=new ci.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new ci.BitTreeDecoder(3)},ci.LenDecoder.prototype.init=function(){var e=this._numPosStates;for(ci.initBitModels(this._choice,2);e--;)this._lowCoder[e].init(),this._midCoder[e].init();this._highCoder.init()},ci.LenDecoder.prototype.decode=function(e,t){return 0===e.decodeBit(this._choice,0)?this._lowCoder[t].decode(e):0===e.decodeBit(this._choice,1)?8+this._midCoder[t].decode(e):16+this._highCoder.decode(e)},ci.Decoder2=function(){this._decoders=[]},ci.Decoder2.prototype.init=function(){ci.initBitModels(this._decoders,768)},ci.Decoder2.prototype.decodeNormal=function(e){var t=1;do{t=t<<1|e.decodeBit(this._decoders,t)}while(t<256);return 255&t},ci.Decoder2.prototype.decodeWithMatchByte=function(e,t){var i,n,r=1;do{if(i=t>>7&1,t<<=1,r=r<<1|(n=e.decodeBit(this._decoders,(1+i<<8)+r)),i!==n){for(;r<256;)r=r<<1|e.decodeBit(this._decoders,r);break}}while(r<256);return 255&r},ci.LiteralDecoder=function(){},ci.LiteralDecoder.prototype.create=function(e,t){var i;if(!this._coders||this._numPrevBits!==t||this._numPosBits!==e)for(this._numPosBits=e,this._posMask=(1<<e)-1,this._numPrevBits=t,this._coders=[],i=1<<this._numPrevBits+this._numPosBits;i--;)this._coders[i]=new ci.Decoder2},ci.LiteralDecoder.prototype.init=function(){for(var e=1<<this._numPrevBits+this._numPosBits;e--;)this._coders[e].init()},ci.LiteralDecoder.prototype.getDecoder=function(e,t){return this._coders[((e&this._posMask)<<this._numPrevBits)+((255&t)>>>8-this._numPrevBits)]},ci.Decoder=function(){this._outWindow=new ci.OutWindow,this._rangeDecoder=new ci.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new ci.BitTreeDecoder(4),this._lenDecoder=new ci.LenDecoder,this._repLenDecoder=new ci.LenDecoder,this._literalDecoder=new ci.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new ci.BitTreeDecoder(6),this._posSlotDecoder[1]=new ci.BitTreeDecoder(6),this._posSlotDecoder[2]=new ci.BitTreeDecoder(6),this._posSlotDecoder[3]=new ci.BitTreeDecoder(6)},ci.Decoder.prototype.setDictionarySize=function(e){return!(e<0)&&(this._dictionarySize!==e&&(this._dictionarySize=e,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},ci.Decoder.prototype.setLcLpPb=function(e,t,i){var n=1<<i;return!(e>8||t>4||i>4)&&(this._literalDecoder.create(t,e),this._lenDecoder.create(n),this._repLenDecoder.create(n),this._posStateMask=n-1,!0)},ci.Decoder.prototype.init=function(){var e=4;for(this._outWindow.init(!1),ci.initBitModels(this._isMatchDecoders,192),ci.initBitModels(this._isRep0LongDecoders,192),ci.initBitModels(this._isRepDecoders,12),ci.initBitModels(this._isRepG0Decoders,12),ci.initBitModels(this._isRepG1Decoders,12),ci.initBitModels(this._isRepG2Decoders,12),ci.initBitModels(this._posDecoders,114),this._literalDecoder.init();e--;)this._posSlotDecoder[e].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},ci.Decoder.prototype.decode=function(e,t,i){var n,r,s,o,a,u,c=0,l=0,h=0,d=0,p=0,M=0,f=0;for(this._rangeDecoder.setStream(e),this._outWindow.setStream(t),this.init();i<0||M<i;)if(n=M&this._posStateMask,0===this._rangeDecoder.decodeBit(this._isMatchDecoders,(c<<4)+n))r=this._literalDecoder.getDecoder(M++,f),f=c>=7?r.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(l)):r.decodeNormal(this._rangeDecoder),this._outWindow.putByte(f),c=c<4?0:c-(c<10?3:6);else{if(1===this._rangeDecoder.decodeBit(this._isRepDecoders,c))s=0,0===this._rangeDecoder.decodeBit(this._isRepG0Decoders,c)?0===this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(c<<4)+n)&&(c=c<7?9:11,s=1):(0===this._rangeDecoder.decodeBit(this._isRepG1Decoders,c)?o=h:(0===this._rangeDecoder.decodeBit(this._isRepG2Decoders,c)?o=d:(o=p,p=d),d=h),h=l,l=o),0===s&&(s=2+this._repLenDecoder.decode(this._rangeDecoder,n),c=c<7?8:11);else if(p=d,d=h,h=l,s=2+this._lenDecoder.decode(this._rangeDecoder,n),c=c<7?7:10,(a=this._posSlotDecoder[s<=5?s-2:3].decode(this._rangeDecoder))>=4){if(l=(2|1&a)<<(u=(a>>1)-1),a<14)l+=ci.reverseDecode2(this._posDecoders,l-a-1,this._rangeDecoder,u);else if(l+=this._rangeDecoder.decodeDirectBits(u-4)<<4,(l+=this._posAlignDecoder.reverseDecode(this._rangeDecoder))<0){if(-1===l)break;return!1}}else l=a;if(l>=M||l>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(l,s),M+=s,f=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},ci.Decoder.prototype.setDecoderProperties=function(e){var t,i,n,r,s;return!(e.size<5)&&(i=(t=e.readByte())%9,n=(t=~~(t/9))%5,r=~~(t/5),!!this.setLcLpPb(i,n,r)&&(s=e.readByte(),s|=e.readByte()<<8,s|=e.readByte()<<16,s+=16777216*e.readByte(),this.setDictionarySize(s)))},ci.decompress=function(e,t,i,n){var r=new ci.Decoder;if(!r.setDecoderProperties(e))throw"Incorrect stream properties";if(!r.decode(t,i,n))throw"Error in data stream";return!0},ci.decompressFile=function(e,t){var i,n=new ci.Decoder;if(!n.setDecoderProperties(e))throw"Incorrect stream properties";if(i=e.readByte(),i|=e.readByte()<<8,i|=e.readByte()<<16,i+=16777216*e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),!n.decode(e,t,i))throw"Error in data stream";return!0};var li="undefined"!=typeof Worker&&"undefined"!=typeof Blob,hi="";if(li)try{var di=new Blob(['\n self.onmessage = function (event) {\n var Packet = event.data;\n var Result = null;\n try {\n if (!Packet.PacketID) {\n throw new Error(\'No incoming id.\');\n }\n if (!Packet.Data) {\n throw new Error(\'No input data.\');\n }\n if (Packet.Type == \'compress\') {\n // C: checking if input is valid\n if (Packet.Data.constructor != Uint8Array) {\n throw new Error(\'Input data is not Uint8Array.\');\n }\n // C: encoding data\n Result = Util.compressFile(Packet.Data, null, Packet.Level, null);\n } else if (Packet.Type == \'decompress\') {\n // C: checking if input is valid\n if (Packet.Data.constructor != Uint8Array) {\n throw new Error(\'Input data is not Uint8Array.\');\n }\n var inStream = {\n data: Packet.Data,\n offset: 0,\n readByte () {\n return this.data[this.offset++];\n }\n };\n var partLength = inStream.data.length;\n var outStream = {\n data: [],\n offset: 0,\n writeByte (value) {\n var partIndex = Math.floor(this.offset / partLength);\n if (!this.data[partIndex]) {\n this.data[partIndex] = new Uint8Array(partLength);\n }\n this.data[partIndex][this.offset % partLength] = value;\n this.offset++;\n }\n }\n // C: decoding data\n\n LZMA.decompressFile(inStream, outStream);\n Result = new Uint8Array(outStream.offset)\n for (var i = 0; i < outStream.offset; i++) {\n Result[i] = outStream.data[Math.floor(i / partLength)][i % partLength];\n }\n }\n postMessage({ PacketID: Packet.PacketID, Result, Error: null }, [Result.buffer]);\n } catch (error) {\n postMessage({ PacketID: Packet.PacketID, Error: error.toString() });\n }\n };\n\n\n /*\n Copyright (c) 2011 Juan Mellado\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the "Software"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\n /*\n References:\n - "LZMA SDK" by Igor Pavlov\n http://www.7-zip.org/sdk.html\n */\n\n var LZMA = LZMA || {};\n\n LZMA.OutWindow = function(){\n this._windowSize = 0;\n };\n\n LZMA.OutWindow.prototype.create = function(windowSize){\n if ( (!this._buffer) || (this._windowSize !== windowSize) ){\n this._buffer = [];\n }\n this._windowSize = windowSize;\n this._pos = 0;\n this._streamPos = 0;\n };\n\n LZMA.OutWindow.prototype.flush = function(){\n var size = this._pos - this._streamPos;\n if (size !== 0){\n while(size --){\n this._stream.writeByte(this._buffer[this._streamPos ++]);\n }\n if (this._pos >= this._windowSize){\n this._pos = 0;\n }\n this._streamPos = this._pos;\n }\n };\n\n LZMA.OutWindow.prototype.releaseStream = function(){\n this.flush();\n this._stream = null;\n };\n\n LZMA.OutWindow.prototype.setStream = function(stream){\n this.releaseStream();\n this._stream = stream;\n };\n\n LZMA.OutWindow.prototype.init = function(solid){\n if (!solid){\n this._streamPos = 0;\n this._pos = 0;\n }\n };\n\n LZMA.OutWindow.prototype.copyBlock = function(distance, len){\n var pos = this._pos - distance - 1;\n if (pos < 0){\n pos += this._windowSize;\n }\n while(len --){\n if (pos >= this._windowSize){\n pos = 0;\n }\n this._buffer[this._pos ++] = this._buffer[pos ++];\n if (this._pos >= this._windowSize){\n this.flush();\n }\n }\n };\n\n LZMA.OutWindow.prototype.putByte = function(b){\n this._buffer[this._pos ++] = b;\n if (this._pos >= this._windowSize){\n this.flush();\n }\n };\n\n LZMA.OutWindow.prototype.getByte = function(distance){\n var pos = this._pos - distance - 1;\n if (pos < 0){\n pos += this._windowSize;\n }\n return this._buffer[pos];\n };\n\n LZMA.RangeDecoder = function(){\n };\n\n LZMA.RangeDecoder.prototype.setStream = function(stream){\n this._stream = stream;\n };\n\n LZMA.RangeDecoder.prototype.releaseStream = function(){\n this._stream = null;\n };\n\n LZMA.RangeDecoder.prototype.init = function(){\n var i = 5;\n\n this._code = 0;\n this._range = -1;\n\n while(i --){\n this._code = (this._code << 8) | this._stream.readByte();\n }\n };\n\n LZMA.RangeDecoder.prototype.decodeDirectBits = function(numTotalBits){\n var result = 0, i = numTotalBits, t;\n\n while(i --){\n this._range >>>= 1;\n t = (this._code - this._range) >>> 31;\n this._code -= this._range & (t - 1);\n result = (result << 1) | (1 - t);\n\n if ( (this._range & 0xff000000) === 0){\n this._code = (this._code << 8) | this._stream.readByte();\n this._range <<= 8;\n }\n }\n\n return result;\n };\n\n LZMA.RangeDecoder.prototype.decodeBit = function(probs, index){\n var prob = probs[index],\n newBound = (this._range >>> 11) * prob;\n\n if ( (this._code ^ 0x80000000) < (newBound ^ 0x80000000) ){\n this._range = newBound;\n probs[index] += (2048 - prob) >>> 5;\n if ( (this._range & 0xff000000) === 0){\n this._code = (this._code << 8) | this._stream.readByte();\n this._range <<= 8;\n }\n return 0;\n }\n\n this._range -= newBound;\n this._code -= newBound;\n probs[index] -= prob >>> 5;\n if ( (this._range & 0xff000000) === 0){\n this._code = (this._code << 8) | this._stream.readByte();\n this._range <<= 8;\n }\n return 1;\n };\n\n LZMA.initBitModels = function(probs, len){\n while(len --){\n probs[len] = 1024;\n }\n };\n\n LZMA.BitTreeDecoder = function(numBitLevels){\n this._models = [];\n this._numBitLevels = numBitLevels;\n };\n\n LZMA.BitTreeDecoder.prototype.init = function(){\n LZMA.initBitModels(this._models, 1 << this._numBitLevels);\n };\n\n LZMA.BitTreeDecoder.prototype.decode = function(rangeDecoder){\n var m = 1, i = this._numBitLevels;\n\n while(i --){\n m = (m << 1) | rangeDecoder.decodeBit(this._models, m);\n }\n return m - (1 << this._numBitLevels);\n };\n\n LZMA.BitTreeDecoder.prototype.reverseDecode = function(rangeDecoder){\n var m = 1, symbol = 0, i = 0, bit;\n\n for (; i < this._numBitLevels; ++ i){\n bit = rangeDecoder.decodeBit(this._models, m);\n m = (m << 1) | bit;\n symbol |= bit << i;\n }\n return symbol;\n };\n\n LZMA.reverseDecode2 = function(models, startIndex, rangeDecoder, numBitLevels){\n var m = 1, symbol = 0, i = 0, bit;\n\n for (; i < numBitLevels; ++ i){\n bit = rangeDecoder.decodeBit(models, startIndex + m);\n m = (m << 1) | bit;\n symbol |= bit << i;\n }\n return symbol;\n };\n\n LZMA.LenDecoder = function(){\n this._choice = [];\n this._lowCoder = [];\n this._midCoder = [];\n this._highCoder = new LZMA.BitTreeDecoder(8);\n this._numPosStates = 0;\n };\n\n LZMA.LenDecoder.prototype.create = function(numPosStates){\n for (; this._numPosStates < numPosStates; ++ this._numPosStates){\n this._lowCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3);\n this._midCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3);\n }\n };\n\n LZMA.LenDecoder.prototype.init = function(){\n var i = this._numPosStates;\n LZMA.initBitModels(this._choice, 2);\n while(i --){\n this._lowCoder[i].init();\n this._midCoder[i].init();\n }\n this._highCoder.init();\n };\n\n LZMA.LenDecoder.prototype.decode = function(rangeDecoder, posState){\n if (rangeDecoder.decodeBit(this._choice, 0) === 0){\n return this._lowCoder[posState].decode(rangeDecoder);\n }\n if (rangeDecoder.decodeBit(this._choice, 1) === 0){\n return 8 + this._midCoder[posState].decode(rangeDecoder);\n }\n return 16 + this._highCoder.decode(rangeDecoder);\n };\n\n LZMA.Decoder2 = function(){\n this._decoders = [];\n };\n\n LZMA.Decoder2.prototype.init = function(){\n LZMA.initBitModels(this._decoders, 0x300);\n };\n\n LZMA.Decoder2.prototype.decodeNormal = function(rangeDecoder){\n var symbol = 1;\n\n do{\n symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol);\n }while(symbol < 0x100);\n\n return symbol & 0xff;\n };\n\n LZMA.Decoder2.prototype.decodeWithMatchByte = function(rangeDecoder, matchByte){\n var symbol = 1, matchBit, bit;\n\n do{\n matchBit = (matchByte >> 7) & 1;\n matchByte <<= 1;\n bit = rangeDecoder.decodeBit(this._decoders, ( (1 + matchBit) << 8) + symbol);\n symbol = (symbol << 1) | bit;\n if (matchBit !== bit){\n while(symbol < 0x100){\n symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol);\n }\n break;\n }\n }while(symbol < 0x100);\n\n return symbol & 0xff;\n };\n\n LZMA.LiteralDecoder = function(){\n };\n\n LZMA.LiteralDecoder.prototype.create = function(numPosBits, numPrevBits){\n var i;\n\n if (this._coders\n && (this._numPrevBits === numPrevBits)\n && (this._numPosBits === numPosBits) ){\n return;\n }\n this._numPosBits = numPosBits;\n this._posMask = (1 << numPosBits) - 1;\n this._numPrevBits = numPrevBits;\n\n this._coders = [];\n\n i = 1 << (this._numPrevBits + this._numPosBits);\n while(i --){\n this._coders[i] = new LZMA.Decoder2();\n }\n };\n\n LZMA.LiteralDecoder.prototype.init = function(){\n var i = 1 << (this._numPrevBits + this._numPosBits);\n while(i --){\n this._coders[i].init();\n }\n };\n\n LZMA.LiteralDecoder.prototype.getDecoder = function(pos, prevByte){\n return this._coders[( (pos & this._posMask) << this._numPrevBits)\n + ( (prevByte & 0xff) >>> (8 - this._numPrevBits) )];\n };\n\n LZMA.Decoder = function(){\n this._outWindow = new LZMA.OutWindow();\n this._rangeDecoder = new LZMA.RangeDecoder();\n this._isMatchDecoders = [];\n this._isRepDecoders = [];\n this._isRepG0Decoders = [];\n this._isRepG1Decoders = [];\n this._isRepG2Decoders = [];\n this._isRep0LongDecoders = [];\n this._posSlotDecoder = [];\n this._posDecoders = [];\n this._posAlignDecoder = new LZMA.BitTreeDecoder(4);\n this._lenDecoder = new LZMA.LenDecoder();\n this._repLenDecoder = new LZMA.LenDecoder();\n this._literalDecoder = new LZMA.LiteralDecoder();\n this._dictionarySize = -1;\n this._dictionarySizeCheck = -1;\n\n this._posSlotDecoder[0] = new LZMA.BitTreeDecoder(6);\n this._posSlotDecoder[1] = new LZMA.BitTreeDecoder(6);\n this._posSlotDecoder[2] = new LZMA.BitTreeDecoder(6);\n this._posSlotDecoder[3] = new LZMA.BitTreeDecoder(6);\n };\n\n LZMA.Decoder.prototype.setDictionarySize = function(dictionarySize){\n if (dictionarySize < 0){\n return false;\n }\n if (this._dictionarySize !== dictionarySize){\n this._dictionarySize = dictionarySize;\n this._dictionarySizeCheck = Math.max(this._dictionarySize, 1);\n this._outWindow.create( Math.max(this._dictionarySizeCheck, 4096) );\n }\n return true;\n };\n\n LZMA.Decoder.prototype.setLcLpPb = function(lc, lp, pb){\n var numPosStates = 1 << pb;\n\n if (lc > 8 || lp > 4 || pb > 4){\n return false;\n }\n\n this._literalDecoder.create(lp, lc);\n\n this._lenDecoder.create(numPosStates);\n this._repLenDecoder.create(numPosStates);\n this._posStateMask = numPosStates - 1;\n\n return true;\n };\n\n LZMA.Decoder.prototype.init = function(){\n var i = 4;\n\n this._outWindow.init(false);\n\n LZMA.initBitModels(this._isMatchDecoders, 192);\n LZMA.initBitModels(this._isRep0LongDecoders, 192);\n LZMA.initBitModels(this._isRepDecoders, 12);\n LZMA.initBitModels(this._isRepG0Decoders, 12);\n LZMA.initBitModels(this._isRepG1Decoders, 12);\n LZMA.initBitModels(this._isRepG2Decoders, 12);\n LZMA.initBitModels(this._posDecoders, 114);\n\n this._literalDecoder.init();\n\n while(i --){\n this._posSlotDecoder[i].init();\n }\n\n this._lenDecoder.init();\n this._repLenDecoder.init();\n this._posAlignDecoder.init();\n this._rangeDecoder.init();\n };\n\n LZMA.Decoder.prototype.decode = function(inStream, outStream, outSize){\n var state = 0, rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0, nowPos64 = 0, prevByte = 0,\n posState, decoder2, len, distance, posSlot, numDirectBits;\n\n this._rangeDecoder.setStream(inStream);\n this._outWindow.setStream(outStream);\n\n this.init();\n\n while(outSize < 0 || nowPos64 < outSize){\n posState = nowPos64 & this._posStateMask;\n\n if (this._rangeDecoder.decodeBit(this._isMatchDecoders, (state << 4) + posState) === 0){\n decoder2 = this._literalDecoder.getDecoder(nowPos64 ++, prevByte);\n\n if (state >= 7){\n prevByte = decoder2.decodeWithMatchByte(this._rangeDecoder, this._outWindow.getByte(rep0) );\n }else{\n prevByte = decoder2.decodeNormal(this._rangeDecoder);\n }\n this._outWindow.putByte(prevByte);\n\n state = state < 4? 0: state - (state < 10? 3: 6);\n\n }else{\n\n if (this._rangeDecoder.decodeBit(this._isRepDecoders, state) === 1){\n len = 0;\n if (this._rangeDecoder.decodeBit(this._isRepG0Decoders, state) === 0){\n if (this._rangeDecoder.decodeBit(this._isRep0LongDecoders, (state << 4) + posState) === 0){\n state = state < 7? 9: 11;\n len = 1;\n }\n }else{\n if (this._rangeDecoder.decodeBit(this._isRepG1Decoders, state) === 0){\n distance = rep1;\n }else{\n if (this._rangeDecoder.decodeBit(this._isRepG2Decoders, state) === 0){\n distance = rep2;\n }else{\n distance = rep3;\n rep3 = rep2;\n }\n rep2 = rep1;\n }\n rep1 = rep0;\n rep0 = distance;\n }\n if (len === 0){\n len = 2 + this._repLenDecoder.decode(this._rangeDecoder, posState);\n state = state < 7? 8: 11;\n }\n }else{\n rep3 = rep2;\n rep2 = rep1;\n rep1 = rep0;\n\n len = 2 + this._lenDecoder.decode(this._rangeDecoder, posState);\n state = state < 7? 7: 10;\n\n posSlot = this._posSlotDecoder[len <= 5? len - 2: 3].decode(this._rangeDecoder);\n if (posSlot >= 4){\n\n numDirectBits = (posSlot >> 1) - 1;\n rep0 = (2 | (posSlot & 1) ) << numDirectBits;\n\n if (posSlot < 14){\n rep0 += LZMA.reverseDecode2(this._posDecoders,\n rep0 - posSlot - 1, this._rangeDecoder, numDirectBits);\n }else{\n rep0 += this._rangeDecoder.decodeDirectBits(numDirectBits - 4) << 4;\n rep0 += this._posAlignDecoder.reverseDecode(this._rangeDecoder);\n if (rep0 < 0){\n if (rep0 === -1){\n break;\n }\n return false;\n }\n }\n }else{\n rep0 = posSlot;\n }\n }\n\n if (rep0 >= nowPos64 || rep0 >= this._dictionarySizeCheck){\n return false;\n }\n\n this._outWindow.copyBlock(rep0, len);\n nowPos64 += len;\n prevByte = this._outWindow.getByte(0);\n }\n }\n\n this._outWindow.flush();\n this._outWindow.releaseStream();\n this._rangeDecoder.releaseStream();\n\n return true;\n };\n\n LZMA.Decoder.prototype.setDecoderProperties = function(properties){\n var value, lc, lp, pb, dictionarySize;\n\n if (properties.size < 5){\n return false;\n }\n\n value = properties.readByte();\n lc = value % 9;\n value = ~~(value / 9);\n lp = value % 5;\n pb = ~~(value / 5);\n\n if ( !this.setLcLpPb(lc, lp, pb) ){\n return false;\n }\n\n dictionarySize = properties.readByte();\n dictionarySize |= properties.readByte() << 8;\n dictionarySize |= properties.readByte() << 16;\n dictionarySize += properties.readByte() * 16777216;\n\n return this.setDictionarySize(dictionarySize);\n };\n\n LZMA.decompress = function(properties, inStream, outStream, outSize){\n var decoder = new LZMA.Decoder();\n\n if ( !decoder.setDecoderProperties(properties) ){\n throw "Incorrect stream properties";\n }\n\n if ( !decoder.decode(inStream, outStream, outSize) ){\n throw "Error in data stream";\n }\n\n return true;\n };\n\n LZMA.decompressFile = function(inStream, outStream){\n var decoder = new LZMA.Decoder(), outSize;\n\n if ( !decoder.setDecoderProperties(inStream) ){\n throw "Incorrect stream properties";\n }\n\n outSize = inStream.readByte();\n outSize |= inStream.readByte() << 8;\n outSize |= inStream.readByte() << 16;\n outSize += inStream.readByte() * 16777216;\n\n inStream.readByte();\n inStream.readByte();\n inStream.readByte();\n inStream.readByte();\n\n if ( !decoder.decode(inStream, outStream, outSize) ){\n throw "Error in data stream";\n }\n\n return true;\n };\n'],{type:"text/javascript"});hi=URL.createObjectURL(di)}catch(e){}var pi=function(){function e(){var e=this;if(this.callCounter=0,this.requests=[],!li)throw new Error("LZMACaller cannot work in this broswer.");var t=this.worker=new Worker(hi);t.onmessage=function(t){var i,n,r=t.data,s=r.PacketID,o=r.Result,a=r.Error;a?null===(n=e.requests[s])||void 0===n||n.onCompleteCallback(new Error(a)):null===(i=e.requests[s])||void 0===i||i.onCompleteCallback(null,o),delete e.requests[s]},t.onerror=function(e){return console.error(e)}}return e.prototype.compress=function(e,t,i){var n=++this.callCounter;this.requests[n]={onCompleteCallback:i},this.worker.postMessage({Type:"compress",PacketID:n,Data:e,Level:t},[e.buffer])},e.prototype.decompress=function(e,t){var i=++this.callCounter;this.requests[i]={onCompleteCallback:t},this.worker.postMessage({Type:"decompress",PacketID:i,Data:e},[e.buffer])},e.prototype.terminate=function(){this.worker.terminate()},e.support=li,e}();function Mi(e){return Array.prototype.reduce.call(e,(function(e,t,i){return e|t<<8*i}),0)}function fi(e){for(var t=new Uint8Array(e),i=Mi(t.slice(0,4)),n=[],r=[],s=4+4*i,o=0;o<i;o++)r[o]=Mi(t.slice(4+4*o,8+4*o)),n[o]=o===i-1?t.subarray(s,s+r[o]):t.slice(s,s+r[o]),s+=r[o];return pi.support?function(e){for(var t=[],i=e.length,n=function(i){t.push(new Promise((function(t,n){var r=new pi;r.decompress(e[i],(function(e,i){if(r.terminate(),e)return n(e);t(i)}))})))},r=0;r<i;r++)n(r);return Promise.all(t)}(n):Promise.resolve(function(e){for(var t,i=[],n=e.length,r=function(n){var r={data:e[n],offset:0,readByte:function(){return this.data[this.offset++]}},s=r.data.length,o={data:[],offset:0,writeByte:function(e){var t=Math.floor(this.offset/s);this.data[t]||(this.data[t]=new Uint8Array(s)),this.data[t][this.offset%s]=e,this.offset++}};ci.decompressFile(r,o),t=new Uint8Array(o.offset);for(var a=0;a<o.offset;a++)t[a]=o.data[Math.floor(a/s)][a%s];i.push(t)},s=0;s<n;s++)r(s);return i}(n))}function gi(e){return 0===e.indexOf("//")||/^[0-9a-z]+\:\/\//i.test(e)}var Ai=u.parse("\nmessage Model {\n repeated Mesh meshes = 1;\n}\nmessage Mesh {\n required string name = 1;\n repeated Chunk chunks = 2;\n repeated Matrix matrix = 3;\n}\nmessage Matrix {\n repeated float elements = 1;\n}\nmessage Chunk {\n required Geometry geometry = 2;\n repeated Material material = 3;\n}\nmessage Geometry {\n required Position position = 1;\n optional UV uv = 2;\n optional UV uv2 = 3;\n required Normal normal = 4;\n repeated Group groups = 5;\n}\nmessage Position {\n repeated float array = 1[packed=true];\n}\nmessage UV {\n repeated float array = 1[packed=true];\n}\nmessage Normal {\n repeated float array = 1[packed=true];\n}\nmessage Group {\n required uint32 start = 1;\n required uint32 count = 2;\n required uint32 materialIndex = 3;\n}\nmessage Material {\n optional Color kd = 1;\n optional Color ks = 2;\n optional Color ke = 3;\n optional string mapkd = 4;\n optional string mapks = 5;\n optional string mapke = 6;\n optional string norm = 7;\n optional string mapbump = 8;\n optional string bump = 9;\n optional string mapd = 10;\n optional float ns = 11;\n optional float d = 12;\n optional float tr = 13;\n optional string mapkdrepeat = 14;\n}\nmessage Color {\n repeated float rgb = 1;\n}\n").root.lookup("Model");var yi={};function vi(e,t,i,n,r){var s,o=[],u=[];function c(e,s,o){var c=function(e){var t=e.position,i=e.normal,n=e.uv,r=e.uv2,s=e.groups,o=new a.BufferGeometry;return o.setAttribute("position",new a.BufferAttribute(new Float32Array(t.array),3)),i&&o.setAttribute("normal",new a.BufferAttribute(new Float32Array(i.array),3)),n&&o.setAttribute("uv",new a.BufferAttribute(new Float32Array(n.array),2)),r&&o.setAttribute("uv2",new a.BufferAttribute(new Float32Array(r.array),2)),s.forEach((function(e){return o.addGroup(e.start,e.count,e.materialIndex)})),o}(e);c.applyMatrix4(o);var l=new a.Vector3,h=new a.Quaternion,d=new a.Vector3;o.decompose(l,h,d),d.x*d.y*d.z<0&&c.attributes.normal&&c.attributes.position&&c.attributes.uv&&function(e){for(var t=[0,0,0],i=0;i<e.attributes.normal.array.length/9;i++)t[0]=e.attributes.normal.array[9*i],t[1]=e.attributes.normal.array[9*i+1],t[2]=e.attributes.normal.array[9*i+2],e.attributes.normal.array[9*i]=e.attributes.normal.array[9*i+6],e.attributes.normal.array[9*i+1]=e.attributes.normal.array[9*i+7],e.attributes.normal.array[9*i+2]=e.attributes.normal.array[9*i+8],e.attributes.normal.array[9*i+6]=t[0],e.attributes.normal.array[9*i+7]=t[1],e.attributes.normal.array[9*i+8]=t[2];for(i=0;i<e.attributes.position.array.length/9;i++)t[0]=e.attributes.position.array[9*i],t[1]=e.attributes.position.array[9*i+1],t[2]=e.attributes.position.array[9*i+2],e.attributes.position.array[9*i]=e.attributes.position.array[9*i+6],e.attributes.position.array[9*i+1]=e.attributes.position.array[9*i+7],e.attributes.position.array[9*i+2]=e.attributes.position.array[9*i+8],e.attributes.position.array[9*i+6]=t[0],e.attributes.position.array[9*i+7]=t[1],e.attributes.position.array[9*i+8]=t[2];for(i=0;i<e.attributes.uv.array.length/6;i++)t[0]=e.attributes.uv.array[6*i],t[1]=e.attributes.uv.array[6*i+1],e.attributes.uv.array[6*i]=e.attributes.uv.array[6*i+4],e.attributes.uv.array[6*i+1]=e.attributes.uv.array[6*i+5],e.attributes.uv.array[6*i+4]=t[0],e.attributes.uv.array[6*i+5]=t[1];e.attributes.normal.needsUpdate=!0,e.attributes.position.needsUpdate=!0,e.attributes.uv.needsUpdate=!0}(c);var p=s.map((function(e){var s=function(e,t,i,n,r){var s={sourceFile:null,needsUpdate:!0,wrapS:a.RepeatWrapping,wrapT:a.RepeatWrapping};function o(e,o){return yi[e]?Promise.resolve(yi[e]):new Promise((function(u,c){var l=new _t({allowHosts:n,networkSubscribe:r});gi(e)||(e=t+e),-1!==(e=(e=e.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/")).split("?")[0]).indexOf(".png")&&(e=e.split(".png")[0]+".png"),-1!==e.indexOf(".jpg")&&(e=e.split(".jpg")[0]+".jpg"),0===e.indexOf("//")&&(e="https:"+e),e=Bt(e,Object.assign({key:"texture"},i,{size:64})),l.load(e,(function(t){var i=new a.Texture(t),n=i.dispose;i.dispose=function(){n.call(i),/^blob\:/.test(t.src)&&URL.revokeObjectURL(t.src)},o&&Object.assign(i.repeat,o),Object.assign(i,s,{sourceFile:e}),i.updateMatrix(),yi[e]=i,u(i)}),He,(function(e){return c(e.error)}))}))}var u=[],c=new dt,l=c.uniforms;l.exposure.value=4.3;var h,d=c.defines;if(d.USE_MAP=!1,d.USE_UV=!1,e.hasOwnProperty("kd")&&(l.diffuse.value=(new a.Color).fromArray(e.kd.rgb)),e.hasOwnProperty("mapkd")){var p=void 0;if(e.mapkdrepeat){var M=e.mapkdrepeat.split(/\s+/).map((function(e){return Number(e)})),f=M[0],g=M[1];p=new a.Vector2(f,g)}u.push(o(e.mapkd,p).then((function(e){d.USE_MAP=!0,d.USE_UV=!0,l.map.value=e,l.uvTransform.value=e.matrix})).catch((function(e){})))}return e.hasOwnProperty("ks")&&(l.specular.value=(new a.Color).fromArray(e.ks.rgb)),e.hasOwnProperty("mapks")&&u.push(o(e.mapks).then((function(e){l.specularMap.value=e})).catch((function(e){}))),e.hasOwnProperty("ke")&&(l.emissive.value=(new a.Color).fromArray(e.ke.rgb)),e.hasOwnProperty("mapke")&&u.push(o(e.mapke).then((function(e){l.emissiveMap.value=e})).catch((function(e){}))),e.hasOwnProperty("norm")&&u.push(o(e.norm).then((function(e){l.normalMap.value=e})).catch((function(e){}))),e.hasOwnProperty("mapbump")&&u.push(o(e.mapbump).then((function(e){l.bumpMap.value=e})).catch((function(e){}))),e.hasOwnProperty("bump")&&u.push(o(e.bump).then((function(e){l.bumpMap.value=e})).catch((function(e){}))),e.hasOwnProperty("ns")&&(l.shininess.value=e.ns),e.hasOwnProperty("d")&&(h=e.d)>=0&&h<1&&(l.originOpacity.value=h),e.hasOwnProperty("tr")&&(h=1-e.tr)>=0&&h<1&&(l.originOpacity.value=h),l.originOpacity.value<1&&(c.transparent=!0),{material:c,textureReady:Promise.all(u).then((function(){}))}}(e,t,i,n,r),o=s.material,c=s.textureReady;return u.push(c),o}));return new tt(c,p)}return(s=e,Ai.decode(s)).meshes.forEach((function(e){var t=e.name,i=e.chunks,n=e.matrix;"Ceiling"!==t&&"CeilingDrop"!==t&&n.map((function(e){var n,r=new a.Matrix4;if(r.elements=e.elements,1===i.length){var s=i[0],u=s.geometry,l=s.material;n=c(u,l,r)}else n=new nt,i.forEach((function(e,t){var i=c(e.geometry,e.material,r);i.name="chunk"+t,n.add(i)}));n.floorIndex=0,n.name=t,o.push(n)}))})),Promise.all(u).catch((function(){})).then((function(){return o}))}function mi(){Object.keys(yi).forEach((function(e){yi[e].dispose(),delete yi[e]}))}function Ni(e){var i;return new((i=a.Triangle).bind.apply(i,t.__spreadArray([void 0],e.map((function(e){return new a.Vector3(e.x,e.y,e.z)})),!1)))}var Di={at3d:function(e,t){for(var i=ui(t.imageOptions,e.textures.length),n={},r=0,s=e.textures;r<s.length;r++){var o=s[r];n[o]=ri(o,i,t.allowHosts,t.networkSubscribe)}var a={responseType:"arraybuffer",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe};return Promise.resolve().then((function(){return kt.async(e.file,a)})).then((function(e){return fi(e.body)})).then((function(e){return Gt((function(){for(var t=[],i=0,n=e;i<n.length;i++){var r=n[i],s=oi.decode(r);t.push.apply(t,s.chunks)}return t}))})).then((function(r){return Gt((function(){return ai(r,e.textureBase,e.textures.slice(),i,n,t.allowHosts,t.networkSubscribe)}))}))},pbm:function(e,t){for(var i=ui(t.imageOptions,e.textures.length),n={},r=0,s=e.textures;r<s.length;r++){var o=s[r];n[o]=ri(o,i,t.allowHosts,t.networkSubscribe)}var a={responseType:"arraybuffer",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe};return Promise.resolve().then((function(){return kt.async(e.file,a)})).then((function(e){return Gt((function(){var t=new Uint8Array(e.body),i=oi.decode(t);return[].concat(i.chunks)}))})).then((function(r){return Gt((function(){return ai(r,e.textureBase,e.textures.slice(),i,n,t.allowHosts,t.networkSubscribe)}))}))},dome:function(e,t){var i={responseType:"arraybuffer",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe};return Promise.resolve().then((function(){return mi()})).then((function(){return kt.async(e.file,i)})).then((function(i){return vi(new Uint8Array(i.body),e.textureBase,t.imageOptions,t.allowHosts,t.networkSubscribe)}))},domez:function(e,t){var i={responseType:"arraybuffer",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe};return Promise.resolve().then((function(){return mi()})).then((function(){return kt.async(e.file,i)})).then((function(e){return fi(e.body)})).then((function(e){var t=e.reduce((function(e,t){return e+t.length}),0),i=new Uint8Array(t),n=0;return e.forEach((function(e){i.set(e,n),n+=e.length})),i})).then((function(i){return vi(i,e.textureBase,t.imageOptions,t.allowHosts,t.networkSubscribe)}))}},wi=function(e){function i(t){void 0===t&&(t={});var i=e.call(this)||this;return i.empty=!1,i.name="model",i.loaded=!1,i.bvhs=[],i.bounding=new a.Box3,i.shownFloor=null,i.floorLength=0,i.networkSubscribe=t.networkSubscribe,i.allowHosts=t.allowHosts,i}return t.__extends(i,e),Object.defineProperty(i.prototype,"shownfloor",{get:function(){return this.shownFloor},enumerable:!1,configurable:!0}),i.prototype.getEdges=function(e){var t;void 0===e&&(e=30/180*Math.PI);for(var i=Math.cos(e),n=[],r=0,s=this.children;r<s.length;r++){var o=s[r];if(o instanceof tt){for(var u={},c=["a","b","c"],l=Wt.mergeVertices(o.geometry),h=l.getAttribute("position").array,d=(null===(t=l.getIndex())||void 0===t?void 0:t.array)||[],p=[],M=[],f=0,g=h.length;f<g;f+=3)p.push(new a.Vector3(h[f],h[f+1],h[f+2]));for(f=0,g=d.length;f<g;f+=3){var A=d[f],y=d[f+1],v=d[f+2],m=(new a.Vector3).crossVectors(p[y].clone().sub(p[A]),p[v].clone().sub(p[A])).normalize();M.push({a:A,b:y,c:v,normal:m})}for(f=0,g=M.length;f<g;f++)for(var N=M[f],D=0;D<3;D++){var w=N[c[D]],T=N[c[(D+1)%3]],x=[Math.min(w,T),Math.max(w,T)];void 0===u[E=x[0]+"-"+x[1]]?u[E]={index1:x[0],index2:x[1],face1:f}:u[E].face2=f}for(var E in u){var j=u[E];if(void 0===j.face2||M[j.face1].normal.dot(M[j.face2].normal)<=i){var z=p[j.index1],I=p[j.index2];n.push(new a.Line3(z,I))}}l.dispose(),p.length=0,M.length=0}}return n},i.prototype.hasFloors=function(){return this.hasFloors_()},i.prototype.hasFloors_=function(){var e=[];return this.traverse((function(t){t instanceof tt&&(e[t.floorIndex]=!0)})),e.length},i.prototype.show=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=this.shownFloor,r=null,s=null!==(e=t[1])&&void 0!==e?e:.1,o=0!==t.length;this.shownFloor=r=o?t[0]:null,this.traverse((function(e){e instanceof tt&&e.material.forEach((function(t){null===r||r===e.floorIndex?t.opacity=1:t.opacity=s}))})),n!==this.shownFloor&&this.emit("shownFloorChange",this.shownFloor,this.floorLength),this.needsRender=!0},i.prototype.intersectRaycaster=function(e,t){var i=e.ray,n=i.origin,r=i.direction;if(Ve(t))if(Ve(this.shownFloor)){var s=this.floorLength;t=[];for(var o=0;o<s;o++)t.push(o)}else t=[this.shownFloor];var u=[],c=[];Array.isArray(t)?c.push.apply(c,t):c.push(t);for(var l=function(t){var i=h.bvhs&&h.bvhs[t];if(i){(s=i.intersectRay(n,r,!0).map((function(e){var t=e.intersectionPoint,i=e.triangle,r=new a.Vector3(t.x,t.y,t.z);return{point:r,face:{normal:Ni(i).getNormal(new a.Vector3)},distance:n.distanceTo(r)}}))).length&&u.push.apply(u,s)}else{var s,o=[];h.traverse((function(e){e instanceof tt&&e.floorIndex===t&&o.push(e)})),(s=e.intersectObjects(o).map((function(e){var t=e.face?{normal:e.face.normal}:void 0;return{point:e.point,face:t,distance:e.distance}}))).length&&u.push.apply(u,s)}},h=this,d=0,p=c;d<p.length;d++){l(p[d])}return u.filter((function(t){var i=t.distance;return i<=e.far&&i>=e.near})).sort((function(e,t){return e.distance-t.distance}))},i.prototype.buildBVH=function(){var e=this,t=[];this.traverse((function(e){e instanceof tt&&(t[e.floorIndex]=t[e.floorIndex]||[],t[e.floorIndex].push(e.geometry))}));var i=t.map((function(e){var t=e.reduce((function(e,t){return e+(t.index?t.index.array.length:t.attributes.position.array.length)}),0),i=new Float32Array(3*t);return e.reduce((function(e,t){for(var n=t.index?t.index.array:null,r=t.attributes.position.array,s=n?n.length:r.length/3,o=0;o<s;o++){var a=3*(e+o),u=n?3*n[o]:3*o;i[a+0]=r[u+0],i[a+1]=r[u+1],i[a+2]=r[u+2]}return e+s}),0),new Nt(i,5)}));return this.bvhs=[],Promise.all(i.map((function(e){return new Promise((function(t){return e.splitNode(t)}))}))).then((function(){e.bvhs=i,e.bvhs.loaded=!0,e.emit("bvhLoaded")}))},i.prototype.load=function(e,t){var i=this;if(void 0===t&&(t={}),!0===this.loaded)throw new Error("[MODEL LOAD ERROR]: model cannot load twice.");var n=function(e,t){void 0===t&&(t=[]);var i=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(e);if(!i)return"";for(var n=0,r=String(i[1]).trim().split(".").slice(1).reverse();n<r.length;n++){var s=r[n],o=t.indexOf(s);if(o>=0)return t[o]}return""}(e.file,Object.keys(Di)),r=Di[n];if(!r)throw new Error("[MODEL LOAD ERROR]: file type("+n+") does not support.");return r(e,{imageOptions:t,allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe}).then((function(e){for(var t=[],n=0,r=e;n<r.length;n++){(c=r[n]).traverse((function(e){e instanceof tt&&(e.geometry.computeBoundingBox(),e.geometry.computeBoundingSphere(),t.push(e.geometry.boundingBox))})),i.add(c)}i.floorLength=i.hasFloors_(),i.bounding=function(e){for(var t=new a.Box3,i=0,n=e;i<n.length;i++){var r=n[i];t.union(r)}return t}(t);for(var s=i.bounding.getCenter(new a.Vector3),o=0,u=e;o<u.length;o++){var c;(c=u[o]).traverse((function(e){e instanceof tt&&e.material.forEach((function(e){e.uniforms.modelCenter.value=s}))}))}t.length=0,i.emit("geometryLoaded"),i.emit("materialLoaded"),i.loaded=!0,Xe((function(){return i.emit("loaded")}))})).catch((function(e){return i.emit("error",e),Promise.reject(e)}))},i.prototype.dispose=function(){for(this.off(),this.disposeGeometry(),this.disposeMaterial();this.children.length;)this.remove(this.children[0]);this.bvhs.length=0,delete this.bvhs.loaded},i}(it);function Ti(e){switch(e.getError()){case e.INVALID_ENUM:return new Error("webgl error: INVALID_ENUM");case e.INVALID_VALUE:return new Error("webgl error: INVALID_VALUE");case e.INVALID_OPERATION:return new Error("webgl error: INVALID_OPERATION");case e.INVALID_FRAMEBUFFER_OPERATION:return new Error("webgl error: INVALID_FRAMEBUFFER_OPERATION");case e.OUT_OF_MEMORY:return new Error("webgl error: OUT_OF_MEMORY");case e.CONTEXT_LOST_WEBGL:return new Error("webgl error: CONTEXT_LOST_WEBGL");default:return null}}Object.assign(wi.prototype,{on:xt.prototype.on,once:xt.prototype.once,off:xt.prototype.off,emit:xt.prototype.emit,hasListener:xt.prototype.hasListener});var xi=c.default.Tween,Ei=c.default.Easing;function ji(e,t,i,n){void 0===n&&(n=Ei.Linear.None);var r=[],s=[],o=[],a=[],u=Object.assign(new xi(e).to(t,i).easing(n),{completed:!1,onCancel:function(e){return r.push(e),u},destroy:function(){if(u.stop(),Object.assign(this,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallback:null}),!u.completed)for(var e=0,t=r;e<t.length;e++){(0,t[e])()}r.length=0,c()}});Object.assign(u,{onStart:function(e){return s.push(e),u},onUpdate:function(e){return o.push(e),u},onComplete:function(e){return a.push(e),u},_onStartCallback:function(e){for(var t=0,i=s;t<i.length;t++){(0,i[t])(e)}},_onUpdateCallback:function(e,t){for(var i=0,n=o;i<n.length;i++){(0,n[i])(e,t)}1===t&&0===u._repeat&&(u.completed=!0)},_onCompleteCallback:function(e){for(var t=0,i=a;t<i.length;t++){(0,i[t])(e)}}}),Xe((function(){return u.start()}));var c=Je((function(e){!1===u.update(e)&&c()}));return u}function zi(e,t){return ji({progress:0},{progress:1},e,t)}var Ii=2*Math.PI;function bi(e){return(e%Ii+Ii)%Ii}var Li=Math.PI,Si=2*Li;function Oi(e,t,i){return e+(t-e)*i}function Ci(e,t,i){return e=bi(e),Oi((t=bi(t))-e>Li?e+Si:e-t>Li?e-Si:e,t,i)}function Pi(e,t,i){if(e===t)return t;var n=t-e;return Math.abs(n)<=i?t:e+(n>0?1:-1)*i}function ki(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=[];e=e.map((function(e){return e.trim()})).filter((function(e){return e.length>0&&!/^\/+$/.test(e)}));for(var n=0;n<e.length;n++){var r=0===n,s=n===e.length-1,o=e[n];r||(o=o.replace(/^\/+/,"")),s||(o=o.replace(/\/+$/,"")),i.push(o)}return i.join("/")}function Ui(e){return e instanceof Error}function Bi(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var i,n,r;if(Array.isArray(e)){if((i=e.length)!=t.length)return!1;for(n=i;0!=n--;)if(!Bi(e[n],t[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((i=(r=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,r[n]))return!1;for(n=i;0!=n--;){var s=r[n];if(!Bi(e[s],t[s]))return!1}return!0}return e!=e&&t!=t}function _i(e){return"number"==typeof e}function Ri(e,t){void 0===t&&(t=!1);var i=typeof e;if("string"===i)return JSON.stringify(e);if(!0===e)return"true";if(!1===e)return"false";if(null===e)return"null";if(e instanceof Array){for(var n="[",r=e.length-1,s=0;s<r;s++)n+=Ri(e[s],!1)+",";return r>-1&&(n+=Ri(e[s],!1)),n+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return Ri(e.toJSON(),t);var o=Object.keys(e).sort(),a=o.length;for(n="",s=0;s<a;){var u=o[s],c=Ri(e[u],!0);void 0!==c&&(s&&""!==n&&(n+=","),n+=JSON.stringify(u)+":"+c),s++}return"{"+n+"}"}switch(i){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(e)?e:null}}function Qi(e){return String(Ri(e,!1))}function Yi(e){var t,i,n,r=JSON.parse(e),s="undefined"!=typeof location?location.hostname:"",o=Date.now();if("object"!=typeof r)return new Error("input is not an object");if(0===s.length||zt(s)||bt.filter((function(e){return It(e,s)})).length>0){var a=String(null!==(t=r.certificate)&&void 0!==t?t:"");if(a){var u=new Oe;return u.readCertPEM(a),{issuer:u.getSubjectString()}}return{issuer:"none"}}var c=String(null!==(i=r.certificate)&&void 0!==i?i:"");if(!c)return new Error("certificate is not existed.");var l=new Oe;l.readCertPEM(c);var h=String(null!==(n=r._signature)&&void 0!==n?n:"");if(!h)return new Error("signature is not existed.");if(!1===function(e,t,i){var n=new Oe;if("string"==typeof i?n.readCertPEM(i):n.readCertHex(i.hex),!1===Be(n))return!1;var r=new ee;return r.readCertPubKeyHex(n.hex,6),!!r.verify(e,R(t))}(Qi(function(e,t){for(var i={},n=0,r=Object.keys(e);n<r.length;n++){var s=r[n];-1===t.indexOf(s)&&(i[s]=e[s])}return i}(r,["_signature"])),h,l))return new Error("signature verify failed.");var d=new Date("string"==typeof r.expire_at&&/^\d+$/.test(r.expire_at)?Number(r.expire_at):r.expire_at);return o-d.getTime()<0?function(e){return new Error("date("+e.toString()+") expired.")}(d):0===(Array.isArray(r.allow_hosts)?r.allow_hosts:[]).filter((function(e){return It(e,s)})).length?function(e){return new Error("host("+JSON.stringify(e)+") is not allowed.")}(s):{issuer:l.getSubjectString()}}var Fi=new WeakMap;function Vi(e,t,i){var n,r,s=JSON.stringify(t),o=JSON.stringify(e),u=Yi(o);e=JSON.parse(o),t=JSON.parse(s);var c={workCode:"",expire:new Date,allowHosts:[],uuid:qe(),initial:{mode:"Panorama",latitude:0,longitude:0,panoIndex:0,fov:80},observers:[],issuer:u instanceof Error?"none":u.issuer,raw:{work:e,options:t}},l=null!==(n=e.base_url)&&void 0!==n?n:"";l&&"/"!==l[l.length-1]&&(l+="/");var h=function(e,n){var r,s=e;!0===t.jsonp&&(s=(s=e.replace(/([\?\#].*)?$/i,""))+"."+Ce(""+s).slice(0,7)+".jsonp");if(!0===t.shortPath){var o=s.replace(l,"").split("."),a=null!==(r=o.shift())&&void 0!==r?r:"",u=o.join(".");s=ki(l,Ce(a))+(u?"."+u:"")}var c=s.replace(l,"");return t.baseURL&&(s=ki(t.baseURL,c)),i&&i(e,s,c,n),s},d=function(t,i){var n,r,s,o,a,u,c=t;if(!gi(t)){var d=null!==(u=null!==(o=null!==(r=null===(n=e.panorama)||void 0===n?void 0:n.pano_high_cube_base_url)&&void 0!==r?r:null===(s=e.panorama)||void 0===s?void 0:s.pano_cube_base_url)&&void 0!==o?o:null===(a=e.panorama)||void 0===a?void 0:a.base_url)&&void 0!==u?u:"";d&&(d=ki(d,String(i))),c=ki(d,c)}return gi(c)||(c=ki(l,c)),h(c,"panorama")},p=function(e){var t=e;return gi(t)||(t=ki(l,e)),h(t,"model")},M=function(e,t){void 0===t&&(t="");var i=e;return gi(i)||(i=ki(t,i)),gi(i)||(i=ki(l,i)),h(i,"texture")};if(c.workCode=null!==(r=String(e.work_code||e.code||e.workCode))&&void 0!==r?r:"",c.expire=new Date("string"==typeof e.expire_at&&/^\d+$/.test(e.expire_at)?Number(e.expire_at):e.expire_at),c.allowHosts=e.allow_hosts||[],Ui(u))return u;if(e.initial&&("Floorplan"!==e.initial.mode&&"Topview"!==e.initial.mode&&"Panorama"!==e.initial.mode&&"VRPanorama"!==e.initial.mode&&"Model"!==e.initial.mode&&"DepthPanorama"!==e.initial.mode||(c.initial.mode=e.initial.mode),_i(e.initial.latitude)&&(c.initial.latitude=e.initial.latitude),_i(e.initial.longitude)?c.initial.longitude=e.initial.longitude:_i(e.initial.heading)&&(c.initial.longitude=-(360*(e.initial.heading-.25)+90)/180*Math.PI),_i(e.initial.fov)&&(c.initial.fov=e.initial.fov),_i(e.initial.panoIndex)?c.initial.panoIndex=e.initial.panoIndex:_i(e.initial.pano_index)?c.initial.panoIndex=e.initial.pano_index:_i(e.initial.pano)&&(c.initial.panoIndex=e.initial.pano)),Ui(u))return u;if(e.model){var f={bvh:!0,async:!1,textureBase:"",textures:[]};"boolean"==typeof e.model.bvh?f.bvh=e.model.bvh:"boolean"==typeof e.bvh&&(f.bvh=e.bvh),"boolean"==typeof e.model.async?f.async=e.model.async:"boolean"==typeof e.modelAsync&&(f.async=e.modelAsync),e.model.file?f.file=p(e.model.file):e.model.file_url&&(f.file=p(e.model.file_url)),e.model.textureBase?f.textureBase=e.model.textureBase:e.model.material_base_url&&(f.textureBase=e.model.material_base_url),Array.isArray(e.model.textures)?f.textures=e.model.textures.map((function(e){return M(e,f.textureBase)})):Array.isArray(e.model.material_textures)&&(f.textures=e.model.material_textures.map((function(e){return M(e,f.textureBase)}))),f.file&&(c.model=f)}if(Ui(u))return u;if(e.observers&&Array.isArray(e.observers)){var g=[];e.panorama&&(Array.isArray(e.panorama)?g=e.panorama:Array.isArray(e.panorama.list)?g=e.panorama.list:Array.isArray(e.panorama.info)&&(g=e.panorama.info));for(var A=0;A<e.observers.length;A++){var y={},v=e.observers[A];if(!v)break;var m=g[A]||{};v=Object.assign({},v,m,{active:!1!==v.active&&!1!==m.active}),y.panoIndex=A,y.active=!1!==v.active,y.loadable=!0===v.loadable,y.images={up:d(v.images?v.images.up:v.up,A),down:d(v.images?v.images.down:v.down,A),right:d(v.images?v.images.right:v.right,A),left:d(v.images?v.images.left:v.left,A),front:d(v.images?v.images.front:v.front,A),back:d(v.images?v.images.back:v.back,A)};var N=v.images?v.images.depth:v.depth;N&&(y.images.depth=d(N,A));var D=v.images?v.images.tiles:v.tiles;if(D&&(y.images.tiles=d(D,A)),v.position instanceof a.Vector3)y.position=v.position.clone();else{if(!Array.isArray(v.position))break;y.position=(new a.Vector3).fromArray(v.position)}if(v.standingPosition instanceof a.Vector3)y.standingPosition=v.standingPosition.clone();else if(Array.isArray(v.standingPosition))y.standingPosition=(new a.Vector3).fromArray(v.standingPosition);else if(v.standing_position instanceof a.Vector3)y.standingPosition=v.standing_position.clone();else{if(!Array.isArray(v.standing_position))break;y.standingPosition=(new a.Vector3).fromArray(v.standing_position)}if(v.quaternion instanceof a.Quaternion)y.quaternion=v.quaternion.clone();else if(Array.isArray(v.quaternion))y.quaternion=(new a.Quaternion).fromArray(v.quaternion);else{if(!v.quaternion)break;var w=v.quaternion,T=w.x,x=w.y,E=w.z,j=w.w;y.quaternion=new a.Quaternion(T,x,E,j)}if(Array.isArray(v.accessibleNodes)?y.accessibleNodes=v.accessibleNodes.slice():Array.isArray(v.accessible_nodes)&&(y.accessibleNodes=v.accessible_nodes.slice()),Array.isArray(v.visibleNodes)?y.visibleNodes=v.visibleNodes.slice():Array.isArray(v.visible_nodes)&&(y.visibleNodes=v.visible_nodes.slice()),_i(v.floorIndex)?y.floorIndex=v.floorIndex:_i(v.floor_index)?y.floorIndex=v.floor_index:y.floorIndex=0,v.video){var z={};"string"==typeof v.video.source&&(z.source=v.video.source),v.video.matrix instanceof a.Matrix4?z.matrix=v.video.matrix.clone():Array.isArray(v.video.matrix)&&(z.matrix=(new a.Matrix4).fromArray(v.video.matrix)),v.video.size instanceof a.Vector2?z.size=v.video.size.clone():Array.isArray(v.video.size)&&(z.size=(new a.Vector2).fromArray(v.video.size)),z.source&&z.matrix&&z.size&&(y.video=z)}c.observers[A]=y}}if(Ui(u))return u;for(var I=0,b=c.observers;I<b.length;I++){if(!(y=b[I]).accessibleNodes){y.accessibleNodes=[];for(var L=0;L<c.observers.length;L++)c.observers[L]!==y&&y.accessibleNodes.push(L)}if(!y.visibleNodes){y.visibleNodes=[];for(L=0;L<c.observers.length;L++)c.observers[L]!==y&&y.visibleNodes.push(L)}}if(Ui(u))return u;var S=Et(c);return Fi.set(S,{work:o,options:s}),S}function Hi(e,t,i){"string"==typeof e&&"{"===e.trim()[0]&&(e=JSON.parse(e));var n=Fi.get(e);if(n){if(t&&!Bi(JSON.parse(n.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return e}var r=Vi(e,null!=t?t:{},i);if(Ui(r))throw new Error("[PARSE FAILED]: "+r.message);return r}var Gi=function(e){return Number(e)};function qi(e,t,i){var n;void 0===t&&(t=Gi),void 0===i&&(i=!1);for(var r,s=1/0,o=0,a=e;o<a.length;o++){var u=a[o],c=t(u);c<=s&&(r=(n=[u,c])[0],s=n[1])}return i?[r,s]:r}
367
+ function(e,t){for(var i=e.toByteArray(),n=0;n<i.length&&0==i[n];)++n;if(i.length-n!=t-1||2!=i[n])return null;for(++n;0!=i[n];)if(++n>=i.length)return null;for(var r="";++n<i.length;){var s=255&i[n];s<128?r+=String.fromCharCode(s):s>191&&s<224?(r+=String.fromCharCode((31&s)<<6|63&i[n+1]),++n):(r+=String.fromCharCode((15&s)<<12|(63&i[n+1])<<6|63&i[n+2]),n+=2)}return r}(i,this.n.bitLength()+7>>3)},ee.prototype.decryptOAEP=function(e,t,i){if(e.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var n=J(e,16),r=this.doPrivate(n);return null==r?null:function(e,t,i,n){var r=A.crypto.MessageDigest,s=A.crypto.Util,o=null;for(i||(i="sha1"),"string"==typeof i&&(o=r.getCanonicalAlgName(i),n=r.getHashLength(o),i=function(e){return ce(s.hashHex(le(e),o))}),e=e.toByteArray(),a=0;a<e.length;a+=1)e[a]&=255;for(;e.length<t;)e.unshift(0);if((e=String.fromCharCode.apply(String,e)).length<2*n+2)throw"Cipher too short";var a,u=e.substr(1,n),c=e.substr(n+1),l=te(c,n,i),h=[];for(a=0;a<u.length;a+=1)h[a]=u.charCodeAt(a)^l.charCodeAt(a);var d=te(String.fromCharCode.apply(String,h),e.length-n,i),p=[];for(a=0;a<c.length;a+=1)p[a]=c.charCodeAt(a)^d.charCodeAt(a);if((p=String.fromCharCode.apply(String,p)).substr(0,n)!==i(""))throw"Hash mismatch";var M=(p=p.substr(n)).indexOf("");if((-1!=M?p.substr(0,M).lastIndexOf("\0"):-1)+1!=M)throw"Malformed data";return p.substr(M+1)}(r,this.n.bitLength()+7>>3,t,i)},void 0!==A.lang&&A.lang||(A.lang={}),A.lang.String=function(){},A.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},A.lang.String.isHex=function(e){return fe(e)},A.lang.String.isBase64=function(e){return!(!(e=e.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},A.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=re(e),A.lang.String.isBase64(e))},A.lang.String.isIntegerArray=function(e){return!!(e=e.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},A.lang.String.isPrintable=function(e){return null!==e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},A.lang.String.isIA5=function(e){return null!==e.match(/^[\x20-\x21\x23-\x7f]*$/)},A.lang.String.isMail=function(e){return null!==e.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var ye=function(e,t,i){return null==i&&(i="0"),e.length>=t?e:new Array(t-e.length+1).join(i)+e};function ve(e,t){var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}void 0!==A.crypto&&A.crypto||(A.crypto={}),A.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:M.algo.MD5,sha1:M.algo.SHA1,sha224:M.algo.SHA224,sha256:M.algo.SHA256,sha384:M.algo.SHA384,sha512:M.algo.SHA512,ripemd160:M.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,i){var n=this.getDigestInfoHex(e,t),r=i/4;if(n.length+22>r)throw"key is too short for SigAlg: keylen="+i+","+t;for(var s="0001",o="00"+n,a="",u=r-s.length-o.length,c=0;c<u;c+=2)a+="ff";return s+a+o},this.hashString=function(e,t){return new A.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new A.crypto.MessageDigest({alg:t}).digestHex(e)},this.sha1=function(e){return this.hashString(e,"sha1")},this.sha256=function(e){return this.hashString(e,"sha256")},this.sha256Hex=function(e){return this.hashHex(e,"sha256")},this.sha512=function(e){return this.hashString(e,"sha512")},this.sha512Hex=function(e){return this.hashHex(e,"sha512")},this.isKey=function(e){return e instanceof ee||e instanceof A.crypto.DSA||e instanceof A.crypto.ECDSA}},A.crypto.Util.md5=function(e){return new A.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(e)},A.crypto.Util.ripemd160=function(e){return new A.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(e)},A.crypto.Util.SECURERANDOMGEN=new K,A.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return A.crypto.Util.SECURERANDOMGEN.nextBytes(t),ie(t)},A.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new f(A.crypto.Util.getRandomHexOfNbytes(e),16)},A.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,i=new Array((e-t)/8+1);return A.crypto.Util.SECURERANDOMGEN.nextBytes(i),i[0]=(255<<t&255^255)&i[0],ie(i)},A.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new f(A.crypto.Util.getRandomHexOfNbits(e),16)},A.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var i=A.crypto.Util.getRandomBigIntegerOfNbits(t);if(-1!=e.compareTo(i))return i}},A.crypto.Util.getRandomBigIntegerMinToMax=function(e,t){var i=e.compareTo(t);if(1==i)throw"biMin is greater than biMax";if(0==i)return e;var n=t.subtract(e);return A.crypto.Util.getRandomBigIntegerZeroToMax(n).add(e)},A.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=A.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=A.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=A.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[e].create()}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=M.enc.Hex.parse(e);this.md.update(t)},this.digest=function(){return this.md.finalize().toString(M.enc.Hex)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}if(-1!=":sha256:".indexOf(e)&&"sjcl"==t){try{this.md=new sjcl.hash.sha256}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=sjcl.codec.hex.toBits(e);this.md.update(t)},this.digest=function(){var e=this.md.finalize();return sjcl.codec.hex.fromBits(e)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(e){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(e){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==e&&void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=A.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},A.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},A.crypto.MessageDigest.getHashLength=function(e){var t=A.crypto.MessageDigest,i=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[i])throw"not supported algorithm: "+e;return t.HASHLENGTH[i]},A.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},A.crypto.Mac=function(e){this.setAlgAndProvider=function(e,t){if(null==(e=e.toLowerCase())&&(e="hmacsha1"),"hmac"!=(e=e.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+e;void 0===t&&(t=A.crypto.Util.DEFAULTPROVIDER[e]),this.algProv=e+"/"+t;var i=e.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(i)&&"cryptojs"==t){try{var n=A.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[i];this.mac=M.algo.HMAC.create(n,this.pass)}catch(e){throw"setAlgAndProvider hash alg set fail hashAlg="+i+"/"+e}this.updateString=function(e){this.mac.update(e)},this.updateHex=function(e){var t=M.enc.Hex.parse(e);this.mac.update(t)},this.doFinal=function(){return this.mac.finalize().toString(M.enc.Hex)},this.doFinalString=function(e){return this.updateString(e),this.doFinal()},this.doFinalHex=function(e){return this.updateHex(e),this.doFinal()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(e){if("string"==typeof e){var t=e;return e.length%2!=1&&e.match(/^[0-9A-Fa-f]+$/)||(t=le(e)),void(this.pass=M.enc.Hex.parse(t))}if("object"!=typeof e)throw"KJUR.crypto.Mac unsupported password type: "+e;t=null;if(void 0!==e.hex){if(e.hex.length%2!=0||!e.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+e.hex;t=e.hex}if(void 0!==e.utf8&&(t=ae(e.utf8)),void 0!==e.rstr&&(t=le(e.rstr)),void 0!==e.b64&&(t=_(e.b64)),void 0!==e.b64u&&(t=oe(e.b64u)),null==t)throw"KJUR.crypto.Mac unsupported password type: "+e;this.pass=M.enc.Hex.parse(t)},void 0!==e&&(void 0!==e.pass&&this.setPassword(e.pass),void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=A.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},A.crypto.Signature=function(e){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,t){for(var i="",n=t/4-e.length,r=0;r<n;r++)i+="0";return i+e},this.setAlgAndProvider=function(e,t){if(this._setAlgNames(),"cryptojs/jsrsa"!=t)throw new Error("provider not supported: "+t);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new A.crypto.MessageDigest({alg:this.mdAlgName})}catch(e){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+e)}this.init=function(e,t){var i=null;try{i=void 0===t?Ie.getKey(e):Ie.getKey(e,t)}catch(e){throw"init failed:"+e}if(!0===i.isPrivate)this.prvKey=i,this.state="SIGN";else{if(!0!==i.isPublic)throw"init failed.:"+i;this.pubKey=i,this.state="VERIFY"}},this.updateString=function(e){this.md.updateString(e)},this.updateHex=function(e){this.md.updateHex(e)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==A.crypto.ECDSA&&(this.prvKey=new A.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof ee&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof ee&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof A.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof A.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(e){return this.updateString(e),this.sign()},this.signHex=function(e){return this.updateHex(e),this.sign()},this.verify=function(e){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==A.crypto.ECDSA&&(this.pubKey=new A.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof ee&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ee&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==A.crypto.ECDSA&&this.pubKey instanceof A.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==A.crypto.DSA&&this.pubKey instanceof A.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,t){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.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(e){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(e){throw"digestHex(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=e,void 0!==e&&(void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov?this.provName=A.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==e.psssaltlen&&(this.pssSaltLen=e.psssaltlen),void 0!==e.prvkeypem)){if(void 0!==e.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{t=Ie.getKey(e.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},A.crypto.Cipher=function(e){},A.crypto.Cipher.encrypt=function(e,t,i){if(t instanceof ee&&t.isPublic){var n=A.crypto.Cipher.getAlgByKeyAndName(t,i);if("RSA"===n)return t.encrypt(e);if("RSAOAEP"===n)return t.encryptOAEP(e,"sha1");var r=n.match(/^RSAOAEP(\d+)$/);if(null!==r)return t.encryptOAEP(e,"sha"+r[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+i}throw"Cipher.encrypt: unsupported key or algorithm"},A.crypto.Cipher.decrypt=function(e,t,i){if(t instanceof ee&&t.isPrivate){var n=A.crypto.Cipher.getAlgByKeyAndName(t,i);if("RSA"===n)return t.decrypt(e);if("RSAOAEP"===n)return t.decryptOAEP(e,"sha1");var r=n.match(/^RSAOAEP(\d+)$/);if(null!==r)return t.decryptOAEP(e,"sha"+r[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+i}throw"Cipher.decrypt: unsupported key or algorithm"},A.crypto.Cipher.getAlgByKeyAndName=function(e,t){if(e instanceof ee){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(t))return t;if(null==t)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+t}throw"getAlgByKeyAndName: not supported algorithm name: "+t},A.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 me,Ne,De,we,Te,xe,Ee,je,Ie=(me=function(e,t,i){return Ne(M.AES,e,t,i)},Ne=function(e,t,i,n){var r=M.enc.Hex.parse(t),s=M.enc.Hex.parse(i),o=M.enc.Hex.parse(n),a={};a.key=s,a.iv=o,a.ciphertext=r;var u=e.decrypt(a,s,{iv:o});return M.enc.Hex.stringify(u)},De=function(e,t,i){return we(M.AES,e,t,i)},we=function(e,t,i,n){var r=M.enc.Hex.parse(t),s=M.enc.Hex.parse(i),o=M.enc.Hex.parse(n),a=e.encrypt(r,s,{iv:o}),u=M.enc.Hex.parse(a.toString());return M.enc.Base64.stringify(u)},Te={"AES-256-CBC":{proc:me,eproc:De,keylen:32,ivlen:16},"AES-192-CBC":{proc:me,eproc:De,keylen:24,ivlen:16},"AES-128-CBC":{proc:me,eproc:De,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,t,i){return Ne(M.TripleDES,e,t,i)},eproc:function(e,t,i){return we(M.TripleDES,e,t,i)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,t,i){return Ne(M.DES,e,t,i)},eproc:function(e,t,i){return we(M.DES,e,t,i)},keylen:8,ivlen:8}},xe=function(e){var t={},i=e.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));i&&(t.cipher=i[1],t.ivsalt=i[2]);var n=e.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(t.type=n[1]);var r=-1,s=0;-1!=e.indexOf("\r\n\r\n")&&(r=e.indexOf("\r\n\r\n"),s=2),-1!=e.indexOf("\n\n")&&(r=e.indexOf("\n\n"),s=1);var o=e.indexOf("-----END");if(-1!=r&&-1!=o){var a=e.substring(r+2*s,o-s);a=a.replace(/\s+/g,""),t.data=a}return t},Ee=function(e,t,i){for(var n=i.substring(0,16),r=M.enc.Hex.parse(n),s=M.enc.Utf8.parse(t),o=Te[e].keylen+Te[e].ivlen,a="",u=null;;){var c=M.algo.MD5.create();if(null!=u&&c.update(u),c.update(s),c.update(r),u=c.finalize(),(a+=M.enc.Hex.stringify(u)).length>=2*o)break}var l={};return l.keyhex=a.substr(0,2*Te[e].keylen),l.ivhex=a.substr(2*Te[e].keylen,2*Te[e].ivlen),l},je=function(e,t,i,n){var r=M.enc.Base64.parse(e),s=M.enc.Hex.stringify(r);return(0,Te[t].proc)(s,i,n)},{version:"1.0.0",parsePKCS5PEM:function(e){return xe(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,i){return Ee(e,t,i)},decryptKeyB64:function(e,t,i,n){return je(e,t,i,n)},getDecryptedKeyHex:function(e,t){var i=xe(e);i.type;var n=i.cipher,r=i.ivsalt,s=i.data,o=Ee(n,t,r).keyhex;return je(s,n,o,r)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,i,n,r){var s="";if(void 0!==n&&null!=n||(n="AES-256-CBC"),void 0===Te[n])throw"KEYUTIL unsupported algorithm: "+n;void 0!==r&&null!=r||(r=function(e){var t=M.lib.WordArray.random(e);return M.enc.Hex.stringify(t)}(Te[n].ivlen).toUpperCase());var o=function(e,t,i,n){return(0,Te[t].eproc)(e,i,n)}(t,n,Ee(n,i,r).keyhex,r);return s="-----BEGIN "+e+" PRIVATE KEY-----\r\n",s+="Proc-Type: 4,ENCRYPTED\r\n",s+="DEK-Info: "+n+","+r+"\r\n",s+="\r\n",s+=o.replace(/(.{64})/g,"$1\r\n"),s+="\r\n-----END "+e+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(e){var t=ze,i=t.getChildIdx,n=t.getV,r={},s=i(e,0);if(2!=s.length)throw"malformed format: SEQUENCE(0).items != 2: "+s.length;r.ciphertext=n(e,s[1]);var o=i(e,s[0]);if(2!=o.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+o.length;if("2a864886f70d01050d"!=n(e,o[0]))throw"this only supports pkcs5PBES2";var a=i(e,o[1]);if(2!=o.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+a.length;var u=i(e,a[1]);if(2!=u.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length;if("2a864886f70d0307"!=n(e,u[0]))throw"this only supports TripleDES";r.encryptionSchemeAlg="TripleDES",r.encryptionSchemeIV=n(e,u[1]);var c=i(e,a[0]);if(2!=c.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length;if("2a864886f70d01050c"!=n(e,c[0]))throw"this only supports pkcs5PBKDF2";var l=i(e,c[1]);if(l.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+l.length;r.pbkdf2Salt=n(e,l[0]);var h=n(e,l[1]);try{r.pbkdf2Iter=parseInt(h,16)}catch(e){throw"malformed format pbkdf2Iter: "+h}return r},getPBKDF2KeyHexFromParam:function(e,t){var i=M.enc.Hex.parse(e.pbkdf2Salt),n=e.pbkdf2Iter,r=M.PBKDF2(t,i,{keySize:6,iterations:n});return M.enc.Hex.stringify(r)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var i=Ae(e,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(i),r=Ie.getPBKDF2KeyHexFromParam(n,t),s={};s.ciphertext=M.enc.Hex.parse(n.ciphertext);var o=M.enc.Hex.parse(r),a=M.enc.Hex.parse(n.encryptionSchemeIV),u=M.TripleDES.decrypt(s,o,{iv:a});return M.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(e,t){var i=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(i)},parsePlainPrivatePKCS8Hex:function(e){var t=ze,i=t.getChildIdx,n=t.getV,r={algparam:null};if("30"!=e.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var s=i(e,0);if(s.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(s[1],2))throw new Error("malformed PKCS8 private key(code:003)");var o=i(e,s[1]);if(2!=o.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(o[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(r.algoid=n(e,o[0]),"06"==e.substr(o[1],2)&&(r.algparam=n(e,o[1])),"04"!=e.substr(s[2],2))throw new Error("malformed PKCS8 private key(code:006)");return r.keyidx=t.getVidx(e,s[2]),r},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=Ae(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,i=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==i.algoid)t=new ee;else if("2a8648ce380401"==i.algoid)t=new A.crypto.DSA;else{if("2a8648ce3d0201"!=i.algoid)throw"unsupported private key algorithm";t=new A.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,i=ze.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===i)t=new ee;else if("2a8648ce380401"===i)t=new A.crypto.DSA;else{if("2a8648ce3d0201"!==i)throw"unsupported PKCS#8 public key hex";t=new A.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=ze,i=t.getChildIdx,n=t.getV,r={};if("30"!=e.substr(0,2))throw"malformed RSA key(code:001)";var s=i(e,0);if(2!=s.length)throw"malformed RSA key(code:002)";if("02"!=e.substr(s[0],2))throw"malformed RSA key(code:003)";if(r.n=n(e,s[0]),"02"!=e.substr(s[1],2))throw"malformed RSA key(code:004)";return r.e=n(e,s[1]),r},parsePublicPKCS8Hex:function(e){var t=ze,i=t.getChildIdx,n=t.getV,r={algparam:null},s=i(e,0);if(2!=s.length)throw"outer DERSequence shall have 2 elements: "+s.length;var o=s[0];if("30"!=e.substr(o,2))throw"malformed PKCS8 public key(code:001)";var a=i(e,o);if(2!=a.length)throw"malformed PKCS8 public key(code:002)";if("06"!=e.substr(a[0],2))throw"malformed PKCS8 public key(code:003)";if(r.algoid=n(e,a[0]),"06"==e.substr(a[1],2)?r.algparam=n(e,a[1]):"30"==e.substr(a[1],2)&&(r.algparam={},r.algparam.p=t.getVbyList(e,a[1],[0],"02"),r.algparam.q=t.getVbyList(e,a[1],[1],"02"),r.algparam.g=t.getVbyList(e,a[1],[2],"02")),"03"!=e.substr(s[1],2))throw"malformed PKCS8 public key(code:004)";return r.key=n(e,s[1]).substr(2),r}});Ie.getKey=function(e,t,i){var n=(y=ze).getChildIdx;y.getV;var r=y.getVbyList,s=A.crypto,o=s.ECDSA,a=s.DSA,u=ee,c=Ae,l=Ie;if(void 0!==u&&e instanceof u)return e;if(void 0!==o&&e instanceof o)return e;if(void 0!==a&&e instanceof a)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new o({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new o({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(z=new u).setPublic(e.n,e.e),z;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.co&&void 0===e.qi)return(z=new u).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),z;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(z=new u).setPrivate(e.n,e.e,e.d),z;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(z=new a).setPublic(e.p,e.q,e.g,e.y),z;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(z=new a).setPrivate(e.p,e.q,e.g,e.y,e.x),z;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(z=new u).setPublic(oe(e.n),oe(e.e)),z;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.qi)return(z=new u).setPrivateEx(oe(e.n),oe(e.e),oe(e.d),oe(e.p),oe(e.q),oe(e.dp),oe(e.dq),oe(e.qi)),z;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(z=new u).setPrivate(oe(e.n),oe(e.e),oe(e.d)),z;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var h=(I=new o({curve:e.crv})).ecparams.keylen/4,d="04"+("0000000000"+oe(e.x)).slice(-h)+("0000000000"+oe(e.y)).slice(-h);return I.setPublicKeyHex(d),I}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){h=(I=new o({curve:e.crv})).ecparams.keylen/4,d="04"+("0000000000"+oe(e.x)).slice(-h)+("0000000000"+oe(e.y)).slice(-h);var p=("0000000000"+oe(e.d)).slice(-h);return I.setPublicKeyHex(d),I.setPrivateKeyHex(p),I}if("pkcs5prv"===i){var M,g=e,y=ze;if(9===(M=n(g,0)).length)(z=new u).readPKCS5PrvKeyHex(g);else if(6===M.length)(z=new a).readPKCS5PrvKeyHex(g);else{if(!(M.length>2&&"04"===g.substr(M[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";(z=new o).readPKCS5PrvKeyHex(g)}return z}if("pkcs8prv"===i)return z=l.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===i)return l._getKeyFromPublicPKCS8Hex(e);if("x509pub"===i)return Oe.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return Oe.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var v=Ae(e,"PUBLIC KEY");return l._getKeyFromPublicPKCS8Hex(v)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var m=c(e,"RSA PRIVATE KEY");return l.getKey(m,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var N=r(S=c(e,"DSA PRIVATE KEY"),0,[1],"02"),D=r(S,0,[2],"02"),w=r(S,0,[3],"02"),T=r(S,0,[4],"02"),x=r(S,0,[5],"02");return(z=new a).setPrivate(new f(N,16),new f(D,16),new f(w,16),new f(T,16),new f(x,16)),z}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){m=c(e,"EC PRIVATE KEY");return l.getKey(m,null,"pkcs5prv")}if(-1!=e.indexOf("-END PRIVATE KEY-"))return l.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var E=l.getDecryptedKeyHex(e,t),j=new ee;return j.readPKCS5PrvKeyHex(E),j}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var I,z=r(S=l.getDecryptedKeyHex(e,t),0,[1],"04"),b=r(S,0,[2,0],"06"),L=r(S,0,[3,0],"03").substr(2);if(void 0===A.crypto.OID.oidhex2name[b])throw"undefined OID(hex) in KJUR.crypto.OID: "+b;return(I=new o({curve:A.crypto.OID.oidhex2name[b]})).setPublicKeyHex(L),I.setPrivateKeyHex(z),I.isPublic=!1,I}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var S;N=r(S=l.getDecryptedKeyHex(e,t),0,[1],"02"),D=r(S,0,[2],"02"),w=r(S,0,[3],"02"),T=r(S,0,[4],"02"),x=r(S,0,[5],"02");return(z=new a).setPrivate(new f(N,16),new f(D,16),new f(w,16),new f(T,16),new f(x,16)),z}if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return l.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},Ie.generateKeypair=function(e,t){if("RSA"==e){var i=t;(o=new ee).generate(i,"10001"),o.isPrivate=!0,o.isPublic=!0;var n=new ee,r=o.n.toString(16),s=o.e.toString(16);return n.setPublic(r,s),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=n,a}if("EC"==e){var o,a,u=t,c=new A.crypto.ECDSA({curve:u}).generateKeyPairHex();return(o=new A.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),o.setPrivateKeyHex(c.ecprvhex),o.isPrivate=!0,o.isPublic=!1,(n=new A.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=n,a}throw"unknown algorithm: "+e},Ie.getPEM=function(e,t,i,n,r,s){var o=A,a=o.asn1,u=a.DERObjectIdentifier,c=a.DERInteger,l=a.ASN1Util.newObject,h=a.x509.SubjectPublicKeyInfo,d=o.crypto,p=d.DSA,f=d.ECDSA,g=ee;function y(e){return l({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function v(e){return l({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function m(e){return l({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==g&&e instanceof g||void 0!==p&&e instanceof p||void 0!==f&&e instanceof f)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return de(T=new h(e).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==g&&e instanceof g&&(void 0===i||null==i)&&1==e.isPrivate)return de(T=y(e).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==f&&e instanceof f&&(void 0===i||null==i)&&1==e.isPrivate){var N=new u({name:e.curveName}).getEncodedHex(),D=v(e).getEncodedHex(),w="";return w+=de(N,"EC PARAMETERS"),w+=de(D,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==p&&e instanceof p&&(void 0===i||null==i)&&1==e.isPrivate)return de(T=m(e).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==g&&e instanceof g&&void 0!==i&&null!=i&&1==e.isPrivate){var T=y(e).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",T,i,n,s)}if("PKCS5PRV"==t&&void 0!==f&&e instanceof f&&void 0!==i&&null!=i&&1==e.isPrivate){T=v(e).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",T,i,n,s)}if("PKCS5PRV"==t&&void 0!==p&&e instanceof p&&void 0!==i&&null!=i&&1==e.isPrivate){T=m(e).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",T,i,n,s)}var x=function(e,t){var i=E(e,t);return new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:i.pbkdf2Salt}},{int:i.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:i.encryptionSchemeIV}}]}]}]},{octstr:{hex:i.ciphertext}}]}).getEncodedHex()},E=function(e,t){var i=M.lib.WordArray.random(8),n=M.lib.WordArray.random(8),r=M.PBKDF2(t,i,{keySize:6,iterations:100}),s=M.enc.Hex.parse(e),o=M.TripleDES.encrypt(s,r,{iv:n})+"",a={};return a.ciphertext=o,a.pbkdf2Salt=M.enc.Hex.stringify(i),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=M.enc.Hex.stringify(n),a};if("PKCS8PRV"==t&&null!=g&&e instanceof g&&1==e.isPrivate){var j=y(e).getEncodedHex();T=l({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:j}}]}).getEncodedHex();return void 0===i||null==i?de(T,"PRIVATE KEY"):de(D=x(T,i),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==f&&e instanceof f&&1==e.isPrivate){j=new l({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]}).getEncodedHex(),T=l({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:j}}]}).getEncodedHex();return void 0===i||null==i?de(T,"PRIVATE KEY"):de(D=x(T,i),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==p&&e instanceof p&&1==e.isPrivate){j=new c({bigint:e.x}).getEncodedHex(),T=l({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:j}}]}).getEncodedHex();return void 0===i||null==i?de(T,"PRIVATE KEY"):de(D=x(T,i),"ENCRYPTED PRIVATE KEY")}throw new Error("unsupported object nor format")},Ie.getKeyFromCSRPEM=function(e){var t=Ae(e,"CERTIFICATE REQUEST");return Ie.getKeyFromCSRHex(t)},Ie.getKeyFromCSRHex=function(e){var t=Ie.parseCSRHex(e);return Ie.getKey(t.p8pubkeyhex,null,"pkcs8pub")},Ie.parseCSRHex=function(e){var t=ze,i=t.getChildIdx,n=t.getTLV,r={},s=e;if("30"!=s.substr(0,2))throw"malformed CSR(code:001)";var o=i(s,0);if(o.length<1)throw"malformed CSR(code:002)";if("30"!=s.substr(o[0],2))throw"malformed CSR(code:003)";var a=i(s,o[0]);if(a.length<3)throw"malformed CSR(code:004)";return r.p8pubkeyhex=n(s,a[2]),r},Ie.getKeyID=function(e){var t=Ie,i=ze;"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=t.getKey(e));var n=Ae(t.getPEM(e)),r=i.getIdxbyList(n,0,[1]),s=i.getV(n,r).substring(2);return A.crypto.Util.hashHex(s,"sha1")},Ie.getJWKFromKey=function(e){var t={};if(e instanceof ee&&e.isPrivate)return t.kty="RSA",t.n=se(e.n.toString(16)),t.e=se(e.e.toString(16)),t.d=se(e.d.toString(16)),t.p=se(e.p.toString(16)),t.q=se(e.q.toString(16)),t.dp=se(e.dmp1.toString(16)),t.dq=se(e.dmq1.toString(16)),t.qi=se(e.coeff.toString(16)),t;if(e instanceof ee&&e.isPublic)return t.kty="RSA",t.n=se(e.n.toString(16)),t.e=se(e.e.toString(16)),t;if(e instanceof A.crypto.ECDSA&&e.isPrivate){if("P-256"!==(n=e.getShortNISTPCurveName())&&"P-384"!==n)throw"unsupported curve name for JWT: "+n;var i=e.getPublicKeyXYHex();return t.kty="EC",t.crv=n,t.x=se(i.x),t.y=se(i.y),t.d=se(e.prvKeyHex),t}if(e instanceof A.crypto.ECDSA&&e.isPublic){var n;if("P-256"!==(n=e.getShortNISTPCurveName())&&"P-384"!==n)throw"unsupported curve name for JWT: "+n;i=e.getPublicKeyXYHex();return t.kty="EC",t.crv=n,t.x=se(i.x),t.y=se(i.y),t}throw"not supported key object"},void 0!==A.asn1&&A.asn1||(A.asn1={}),A.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var i=t.substr(1).length;i%2==1?i+=1:t.match(/^[0-7]/)||(i+=2);for(var n="",r=0;r<i;r++)n+="f";t=new f(n,16).xor(e).add(f.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return de(e,t)},this.newObject=function(e){var t=A.asn1,i=t.ASN1Object,n=t.DERBoolean,r=t.DERInteger,s=t.DERBitString,o=t.DEROctetString,a=t.DERNull,u=t.DERObjectIdentifier,c=t.DEREnumerated,l=t.DERUTF8String,h=t.DERNumericString,d=t.DERPrintableString,p=t.DERTeletexString,M=t.DERIA5String,f=t.DERUTCTime,g=t.DERGeneralizedTime,y=t.DERVisibleString,v=t.DERBMPString,m=t.DERSequence,N=t.DERSet,D=t.DERTaggedObject,w=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var T=Object.keys(e);if(1!=T.length)throw new Error("key of param shall be only one.");var x=T[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+x+":"))throw new Error("undefined key: "+x);if("bool"==x)return new n(e[x]);if("int"==x)return new r(e[x]);if("bitstr"==x)return new s(e[x]);if("octstr"==x)return new o(e[x]);if("null"==x)return new a(e[x]);if("oid"==x)return new u(e[x]);if("enum"==x)return new c(e[x]);if("utf8str"==x)return new l(e[x]);if("numstr"==x)return new h(e[x]);if("prnstr"==x)return new d(e[x]);if("telstr"==x)return new p(e[x]);if("ia5str"==x)return new M(e[x]);if("utctime"==x)return new f(e[x]);if("gentime"==x)return new g(e[x]);if("visstr"==x)return new y(e[x]);if("bmpstr"==x)return new v(e[x]);if("asn1"==x)return new i(e[x]);if("seq"==x){for(var E=e[x],j=[],I=0;I<E.length;I++){var z=w(E[I]);j.push(z)}return new m({array:j})}if("set"==x){for(E=e[x],j=[],I=0;I<E.length;I++){z=w(E[I]);j.push(z)}return new N({array:j})}if("tag"==x){var b=e[x];if("[object Array]"===Object.prototype.toString.call(b)&&3==b.length){var L=w(b[2]);return new D({tag:b[0],explicit:b[1],obj:L})}return new D(b)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},A.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",i=parseInt(e.substr(0,2),16),n=(t=Math.floor(i/40)+"."+i%40,""),r=2;r<e.length;r+=2){var s=("00000000"+parseInt(e.substr(r,2),16).toString(2)).slice(-8);if(n+=s.substr(1,7),"0"==s.substr(0,1))t=t+"."+new f(n,2).toString(10),n=""}return t},A.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},i=function(e){var i="",n=new f(e,10).toString(2),r=7-n.length%7;7==r&&(r=0);for(var s="",o=0;o<r;o++)s+="0";n=s+n;for(o=0;o<n.length-1;o+=7){var a=n.substr(o,7);o!=n.length-7&&(a="1"+a),i+=t(parseInt(a,2))}return i};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",r=e.split("."),s=40*parseInt(r[0])+parseInt(r[1]);n+=t(s),r.splice(0,2);for(var o=0;o<r.length;o++)n+=i(r[o]);return n},A.asn1.ASN1Object=function(e){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+"".length+",v="+this.hV);var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var i=t.length/2;if(i>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+i).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},null!=e&&null!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},A.asn1.DERAbstractString=function(e){A.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=ae(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},p.lang.extend(A.asn1.DERAbstractString,A.asn1.ASN1Object),A.asn1.DERAbstractTime=function(e){A.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,i){var n=this.zeroPadding,r=this.localDateToUTC(e),s=String(r.getFullYear());"utc"==t&&(s=s.substr(2,2));var o=s+n(String(r.getMonth()+1),2)+n(String(r.getDate()),2)+n(String(r.getHours()),2)+n(String(r.getMinutes()),2)+n(String(r.getSeconds()),2);if(!0===i){var a=r.getMilliseconds();if(0!=a){var u=n(String(a),3);o=o+"."+(u=u.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=ne(e)},this.setByDateValue=function(e,t,i,n,r,s){var o=new Date(Date.UTC(e,t-1,i,n,r,s,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},p.lang.extend(A.asn1.DERAbstractTime,A.asn1.ASN1Object),A.asn1.DERAbstractStructured=function(e){A.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},p.lang.extend(A.asn1.DERAbstractStructured,A.asn1.ASN1Object),A.asn1.DERBoolean=function(e){A.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},p.lang.extend(A.asn1.DERBoolean,A.asn1.ASN1Object),A.asn1.DERInteger=function(e){A.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=A.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new f(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},p.lang.extend(A.asn1.DERInteger,A.asn1.ASN1Object),A.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=A.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}A.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var i="0"+e;this.hTLV=null,this.isModified=!0,this.hV=i+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var i=0;i<=t;i++)e+="0";var n="";for(i=0;i<e.length-1;i+=8){var r=e.substr(i,8),s=parseInt(r,2).toString(16);1==s.length&&(s="0"+s),n+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",i=0;i<e.length;i++)1==e[i]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),i=0;i<e;i++)t[i]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},p.lang.extend(A.asn1.DERBitString,A.asn1.ASN1Object),A.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=A.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}A.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},p.lang.extend(A.asn1.DEROctetString,A.asn1.DERAbstractString),A.asn1.DERNull=function(){A.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},p.lang.extend(A.asn1.DERNull,A.asn1.ASN1Object),A.asn1.DERObjectIdentifier=function(e){A.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){var t=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},i=function(e){var i="",n=parseInt(e,10).toString(2),r=7-n.length%7;7==r&&(r=0);for(var s="",o=0;o<r;o++)s+="0";for(n=s+n,o=0;o<n.length-1;o+=7){var a=n.substr(o,7);o!=n.length-7&&(a="1"+a),i+=t(parseInt(a,2))}return i};try{if(!e.match(/^[0-9.]+$/))return null;var n="",r=e.split("."),s=40*parseInt(r[0],10)+parseInt(r[1],10);n+=t(s),r.splice(0,2);for(var o=0;o<r.length;o++)n+=i(r[o]);return n}catch(e){return null}}(e);if(null==t)throw new Error("malformed oid string: "+e);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueName=function(e){var t=A.asn1.x509.OID.name2oid(e);if(""===t)throw new Error("DERObjectIdentifier oidName undefined: "+e);this.setValueOidString(t)},this.setValueNameOrOid=function(e){e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){"string"==typeof e?this.setValueNameOrOid(e):void 0!==e.oid?this.setValueNameOrOid(e.oid):void 0!==e.name?this.setValueNameOrOid(e.name):void 0!==e.hex&&this.setValueHex(e.hex)},void 0!==e&&this.setByParam(e)},p.lang.extend(A.asn1.DERObjectIdentifier,A.asn1.ASN1Object),A.asn1.DEREnumerated=function(e){A.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=A.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new f(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},p.lang.extend(A.asn1.DEREnumerated,A.asn1.ASN1Object),A.asn1.DERUTF8String=function(e){A.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},p.lang.extend(A.asn1.DERUTF8String,A.asn1.DERAbstractString),A.asn1.DERNumericString=function(e){A.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},p.lang.extend(A.asn1.DERNumericString,A.asn1.DERAbstractString),A.asn1.DERPrintableString=function(e){A.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},p.lang.extend(A.asn1.DERPrintableString,A.asn1.DERAbstractString),A.asn1.DERTeletexString=function(e){A.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},p.lang.extend(A.asn1.DERTeletexString,A.asn1.DERAbstractString),A.asn1.DERIA5String=function(e){A.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},p.lang.extend(A.asn1.DERIA5String,A.asn1.DERAbstractString),A.asn1.DERVisibleString=function(e){A.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"},p.lang.extend(A.asn1.DERVisibleString,A.asn1.DERAbstractString),A.asn1.DERBMPString=function(e){A.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"},p.lang.extend(A.asn1.DERBMPString,A.asn1.DERAbstractString),A.asn1.DERUTCTime=function(e){A.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=ne(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=ne(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},p.lang.extend(A.asn1.DERUTCTime,A.asn1.DERAbstractTime),A.asn1.DERGeneralizedTime=function(e){A.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=ne(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=ne(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},p.lang.extend(A.asn1.DERGeneralizedTime,A.asn1.DERAbstractTime),A.asn1.DERSequence=function(e){A.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++){e+=this.asn1Array[t].getEncodedHex()}return this.hV=e,this.hV}},p.lang.extend(A.asn1.DERSequence,A.asn1.DERAbstractStructured),A.asn1.DERSet=function(e){A.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var i=this.asn1Array[t];e.push(i.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},p.lang.extend(A.asn1.DERSet,A.asn1.DERAbstractStructured),A.asn1.DERTaggedObject=function(e){A.asn1.DERTaggedObject.superclass.constructor.call(this);var t=A.asn1;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,i){this.hT=t,this.isExplicit=e,this.asn1Object=i,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=i.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){null!=e.tag&&(this.hT=e.tag),null!=e.explicit&&(this.isExplicit=e.explicit),null!=e.tage&&(this.hT=e.tage,this.isExplicit=!0),null!=e.tagi&&(this.hT=e.tagi,this.isExplicit=!1),null!=e.obj&&(e.obj instanceof t.ASN1Object?(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)):"object"==typeof e.obj&&(this.asn1Object=t.ASN1Util.newObject(e.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},null!=e&&this.setByParam(e)},p.lang.extend(A.asn1.DERTaggedObject,A.asn1.ASN1Object);var ze=new function(){};function be(e,t){for(var i="",n=t/4-e.length,r=0;r<n;r++)i+="0";return i+e}function Le(e,t,i){for(var n="",r=0;n.length<t;)n+=ce(i(le(e+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])))),r+=1;return n}function Se(e){for(var t in A.crypto.Util.DIGESTINFOHEAD){var i=A.crypto.Util.DIGESTINFOHEAD[t],n=i.length;if(e.substring(0,n)==i)return[t,e.substring(n)]}return[]}function Oe(e){var t,i=ze,n=i.getChildIdx,r=i.getV,s=i.getTLV,o=i.getVbyList,a=i.getVbyListEx,u=i.getTLVbyList,c=i.getTLVbyListEx,l=i.getIdxbyList,h=i.getIdxbyListEx,d=i.getVidx,p=i.getInt,M=i.oidname,f=i.hextooidstr,g=Ae;try{t=A.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}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(null===this.hex||0!==this.version)return this.version;var e=u(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=u(e,0,[0]),i=p(t,0);if(i<0||2<i)throw new Error("malformed version field");return this.version=i+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return a(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var e=c(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(e)},this.getAlgorithmIdentifierName=function(e){for(var i in t)if(e===t[i])return i;return M(a(e,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return u(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return u(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var e=o(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getNotAfter=function(){var e=o(this.hex,0,[0,4+this.foffset,1]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getPublicKeyHex=function(){return i.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 e=this.getPublicKeyIdx();return l(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return Ie.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=u(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return o(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),i=this.getSignatureValueHex(),n=u(this.hex,0,[0],"30"),r=new A.crypto.Signature({alg:t});return r.init(e),r.updateHex(n),r.verify(i)},this.parseExt=function(e){var t,s,a;if(void 0===e){if(a=this.hex,3!==this.version)return-1;t=l(a,0,[0,7,0],"30"),s=n(a,t)}else{a=Ae(e);var u=l(a,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=r(a,u))return void(this.aExtInfo=new Array);t=l(a,0,[0,3,0,1,0],"30"),s=n(a,t),this.hex=a}this.aExtInfo=new Array;for(var c=0;c<s.length;c++){var h={critical:!1},A=0;3===n(a,s[c]).length&&(h.critical=!0,A=1),h.oid=i.hextooidstr(o(a,s[c],[0],"06"));var p=l(a,s[c],[1+A]);h.vidx=d(a,p),this.aExtInfo.push(h)}},this.getExtInfo=function(e){var t=this.aExtInfo,i=e;if(e.match(/^[0-9.]+$/)||(i=A.asn1.x509.OID.name2oid(e)),""!==i)for(var n=0;n<t.length;n++)if(t[n].oid===i)return t[n]},this.getExtBasicConstraints=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("basicConstraints");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var n={extname:"basicConstraints"};if(t&&(n.critical=!0),"3000"===e)return n;if("30030101ff"===e)return n.cA=!0,n;if("30060101ff02"===e.substr(0,12)){var o=r(e,10),a=parseInt(o,16);return n.cA=!0,n.pathLen=a,n}throw new Error("hExtV parse error: "+e)},this.getExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("keyUsage");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var n={extname:"keyUsage"};return t&&(n.critical=!0),n.names=this.getExtKeyUsageString(e).split(","),n},this.getExtKeyUsageBin=function(e){if(void 0===e){var t=this.getExtInfo("keyUsage");if(void 0===t)return"";e=s(this.hex,t.vidx)}if(8!=e.length&&10!=e.length)throw new Error("malformed key usage value: "+e);var i="000000000000000"+parseInt(e.substr(6),16).toString(2);return 8==e.length&&(i=i.slice(-8)),10==e.length&&(i=i.slice(-16)),""==(i=i.replace(/0+$/,""))&&(i="0"),i},this.getExtKeyUsageString=function(e){for(var t=this.getExtKeyUsageBin(e),i=new Array,n=0;n<t.length;n++)"1"==t.substr(n,1)&&i.push(Oe.KEYUSAGE_NAME[n]);return i.join(",")},this.getExtSubjectKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("subjectKeyIdentifier");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var n={extname:"subjectKeyIdentifier"};t&&(n.critical=!0);var o=r(e,0);return n.kid={hex:o},n},this.getExtAuthorityKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("authorityKeyIdentifier");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var o={extname:"authorityKeyIdentifier"};t&&(o.critical=!0);for(var a=n(e,0),u=0;u<a.length;u++){var c=e.substr(a[u],2);if("80"===c&&(o.kid={hex:r(e,a[u])}),"a1"===c){var l=s(e,a[u]),h=this.getGeneralNames(l);o.issuer=h[0].dn}"82"===c&&(o.sn={hex:r(e,a[u])})}return o},this.getExtExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("extKeyUsage");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var o={extname:"extKeyUsage",array:[]};t&&(o.critical=!0);for(var a=n(e,0),u=0;u<a.length;u++)o.array.push(M(r(e,a[u])));return o},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var t=new Array,i=s(this.hex,e.vidx);if(""===i)return t;for(var o=n(i,0),a=0;a<o.length;a++)t.push(M(r(i,o[a])));return t},this.getExtSubjectAltName=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("subjectAltName");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var n={extname:"subjectAltName",array:[]};return t&&(n.critical=!0),n.array=this.getGeneralNames(e),n},this.getExtIssuerAltName=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("issuerAltName");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var n={extname:"issuerAltName",array:[]};return t&&(n.critical=!0),n.array=this.getGeneralNames(e),n},this.getGeneralNames=function(e){for(var t=n(e,0),i=[],r=0;r<t.length;r++){var o=this.getGeneralName(s(e,t[r]));void 0!==o&&i.push(o)}return i},this.getGeneralName=function(e){var t=e.substr(0,2),i=r(e,0),n=ce(i);return"81"==t?{rfc822:n}:"82"==t?{dns:n}:"86"==t?{uri:n}:"87"==t?{ip:pe(i)}:"a4"==t?{dn:this.getX500Name(i)}:void 0},this.getExtSubjectAltName2=function(){var e,t,i,o=this.getExtInfo("subjectAltName");if(void 0===o)return o;for(var a=new Array,u=s(this.hex,o.vidx),c=n(u,0),l=0;l<c.length;l++)i=u.substr(c[l],2),e=r(u,c[l]),"81"===i&&(t=ue(e),a.push(["MAIL",t])),"82"===i&&(t=ue(e),a.push(["DNS",t])),"84"===i&&(t=Oe.hex2dn(e,0),a.push(["DN",t])),"86"===i&&(t=ue(e),a.push(["URI",t])),"87"===i&&(t=pe(e),a.push(["IP",t]));return a},this.getExtCRLDistributionPoints=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("cRLDistributionPoints");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var r={extname:"cRLDistributionPoints",array:[]};t&&(r.critical=!0);for(var o=n(e,0),a=0;a<o.length;a++){var u=s(e,o[a]);r.array.push(this.getDistributionPoint(u))}return r},this.getDistributionPoint=function(e){for(var t={},i=n(e,0),r=0;r<i.length;r++){var o=e.substr(i[r],2),a=s(e,i[r]);"a0"==o&&(t.dpname=this.getDistributionPointName(a))}return t},this.getDistributionPointName=function(e){for(var t={},i=n(e,0),r=0;r<i.length;r++){var o=e.substr(i[r],2),a=s(e,i[r]);"a0"==o&&(t.full=this.getGeneralNames(a))}return t},this.getExtCRLDistributionPointsURI=function(){var e=this.getExtInfo("cRLDistributionPoints");if(void 0===e)return e;for(var t=new Array,i=n(this.hex,e.vidx),r=0;r<i.length;r++)try{var s=ue(o(this.hex,i[r],[0,0,0],"86"));t.push(s)}catch(e){}return t},this.getExtAIAInfo=function(){var e=this.getExtInfo("authorityInfoAccess");if(void 0===e)return e;for(var t={ocsp:[],caissuer:[]},i=n(this.hex,e.vidx),r=0;r<i.length;r++){var s=o(this.hex,i[r],[0],"06"),a=o(this.hex,i[r],[1],"86");"2b06010505073001"===s&&t.ocsp.push(ue(a)),"2b06010505073002"===s&&t.caissuer.push(ue(a))}return t},this.getExtAuthorityInfoAccess=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("authorityInfoAccess");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var r={extname:"authorityInfoAccess",array:[]};t&&(r.critical=!0);for(var u=n(e,0),c=0;c<u.length;c++){var l=a(e,u[c],[0],"06"),h=ue(o(e,u[c],[1],"86"));if("2b06010505073001"==l)r.array.push({ocsp:h});else{if("2b06010505073002"!=l)throw new Error("unknown method: "+l);r.array.push({caissuer:h})}}return r},this.getExtCertificatePolicies=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("certificatePolicies");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var r={extname:"certificatePolicies",array:[]};t&&(r.critical=!0);for(var o=n(e,0),a=0;a<o.length;a++){var u=s(e,o[a]),c=this.getPolicyInformation(u);r.array.push(c)}return r},this.getPolicyInformation=function(e){var t={},i=o(e,0,[0],"06");t.policyoid=M(i);var r=h(e,0,[1],"30");if(-1!=r){t.array=[];for(var a=n(e,r),u=0;u<a.length;u++){var c=s(e,a[u]),l=this.getPolicyQualifierInfo(c);t.array.push(l)}}return t},this.getPolicyQualifierInfo=function(e){var t={},i=o(e,0,[0],"06");if("2b06010505070201"===i){var n=a(e,0,[1],"16");t.cps=ce(n)}else if("2b06010505070202"===i){var r=u(e,0,[1],"30");t.unotice=this.getUserNotice(r)}return t},this.getUserNotice=function(e){for(var t={},i=n(e,0),r=0;r<i.length;r++){var o=s(e,i[r]);"30"!=o.substr(0,2)&&(t.exptext=this.getDisplayText(o))}return t},this.getDisplayText=function(e){var t={};return t.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[e.substr(0,2)],t.str=ce(r(e,0)),t},this.getExtCRLNumber=function(e,t){var i={extname:"cRLNumber"};if(t&&(i.critical=!0),"02"==e.substr(0,2))return i.num={hex:r(e,0)},i;throw new Error("hExtV parse error: "+e)},this.getExtCRLReason=function(e,t){var i={extname:"cRLReason"};if(t&&(i.critical=!0),"0a"==e.substr(0,2))return i.code=parseInt(r(e,0),16),i;throw new Error("hExtV parse error: "+e)},this.getExtOcspNonce=function(e,t){var i={extname:"ocspNonce"};t&&(i.critical=!0);var n=r(e,0);return i.hex=n,i},this.getExtOcspNoCheck=function(e,t){var i={extname:"ocspNoCheck"};return t&&(i.critical=!0),i},this.getExtAdobeTimeStamp=function(e,t){if(void 0===e&&void 0===t){var i=this.getExtInfo("adobeTimeStamp");if(void 0===i)return;e=s(this.hex,i.vidx),t=i.critical}var r={extname:"adobeTimeStamp"};t&&(r.critical=!0);var o=n(e,0);if(o.length>1){var a=s(e,o[1]),u=this.getGeneralName(a);null!=u.uri&&(r.uri=u.uri)}if(o.length>2){var c=s(e,o[2]);"0101ff"==c&&(r.reqauth=!0),"010100"==c&&(r.reqauth=!1)}return r},this.getX500NameRule=function(e){for(var t=null,i=[],n=0;n<e.length;n++)for(var r=e[n],s=0;s<r.length;s++)i.push(r[s]);for(n=0;n<i.length;n++){var o=i[n],a=o.ds,u=o.value,c=o.type;if("prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=c)return"mixed";if(A.lang.String.isMail(u))continue;return"mixed"}if("C"==c){if("prn"==a)continue;return"mixed"}if(null==t)t=a;else if(t!==a)return"mixed"}return null==t?"prn":t},this.getX500Name=function(e){var t=this.getX500NameArray(e);return{array:t,str:this.dnarraytostr(t)}},this.getX500NameArray=function(e){for(var t=[],i=n(e,0),r=0;r<i.length;r++)t.push(this.getRDN(s(e,i[r])));return t},this.getRDN=function(e){for(var t=[],i=n(e,0),r=0;r<i.length;r++)t.push(this.getAttrTypeAndValue(s(e,i[r])));return t},this.getAttrTypeAndValue=function(e){var t={type:null,value:null,ds:null},i=n(e,0),r=o(e,i[0],[],"06"),s=o(e,i[1],[]),a=A.asn1.ASN1Util.oidHexToInt(r);return t.type=A.asn1.x509.OID.oid2atype(a),t.ds=this.HEX2STAG[e.substr(i[1],2)],"bmp"!=t.ds?t.value=ue(s):t.value=Me(s),t},this.readCertPEM=function(e){this.readCertHex(g(e))},this.readCertHex=function(e){this.hex=e,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(e){}},this.getParam=function(){var e={};return e.version=this.getVersion(),e.serial={hex:this.getSerialNumberHex()},e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(),e.notbefore=this.getNotBefore(),e.notafter=this.getNotAfter(),e.subject=this.getSubject(),e.sbjpubkey=de(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),e},this.getExtParamArray=function(e){null==e&&(-1!=h(this.hex,0,[0,"[3]"])&&(e=c(this.hex,0,[0,"[3]",0],"30")));for(var t=[],i=n(e,0),r=0;r<i.length;r++){var o=s(e,i[r]),a=this.getExtParam(o);null!=a&&t.push(a)}return t},this.getExtParam=function(e){var t=n(e,0).length;if(2!=t&&3!=t)throw new Error("wrong number elements in Extension: "+t+" "+e);var i=f(o(e,0,[0],"06")),r=!1;3==t&&"0101ff"==u(e,0,[1])&&(r=!0);var s=u(e,0,[t-1,0]),a=void 0;if("2.5.29.14"==i?a=this.getExtSubjectKeyIdentifier(s,r):"2.5.29.15"==i?a=this.getExtKeyUsage(s,r):"2.5.29.17"==i?a=this.getExtSubjectAltName(s,r):"2.5.29.18"==i?a=this.getExtIssuerAltName(s,r):"2.5.29.19"==i?a=this.getExtBasicConstraints(s,r):"2.5.29.31"==i?a=this.getExtCRLDistributionPoints(s,r):"2.5.29.32"==i?a=this.getExtCertificatePolicies(s,r):"2.5.29.35"==i?a=this.getExtAuthorityKeyIdentifier(s,r):"2.5.29.37"==i?a=this.getExtExtKeyUsage(s,r):"1.3.6.1.5.5.7.1.1"==i?a=this.getExtAuthorityInfoAccess(s,r):"2.5.29.20"==i?a=this.getExtCRLNumber(s,r):"2.5.29.21"==i?a=this.getExtCRLReason(s,r):"1.3.6.1.5.5.7.48.1.2"==i?a=this.getExtOcspNonce(s,r):"1.3.6.1.5.5.7.48.1.5"==i?a=this.getExtOcspNoCheck(s,r):"1.2.840.113583.1.1.9.1"==i&&(a=this.getExtAdobeTimeStamp(s,r)),null!=a)return a;var c={extname:i,extn:s};return r&&(c.critical=!0),c},this.findExt=function(e,t){for(var i=0;i<e.length;i++)if(e[i].extname==t)return e[i];return null},this.updateExtCDPFullURI=function(e,t){var i=this.findExt(e,"cRLDistributionPoints");if(null!=i&&null!=i.array)for(var n=i.array,r=0;r<n.length;r++)if(null!=n[r].dpname&&null!=n[r].dpname.full)for(var s=n[r].dpname.full,o=0;o<s.length;o++){var a=s[r];null!=a.uri&&(a.uri=t)}},this.updateExtAIAOCSP=function(e,t){var i=this.findExt(e,"authorityInfoAccess");if(null!=i&&null!=i.array)for(var n=i.array,r=0;r<n.length;r++)null!=n[r].ocsp&&(n[r].ocsp=t)},this.updateExtAIACAIssuer=function(e,t){var i=this.findExt(e,"authorityInfoAccess");if(null!=i&&null!=i.array)for(var n=i.array,r=0;r<n.length;r++)null!=n[r].caissuer&&(n[r].caissuer=t)},this.dnarraytostr=function(e){return"/"+e.map((function(e){return function(e){return e.map((function(e){return function(e){return e.type+"="+e.value}(e).replace(/\+/,"\\+")})).join("+")}(e).replace(/\//,"\\/")})).join("/")},this.getInfo=function(){var e,t,i,n,r=function(e){for(var t="",i=e.array,n=0;n<i.length;n++){var r=i[n];if(t+=" policy oid: "+r.policyoid+"\n",void 0!==r.array)for(var s=0;s<r.array.length;s++){var o=r.array[s];void 0!==o.cps&&(t+=" cps: "+o.cps+"\n")}}return t},s=function(e){for(var t="",i=e.array,n=0;n<i.length;n++){var r=i[n];try{void 0!==r.dpname.full[0].uri&&(t+=" "+r.dpname.full[0].uri+"\n")}catch(e){}try{void 0!==r.dname.full[0].dn.hex&&(t+=" "+Oe.hex2dn(r.dpname.full[0].dn.hex)+"\n")}catch(e){}}return t},o=function(e){for(var t="",i=e.array,n=0;n<i.length;n++){var r=i[n];void 0!==r.caissuer&&(t+=" caissuer: "+r.caissuer+"\n"),void 0!==r.ocsp&&(t+=" ocsp: "+r.ocsp+"\n")}return t};if(e="Basic Fields\n",e+=" serial number: "+this.getSerialNumberHex()+"\n",e+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",e+=" issuer: "+this.getIssuerString()+"\n",e+=" notBefore: "+this.getNotBefore()+"\n",e+=" notAfter: "+this.getNotAfter()+"\n",e+=" subject: "+this.getSubjectString()+"\n",e+=" subject public key info: \n",e+=" key algorithm: "+(t=this.getPublicKey()).type+"\n","RSA"===t.type&&(e+=" n="+ge(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+ge(t.e.toString(16))+"\n"),null!=(i=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var a=0;a<i.length;a++){var u=i[a],c=A.asn1.x509.OID.oid2name(u.oid);""===c&&(c=u.oid);var l="";if(!0===u.critical&&(l="CRITICAL"),e+=" "+c+" "+l+":\n","basicConstraints"===c){var h=this.getExtBasicConstraints();void 0===h.cA?e+=" {}\n":(e+=" cA=true",void 0!==h.pathLen&&(e+=", pathLen="+h.pathLen),e+="\n")}else if("keyUsage"===c)e+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===c)e+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===c){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(e+=" kid="+d.kid.hex+"\n")}else{if("extKeyUsage"===c)e+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"===c)e+=" "+(n=this.getExtSubjectAltName(),JSON.stringify(n.array).replace(/[\[\]\{\}\"]/g,""))+"\n";else if("cRLDistributionPoints"===c)e+=s(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"===c)e+=o(this.getExtAuthorityInfoAccess());else"certificatePolicies"===c&&(e+=r(this.getExtCertificatePolicies()))}}}return e+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n",e+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?this.readCertPEM(e):A.lang.String.isHex(e)&&this.readCertHex(e))}function Ce(e){return M.SHA256(e).toString()}ze.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var i=parseInt(e.substr(t+3,1));return 0==i?-1:0<i&&i<10?i+1:-2},ze.getL=function(e,t){var i=ze.getLblen(e,t);return i<1?"":e.substr(t+2,2*i)},ze.getVblen=function(e,t){var i;return""==(i=ze.getL(e,t))?-1:("8"===i.substr(0,1)?new f(i.substr(2),16):new f(i,16)).intValue()},ze.getVidx=function(e,t){var i=ze.getLblen(e,t);return i<0?i:t+2*(i+1)},ze.getV=function(e,t){var i=ze.getVidx(e,t),n=ze.getVblen(e,t);return e.substr(i,2*n)},ze.getTLV=function(e,t){return e.substr(t,2)+ze.getL(e,t)+ze.getV(e,t)},ze.getTLVblen=function(e,t){return 2+2*ze.getLblen(e,t)+2*ze.getVblen(e,t)},ze.getNextSiblingIdx=function(e,t){return ze.getVidx(e,t)+2*ze.getVblen(e,t)},ze.getChildIdx=function(e,t){var i,n,r,s=ze,o=[];i=s.getVidx(e,t),n=2*s.getVblen(e,t),"03"==e.substr(t,2)&&(i+=2,n-=2),r=0;for(var a=i;r<=n;){var u=s.getTLVblen(e,a);if((r+=u)<=n&&o.push(a),a+=u,r>=n)break}return o},ze.getNthChildIdx=function(e,t,i){return ze.getChildIdx(e,t)[i]},ze.getIdxbyList=function(e,t,i,n){var r,s,o=ze;return 0==i.length?void 0!==n&&e.substr(t,2)!==n?-1:t:(r=i.shift())>=(s=o.getChildIdx(e,t)).length?-1:o.getIdxbyList(e,s[r],i,n)},ze.getIdxbyListEx=function(e,t,i,n){var r,s,o=ze;if(0==i.length)return void 0!==n&&e.substr(t,2)!==n?-1:t;r=i.shift(),s=o.getChildIdx(e,t);for(var a=0,u=0;u<s.length;u++){var c=e.substr(s[u],2);if("number"==typeof r&&!o.isContextTag(c)&&a==r||"string"==typeof r&&o.isContextTag(c,r))return o.getIdxbyListEx(e,s[u],i,n);o.isContextTag(c)||a++}return-1},ze.getTLVbyList=function(e,t,i,n){var r=ze,s=r.getIdxbyList(e,t,i,n);return-1==s||s>=e.length?null:r.getTLV(e,s)},ze.getTLVbyListEx=function(e,t,i,n){var r=ze,s=r.getIdxbyListEx(e,t,i,n);return-1==s?null:r.getTLV(e,s)},ze.getVbyList=function(e,t,i,n,r){var s,o,a=ze;return-1==(s=a.getIdxbyList(e,t,i,n))||s>=e.length?null:(o=a.getV(e,s),!0===r&&(o=o.substr(2)),o)},ze.getVbyListEx=function(e,t,i,n,r){var s,o,a=ze;return-1==(s=a.getIdxbyListEx(e,t,i,n))?null:(o=a.getV(e,s),"03"==e.substr(s,2)&&!1!==r&&(o=o.substr(2)),o)},ze.getInt=function(e,t,i){null==i&&(i=-1);try{var n=e.substr(t,2);if("02"!=n&&"03"!=n)return i;var r=ze.getV(e,t);return"02"==n?parseInt(r,16):function(e){try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var i=parseInt(t,16),n=e.substr(2),r=parseInt(n,16).toString(2);return"0"==r&&(r="00000000"),r=r.slice(0,0-i),parseInt(r,2)}catch(e){return-1}}(r)}catch(e){return i}},ze.getOID=function(e,t,i){null==i&&(i=null);try{return"06"!=e.substr(t,2)?i:function(e){if(!fe(e))return null;try{var t=[],i=e.substr(0,2),n=parseInt(i,16);t[0]=new String(Math.floor(n/40)),t[1]=new String(n%40);for(var r=e.substr(2),s=[],o=0;o<r.length/2;o++)s.push(parseInt(r.substr(2*o,2),16));var a=[],u="";for(o=0;o<s.length;o++)128&s[o]?u+=ye((127&s[o]).toString(2),7):(u+=ye((127&s[o]).toString(2),7),a.push(new String(parseInt(u,2))),u="");var c=t.join(".");return a.length>0&&(c=c+"."+a.join(".")),c}catch(e){return null}}(ze.getV(e,t))}catch(e){return i}},ze.getOIDName=function(e,t,i){null==i&&(i=null);try{var n=ze.getOID(e,t,i);if(n==i)return i;var r=A.asn1.x509.OID.oid2name(n);return""==r?n:r}catch(e){return i}},ze.getString=function(e,t,i){null==i&&(i=null);try{return ce(ze.getV(e,t))}catch(e){return i}},ze.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},i=[],n=e.substr(0,2),r=parseInt(n,16);i[0]=new String(Math.floor(r/40)),i[1]=new String(r%40);for(var s=e.substr(2),o=[],a=0;a<s.length/2;a++)o.push(parseInt(s.substr(2*a,2),16));var u=[],c="";for(a=0;a<o.length;a++)128&o[a]?c+=t((127&o[a]).toString(2),7):(c+=t((127&o[a]).toString(2),7),u.push(new String(parseInt(c,2))),c="");var l=i.join(".");return u.length>0&&(l=l+"."+u.join(".")),l},ze.dump=function(e,t,i,n){var r=ze,s=r.getV,o=r.dump,a=r.getChildIdx,u=e;e instanceof A.asn1.ASN1Object&&(u=e.getEncodedHex());var c=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===i&&(i=0),void 0===n&&(n="");var l,h=t.ommit_long_octet;if("01"==(l=u.substr(i,2)))return"00"==(d=s(u,i))?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n";if("02"==l)return n+"INTEGER "+c(d=s(u,i),h)+"\n";if("03"==l){var d=s(u,i);if(r.isASN1HEX(d.substr(2))){var p=n+"BITSTRING, encapsulates\n";return p+=o(d.substr(2),t,0,n+" ")}return n+"BITSTRING "+c(d,h)+"\n"}if("04"==l){d=s(u,i);if(r.isASN1HEX(d)){p=n+"OCTETSTRING, encapsulates\n";return p+=o(d,t,0,n+" ")}return n+"OCTETSTRING "+c(d,h)+"\n"}if("05"==l)return n+"NULL\n";if("06"==l){var M=s(u,i),f=A.asn1.ASN1Util.oidHexToInt(M),g=A.asn1.x509.OID.oid2name(f),y=f.replace(/\./g," ");return""!=g?n+"ObjectIdentifier "+g+" ("+y+")\n":n+"ObjectIdentifier ("+y+")\n"}if("0a"==l)return n+"ENUMERATED "+parseInt(s(u,i))+"\n";if("0c"==l)return n+"UTF8String '"+ue(s(u,i))+"'\n";if("13"==l)return n+"PrintableString '"+ue(s(u,i))+"'\n";if("14"==l)return n+"TeletexString '"+ue(s(u,i))+"'\n";if("16"==l)return n+"IA5String '"+ue(s(u,i))+"'\n";if("17"==l)return n+"UTCTime "+ue(s(u,i))+"\n";if("18"==l)return n+"GeneralizedTime "+ue(s(u,i))+"\n";if("1a"==l)return n+"VisualString '"+ue(s(u,i))+"'\n";if("1e"==l)return n+"BMPString '"+Me(s(u,i))+"'\n";if("30"==l){if("3000"==u.substr(i,4))return n+"SEQUENCE {}\n";p=n+"SEQUENCE\n";var v=t;if((2==(D=a(u,i)).length||3==D.length)&&"06"==u.substr(D[0],2)&&"04"==u.substr(D[D.length-1],2)){g=r.oidname(s(u,D[0]));var m=JSON.parse(JSON.stringify(t));m.x509ExtName=g,v=m}for(var N=0;N<D.length;N++)p+=o(u,v,D[N],n+" ");return p}if("31"==l){p=n+"SET\n";var D=a(u,i);for(N=0;N<D.length;N++)p+=o(u,t,D[N],n+" ");return p}if(0!=(128&(l=parseInt(l,16)))){var w=31&l;if(0!=(32&l)){for(p=n+"["+w+"]\n",D=a(u,i),N=0;N<D.length;N++)p+=o(u,t,D[N],n+" ");return p}d=s(u,i);if(ze.isASN1HEX(d)){var p=n+"["+w+"]\n";return p+=o(d,t,0,n+" ")}return("68747470"==d.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==w)&&(d=ue(d)),p=n+"["+w+"] "+d+"\n"}return n+"UNKNOWN("+l+") "+s(u,i)+"\n"},ze.isContextTag=function(e,t){var i,n;e=e.toLowerCase();try{i=parseInt(e,16)}catch(e){return-1}if(void 0===t)return 128==(192&i);try{return null!=t.match(/^\[[0-9]+\]$/)&&(!((n=parseInt(t.substr(1,t.length-1),10))>31)&&(128==(192&i)&&(31&i)==n))}catch(e){return!1}},ze.isASN1HEX=function(e){var t=ze;if(e.length%2==1)return!1;var i=t.getVblen(e,0),n=e.substr(0,2),r=t.getL(e,0);return e.length-n.length-r.length==2*i},ze.checkStrictDER=function(e,t,i,n,r){var s=ze;if(void 0===i){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!A.lang.String.isHex(e))throw new Error("not hex string");i=e.length,r=(n=e.length/2)<128?1:Math.ceil(n.toString(16))+1}if(s.getL(e,t).length>2*r)throw new Error("L of TLV too long: idx="+t);var o=s.getVblen(e,t);if(o>n)throw new Error("value of L too long than hex: idx="+t);var a=s.getTLV(e,t),u=a.length-2-s.getL(e,t).length;if(u!==2*o)throw new Error("V string length and L's value not the same:"+u+"/"+2*o);if(0===t&&e.length!=a.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+a.length);var c=e.substr(t,2);if("02"===c){var l=s.getVidx(e,t);if("00"==e.substr(l,2)&&e.charCodeAt(l+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(c,16)){for(var h=s.getVblen(e,t),d=0,p=s.getChildIdx(e,t),M=0;M<p.length;M++){d+=s.getTLV(e,p[M]).length,s.checkStrictDER(e,p[M],i,n,r)}if(2*h!=d)throw new Error("sum of children's TLV length and L unmatch: "+2*h+"!="+d)}},ze.oidname=function(e){var t=A.asn1;A.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var i=t.x509.OID.oid2name(e);return""===i&&(i=e),i},void 0!==A.asn1&&A.asn1||(A.asn1={}),void 0!==A.asn1.x509&&A.asn1.x509||(A.asn1.x509={}),A.asn1.x509.Certificate=function(e){A.asn1.x509.Certificate.superclass.constructor.call(this);var t=A.asn1,i=t.DERBitString,n=t.DERSequence,r=t.x509,s=r.TBSCertificate,o=r.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(e){this.params=e},this.sign=function(){var e=this.params,t=e.sigalg;null!=e.sigalg.name&&(t=e.sigalg.name);var i=e.tbsobj.getEncodedHex(),n=new A.crypto.Signature({alg:t});n.init(e.cakey),n.updateHex(i),e.sighex=n.sign()},this.getPEM=function(){return de(this.getEncodedHex(),"CERTIFICATE")},this.getEncodedHex=function(){var e=this.params;if(null!=e.tbsobj&&null!=e.tbsobj||(e.tbsobj=new s(e)),null==e.sighex&&null!=e.cakey&&this.sign(),null==e.sighex)throw new Error("sighex or cakey parameter not defined");var t=[];return t.push(e.tbsobj),t.push(new o({name:e.sigalg})),t.push(new i({hex:"00"+e.sighex})),new n({array:t}).getEncodedHex()},null!=e&&(this.params=e)},ve(A.asn1.x509.Certificate,A.asn1.ASN1Object),A.asn1.x509.TBSCertificate=function(e){A.asn1.x509.TBSCertificate.superclass.constructor.call(this);var t=A.asn1,i=t.x509,n=t.DERTaggedObject,r=t.DERInteger,s=t.DERSequence,o=i.AlgorithmIdentifier,a=i.Time,u=i.X500Name,c=i.Extensions,l=i.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(e){this.params=e},this.getEncodedHex=function(){var e=[],t=this.params;if(null!=t.version||1!=t.version){var i=2;null!=t.version&&(i=t.version-1);var h=new n({obj:new r({int:i})});e.push(h)}return e.push(new r(t.serial)),e.push(new o({name:t.sigalg})),e.push(new u(t.issuer)),e.push(new s({array:[new a(t.notbefore),new a(t.notafter)]})),e.push(new u(t.subject)),e.push(new l(Ie.getKey(t.sbjpubkey))),void 0!==t.ext&&t.ext.length>0&&e.push(new n({tag:"a3",obj:new c(t.ext)})),new A.asn1.DERSequence({array:e}).getEncodedHex()},void 0!==e&&this.setByParam(e)},ve(A.asn1.x509.TBSCertificate,A.asn1.ASN1Object),A.asn1.x509.Extensions=function(e){A.asn1.x509.Extensions.superclass.constructor.call(this);var t=A.asn1,i=t.DERSequence,n=t.x509;this.aParam=[],this.setByParam=function(e){this.aParam=e},this.getEncodedHex=function(){for(var e=[],t=0;t<this.aParam.length;t++){var r=this.aParam[t],s=r.extname,o=null;if(null!=r.extn)o=new n.PrivateExtension(r);else if("subjectKeyIdentifier"==s)o=new n.SubjectKeyIdentifier(r);else if("keyUsage"==s)o=new n.KeyUsage(r);else if("subjectAltName"==s)o=new n.SubjectAltName(r);else if("issuerAltName"==s)o=new n.IssuerAltName(r);else if("basicConstraints"==s)o=new n.BasicConstraints(r);else if("cRLDistributionPoints"==s)o=new n.CRLDistributionPoints(r);else if("certificatePolicies"==s)o=new n.CertificatePolicies(r);else if("authorityKeyIdentifier"==s)o=new n.AuthorityKeyIdentifier(r);else if("extKeyUsage"==s)o=new n.ExtKeyUsage(r);else if("authorityInfoAccess"==s)o=new n.AuthorityInfoAccess(r);else if("cRLNumber"==s)o=new n.CRLNumber(r);else if("cRLReason"==s)o=new n.CRLReason(r);else if("ocspNonce"==s)o=new n.OCSPNonce(r);else if("ocspNoCheck"==s)o=new n.OCSPNoCheck(r);else if("adobeTimeStamp"==s)o=new n.AdobeTimeStamp(r);else{if("subjectDirectoryAttributes"!=s)throw new Error("extension not supported:"+JSON.stringify(r));o=new n.SubjectDirectoryAttributes(r)}null!=o&&e.push(o)}return new i({array:e}).getEncodedHex()},null!=e&&this.setByParam(e)},ve(A.asn1.x509.Extensions,A.asn1.ASN1Object),A.asn1.x509.Extension=function(e){A.asn1.x509.Extension.superclass.constructor.call(this);var t=A.asn1,i=t.DERObjectIdentifier,n=t.DEROctetString;t.DERBitString;var r=t.DERBoolean,s=t.DERSequence;this.getEncodedHex=function(){var e=new i({oid:this.oid}),t=new n({hex:this.getExtnValueHex()}),o=new Array;return o.push(e),this.critical&&o.push(new r),o.push(t),new s({array:o}).getEncodedHex()},this.critical=!1,void 0!==e&&void 0!==e.critical&&(this.critical=e.critical)},ve(A.asn1.x509.Extension,A.asn1.ASN1Object),A.asn1.x509.KeyUsage=function(e){A.asn1.x509.KeyUsage.superclass.constructor.call(this,e);var t=Oe.KEYUSAGE_NAME;if(this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.15",void 0!==e&&(void 0!==e.bin&&(this.asn1ExtnValue=new A.asn1.DERBitString(e)),void 0!==e.names&&void 0!==e.names.length)){for(var i=e.names,n="000000000",r=0;r<i.length;r++)for(var s=0;s<t.length;s++)i[r]===t[s]&&(n=n.substring(0,s)+"1"+n.substring(s+1,n.length));this.asn1ExtnValue=new A.asn1.DERBitString({bin:n})}},ve(A.asn1.x509.KeyUsage,A.asn1.x509.Extension),A.asn1.x509.BasicConstraints=function(e){A.asn1.x509.BasicConstraints.superclass.constructor.call(this,e);var t=A.asn1,i=t.DERBoolean,n=t.DERInteger,r=t.DERSequence;this.getExtnValueHex=function(){var e=new Array;this.cA&&e.push(new i),this.pathLen>-1&&e.push(new n({int:this.pathLen}));var t=new r({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==e&&(void 0!==e.cA&&(this.cA=e.cA),void 0!==e.pathLen&&(this.pathLen=e.pathLen))},ve(A.asn1.x509.BasicConstraints,A.asn1.x509.Extension),A.asn1.x509.CRLDistributionPoints=function(e){A.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=A.asn1,i=t.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.setByDPArray=function(e){for(var n=[],r=0;r<e.length;r++)if(e[r]instanceof A.asn1.ASN1Object)n.push(e[r]);else{var s=new i.DistributionPoint(e[r]);n.push(s)}this.asn1ExtnValue=new t.DERSequence({array:n})},this.setByOneURI=function(e){var t=new i.DistributionPoint({fulluri:e});this.setByDPArray([t])},this.oid="2.5.29.31",void 0!==e&&(void 0!==e.array?this.setByDPArray(e.array):void 0!==e.uri&&this.setByOneURI(e.uri))},ve(A.asn1.x509.CRLDistributionPoints,A.asn1.x509.Extension),A.asn1.x509.DistributionPoint=function(e){A.asn1.x509.DistributionPoint.superclass.constructor.call(this);var t=A.asn1,i=t.x509.DistributionPointName;this.getEncodedHex=function(){var e=new t.DERSequence;if(null!=this.asn1DP){var i=new t.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});e.appendASN1Object(i)}return this.hTLV=e.getEncodedHex(),this.hTLV},void 0!==e&&(void 0!==e.dpobj?this.asn1DP=e.dpobj:void 0!==e.dpname?this.asn1DP=new i(e.dpname):void 0!==e.fulluri&&(this.asn1DP=new i({full:[{uri:e.fulluri}]})))},ve(A.asn1.x509.DistributionPoint,A.asn1.ASN1Object),A.asn1.x509.DistributionPointName=function(e){A.asn1.x509.DistributionPointName.superclass.constructor.call(this);var t=A.asn1,i=t.DERTaggedObject;if(this.getEncodedHex=function(){if("full"!=this.type)throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new i({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.getEncodedHex(),this.hTLV},void 0!==e)if(t.x509.GeneralNames.prototype.isPrototypeOf(e))this.type="full",this.tag="a0",this.asn1V=e;else{if(void 0===e.full)throw new Error("This class supports GeneralNames only as argument");this.type="full",this.tag="a0",this.asn1V=new t.x509.GeneralNames(e.full)}},ve(A.asn1.x509.DistributionPointName,A.asn1.ASN1Object),A.asn1.x509.CertificatePolicies=function(e){A.asn1.x509.CertificatePolicies.superclass.constructor.call(this,e);var t=A.asn1,i=t.x509,n=t.DERSequence,r=i.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var e=[],t=0;t<this.params.array.length;t++)e.push(new r(this.params.array[t]));var i=new n({array:e});return this.asn1ExtnValue=i,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.32",void 0!==e&&(this.params=e)},ve(A.asn1.x509.CertificatePolicies,A.asn1.x509.Extension),A.asn1.x509.PolicyInformation=function(e){A.asn1.x509.PolicyInformation.superclass.constructor.call(this,e);var t=A.asn1,i=t.DERSequence,n=t.DERObjectIdentifier,r=t.x509.PolicyQualifierInfo;this.params=null,this.getEncodedHex=function(){if(void 0===this.params.policyoid&&void 0===this.params.array)throw new Error("parameter oid and array missing");var e=[new n(this.params.policyoid)];if(void 0!==this.params.array){for(var t=[],s=0;s<this.params.array.length;s++)t.push(new r(this.params.array[s]));t.length>0&&e.push(new i({array:t}))}return new i({array:e}).getEncodedHex()},void 0!==e&&(this.params=e)},ve(A.asn1.x509.PolicyInformation,A.asn1.ASN1Object),A.asn1.x509.PolicyQualifierInfo=function(e){A.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=A.asn1,i=t.DERSequence,n=t.DERIA5String,r=t.DERObjectIdentifier,s=t.x509.UserNotice;this.params=null,this.getEncodedHex=function(){return void 0!==this.params.cps?new i({array:[new r({oid:"1.3.6.1.5.5.7.2.1"}),new n({str:this.params.cps})]}).getEncodedHex():null!=this.params.unotice?new i({array:[new r({oid:"1.3.6.1.5.5.7.2.2"}),new s(this.params.unotice)]}).getEncodedHex():void 0},void 0!==e&&(this.params=e)},ve(A.asn1.x509.PolicyQualifierInfo,A.asn1.ASN1Object),A.asn1.x509.UserNotice=function(e){A.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=A.asn1.DERSequence;A.asn1.DERInteger;var i=A.asn1.x509.DisplayText,n=A.asn1.x509.NoticeReference;this.params=null,this.getEncodedHex=function(){var e=[];return void 0!==this.params.noticeref&&e.push(new n(this.params.noticeref)),void 0!==this.params.exptext&&e.push(new i(this.params.exptext)),new t({array:e}).getEncodedHex()},void 0!==e&&(this.params=e)},ve(A.asn1.x509.UserNotice,A.asn1.ASN1Object),A.asn1.x509.NoticeReference=function(e){A.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=A.asn1.DERSequence,i=A.asn1.DERInteger,n=A.asn1.x509.DisplayText;this.params=null,this.getEncodedHex=function(){var e=[];if(void 0!==this.params.org&&e.push(new n(this.params.org)),void 0!==this.params.noticenum){for(var r=[],s=this.params.noticenum,o=0;o<s.length;o++)r.push(new i(s[o]));e.push(new t({array:r}))}if(0==e.length)throw new Error("parameter is empty");return new t({array:e}).getEncodedHex()},void 0!==e&&(this.params=e)},ve(A.asn1.x509.NoticeReference,A.asn1.ASN1Object),A.asn1.x509.DisplayText=function(e){A.asn1.x509.DisplayText.superclass.constructor.call(this,e),this.hT="0c",void 0!==e&&("ia5"===e.type?this.hT="16":"vis"===e.type?this.hT="1a":"bmp"===e.type&&(this.hT="1e"))},ve(A.asn1.x509.DisplayText,A.asn1.DERAbstractString),A.asn1.x509.ExtKeyUsage=function(e){A.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,e);var t=A.asn1;this.setPurposeArray=function(e){this.asn1ExtnValue=new t.DERSequence;for(var i=0;i<e.length;i++){var n=new t.DERObjectIdentifier(e[i]);this.asn1ExtnValue.appendASN1Object(n)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.37",void 0!==e&&void 0!==e.array&&this.setPurposeArray(e.array)},ve(A.asn1.x509.ExtKeyUsage,A.asn1.x509.Extension),A.asn1.x509.AuthorityKeyIdentifier=function(e){A.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,e);var t=A,i=t.asn1,n=i.DERTaggedObject,r=i.x509.GeneralNames;t.crypto.Util.isKey,this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var e=new Array;this.asn1KID&&e.push(new n({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&e.push(new n({explicit:!1,tag:"a1",obj:new r([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&e.push(new n({explicit:!1,tag:"82",obj:this.asn1CertSN}));var t=new i.DERSequence({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.getEncodedHex()},this.setKIDByParam=function(e){if(void 0!==e.str||void 0!==e.hex)this.asn1KID=new A.asn1.DEROctetString(e);else if("object"==typeof e&&A.crypto.Util.isKey(e)||"string"==typeof e&&-1!=e.indexOf("BEGIN ")){var t=e;"string"==typeof e&&(t=Ie.getKey(e));var i=Ie.getKeyID(t);this.asn1KID=new A.asn1.DEROctetString({hex:i})}},this.setCertIssuerByParam=function(e){void 0!==e.str||void 0!==e.ldapstr||void 0!==e.hex||void 0!==e.certsubject||void 0!==e.certissuer?this.asn1CertIssuer=new A.asn1.x509.X500Name(e):"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&-1!=e.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new A.asn1.x509.X500Name({certissuer:e}))},this.setCertSNByParam=function(e){if(void 0!==e.str||void 0!==e.bigint||void 0!==e.hex)this.asn1CertSN=new A.asn1.DERInteger(e);else if("string"==typeof e&&-1!=e.indexOf("BEGIN ")&&e.indexOf("CERTIFICATE")){var t=new Oe;t.readCertPEM(e);var i=t.getSerialNumberHex();this.asn1CertSN=new A.asn1.DERInteger({hex:i})}},this.oid="2.5.29.35",void 0!==e&&(void 0!==e.kid&&this.setKIDByParam(e.kid),void 0!==e.issuer&&this.setCertIssuerByParam(e.issuer),void 0!==e.sn&&this.setCertSNByParam(e.sn),void 0!==e.issuersn&&"string"==typeof e.issuersn&&-1!=e.issuersn.indexOf("BEGIN ")&&e.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(e.issuersn),this.setCertIssuerByParam(e.issuersn)))},ve(A.asn1.x509.AuthorityKeyIdentifier,A.asn1.x509.Extension),A.asn1.x509.SubjectKeyIdentifier=function(e){A.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,e);var t=A.asn1.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.getEncodedHex()},this.setKIDByParam=function(e){if(void 0!==e.str||void 0!==e.hex)this.asn1KID=new t(e);else if("object"==typeof e&&A.crypto.Util.isKey(e)||"string"==typeof e&&-1!=e.indexOf("BEGIN")){var i=e;"string"==typeof e&&(i=Ie.getKey(e));var n=Ie.getKeyID(i);this.asn1KID=new A.asn1.DEROctetString({hex:n})}},this.oid="2.5.29.14",void 0!==e&&void 0!==e.kid&&this.setKIDByParam(e.kid)},ve(A.asn1.x509.SubjectKeyIdentifier,A.asn1.x509.Extension),A.asn1.x509.AuthorityInfoAccess=function(e){A.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,e),this.setAccessDescriptionArray=function(e){for(var t=new Array,i=A.asn1,n=i.DERSequence,r=i.DERObjectIdentifier,s=i.x509.GeneralName,o=0;o<e.length;o++){var a,u=e[o];if(void 0!==u.ocsp)a=new n({array:[new r({oid:"1.3.6.1.5.5.7.48.1"}),new s({uri:u.ocsp})]});else{if(void 0===u.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(u));a=new n({array:[new r({oid:"1.3.6.1.5.5.7.48.2"}),new s({uri:u.caissuer})]})}t.push(a)}this.asn1ExtnValue=new n({array:t})},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==e&&void 0!==e.array&&this.setAccessDescriptionArray(e.array)},ve(A.asn1.x509.AuthorityInfoAccess,A.asn1.x509.Extension),A.asn1.x509.SubjectAltName=function(e){A.asn1.x509.SubjectAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new A.asn1.x509.GeneralNames(e)},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.17",void 0!==e&&void 0!==e.array&&this.setNameArray(e.array)},ve(A.asn1.x509.SubjectAltName,A.asn1.x509.Extension),A.asn1.x509.IssuerAltName=function(e){A.asn1.x509.IssuerAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new A.asn1.x509.GeneralNames(e)},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.18",void 0!==e&&void 0!==e.array&&this.setNameArray(e.array)},ve(A.asn1.x509.IssuerAltName,A.asn1.x509.Extension),A.asn1.x509.SubjectDirectoryAttributes=function(e){A.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,e);var t=A.asn1,i=t.DERSequence,n=t.ASN1Util.newObject,r=t.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var e=[],t=0;t<this.params.array.length;t++){var s=this.params.array[t],o={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==s.attr)o.seq[0].oid=r(s.attr),o.seq[1].set[0]={gentime:s.str};else if("placeOfBirth"==s.attr)o.seq[0].oid=r(s.attr),o.seq[1].set[0]={utf8str:s.str};else if("gender"==s.attr)o.seq[0].oid=r(s.attr),o.seq[1].set[0]={prnstr:s.str};else if("countryOfCitizenship"==s.attr)o.seq[0].oid=r(s.attr),o.seq[1].set[0]={prnstr:s.str};else{if("countryOfResidence"!=s.attr)throw new Error("unsupported attribute: "+s.attr);o.seq[0].oid=r(s.attr),o.seq[1].set[0]={prnstr:s.str}}e.push(new n(o))}var a=new i({array:e});return this.asn1ExtnValue=a,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.9",void 0!==e&&(this.params=e)},ve(A.asn1.x509.SubjectDirectoryAttributes,A.asn1.x509.Extension),A.asn1.x509.PrivateExtension=function(e){A.asn1.x509.PrivateExtension.superclass.constructor.call(this,e);var t=A,i=t.lang.String.isHex,n=t.asn1,r=n.x509.OID.name2oid,s=n.ASN1Util.newObject;this.params=null,this.setByParam=function(e){this.oid=r(e.extname),this.params=e},this.getExtnValueHex=function(){if(null==this.params.extname||null==this.params.extn)throw new Error("extname or extnhex not specified");var e=this.params.extn;if("string"==typeof e&&i(e))return e;if("object"==typeof e)try{return s(e).getEncodedHex()}catch(e){}throw new Error("unsupported extn value")},null!=e&&this.setByParam(e)},ve(A.asn1.x509.PrivateExtension,A.asn1.x509.Extension),A.asn1.x509.CRL=function(e){A.asn1.x509.CRL.superclass.constructor.call(this);var t=A.asn1,i=t.DERSequence,n=t.DERBitString,r=t.x509,s=r.AlgorithmIdentifier,o=r.TBSCertList;this.params=void 0,this.setByParam=function(e){this.params=e},this.sign=function(){var e=new o(this.params).getEncodedHex(),t=new A.crypto.Signature({alg:this.params.sigalg});t.init(this.params.cakey),t.updateHex(e);var i=t.sign();this.params.sighex=i},this.getPEM=function(){return de(this.getEncodedHex(),"X509 CRL")},this.getEncodedHex=function(){var e=this.params;if(null==e.tbsobj&&(e.tbsobj=new o(e)),null==e.sighex&&null!=e.cakey&&this.sign(),null==e.sighex)throw new Error("sighex or cakey parameter not defined");var t=[];return t.push(e.tbsobj),t.push(new s({name:e.sigalg})),t.push(new n({hex:"00"+e.sighex})),new i({array:t}).getEncodedHex()},null!=e&&(this.params=e)},ve(A.asn1.x509.CRL,A.asn1.ASN1Object),A.asn1.x509.TBSCertList=function(e){A.asn1.x509.TBSCertList.superclass.constructor.call(this);var t=A.asn1,i=t.DERInteger,n=t.DERSequence,r=t.DERTaggedObject;t.DERObjectIdentifier;var s=t.x509,o=s.AlgorithmIdentifier,a=s.Time,u=s.Extensions,c=s.X500Name;this.params=null,this.setByParam=function(e){this.params=e},this.getRevCertSequence=function(){for(var e=[],t=this.params.revcert,r=0;r<t.length;r++){var s=[new i(t[r].sn),new a(t[r].date)];null!=t[r].ext&&s.push(new u(t[r].ext)),e.push(new n({array:s}))}return new n({array:e})},this.getEncodedHex=function(){var e=[],t=this.params;if(null!=t.version){var s=t.version-1,l=new i({int:s});e.push(l)}if(e.push(new o({name:t.sigalg})),e.push(new c(t.issuer)),e.push(new a(t.thisupdate)),null!=t.nextupdate&&e.push(new a(t.nextupdate)),null!=t.revcert&&e.push(this.getRevCertSequence()),null!=t.ext){var h=new u(t.ext);e.push(new r({tag:"a0",explicit:!0,obj:h}))}return new n({array:e}).getEncodedHex()},void 0!==e&&this.setByParam(e)},ve(A.asn1.x509.TBSCertList,A.asn1.ASN1Object),A.asn1.x509.CRLEntry=function(e){A.asn1.x509.CRLEntry.superclass.constructor.call(this);var t=A.asn1;this.setCertSerial=function(e){this.sn=new t.DERInteger(e)},this.setRevocationDate=function(e){this.time=new t.x509.Time(e)},this.getEncodedHex=function(){var e=new t.DERSequence({array:[this.sn,this.time]});return this.TLV=e.getEncodedHex(),this.TLV},void 0!==e&&(void 0!==e.time&&this.setRevocationDate(e.time),void 0!==e.sn&&this.setCertSerial(e.sn))},ve(A.asn1.x509.CRLEntry,A.asn1.ASN1Object),A.asn1.x509.CRLNumber=function(e){A.asn1.x509.CRLNumber.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new A.asn1.DERInteger(this.params.num),this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.20",null!=e&&(this.params=e)},ve(A.asn1.x509.CRLNumber,A.asn1.x509.Extension),A.asn1.x509.CRLReason=function(e){A.asn1.x509.CRLReason.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new A.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.21",null!=e&&(this.params=e)},ve(A.asn1.x509.CRLReason,A.asn1.x509.Extension),A.asn1.x509.OCSPNonce=function(e){A.asn1.x509.OCSPNonce.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new A.asn1.DEROctetString(this.params),this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=e&&(this.params=e)},ve(A.asn1.x509.OCSPNonce,A.asn1.x509.Extension),A.asn1.x509.OCSPNoCheck=function(e){A.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new A.asn1.DERNull,this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=e&&(this.params=e)},ve(A.asn1.x509.OCSPNoCheck,A.asn1.x509.Extension),A.asn1.x509.AdobeTimeStamp=function(e){A.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,e);var t=A.asn1,i=t.DERInteger,n=t.DERBoolean,r=t.DERSequence,s=t.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var e=this.params,t=[new i(1)];return t.push(new s({uri:e.uri})),null!=e.reqauth&&t.push(new n(e.reqauth)),this.asn1ExtnValue=new r({array:t}),this.asn1ExtnValue.getEncodedHex()},this.oid="1.2.840.113583.1.1.9.1",void 0!==e&&this.setByParam(e)},ve(A.asn1.x509.AdobeTimeStamp,A.asn1.x509.Extension),A.asn1.x509.X500Name=function(e){A.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=A.asn1,i=t.x509,n=i.RDN;this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var i=e.split("/");i.shift();for(var r=[],s=0;s<i.length;s++)if(i[s].match(/^[^=]+=.+$/))r.push(i[s]);else{var o=r.length-1;r[o]=r[o]+"/"+i[s]}for(s=0;s<r.length;s++)this.asn1Array.push(new n({str:r[s],rule:this.sRule}))},this.setByLdapString=function(e,t){void 0!==t&&(this.sRule=t);var n=i.X500Name.ldapToCompat(e);this.setByString(n,t)},this.setByObject=function(e,t){for(var i in void 0!==t&&(this.sRule=t),e)if(e.hasOwnProperty(i)){var r=new n({str:i+"="+e[i],rule:this.sRule});this.asn1Array?this.asn1Array.push(r):this.asn1Array=[r]}},this.setByParam=function(e){var t;(void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.array)?this.paramArray=e.array:void 0!==e.str?this.setByString(e.str):void 0!==e.ldapstr?this.setByLdapString(e.ldapstr):void 0!==e.hex?this.hTLV=e.hex:void 0!==e.certissuer?((t=new Oe).readCertPEM(e.certissuer),this.hTLV=t.getIssuerHex()):void 0!==e.certsubject?((t=new Oe).readCertPEM(e.certsubject),this.hTLV=t.getSubjectHex()):"object"==typeof e&&void 0===e.certsubject&&void 0===e.certissuer&&this.setByObject(e)},this.getEncodedHex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(0==this.asn1Array.length&&this.paramArray.length>0)for(var e=0;e<this.paramArray.length;e++){var i={array:this.paramArray[e]};"utf8"!=this.sRule&&(i.rule=this.sRule);var r=new n(i);this.asn1Array.push(r)}var s=new t.DERSequence({array:this.asn1Array});return this.hTLV=s.getEncodedHex(),this.hTLV},void 0!==e&&this.setByParam(e)},ve(A.asn1.x509.X500Name,A.asn1.ASN1Object),A.asn1.x509.X500Name.compatToLDAP=function(e){if("/"!==e.substr(0,1))throw"malformed input";var t=(e=e.substr(1)).split("/");return t.reverse(),(t=t.map((function(e){return e.replace(/,/,"\\,")}))).join(",")},A.asn1.x509.X500Name.onelineToLDAP=function(e){return A.asn1.x509.X500Name.compatToLDAP(e)},A.asn1.x509.X500Name.ldapToCompat=function(e){for(var t=e.split(","),i=!1,n=[],r=0;t.length>0;r++){var s=t.shift();if(!0===i){var o=(n.pop()+","+s).replace(/\\,/g,",");n.push(o),i=!1}else n.push(s);"\\"===s.substr(-1,1)&&(i=!0)}return(n=n.map((function(e){return e.replace("/","\\/")}))).reverse(),"/"+n.join("/")},A.asn1.x509.X500Name.ldapToOneline=function(e){return A.asn1.x509.X500Name.ldapToCompat(e)},A.asn1.x509.RDN=function(e){A.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=A.asn1.x509.AttributeTypeAndValue;this.setByParam=function(e){void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.str&&this.addByMultiValuedString(e.str),void 0!==e.array&&(this.paramArray=e.array)},this.addByString=function(e){this.asn1Array.push(new A.asn1.x509.AttributeTypeAndValue({str:e,rule:this.sRule}))},this.addByMultiValuedString=function(e){for(var t=A.asn1.x509.RDN.parseString(e),i=0;i<t.length;i++)this.addByString(t[i])},this.getEncodedHex=function(){if(0==this.asn1Array.length&&this.paramArray.length>0)for(var e=0;e<this.paramArray.length;e++){var i=this.paramArray[e];void 0!==i.rule&&"utf8"!=this.sRule&&(i.rule=this.sRule);var n=new t(i);this.asn1Array.push(n)}var r=new A.asn1.DERSet({array:this.asn1Array});return this.TLV=r.getEncodedHex(),this.TLV},void 0!==e&&this.setByParam(e)},ve(A.asn1.x509.RDN,A.asn1.ASN1Object),A.asn1.x509.RDN.parseString=function(e){for(var t=e.split(/\+/),i=!1,n=[],r=0;t.length>0;r++){var s=t.shift();if(!0===i){var o=(n.pop()+"+"+s).replace(/\\\+/g,"+");n.push(o),i=!1}else n.push(s);"\\"===s.substr(-1,1)&&(i=!0)}var a=!1,u=[];for(r=0;n.length>0;r++){s=n.shift();if(!0===a){var c=u.pop();if(s.match(/"$/)){o=(c+"+"+s).replace(/^([^=]+)="(.*)"$/,"$1=$2");u.push(o),a=!1}else u.push(c+"+"+s)}else u.push(s);s.match(/^[^=]+="/)&&(a=!0)}return u},A.asn1.x509.AttributeTypeAndValue=function(e){A.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=A,i=t.asn1,n=i.DERSequence,r=i.DERUTF8String,s=i.DERPrintableString,o=i.DERTeletexString,a=i.DERIA5String,u=i.DERVisibleString,c=i.DERBMPString,l=t.lang.String.isMail,h=t.lang.String.isPrintable;this.setByParam=function(e){if(void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.ds&&(this.dsType=e.ds),void 0===e.value&&void 0!==e.str){var t=e.str.match(/^([^=]+)=(.+)$/);if(!t)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=t[1],this.sValue=t[2]}else this.sType=e.type,this.sValue=e.value},this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var i=e.match(/^([^=]+)=(.+)$/);if(!i)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(i[1],i[2])},this._getDsType=function(){var e=this.sType,t=this.sValue,i=this.sRule;return"prn"===i?"CN"==e&&l(t)?"ia5":h(t)?"prn":"utf8":"utf8"===i?"CN"==e&&l(t)?"ia5":"C"==e?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(e,t,i){void 0!==i&&(this.sRule=i),this.sType=e,this.sValue=t},this.getValueObj=function(e,t){if("utf8"==e)return new r({str:t});if("prn"==e)return new s({str:t});if("tel"==e)return new o({str:t});if("ia5"==e)return new a({str:t});if("vis"==e)return new u({str:t});if("bmp"==e)return new c({str:t});throw new Error("unsupported directory string type: type="+e+" value="+t)},this.getEncodedHex=function(){null==this.dsType&&(this.dsType=this._getDsType());var e=A.asn1.x509.OID.atype2obj(this.sType),t=this.getValueObj(this.dsType,this.sValue),i=new n({array:[e,t]});return this.TLV=i.getEncodedHex(),this.TLV},void 0!==e&&this.setByParam(e)},ve(A.asn1.x509.AttributeTypeAndValue,A.asn1.ASN1Object),A.asn1.x509.SubjectPublicKeyInfo=function(e){A.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=A,i=t.asn1,n=i.DERInteger,r=i.DERBitString,s=i.DERObjectIdentifier,o=i.DERSequence,a=i.ASN1Util.newObject,u=i.x509.AlgorithmIdentifier,c=t.crypto;c.ECDSA,c.DSA,this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new o({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.getEncodedHex=function(){var e=this.getASN1Object();return this.hTLV=e.getEncodedHex(),this.hTLV},this.setPubKey=function(e){try{if(e instanceof ee){var t=a({seq:[{int:{bigint:e.n}},{int:{int:e.e}}]}).getEncodedHex();this.asn1AlgId=new u({name:"rsaEncryption"}),this.asn1SubjPKey=new r({hex:"00"+t})}}catch(e){}try{if(e instanceof A.crypto.ECDSA){var i=new s({name:e.curveName});this.asn1AlgId=new u({name:"ecPublicKey",asn1params:i}),this.asn1SubjPKey=new r({hex:"00"+e.pubKeyHex})}}catch(e){}try{if(e instanceof A.crypto.DSA){i=new a({seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]});this.asn1AlgId=new u({name:"dsa",asn1params:i});var o=new n({bigint:e.y});this.asn1SubjPKey=new r({hex:"00"+o.getEncodedHex()})}}catch(e){}},void 0!==e&&this.setPubKey(e)},ve(A.asn1.x509.SubjectPublicKeyInfo,A.asn1.ASN1Object),A.asn1.x509.Time=function(e){A.asn1.x509.Time.superclass.constructor.call(this);var t=A.asn1,i=t.DERUTCTime,n=t.DERGeneralizedTime;this.setTimeParams=function(e){this.timeParams=e},this.getEncodedHex=function(){var e=null;return e=null!=this.timeParams?"utc"==this.type?new i(this.timeParams):new n(this.timeParams):"utc"==this.type?new i:new n,this.TLV=e.getEncodedHex(),this.TLV},this.type="utc",void 0!==e&&(void 0!==e.type?this.type=e.type:void 0!==e.str&&(e.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),e.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=e)},ve(A.asn1.x509.Time,A.asn1.ASN1Object),A.asn1.x509.AlgorithmIdentifier=function(e){A.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=A.asn1,i=t.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.getEncodedHex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw new Error("algorithm not specified");if(null!==this.nameAlg){var e=null;for(var n in i)n===this.nameAlg&&(e=i[n]);if(null!==e)return this.hTLV=e,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=t.x509.OID.name2obj(this.nameAlg));var r=[this.asn1Alg];null!==this.asn1Params&&r.push(this.asn1Params);var s=new t.DERSequence({array:r});return this.hTLV=s.getEncodedHex(),this.hTLV},void 0!==e&&(void 0!==e.name&&(this.nameAlg=e.name),void 0!==e.asn1params&&(this.asn1Params=e.asn1params),void 0!==e.paramempty&&(this.paramEmpty=e.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var n=this.nameAlg.toLowerCase();"withdsa"!==n.substr(-7,7)&&"withecdsa"!==n.substr(-9,9)&&(this.asn1Params=new t.DERNull)}},ve(A.asn1.x509.AlgorithmIdentifier,A.asn1.ASN1Object),A.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},A.asn1.x509.GeneralName=function(e){A.asn1.x509.GeneralName.superclass.constructor.call(this);var t={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},i=A.asn1;i.DERSequence;var n=i.DEROctetString,r=i.DERIA5String,s=i.DERTaggedObject,o=i.ASN1Object,a=i.x509.X500Name,u=Ae;this.explicit=!1,this.setByParam=function(e){var i=null;if(void 0!==e){if(void 0!==e.rfc822&&(this.type="rfc822",i=new r({str:e[this.type]})),void 0!==e.dns&&(this.type="dns",i=new r({str:e[this.type]})),void 0!==e.uri&&(this.type="uri",i=new r({str:e[this.type]})),void 0!==e.dn&&(this.type="dn",this.explicit=!0,i="string"==typeof e.dn?new a({str:e.dn}):e.dn instanceof A.asn1.x509.X500Name?e.dn:new a(e.dn)),void 0!==e.ldapdn&&(this.type="dn",this.explicit=!0,i=new a({ldapstr:e.ldapdn})),void 0!==e.certissuer){this.type="dn",this.explicit=!0;var c=null;if((h=e.certissuer).match(/^[0-9A-Fa-f]+$/),-1!=h.indexOf("-----BEGIN ")&&(c=u(h)),null==c)throw"certissuer param not cert";(d=new Oe).hex=c;var l=d.getIssuerHex();(i=new o).hTLV=l}if(void 0!==e.certsubj){this.type="dn",this.explicit=!0;var h,d;c=null;if((h=e.certsubj).match(/^[0-9A-Fa-f]+$/),-1!=h.indexOf("-----BEGIN ")&&(c=u(h)),null==c)throw"certsubj param not cert";(d=new Oe).hex=c;l=d.getSubjectHex();(i=new o).hTLV=l}if(void 0!==e.ip){this.type="ip",this.explicit=!1;var p,M=e.ip,f="malformed IP address";if(M.match(/^[0-9.]+[.][0-9.]+$/)){if(8!==(p=function(e){e=(e=(e=e.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return e.split(/,/).map((function(e,t,i){var n=parseInt(e);if(n<0||255<n)throw"integer not in range 0-255";return("00"+n.toString(16)).slice(-2)})).join("")}catch(e){throw"malformed integer array string: "+e}}("["+M.split(".").join(",")+"]")).length)throw f}else if(M.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/))p=function(e){var t="malformed IPv6 address";if(!e.match(/^[0-9A-Fa-f:]+$/))throw t;var i=(e=e.toLowerCase()).split(":").length-1;if(i<2)throw t;var n=":".repeat(7-i+2),r=(e=e.replace("::",n)).split(":");if(8!=r.length)throw t;for(var s=0;s<8;s++)r[s]=("0000"+r[s]).slice(-4);return r.join("")}(M);else{if(!M.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw f;p=M}i=new n({hex:p})}if(null==this.type)throw"unsupported type in params="+e;this.asn1Obj=new s({explicit:this.explicit,tag:t[this.type],obj:i})}},this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()},void 0!==e&&this.setByParam(e)},ve(A.asn1.x509.GeneralName,A.asn1.ASN1Object),A.asn1.x509.GeneralNames=function(e){A.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=A.asn1;this.setByParamArray=function(e){for(var i=0;i<e.length;i++){var n=new t.x509.GeneralName(e[i]);this.asn1Array.push(n)}},this.getEncodedHex=function(){return new t.DERSequence({array:this.asn1Array}).getEncodedHex()},this.asn1Array=new Array,void 0!==e&&this.setByParamArray(e)},ve(A.asn1.x509.GeneralNames,A.asn1.ASN1Object),A.asn1.x509.OID=new function(e){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(e){if(void 0!==this.objCache[e])return this.objCache[e];if(void 0===this.name2oidList[e])throw"Name of ObjectIdentifier not defined: "+e;var t=this.name2oidList[e],i=new A.asn1.DERObjectIdentifier({oid:t});return this.objCache[e]=i,i},this.atype2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];var t;if(e.match(/^\d+\.\d+\.[0-9.]+$/))t=e;else if(void 0!==this.atype2oidList[e])t=this.atype2oidList[e];else{if(void 0===this.name2oidList[e])throw"AttributeType name undefined: "+e;t=this.name2oidList[e]}var i=new A.asn1.DERObjectIdentifier({oid:t});return this.objCache[e]=i,i}},A.asn1.x509.OID.oid2name=function(e){var t=A.asn1.x509.OID.name2oidList;for(var i in t)if(t[i]==e)return i;return""},A.asn1.x509.OID.oid2atype=function(e){var t=A.asn1.x509.OID.atype2oidList;for(var i in t)if(t[i]==e)return i;return e},A.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=A.asn1.x509.OID.name2oidList;return void 0===t[e]?"":t[e]},A.asn1.x509.X509Util={},A.asn1.x509.X509Util.newCertPEM=function(e){var t=A.asn1.x509;return t.TBSCertificate,new(0,t.Certificate)(e).getPEM()},ee.getPosArrayOfChildrenFromHex=function(e){return ze.getChildIdx(e,0)},ee.getHexValueArrayOfChildrenFromHex=function(e){var t,i=ze.getV,n=i(e,(t=ee.getPosArrayOfChildrenFromHex(e))[0]),r=i(e,t[1]),s=i(e,t[2]),o=i(e,t[3]),a=i(e,t[4]),u=i(e,t[5]),c=i(e,t[6]),l=i(e,t[7]),h=i(e,t[8]);return(t=new Array).push(n,r,s,o,a,u,c,l,h),t},ee.prototype.readPrivateKeyFromPEMString=function(e){var t=Ae(e),i=ee.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8])},ee.prototype.readPKCS5PrvKeyHex=function(e){var t=ee.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},ee.prototype.readPKCS8PrvKeyHex=function(e){var t,i,n,r,s,o,a,u,c=ze,l=c.getVbyListEx;if(!1===c.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=l(e,0,[2,0,1],"02"),i=l(e,0,[2,0,2],"02"),n=l(e,0,[2,0,3],"02"),r=l(e,0,[2,0,4],"02"),s=l(e,0,[2,0,5],"02"),o=l(e,0,[2,0,6],"02"),a=l(e,0,[2,0,7],"02"),u=l(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,i,n,r,s,o,a,u)},ee.prototype.readPKCS5PubKeyHex=function(e){var t=ze,i=t.getV;if(!1===t.isASN1HEX(e))throw new Error("keyHex is not ASN.1 hex string");var n=t.getChildIdx(e,0);if(2!==n.length||"02"!==e.substr(n[0],2)||"02"!==e.substr(n[1],2))throw new Error("wrong hex for PKCS#5 public key");var r=i(e,n[0]),s=i(e,n[1]);this.setPublic(r,s)},ee.prototype.readPKCS8PubKeyHex=function(e){var t=ze;if(!1===t.isASN1HEX(e))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(e,0,[0,0]))throw new Error("not PKCS8 RSA public key");var i=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(i)},ee.prototype.readCertPubKeyHex=function(e,t){var i,n;(i=new Oe).readCertHex(e),n=i.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},ee.prototype.sign=function(e,t){var i,n=(i=e,A.crypto.Util.hashString(i,t));return this.signWithMessageHash(n,t)},ee.prototype.signWithMessageHash=function(e,t){var i=J(A.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return be(this.doPrivate(i).toString(16),this.n.bitLength())},ee.prototype.signPSS=function(e,t,i){var n,r=(n=le(e),A.crypto.Util.hashHex(n,t));return void 0===i&&(i=-1),this.signWithMessageHashPSS(r,t,i)},ee.prototype.signWithMessageHashPSS=function(e,t,i){var n,r=ce(e),s=r.length,o=this.n.bitLength()-1,a=Math.ceil(o/8),u=function(e){return A.crypto.Util.hashHex(e,t)};if(-1===i||void 0===i)i=s;else if(-2===i)i=a-s-2;else if(i<-2)throw new Error("invalid salt length");if(a<s+i+2)throw new Error("data too long");var c="";i>0&&(c=new Array(i),(new K).nextBytes(c),c=String.fromCharCode.apply(String,c));var l=ce(u(le("\0\0\0\0\0\0\0\0"+r+c))),h=[];for(n=0;n<a-i-s-2;n+=1)h[n]=0;var d=String.fromCharCode.apply(String,h)+""+c,p=Le(l,d.length,u),M=[];for(n=0;n<d.length;n+=1)M[n]=d.charCodeAt(n)^p.charCodeAt(n);var g=65280>>8*a-o&255;for(M[0]&=~g,n=0;n<s;n++)M.push(l.charCodeAt(n));return M.push(188),be(this.doPrivate(new f(M)).toString(16),this.n.bitLength())},ee.prototype.verify=function(e,t){if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var i=J(t,16),n=this.n.bitLength();if(i.bitLength()>n)return!1;var r=this.doPublic(i).toString(16);if(r.length+3!=n/4)return!1;var s=Se(r.replace(/^1f+00/,""));if(0==s.length)return!1;var o,a=s[0];return s[1]==(o=e,A.crypto.Util.hashString(o,a))},ee.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=J(t,16);if(i.bitLength()>this.n.bitLength())return 0;var n=Se(this.doPublic(i).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==e)},ee.prototype.verifyPSS=function(e,t,i,n){var r=function(e){return A.crypto.Util.hashHex(e,i)}(le(e));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(r,t,i,n)},ee.prototype.verifyWithMessageHashPSS=function(e,t,i,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r,s=new f(t,16),o=function(e){return A.crypto.Util.hashHex(e,i)},a=ce(e),u=a.length,c=this.n.bitLength()-1,l=Math.ceil(c/8);if(-1===n||void 0===n)n=u;else if(-2===n)n=l-u-2;else if(n<-2)throw new Error("invalid salt length");if(l<u+n+2)throw new Error("data too long");var h=this.doPublic(s).toByteArray();for(r=0;r<h.length;r+=1)h[r]&=255;for(;h.length<l;)h.unshift(0);if(188!==h[l-1])throw new Error("encoded message does not end in 0xbc");var d=(h=String.fromCharCode.apply(String,h)).substr(0,l-u-1),p=h.substr(d.length,u),M=65280>>8*l-c&255;if(0!=(d.charCodeAt(0)&M))throw new Error("bits beyond keysize not zero");var g=Le(p,d.length,o),y=[];for(r=0;r<d.length;r+=1)y[r]=d.charCodeAt(r)^g.charCodeAt(r);y[0]&=~M;var v=l-u-n-2;for(r=0;r<v;r+=1)if(0!==y[r])throw new Error("leftmost octets not zero");if(1!==y[v])throw new Error("0x01 marker not found");return p===ce(o(le("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,y.slice(-n)))))},ee.SALT_LEN_HLEN=-1,ee.SALT_LEN_MAX=-2,ee.SALT_LEN_RECOVER=-2,Oe.hex2dn=function(e,t){void 0===t&&(t=0);var i=new Oe;return ze.getTLV(e,t),i.getX500Name(e).str},Oe.hex2rdn=function(e,t){if(void 0===t&&(t=0),"31"!==e.substr(t,2))throw new Error("malformed RDN");for(var i=new Array,n=ze.getChildIdx(e,t),r=0;r<n.length;r++)i.push(Oe.hex2attrTypeValue(e,n[r]));return(i=i.map((function(e){return e.replace("+","\\+")}))).join("+")},Oe.hex2attrTypeValue=function(e,t){var i=ze,n=i.getV;if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw new Error("malformed attribute type and value");var r=i.getChildIdx(e,t);2!==r.length||e.substr(r[0],2);var s=n(e,r[0]),o=A.asn1.ASN1Util.oidHexToInt(s);return A.asn1.x509.OID.oid2atype(o)+"="+ce(n(e,r[1]))},Oe.getPublicKeyFromCertHex=function(e){var t=new Oe;return t.readCertHex(e),t.getPublicKey()},Oe.getPublicKeyFromCertPEM=function(e){var t=new Oe;return t.readCertPEM(e),t.getPublicKey()},Oe.getPublicKeyInfoPropOfCertPEM=function(e){var t,i,n=ze.getVbyList,r={};return r.algparam=null,(t=new Oe).readCertPEM(e),i=t.getPublicKeyHex(),r.keyhex=n(i,0,[1],"03").substr(2),r.algoid=n(i,0,[0,0],"06"),"2a8648ce3d0201"===r.algoid&&(r.algparam=n(i,0,[0,1],"06")),r},Oe.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];var Pe,ke=[(Pe=new Oe,Pe.readCertPEM(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVS@\tPPNErtNVONtVWNZR}@]nU\0ZaZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg\tR^ZNATN>bROU^zc}nzyg\tR]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\\QN>Z\tN\\Q^B[QqnS=\b\\QN>Zwp\\Q^B[QqnZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg\tR^ZNATN>bROU^zc}nzyg\tR]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaPPNvVQ^fWX|gVup[N^ROO^NQttV]NQPPNt|PttVONZU|C\b\\@@e^Xv{[vTtd8`nyO@ebN[bqx=ng?\tS^w@|XAz|qUTwfzn]Bu<qs_ae\\y<}u`eRAoE`_\\s\0r|b{rp_o<oC@o=x\bw_cUUZPApQevD\\FxFoFgE=<sq[p<coqyn>TEpP@aSC_YDU8\0|8TB?c>r\\=rp`pcwP}c\0PP_\\RS\\EPVSy8x`\0?R|NP\tP>}A^VP}Ex\bUZa=syDw}>Ya8wPp[pRnn\brU^dE8U?a\bc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tP\bZ\b\\YNNSZ_\\w^|TsD8db\t_\tY\\o^Cw>Z\0x\\^aN]wWf\bA}\tC^d_{ZC@\by]gY@E\tBFY?OsaqbDcVgQbZeFc\tovtucxnq|<TnuyXRveYFOegCpAs{YTe|>bE<OXsSqCBWD_SVepfvCCUg]z\tZvQ[\0s|U>pFz\b=OwT``fNJJ:::::R[Q-PR_aVSVPNaR:::::")),Pe)];function Be(e,t){var i=e.getIssuerHex();if(i===e.getSubjectHex())return e.verifySignature(e.getPublicKey());var n=function(e,t){for(var i=0,n=t;i<n.length;i++){var r=n[i];if(r.getSubjectHex()===e)return r}}(i,t);return!!n&&(!1!==e.verifySignature(n.getPublicKey())&&Be(n,t))}function Ue(e){return e.getIssuerHex()!==e.getSubjectHex()&&Be(e,ke)}!function(e){var t=new Oe;"string"==typeof e?t.readCertPEM(e):t.readCertHex(e.hex);var i=Ue(t);ke.push(t)}(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}(":::::ORTV[-PR_aVSVPNaR:::::ZVVTU\tPPONrtNVONtVWNW=_SVw\tVE=ZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg\tR^ZNATN>bROU^zc}nzyg\tR]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\bZQNAZaN\\aZ\t[QSnS=\b[aNBZQZ\\aZ\t[QSnZVTaZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg\tR^ZNATN>bROU^zc}nzyg\tRbZOVTN>bRPtYoTyuoz}}f`Bwo?=RQN\\Ot[cONZO>Wyfd\tgdbRaN]Ot[cONZZPRuupz_@feWyZ`bVfW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=<e]nbSz\bZvac\b[w^nA_`vP|@8w[}nQobe=??oRYf{vpRxcC}yCd>8[NDx{Ne\\t8oou=guC>>gvb}ACd\t``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\tXSq\t{\0DvAVBbnTqEE[QzDyqF`bF}R=Q?VeDo<Vzb\0w}D}NZ\0t}^?OyFP\bVaVNrTNYqe?[NRYTSQby@yzWvT`wQo}y]c_WgxBYCy\tRNRg@NZCaaq8?`\t^`?ryD\t=obzw?E]Ou]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{ug8^f[YQAWad8FNqxFQE?ZOo\t}RnO\bsQc\txyccn=nxvs>bDBf\b\bW\\TuTnvAO^U\0QXC>xx8FxRFf<tJ:::::R[Q-PR_aVSVPNaR:::::"));var Qe=2*Math.PI;function _e(e){return(e%Qe+Qe)%Qe}var Re=function(e){function i(t){var i=e.call(this,t,1,.1,1e3)||this;return i.pose={longitude:0,latitude:0,fov:t,offset:new a.Vector3},i.computePose(),i}return t.__extends(i,e),i.prototype.computePose=function(){var e=this.getWorldDirection(new a.Vector3);this.pose.longitude=_e(-Math.atan2(e.x,-e.z)),this.pose.latitude=-Math.asin(e.y/1),this.pose.fov=this.fov,this.pose.offset.copy(this.position)},i.prototype.setFromPose=function(e){var t,i,n,r,s=_e(null!==(t=e.longitude)&&void 0!==t?t:this.pose.longitude),o=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,null!==(i=e.latitude)&&void 0!==i?i:this.pose.latitude)),u=null!==(n=e.fov)&&void 0!==n?n:this.pose.fov,c=null!==(r=e.offset)&&void 0!==r?r:this.pose.offset;this.position.copy(c);var l=Math.abs(Math.cos(o)),h=new a.Vector3(-Math.sin(s)*l,-Math.sin(o),-Math.cos(s)*l);this.lookAt(c.clone().add(h)),this.fov!==u&&(this.fov=u,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=s,this.pose.latitude=o,this.pose.fov=u,this.pose.offset.copy(c)},i.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,offset:this.pose.offset.clone()}},i}(a.PerspectiveCamera),Ye=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(i,e),i.prototype.add=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e.prototype.add.apply(this,t)},i.prototype.remove=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e.prototype.remove.apply(this,t)},i}(a.Scene),Fe=function(e){function i(t){var i=t.preserveDrawingBuffer,n=void 0===i||i,r=t.backgroundColor,s=void 0===r?1579548:r,o=t.backgroundAlpha,u=void 0===o?1:o,c=t.pixelRatio,l=void 0===c?1:c,h=t.antialias,d=void 0!==h&&h,A=e.call(this,{antialias:d,preserveDrawingBuffer:n,alpha:u<1})||this;return A.setPixelRatio(l),A.setClearColor(s,u),A.outputEncoding=a.sRGBEncoding,A.autoClear=!0,A}return t.__extends(i,e),i}(a.WebGLRenderer);function Ve(e){return null==e}function He(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}function Ge(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function qe(){return(Ge()+Ge()+"-"+Ge()+"-4"+Ge().substr(0,3)+"-"+Ge()+"-"+Ge()+Ge()+Ge()).toLowerCase()}var We="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),Ze="undefined"!=typeof performance?function(){return We+performance.now()}:function(){return Date.now()},Xe=function(){if("undefined"!=typeof window){var e=window;return e.requestAnimationFrame||e.mozRequestAnimationFrame||e.webkitRequestAnimationFrame||e.msRequestAnimationFrame||function(e){return setTimeout(e,16)}}return function(e){return setTimeout(e,16)}}();function Ke(e,t){void 0===e&&(e=He),void 0===t&&(t=0),Xe(t<=0?e:function(){return Ke(e,t-1)})}function Je(e,i){void 0===e&&(e=He);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=!1,o=function(r){e.call.apply(e,t.__spreadArray([i,r],n,!1)),s||"function"!=typeof o||Xe(o)};return Xe(o),function(){o=null,s=!0}}var $e=0;function et(e){$e&&e($e);var t=Ze();Xe((function(){e($e=Ze()-t)}))}et(He);var tt=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.floorIndex=0,t.needsRender=!0,t}return t.__extends(i,e),i}(a.Mesh),it=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.needsRender=!0,t}return t.__extends(i,e),i.prototype.getTransparent=function(){var e;return this.traverse((function(t){void 0===e&&t instanceof tt&&t.material.forEach((function(t){void 0===e&&1===t.uniforms.originOpacity.value&&(e=t.transparent)}))})),null!=e&&e},i.prototype.setTransparent=function(e){this.traverse((function(t){t instanceof tt&&t.material.forEach((function(t){1===t.uniforms.originOpacity.value&&(t.transparent=e)}))}))},i.prototype.getMaterial=function(){var e=null;return this.traverse((function(t){if(null===e&&t instanceof tt){var i=t.material[0];e={pano0Map:i.pano0Map,pano0Matrix:i.pano0Matrix,pano1Map:i.pano1Map,pano1Matrix:i.pano1Matrix,modelAlpha:i.modelAlpha,progress:i.progress,useBlackTransition:i.useBlackTransition,perspToOrtho:i.perspToOrtho,opacity:i.opacity,pano0DepthMap:i.pano0DepthMap,panoVideoMap:i.panoVideoMap,panoVideoSize:i.panoVideoSize,panoVideoMatrix:i.panoVideoMatrix,panoVideoAlpha:i.panoVideoAlpha,panoTileMap:i.panoTileMap,panoTileMappings:i.panoTileMappings}}})),e},i.prototype.setMaterial=function(e){this.traverse((function(t){t instanceof tt&&t.material.forEach((function(t){void 0!==e.pano0Map&&(t.pano0Map=e.pano0Map),void 0!==e.pano0Matrix&&(t.pano0Matrix=e.pano0Matrix),void 0!==e.pano1Map&&(t.pano1Map=e.pano1Map),void 0!==e.pano1Matrix&&(t.pano1Matrix=e.pano1Matrix),void 0!==e.modelAlpha&&(t.modelAlpha=e.modelAlpha),void 0!==e.progress&&(t.progress=e.progress),void 0!==e.useBlackTransition&&(t.useBlackTransition=e.useBlackTransition),void 0!==e.perspToOrtho&&(t.perspToOrtho=e.perspToOrtho),void 0!==e.opacity&&(t.opacity=e.opacity),void 0!==e.pano0DepthMap&&(t.pano0DepthMap=e.pano0DepthMap),void 0!==e.panoVideoMap&&(t.panoVideoMap=e.panoVideoMap),void 0!==e.panoVideoSize&&(t.panoVideoSize=e.panoVideoSize),void 0!==e.panoVideoMatrix&&(t.panoVideoMatrix=e.panoVideoMatrix),void 0!==e.panoVideoAlpha&&(t.panoVideoAlpha=e.panoVideoAlpha),void 0!==e.panoTileMap&&(t.panoTileMap=e.panoTileMap),void 0!==e.panoTileMappings&&(t.panoTileMappings=e.panoTileMappings)}))}))},i.prototype.disposeMaterial=function(){this.traverse((function(e){if(e instanceof tt){var t=[];e.material.forEach((function(e){var i=e.uniforms;Object.keys(i).map((function(e){if(["pano0Map","pano1Map","pano0DepthMap","panoVideoMap","panoTileMap"].indexOf(e)>=0)i[e].value=null;else{var n=i[e].value;n&&"function"==typeof n.dispose&&-1===t.indexOf(n)&&(i[e].value=null,t.push(n))}})),e.dispose()})),t.forEach((function(e){return e.dispose()}))}}))},i.prototype.disposeGeometry=function(){this.traverse((function(e){e instanceof tt&&e.geometry.dispose()}))},i}(a.Group),nt=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.floorIndex=0,t}return t.__extends(i,e),i}(it),rt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}("n\bv{t-rp@-[|znyHn\bv{t-rp@-cvr]|vv|{H{vs|z-znA-}n{|=ZnvH{vs|z-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l]|vv|{;\b-J-zv5-tyl]|vv|{;\b9-tyl]|vv|{;\b-7-5-tyl]|vv|{;\t-<-|u|Qvn{pr-69-}r}a|\\u|-6H\f"),st=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}("{vs|z-rp@-qvssrH{vs|z-rp@-rzvvrH{vs|z-rp@-}rpynH{vs|z-sy|n-uv{v{rH{vs|z-sy|n-r}|rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-|vtv{\\}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH{vs|z-nz}yrPor-}n{|=Zn}H{vs|z-nz}yrPor-}n{|>Zn}H{vs|z-nz}yrPor-}n{|=Qr}uZn}H{vs|z-rp?-}n{|cvqr|`v\trH{vs|z-znA-}n{|cvqr|ZnvH{vs|z-sy|n-}n{|cvqr|Ny}unH{vs|z-nz}yr?Q-}n{|cvqr|Zn}H0vs-qrsv{rq5b`RlaVYR6--{vs|z-nz}yr?Q-}n{|avyrZn}H--{vs|z-rpA-}n{|avyrPyv}Zn}}v{thaVYRlZN]]V[TlYR[TaUjH--{vs|z-rpA-}n{|avyrQnNZn}}v{thaVYRlZN]]V[TlYR[TaUjH0r{qvs0vs-.qrsv{rq5b`RlOYNPXla_N[`VaV\\[6-33-qrsv{rq5b`Rl]N[\\=lQR]aUlZN]6--n\bv{t-rp@-pnzrna|crrH0r{qvsn\bv{t-rp@-}n{|=a|crrHn\bv{t-rp@-}n{|>a|crrH0v{pyqr-Ip|zz|{K0v{pyqr-I}npxv{tK0v{pyqr-Ip|y|l}nlsntzr{K0v{pyqr-Il}nlsntzr{K0v{pyqr-I?l}nlsntzr{K0v{pyqr-Izn}l}nlsntzr{K0v{pyqr-Iny}unzn}l}nlsntzr{K0v{pyqr-In|zn}l}nlsntzr{K0v{pyqr-Iyvtuzn}l}nlsntzr{K0v{pyqr-Irzvvrzn}l}nlsntzr{K0v{pyqr-Ir{zn}l}nlsntzr{K0v{pyqr-Itnqvr{zn}l}nlsntzr{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-IoqsK0v{pyqr-Iyvtul}nlortv{K0v{pyqr-Iyvtul}u|{tl}nlsntzr{K0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=9-=;=9-=;=9->;=60qrsv{r-]Vl?-C;?E@>EB?rp?-|P||q5rp@-rp|6-\n--sy|n--J-yr{tu5rp|6H--sy|n-urn-J-np|5rp|;\b-<-6H--sy|n-}uv-J-nn{5rp|;9-rp|;\t6H--r{-rp?5=;B-8-}uv-<-]Vl?9-urn-<-]V6H\f|vq-znv{56-\n--rpA-qvssrP|y|-J-rpA5qvssr9-|vtv{\\}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}|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\\_;\b\t9-qvssrP|y|;n6H--\f--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-rrPor5}n{|=Zn}9-}n{|=a|crr6H--0vs-qrsv{rq5b`RlaVYR6----rp?-vyrlp||q-J-|P||q5}n{|=a|crr6H----rpA-vyrlpyv}H----rpA-vyrlqnNH----rp?-vyrlH----sy|n-vyrlny}unH----0}ntzn-{|yyly||}lnH----s|-5v{-v-J-=H-v-I-aVYRlZN]]V[TlYR[TaUH-v886-\n------vyrlpyv}-J-}n{|avyrPyv}Zn}}v{thvjH------vyrlqnN-J-}n{|avyrQnNZn}}v{thvjH------vyrl;-J-5vyrlp||q;-:-vyrlpyv}h=j6-<-vyrlpyv}h?jH------vyrl;\b-J-5vyrlp||q;\b-:-vyrlpyv}h>j6-<-vyrlpyv}h@jH------vyrlny}un-J-5>;=-:-r}5=;B9-no5vyrl;-:-=;B666-7-5>;=-:-r}5=;B9-no5vyrl;\b-:-=;B666H------vyrl;-J-vyrlqnNh=j-8-vyrl;-7-vyrlqnNh?jH------vyrl;\b-J-vyrlqnNh>j-8-vyrl;\b-7-vyrlqnNh@jH------vyrlny}un-J-prvy5vyrlny}un-7-vyrlqnNh?j6H------}n{|=P|y|-J-zv5}n{|=P|y|9-rr?Q5}n{|avyrZn}9-vyrl69-vyrlny}un6H----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--rpA-}n{|>P|y|-J-rrPor5}n{|>Zn}9-}n{|>a|crr6H--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv5}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv5}n{|P|y|9-}n{|>P|y|9-zn5=;=9-oynpx]|tr-:-?;=66H--0ryr----0vs-qrsv{rq5b`Rl]N[\\=lQR]aUlZN]6------rpA-}n{|=Qr}uP|y|-J-rrPor5}n{|=Qr}uZn}9-pnzrna|crr6H------sy|n-qrynQvn{pr=-J-no5{}npx_TONa|Qr}u5}n{|=Qr}uP|y|6-7->=;=-:-yr{tu5}n{|=a|crr66H------sy|n-ynry-J-pynz}5}|tr-7-5>;=-8-qrynQvn{pr=-7-=;FB69-=;=9->;=6H----0ryr------sy|n-ynry-J-}|trH----0r{qvs----}n{|P|y|-J-zv5}n{|=P|y|9-}n{|>P|y|9-ynry6H--0r{qvs--0vs-qrsv{rq5b`Rl]N[\\lcVQR\\lZN]6----rpA-zn}P||q-J-rpA5pnzrna|crr9->;=6-7-}n{|cvqr|ZnvH----rp?--J-rp?5------=;B-8-zn}P||q;-<-zn}P||q;\t-<-}n{|cvqr|`v\tr;9------=;B-:-zn}P||q;\b-<-zn}P||q;\t-<-}n{|cvqr|`v\tr;\b----6H----rpA-vqr|P|y|-J-rr?Q5}n{|cvqr|Zn}9-6H----sy|n-znpu-J-5>;=-:-r}5=;=9-zn}P||q;\t66-7-5>;=-:-r}5=;B9-no5;-:-=;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-zv5}n{|P|y|9-vqr|P|y|9-znpu-7-ny}un-7-}n{|cvqr|Ny}un6H--0r{qvs--tylSntP|y|-J-zv5}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--tylSntP|y|-J-rpA5tylSntP|y|;to9-|}npv\b6H\f"),ot=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.hash=qe(),t.meta=[null,null,null,null,null,null],t}return t.__extends(i,e),i}(a.CubeTexture);function at(){return"undefined"==typeof document?{}:document.createElementNS("http://www.w3.org/1999/xhtml","img")}var ut=at();ut.width=ut.height=8;var ct=new a.Texture(ut),lt=new ot([ut,ut,ut,ut,ut,ut]);ct.dispose=lt.dispose=function(){};var ht=Object.assign({modelAlpha:new a.Uniform(0),originOpacity:new a.Uniform(1),progress:new a.Uniform(0),pano0Map:new a.Uniform(null),pano0Matrix:new a.Uniform(new a.Matrix4),pano1Map:new a.Uniform(null),pano1Matrix:new a.Uniform(new a.Matrix4),pano0DepthMap:new a.Uniform(null),panoVideoMap:new a.Uniform(null),panoVideoSize:new a.Uniform(new a.Vector2),panoVideoMatrix:new a.Uniform(new a.Matrix4),panoVideoAlpha:new a.Uniform(0),modelCenter:new a.Uniform(new a.Vector3),perspToOrtho:new a.Uniform(0),panoTileMap:new a.Uniform(null),panoTileClipMappings:new a.Uniform([]),panoTileDrawAtMappings:new a.Uniform([])},{exposure:new a.Uniform(1),emissive:new a.Uniform(new a.Color(0)),emissiveMap:new a.Uniform(null),specular:new a.Uniform(new a.Color(1118481)),specularMap:new a.Uniform(null),normalMap:new a.Uniform(null),bumpMap:new a.Uniform(null),shininess:new a.Uniform(30)},a.UniformsLib.common,a.UniformsLib.lights),dt=function(e){function i(t){var i,n,r,s,o,u,c,l,h,d,A,p,M,f,g,y;void 0===t&&(t={});var v=e.call(this,{vertexShader:rt,fragmentShader:st,uniforms:a.UniformsUtils.clone(ht),defines:{USE_MAP:!0,USE_UV:!0,USE_TILE:!1,TILE_MAPPING_LENGTH:0,USE_BLACK_TRANSITION:!1,USE_PANO0_DEPTH_MAP:!1,USE_PANO_VIDEO_MAP:!1},lights:!0})||this;return Object.defineProperties(v,{pano0Map:{get:function(){var e=this.uniforms.pano0Map.value;return e===lt?null:e},set:function(e){this.uniforms.pano0Map.value=null===e?lt:e}},pano0Matrix:{get:function(){return this.uniforms.pano0Matrix.value.clone()},set:function(e){this.uniforms.pano0Matrix.value.copy(e)}},pano1Map:{get:function(){var e=this.uniforms.pano1Map.value;return e===lt?null:e},set:function(e){this.uniforms.pano1Map.value=null===e?lt:e}},pano1Matrix:{get:function(){return this.uniforms.pano1Matrix.value.clone()},set:function(e){this.uniforms.pano1Matrix.value.copy(e)}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(e){this.uniforms.modelAlpha.value=e}},progress:{get:function(){return this.uniforms.progress.value},set:function(e){this.uniforms.progress.value=e}},useBlackTransition:{get:function(){return this.defines.USE_BLACK_TRANSITION},set:function(e){this.defines.USE_BLACK_TRANSITION!==e&&(this.defines.USE_BLACK_TRANSITION=e,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},perspToOrtho:{get:function(){return this.uniforms.perspToOrtho.value},set:function(e){this.uniforms.perspToOrtho.value=e}},pano0DepthMap:{get:function(){return this.uniforms.pano0DepthMap.value},set:function(e){this.uniforms.pano0DepthMap.value=e;var t=null!==e;t!==this.defines.USE_PANO0_DEPTH_MAP&&(this.defines.USE_PANO0_DEPTH_MAP=t,this.needsUpdate=!0)}},panoVideoMap:{get:function(){return this.uniforms.panoVideoMap.value},set:function(e){this.uniforms.panoVideoMap.value=e;var t=null!==e;t!==this.defines.USE_PANO_VIDEO_MAP&&(this.defines.USE_PANO_VIDEO_MAP=t,this.needsUpdate=!0)}},panoVideoSize:{get:function(){return this.uniforms.panoVideoSize.value.clone()},set:function(e){this.uniforms.panoVideoSize.value.copy(e)}},panoVideoMatrix:{get:function(){return this.uniforms.panoVideoMatrix.value.clone()},set:function(e){this.uniforms.panoVideoMatrix.value.copy(e)}},panoVideoAlpha:{get:function(){return this.uniforms.panoVideoAlpha.value},set:function(e){this.uniforms.panoVideoAlpha.value=e}},panoTileMap:{get:function(){return this.uniforms.panoTileMap.value},set:function(e){this.uniforms.panoTileMap.value=e;var t=null!==e;t!==this.defines.USE_TILE&&(this.defines.USE_TILE=t,this.needsUpdate=!0)}},panoTileMappings:{get:function(){var e=this.uniforms.panoTileClipMappings.value,t=this.uniforms.panoTileDrawAtMappings.value;if(null===e)return null;for(var i=[],n=0;n<e.length;n++)i[n]=[e[n].clone(),t[n].clone()];return i},set:function(e){var t=this.defines.TILE_MAPPING_LENGTH;if(null===e)this.uniforms.panoTileClipMappings.value=null,this.uniforms.panoTileDrawAtMappings.value=null;else{for(var i=[],n=[],r=0;r<e.length;r++)i[r]=e[r][0].clone(),n[r]=e[r][1].clone();this.uniforms.panoTileClipMappings.value=i,this.uniforms.panoTileDrawAtMappings.value=n}var s=null!==e?e.length:0;s!==t&&(this.defines.TILE_MAPPING_LENGTH=s,this.needsUpdate=!0)}}}),v.pano0Map=null!==(i=t.pano0Map)&&void 0!==i?i:lt,v.pano0Matrix=null!==(n=t.pano0Matrix)&&void 0!==n?n:new a.Matrix4,v.pano1Map=null!==(r=t.pano1Map)&&void 0!==r?r:lt,v.pano1Matrix=null!==(s=t.pano1Matrix)&&void 0!==s?s:new a.Matrix4,v.modelAlpha=null!==(o=t.modelAlpha)&&void 0!==o?o:1,v.progress=null!==(u=t.progress)&&void 0!==u?u:0,v.useBlackTransition=null!==(c=t.useBlackTransition)&&void 0!==c&&c,v.perspToOrtho=null!==(l=t.perspToOrtho)&&void 0!==l?l:0,v.opacity=null!==(h=t.opacity)&&void 0!==h?h:1,v.pano0DepthMap=null!==(d=t.pano0DepthMap)&&void 0!==d?d:null,v.panoVideoSize=null!==(A=t.panoVideoSize)&&void 0!==A?A:new a.Vector2,v.panoVideoMap=null!==(p=t.panoVideoMap)&&void 0!==p?p:null,v.panoVideoMatrix=null!==(M=t.panoVideoMatrix)&&void 0!==M?M:new a.Matrix4,v.panoVideoAlpha=null!==(f=t.panoVideoAlpha)&&void 0!==f?f:0,v.panoTileMap=null!==(g=t.panoTileMap)&&void 0!==g?g:null,v.panoTileMappings=null!==(y=t.panoTileMappings)&&void 0!==y?y:null,v}return t.__extends(i,e),i}(a.ShaderMaterial),At=new a.Vector3(0,0,0),pt=function(e){function i(t,i){void 0===i&&(i=At);var n=e.call(this)||this,r=new a.BoxBufferGeometry(t.max.x-t.min.x+2*i.x,t.max.y-t.min.y+2*i.y,t.max.z-t.min.z+2*i.z,1,1);r.groups.length=0,r.groups.push({start:0,count:36,materialIndex:0}),r.applyMatrix4((new a.Matrix4).makeScale(-1,1,1));var s=new dt;s.defines.USE_MAP=!1,s.defines.USE_UV=!1,s.uniforms.diffuse.value=new a.Color(16777215);var o=new tt(r,[s]);return o.floorIndex=-1,o.position.copy(t.getCenter(new a.Vector3)),o.frustumCulled=!1,n.add(o),n}return t.__extends(i,e),i.prototype.dispose=function(){this.disposeMaterial(),this.disposeGeometry()},i}(nt);function Mt(e,t){return void 0===t&&(t=At),new pt(e,t)}var ft,gt,yt,vt,mt={};mt.EPSILON=1e-6,mt.BVHVector3=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0},mt.BVHVector3.prototype={constructor:mt.BVHVector3,copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},setFromArray:function(e,t){this.x=e[t],this.y=e[t+1],this.z=e[t+2]},add:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},cross:function(e){var t=this.x,i=this.y,n=this.z;return this.x=i*e.z-n*e.y,this.y=n*e.x-t*e.z,this.z=t*e.y-i*e.x,this},crossVectors:function(e,t){var i=e.x,n=e.y,r=e.z,s=t.x,o=t.y,a=t.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this},clone:function(){return new mt.BVHVector3(this.x,this.y,this.z)}},mt.BVH=function(e,t){this._trianglesArray=e,this._maxTrianglesPerNode=t||10,this._bboxArray=this.calcBoundingBoxes(e),this._bboxHelper=new Float32Array(this._bboxArray.length),this._bboxHelper.set(this._bboxArray);var i=e.length/9,n=this.calcExtents(0,i,mt.EPSILON);this._rootNode=new mt.BVHNode(n[0],n[1],0,i,0),this._nodesToSplit=[this._rootNode]},mt.BVH.prototype.splitNode=function(e){if(e){var t=0,i=function(){t++;var n=this._nodesToSplit.pop();n?(this._splitNode(n),t%255==0?setTimeout(i):i()):(t=0,e())}.bind(this);i()}else for(;this._nodesToSplit.length>0;)this._splitNode(this._nodesToSplit.pop())},mt.BVH.prototype.dispose=function(){this._trianglesArray=new Float32Array,this._bboxArray=new Float32Array,this._bboxHelper=new Float32Array,this._rootNode=null,this._nodesToSplit=null},mt.BVH.prototype.intersectRay=function(e,t,i){for(var n,r=[this._rootNode],s=[],o=[],a=new mt.BVHVector3(1/t.x,1/t.y,1/t.z);r.length>0;){var u=r.pop();if(mt.BVH.intersectNodeBox(e,a,u))for(u._node0&&r.push(u._node0),u._node1&&r.push(u._node1),n=u._startIndex;n<u._endIndex;n++)s.push(this._bboxArray[7*n])}var c=new mt.BVHVector3,l=new mt.BVHVector3,h=new mt.BVHVector3,d=new mt.BVHVector3(e.x,e.y,e.z),A=new mt.BVHVector3(t.x,t.y,t.z);for(n=0;n<s.length;n++){var p=s[n];c.setFromArray(this._trianglesArray,9*p),l.setFromArray(this._trianglesArray,9*p+3),h.setFromArray(this._trianglesArray,9*p+6);var M=mt.BVH.intersectRayTriangle(c,l,h,d,A,i);M&&o.push({triangle:[c.clone(),l.clone(),h.clone()],triangleIndex:p,intersectionPoint:M})}return o},mt.BVH.prototype.calcBoundingBoxes=function(e){for(var t,i,n,r,s,o,a,u,c,l,h,d,A,p,M,f=e.length/9,g=new Float32Array(7*f),y=0;y<f;y++)t=e[9*y],i=e[9*y+1],n=e[9*y+2],r=e[9*y+3],s=e[9*y+4],o=e[9*y+5],a=e[9*y+6],u=e[9*y+7],c=e[9*y+8],l=Math.min(Math.min(t,r),a),h=Math.min(Math.min(i,s),u),d=Math.min(Math.min(n,o),c),A=Math.max(Math.max(t,r),a),p=Math.max(Math.max(i,s),u),M=Math.max(Math.max(n,o),c),mt.BVH.setBox(g,y,y,l,h,d,A,p,M);return g},mt.BVH.prototype.calcExtents=function(e,t,i){if(i=i||0,e>=t)return[{x:0,y:0,z:0},{x:0,y:0,z:0}];for(var n=Number.MAX_VALUE,r=Number.MAX_VALUE,s=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=-Number.MAX_VALUE,u=-Number.MAX_VALUE,c=e;c<t;c++)n=Math.min(this._bboxArray[7*c+1],n),r=Math.min(this._bboxArray[7*c+2],r),s=Math.min(this._bboxArray[7*c+3],s),o=Math.max(this._bboxArray[7*c+4],o),a=Math.max(this._bboxArray[7*c+5],a),u=Math.max(this._bboxArray[7*c+6],u);return[{x:n-i,y:r-i,z:s-i},{x:o+i,y:a+i,z:u+i}]},mt.BVH.prototype._splitNode=function(e){if(!(e.elementCount()<=this._maxTrianglesPerNode||0===e.elementCount())){var t=e._startIndex,i=e._endIndex,n=[[],[],[]],r=[[],[],[]],s=[e.centerX(),e.centerY(),e.centerZ()],o=[e._extentsMax.x-e._extentsMin.x,e._extentsMax.y-e._extentsMin.y,e._extentsMax.z-e._extentsMin.z],a=[];a.length=3;for(var u=t;u<i;u++){a[0]=.5*(this._bboxArray[7*u+1]+this._bboxArray[7*u+4]),a[1]=.5*(this._bboxArray[7*u+2]+this._bboxArray[7*u+5]),a[2]=.5*(this._bboxArray[7*u+3]+this._bboxArray[7*u+6]);for(var c=0;c<3;c++)a[c]<s[c]?n[c].push(u):r[c].push(u)}var l=[];if(l.length=3,l[0]=0===n[0].length||0===r[0].length,l[1]=0===n[1].length||0===r[1].length,l[2]=0===n[2].length||0===r[2].length,!(l[0]&&l[1]&&l[2])){var h,d,A=[0,1,2];for(A.sort((function(e,t){return o[t]-o[e]})),c=0;c<3;c++){var p=A[c];if(!l[p]){h=n[p],d=r[p];break}}var M,f=t,g=f+h.length,y=g,v=i,m=e._startIndex,N=h.concat(d);for(u=0;u<N.length;u++)M=N[u],mt.BVH.copyBox(this._bboxArray,M,this._bboxHelper,m),m++;var D=this._bboxHelper.subarray(7*e._startIndex,7*e._endIndex);this._bboxArray.set(D,7*e._startIndex);var w=this.calcExtents(f,g,mt.EPSILON),T=this.calcExtents(y,v,mt.EPSILON),x=new mt.BVHNode(w[0],w[1],f,g,e._level+1),E=new mt.BVHNode(T[0],T[1],y,v,e._level+1);e._node0=x,e._node1=E,e.clearShapes(),this._nodesToSplit.push(x),this._nodesToSplit.push(E)}}},mt.BVH._calcTValues=function(e,t,i,n){var r={min:0,max:0};return n>=0?(r.min=(e-i)*n,r.max=(t-i)*n):(r.min=(t-i)*n,r.max=(e-i)*n),r},mt.BVH.intersectNodeBox=function(e,t,i){var n=mt.BVH._calcTValues(i._extentsMin.x,i._extentsMax.x,e.x,t.x),r=mt.BVH._calcTValues(i._extentsMin.y,i._extentsMax.y,e.y,t.y);if(n.min>r.max||r.min>n.max)return!1;(r.min>n.min||n.min!=n.min)&&(n.min=r.min),(r.max<n.max||n.max!=n.max)&&(n.max=r.max);var s=mt.BVH._calcTValues(i._extentsMin.z,i._extentsMax.z,e.z,t.z);return!(n.min>s.max||s.min>n.max)&&((s.min>n.min||n.min!=n.min)&&(n.min=s.min),(s.max<n.max||n.max!=n.max)&&(n.max=s.max),!(n.max<0))},mt.BVH.intersectRayTriangle=(ft=new mt.BVHVector3,gt=new mt.BVHVector3,yt=new mt.BVHVector3,vt=new mt.BVHVector3,function(e,t,i,n,r,s){gt.subVectors(t,e),yt.subVectors(i,e),vt.crossVectors(gt,yt);var o,a=r.dot(vt);if(a>0){if(s)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}ft.subVectors(n,e);var u=o*r.dot(yt.crossVectors(ft,yt));if(u<0)return null;var c=o*r.dot(gt.cross(ft));if(c<0)return null;if(u+c>a)return null;var l=-o*ft.dot(vt);if(l<0)return null;var h=l/a;return(new mt.BVHVector3).copy(r).multiplyScalar(h).add(n)}),mt.BVH.setBox=function(e,t,i,n,r,s,o,a,u){e[7*t]=i,e[7*t+1]=n,e[7*t+2]=r,e[7*t+3]=s,e[7*t+4]=o,e[7*t+5]=a,e[7*t+6]=u},mt.BVH.copyBox=function(e,t,i,n){i[7*n]=e[7*t],i[7*n+1]=e[7*t+1],i[7*n+2]=e[7*t+2],i[7*n+3]=e[7*t+3],i[7*n+4]=e[7*t+4],i[7*n+5]=e[7*t+5],i[7*n+6]=e[7*t+6]},mt.BVH.getBox=function(e,t,i){i.triangleId=e[7*t],i.minX=e[7*t+1],i.minY=e[7*t+2],i.minZ=e[7*t+3],i.maxX=e[7*t+4],i.maxY=e[7*t+5],i.maxZ=e[7*t+6]},mt.BVHNode=function(e,t,i,n,r){this._extentsMin=e,this._extentsMax=t,this._startIndex=i,this._endIndex=n,this._level=r,this._node0=null,this._node1=null},mt.BVHNode.prototype.elementCount=function(){return this._endIndex-this._startIndex},mt.BVHNode.prototype.centerX=function(){return.5*(this._extentsMin.x+this._extentsMax.x)},mt.BVHNode.prototype.centerY=function(){return.5*(this._extentsMin.y+this._extentsMax.y)},mt.BVHNode.prototype.centerZ=function(){return.5*(this._extentsMin.z+this._extentsMax.z)},mt.BVHNode.prototype.clearShapes=function(){this._startIndex=-1,this._endIndex=-1},mt.BVHNode.calcBoundingSphereRadius=function(e,t){var i=.5*(e.x+t.x),n=.5*(e.y+t.y),r=.5*(e.z+t.z),s=(i-e.x)*(i-e.x)+(n-e.y)*(n-e.y)+(r-e.z)*(r-e.z),o=(i-t.x)*(i-t.x)+(n-t.y)*(n-t.y)+(r-t.z)*(r-t.z);return Math.sqrt(Math.max(s,o))};var Nt=mt.BVH;var Dt,wt=(Dt="$$FIVE_EVENT$$","undefined"==typeof Symbol?"$Symbol<"+Dt+">$":Symbol(Dt));function Tt(e){return e[wt]||(e[wt]={}),e[wt]}var xt=function(){function e(){}return e.prototype.hasListener=function(e){var t=Tt(this);return t&&t[e]&&t[e].length>0},e.prototype.on=function(e,t,i){var n=this,r=Tt(this);return r[e]||(r[e]=[]),r[e].push([t,i||!1]),function(){return n.off(e,t)}},e.prototype.once=function(e,t){return this.on(e,t,!0)},e.prototype.off=function(e,t){if(void 0!==e){var i,n=Tt(this);if(n[e]||(n[e]=[]),void 0!==t){for(var r=0;r<n[e].length&&n[e][r][0]!==t;r++);r<n[e].length&&n[e].splice(r,1)}else n[e].length=0}else(i=this)[wt]||delete i[wt]},e.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];for(var n=!1,r=Tt(this),s=r[e]||[],o=0,a=s.slice();o<a.length;o++){var u=a[o],c=u[0],l=u[1],h=void 0!==l&&l,d=c.apply(void 0,t);h&&this.off(e,c),!1===d&&(n=!0)}return n},e}();function Et(e){Object.freeze(e);var t="function"==typeof e,i=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(e).forEach((function(n){!i.call(e,n)||t&&("caller"===n||"callee"===n||"arguments"===n)||null===e[n]||"object"!=typeof e[n]&&"function"!=typeof e[n]||Object.isFrozen(e[n])||Et(e[n])})),e}var jt=/^([^.]+)(\.([^.]+))*$/;function It(e){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(e)}function zt(e,t){return jt.test(e)&&function(e){if("*"===e)return/^(.+)$/i;var t="^"+e.split(".").map((function(e){return"*"===e?"([^.]+)":e})).join(".")+"$";return new RegExp(t,"i")}(e).test(t)}var bt=Et(JSON.parse(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}("h--/y|pnyu|/9--/xr;p|z/9-------/7;xr;p|z/9-------/7;7;xr;p|z/9--/yvn{wvn;p|z/9--/7;yvn{wvn;p|z/9--/7;7;yvn{wvn;p|z/9--/rnyrr;p|z/9--/7;rnyrr;p|z/9--/7;7;rnyrr;p|z/9--/rnyrr;p{/9---/7;rnyrr;p{/9---/7;7;rnyrr;p{/9--/uv;p|z/9--/7;uv;p|z/9--/7;7;uv;p|z/9--/uv;p{/9---/7;uv;p{/9---/7;7;uv;p{/9--/ywpq{;p|z/9----/7;ywpq{;p|z/9----/7;7;ywpq{;p|z/j"))),Lt=function(e){function i(t,i){var n=e.call(this,"[NETWORK]: response error(status: "+i+"): "+t)||this;return n.httpStatus=i,n}return t.__extends(i,e),i}(Error),St=function(e){function i(t){return e.call(this,"[NETWORK]: request abort: "+t)||this}return t.__extends(i,e),i}(Error),Ot=function(e){function i(t,i){return e.call(this,"[NETWORK]: request timeout("+i+"ms): "+t)||this}return t.__extends(i,e),i}(Error),Ct=function(e){function i(t,i){return e.call(this,"[NETWORK]: request forbidden: "+t+", "+i)||this}return t.__extends(i,e),i}(Error);var Pt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(i,e),i}(xt);function kt(e,t,i,n){void 0===t&&(t={}),void 0===i&&(i=He),void 0===n&&(n=He);var r,s=t.allowHosts?bt.concat(t.allowHosts):bt.slice(),o=(r=e.match(/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/))?r[2]:location.hostname;if(0!==location.hostname.length&&!It(location.hostname)&&0===bt.filter((function(e){return zt(e,location.hostname)})).length&&!It(o)&&0===s.filter((function(e){return zt(e,o)})).length){var a=He,u=new Ct(e,"request host("+o+") is not allowed");return Ke((function(){var n;i(u,null),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"forbidden",u.message)})),{abort:a}}var c=function(e){for(var t=0,i=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i];t<i.length;t++){var n=i[t],r=e.match(n);if(r)return"jsonp_"+r[1]}return null}(e);if(c){var l=window,h=null,d=!1,A=Ze(),p=document.createElement("script");return l[c]=function(n){var r,s=Ze(),o=s-A;if(delete l[c],p.parentNode&&p.parentNode.removeChild(p),null!==h&&(window.clearTimeout(h),h=null),!0!==d){if(0!==n.indexOf("data:")){var a=new Lt(e,500);return i(a,null),void(null===(r=t.networkSubscribe)||void 0===r||r.emit("network",e,"error",a.message))}var u=n.split(","),M=(u[0].match(/:(.*?);/)||[])[1],f=u[1];if("arraybuffer"===t.responseType||"blob"===t.responseType){for(var g=atob(u[1]),y=g.length,v=new Uint8Array(y),m=0;m<y;m++)v[m]=g.charCodeAt(m);f="arraybuffer"===t.responseType?v.buffer:new Blob([v],{type:M})}var N={body:f,meta:{source:e,requestTime:A,responseTime:s,costs:o,headers:{}}};Ke((function(){var n;i(null,N),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"ok",JSON.stringify(N.meta))})),d=!0}},p.src=e,document.body.appendChild(p),"number"==typeof t.timeout&&(h=window.setTimeout((function(){var n;if(h=null,!0!==d){var r=new Ot(e,t.timeout||NaN);i(r,null),d=!0,null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"timeout",r.message)}}),t.timeout)),{abort:function(){var n;if(delete l[c],p.parentNode&&p.parentNode.removeChild(p),null!==h&&(window.clearTimeout(h),h=null),!0!==d){var r=new St(e);i(r,null),d=!0,null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"abort",r.message)}}}}var M=Ze(),f=!1,g=new XMLHttpRequest,y=function(){g&&(g.removeEventListener("timeout",v,!1),g.removeEventListener("progress",m,!1),g.removeEventListener("abort",N,!1),g.removeEventListener("load",D,!1),g.removeEventListener("error",w,!1)),g=null,y=He},v=function(){var n,r=new Ot(e,t.timeout||NaN);i(r,null),f=!0,y(),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"timeout",r.message)},m=function(e){if(!0!==f&&e.lengthComputable){var t=e.loaded,i=e.total;n(t/i,t,i)}},N=function(){var n;if(!0!==f){var r=new St(e);i(r,null),f=!0,y(),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"abort",r.message)}},D=function(){var n,r=Ze(),s=r-M,o=function(e){if(!e)return{};for(var t={},i=e.trim().split("\n"),n=0;n<i.length;n++){var r=i[n],s=r.indexOf(":"),o=r.slice(0,s).trim().toLowerCase(),a=r.slice(s+1).trim();a&&(t[o]?t[o]+=", "+a:t[o]=a)}return t}(this.getAllResponseHeaders()),a={body:this.response,meta:{source:e,requestTime:M,responseTime:r,costs:s,headers:o}};i(null,a),f=!0,y(),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"ok",JSON.stringify(a.meta))},w=function(){var n,r=new Lt(e,this.status);i(r,null),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"error",r.message),f=!0,y()};return g.addEventListener("timeout",v,!1),g.addEventListener("progress",m,!1),g.addEventListener("abort",N,!1),g.addEventListener("load",D,!1),g.addEventListener("error",w,!1),t.responseType&&(g.responseType=t.responseType),"number"==typeof t.timeout&&(g.timeout=t.timeout),g.open("GET",e,!0),g.send(null),{abort:N}}kt.async=function(e,t){return new Promise((function(i,n){kt(e,t,(function(e,t){e?n(e):i(t)}))}))};var Bt={};function Ut(e,t){if(void 0===t&&(t={}),"function"==typeof t.transform)return t.transform(e,t);if(e.indexOf("//vrlab-public.ljcdn.com")>=0&&(/\.basis(\?|$)/.test(e)&&!0!==t.basisLoaderInitialized&&(e=e.replace(/\.basis(\?|$)/,".jpg$1")),/\.(jpg|png)$/.test(e))){var i=t.size,n=t.quality,r=t.format;if(i||n||r){var s="?imageMogr2";n&&(s+="/quality/"+n),i&&(s+="/thumbnail/"+i+"x"),r&&(s+="/format/"+r),e=e.replace("//vrlab-public.ljcdn.com","//vrlab-image4.ljcdn.com")+s}}return e}var Qt=function(){function e(e){void 0===e&&(e={}),this.allowHosts=e.allowHosts,this.networkSubscribe=e.networkSubscribe}return e.prototype.load=function(e,t,i,n){return void 0===t&&(t=He),void 0===i&&(i=He),void 0===n&&(n=He),this.loadToImage(at(),e,t,i,n)},e.prototype.loadToImage=function(e,t,i,n,r){if(void 0===i&&(i=He),void 0===r&&(r=He),e.src)throw new Error("image is loaded");var s={responseType:"blob",allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe};kt(t,s,(function(n,s){n?r(n):(e.onload=function(){i(e),e.onload=e.onerror=function(){}},e.onerror=function(){r(new Error("image parse error "+t)),e.onload=e.onerror=function(){}},e.src=URL.createObjectURL(s.body))}))},e}(),_t=null,Rt=!1,Yt=[];function Ft(e){if(void 0===e&&(e=!1),e||!Rt)if(_t)Rt=!1;else{Rt=!0;var t=Yt.shift();if(t){try{t()}catch(e){}Ke((function(){return Ft(!0)}))}else Rt=!1}}function Vt(){_t=null,Ft()}function Ht(){(_t||0!==Yt.length)&&(_t&&clearTimeout(_t),_t=window.setTimeout(Vt,200))}function Gt(e){return new Promise((function(t){Yt.push((function(){return t(e())})),Ft()}))}var qt,Wt={computeTangents:function(e){var t=e.index,i=e.attributes;if(null!==t&&void 0!==i.position&&void 0!==i.normal&&void 0!==i.uv){var n=t.array,r=i.position.array,s=i.normal.array,o=i.uv.array,u=r.length/3;void 0===i.tangent&&e.setAttribute("tangent",new a.BufferAttribute(new Float32Array(4*u),4));for(var c=i.tangent.array,l=[],h=[],d=0;d<u;d++)l[d]=new a.Vector3,h[d]=new a.Vector3;var A=new a.Vector3,p=new a.Vector3,M=new a.Vector3,f=new a.Vector2,g=new a.Vector2,y=new a.Vector2,v=new a.Vector3,m=new a.Vector3,N=e.groups;0===N.length&&(N=[{start:0,count:n.length}]);d=0;for(var D=N.length;d<D;++d)for(var w=O=(S=N[d]).start,T=O+S.count;w<T;w+=3)C(n[w+0],n[w+1],n[w+2]);var x,E,j,I=new a.Vector3,z=new a.Vector3,b=new a.Vector3,L=new a.Vector3;for(d=0,D=N.length;d<D;++d){var S,O;for(w=O=(S=N[d]).start,T=O+S.count;w<T;w+=3)P(n[w+0]),P(n[w+1]),P(n[w+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function C(e,t,i){A.fromArray(r,3*e),p.fromArray(r,3*t),M.fromArray(r,3*i),f.fromArray(o,2*e),g.fromArray(o,2*t),y.fromArray(o,2*i);var n=p.x-A.x,s=M.x-A.x,a=p.y-A.y,u=M.y-A.y,c=p.z-A.z,d=M.z-A.z,N=g.x-f.x,D=y.x-f.x,w=g.y-f.y,T=y.y-f.y,x=1/(N*T-D*w);v.set((T*n-w*s)*x,(T*a-w*u)*x,(T*c-w*d)*x),m.set((N*s-D*n)*x,(N*u-D*a)*x,(N*d-D*c)*x),l[e].add(v),l[t].add(v),l[i].add(v),h[e].add(m),h[t].add(m),h[i].add(m)}function P(e){b.fromArray(s,3*e),L.copy(b),E=l[e],I.copy(E),I.sub(b.multiplyScalar(b.dot(E))).normalize(),z.crossVectors(L,E),j=z.dot(h[e]),x=j<0?-1:1,c[4*e]=I.x,c[4*e+1]=I.y,c[4*e+2]=I.z,c[4*e+3]=x}},mergeBufferGeometries:function(e,t){for(var i=null!==e[0].index,n=new Set(Object.keys(e[0].attributes)),r=new Set(Object.keys(e[0].morphAttributes)),s={},o={},u=new a.BufferGeometry,c=0,l=0;l<e.length;++l){var h=e[l];if(i!==(null!==h.index))return null;for(var d in h.attributes){if(!n.has(d))return null;void 0===s[d]&&(s[d]=[]),s[d].push(h.attributes[d])}for(var d in h.morphAttributes){if(!r.has(d))return null;void 0===o[d]&&(o[d]=[]),o[d].push(h.morphAttributes[d])}if(u.userData.mergedUserData=u.userData.mergedUserData||[],u.userData.mergedUserData.push(h.userData),t){var A;if(i)A=h.index.count;else{if(void 0===h.attributes.position)return null;A=h.attributes.position.count}u.addGroup(c,A,l),c+=A}}if(i){var p=0,M=[];for(l=0;l<e.length;++l){for(var f=e[l].index,g=0;g<f.count;++g)M.push(f.getX(g)+p);p+=e[l].attributes.position.count}u.setIndex(M)}for(var d in s){var y=this.mergeBufferAttributes(s[d]);if(!y)return null;u.setAttribute(d,y)}for(var d in o){var v=o[d][0].length;if(0===v)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[d]=[];for(l=0;l<v;++l){var m=[];for(g=0;g<o[d].length;++g)m.push(o[d][g][l]);var N=this.mergeBufferAttributes(m);if(!N)return null;u.morphAttributes[d].push(N)}}return u},mergeBufferAttributes:function(e){for(var t,i,n,r=0,s=0;s<e.length;++s){var o=e[s];if(o.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return null;if(void 0===i&&(i=o.itemSize),i!==o.itemSize)return null;if(void 0===n&&(n=o.normalized),n!==o.normalized)return null;r+=o.array.length}var u=new t(r),c=0;for(s=0;s<e.length;++s)u.set(e[s].array,c),c+=e[s].array.length;return new a.BufferAttribute(u,i,n)},interleaveAttributes:function(e){for(var t,i=0,n=0,r=0,s=e.length;r<s;++r){var o=e[r];if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;i+=o.array.length,n+=o.itemSize}var u=new a.InterleavedBuffer(new t(i),n),c=0,l=[],h=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"],A=0;for(s=e.length;A<s;A++){var p=(o=e[A]).itemSize,M=o.count,f=new a.InterleavedBufferAttribute(u,p,c,o.normalized);l.push(f),c+=p;for(var g=0;g<M;g++)for(var y=0;y<p;y++)f[d[y]](g,o[h[y]](g))}return l},estimateBytesUsed:function(e){var t=0;for(var i in e.attributes){var n=e.getAttribute(i);t+=n.count*n.itemSize*n.array.BYTES_PER_ELEMENT}var r=e.getIndex();return t+=r?r.count*r.itemSize*r.array.BYTES_PER_ELEMENT:0},mergeVertices:function(e,t){void 0===t&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var i={},n=e.getIndex(),r=e.getAttribute("position"),s=n?n.count:r.count,o=0,u=Object.keys(e.attributes),c={},l={},h=[],d=["getX","getY","getZ","getW"],A=0,p=u.length;A<p;A++){c[m=u[A]]=[],(T=e.morphAttributes[m])&&(l[m]=new Array(T.length).fill().map((function(){return[]})))}var M=Math.log10(1/t),f=Math.pow(10,M);for(A=0;A<s;A++){var g=n?n.getX(A):A,y="",v=0;for(p=u.length;v<p;v++)for(var m=u[v],N=(w=e.getAttribute(m)).itemSize,D=0;D<N;D++)y+=~~(w[d[D]](g)*f)+",";if(y in i)h.push(i[y]);else{for(v=0,p=u.length;v<p;v++){m=u[v];var w=e.getAttribute(m),T=e.morphAttributes[m],x=(N=w.itemSize,c[m]),E=l[m];for(D=0;D<N;D++){var j=d[D];if(x.push(w[j](g)),T)for(var I=0,z=T.length;I<z;I++)E[I].push(T[I][j](g))}}i[y]=o,h.push(o),o++}}var b=e.clone();for(A=0,p=u.length;A<p;A++){m=u[A];var L=e.getAttribute(m),S=new L.array.constructor(c[m]);w=new a.BufferAttribute(S,L.itemSize,L.normalized);if(b.setAttribute(m,w),m in l)for(v=0;v<l[m].length;v++){var O=e.morphAttributes[m][v],C=(S=new O.array.constructor(l[m][v]),new a.BufferAttribute(S,O.itemSize,O.normalized));b.morphAttributes[m][v]=C}}return b.setIndex(h),b}};var Zt='\nvar config, transcoderPending, _BasisFile;\nself.onmessage = function(e) {\n var message = e.data;\n switch (message.type) {\n case "init":\n config = message.config;\n init(message.transcoderBinary);\n break;\n case "transcode":\n transcoderPending.then(function() {\n try {\n var result = transcode(message.buffer);\n var width = result.width;\n var height = result.height;\n var hasAlpha = result.hasAlpha;\n var mipmaps = result.mipmaps;\n var format = result.format;\n var buffers = [];\n for (var i = 0; i < mipmaps.length; ++i) {\n buffers.push(mipmaps[i].data.buffer);\n }\n self.postMessage({ type: "transcode", id: message.id, width, height, hasAlpha, mipmaps, format }, buffers);\n } catch (error) {\n console.error(error);\n self.postMessage({ type: "error", id: message.id, error: error.message });\n }\n });\n break;\n default: break;\n }\n};\n\nfunction init(wasmBinary) {\n var BasisModule;\n transcoderPending = new Promise(function(resolve) {\n BasisModule = { wasmBinary, onRuntimeInitialized: resolve };\n BASIS(BasisModule); // eslint-disable-line no-undef\n }).then(function() {\n _BasisFile = BasisModule.BasisFile;\n BasisModule.initializeBasis();\n self.postMessage({ type: "initialized" });\n });\n}\n\nfunction transcode(buffer) {\n var basisFile = new _BasisFile(new Uint8Array(buffer));\n var width = basisFile.getImageWidth(0, 0);\n var height = basisFile.getImageHeight(0, 0);\n var levels = basisFile.getNumLevels(0);\n var hasAlpha = basisFile.getHasAlpha();\n function cleanup() {\n basisFile.close();\n basisFile.delete();\n }\n if (!hasAlpha) {\n switch (config.format) {\n case 9: // Hardcoded: BasisTextureLoader.BASIS_FORMAT.cTFPVRTC1_4_RGBA\n config.format = 8; // Hardcoded: BasisTextureLoader.BASIS_FORMAT.cTFPVRTC1_4_RGB;\n break;\n default: break;\n }\n }\n if (!width || !height || !levels) {\n cleanup();\n throw new Error("BasisTextureLoader: Invalid .basis file");\n }\n if (!basisFile.startTranscoding()) {\n cleanup();\n throw new Error("BasisTextureLoader: .startTranscoding failed");\n }\n var mipmaps = [];\n for (var mip = 0; mip < levels; mip++) {\n var mipWidth = basisFile.getImageWidth(0, mip);\n var mipHeight = basisFile.getImageHeight(0, mip);\n var dst = new Uint8Array(basisFile.getImageTranscodedSizeInBytes(0, mip, config.format));\n var status = basisFile.transcodeImage(dst, 0, mip, config.format, 0, hasAlpha);\n if (!status) {\n cleanup();\n throw new Error("BasisTextureLoader: .transcodeImage failed.");\n }\n mipmaps.push({ data: dst, width: mipWidth, height: mipHeight });\n }\n cleanup();\n return { width, height, hasAlpha, mipmaps, format: config.format };\n}\n',Xt={cTFETC1:0,cTFETC2:1,cTFBC1:2,cTFBC3:3,cTFBC4:4,cTFBC5:5,cTFBC7_M6_OPAQUE_ONLY:6,cTFBC7_M5:7,cTFPVRTC1_4_RGB:8,cTFPVRTC1_4_RGBA:9,cTFASTC_4x4:10,cTFATC_RGB:11,cTFATC_RGBA_INTERPOLATED_ALPHA:12,cTFRGBA32:13,cTFRGB565:14,cTFBGR565:15,cTFRGBA4444:16},Kt={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779},Jt=((qt={})[Xt.cTFBC1]=Kt.COMPRESSED_RGB_S3TC_DXT1_EXT,qt[Xt.cTFBC3]=Kt.COMPRESSED_RGBA_S3TC_DXT5_EXT,qt),$t=function(e){function i(t){void 0===t&&(t={});var i=e.call(this)||this;return i.allowHosts=t.allowHosts,i.networkSubscribe=t.networkSubscribe,i}return t.__extends(i,e),i.setTranscoderPath=function(e){return this.transcoderPath=e,this},i.setWorkerLimit=function(e){return this.workerLimit=e,this},i.isInitialized=function(){return 0!==this.workerPool.filter((function(e){return e._initialized})).length},i.detectSupport=function(e){var t=this.workerConfig;if(t.astcSupported=!!e.extensions.get("WEBGL_compressed_texture_astc"),t.bptcSupported=!!e.extensions.get("EXT_texture_compression_bptc"),t.etcSupported=!!e.extensions.get("WEBGL_compressed_texture_etc1"),t.dxtSupported=!!e.extensions.get("WEBGL_compressed_texture_s3tc"),t.pvrtcSupported=!!e.extensions.get("WEBGL_compressed_texture_pvrtc")||!!e.extensions.get("WEBKIT_WEBGL_compressed_texture_pvrtc"),t.astcSupported)t.format=i.BASIS_FORMAT.cTFASTC_4x4;else if(t.bptcSupported)t.format=i.BASIS_FORMAT.cTFBC7_M5;else if(t.dxtSupported)t.format=i.BASIS_FORMAT.cTFBC3;else if(t.pvrtcSupported)t.format=i.BASIS_FORMAT.cTFPVRTC1_4_RGBA;else{if(!t.etcSupported)throw new Error("BasisTextureLoader: No suitable compressed texture format found.");t.format=i.BASIS_FORMAT.cTFETC1}return this},i.prototype.load=function(e,t,n,r){return kt(e,{responseType:"arraybuffer",allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe},(function(n,s){if(n)r(n);else{var o=function(e){return t(e,s.meta)},a=s.body;if(i.taskCache.has(a))return i.taskCache.get(a).promise.then(o).catch(r);i._createTexture(a,e).then(o).catch(r)}}),n)},i._createTexture=function(e,t){var n,r,s=this,o=e.byteLength,u=this._allocateWorker(o).then((function(t){return n=t,r=s.workerNextTaskID++,new Promise((function(t,i){n._callbacks[r]={resolve:t,reject:i},n.postMessage({type:"transcode",id:r,buffer:e},[e])}))})).then((function(e){var t,i=s.workerConfig,n=e.width,r=e.height,o=e.mipmaps;switch(e.format){case Xt.cTFASTC_4x4:t=new a.CompressedTexture(o,n,r,a.RGBA_ASTC_4x4_Format);break;case Xt.cTFBC1:case Xt.cTFBC3:t=new a.CompressedTexture(o,n,r,Jt[i.format],a.UnsignedByteType);break;case Xt.cTFETC1:t=new a.CompressedTexture(o,n,r,a.RGB_ETC1_Format);break;case Xt.cTFPVRTC1_4_RGB:t=new a.CompressedTexture(o,n,r,a.RGB_PVRTC_4BPPV1_Format);break;case Xt.cTFPVRTC1_4_RGBA:t=new a.CompressedTexture(o,n,r,a.RGBA_PVRTC_4BPPV1_Format);break;default:throw new Error("BasisTextureLoader: No supported format available.")}return t.minFilter=1===o.length?a.LinearFilter:a.LinearMipmapLinearFilter,t.magFilter=a.LinearFilter,t.generateMipmaps=!1,t.needsUpdate=!0,t}));return u.catch((function(){return!0})).then((function(){n&&r&&(n._taskLoad-=o,delete n._callbacks[r])})),i.taskCache.set(e,{url:t,promise:u}),u},i._initTranscoder=function(){var e=this;if(!this.transcoderPending){var t=new a.FileLoader;t.setPath(this.transcoderPath);var i=new Promise((function(e,i){t.load("basis_transcoder.js",e,void 0,i)})),n=new a.FileLoader;n.setPath(this.transcoderPath),n.setResponseType("arraybuffer");var r=new Promise((function(e,t){n.load("basis_transcoder.wasm",e,void 0,t)}));this.transcoderPending=Promise.all([i,r]).then((function(t){var i=t[0],n=t[1],r=["/* basis_transcoder.js */",i,"/* worker */",Zt].join("\n");e.workerSourceURL=URL.createObjectURL(new Blob([r])),e.transcoderBinary=n}))}return this.transcoderPending},i._allocateWorker=function(e){var t=this;return this._initTranscoder().then((function(){if(t.workerPool.length<t.workerLimit){var i=function(e){var t=new Worker(e);return Object.assign(t,{_callbacks:{},_initialized:!1,_taskLoad:0})}(t.workerSourceURL);i._callbacks={},i._initialized=!1,i._taskLoad=0,i.postMessage({type:"init",config:t.workerConfig,transcoderBinary:t.transcoderBinary}),i.onmessage=function(e){var t=e.data;switch(t.type){case"initialized":i._initialized=!0,console.log("BasisTextureLoader: basis loader initialized");break;case"transcode":i._callbacks[t.id].resolve(t);break;case"error":i._callbacks[t.id].reject(t);break;default:console.error('BasisTextureLoader: Unexpected message, "'+t.type+'"')}},t.workerPool.push(i)}else t.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));var n=t.workerPool[t.workerPool.length-1];return n._taskLoad+=e,n}))},i.prototype.dispose=function(){for(var e=0;e<i.workerPool.length;e++)i.workerPool[e].terminate();return i.workerPool.length=0,this},i.taskCache=new WeakMap,i.BASIS_FORMAT=Xt,i.DXT_FORMAT=Kt,i.DXT_FORMAT_MAP=Jt,i.transcoderPath="https://vrlab-public.ljcdn.com/release/static/image/release/five/basis/",i.transcoderBinary=null,i.transcoderPending=null,i.workerLimit=1,i.workerPool=[],i.workerNextTaskID=1,i.workerSourceURL="",i.workerConfig={format:null,astcSupported:!1,bptcSupported:!1,etcSupported:!1,dxtSupported:!1,pvrtcSupported:!1},i}(a.Loader),ei=(new a.Matrix4).set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);function ti(e,t){return new a.BufferAttribute(e,t)}function ii(e){var t=e.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function ni(e){var t=e.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function ri(e){var t=e.indices,i=e.vertices,n=e.uvs,r=new a.BufferGeometry;return r.setIndex(ti(new Uint32Array(t),1)),r.setAttribute("position",ti(new Float32Array(i),3)),Ve(n)||r.setAttribute("uv",ti(new Float32Array(n),2)),r.applyMatrix4(ei),r.computeVertexNormals(),r}function si(e,t,i,n){var r=$t.isInitialized();e=Ut(e,Object.assign({key:"texture",basisLoaderInitialized:r},t));var s=new $t({allowHosts:i,networkSubscribe:n});if(/\.basis(\?|$)/.test(e)){var o={sourceFile:e,needsUpdate:!0,wrapS:a.ClampToEdgeWrapping,wrapT:a.ClampToEdgeWrapping,minFilter:a.LinearFilter};return new Promise((function(t,i){s.load(e,(function(e){t(Object.assign(e,o))}),(function(){}),(function(e){i(e)}))}))}var u={sourceFile:e,needsUpdate:!0,wrapS:a.ClampToEdgeWrapping,wrapT:a.ClampToEdgeWrapping,minFilter:a.LinearFilter},c=new Qt({allowHosts:i,networkSubscribe:n});return new Promise((function(t,i){c.load(e,(function(e){var i=new a.Texture(e),n=i.dispose;i.dispose=function(){n.call(i),/^blob\:/.test(e.src)&&URL.revokeObjectURL(e.src)},t(Object.assign(i,u))}),He,(function(e){return i(e)}))}))}function oi(e){var t=new dt;return e.catch((function(){return null})).then((function(e){t.uniforms.map.value=e,t.uniforms.exposure.value=3.3})),t}var ai=u.parse("\nmessage Model {\n repeated Chunk chunks = 1;\n}\nmessage Chunk {\n required Vertices vertices = 1;\n required Faces faces = 2;\n required string name = 3;\n optional string texture = 4;\n}\nmessage Vertices {\n repeated float xyz = 1 [packed=true];\n repeated float uvs = 2 [packed=true];\n}\nmessage Faces {\n repeated uint32 indices = 1 [packed=true];\n}\n").root.lookup("Model");function ui(e,t,i,n,r,s,o){void 0===r&&(r={});for(var u=0,c=e;u<c.length;u++){var l=c[u];l.chunkName=ni(l.name),l.floorName=ii(l.name),l.texture&&(l.texture=i[l.chunkName]=i[l.chunkName]||t+l.texture)}e.sort((function(e,t){return 1e3*e.floorName+e.chunkName-(1e3*t.floorName+t.chunkName)}));var h=[],d=[],A=Promise.resolve();return(A=(A=A.then((function(){return Gt((function(){for(var t=0;t<e.length;t++){var i=e[t],u=ii(i.name),c=h[u]=h[u]||{geometries:[],materials:[]},l=ri({vertices:i.vertices.xyz,uvs:i.vertices.uvs,indices:i.faces.indices});if(l.name="model_geo_chunk_"+t,c.geometries.push(l),i.texture){(d=oi(i.texture in r?r[i.texture]:r[i.texture]=si(i.texture,n,s,o))).name="model_mtl_chunk_"+t,c.materials.push(d)}else{var d;(d=new dt).defines.USE_MAP=!1,d.uniforms.color.value=new a.Color(16777215),d.name="model_mtl_chunk_"+t,c.materials.push(d)}}}))}))).then((function(){return Gt((function(){for(var e=0;e<h.length;e++){var t=h[e];if(t){var i=Wt.mergeBufferGeometries(t.geometries,!0);t.geometries.forEach((function(e){return e.dispose()}));var n=new tt(i,t.materials);n.floorIndex=e,n.name="model_floor_"+e,d.push(n)}}}))}))).then((function(){var e=Object.keys(r).map((function(e){return r[e].then((function(){}))}));return Promise.all(e).then((function(){return d}))}))}function ci(e,t){return!1!==(e=Object.assign({},e)).autoResize&&(t>96?e.size=Math.min(e.size||1/0,100):t>48?e.size=Math.min(e.size||1/0,200):t>24?e.size=Math.min(e.size||1/0,400):t>12&&(e.size=Math.min(e.size||1/0,800))),e}var li={OutWindow:function(){this._windowSize=0}};li.OutWindow.prototype.create=function(e){this._buffer&&this._windowSize===e||(this._buffer=[]),this._windowSize=e,this._pos=0,this._streamPos=0},li.OutWindow.prototype.flush=function(){var e=this._pos-this._streamPos;if(0!==e){for(;e--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},li.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},li.OutWindow.prototype.setStream=function(e){this.releaseStream(),this._stream=e},li.OutWindow.prototype.init=function(e){e||(this._streamPos=0,this._pos=0)},li.OutWindow.prototype.copyBlock=function(e,t){var i=this._pos-e-1;for(i<0&&(i+=this._windowSize);t--;)i>=this._windowSize&&(i=0),this._buffer[this._pos++]=this._buffer[i++],this._pos>=this._windowSize&&this.flush()},li.OutWindow.prototype.putByte=function(e){this._buffer[this._pos++]=e,this._pos>=this._windowSize&&this.flush()},li.OutWindow.prototype.getByte=function(e){var t=this._pos-e-1;return t<0&&(t+=this._windowSize),this._buffer[t]},li.RangeDecoder=function(){},li.RangeDecoder.prototype.setStream=function(e){this._stream=e},li.RangeDecoder.prototype.releaseStream=function(){this._stream=null},li.RangeDecoder.prototype.init=function(){var e=5;for(this._code=0,this._range=-1;e--;)this._code=this._code<<8|this._stream.readByte()},li.RangeDecoder.prototype.decodeDirectBits=function(e){for(var t,i=0,n=e;n--;)this._range>>>=1,t=this._code-this._range>>>31,this._code-=this._range&t-1,i=i<<1|1-t,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return i},li.RangeDecoder.prototype.decodeBit=function(e,t){var i=e[t],n=(this._range>>>11)*i;return(2147483648^this._code)<(2147483648^n)?(this._range=n,e[t]+=2048-i>>>5,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=n,this._code-=n,e[t]-=i>>>5,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},li.initBitModels=function(e,t){for(;t--;)e[t]=1024},li.BitTreeDecoder=function(e){this._models=[],this._numBitLevels=e},li.BitTreeDecoder.prototype.init=function(){li.initBitModels(this._models,1<<this._numBitLevels)},li.BitTreeDecoder.prototype.decode=function(e){for(var t=1,i=this._numBitLevels;i--;)t=t<<1|e.decodeBit(this._models,t);return t-(1<<this._numBitLevels)},li.BitTreeDecoder.prototype.reverseDecode=function(e){for(var t,i=1,n=0,r=0;r<this._numBitLevels;++r)i=i<<1|(t=e.decodeBit(this._models,i)),n|=t<<r;return n},li.reverseDecode2=function(e,t,i,n){for(var r,s=1,o=0,a=0;a<n;++a)s=s<<1|(r=i.decodeBit(e,t+s)),o|=r<<a;return o},li.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new li.BitTreeDecoder(8),this._numPosStates=0},li.LenDecoder.prototype.create=function(e){for(;this._numPosStates<e;++this._numPosStates)this._lowCoder[this._numPosStates]=new li.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new li.BitTreeDecoder(3)},li.LenDecoder.prototype.init=function(){var e=this._numPosStates;for(li.initBitModels(this._choice,2);e--;)this._lowCoder[e].init(),this._midCoder[e].init();this._highCoder.init()},li.LenDecoder.prototype.decode=function(e,t){return 0===e.decodeBit(this._choice,0)?this._lowCoder[t].decode(e):0===e.decodeBit(this._choice,1)?8+this._midCoder[t].decode(e):16+this._highCoder.decode(e)},li.Decoder2=function(){this._decoders=[]},li.Decoder2.prototype.init=function(){li.initBitModels(this._decoders,768)},li.Decoder2.prototype.decodeNormal=function(e){var t=1;do{t=t<<1|e.decodeBit(this._decoders,t)}while(t<256);return 255&t},li.Decoder2.prototype.decodeWithMatchByte=function(e,t){var i,n,r=1;do{if(i=t>>7&1,t<<=1,r=r<<1|(n=e.decodeBit(this._decoders,(1+i<<8)+r)),i!==n){for(;r<256;)r=r<<1|e.decodeBit(this._decoders,r);break}}while(r<256);return 255&r},li.LiteralDecoder=function(){},li.LiteralDecoder.prototype.create=function(e,t){var i;if(!this._coders||this._numPrevBits!==t||this._numPosBits!==e)for(this._numPosBits=e,this._posMask=(1<<e)-1,this._numPrevBits=t,this._coders=[],i=1<<this._numPrevBits+this._numPosBits;i--;)this._coders[i]=new li.Decoder2},li.LiteralDecoder.prototype.init=function(){for(var e=1<<this._numPrevBits+this._numPosBits;e--;)this._coders[e].init()},li.LiteralDecoder.prototype.getDecoder=function(e,t){return this._coders[((e&this._posMask)<<this._numPrevBits)+((255&t)>>>8-this._numPrevBits)]},li.Decoder=function(){this._outWindow=new li.OutWindow,this._rangeDecoder=new li.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new li.BitTreeDecoder(4),this._lenDecoder=new li.LenDecoder,this._repLenDecoder=new li.LenDecoder,this._literalDecoder=new li.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new li.BitTreeDecoder(6),this._posSlotDecoder[1]=new li.BitTreeDecoder(6),this._posSlotDecoder[2]=new li.BitTreeDecoder(6),this._posSlotDecoder[3]=new li.BitTreeDecoder(6)},li.Decoder.prototype.setDictionarySize=function(e){return!(e<0)&&(this._dictionarySize!==e&&(this._dictionarySize=e,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},li.Decoder.prototype.setLcLpPb=function(e,t,i){var n=1<<i;return!(e>8||t>4||i>4)&&(this._literalDecoder.create(t,e),this._lenDecoder.create(n),this._repLenDecoder.create(n),this._posStateMask=n-1,!0)},li.Decoder.prototype.init=function(){var e=4;for(this._outWindow.init(!1),li.initBitModels(this._isMatchDecoders,192),li.initBitModels(this._isRep0LongDecoders,192),li.initBitModels(this._isRepDecoders,12),li.initBitModels(this._isRepG0Decoders,12),li.initBitModels(this._isRepG1Decoders,12),li.initBitModels(this._isRepG2Decoders,12),li.initBitModels(this._posDecoders,114),this._literalDecoder.init();e--;)this._posSlotDecoder[e].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},li.Decoder.prototype.decode=function(e,t,i){var n,r,s,o,a,u,c=0,l=0,h=0,d=0,A=0,p=0,M=0;for(this._rangeDecoder.setStream(e),this._outWindow.setStream(t),this.init();i<0||p<i;)if(n=p&this._posStateMask,0===this._rangeDecoder.decodeBit(this._isMatchDecoders,(c<<4)+n))r=this._literalDecoder.getDecoder(p++,M),M=c>=7?r.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(l)):r.decodeNormal(this._rangeDecoder),this._outWindow.putByte(M),c=c<4?0:c-(c<10?3:6);else{if(1===this._rangeDecoder.decodeBit(this._isRepDecoders,c))s=0,0===this._rangeDecoder.decodeBit(this._isRepG0Decoders,c)?0===this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(c<<4)+n)&&(c=c<7?9:11,s=1):(0===this._rangeDecoder.decodeBit(this._isRepG1Decoders,c)?o=h:(0===this._rangeDecoder.decodeBit(this._isRepG2Decoders,c)?o=d:(o=A,A=d),d=h),h=l,l=o),0===s&&(s=2+this._repLenDecoder.decode(this._rangeDecoder,n),c=c<7?8:11);else if(A=d,d=h,h=l,s=2+this._lenDecoder.decode(this._rangeDecoder,n),c=c<7?7:10,(a=this._posSlotDecoder[s<=5?s-2:3].decode(this._rangeDecoder))>=4){if(l=(2|1&a)<<(u=(a>>1)-1),a<14)l+=li.reverseDecode2(this._posDecoders,l-a-1,this._rangeDecoder,u);else if(l+=this._rangeDecoder.decodeDirectBits(u-4)<<4,(l+=this._posAlignDecoder.reverseDecode(this._rangeDecoder))<0){if(-1===l)break;return!1}}else l=a;if(l>=p||l>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(l,s),p+=s,M=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},li.Decoder.prototype.setDecoderProperties=function(e){var t,i,n,r,s;return!(e.size<5)&&(i=(t=e.readByte())%9,n=(t=~~(t/9))%5,r=~~(t/5),!!this.setLcLpPb(i,n,r)&&(s=e.readByte(),s|=e.readByte()<<8,s|=e.readByte()<<16,s+=16777216*e.readByte(),this.setDictionarySize(s)))},li.decompress=function(e,t,i,n){var r=new li.Decoder;if(!r.setDecoderProperties(e))throw"Incorrect stream properties";if(!r.decode(t,i,n))throw"Error in data stream";return!0},li.decompressFile=function(e,t){var i,n=new li.Decoder;if(!n.setDecoderProperties(e))throw"Incorrect stream properties";if(i=e.readByte(),i|=e.readByte()<<8,i|=e.readByte()<<16,i+=16777216*e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),!n.decode(e,t,i))throw"Error in data stream";return!0};var hi="undefined"!=typeof Worker&&"undefined"!=typeof Blob,di="";if(hi)try{var Ai=new Blob(['\n self.onmessage = function (event) {\n var Packet = event.data;\n var Result = null;\n try {\n if (!Packet.PacketID) {\n throw new Error(\'No incoming id.\');\n }\n if (!Packet.Data) {\n throw new Error(\'No input data.\');\n }\n if (Packet.Type == \'compress\') {\n // C: checking if input is valid\n if (Packet.Data.constructor != Uint8Array) {\n throw new Error(\'Input data is not Uint8Array.\');\n }\n // C: encoding data\n Result = Util.compressFile(Packet.Data, null, Packet.Level, null);\n } else if (Packet.Type == \'decompress\') {\n // C: checking if input is valid\n if (Packet.Data.constructor != Uint8Array) {\n throw new Error(\'Input data is not Uint8Array.\');\n }\n var inStream = {\n data: Packet.Data,\n offset: 0,\n readByte () {\n return this.data[this.offset++];\n }\n };\n var partLength = inStream.data.length;\n var outStream = {\n data: [],\n offset: 0,\n writeByte (value) {\n var partIndex = Math.floor(this.offset / partLength);\n if (!this.data[partIndex]) {\n this.data[partIndex] = new Uint8Array(partLength);\n }\n this.data[partIndex][this.offset % partLength] = value;\n this.offset++;\n }\n }\n // C: decoding data\n\n LZMA.decompressFile(inStream, outStream);\n Result = new Uint8Array(outStream.offset)\n for (var i = 0; i < outStream.offset; i++) {\n Result[i] = outStream.data[Math.floor(i / partLength)][i % partLength];\n }\n }\n postMessage({ PacketID: Packet.PacketID, Result, Error: null }, [Result.buffer]);\n } catch (error) {\n postMessage({ PacketID: Packet.PacketID, Error: error.toString() });\n }\n };\n\n\n /*\n Copyright (c) 2011 Juan Mellado\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the "Software"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\n /*\n References:\n - "LZMA SDK" by Igor Pavlov\n http://www.7-zip.org/sdk.html\n */\n\n var LZMA = LZMA || {};\n\n LZMA.OutWindow = function(){\n this._windowSize = 0;\n };\n\n LZMA.OutWindow.prototype.create = function(windowSize){\n if ( (!this._buffer) || (this._windowSize !== windowSize) ){\n this._buffer = [];\n }\n this._windowSize = windowSize;\n this._pos = 0;\n this._streamPos = 0;\n };\n\n LZMA.OutWindow.prototype.flush = function(){\n var size = this._pos - this._streamPos;\n if (size !== 0){\n while(size --){\n this._stream.writeByte(this._buffer[this._streamPos ++]);\n }\n if (this._pos >= this._windowSize){\n this._pos = 0;\n }\n this._streamPos = this._pos;\n }\n };\n\n LZMA.OutWindow.prototype.releaseStream = function(){\n this.flush();\n this._stream = null;\n };\n\n LZMA.OutWindow.prototype.setStream = function(stream){\n this.releaseStream();\n this._stream = stream;\n };\n\n LZMA.OutWindow.prototype.init = function(solid){\n if (!solid){\n this._streamPos = 0;\n this._pos = 0;\n }\n };\n\n LZMA.OutWindow.prototype.copyBlock = function(distance, len){\n var pos = this._pos - distance - 1;\n if (pos < 0){\n pos += this._windowSize;\n }\n while(len --){\n if (pos >= this._windowSize){\n pos = 0;\n }\n this._buffer[this._pos ++] = this._buffer[pos ++];\n if (this._pos >= this._windowSize){\n this.flush();\n }\n }\n };\n\n LZMA.OutWindow.prototype.putByte = function(b){\n this._buffer[this._pos ++] = b;\n if (this._pos >= this._windowSize){\n this.flush();\n }\n };\n\n LZMA.OutWindow.prototype.getByte = function(distance){\n var pos = this._pos - distance - 1;\n if (pos < 0){\n pos += this._windowSize;\n }\n return this._buffer[pos];\n };\n\n LZMA.RangeDecoder = function(){\n };\n\n LZMA.RangeDecoder.prototype.setStream = function(stream){\n this._stream = stream;\n };\n\n LZMA.RangeDecoder.prototype.releaseStream = function(){\n this._stream = null;\n };\n\n LZMA.RangeDecoder.prototype.init = function(){\n var i = 5;\n\n this._code = 0;\n this._range = -1;\n\n while(i --){\n this._code = (this._code << 8) | this._stream.readByte();\n }\n };\n\n LZMA.RangeDecoder.prototype.decodeDirectBits = function(numTotalBits){\n var result = 0, i = numTotalBits, t;\n\n while(i --){\n this._range >>>= 1;\n t = (this._code - this._range) >>> 31;\n this._code -= this._range & (t - 1);\n result = (result << 1) | (1 - t);\n\n if ( (this._range & 0xff000000) === 0){\n this._code = (this._code << 8) | this._stream.readByte();\n this._range <<= 8;\n }\n }\n\n return result;\n };\n\n LZMA.RangeDecoder.prototype.decodeBit = function(probs, index){\n var prob = probs[index],\n newBound = (this._range >>> 11) * prob;\n\n if ( (this._code ^ 0x80000000) < (newBound ^ 0x80000000) ){\n this._range = newBound;\n probs[index] += (2048 - prob) >>> 5;\n if ( (this._range & 0xff000000) === 0){\n this._code = (this._code << 8) | this._stream.readByte();\n this._range <<= 8;\n }\n return 0;\n }\n\n this._range -= newBound;\n this._code -= newBound;\n probs[index] -= prob >>> 5;\n if ( (this._range & 0xff000000) === 0){\n this._code = (this._code << 8) | this._stream.readByte();\n this._range <<= 8;\n }\n return 1;\n };\n\n LZMA.initBitModels = function(probs, len){\n while(len --){\n probs[len] = 1024;\n }\n };\n\n LZMA.BitTreeDecoder = function(numBitLevels){\n this._models = [];\n this._numBitLevels = numBitLevels;\n };\n\n LZMA.BitTreeDecoder.prototype.init = function(){\n LZMA.initBitModels(this._models, 1 << this._numBitLevels);\n };\n\n LZMA.BitTreeDecoder.prototype.decode = function(rangeDecoder){\n var m = 1, i = this._numBitLevels;\n\n while(i --){\n m = (m << 1) | rangeDecoder.decodeBit(this._models, m);\n }\n return m - (1 << this._numBitLevels);\n };\n\n LZMA.BitTreeDecoder.prototype.reverseDecode = function(rangeDecoder){\n var m = 1, symbol = 0, i = 0, bit;\n\n for (; i < this._numBitLevels; ++ i){\n bit = rangeDecoder.decodeBit(this._models, m);\n m = (m << 1) | bit;\n symbol |= bit << i;\n }\n return symbol;\n };\n\n LZMA.reverseDecode2 = function(models, startIndex, rangeDecoder, numBitLevels){\n var m = 1, symbol = 0, i = 0, bit;\n\n for (; i < numBitLevels; ++ i){\n bit = rangeDecoder.decodeBit(models, startIndex + m);\n m = (m << 1) | bit;\n symbol |= bit << i;\n }\n return symbol;\n };\n\n LZMA.LenDecoder = function(){\n this._choice = [];\n this._lowCoder = [];\n this._midCoder = [];\n this._highCoder = new LZMA.BitTreeDecoder(8);\n this._numPosStates = 0;\n };\n\n LZMA.LenDecoder.prototype.create = function(numPosStates){\n for (; this._numPosStates < numPosStates; ++ this._numPosStates){\n this._lowCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3);\n this._midCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3);\n }\n };\n\n LZMA.LenDecoder.prototype.init = function(){\n var i = this._numPosStates;\n LZMA.initBitModels(this._choice, 2);\n while(i --){\n this._lowCoder[i].init();\n this._midCoder[i].init();\n }\n this._highCoder.init();\n };\n\n LZMA.LenDecoder.prototype.decode = function(rangeDecoder, posState){\n if (rangeDecoder.decodeBit(this._choice, 0) === 0){\n return this._lowCoder[posState].decode(rangeDecoder);\n }\n if (rangeDecoder.decodeBit(this._choice, 1) === 0){\n return 8 + this._midCoder[posState].decode(rangeDecoder);\n }\n return 16 + this._highCoder.decode(rangeDecoder);\n };\n\n LZMA.Decoder2 = function(){\n this._decoders = [];\n };\n\n LZMA.Decoder2.prototype.init = function(){\n LZMA.initBitModels(this._decoders, 0x300);\n };\n\n LZMA.Decoder2.prototype.decodeNormal = function(rangeDecoder){\n var symbol = 1;\n\n do{\n symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol);\n }while(symbol < 0x100);\n\n return symbol & 0xff;\n };\n\n LZMA.Decoder2.prototype.decodeWithMatchByte = function(rangeDecoder, matchByte){\n var symbol = 1, matchBit, bit;\n\n do{\n matchBit = (matchByte >> 7) & 1;\n matchByte <<= 1;\n bit = rangeDecoder.decodeBit(this._decoders, ( (1 + matchBit) << 8) + symbol);\n symbol = (symbol << 1) | bit;\n if (matchBit !== bit){\n while(symbol < 0x100){\n symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol);\n }\n break;\n }\n }while(symbol < 0x100);\n\n return symbol & 0xff;\n };\n\n LZMA.LiteralDecoder = function(){\n };\n\n LZMA.LiteralDecoder.prototype.create = function(numPosBits, numPrevBits){\n var i;\n\n if (this._coders\n && (this._numPrevBits === numPrevBits)\n && (this._numPosBits === numPosBits) ){\n return;\n }\n this._numPosBits = numPosBits;\n this._posMask = (1 << numPosBits) - 1;\n this._numPrevBits = numPrevBits;\n\n this._coders = [];\n\n i = 1 << (this._numPrevBits + this._numPosBits);\n while(i --){\n this._coders[i] = new LZMA.Decoder2();\n }\n };\n\n LZMA.LiteralDecoder.prototype.init = function(){\n var i = 1 << (this._numPrevBits + this._numPosBits);\n while(i --){\n this._coders[i].init();\n }\n };\n\n LZMA.LiteralDecoder.prototype.getDecoder = function(pos, prevByte){\n return this._coders[( (pos & this._posMask) << this._numPrevBits)\n + ( (prevByte & 0xff) >>> (8 - this._numPrevBits) )];\n };\n\n LZMA.Decoder = function(){\n this._outWindow = new LZMA.OutWindow();\n this._rangeDecoder = new LZMA.RangeDecoder();\n this._isMatchDecoders = [];\n this._isRepDecoders = [];\n this._isRepG0Decoders = [];\n this._isRepG1Decoders = [];\n this._isRepG2Decoders = [];\n this._isRep0LongDecoders = [];\n this._posSlotDecoder = [];\n this._posDecoders = [];\n this._posAlignDecoder = new LZMA.BitTreeDecoder(4);\n this._lenDecoder = new LZMA.LenDecoder();\n this._repLenDecoder = new LZMA.LenDecoder();\n this._literalDecoder = new LZMA.LiteralDecoder();\n this._dictionarySize = -1;\n this._dictionarySizeCheck = -1;\n\n this._posSlotDecoder[0] = new LZMA.BitTreeDecoder(6);\n this._posSlotDecoder[1] = new LZMA.BitTreeDecoder(6);\n this._posSlotDecoder[2] = new LZMA.BitTreeDecoder(6);\n this._posSlotDecoder[3] = new LZMA.BitTreeDecoder(6);\n };\n\n LZMA.Decoder.prototype.setDictionarySize = function(dictionarySize){\n if (dictionarySize < 0){\n return false;\n }\n if (this._dictionarySize !== dictionarySize){\n this._dictionarySize = dictionarySize;\n this._dictionarySizeCheck = Math.max(this._dictionarySize, 1);\n this._outWindow.create( Math.max(this._dictionarySizeCheck, 4096) );\n }\n return true;\n };\n\n LZMA.Decoder.prototype.setLcLpPb = function(lc, lp, pb){\n var numPosStates = 1 << pb;\n\n if (lc > 8 || lp > 4 || pb > 4){\n return false;\n }\n\n this._literalDecoder.create(lp, lc);\n\n this._lenDecoder.create(numPosStates);\n this._repLenDecoder.create(numPosStates);\n this._posStateMask = numPosStates - 1;\n\n return true;\n };\n\n LZMA.Decoder.prototype.init = function(){\n var i = 4;\n\n this._outWindow.init(false);\n\n LZMA.initBitModels(this._isMatchDecoders, 192);\n LZMA.initBitModels(this._isRep0LongDecoders, 192);\n LZMA.initBitModels(this._isRepDecoders, 12);\n LZMA.initBitModels(this._isRepG0Decoders, 12);\n LZMA.initBitModels(this._isRepG1Decoders, 12);\n LZMA.initBitModels(this._isRepG2Decoders, 12);\n LZMA.initBitModels(this._posDecoders, 114);\n\n this._literalDecoder.init();\n\n while(i --){\n this._posSlotDecoder[i].init();\n }\n\n this._lenDecoder.init();\n this._repLenDecoder.init();\n this._posAlignDecoder.init();\n this._rangeDecoder.init();\n };\n\n LZMA.Decoder.prototype.decode = function(inStream, outStream, outSize){\n var state = 0, rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0, nowPos64 = 0, prevByte = 0,\n posState, decoder2, len, distance, posSlot, numDirectBits;\n\n this._rangeDecoder.setStream(inStream);\n this._outWindow.setStream(outStream);\n\n this.init();\n\n while(outSize < 0 || nowPos64 < outSize){\n posState = nowPos64 & this._posStateMask;\n\n if (this._rangeDecoder.decodeBit(this._isMatchDecoders, (state << 4) + posState) === 0){\n decoder2 = this._literalDecoder.getDecoder(nowPos64 ++, prevByte);\n\n if (state >= 7){\n prevByte = decoder2.decodeWithMatchByte(this._rangeDecoder, this._outWindow.getByte(rep0) );\n }else{\n prevByte = decoder2.decodeNormal(this._rangeDecoder);\n }\n this._outWindow.putByte(prevByte);\n\n state = state < 4? 0: state - (state < 10? 3: 6);\n\n }else{\n\n if (this._rangeDecoder.decodeBit(this._isRepDecoders, state) === 1){\n len = 0;\n if (this._rangeDecoder.decodeBit(this._isRepG0Decoders, state) === 0){\n if (this._rangeDecoder.decodeBit(this._isRep0LongDecoders, (state << 4) + posState) === 0){\n state = state < 7? 9: 11;\n len = 1;\n }\n }else{\n if (this._rangeDecoder.decodeBit(this._isRepG1Decoders, state) === 0){\n distance = rep1;\n }else{\n if (this._rangeDecoder.decodeBit(this._isRepG2Decoders, state) === 0){\n distance = rep2;\n }else{\n distance = rep3;\n rep3 = rep2;\n }\n rep2 = rep1;\n }\n rep1 = rep0;\n rep0 = distance;\n }\n if (len === 0){\n len = 2 + this._repLenDecoder.decode(this._rangeDecoder, posState);\n state = state < 7? 8: 11;\n }\n }else{\n rep3 = rep2;\n rep2 = rep1;\n rep1 = rep0;\n\n len = 2 + this._lenDecoder.decode(this._rangeDecoder, posState);\n state = state < 7? 7: 10;\n\n posSlot = this._posSlotDecoder[len <= 5? len - 2: 3].decode(this._rangeDecoder);\n if (posSlot >= 4){\n\n numDirectBits = (posSlot >> 1) - 1;\n rep0 = (2 | (posSlot & 1) ) << numDirectBits;\n\n if (posSlot < 14){\n rep0 += LZMA.reverseDecode2(this._posDecoders,\n rep0 - posSlot - 1, this._rangeDecoder, numDirectBits);\n }else{\n rep0 += this._rangeDecoder.decodeDirectBits(numDirectBits - 4) << 4;\n rep0 += this._posAlignDecoder.reverseDecode(this._rangeDecoder);\n if (rep0 < 0){\n if (rep0 === -1){\n break;\n }\n return false;\n }\n }\n }else{\n rep0 = posSlot;\n }\n }\n\n if (rep0 >= nowPos64 || rep0 >= this._dictionarySizeCheck){\n return false;\n }\n\n this._outWindow.copyBlock(rep0, len);\n nowPos64 += len;\n prevByte = this._outWindow.getByte(0);\n }\n }\n\n this._outWindow.flush();\n this._outWindow.releaseStream();\n this._rangeDecoder.releaseStream();\n\n return true;\n };\n\n LZMA.Decoder.prototype.setDecoderProperties = function(properties){\n var value, lc, lp, pb, dictionarySize;\n\n if (properties.size < 5){\n return false;\n }\n\n value = properties.readByte();\n lc = value % 9;\n value = ~~(value / 9);\n lp = value % 5;\n pb = ~~(value / 5);\n\n if ( !this.setLcLpPb(lc, lp, pb) ){\n return false;\n }\n\n dictionarySize = properties.readByte();\n dictionarySize |= properties.readByte() << 8;\n dictionarySize |= properties.readByte() << 16;\n dictionarySize += properties.readByte() * 16777216;\n\n return this.setDictionarySize(dictionarySize);\n };\n\n LZMA.decompress = function(properties, inStream, outStream, outSize){\n var decoder = new LZMA.Decoder();\n\n if ( !decoder.setDecoderProperties(properties) ){\n throw "Incorrect stream properties";\n }\n\n if ( !decoder.decode(inStream, outStream, outSize) ){\n throw "Error in data stream";\n }\n\n return true;\n };\n\n LZMA.decompressFile = function(inStream, outStream){\n var decoder = new LZMA.Decoder(), outSize;\n\n if ( !decoder.setDecoderProperties(inStream) ){\n throw "Incorrect stream properties";\n }\n\n outSize = inStream.readByte();\n outSize |= inStream.readByte() << 8;\n outSize |= inStream.readByte() << 16;\n outSize += inStream.readByte() * 16777216;\n\n inStream.readByte();\n inStream.readByte();\n inStream.readByte();\n inStream.readByte();\n\n if ( !decoder.decode(inStream, outStream, outSize) ){\n throw "Error in data stream";\n }\n\n return true;\n };\n'],{type:"text/javascript"});di=URL.createObjectURL(Ai)}catch(e){}var pi=function(){function e(){var e=this;if(this.callCounter=0,this.requests=[],!hi)throw new Error("LZMACaller cannot work in this broswer.");var t=this.worker=new Worker(di);t.onmessage=function(t){var i,n,r=t.data,s=r.PacketID,o=r.Result,a=r.Error;a?null===(n=e.requests[s])||void 0===n||n.onCompleteCallback(new Error(a)):null===(i=e.requests[s])||void 0===i||i.onCompleteCallback(null,o),delete e.requests[s]},t.onerror=function(e){return console.error(e)}}return e.prototype.compress=function(e,t,i){var n=++this.callCounter;this.requests[n]={onCompleteCallback:i},this.worker.postMessage({Type:"compress",PacketID:n,Data:e,Level:t},[e.buffer])},e.prototype.decompress=function(e,t){var i=++this.callCounter;this.requests[i]={onCompleteCallback:t},this.worker.postMessage({Type:"decompress",PacketID:i,Data:e},[e.buffer])},e.prototype.terminate=function(){this.worker.terminate()},e.support=hi,e}();function Mi(e){return Array.prototype.reduce.call(e,(function(e,t,i){return e|t<<8*i}),0)}function fi(e){for(var t=new Uint8Array(e),i=Mi(t.slice(0,4)),n=[],r=[],s=4+4*i,o=0;o<i;o++)r[o]=Mi(t.slice(4+4*o,8+4*o)),n[o]=o===i-1?t.subarray(s,s+r[o]):t.slice(s,s+r[o]),s+=r[o];return pi.support?function(e){for(var t=[],i=e.length,n=function(i){t.push(new Promise((function(t,n){var r=new pi;r.decompress(e[i],(function(e,i){if(r.terminate(),e)return n(e);t(i)}))})))},r=0;r<i;r++)n(r);return Promise.all(t)}(n):Promise.resolve(function(e){for(var t,i=[],n=e.length,r=function(n){var r={data:e[n],offset:0,readByte:function(){return this.data[this.offset++]}},s=r.data.length,o={data:[],offset:0,writeByte:function(e){var t=Math.floor(this.offset/s);this.data[t]||(this.data[t]=new Uint8Array(s)),this.data[t][this.offset%s]=e,this.offset++}};li.decompressFile(r,o),t=new Uint8Array(o.offset);for(var a=0;a<o.offset;a++)t[a]=o.data[Math.floor(a/s)][a%s];i.push(t)},s=0;s<n;s++)r(s);return i}(n))}function gi(e){return 0===e.indexOf("//")||/^[0-9a-z]+\:\/\//i.test(e)}var yi=u.parse("\nmessage Model {\n repeated Mesh meshes = 1;\n}\nmessage Mesh {\n required string name = 1;\n repeated Chunk chunks = 2;\n repeated Matrix matrix = 3;\n}\nmessage Matrix {\n repeated float elements = 1;\n}\nmessage Chunk {\n required Geometry geometry = 2;\n repeated Material material = 3;\n}\nmessage Geometry {\n required Position position = 1;\n optional UV uv = 2;\n optional UV uv2 = 3;\n required Normal normal = 4;\n repeated Group groups = 5;\n}\nmessage Position {\n repeated float array = 1[packed=true];\n}\nmessage UV {\n repeated float array = 1[packed=true];\n}\nmessage Normal {\n repeated float array = 1[packed=true];\n}\nmessage Group {\n required uint32 start = 1;\n required uint32 count = 2;\n required uint32 materialIndex = 3;\n}\nmessage Material {\n optional Color kd = 1;\n optional Color ks = 2;\n optional Color ke = 3;\n optional string mapkd = 4;\n optional string mapks = 5;\n optional string mapke = 6;\n optional string norm = 7;\n optional string mapbump = 8;\n optional string bump = 9;\n optional string mapd = 10;\n optional float ns = 11;\n optional float d = 12;\n optional float tr = 13;\n optional string mapkdrepeat = 14;\n}\nmessage Color {\n repeated float rgb = 1;\n}\n").root.lookup("Model");var vi={};function mi(e,t,i,n,r){var s,o=[],u=[];function c(e,s,o){var c=function(e){var t=e.position,i=e.normal,n=e.uv,r=e.uv2,s=e.groups,o=new a.BufferGeometry;return o.setAttribute("position",new a.BufferAttribute(new Float32Array(t.array),3)),i&&o.setAttribute("normal",new a.BufferAttribute(new Float32Array(i.array),3)),n&&o.setAttribute("uv",new a.BufferAttribute(new Float32Array(n.array),2)),r&&o.setAttribute("uv2",new a.BufferAttribute(new Float32Array(r.array),2)),s.forEach((function(e){return o.addGroup(e.start,e.count,e.materialIndex)})),o}(e);c.applyMatrix4(o);var l=new a.Vector3,h=new a.Quaternion,d=new a.Vector3;o.decompose(l,h,d),d.x*d.y*d.z<0&&c.attributes.normal&&c.attributes.position&&c.attributes.uv&&function(e){for(var t=[0,0,0],i=0;i<e.attributes.normal.array.length/9;i++)t[0]=e.attributes.normal.array[9*i],t[1]=e.attributes.normal.array[9*i+1],t[2]=e.attributes.normal.array[9*i+2],e.attributes.normal.array[9*i]=e.attributes.normal.array[9*i+6],e.attributes.normal.array[9*i+1]=e.attributes.normal.array[9*i+7],e.attributes.normal.array[9*i+2]=e.attributes.normal.array[9*i+8],e.attributes.normal.array[9*i+6]=t[0],e.attributes.normal.array[9*i+7]=t[1],e.attributes.normal.array[9*i+8]=t[2];for(i=0;i<e.attributes.position.array.length/9;i++)t[0]=e.attributes.position.array[9*i],t[1]=e.attributes.position.array[9*i+1],t[2]=e.attributes.position.array[9*i+2],e.attributes.position.array[9*i]=e.attributes.position.array[9*i+6],e.attributes.position.array[9*i+1]=e.attributes.position.array[9*i+7],e.attributes.position.array[9*i+2]=e.attributes.position.array[9*i+8],e.attributes.position.array[9*i+6]=t[0],e.attributes.position.array[9*i+7]=t[1],e.attributes.position.array[9*i+8]=t[2];for(i=0;i<e.attributes.uv.array.length/6;i++)t[0]=e.attributes.uv.array[6*i],t[1]=e.attributes.uv.array[6*i+1],e.attributes.uv.array[6*i]=e.attributes.uv.array[6*i+4],e.attributes.uv.array[6*i+1]=e.attributes.uv.array[6*i+5],e.attributes.uv.array[6*i+4]=t[0],e.attributes.uv.array[6*i+5]=t[1];e.attributes.normal.needsUpdate=!0,e.attributes.position.needsUpdate=!0,e.attributes.uv.needsUpdate=!0}(c);var A=s.map((function(e){var s=function(e,t,i,n,r){var s={sourceFile:null,needsUpdate:!0,wrapS:a.RepeatWrapping,wrapT:a.RepeatWrapping};function o(e,o){return vi[e]?Promise.resolve(vi[e]):new Promise((function(u,c){var l=new Qt({allowHosts:n,networkSubscribe:r});gi(e)||(e=t+e),-1!==(e=(e=e.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/")).split("?")[0]).indexOf(".png")&&(e=e.split(".png")[0]+".png"),-1!==e.indexOf(".jpg")&&(e=e.split(".jpg")[0]+".jpg"),0===e.indexOf("//")&&(e="https:"+e),e=Ut(e,Object.assign({key:"texture"},i,{size:64})),l.load(e,(function(t){var i=new a.Texture(t),n=i.dispose;i.dispose=function(){n.call(i),/^blob\:/.test(t.src)&&URL.revokeObjectURL(t.src)},o&&Object.assign(i.repeat,o),Object.assign(i,s,{sourceFile:e}),i.updateMatrix(),vi[e]=i,u(i)}),He,(function(e){return c(e.error)}))}))}var u=[],c=new dt,l=c.uniforms;l.exposure.value=4.3;var h,d=c.defines;if(d.USE_MAP=!1,d.USE_UV=!1,e.hasOwnProperty("kd")&&(l.diffuse.value=(new a.Color).fromArray(e.kd.rgb)),e.hasOwnProperty("mapkd")){var A=void 0;if(e.mapkdrepeat){var p=e.mapkdrepeat.split(/\s+/).map((function(e){return Number(e)})),M=p[0],f=p[1];A=new a.Vector2(M,f)}u.push(o(e.mapkd,A).then((function(e){d.USE_MAP=!0,d.USE_UV=!0,l.map.value=e,l.uvTransform.value=e.matrix})).catch((function(e){})))}return e.hasOwnProperty("ks")&&(l.specular.value=(new a.Color).fromArray(e.ks.rgb)),e.hasOwnProperty("mapks")&&u.push(o(e.mapks).then((function(e){l.specularMap.value=e})).catch((function(e){}))),e.hasOwnProperty("ke")&&(l.emissive.value=(new a.Color).fromArray(e.ke.rgb)),e.hasOwnProperty("mapke")&&u.push(o(e.mapke).then((function(e){l.emissiveMap.value=e})).catch((function(e){}))),e.hasOwnProperty("norm")&&u.push(o(e.norm).then((function(e){l.normalMap.value=e})).catch((function(e){}))),e.hasOwnProperty("mapbump")&&u.push(o(e.mapbump).then((function(e){l.bumpMap.value=e})).catch((function(e){}))),e.hasOwnProperty("bump")&&u.push(o(e.bump).then((function(e){l.bumpMap.value=e})).catch((function(e){}))),e.hasOwnProperty("ns")&&(l.shininess.value=e.ns),e.hasOwnProperty("d")&&(h=e.d)>=0&&h<1&&(l.originOpacity.value=h),e.hasOwnProperty("tr")&&(h=1-e.tr)>=0&&h<1&&(l.originOpacity.value=h),l.originOpacity.value<1&&(c.transparent=!0),{material:c,textureReady:Promise.all(u).then((function(){}))}}(e,t,i,n,r),o=s.material,c=s.textureReady;return u.push(c),o}));return new tt(c,A)}return(s=e,yi.decode(s)).meshes.forEach((function(e){var t=e.name,i=e.chunks,n=e.matrix;"Ceiling"!==t&&"CeilingDrop"!==t&&n.map((function(e){var n,r=new a.Matrix4;if(r.elements=e.elements,1===i.length){var s=i[0],u=s.geometry,l=s.material;n=c(u,l,r)}else n=new nt,i.forEach((function(e,t){var i=c(e.geometry,e.material,r);i.name="chunk"+t,n.add(i)}));n.floorIndex=0,n.name=t,o.push(n)}))})),Promise.all(u).catch((function(){})).then((function(){return o}))}function Ni(){Object.keys(vi).forEach((function(e){vi[e].dispose(),delete vi[e]}))}function Di(e){var i;return new((i=a.Triangle).bind.apply(i,t.__spreadArray([void 0],e.map((function(e){return new a.Vector3(e.x,e.y,e.z)})),!1)))}var wi={at3d:function(e,t){for(var i=ci(t.imageOptions,e.textures.length),n={},r=0,s=e.textures;r<s.length;r++){var o=s[r];n[o]=si(o,i,t.allowHosts,t.networkSubscribe)}var a={responseType:"arraybuffer",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe};return Promise.resolve().then((function(){return kt.async(e.file,a)})).then((function(e){return fi(e.body)})).then((function(e){return Gt((function(){for(var t=[],i=0,n=e;i<n.length;i++){var r=n[i],s=ai.decode(r);t.push.apply(t,s.chunks)}return t}))})).then((function(r){return Gt((function(){return ui(r,e.textureBase,e.textures.slice(),i,n,t.allowHosts,t.networkSubscribe)}))}))},pbm:function(e,t){for(var i=ci(t.imageOptions,e.textures.length),n={},r=0,s=e.textures;r<s.length;r++){var o=s[r];n[o]=si(o,i,t.allowHosts,t.networkSubscribe)}var a={responseType:"arraybuffer",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe};return Promise.resolve().then((function(){return kt.async(e.file,a)})).then((function(e){return Gt((function(){var t=new Uint8Array(e.body),i=ai.decode(t);return[].concat(i.chunks)}))})).then((function(r){return Gt((function(){return ui(r,e.textureBase,e.textures.slice(),i,n,t.allowHosts,t.networkSubscribe)}))}))},dome:function(e,t){var i={responseType:"arraybuffer",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe};return Promise.resolve().then((function(){return Ni()})).then((function(){return kt.async(e.file,i)})).then((function(i){return mi(new Uint8Array(i.body),e.textureBase,t.imageOptions,t.allowHosts,t.networkSubscribe)}))},domez:function(e,t){var i={responseType:"arraybuffer",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe};return Promise.resolve().then((function(){return Ni()})).then((function(){return kt.async(e.file,i)})).then((function(e){return fi(e.body)})).then((function(e){var t=e.reduce((function(e,t){return e+t.length}),0),i=new Uint8Array(t),n=0;return e.forEach((function(e){i.set(e,n),n+=e.length})),i})).then((function(i){return mi(i,e.textureBase,t.imageOptions,t.allowHosts,t.networkSubscribe)}))}},Ti=function(e){function i(t){void 0===t&&(t={});var i=e.call(this)||this;return i.empty=!1,i.name="model",i.loaded=!1,i.bvhs=[],i.bounding=new a.Box3,i.shownFloor=null,i.floorLength=0,i.networkSubscribe=t.networkSubscribe,i.allowHosts=t.allowHosts,i}return t.__extends(i,e),Object.defineProperty(i.prototype,"shownfloor",{get:function(){return this.shownFloor},enumerable:!1,configurable:!0}),i.prototype.getEdges=function(e){var t;void 0===e&&(e=30/180*Math.PI);for(var i=Math.cos(e),n=[],r=0,s=this.children;r<s.length;r++){var o=s[r];if(o instanceof tt){for(var u={},c=["a","b","c"],l=Wt.mergeVertices(o.geometry),h=l.getAttribute("position").array,d=(null===(t=l.getIndex())||void 0===t?void 0:t.array)||[],A=[],p=[],M=0,f=h.length;M<f;M+=3)A.push(new a.Vector3(h[M],h[M+1],h[M+2]));for(M=0,f=d.length;M<f;M+=3){var g=d[M],y=d[M+1],v=d[M+2],m=(new a.Vector3).crossVectors(A[y].clone().sub(A[g]),A[v].clone().sub(A[g])).normalize();p.push({a:g,b:y,c:v,normal:m})}for(M=0,f=p.length;M<f;M++)for(var N=p[M],D=0;D<3;D++){var w=N[c[D]],T=N[c[(D+1)%3]],x=[Math.min(w,T),Math.max(w,T)];void 0===u[E=x[0]+"-"+x[1]]?u[E]={index1:x[0],index2:x[1],face1:M}:u[E].face2=M}for(var E in u){var j=u[E];if(void 0===j.face2||p[j.face1].normal.dot(p[j.face2].normal)<=i){var I=A[j.index1],z=A[j.index2];n.push(new a.Line3(I,z))}}l.dispose(),A.length=0,p.length=0}}return n},i.prototype.hasFloors=function(){return this.hasFloors_()},i.prototype.hasFloors_=function(){var e=[];return this.traverse((function(t){t instanceof tt&&(e[t.floorIndex]=!0)})),e.length},i.prototype.show=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=this.shownFloor,r=null,s=null!==(e=t[1])&&void 0!==e?e:.1,o=0!==t.length;this.shownFloor=r=o?t[0]:null,this.traverse((function(e){e instanceof tt&&e.material.forEach((function(t){null===r||r===e.floorIndex?t.opacity=1:t.opacity=s}))})),n!==this.shownFloor&&this.emit("shownFloorChange",this.shownFloor,this.floorLength),this.needsRender=!0},i.prototype.intersectRaycaster=function(e,t){var i=e.ray,n=i.origin,r=i.direction;if(Ve(t))if(Ve(this.shownFloor)){var s=this.floorLength;t=[];for(var o=0;o<s;o++)t.push(o)}else t=[this.shownFloor];var u=[],c=[];Array.isArray(t)?c.push.apply(c,t):c.push(t);for(var l=function(t){var i=h.bvhs&&h.bvhs[t];if(i){(s=i.intersectRay(n,r,!0).map((function(e){var t=e.intersectionPoint,i=e.triangle,r=new a.Vector3(t.x,t.y,t.z);return{point:r,face:{normal:Di(i).getNormal(new a.Vector3)},distance:n.distanceTo(r)}}))).length&&u.push.apply(u,s)}else{var s,o=[];h.traverse((function(e){e instanceof tt&&e.floorIndex===t&&o.push(e)})),(s=e.intersectObjects(o).map((function(e){var t=e.face?{normal:e.face.normal}:void 0;return{point:e.point,face:t,distance:e.distance}}))).length&&u.push.apply(u,s)}},h=this,d=0,A=c;d<A.length;d++){l(A[d])}return u.filter((function(t){var i=t.distance;return i<=e.far&&i>=e.near})).sort((function(e,t){return e.distance-t.distance}))},i.prototype.buildBVH=function(){var e=this,t=[];this.traverse((function(e){e instanceof tt&&(t[e.floorIndex]=t[e.floorIndex]||[],t[e.floorIndex].push(e.geometry))}));var i=t.map((function(e){var t=e.reduce((function(e,t){return e+(t.index?t.index.array.length:t.attributes.position.array.length)}),0),i=new Float32Array(3*t);return e.reduce((function(e,t){for(var n=t.index?t.index.array:null,r=t.attributes.position.array,s=n?n.length:r.length/3,o=0;o<s;o++){var a=3*(e+o),u=n?3*n[o]:3*o;i[a+0]=r[u+0],i[a+1]=r[u+1],i[a+2]=r[u+2]}return e+s}),0),new Nt(i,5)}));return this.bvhs=[],Promise.all(i.map((function(e){return new Promise((function(t){return e.splitNode(t)}))}))).then((function(){e.bvhs=i,e.bvhs.loaded=!0,e.emit("bvhLoaded")}))},i.prototype.load=function(e,t){var i=this;if(void 0===t&&(t={}),!0===this.loaded)throw new Error("[MODEL LOAD ERROR]: model cannot load twice.");var n=function(e,t){void 0===t&&(t=[]);var i=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(e);if(!i)return"";for(var n=0,r=String(i[1]).trim().split(".").slice(1).reverse();n<r.length;n++){var s=r[n],o=t.indexOf(s);if(o>=0)return t[o]}return""}(e.file,Object.keys(wi)),r=wi[n];if(!r)throw new Error("[MODEL LOAD ERROR]: file type("+n+") does not support.");return r(e,{imageOptions:t,allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe}).then((function(e){for(var t=[],n=0,r=e;n<r.length;n++){(c=r[n]).traverse((function(e){e instanceof tt&&(e.geometry.computeBoundingBox(),e.geometry.computeBoundingSphere(),t.push(e.geometry.boundingBox))})),i.add(c)}i.floorLength=i.hasFloors_(),i.bounding=function(e){for(var t=new a.Box3,i=0,n=e;i<n.length;i++){var r=n[i];t.union(r)}return t}(t);for(var s=i.bounding.getCenter(new a.Vector3),o=0,u=e;o<u.length;o++){var c;(c=u[o]).traverse((function(e){e instanceof tt&&e.material.forEach((function(e){e.uniforms.modelCenter.value=s}))}))}t.length=0,i.emit("geometryLoaded"),i.emit("materialLoaded"),i.loaded=!0,Ke((function(){return i.emit("loaded")}))})).catch((function(e){return i.emit("error",e),Promise.reject(e)}))},i.prototype.dispose=function(){for(this.off(),this.disposeGeometry(),this.disposeMaterial();this.children.length;)this.remove(this.children[0]);this.bvhs.length=0,delete this.bvhs.loaded},i}(it);function xi(e){switch(e.getError()){case e.INVALID_ENUM:return new Error("webgl error: INVALID_ENUM");case e.INVALID_VALUE:return new Error("webgl error: INVALID_VALUE");case e.INVALID_OPERATION:return new Error("webgl error: INVALID_OPERATION");case e.INVALID_FRAMEBUFFER_OPERATION:return new Error("webgl error: INVALID_FRAMEBUFFER_OPERATION");case e.OUT_OF_MEMORY:return new Error("webgl error: OUT_OF_MEMORY");case e.CONTEXT_LOST_WEBGL:return new Error("webgl error: CONTEXT_LOST_WEBGL");default:return null}}Object.assign(Ti.prototype,{on:xt.prototype.on,once:xt.prototype.once,off:xt.prototype.off,emit:xt.prototype.emit,hasListener:xt.prototype.hasListener});var Ei=c.default.Tween,ji=c.default.Easing;function Ii(e,t,i,n){void 0===n&&(n=ji.Linear.None);var r=[],s=[],o=[],a=[],u=Object.assign(new Ei(e).to(t,i).easing(n),{completed:!1,onCancel:function(e){return r.push(e),u},destroy:function(){if(u.stop(),Object.assign(this,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallback:null}),!u.completed)for(var e=0,t=r;e<t.length;e++){(0,t[e])()}r.length=0,c()}});Object.assign(u,{onStart:function(e){return s.push(e),u},onUpdate:function(e){return o.push(e),u},onComplete:function(e){return a.push(e),u},_onStartCallback:function(e){for(var t=0,i=s;t<i.length;t++){(0,i[t])(e)}},_onUpdateCallback:function(e,t){for(var i=0,n=o;i<n.length;i++){(0,n[i])(e,t)}1===t&&0===u._repeat&&(u.completed=!0)},_onCompleteCallback:function(e){for(var t=0,i=a;t<i.length;t++){(0,i[t])(e)}}}),Ke((function(){return u.start()}));var c=Je((function(e){!1===u.update(e)&&c()}));return u}function zi(e,t){return Ii({progress:0},{progress:1},e,t)}var bi=2*Math.PI;function Li(e){return(e%bi+bi)%bi}var Si=Math.PI,Oi=2*Si;function Ci(e,t,i){return e+(t-e)*i}function Pi(e,t,i){return e=Li(e),Ci((t=Li(t))-e>Si?e+Oi:e-t>Si?e-Oi:e,t,i)}function ki(e,t,i){if(e===t)return t;var n=t-e;return Math.abs(n)<=i?t:e+(n>0?1:-1)*i}function Bi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=[];e=e.map((function(e){return e.trim()})).filter((function(e){return e.length>0&&!/^\/+$/.test(e)}));for(var n=0;n<e.length;n++){var r=0===n,s=n===e.length-1,o=e[n];r||(o=o.replace(/^\/+/,"")),s||(o=o.replace(/\/+$/,"")),i.push(o)}return i.join("/")}function Ui(e){return e instanceof Error}function Qi(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var i,n,r;if(Array.isArray(e)){if((i=e.length)!=t.length)return!1;for(n=i;0!=n--;)if(!Qi(e[n],t[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((i=(r=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,r[n]))return!1;for(n=i;0!=n--;){var s=r[n];if(!Qi(e[s],t[s]))return!1}return!0}return e!=e&&t!=t}function _i(e){return"number"==typeof e}function Ri(e,t){void 0===t&&(t=!1);var i=typeof e;if("string"===i)return JSON.stringify(e);if(!0===e)return"true";if(!1===e)return"false";if(null===e)return"null";if(e instanceof Array){for(var n="[",r=e.length-1,s=0;s<r;s++)n+=Ri(e[s],!1)+",";return r>-1&&(n+=Ri(e[s],!1)),n+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return Ri(e.toJSON(),t);var o=Object.keys(e).sort(),a=o.length;for(n="",s=0;s<a;){var u=o[s],c=Ri(e[u],!0);void 0!==c&&(s&&""!==n&&(n+=","),n+=JSON.stringify(u)+":"+c),s++}return"{"+n+"}"}switch(i){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(e)?e:null}}function Yi(e){return String(Ri(e,!1))}function Fi(e){var t,i,n,r=JSON.parse(e),s="undefined"!=typeof location?location.hostname:"",o=Date.now();if("object"!=typeof r)return new Error("input is not an object");if(0===s.length||It(s)||bt.filter((function(e){return zt(e,s)})).length>0){var a=String(null!==(t=r.certificate)&&void 0!==t?t:"");if(a){var u=new Oe;return u.readCertPEM(a),{issuer:u.getSubjectString()}}return{issuer:"none"}}var c=String(null!==(i=r.certificate)&&void 0!==i?i:"");if(!c)return new Error("certificate is not existed.");var l=new Oe;l.readCertPEM(c);var h=String(null!==(n=r._signature)&&void 0!==n?n:"");if(!h)return new Error("signature is not existed.");if(!1===function(e,t,i){var n=new Oe;if("string"==typeof i?n.readCertPEM(i):n.readCertHex(i.hex),!1===Ue(n))return!1;var r=new ee;return r.readCertPubKeyHex(n.hex,6),!!r.verify(e,_(t))}(Yi(function(e,t){for(var i={},n=0,r=Object.keys(e);n<r.length;n++){var s=r[n];-1===t.indexOf(s)&&(i[s]=e[s])}return i}(r,["_signature"])),h,l))return new Error("signature verify failed.");var d=new Date("string"==typeof r.expire_at&&/^\d+$/.test(r.expire_at)?Number(r.expire_at):r.expire_at);return o<d.getTime()?0===(Array.isArray(r.allow_hosts)?r.allow_hosts:[]).filter((function(e){return zt(e,s)})).length?function(e){return new Error("host("+JSON.stringify(e)+") is not allowed.")}(s):{issuer:l.getSubjectString()}:function(e){return new Error("date("+e.toString()+") expired.")}(d)}var Vi=new WeakMap;function Hi(e,t,i){var n,r,s=JSON.stringify(t),o=JSON.stringify(e),u=Fi(o);e=JSON.parse(o),t=JSON.parse(s);var c={workCode:"",expire:new Date,allowHosts:[],uuid:qe(),initial:{mode:"Panorama",latitude:0,longitude:0,panoIndex:0,fov:80},observers:[],issuer:u instanceof Error?"none":u.issuer,raw:{work:e,options:t}},l=null!==(n=e.base_url)&&void 0!==n?n:"";l&&"/"!==l[l.length-1]&&(l+="/");var h=function(e,n){var r,s=e;!0===t.jsonp&&(s=(s=e.replace(/([\?\#].*)?$/i,""))+"."+Ce(""+s).slice(0,7)+".jsonp");if(!0===t.shortPath){var o=s.replace(l,"").split("."),a=null!==(r=o.shift())&&void 0!==r?r:"",u=o.join(".");s=Bi(l,Ce(a))+(u?"."+u:"")}var c=s.replace(l,"");return t.baseURL&&(s=Bi(t.baseURL,c)),i&&i(e,s,c,n),s},d=function(t,i){var n,r,s,o,a,u,c=t;if(!gi(t)){var d=null!==(u=null!==(o=null!==(r=null===(n=e.panorama)||void 0===n?void 0:n.pano_high_cube_base_url)&&void 0!==r?r:null===(s=e.panorama)||void 0===s?void 0:s.pano_cube_base_url)&&void 0!==o?o:null===(a=e.panorama)||void 0===a?void 0:a.base_url)&&void 0!==u?u:"";d&&(d=Bi(d,String(i))),c=Bi(d,c)}return gi(c)||(c=Bi(l,c)),h(c,"panorama")},A=function(e){var t=e;return gi(t)||(t=Bi(l,e)),h(t,"model")},p=function(e,t){void 0===t&&(t="");var i=e;return gi(i)||(i=Bi(t,i)),gi(i)||(i=Bi(l,i)),h(i,"texture")};if(c.workCode=null!==(r=String(e.work_code||e.code||e.vr_code||e.workCode))&&void 0!==r?r:"",c.expire=new Date("string"==typeof e.expire_at&&/^\d+$/.test(e.expire_at)?Number(e.expire_at):e.expire_at),c.allowHosts=e.allow_hosts||[],Ui(u))return u;if(e.initial&&("Floorplan"!==e.initial.mode&&"Topview"!==e.initial.mode&&"Panorama"!==e.initial.mode&&"VRPanorama"!==e.initial.mode&&"Model"!==e.initial.mode&&"DepthPanorama"!==e.initial.mode||(c.initial.mode=e.initial.mode),_i(e.initial.latitude)&&(c.initial.latitude=e.initial.latitude),_i(e.initial.longitude)?c.initial.longitude=e.initial.longitude:_i(e.initial.heading)&&(c.initial.longitude=-(360*(e.initial.heading-.25)+90)/180*Math.PI),_i(e.initial.fov)&&(c.initial.fov=e.initial.fov),_i(e.initial.panoIndex)?c.initial.panoIndex=e.initial.panoIndex:_i(e.initial.pano_index)?c.initial.panoIndex=e.initial.pano_index:_i(e.initial.pano)&&(c.initial.panoIndex=e.initial.pano)),Ui(u))return u;if(e.model){var M={bvh:!0,async:!1,textureBase:"",textures:[]};"boolean"==typeof e.model.bvh?M.bvh=e.model.bvh:"boolean"==typeof e.bvh&&(M.bvh=e.bvh),"boolean"==typeof e.model.async?M.async=e.model.async:"boolean"==typeof e.modelAsync&&(M.async=e.modelAsync),e.model.file?M.file=A(e.model.file):e.model.file_url&&(M.file=A(e.model.file_url)),e.model.textureBase?M.textureBase=e.model.textureBase:e.model.material_base_url&&(M.textureBase=e.model.material_base_url),Array.isArray(e.model.textures)?M.textures=e.model.textures.map((function(e){return p(e,M.textureBase)})):Array.isArray(e.model.material_textures)&&(M.textures=e.model.material_textures.map((function(e){return p(e,M.textureBase)}))),M.file&&(c.model=M)}if(Ui(u))return u;if(e.observers&&Array.isArray(e.observers)){var f=[];e.panorama&&(Array.isArray(e.panorama)?f=e.panorama:Array.isArray(e.panorama.list)?f=e.panorama.list:Array.isArray(e.panorama.info)&&(f=e.panorama.info));for(var g=0;g<e.observers.length;g++){var y={},v=e.observers[g];if(!v)break;var m=f[g]||{};v=Object.assign({},v,m,{active:!1!==v.active&&!1!==m.active}),y.panoIndex=g,y.active=!1!==v.active,y.loadable=!0===v.loadable,y.images={up:d(v.images?v.images.up:v.up,g),down:d(v.images?v.images.down:v.down,g),right:d(v.images?v.images.right:v.right,g),left:d(v.images?v.images.left:v.left,g),front:d(v.images?v.images.front:v.front,g),back:d(v.images?v.images.back:v.back,g)};var N=v.images?v.images.depth:v.depth;N&&(y.images.depth=d(N,g));var D=v.images?v.images.tiles:v.tiles;if(D&&(y.images.tiles=d(D,g)),v.position instanceof a.Vector3)y.position=v.position.clone();else{if(!Array.isArray(v.position))break;y.position=(new a.Vector3).fromArray(v.position)}if(v.standingPosition instanceof a.Vector3)y.standingPosition=v.standingPosition.clone();else if(Array.isArray(v.standingPosition))y.standingPosition=(new a.Vector3).fromArray(v.standingPosition);else if(v.standing_position instanceof a.Vector3)y.standingPosition=v.standing_position.clone();else{if(!Array.isArray(v.standing_position))break;y.standingPosition=(new a.Vector3).fromArray(v.standing_position)}if(v.quaternion instanceof a.Quaternion)y.quaternion=v.quaternion.clone();else if(Array.isArray(v.quaternion))y.quaternion=(new a.Quaternion).fromArray(v.quaternion);else{if(!v.quaternion)break;var w=v.quaternion,T=w.x,x=w.y,E=w.z,j=w.w;y.quaternion=new a.Quaternion(T,x,E,j)}if(Array.isArray(v.accessibleNodes)?y.accessibleNodes=v.accessibleNodes.slice():Array.isArray(v.accessible_nodes)&&(y.accessibleNodes=v.accessible_nodes.slice()),Array.isArray(v.visibleNodes)?y.visibleNodes=v.visibleNodes.slice():Array.isArray(v.visible_nodes)&&(y.visibleNodes=v.visible_nodes.slice()),_i(v.floorIndex)?y.floorIndex=v.floorIndex:_i(v.floor_index)?y.floorIndex=v.floor_index:y.floorIndex=0,v.video){var I={};"string"==typeof v.video.source&&(I.source=v.video.source),v.video.matrix instanceof a.Matrix4?I.matrix=v.video.matrix.clone():Array.isArray(v.video.matrix)&&(I.matrix=(new a.Matrix4).fromArray(v.video.matrix)),v.video.size instanceof a.Vector2?I.size=v.video.size.clone():Array.isArray(v.video.size)&&(I.size=(new a.Vector2).fromArray(v.video.size)),I.source&&I.matrix&&I.size&&(y.video=I)}c.observers[g]=y}}if(Ui(u))return u;for(var z=0,b=c.observers;z<b.length;z++){if(!(y=b[z]).accessibleNodes){y.accessibleNodes=[];for(var L=0;L<c.observers.length;L++)c.observers[L]!==y&&y.accessibleNodes.push(L)}if(!y.visibleNodes){y.visibleNodes=[];for(L=0;L<c.observers.length;L++)c.observers[L]!==y&&y.visibleNodes.push(L)}}if(Ui(u))return u;var S=Et(c);return Vi.set(S,{work:o,options:s}),S}function Gi(e,t,i){"string"==typeof e&&"{"===e.trim()[0]&&(e=JSON.parse(e));var n=Vi.get(e);if(n){if(t&&!Qi(JSON.parse(n.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return e}var r=Hi(e,null!=t?t:{},i);if(Ui(r))throw new Error("[PARSE FAILED]: "+r.message);return r}var qi=function(e){return Number(e)};function Wi(e,t,i){var n;void 0===t&&(t=qi),void 0===i&&(i=!1);for(var r,s=1/0,o=0,a=e;o<a.length;o++){var u=a[o],c=t(u);c<=s&&(r=(n=[u,c])[0],s=n[1])}return i?[r,s]:r}
368
368
  /*! Hammer.JS - v2.0.7 - 2016-04-22
369
369
  * http://hammerjs.github.io/
370
370
  *
371
371
  * Copyright (c) 2016 Jorik Tangelder;
372
- * Licensed under the MIT license */var Wi=function(e,t,i,n){var r,s=["","webkit","Moz","MS","ms","o"],o=t.createElement?t.createElement("div"):n,a=Math.round,u=Math.abs,c=Date.now;function l(e,t,i){return setTimeout(A(e,i),t)}function h(e,t,i){return!!Array.isArray(e)&&(d(e,i[t],i),!0)}function d(e,t,i){var r;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==n)for(r=0;r<e.length;)t.call(i,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(i,e[r],r,e)}function p(t,i,n){var r="DEPRECATED METHOD: "+i+"\n"+n+" AT \n";return function(){var i=new Error("get-stack-trace"),n=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=e.console&&(e.console.warn||e.console.log);return s&&s.call(e.console,r,n),t.apply(this,arguments)}}r="function"!=typeof Object.assign?function(e){if(e===n||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var r=arguments[i];if(r!==n&&null!==r)for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])}return t}:Object.assign;var M=p((function(e,t,i){for(var r=Object.keys(t),s=0;s<r.length;)(!i||i&&e[r[s]]===n)&&(e[r[s]]=t[r[s]]),s++;return e}),"extend","Use `assign`."),f=p((function(e,t){return M(e,t,!0)}),"merge","Use `assign`.");function g(e,t,i){var n,s=t.prototype;(n=e.prototype=Object.create(s)).constructor=e,n._super=s,i&&r(n,i)}function A(e,t){return function(){return e.apply(t,arguments)}}function y(e,t){return"function"==typeof e?e.apply(t&&t[0]||n,t):e}function v(e,t){return e===n?t:e}function m(e,t,i){d(T(t),(function(t){e.addEventListener(t,i,!1)}))}function N(e,t,i){d(T(t),(function(t){e.removeEventListener(t,i,!1)}))}function D(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function w(e,t){return e.indexOf(t)>-1}function T(e){return e.trim().split(/\s+/g)}function x(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var n=0;n<e.length;){if(i&&e[n][i]==t||!i&&e[n]===t)return n;n++}return-1}function E(e){return Array.prototype.slice.call(e,0)}function j(e,t,i){for(var n=[],r=[],s=0;s<e.length;){var o=t?e[s][t]:e[s];x(r,o)<0&&n.push(e[s]),r[s]=o,s++}return i&&(n=t?n.sort((function(e,i){return e[t]>i[t]})):n.sort()),n}function z(e,t){for(var i,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(i=s[a])?i+o:t)in e)return r;a++}return n}var I=1;function b(t){var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||e}var L="ontouchstart"in e,S=z(e,"PointerEvent")!==n,O=L&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),C="touch",P="mouse",k=24,U=["x","y"],B=["clientX","clientY"];function _(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){y(e.options.enable,[e])&&i.handler(t)},this.init()}function R(e,t,i){var r=i.pointers.length,s=i.changedPointers.length,o=1&t&&r-s==0,a=12&t&&r-s==0;i.isFirst=!!o,i.isFinal=!!a,o&&(e.session={}),i.eventType=t,function(e,t){var i=e.session,r=t.pointers,s=r.length;i.firstInput||(i.firstInput=Q(t));s>1&&!i.firstMultiple?i.firstMultiple=Q(t):1===s&&(i.firstMultiple=!1);var o=i.firstInput,a=i.firstMultiple,l=a?a.center:o.center,h=t.center=Y(r);t.timeStamp=c(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=G(l,h),t.distance=H(l,h),function(e,t){var i=t.center,n=e.offsetDelta||{},r=e.prevDelta||{},s=e.prevInput||{};1!==t.eventType&&4!==s.eventType||(r=e.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=e.offsetDelta={x:i.x,y:i.y});t.deltaX=r.x+(i.x-n.x),t.deltaY=r.y+(i.y-n.y)}(i,t),t.offsetDirection=V(t.deltaX,t.deltaY);var d=F(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=u(d.x)>u(d.y)?d.x:d.y,t.scale=a?function(e,t){return H(t[0],t[1],B)/H(e[0],e[1],B)}(a.pointers,r):1,t.rotation=a?function(e,t){return G(t[1],t[0],B)+G(e[1],e[0],B)}(a.pointers,r):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,function(e,t){var i,r,s,o,a=e.lastInterval||t,c=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(c>25||a.velocity===n)){var l=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=F(c,l,h);r=d.x,s=d.y,i=u(d.x)>u(d.y)?d.x:d.y,o=V(l,h),e.lastInterval=t}else i=a.velocity,r=a.velocityX,s=a.velocityY,o=a.direction;t.velocity=i,t.velocityX=r,t.velocityY=s,t.direction=o}(i,t);var p=e.element;D(t.srcEvent.target,p)&&(p=t.srcEvent.target);t.target=p}(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function Q(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:a(e.pointers[i].clientX),clientY:a(e.pointers[i].clientY)},i++;return{timeStamp:c(),pointers:t,center:Y(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Y(e){var t=e.length;if(1===t)return{x:a(e[0].clientX),y:a(e[0].clientY)};for(var i=0,n=0,r=0;r<t;)i+=e[r].clientX,n+=e[r].clientY,r++;return{x:a(i/t),y:a(n/t)}}function F(e,t,i){return{x:t/e||0,y:i/e||0}}function V(e,t){return e===t?1:u(e)>=u(t)?e<0?2:4:t<0?8:16}function H(e,t,i){i||(i=U);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return Math.sqrt(n*n+r*r)}function G(e,t,i){i||(i=U);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return 180*Math.atan2(r,n)/Math.PI}_.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(b(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&N(this.element,this.evEl,this.domHandler),this.evTarget&&N(this.target,this.evTarget,this.domHandler),this.evWin&&N(b(this.element),this.evWin,this.domHandler)}};var q={mousedown:1,mousemove:2,mouseup:4},W="mousedown",K="mousemove mouseup";function Z(){this.evEl=W,this.evWin=K,this.pressed=!1,_.apply(this,arguments)}g(Z,_,{handler:function(e){var t=q[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var X={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},J={2:C,3:"pen",4:P,5:"kinect"},$="pointerdown",ee="pointermove pointerup pointercancel";function te(){this.evEl=$,this.evWin=ee,_.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&($="MSPointerDown",ee="MSPointerMove MSPointerUp MSPointerCancel"),g(te,_,{handler:function(e){var t=this.store,i=!1,n=e.type.toLowerCase().replace("ms",""),r=X[n],s=J[e.pointerType]||e.pointerType,o=s==C,a=x(t,e.pointerId,"pointerId");1&r&&(0===e.button||o)?a<0&&(t.push(e),a=t.length-1):12&r&&(i=!0),a<0||(t[a]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:s,srcEvent:e}),i&&t.splice(a,1))}});var ie={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ne="touchstart",re="touchstart touchmove touchend touchcancel";function se(){this.evTarget=ne,this.evWin=re,this.started=!1,_.apply(this,arguments)}function oe(e,t){var i=E(e.touches),n=E(e.changedTouches);return 12&t&&(i=j(i.concat(n),"identifier",!0)),[i,n]}g(se,_,{handler:function(e){var t=ie[e.type];if(1===t&&(this.started=!0),this.started){var i=oe.call(this,e,t);12&t&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:C,srcEvent:e})}}});var ae={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ue="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=ue,this.targetIds={},_.apply(this,arguments)}function le(e,t){var i=E(e.touches),n=this.targetIds;if(3&t&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,s,o=E(e.changedTouches),a=[],u=this.target;if(s=i.filter((function(e){return D(e.target,u)})),1===t)for(r=0;r<s.length;)n[s[r].identifier]=!0,r++;for(r=0;r<o.length;)n[o[r].identifier]&&a.push(o[r]),12&t&&delete n[o[r].identifier],r++;return a.length?[j(s.concat(a),"identifier",!0),a]:void 0}g(ce,_,{handler:function(e){var t=ae[e.type],i=le.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:C,srcEvent:e})}});function he(){_.apply(this,arguments);var e=A(this.handler,this);this.touch=new ce(this.manager,e),this.mouse=new Z(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function de(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,pe.call(this,t)):12&e&&pe.call(this,t)}function pe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var i={x:t.clientX,y:t.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var e=n.indexOf(i);e>-1&&n.splice(e,1)}),2500)}}function Me(e){for(var t=e.srcEvent.clientX,i=e.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],s=Math.abs(t-r.x),o=Math.abs(i-r.y);if(s<=25&&o<=25)return!0}return!1}g(he,_,{handler:function(e,t,i){var n=i.pointerType==C,r=i.pointerType==P;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)de.call(this,t,i);else if(r&&Me.call(this,i))return;this.callback(e,t,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var fe=o?z(o.style,"touchAction"):n,ge=fe!==n,Ae="compute",ye="auto",ve="manipulation",me="none",Ne="pan-x",De="pan-y",we=function(){if(!ge)return!1;var t={},i=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!i||e.CSS.supports("touch-action",n)})),t}();function Te(e,t){this.manager=e,this.set(t)}Te.prototype={set:function(e){e==Ae&&(e=this.compute()),ge&&this.manager.element.style&&we[e]&&(this.manager.element.style[fe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return d(this.manager.recognizers,(function(t){y(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(w(e,me))return me;var t=w(e,Ne),i=w(e,De);if(t&&i)return me;if(t||i)return t?Ne:De;if(w(e,ve))return ve;return ye}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var n=this.actions,r=w(n,me)&&!we.none,s=w(n,De)&&!we["pan-y"],o=w(n,Ne)&&!we["pan-x"];if(r){var a=1===e.pointers.length,u=e.distance<2,c=e.deltaTime<250;if(a&&u&&c)return}if(!o||!s)return r||s&&6&i||o&&i&k?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var xe=32;function Ee(e){this.options=r({},this.defaults,e||{}),this.id=I++,this.manager=null,this.options.enable=v(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function je(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function ze(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ie(e,t){var i=t.manager;return i?i.get(e):e}function be(){Ee.apply(this,arguments)}function Le(){be.apply(this,arguments),this.pX=null,this.pY=null}function Se(){be.apply(this,arguments)}function Oe(){Ee.apply(this,arguments),this._timer=null,this._input=null}function Ce(){be.apply(this,arguments)}function Pe(){be.apply(this,arguments)}function ke(){Ee.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ue(e,t){return(t=t||{}).recognizers=v(t.recognizers,Ue.defaults.preset),new Be(e,t)}Ee.prototype={defaults:{},set:function(e){return r(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(h(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ie(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return h(e,"dropRecognizeWith",this)||(e=Ie(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(h(e,"requireFailure",this))return this;var t=this.requireFail;return-1===x(t,e=Ie(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(h(e,"dropRequireFailure",this))return this;e=Ie(e,this);var t=x(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,i=this.state;function n(i){t.manager.emit(i,e)}i<8&&n(t.options.event+je(i)),n(t.options.event),e.additionalEvent&&n(e.additionalEvent),i>=8&&n(t.options.event+je(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=xe},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=r({},e);if(!y(this.options.enable,[this,t]))return this.reset(),void(this.state=xe);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},g(be,Ee,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,i=e.eventType,n=6&t,r=this.attrTest(e);return n&&(8&i||!r)?16|t:n||r?4&i?8|t:2&t?4|t:2:xe}}),g(Le,be,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(De),e&k&&t.push(Ne),t},directionTest:function(e){var t=this.options,i=!0,n=e.distance,r=e.direction,s=e.deltaX,o=e.deltaY;return r&t.direction||(6&t.direction?(r=0===s?1:s<0?2:4,i=s!=this.pX,n=Math.abs(e.deltaX)):(r=0===o?1:o<0?8:16,i=o!=this.pY,n=Math.abs(e.deltaY))),e.direction=r,i&&n>t.threshold&&r&t.direction},attrTest:function(e){return be.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ze(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),g(Se,be,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),g(Oe,Ee,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!n||!i||12&e.eventType&&!r)this.reset();else if(1&e.eventType)this.reset(),this._timer=l((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return xe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}}),g(Ce,be,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),g(Pe,be,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Le.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return 30&i?t=e.overallVelocity:6&i?t=e.overallVelocityX:i&k&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=ze(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),g(ke,Ee,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ve]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(n&&r&&i){if(4!=e.eventType)return this.failTimeout();var s=!this.pTime||e.timeStamp-this.pTime<t.interval,o=!this.pCenter||H(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,o&&s?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=l((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return xe},failTimeout:function(){return this._timer=l((function(){this.state=xe}),this.options.interval,this),xe},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ue.VERSION="2.0.7",Ue.defaults={domEvents:!1,touchAction:Ae,enable:!0,inputTarget:null,inputClass:null,preset:[[Ce,{enable:!1}],[Se,{enable:!1},["rotate"]],[Pe,{direction:6}],[Le,{direction:6},["swipe"]],[ke],[ke,{event:"doubletap",taps:2},["tap"]],[Oe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Be(e,t){var i;this.options=r({},Ue.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((i=this).options.inputClass||(S?te:O?ce:L?he:Z))(i,R),this.touchAction=new Te(this,this.options.touchAction),_e(this,!0),d(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function _e(e,t){var i,n=e.element;n.style&&(d(e.options.cssProps,(function(r,s){i=z(n.style,s),t?(e.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=e.oldCssProps[i]||""})),t||(e.oldCssProps={}))}return Be.prototype={set:function(e){return r(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var i;this.touchAction.preventDefaults(e);var n=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var s=0;s<n.length;)i=n[s],2===t.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(e),!r&&14&i.state&&(r=t.curRecognizer=i),s++}},get:function(e){if(e instanceof Ee)return e;for(var t=this.recognizers,i=0;i<t.length;i++)if(t[i].options.event==e)return t[i];return null},add:function(e){if(h(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(h(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=x(t,e);-1!==i&&(t.splice(i,1),this.touchAction.update())}return this},on:function(e,t){if(e!==n&&t!==n){var i=this.handlers;return d(T(e),(function(e){i[e]=i[e]||[],i[e].push(t)})),this}},off:function(e,t){if(e!==n){var i=this.handlers;return d(T(e),(function(e){t?i[e]&&i[e].splice(x(i[e],t),1):delete i[e]})),this}},emit:function(e,i){this.options.domEvents&&function(e,i){var n=t.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=i,i.target.dispatchEvent(n)}(e,i);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){i.type=e,i.preventDefault=function(){i.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](i),r++}},destroy:function(){this.element&&_e(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(Ue,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:xe,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:k,DIRECTION_ALL:30,Manager:Be,Input:_,TouchAction:Te,TouchInput:ce,MouseInput:Z,PointerEventInput:te,TouchMouseInput:he,SingleTouchInput:se,Recognizer:Ee,AttrRecognizer:be,Tap:ke,Pan:Le,Swipe:Pe,Pinch:Se,Rotate:Ce,Press:Oe,on:m,off:N,each:d,merge:f,extend:M,assign:r,inherit:g,bindFn:A,prefixed:z}),Ue}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{});function Ki(e,t){var i=document.mozFullScreen?"DOMMouseScroll":"mousewheel",n=!!window.addEventListener,r=!!window.attachEvent,s=function(e,t){var i=document.mozFullScreen?"DOMMouseScroll":"mousewheel",n=!!window.addEventListener,r=!!window.attachEvent;return t.__mouseWheelWrapper=function(s){if(s=s||window.event,n&&s.preventDefault(),r&&(s.returnValue=!1),"DOMMouseScroll"==i||"mousewheel"==i){var o=s.wheelDelta;s.delta=o?o/120:-(s.delta||0)/3}t.call(e,s)}}(e,t);n?e.addEventListener(i,s,!1):r&&e.attachEvent("on"+i,s)}function Zi(e,t,i){var n=t.offsetWidth,r=t.offsetHeight,s=t.getBoundingClientRect(),o=s.top,u=s.left;return i&&(u+=n*i.left,o+=r*(1-i.bottom-i.height),n*=i.width,r*=i.height),new a.Vector2((e.x-u)/n*2-1,-(e.y-o)/r*2+1)}!function(){try{var e=document.createElement("canvas");!window.WebGLRenderingContext||!e.getContext("webgl")&&e.getContext("experimental-webgl")}catch(e){return!1}}();var Xi="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"node",Ji=Xi.match(/android/i)||Xi.match(/webos/i)||Xi.match(/ipad|iphone|ipod/i)||Xi.match(/iemobile/i)||Xi.match(/opera mini/i)||Xi.match(/blackberry/i)||Xi.match(/windows phone/i),$i=function(e){function i(t){var n=e.call(this)||this,r=i.parseArgs(t);return n.ready=!1,n.destroyed=!1,n.ident=r.ident,n.scene=r.scene,n.helper=r.helper,n.camera=r.camera,n.renderer=r.renderer,n.scissor=r.scissor,n.element=r.element,n.model=r.model,n.work=r.work,n.imageOptions=r.imageOptions,n.videoTexture=r.videoTexture,n.networkSubscribe=r.networkSubscribe,n.needsRender=!0,n.preventPanGesture=!1,n.preventTapGesture=!1,n.preventPinchGesture=!1,n.currentPanoIndex=r.panoIndex,Ve(n.work.observers[n.currentPanoIndex])&&(n.currentPanoIndex=0),n.eventUnbinds=[r.element].concat(r.extraElements||[]).map((function(e){return n.bindEvents(e)})),Xe((function(){return n.initAnimation.apply(n,r.initial).then((function(){return n.ready=!0}))})),n}return t.__extends(i,e),i.parseArgs=function(e){return t.__assign({},e)},i.initAnimationEndPose=function(e){return this.parseArgs(e).camera.copyPose()},i.prototype.initAnimation=function(e,t,i){return Promise.resolve()},i.prototype.bindExtraElement=function(e){for(var t=0,i=this.eventUnbinds;t<i.length;t++){if(i[t].element===e)return}this.eventUnbinds.push(this.bindEvents(e))},i.prototype.unbindExtraElement=function(e){for(var t=null,i=-1,n=0,r=this.eventUnbinds;n<r.length;n++){var s=r[n];if(i++,s.element===e){t=s;break}}t&&(t(),this.eventUnbinds.splice(i,1))},i.prototype.resize=function(){this.needsRender=!0},i.prototype.resetModel=function(e,t){this.model=e,this.needsRender=!0},i.prototype.updateWork=function(e,t,i,n){return!1},i.prototype.render=function(e){this.renderer.render(this.scene,this.camera)},i.prototype.destroy=function(){this.destroyed=!0,this.ready=!1,this.off();for(var e=0,t=this.eventUnbinds;e<t.length;e++){(0,t[e])()}this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.tweenPosition&&(this.tweenPosition.destroy(),delete this.tweenCoordinates)},i.prototype.moveToPano=function(e,t,i){void 0===t&&(t={});var n={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone()};t.moveStartCallback&&t.moveStartCallback(e,n),this.emit("moveToPano",e,i),this.currentPanoIndex=e,this.emit("panoArrived",e,{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone()},i),t.moveEndCallback&&t.moveEndCallback(e,n)},i.prototype.updateCamera=function(e,t,i){var n,r,s,o;void 0===e&&(e={});var a=null!==(n=e.longitude)&&void 0!==n?n:this.camera.pose.longitude,u=null!==(r=e.latitude)&&void 0!==r?r:this.camera.pose.latitude,c=null!==(s=e.fov)&&void 0!==s?s:this.camera.pose.fov,l=null!==(o=e.offset)&&void 0!==o?o:this.camera.pose.offset,h=a!==this.camera.pose.longitude||u!==this.camera.pose.latitude,d=c!==this.camera.pose.fov,p=!l.equals(this.camera.pose.offset);this.camera.setFromPose({longitude:a,latitude:u,fov:c,offset:l}),d&&this.emit("cameraFovUpdate",this.camera.pose.fov,t),h&&this.emit("cameraDirectionUpdate",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},t),p&&this.emit("cameraPositionUpdate",this.camera.pose.offset.clone(),t),(d||h||p)&&this.emit("cameraUpdate",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone()},t),this.needsRender=!0},Object.defineProperty(i.prototype,"gesturing",{get:function(){return!1},enumerable:!1,configurable:!0}),i.prototype.onPanGesture=function(e){},i.prototype.onTapGesture=function(e){},i.prototype.onPinchGesture=function(e){},i.prototype.onMouseWheel=function(e){},i.prototype.onMouseMove=function(e){},i.prototype.onMouseOut=function(){},i.prototype.relativeClientPosition=function(e){return Zi(e,this.element,this.scissor)},i.prototype.bindEvents=function(e){var t=this,i=function(e){var i=Zi(e,t.element,t.scissor);return!(Math.abs(i.x)>1||Math.abs(i.y)>1)},n=new Wi.Manager(e),r=function(e){return e.session.firstInput||null};n.add(new Wi.Pan({threshold:10,pointers:0})),n.add(new Wi.Tap({interval:410})),n.add(new Wi.Pinch({threshold:0,pointers:2}).recognizeWith(n.get("pan"))),n.on("panstart pan",(function(e){var s=r(n);s&&!i(s.center)||!0!==t.preventPanGesture&&t.onPanGesture(e)})),n.on("tap",(function(e){var s=r(n);s&&!i(s.center)||!0!==t.preventTapGesture&&t.onTapGesture(e)})),n.on("pinchstart pinch pinchend",(function(e){var s=r(n);s&&!i(s.center)||!0!==t.preventPinchGesture&&t.onPinchGesture(e)}));var s=function(e){var n={x:e.clientX,y:e.clientY};i(n)&&t.onMouseWheel(e)},o=function(e){var n={x:e.clientX,y:e.clientY};i(n)?t.onMouseMove(e):t.onMouseOut()},a=function(){t.onMouseOut()};Ki(e,s),Ji||(Wi.on(e,"mousemove",o),Wi.on(e,"mouseout",a));return Object.assign((function(){n.destroy(),function(e,t){var i=document.mozFullScreen?"DOMMouseScroll":"mousewheel",n=!!window.addEventListener,r=!!window.attachEvent;t.__mouseWheelWrapper&&(n?e.removeEventListener(i,t.__mouseWheelWrapper,!1):r&&e.detachEvent("on"+i,t.__mouseWheelWrapper),delete t.__mouseWheelWrapper)}(e,s),Ji||(Wi.off(e,"mousemove",o),Wi.off(e,"mouseout",a))}),{element:e})},i}(xt),en=function(e){function i(t){var n=this,r=i.parseArgs(t);return(n=e.call(this,r)||this).defaultLongitude=r.defaultLongitude,n.defaultLatitude=r.defaultLatitude,n.defaultFov=r.defaultFov,n.maxFov=r.maxFov,n.minFov=r.minFov,n.maxLatitude=r.maxLatitude,n.minLatitude=r.minLatitude,n}return t.__extends(i,e),i.parseArgs=function(i){var n,r,s,o,a,u,c,l=e.parseArgs.call(this,i);return t.__assign(t.__assign({},l),{defaultLongitude:null!==(n=i.defaultLongitude)&&void 0!==n?n:Math.PI/4,defaultLatitude:null!==(r=i.defaultLatitude)&&void 0!==r?r:Math.PI/4,defaultFov:null!==(s=i.defaultFov)&&void 0!==s?s:80,maxFov:null!==(o=i.maxFov)&&void 0!==o?o:120,minFov:null!==(a=i.minFov)&&void 0!==a?a:40,maxLatitude:null!==(u=i.maxLatitude)&&void 0!==u?u:+Math.PI/2,minLatitude:null!==(c=i.minLatitude)&&void 0!==c?c:-Math.PI/2})},i.initAnimationEndPose=function(e){var t,n,r,s=this.parseArgs(e),o=e.initial[0],a=null!==(t=o.longitude)&&void 0!==t?t:s.defaultLongitude,u=Math.max(s.minLatitude,Math.min(s.maxLatitude,null!==(n=o.latitude)&&void 0!==n?n:s.defaultLatitude)),c=null!==(r=o.fov)&&void 0!==r?r:s.defaultFov,l=i.prototype.cameraDistance.call(s);return{longitude:a,latitude:u,fov:c,offset:i.prototype.calculateCameraPosition.call(s,{longitude:u,latitude:u},l,null,!1).clone()}},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i.prototype.updateWork=function(e,t,i,n){return this.work=e,this.currentPanoIndex=t.panoIndex,!0},i.prototype.resetModel=function(t,i){e.prototype.resetModel.call(this,t,i),this.updateCamera({longitude:this.defaultLongitude,latitude:this.defaultLatitude,fov:this.defaultFov},i,!1)},i.prototype.initAnimation=function(e,t,i){var n,r,s,o,u,c,l=this;if(this.destroyed)return Promise.resolve();var h=this.camera,d=this.model;this.preventPanGesture=!0,this.preventTapGesture=!0,this.preventPinchGesture=!0;var p=h.pose.longitude,M=h.pose.latitude,f=h.pose.fov,g=h.pose.offset.clone(),A=(null===(n=d.getMaterial())||void 0===n?void 0:n.modelAlpha)||0,y=null!==(s=null===(r=this.model.getMaterial())||void 0===r?void 0:r.perspToOrtho)&&void 0!==s?s:0,v=null!==(o=e.longitude)&&void 0!==o?o:this.defaultLongitude,m=Math.max(this.minLatitude,Math.min(this.maxLatitude,null!==(u=e.latitude)&&void 0!==u?u:this.defaultLatitude)),N=null!==(c=e.fov)&&void 0!==c?c:this.defaultFov,D=d.bounding.getCenter(new a.Vector3),w=this.cameraDistance(),T=this.calculateCameraPosition({longitude:m,latitude:m},w,null,!1),x={longitude:v,latitude:m,fov:N,offset:T.clone()};return this.emit("initAnimationWillStart",this.currentPanoIndex,x,i),new Promise((function(e){l.tweenCoordinates&&(l.tweenCoordinates.destroy(),delete l.tweenCoordinates);var n=function(e){var t=e.progress,n=Ci(p,v,t),r=Oi(M,m,t),s=Oi(f,N,t);l.updateCamera({longitude:n,latitude:r,fov:s,offset:l.camera.pose.offset},i,!1)},r=function(){n({progress:1}),l.tweenCoordinates&&(l.tweenCoordinates.destroy(),delete l.tweenCoordinates)};t>0?l.tweenCoordinates=zi(t,Ei.Quadratic.InOut).onUpdate(n).onComplete(r):r(),l.tweenPosition&&(l.tweenPosition.destroy(),delete l.tweenPosition);var s=function(e){var t=e.progress,n=Oi(0,w,t),r=new a.Vector3(Oi(g.x-D.x,0,t),Oi(g.y-D.y,0,t),Oi(g.z-D.z,0,t)),s=Oi(A,1,t),o=Oi(y,0,t);d.setMaterial({modelAlpha:s,perspToOrtho:o});var u=l.calculateCameraPosition(l.camera.pose,n,r,!1);l.updateCamera({offset:u},i,!1)};r=function(){s({progress:1}),l.updateCamera(l.camera.copyPose(),i,!1),l.tweenPosition&&(l.tweenPosition.destroy(),delete l.tweenPosition),l.needsRender=!0,l.preventPanGesture=!1,l.preventTapGesture=!1,l.preventPinchGesture=!1,e(),l.emit("initAnimationEnded",l.currentPanoIndex,l.camera.copyPose(),i)};t>0?l.tweenPosition=zi(t,Ei.Quadratic.InOut).onUpdate(s).onComplete(r).onCancel((function(){l.preventPanGesture=!1,l.preventTapGesture=!1,l.preventPinchGesture=!1,e(),l.emit("initAnimationEnded",l.currentPanoIndex,l.camera.copyPose(),i)})):r()}))},i.prototype.cameraDistance=function(){var e=this.model.bounding,t=this.camera.aspect,i=Math.pow(Math.pow(e.max.x-e.min.x+2,2)+Math.pow(e.max.y-e.min.y+2,2)+Math.pow(e.max.z-e.min.z+2,2),.5),n=i/2/Math.tan(Math.PI*this.defaultFov/360);return t<1&&(n/=t),isNaN(n)?i:n},i.prototype.calculateCameraPosition=function(e,t,i,n){var r=e.longitude,s=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,e.latitude));n&&(s=Math.max(this.minLatitude,Math.min(this.maxLatitude,s)));var o=this.model.bounding.getCenter(new a.Vector3),u=t*Math.cos(s),c=new a.Vector3(Math.sin(r)*u+o.x,Math.sin(s)*t+o.y,Math.cos(r)*u+o.z);return null!==i&&c.add(i),c},i.prototype.updateCamera=function(e,t,i){var n,r,s;void 0===e&&(e={});var o=this,a=o.minFov,u=o.maxFov,c=o.maxLatitude,l=o.minLatitude,h=null!==(n=e.longitude)&&void 0!==n?n:this.camera.pose.longitude,d=null!==(r=e.latitude)&&void 0!==r?r:this.camera.pose.latitude,p=void 0===e.fov||this.emit("wantsChangeCameraFov",e.fov)?this.camera.pose.fov:e.fov,M=null!==(s=e.offset)&&void 0!==s?s:this.calculateCameraPosition({longitude:h,latitude:d},this.cameraDistance(),null,i);i&&(d=Math.max(l,Math.min(c,d)),p=Math.max(a,Math.min(u,p)));var f=h!==this.camera.pose.longitude||d!==this.camera.pose.latitude,g=p!==this.camera.pose.fov,A=!M.equals(this.camera.pose.offset);this.camera.setFromPose({longitude:h,latitude:d,fov:p,offset:M}),g&&this.emit("cameraFovUpdate",this.camera.pose.fov,t),f&&this.emit("cameraDirectionUpdate",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},t),A&&this.emit("cameraPositionUpdate",this.camera.pose.offset.clone(),t),(g||f||A)&&this.emit("cameraUpdate",this.camera.copyPose(),t),this.needsRender=!0,Ht()},i.prototype.getForwardPanoIndexOrNot=function(e){var t=this.work.observers.filter((function(e){return e.active})),i=this.model.intersectRaycaster(e)[0];if(!i)return null;var n=qi(t,(function(e){return e.standingPosition.distanceTo(i.point)}),!0),r=n[0];return n[1]<5?this.work.observers.indexOf(r):null},i.prototype.coordinatesChangeWithOffset=function(e,t){var i=this.element,n=this.camera,r=i.offsetWidth,s=i.offsetHeight,o=2*t.x/r*n.fov/30,a=2*t.y/s*n.fov/30;return{longitude:bi(e.longitude+o),latitude:Math.max(this.minLatitude,Math.min(this.maxLatitude,e.latitude+a))}},i.prototype.requestInteriaMovement=function(e,t){var i=this;if(!1!==this.interiaMovement){var n=this.coordinatesChangeWithOffset(this.camera.pose,e),r=n.longitude,s=n.latitude;this.updateCamera({longitude:r,latitude:s},t,!0);var o=Math.abs(e.x)>1||Math.abs(e.y)>1;this.emit("interiaPan",this.camera.copyPose(),!o),o?Xe((function(){i.requestInteriaMovement({x:.8*e.x,y:.8*e.y},t)})):this.interiaMovement=!1}},Object.defineProperty(i.prototype,"gesturing",{get:function(){return this.interiaMovement||void 0!==this.lastPanPoint||void 0!==this.lastPinchFov},enumerable:!1,configurable:!0}),i.prototype.onPanGesture=function(e){var t=this;if(!this.tweenCoordinates){this.interiaMovement=!1;var i=this.lastPanPoint&&this.lastPanPoint.pointerLength===e.pointers.length?{x:e.center.x-this.lastPanPoint.x,y:e.center.y-this.lastPanPoint.y}:{x:0,y:0},n=this.relativeClientPosition(e.center),r=this.camera.pose.latitude<Math.PI/6||n.y<0?-1:1,s=this.coordinatesChangeWithOffset(this.camera.pose,{x:i.x*r,y:i.y}),o=s.longitude,a=s.latitude,u=this.calculateCameraPosition({longitude:o,latitude:a},this.cameraDistance(),null,!0),c=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","pan",c,e.isFinal)||this.emit("wantsPanGesture",{longitude:o,latitude:a,fov:this.camera.pose.fov,offset:u.clone()},e.isFinal)))if(this.updateCamera({longitude:o,latitude:a,offset:u},!0,!0),this.emit("gesture","pan",c,e.isFinal),this.emit("panGesture",this.camera.copyPose(),e.isFinal),this.lastPanPoint=e.isFinal?void 0:{pointerLength:e.pointers.length,x:e.center.x,y:e.center.y},e.isFinal)this.emit("wantsInteriaPan",this.camera.copyPose())||(this.interiaMovement=!0,et((function(i){var n=e.velocityX*i*r,s=e.velocityY*i,o=Math.sqrt(n*n+s*s);o>100&&(n=n/o*100,s=s/o*100),t.requestInteriaMovement({x:n,y:s},!0)})))}},i.prototype.onTapGesture=function(e){if(this.interiaMovement=!1,!this.tweenPosition){var t=this.relativeClientPosition(e.center),i=new a.Raycaster;i.setFromCamera(t,this.camera);var n=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","tap",n,!0)||this.emit("wantsTapGesture",i,t))){this.emit("gesture","tap",n,!0),this.emit("tapGesture",i,t);var r;Ve(r=this.getForwardPanoIndexOrNot(i))||(this.emit("panoSelected",r),this.emit("wantsMoveToPano",r,{longitude:this.camera.pose.longitude,latitude:0},!0))}}},i.prototype.onPinchGesture=function(e){this.interiaMovement=!1;var t=this.camera,i=this.lastPinchFov;if("pinchstart"===e.type)return delete this.lastPanPoint,void(this.lastPinchFov=t.fov);"pinchend"===e.type&&(delete this.lastPanPoint,delete this.lastPinchFov);var n="pinchend"===e.type;if(i){var r=i/e.scale,s=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(this.emit("wantsGesture","pinch",s,n)||this.emit("wantsPinchGesture",e.scale,r,n))return;this.updateCamera({fov:r},!0,!0),this.emit("gesture","pinch",s,n),this.emit("pinchGesture",e.scale,r,n)}},i.prototype.onMouseWheel=function(e){var t=this;this.interiaMovement=!1;var i=e.delta,n=this.minFov,r=this.maxFov,s=Math.max(n,Math.min(r,this.camera.fov-i)),o=[{x:e.clientX,y:e.clientY}];this.emit("wantsGesture","mouseWheel",o,!1)||this.emit("wantsMouseWheel",i,s,!1)||(this.updateCamera({fov:s},!0,!0),this.emit("gesture","mouseWheel",o,!1),this.emit("mouseWheel",i,s,!1),clearTimeout(this.onMouseWheelFinalInterval),this.onMouseWheelFinalInterval=window.setTimeout((function(){t.emit("wantsGesture","mouseWheel",o,!0)||t.emit("wantsMouseWheel",i,s,!0)||(t.emit("gesture","mouseWheel",o,!0),t.emit("mouseWheel",0,s,!0))}),200))},i}($i),tn=function(e){function i(t){var n=i.parseArgs(t);return e.call(this,n)||this}return t.__extends(i,e),i.parseArgs=function(i){var n=[t.__assign(t.__assign({},i.initial[0]),{longitude:0,latitude:Math.PI/2}),i.initial[1],i.initial[2]],r=t.__assign(t.__assign({},i),{initial:n,maxLatitude:Math.PI/2,minLatitude:Math.PI/2,defaultLongitude:0,defaultLatitude:Math.PI/2});return e.parseArgs.call(this,r)},i.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},i.prototype.initAnimation=function(t,i,n){var r=this;return e.prototype.initAnimation.call(this,t,i,n).then((function(){var e,t;if(!r.destroyed){var n=null!==(t=null===(e=r.model.getMaterial())||void 0===e?void 0:e.perspToOrtho)&&void 0!==t?t:0;if(0===i)r.model.setMaterial({perspToOrtho:1}),r.needsRender=!0;else var s=zi(250,Ei.Linear.None).onUpdate((function(e){var t=e.progress;r.destroyed||(r.model.setMaterial({perspToOrtho:Oi(n,1,t)}),r.needsRender=!0)})).onComplete((function(){return s.destroy()}))}}))},i.prototype.resetModel=function(e,t){this.model=e,this.needsRender=!0;var i=this.calculateCameraPosition({longitude:this.defaultLongitude,latitude:this.defaultLatitude},this.cameraDistance(),null,!1);this.updateCamera({offset:i},t,!1)},i.prototype.getZoomOffsetFromFov=function(e,t,i){var n=new a.Vector3(0,-1,0),r=Math.tan(i/2*Math.PI/180),s=Math.tan(t.fov/2*Math.PI/180),o=(s-r)/s,u=new a.Raycaster;u.setFromCamera(e,t);var c=u.ray.direction,l=c.angleTo(n),h=this.cameraDistance(),d=h*Math.tan(l),p=c.clone().setLength(h*Math.cos(l)).projectOnPlane(n),M=p.length(),f=o/M*p.x*d,g=o/M*p.z*d;return new a.Vector3(f,0,g)},i.prototype.onPanGesture=function(e){if(!this.tweenCoordinates){var t=this.element,i=this.camera,n=i.fov,r=i.matrix,s=i.up,o=t.offsetHeight,u=this.lastPanPoint&&this.lastPanPoint.pointerLength===e.pointers.length?{x:e.center.x-this.lastPanPoint.x,y:e.center.y-this.lastPanPoint.y}:{x:0,y:0},c=this.camera.pose.offset.clone(),l=i.position.y*Math.tan(n/2*Math.PI/180);c.add(function(e,t){var i=new a.Vector3;return i.setFromMatrixColumn(t,0),i.multiplyScalar(-e),i}(2*u.x*l/o,r)),c.add(function(e,t,i){var n=new a.Vector3;return n.setFromMatrixColumn(i,0),n.crossVectors(t,n),n.multiplyScalar(e),n}(2*u.y*l/o,s,r));var h=this.model.bounding,d=h.getCenter(new a.Vector3),p=(h.max.x-h.min.x)/this.defaultFov*i.fov,M=(h.max.y,h.min.y,this.defaultFov,i.fov,(h.max.z-h.min.z)/this.defaultFov*i.fov);c.x=Math.max(d.x-p,Math.min(d.x+p,c.x)),c.z=Math.max(d.z-M,Math.min(d.z+M,c.z));var f=e.pointers.map((function(e){return{x:e.x,y:e.y}}));this.emit("wantsGesture","pan",f,e.isFinal)||this.emit("wantsPanGesture",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:c},e.isFinal)||(this.updateCamera({offset:c},!0,!0),this.emit("gesture","pan",f,e.isFinal),this.emit("panGesture",this.camera.copyPose(),e.isFinal),this.lastPanPoint=e.isFinal?void 0:{pointerLength:e.pointers.length,x:e.center.x,y:e.center.y})}},i.prototype.onMouseWheel=function(e){var t=this,i=e.delta,n=e.clientX,r=e.clientY,s=this.camera,o=this.minFov,a=this.maxFov,u=Math.max(o,Math.min(a,this.camera.fov-i)),c=[{x:e.clientX,y:e.clientY}];if(!(this.emit("wantsGesture","mouseWheel",c,!1)||this.emit("wantsMouseWheel",i,u,!1))){var l=this.relativeClientPosition({x:n,y:r}),h=this.getZoomOffsetFromFov(l,s,u),d=this.camera.pose.offset.clone().add(h);this.updateCamera({offset:d,fov:u},!0,!0),this.emit("gesture","mouseWheel",c,!1),this.emit("mouseWheel",i,u,!1),clearTimeout(this.onMouseWheelFinalInterval),this.onMouseWheelFinalInterval=window.setTimeout((function(){t.emit("wantsGesture","mouseWheel",c,!0)||t.emit("wantsMouseWheel",i,u,!0)||(t.emit("gesture","mouseWheel",c,!0),t.emit("mouseWheel",0,u,!0))}),200)}},i.prototype.onPinchGesture=function(e){var t=this.camera,i=this.lastPinchFov,n=e.scale,r=e.type,s=e.center,o=this.minFov,a=this.maxFov;if("pinchstart"===r)return delete this.lastPanPoint,void(this.lastPinchFov=t.fov);"pinchend"===r&&(delete this.lastPanPoint,delete this.lastPinchFov);var u="pinchend"===r;if(i){var c=i/n,l=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(this.emit("wantsGesture","pinch",l,u)||this.emit("wantsPinchGesture",n,c,u))return;c=Math.max(o,Math.min(a,c));var h=this.relativeClientPosition(s),d=this.getZoomOffsetFromFov(h,t,c),p=this.camera.pose.offset.clone().add(d);this.updateCamera({longitude:0,latitude:Math.PI/2,offset:p,fov:c},!0,!0),this.emit("gesture","pinch",l,u),this.emit("pinchGesture",n,c,u)}},i.prototype.__requestInteriaMovement=function(){},i}(en),nn=[];function rn(e){return e.onload=e.onerror=He,e.crossOrigin="",/^blob\:/.test(e.src)&&URL.revokeObjectURL(e.src),e.removeAttribute("src"),e}function sn(e){e instanceof a.Texture?e.dispose():(rn(e),-1===nn.indexOf(e)&&nn.push(e))}function on(e,t,i,n,r,s,o){if(void 0===e&&(e=""),void 0===t&&(t=He),void 0===i&&(i=He),void 0===n&&(n=He),void 0===r&&(r=He),/\.basis(\?|$)/.test(e)){var a=!1;Ke();var u=function(){!0!==a&&(r(),a=!0)};return new $t({allowHosts:s,networkSubscribe:o}).load(e,(function(e,i){!0!==a?(n(1),t(e,i),a=!0):e.dispose()}),(function(e,t,i){n(e)}),(function(t){!0!==a&&(i(new Error("source load error: "+e)),a=!0)})),{abort:u}}var c=!1,l=null,h=function(e){var r=e.body,s=e.meta,o=URL.createObjectURL(r),a=rn(nn.shift()||at());a.onload=function(){a.onload=a.onerror=He,!0!==c?(Xe((function(){return t(a,s)})),n(1),c=!0):sn(a)},a.onerror=function(){a.onload=a.onerror=He,!0!==c&&(i(new Error("source load error: "+o)),c=!0),sn(a)},a.src=o};u=function(){!0!==c&&(l?l.abort():(r(),c=!0))};return l=kt(e,{responseType:"blob",allowHosts:s,networkSubscribe:o},(function(e,t){if(l=null,!0!==c)return e instanceof St?(c=!0,r()):e?(c=!0,i(e)):void h(t)}),n),{abort:u}}var an=["right","left","up","down","front","back"];var un=function(e){function i(t,i){void 0===i&&(i={});var n=e.call(this)||this;return n.renderer=t,n.allowHosts=i.allowHosts,n.networkSubscribe=i.networkSubscribe,n.prevRequest=null,n}return t.__extends(i,e),i.prototype.setAllowHosts=function(e){this.allowHosts=e},i.prototype.load=function(e,i){var n=this,r=l.digest(e),s=He,o=He,u=He,c=He;"function"==typeof i?(s=function(e){return i(null,e)},u=function(e){return i(e)},c=function(e){return i(e)}):(i.onLoad&&(s=i.onLoad),i.onProgress&&(o=i.onProgress),i.onError&&(u=i.onError),i.onAbort&&(c=i.onAbort)),this.abort();for(var h=[],d=function(){h.length=0,n.prevRequest=null},p=!1,M=function(i,o,u){if(p)sn(i);else{f(1,u),h[u].image=i,h[u].meta=o;for(var c=0,l=h;c<l.length;c++){if(!l[c].image)return}var M=function(e){var i=new ot;i.generateMipmaps=!0;var n=i.dispose,r=e[0];r instanceof a.Texture?(i.format=r.format,i.encoding=r.encoding,i.minFilter=r.minFilter,i.magFilter=r.magFilter):i.minFilter=a.LinearFilter,r instanceof a.CompressedTexture&&(i.isCompressedTexture=!0);for(var s=0;s<e.length;s++)i.images[s]=e[s];return i.needsUpdate=!0,i.dispose=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var r=0,s=this.images;r<s.length;r++){var o=s[r];o&&sn(o)}return this.images.length=[],n.call.apply(n,t.__spreadArray([this],e,!1))},i}(h.map((function(e){return e.image})));M.hash=r,M.meta=h.map((function(e){return e.meta})),p=!0,s(M),n.emit("load",M,e),d()}},f=function(t,i){h[i].progress=Math.max(h[i].progress,t);var r=h.reduce((function(e,t){return t.progress/h.length+e}),0);o(r),n.emit("progress",r,e)},g=function(t){var i=function(e,t){var i=t.index,n=void 0===i?0:i,r=t.images,s=void 0===r?{}:r,o=t.imageOptions,a=void 0===o?{}:o,u=s[e],c=["cube",n,e].join("."),l=$t.isInitialized();return Bt(u,Object.assign({key:c,basisLoaderInitialized:l},a))}(an[t],e);h[t]={source:i,progress:0,handler:{abort:He}},h[t].handler=on(i,(function(e,i){return M(e,i,t)}),(function(t){return function(t,i){if(!0!==p){u(t),n.emit("error",t,e);for(var r=0,s=h;r<s.length;r++){var o=s[r].image;o&&sn(o)}p=!0,d()}}(t)}),(function(e){return f(e,t)}),(function(){return function(t){if(!0!==p){c(new Error("source load abort: "+h[t].source)),n.emit("abort",e);for(var i=0,r=h;i<r.length;i++){var s=r[i].image;s&&sn(s)}p=!0,d()}}(t)}),A.allowHosts,A.networkSubscribe)},A=this,y=0;y<an.length;y++)g(y);this.prevRequest={abort:function(){for(var e=0,t=h;e<t.length;e++){t[e].handler.abort()}h.length=0}},this.emit("start",e)},i.prototype.abort=function(){this.prevRequest&&(this.prevRequest.abort(),this.prevRequest=null)},i}(xt),cn=function(e){function i(t,i){var n=e.call(this)||this;n.disposed=!1,n.size=t.clone(),n.image=new ImageData(new Uint8ClampedArray([0,0,0,0]),1,1),n.generateMipmaps=!0,n.unpackAlignment=1,n.needsUpdate=!0,n.wrapS=a.ClampToEdgeWrapping,n.wrapT=a.ClampToEdgeWrapping,n.minFilter=a.NearestFilter,n.magFilter=a.NearestFilter,n.renderer=i;var r=n.gl=i.getContext(),s=n.utils=a.WebGLUtils(r,i.extensions,i.capabilities);i.initTexture(n);var o=i.properties.get(n),u=r.getParameter(r.TEXTURE_BINDING_2D);return r.bindTexture(r.TEXTURE_2D,o.__webglTexture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.texImage2D(r.TEXTURE_2D,0,s.convert(n.format),t.x,t.y,0,s.convert(n.format),s.convert(n.type),null),r.bindTexture(r.TEXTURE_2D,u),n.update(n.image,new a.Vector2),n}return t.__extends(i,e),i.prototype.update=function(e,t){if(!this.disposed){var i=this;i.size;var n=i.gl,r=i.utils,s=i.renderer.properties.get(this);if(!s.__webglTexture)throw new Error("UpdatableTexture never initialized");var o=n.getParameter(n.TEXTURE_BINDING_2D);n.bindTexture(n.TEXTURE_2D,s.__webglTexture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.texSubImage2D(n.TEXTURE_2D,0,t.x,t.y,r.convert(this.format),r.convert(this.type),e),n.generateMipmap(n.TEXTURE_2D),n.bindTexture(n.TEXTURE_2D,o)}},i.prototype.dispose=function(){this.disposed=!0,e.prototype.dispose.call(this)},i}(a.Texture);function ln(e,t){return[Math.floor(e%t),Math.floor(e/t)]}var hn=new _t,dn=at();dn.crossOrigin="";var pn=Promise.resolve(),Mn=function(e){function i(t){var i=e.call(this)||this;i.texutre=new cn(new a.Vector2(2048,2048),t),i.mappings=[];for(var n=Ke(),r=0;r<16;r++){var s=ln(r,4),o=s[0],u=s[1];i.mappings[r]={idle:!0,loaded:!0,resource:"",timestamp:n,clip:new a.Vector4(0,0,0,0),drawAt:new a.Vector4(o/4,u/4,1/4,1/4)}}return i}return t.__extends(i,e),i.prototype.requestResource=function(e){var t=this;pn=pn.then((function(){return new Promise((function(i){var n=function(){/^blob\:/.test(dn.src)&&URL.revokeObjectURL(dn.src),dn.removeAttribute("src"),i()};hn.loadToImage(dn,e,(function(){if(512!==dn.width||512!==dn.height)t.emit("error",new Error("tile image size must be 512 x 512."));else{var i=t.getMaddpingByResource(e);if(i&&!0!==i.loaded){i.loaded=!0;var r=new a.Vector2(2048*i.drawAt.x,2048*i.drawAt.y);t.texutre.update(dn,r),t.emit("update",t.getVisibleMappings())}}n()}),(function(){}),n)}))}))},i.prototype.getMaddpingByResource=function(e){return this.mappings.filter((function(t){return e===t.resource}))[0]},i.prototype.getIdleMapping=function(){return this.mappings.filter((function(e){return e.idle})).sort((function(e,t){return e.timestamp-t.timestamp}))[0]},i.prototype.getHash=function(){return l.digest(this.getVisibleMappings().map((function(e){return e.map((function(e){return e.toArray()}))})))},i.prototype.cleanTiles=function(){for(var e=this.getHash(),t=0,i=this.mappings;t<i.length;t++){i[t].idle=!0}e!==this.getHash&&this.emit("update",this.getVisibleMappings())},i.prototype.loadTiles=function(e){var t=this.getHash(),i=Math.pow(4,2),n=Ke();e.length>i&&((e=e.slice()).length=i);for(var r=0,s=this.mappings;r<s.length;r++){(p=s[r]).idle=!0}for(var o=[],a=0,u=e;a<u.length;a++){var c=Bt((d=u[a]).resource);(p=this.getMaddpingByResource(c))?(p.idle=!1,p.timestamp=n):o.push(d)}for(var l=0,h=o;l<h.length;l++){var d,p;c=Bt((d=h[l]).resource);(p=this.getIdleMapping()).idle=!1,p.resource=c,p.clip=d.clip,p.loaded=!1,p.timestamp=n,this.requestResource(c)}t!==this.getHash&&this.emit("update",this.getVisibleMappings())},i.prototype.getVisibleMappings=function(){return this.mappings.map((function(e){var t=!1===e.idle&&!0===e.loaded?e.drawAt.clone():new a.Vector4(0,0,0,0);return[e.clip.clone(),t.clone()]}))},i.prototype.dispose=function(){this.emit("dispose"),this.mappings.length=0,this.texutre.dispose()},i}(xt);var fn=function(e){function i(){var t=e.call(this)||this,i=new a.RingBufferGeometry(.04,.08,32),n=new a.MeshBasicMaterial({color:1245179,opacity:.8,side:a.DoubleSide,transparent:!0});return t.ringMesh=new a.Mesh(i,n),t.ringMesh.renderOrder=10,t.add(t.ringMesh),t}return t.__extends(i,e),i.prototype.dispose=function(){this.remove(this.ringMesh),this.ringMesh.geometry.dispose(),Array.isArray(this.ringMesh.material)?this.ringMesh.material.forEach((function(e){return e.dispose()})):this.ringMesh.material.dispose()},i}(a.Object3D);function gn(){return new fn}var An=function(e){function i(t){var n=this,r=i.parseArgs(t);return(n=e.call(this,r)||this).defaultLongitude=r.defaultLongitude,n.defaultLatitude=r.defaultLongitude,n.defaultFov=r.defaultFov,n.maxFov=r.maxFov,n.minFov=r.minFov,n.maxLatitude=r.maxLatitude,n.minLatitude=r.minLatitude,n.moveSpeed=r.moveSpeed,n.intersectMeshCreator=r.intersectMeshCreator,n.interiaMovement=!1,n.intersectMesh=n.intersectMeshCreator(),n.intersectMesh.name="intersect",n.intersectMesh.visible=!1,n.helper.add(n.intersectMesh),n}return t.__extends(i,e),i.parseArgs=function(i){var n,r,s,o,a,u,c,l,h,d=e.parseArgs.call(this,i);return t.__assign(t.__assign({},d),{defaultLongitude:null!==(n=i.defaultLongitude)&&void 0!==n?n:0,defaultLatitude:null!==(r=i.defaultLongitude)&&void 0!==r?r:0,defaultFov:null!==(s=i.defaultFov)&&void 0!==s?s:80,maxFov:null!==(o=i.maxFov)&&void 0!==o?o:120,minFov:null!==(a=i.minFov)&&void 0!==a?a:40,maxLatitude:null!==(u=i.maxLatitude)&&void 0!==u?u:+Math.PI/2,minLatitude:null!==(c=i.minLatitude)&&void 0!==c?c:-Math.PI/2,moveSpeed:null!==(l=i.moveSpeed)&&void 0!==l?l:3.2,intersectMeshCreator:null!==(h=i.intersectMeshCreator)&&void 0!==h?h:gn})},i.initAnimationEndPose=function(e){var t,i,n,r=this.parseArgs(e),s=e.initial[0];return{longitude:null!==(t=s.longitude)&&void 0!==t?t:r.defaultLongitude,latitude:null!==(i=s.latitude)&&void 0!==i?i:r.defaultLatitude,fov:null!==(n=s.fov)&&void 0!==n?n:r.defaultFov,offset:r.work.observers[r.panoIndex].position.clone()}},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.interiaMovement=!1,this.hideIntersectMesh(),this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose())},i.prototype.updateCamera=function(e,t,i){var n,r,s;void 0===e&&(e={});var o=this,a=o.minFov,u=o.maxFov,c=o.maxLatitude,l=o.minLatitude,h=null!==(n=e.longitude)&&void 0!==n?n:this.camera.pose.longitude,d=null!==(r=e.latitude)&&void 0!==r?r:this.camera.pose.latitude,p=void 0===e.fov||this.emit("wantsChangeCameraFov",e.fov)?this.camera.pose.fov:e.fov,M=null!==(s=e.offset)&&void 0!==s?s:this.camera.pose.offset;i&&(d=Math.max(l,Math.min(c,d)),p=Math.max(a,Math.min(u,p)));var f=h!==this.camera.pose.longitude||d!==this.camera.pose.latitude,g=p!==this.camera.pose.fov,A=!M.equals(this.camera.pose.offset);this.camera.setFromPose({longitude:h,latitude:d,fov:p,offset:M}),g&&this.emit("cameraFovUpdate",this.camera.pose.fov,t),f&&this.emit("cameraDirectionUpdate",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},t),A&&this.emit("cameraPositionUpdate",this.camera.pose.offset.clone(),t),(g||f||A)&&this.emit("cameraUpdate",this.camera.copyPose(),t),this.needsRender=!0,Ht()},i.prototype.calculateMovingDuration=function(e,t){switch(typeof e){case"function":return e(t,this.moveSpeed);case"number":return e;case"string":return Number(e);default:return Math.floor(Math.max(Math.min(t/this.moveSpeed*1e3,1500),500))}},i.prototype.initAnimation=function(e,t,i){var n,r,s,o=this;if(this.destroyed)return Promise.resolve();var a=null!==(n=e.longitude)&&void 0!==n?n:this.defaultLongitude,u=null!==(r=e.latitude)&&void 0!==r?r:this.defaultLatitude,c=null!==(s=e.fov)&&void 0!==s?s:this.defaultFov;return new Promise((function(e){o.moveToPano(o.currentPanoIndex,{longitude:a,latitude:u,fov:c,limit:!1,duration:t,moveStartCallback:function(e,t){o.preventPanGesture=!0,o.preventTapGesture=!0,o.emit("initAnimationWillStart",e,t,i)},moveEndCallback:function(t,n){o.preventPanGesture=!1,o.preventTapGesture=!1,e(),o.emit("initAnimationEnded",t,n,i)},moveCancelCallback:function(){o.preventPanGesture=!1,o.preventTapGesture=!1,e(),o.emit("initAnimationEnded",o.currentPanoIndex,o.camera.copyPose(),i)}},i)}))},i.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.emit("intersectionHidden"),this.needsRender=!0},i.prototype.coordinatesChangeWithOffset=function(e,t){var i=2*t.x/this.element.offsetWidth*this.camera.fov/95*this.camera.aspect,n=-2*t.y/this.element.offsetHeight*this.camera.fov/95;return{longitude:e.longitude+i,latitude:e.latitude+n}},i.prototype.requestInteriaMovement=function(e,t){var i=this;if(!1!==this.interiaMovement){var n=this.coordinatesChangeWithOffset(this.camera.pose,e),r=n.longitude,s=n.latitude;this.updateCamera({longitude:r,latitude:s},t,!0);var o=Math.abs(e.x)>1||Math.abs(e.y)>1;this.emit("interiaPan",this.camera.copyPose(),!o),o?Xe((function(){i.requestInteriaMovement({x:.9*e.x,y:.9*e.y*.7},t)})):this.interiaMovement=!1}},Object.defineProperty(i.prototype,"gesturing",{get:function(){return this.interiaMovement||void 0!==this.lastPanPoint||void 0!==this.lastPinchFov},enumerable:!1,configurable:!0}),i.prototype.onPanGesture=function(e){var t=this;this.interiaMovement=!1,this.hideIntersectMesh();var i=this.lastPanPoint&&this.lastPanPoint.pointerLength===e.pointers.length?{x:e.center.x-this.lastPanPoint.x,y:e.center.y-this.lastPanPoint.y}:{x:0,y:0},n=this.coordinatesChangeWithOffset(this.camera.pose,i),r=n.longitude,s=n.latitude;Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(s=this.camera.pose.latitude);var o=e.pointers.map((function(e){return{x:e.x,y:e.y}}));this.emit("wantsGesture","pan",o,e.isFinal)||this.emit("wantsPanGesture",this.camera.copyPose(),e.isFinal)||(this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.updateCamera({longitude:r,latitude:s},!0,!0),this.emit("gesture","pan",o,e.isFinal),this.emit("panGesture",this.camera.copyPose(),e.isFinal),this.lastPanPoint=e.isFinal?void 0:{pointerLength:e.pointers.length,x:e.center.x,y:e.center.y},e.isFinal&&(this.emit("wantsInteriaPan",this.camera.copyPose())||et((function(i){t.interiaMovement=!0;var n=e.velocityX*i,r=e.velocityY*i,s=Math.sqrt(n*n+r*r);s>100&&(n=n/s*100,r=r/s*100),Math.abs(r/n)<Math.tan(20/180*Math.PI)&&(r=0),t.requestInteriaMovement({x:n,y:r},!0)}))))},i.prototype.onPinchGesture=function(e){this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.interiaMovement=!1;var t=this.camera,i=this.lastPinchFov,n=e.scale,r=e.type;if("pinchstart"===r)return this.lastPinchFov=t.fov,void delete this.lastPanPoint;"pinchend"===r&&(delete this.lastPanPoint,delete this.lastPinchFov);var s="pinchend"===r;if(i){var o=i/n,a=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(this.emit("wantsGesture","pinch",a,s)||this.emit("wantsPinchGesture",n,o,s))return;this.updateCamera({fov:o},!0,!0),this.emit("gesture","pinch",a,s),this.emit("pinchGesture",n,o,s)}},i.prototype.onMouseWheel=function(e){var t=this;this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.interiaMovement=!1;var i=e.delta,n=this.minFov,r=this.maxFov,s=Math.max(n,Math.min(r,this.camera.fov-i)),o=[{x:e.clientX,y:e.clientY}];this.emit("wantsGesture","mouseWheel",o,!1)||this.emit("wantsMouseWheel",i,s,!1)||(this.updateCamera({fov:s},!0,!0),this.emit("gesture","mouseWheel",o,!1),this.emit("mouseWheel",i,s,!1),clearTimeout(this.onMouseWheelFinalInterval),this.onMouseWheelFinalInterval=window.setTimeout((function(){t.emit("wantsGesture","mouseWheel",o,!0)||t.emit("wantsMouseWheel",i,s,!0)||(t.emit("gesture","mouseWheel",o,!0),t.emit("mouseWheel",0,s,!0))}),200))},i.prototype.onMouseMove=function(e){var t=this,i=t.camera,n=t.model,r=t.intersectMesh,s=t.lastPanPoint;if(r&&!n.empty&&n.bvhs&&!0===n.bvhs.loaded&&!s){var o=this.relativeClientPosition({x:e.clientX,y:e.clientY}),u=new a.Raycaster;if(u.setFromCamera(o,i),this.emit("wantsShowIntersectionOnModel",u))return this.hideIntersectMesh(),void(this.needsRender=!0);var c=n.intersectRaycaster(u)[0];if(c&&c.face){var l=c.face.normal,h=l.clone().multiplyScalar(.05),d=c.point.clone().add(h);r.position.copy(d);var p=d.clone().add(h);if(r.lookAt(p),Math.abs(l.y)>.99){var M=i.pose.offset.clone().sub(d);r.rotation.z=-Math.atan2(M.z,M.x)}r.visible=!0,this.emit("intersectionOnModelUpdate",c,r),this.needsRender=!0}else this.hideIntersectMesh(),this.needsRender=!0;this.lastMouseMoveEvent={clientX:e.clientX,clientY:e.clientY}}},i.prototype.onMouseOut=function(){this.intersectMesh&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},i}($i),yn=at(),vn=new a.Texture(yn);yn.onload=function(){return vn.needsUpdate=!0},yn.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAR9JREFUOBF10kFOAzEMBdCZFhCbrrgAN+NqHIULsWKDKO3gF+VHoZpa+rXjfH87nq7btr0ty3KZ8FsxnHeQPL748lA/x0Jsq+AwYe0X8nDtGA33BEJUHIEKW/EorHOLI7BHNlkEbju38YkQAIRZxFkHz2HOirKDxNcIzG+fu/6oLiNmqc5ZrlwTeKyAgJF14tMZmSn87pBrxeX/CRABgk/dl1s+C18dio2Pp9nmCQru2UtdvN+7lI9AFsgb3zNMcSp8FF4LYs3UhLfOAvkDJffci8q1J/ByRLKnQ8gUJUFOd2SeZYliCxwiyJCxCbhUGFKF4zPm61hiq7sVyJnPmATyR5IzLSNyDNEFRCDnkAmA8U2RfCsIefYhDeKOQLv7A+l1ZTyjymNxAAAAAElFTkSuQmCC";var mn=new a.RingBufferGeometry(.06,.07,32).rotateX(-Math.PI/2),Nn=new a.MeshBasicMaterial({map:vn,transparent:!0});function Dn(){if("undefined"==typeof document){var e=new a.Texture;return Object.assign(e,{draw:function(e){},retain:!1,pool:!1})}var t=document.createElement("canvas"),i=512,n=256,r=190;t.setAttribute("width",String(i)),t.setAttribute("height",String(i));var s=new a.Texture(t),o=t.getContext("2d");if(!o)throw Error("cannot create canvas context");var u=o.createRadialGradient(n,n,150,n,n,0);function c(){var e=Math.PI/12,t=2*Math.PI/3;o&&(o.beginPath(),o.arc(n,n,r,0*t,1*t-e),o.stroke(),o.beginPath(),o.arc(n,n,r,1*t,2*t-e),o.stroke(),o.beginPath(),o.arc(n,n,r,2*t,3*t-e),o.stroke())}function l(e){o&&(o.clearRect(0,0,i,i),o.lineWidth=20,-1!==e&&(o.globalCompositeOperation="source-over",o.strokeStyle="rgba(255, 255, 255, 1)",c(),o.globalCompositeOperation="source-in",o.beginPath(),o.arc(n,n,r,0,2*Math.PI*e),o.strokeStyle="rgba(255, 255, 255, 1)",o.stroke(),o.globalCompositeOperation="source-over",o.strokeStyle="rgba(255, 255, 255, "+(e?.5:1)+")",c()),o.beginPath(),o.arc(n,n,150,0,2*Math.PI),o.closePath(),o.fillStyle=u,o.fill(),o.fillStyle="rgba(255, 255, 255, 0.01)",o.fillRect(0,0,i,i),s.needsUpdate=!0)}return u.addColorStop(0,"rgba(255, 255, 255, 1)"),u.addColorStop(.15,"rgba(255, 255, 255, 1)"),u.addColorStop(.15,"rgba(255, 255, 255, 0.5)"),u.addColorStop(.4,"rgba(255, 255, 255, 0.0)"),u.addColorStop(1,"rgba(255, 255, 255, 0.0)"),l(0),Object.assign(s,{draw:l,retain:!1,pool:!1})}var wn=[];var Tn=Dn();Tn.draw(0);var xn=Dn();xn.draw(1);var En=Dn();En.draw(-1);var jn=new a.CircleBufferGeometry(.12,32).rotateX(-Math.PI/2);function zn(){return new a.Mesh(jn,new a.MeshBasicMaterial({map:Tn,transparent:!0}))}var In=function(e){function i(){var t=e.call(this)||this;return t.needsRender=!0,t.loading=!1,t.disabled=!1,t.centerMesh=zn(),t.centerMesh.position.y+=.01,t.add(t.centerMesh),t.loadingMesh=new a.Mesh(mn,Nn),t.loadingMesh.position.y+=.011,t}return t.__extends(i,e),i.prototype.setLoading=function(e){var t=this;this.loading=e,this.stopInterval&&this.stopInterval(),e?(this.add(this.loadingMesh),this.stopInterval=Je((function(){t.loadingMesh.rotateOnAxis(new a.Vector3(0,1,0),.1),t.needsRender=!0}))):this.remove(this.loadingMesh),this.needsRender=!0},i.prototype.setDisabled=function(e){function t(t){var i=t.map;!0===i.pool&&(i.retain=!1),t.map=e?En:Tn}this.disabled=e,Array.isArray(this.centerMesh.material)?this.centerMesh.material.forEach((function(e){t(e)})):t(this.centerMesh.material),this.needsRender=!0},i.prototype.setProgress=function(e){function t(e,t){var i=e.map;0===t||1===t?(!0===i.pool&&(i.retain=!1),0===t&&(e.map=Tn),1===t&&(e.map=xn)):(!0!==i.pool&&(e.map=function(){for(var e=0,t=wn;e<t.length;e++){var i=t[e];if(!1===i.retain)return i}var n=Dn();return n.pool=!0,n.retain=!0,wn.push(n),n}()),e.map.draw(t))}this.setLoading(!1),this.setDisabled(!1),e=Math.max(0,Math.min(1,e)),Array.isArray(this.centerMesh.material)?this.centerMesh.material.forEach((function(i){t(i,e)})):t(this.centerMesh.material,e),this.needsRender=!0},i.prototype.setOpacity=function(e){Array.isArray(this.centerMesh.material)?this.centerMesh.material.forEach((function(t){t.opacity=e})):this.centerMesh.material.opacity=e,this.needsRender=!0},i.prototype.dispose=function(){this.setLoading(!1),this.remove(this.centerMesh),this.remove(this.loadingMesh),this.centerMesh.geometry.dispose(),Array.isArray(this.centerMesh.material)?this.centerMesh.material.forEach((function(e){e.dispose()})):this.centerMesh.material.dispose(),this.loadingMesh.geometry.dispose(),Array.isArray(this.loadingMesh.material)?this.loadingMesh.material.forEach((function(e){e.dispose()})):this.loadingMesh.material.dispose()},i}(a.Object3D);function bn(){return new In}function Ln(e){var t=Math.abs(Math.cos(e.latitude));return new a.Vector3(-Math.sin(e.longitude)*t,-Math.sin(e.latitude),-Math.cos(e.longitude)*t)}var Sn=new a.OrthographicCamera(-1,1,1,-1,0,1),On=new a.BufferGeometry;On.setAttribute("position",new a.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),On.setAttribute("uv",new a.Float32BufferAttribute([0,2,0,0,2,0],2));var Cn=new a.Mesh(On),Pn=new a.Scene;Pn.add(Cn);for(var kn=function(){function e(e,t){var i;this.renderer=e,this.material=new a.ShaderMaterial({vertexShader:null!==(i=t.vertex)&&void 0!==i?i:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:t.fragment,uniforms:Object.assign({inputBuffer:new a.Uniform(null)},t.uniforms)})}return e.prototype.render=function(e,t){var i=this.renderer.getRenderTarget(),n=Cn.material;this.material.uniforms.inputBuffer.value=e.texture,Cn.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Pn,Sn),this.renderer.setRenderTarget(i),Cn.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Un=function(){function e(e){this.renderer=e,this.material=new a.ShaderMaterial({vertexShader:"\n void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n uniform vec3 inputValue;\n void main() {\n gl_FragColor = vec4(inputValue, 1.0);\n }\n ",uniforms:Object.assign({inputValue:new a.Uniform(new a.Vector3)})})}return e.prototype.render=function(e,t){var i=this.renderer.getRenderTarget(),n=Cn.material;this.material.uniforms.inputValue.value.copy(e),Cn.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Pn,Sn),this.renderer.setRenderTarget(i),Cn.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Bn=function(e){function i(t){return e.call(this,t,{fragment:"\n uniform sampler2D inputBuffer;\n varying vec2 vUv;\n void main() {\n gl_FragColor = texture2D(inputBuffer, vUv);\n }\n "})||this}return t.__extends(i,e),i}(kn),_n=function(e){function i(t){return e.call(this,t,{fragment:"\n #include <common>\n uniform sampler2D inputBuffer;\n varying vec2 vUv;\n void main() {\n float scale = 0.25;\n float u = (vUv.x - 0.5) * scale + 0.5;\n float v = (vUv.y - 0.5) * scale + 0.5;\n vec3 rgb = texture2D(inputBuffer, vec2(u, v)).rgb;\n float luminance = linearToRelativeLuminance(rgb) - 0.5;\n luminance = luminance / 2.0 + 0.5;\n gl_FragColor = vec4(luminance, luminance, luminance, 1.0);\n }\n "})||this}return t.__extends(i,e),i}(kn),Rn=function(e){function i(t,i){return void 0===i&&(i=.002),e.call(this,t,{uniforms:{targetBuffer:new a.Uniform(null),inputBuffer:new a.Uniform(null),step:new a.Uniform(i)},vertex:"\n void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",fragment:"\n uniform sampler2D targetBuffer;\n uniform sampler2D inputBuffer;\n uniform float step;\n void main() {\n float target = texture2D(targetBuffer, vec2(0.5, 0.5)).r;\n float current = texture2D(inputBuffer, vec2(0.5, 0.5)).r;\n\n float result;\n if (abs(target - current) < step) {\n result = target;\n } else if (target - current > 0.0) {\n result = current + step;\n } else {\n result = current - step;\n }\n gl_FragColor = vec4(result, result, result, 1.0);\n }\n "})||this}return t.__extends(i,e),Object.defineProperty(i.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(i.prototype,"step",{get:function(){return this.material.uniforms.step.value},set:function(e){this.material.uniforms.step.value=e},enumerable:!1,configurable:!0}),i}(kn),Qn=function(e){function i(t){return e.call(this,t,{uniforms:{inputBuffer:new a.Uniform(null),luminanceAdaptiveBUffer:new a.Uniform(null)},fragment:"\n #include <common>\n uniform sampler2D inputBuffer;\n uniform sampler2D luminanceAdaptiveBUffer;\n varying vec2 vUv;\n\n vec3 hsv2rgb(vec3 c) {\n const vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n }\n\n vec3 rgb2hsv(vec3 c) {\n const vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n\n float d = q.x - min(q.w, q.y);\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + 0.001)), d / (q.x + 0.001), q.x);\n }\n\n void main() {\n vec3 rgb = texture2D(inputBuffer, vUv).rgb;\n float luminance = linearToRelativeLuminance(rgb);\n float delta = (texture2D(luminanceAdaptiveBUffer, vec2(0.5, 0.5)).r - 0.5);\n vec3 hsv = rgb2hsv(rgb);\n if (delta > 0.0) {\n hsv.z -= delta * (1.0 - luminance);\n } else {\n hsv.z -= delta * luminance;\n }\n gl_FragColor = vec4(hsv2rgb(hsv), 1.0);\n }\n\n "})||this}return t.__extends(i,e),Object.defineProperty(i.prototype,"luminanceAdaptiveBUffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBUffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBUffer.value=e},enumerable:!1,configurable:!0}),i}(kn),Yn=function(){function e(e){this.enable=!0,this.renderer=e,this.valuePass=new Un(this.renderer),this.copyPass=new Bn(this.renderer),this.luminancePass=new _n(this.renderer),this.nextStepPass=new Rn(this.renderer),this.luminanceAdaptivePass=new Qn(this.renderer)}return e.prototype.render=function(e){this.enable?(this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new a.WebGLRenderTarget(1,1,{encoding:this.renderer.outputEncoding}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e),this.luminancePass.render(e,this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new a.WebGLRenderTarget(1,1,{encoding:this.renderer.outputEncoding}),this.valuePass.render(new a.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new a.WebGLRenderTarget(1,1,{encoding:this.renderer.outputEncoding}),this.valuePass.render(new a.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.render(e)):this.copyPass.render(e)},e.prototype.dispose=function(){var e,t,i;null===(e=this.luminanceTargetBuffer)||void 0===e||e.dispose(),null===(t=this.luminancePrevBuffer)||void 0===t||t.dispose(),null===(i=this.luminanceNextBuffer)||void 0===i||i.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},e}(),Fn=(new a.Matrix4).makeRotationAxis(new a.Vector3(0,1,0),Math.PI),Vn=new a.Vector2(16,8),Hn=[],Gn=0;Gn<Vn.x;Gn++)for(var qn=0;qn<Vn.y;qn++){Hn[qn*Vn.x+Gn]=[];var Wn=Ln({longitude:2*Math.PI/Vn.x*(Gn+.5),latitude:Math.PI/Vn.y*(qn+.5)-Math.PI/2});Hn[qn*Vn.x+Gn].push(Wn);for(var Kn=0;Kn<=8;Kn++)for(var Zn=0;Zn<=8;Zn++){var Xn=Ln({longitude:2*Math.PI/Vn.x*(Gn+Kn/8),latitude:Math.PI/Vn.y*(qn+Zn/8)-Math.PI/2});Hn[qn*Vn.x+Gn].push(Xn)}}var Jn=new a.MeshDistanceMaterial({nearDistance:0,farDistance:10}),$n=new a.Scene;$n.overrideMaterial=Jn;var er=function(e){function i(t){var n=this,r=i.parseArgs(t);(n=e.call(this,r)||this).maxAccessibleDistance=r.maxAccessibleDistance,n.panoTapTriggerRadius=r.panoTapTriggerRadius,n.panoCircleMeshCreator=r.panoCircleMeshCreator;var s=n.model.getMaterial()||{},o=s.pano0Map,u=s.pano1Map;return u&&u!==o&&(n.model.setMaterial({pano1Map:o}),u.dispose()),n.boundingMesh=n.generateBoundingMesh(),n.boundingMesh.setMaterial(n.model.getMaterial()||{}),n.boundingMesh.name="bounding",n.boundingMesh.visible=!1,n.scene.add(n.boundingMesh),n.panoCircleMeshes=[],n.updatePanoCircleMeshes(),n.model.loaded||n.panoCircleMeshes.forEach((function(e){return e.visible=!1})),n.depthCamera=new a.CubeCamera(.01,10,new a.WebGLCubeRenderTarget(64)),r.enableLuminanceAdaptiveEffect&&(n.luminanceAdaptiveEffect=new Yn(n.renderer),n.luminanceAdaptiveEffect.enable=!1,n.postProcessing=function(e){var t;return null===(t=n.luminanceAdaptiveEffect)||void 0===t?void 0:t.render(e)}),n.cubeTextureLoader=new un(n.renderer,{allowHosts:n.work.allowHosts,networkSubscribe:n.networkSubscribe}),n.cubeTextureLoader.on("start",(function(e){var t,i=e.index;null===(t=n.panoCircleMeshes[i])||void 0===t||t.setProgress(0),n.emit("textureStartLoad",i,n.work.observers[i])})),n.cubeTextureLoader.on("progress",(function(e,t){var i,r=t.index;null===(i=n.panoCircleMeshes[r])||void 0===i||i.setProgress(e),n.emit("textureLoading",e,r,n.work.observers[r])})),n.cubeTextureLoader.on("abort",(function(e){var t,i=e.index;null===(t=n.panoCircleMeshes[i])||void 0===t||t.setProgress(0),n.emit("textureAbort",i,n.work.observers[i])})),n.cubeTextureLoader.on("load",(function(e,t){var i,r=t.index;null===(i=n.panoCircleMeshes[r])||void 0===i||i.setProgress(1),n.emit("textureLoaded",r,n.work.observers[r],e.meta)})),n.cubeTextureLoader.on("error",(function(e,t){var i,r=t.index;null===(i=n.panoCircleMeshes[r])||void 0===i||i.setProgress(0),n.emit("textureError",e,r,n.work.observers[r]),n.emit("error",e)})),n.once("initAnimationWillStart",(function(){(new a.Box3).expandByObject(n.boundingMesh).containsPoint(n.camera.position)&&(n.boundingMesh.visible=!0),n.luminanceAdaptiveEffect&&(n.luminanceAdaptiveEffect.enable=!0)})),n}return t.__extends(i,e),i.parseArgs=function(i){var n,r,s,o,a=e.parseArgs.call(this,i);return t.__assign(t.__assign({},a),{enableLuminanceAdaptiveEffect:null!==(n=i.enableLuminanceAdaptiveEffect)&&void 0!==n&&n,maxAccessibleDistance:null!==(r=i.maxAccessibleDistance)&&void 0!==r?r:5,panoTapTriggerRadius:null!==(s=i.panoTapTriggerRadius)&&void 0!==s?s:1,panoCircleMeshCreator:null!==(o=i.panoCircleMeshCreator)&&void 0!==o?o:bn})},i.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},i.prototype.getCurrentTileIndicesInCamera=function(){for(var e=this.work.observers[this.currentPanoIndex],t=(new a.Matrix4).compose(e.position,e.quaternion,new a.Vector3(-1,1,1)),i=this.camera.getWorldDirection(new a.Vector3),n=(new a.Matrix4).multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),r=(new a.Frustum).setFromProjectionMatrix(n),s=[],o=0;o<Hn.length;o++)for(var u=0,c=Hn[o];u<c.length;u++){var l=c[u];if(r.containsPoint(l.clone().applyMatrix4(t))){s.push(o);break}}return s.sort((function(e,t){return Hn[e][0].angleTo(i)-Hn[t][0].angleTo(i)})),s},i.prototype.tilingPanoIfNeeds=function(){var e,t=this,i=this.camera.pose.fov<=70,n=this.work.observers[this.currentPanoIndex],r=n.images.tiles;if(i&&r&&n.position.equals(this.camera.pose.offset)){this.tileTextureLoader||(this.tileTextureLoader=new Mn(this.renderer),this.tileTextureLoader.on("update",(function(e){t.setModelAndBoundingMaterial({panoTileMap:t.tileTextureLoader.texutre,panoTileMappings:e}),t.needsRender=!0})));for(var s=this.getCurrentTileIndicesInCamera(),o=[],u=0;u<Vn.x*Vn.y;u++)if(-1!==s.indexOf(u)){var c=Math.floor(u%Vn.x),l=Math.floor(u/Vn.x),h=new a.Vector4(c/Vn.x,l/Vn.y,1/Vn.x,1/Vn.y),d=r+"/row-"+(l+1)+"-column-"+(c+1)+".jpg";o.push({resource:d,clip:h})}this.tileTextureLoader.loadTiles(o)}else null===(e=this.tileTextureLoader)||void 0===e||e.cleanTiles()},i.prototype.updateWork=function(e,t,i,n){var r=this;this.ready=!1,this.work=e,this.currentPanoIndex=t.panoIndex,this.cubeTextureLoader.setAllowHosts(this.work.allowHosts);var s={},o=!0;return this.boundingMesh&&(s=this.boundingMesh.getMaterial()||{},o=this.boundingMesh.visible,this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.boundingMesh=this.generateBoundingMesh(!0),this.boundingMesh.name="bounding",this.boundingMesh.visible=o,this.boundingMesh.setMaterial(s),this.scene.add(this.boundingMesh),this.hideIntersectMesh(),this.moveToPano(t.panoIndex,{effect:"fade",duration:i,longitude:t.longitude,latitude:t.latitude,fov:t.fov,moveStartCallback:function(){return r.updatePanoCircleMeshes(!1)}},n),!0},i.prototype.updatePanoCircleMeshes=function(e){var t=this;void 0===e&&(e=!0);var i=[];this.panoCircleMeshes&&(this.panoCircleMeshes.forEach((function(e){e.loading&&i.push(e.panoIndex),t.helper.remove(e),e.dispose()})),this.panoCircleMeshes.length=0);var n=new a.Vector3(0,-1,0);this.panoCircleMeshes=this.work.observers.map((function(r,s){var o=t.panoCircleMeshCreator();if(o.position.copy(r.standingPosition),e&&t.model.loaded){var u=o.position.clone().add(new a.Vector3(0,1,0)),c=new a.Raycaster(u,n,0,1),l=t.model.intersectRaycaster(c)[0];l&&l.point.distanceTo(o.position)>.1&&(o.position.copy(l.point.clone()),o.needsRender=!0)}return o.name="panoCircle_"+s,o.panoIndex=s,t.helper.add(o),o.needsRender=!0,!1===r.active&&(o.setDisabled(!0),i.indexOf(s)>=0&&(o.setDisabled(!1),o.setLoading(!0))),o}));var r=this.work.observers[this.currentPanoIndex].visibleNodes;r=r.filter((function(e){var i=t.work.observers[e];return i.loadable||i.active})),this.panoCircleMeshes.forEach((function(e){e.visible=r.indexOf(e.panoIndex)>=0}));var s=this.camera.position;this.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(s);e.setOpacity(Math.min(1.5/t,1))}))},i.prototype.destroy=function(){var t,i,n,r,s=this;e.prototype.destroy.call(this),null===(t=this.luminanceAdaptiveEffect)||void 0===t||t.dispose(),this.cubeTextureLoader.off(),null===(i=this.tileTextureLoader)||void 0===i||i.dispose(),delete this.pendingLoadTextureHashAndCallback,this.boundingMesh&&(this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.panoCircleMeshes&&(this.panoCircleMeshes.forEach((function(e){s.helper.remove(e),e.dispose()})),this.panoCircleMeshes.length=0),this.interiaMovement=!1;var o=this.videoTexture.image;o.pause(),o.oncanplay=function(){},o.ontimeupdate=function(){};var u={pano0DepthMap:null,panoVideoMap:null,panoVideoSize:new a.Vector2,panoVideoMatrix:new a.Matrix4,panoVideoAlpha:0};this.setModelAndBoundingMaterial(u),null===(n=this.depthCamera)||void 0===n||n.renderTarget.texture.dispose(),null===(r=this.depthCamera)||void 0===r||r.renderTarget.dispose(),delete this.depthCamera},i.prototype.render=function(t){this.work.observers[this.currentPanoIndex].video&&(this.needsRender=!0),e.prototype.render.call(this,t)},i.prototype.generateBoundingMesh=function(e){void 0===e&&(e=!1);var t=this.model.bounding.clone();return this.work.observers.forEach((function(e){t.expandByPoint(e.standingPosition),t.expandByPoint((new a.Vector3).fromArray([e.position.x,2*e.position.y-e.standingPosition.y,e.position.z]))})),e&&t.expandByPoint(this.camera.pose.offset),ft(t,new a.Vector3(1,0,1))},i.prototype.resetModel=function(e,t){var i=this;this.model=e;var n={};this.boundingMesh&&(n=this.boundingMesh.getMaterial()||{},this.boundingMesh.visible,this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.boundingMesh=this.generateBoundingMesh(),this.boundingMesh.visible=!0,this.boundingMesh.name="bounding",this.boundingMesh.setMaterial(n),this.scene.add(this.boundingMesh),this.needsRender=!0,Gt((function(){i.updatePanoCircleMeshes(),i.updateCamera({},t,!0),i.needsRender=!0}))},i.prototype.moveToPano=function(e,t,i){var n=this;this.ready=!1,this.interiaMovement=!1;var r={index:e,images:this.work.observers[e].images,imageOptions:this.imageOptions},s=l.digest(r),o=function(r,s){if(r)return t.moveCancelCallback&&t.moveCancelCallback(),n.emit("panoLoadError",r,e),n.emit("moveToPanoCanceled",e),void(n.ready=!0);var o=s;n.destroyed?o.dispose():(n.emit("panoLoaded",e),Xe((function(){return n.doMoveToPano(e,o,t,i)})))},a=this.pendingLoadTextureHashAndCallback||[],u=a[0],c=a[1];if(s!==u){if(delete this.pendingLoadTextureHashAndCallback,c&&c(new Error("texture aborted")),this.emit("moveToPano",e,i),this.emit("panoWillLoad",e),!r.images)return void o(new Error("pano images were not existed"));var h=this.getModelAndBoundingMaterial()||{},d=h.pano0Map,p=h.pano1Map,M=void 0;if(d&&d.hash===s?M=d:p&&p.hash===s&&(M=p),M)return void o(null,M);this.pendingLoadTextureHashAndCallback=[s,o],this.cubeTextureLoader.load(r,(function(e,t){var i=n.pendingLoadTextureHashAndCallback||[],r=i[0],o=i[1];s===r&&o?(o(e,t),delete n.pendingLoadTextureHashAndCallback):null==t||t.dispose()}))}},i.prototype.updateCamera=function(t,i,n){var r=this;void 0===t&&(t={}),e.prototype.updateCamera.call(this,t,i,n),this.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(r.camera.pose.offset);e.setOpacity(Math.min(1.5/t,1))}));var s=this.getForwardPanoIndexOrNot();null!==s&&this.panoCircleMeshes[s].setOpacity(1),this.needsRender=!0,Ht(),this.tilingPanoIfNeeds()},i.prototype.cannotMoveAnimation=function(){var e=this;if(this.interiaMovement=!1,!this.tweenCoordinates){var t=this.camera.fov,i=.98*t,n=function(t){var i=t.fov;e.updateCamera({fov:i},!0,!0)};this.tweenCoordinates=ji({fov:t},{fov:i},200).onUpdate(n).onComplete((function(){var r;null===(r=e.tweenCoordinates)||void 0===r||r.destroy(),e.tweenCoordinates=ji({fov:i},{fov:t},200).onUpdate(n).onComplete((function(){var t;null===(t=e.tweenCoordinates)||void 0===t||t.destroy(),delete e.tweenCoordinates}))}))}},i.prototype.getModelAndBoundingMaterial=function(){for(var e=0,t=[this.model,this.boundingMesh];e<t.length;e++){return t[e].getMaterial()}return null},i.prototype.setModelAndBoundingMaterial=function(e){for(var t=0,i=[this.model,this.boundingMesh];t<i.length;t++){i[t].setMaterial(e)}},i.prototype.doMoveToPano=function(e,t,i,n){var r,s,o,u,c,l,h,d,p,M,f,g=this;void 0===i&&(i={});var A=i.effect,y=void 0===A?"fly":A,v=i.limit,m=void 0===v||v,N=i.easing,D=void 0===N?Ei.Quadratic.InOut:N,w=this.currentPanoIndex,T=this.work.observers[e],x=this.work.observers[w].accessibleNodes.indexOf(e)>=0,E=T.video,j=T.visibleNodes;j=j.filter((function(e){var t=g.work.observers[e];return t.loadable||t.active}));var z=this.calculateMovingDuration(i.duration,this.camera.pose.offset.distanceTo(T.standingPosition)),I=this.camera.pose.offset.clone(),b=null!==(s=null===(r=this.getModelAndBoundingMaterial())||void 0===r?void 0:r.modelAlpha)&&void 0!==s?s:0,L=null!==(u=null===(o=this.model.getMaterial())||void 0===o?void 0:o.perspToOrtho)&&void 0!==u?u:0,S=this.camera.pose.longitude,O=this.camera.pose.latitude,C=this.camera.pose.fov,P=T.position,k=null!==(l=null===(c=this.getModelAndBoundingMaterial())||void 0===c?void 0:c.pano0Matrix)&&void 0!==l?l:new a.Matrix4,U=(new a.Matrix4).compose(T.position,T.quaternion,new a.Vector3(-1,1,1)),B=null!==(h=i.longitude)&&void 0!==h?h:S,_=null!==(d=i.latitude)&&void 0!==d?d:O,R=null!==(p=i.fov)&&void 0!==p?p:C,Q={fov:R,longitude:B,latitude:_,offset:P.clone()};this.tweenPosition&&(this.tweenPosition.destroy(),delete this.tweenPosition),this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),i.moveStartCallback&&i.moveStartCallback(e,Q),this.emit("panoWillArrive",e,Q,n),this.needsRender=!0,x&&($n.add(this.model),Jn.referencePosition.copy(I),null===(M=this.depthCamera)||void 0===M||M.position.copy(I),null===(f=this.depthCamera)||void 0===f||f.update(this.renderer,$n),this.scene.add(this.model),this.scene.children.unshift(this.scene.children.pop()));var Y=function(){var r=g.getModelAndBoundingMaterial()||{},s=r.pano0Map,o=r.pano1Map;s&&s!==o&&s!==t&&s.dispose();var a={modelAlpha:0,perspToOrtho:0,pano0Matrix:U,pano0Map:t,pano0DepthMap:g.depthCamera?g.depthCamera.renderTarget.texture:null,pano1Matrix:U,pano1Map:t,progress:0};if(E&&Object.keys(E).length>0){var u=g.videoTexture.image;u.oncanplay=function(){u.oncanplay=function(){},u.currentTime=0,u.play(),g.setModelAndBoundingMaterial({panoVideoAlpha:0,panoVideoMap:g.videoTexture,panoVideoSize:E.size,panoVideoMatrix:Fn.clone().multiply(U).multiply(E.matrix)})},u.src=E.source,u.ontimeupdate=function(){if(u.currentTime>.5&&u.src===(null==E?void 0:E.source)){u.ontimeupdate=function(){};var e=zi(230,D).onUpdate((function(e){var t=e.progress;return g.setModelAndBoundingMaterial({panoVideoAlpha:t})})).onComplete((function(){return e.destroy()}))}}}g.setModelAndBoundingMaterial(a),g.panoCircleMeshes.forEach((function(e){e.visible=j.indexOf(e.panoIndex)>=0})),g.updateCamera({offset:P},n,m),g.panoCircleMeshes[e]&&g.panoCircleMeshes[e].setProgress(0),i.moveEndCallback&&i.moveEndCallback(e,g.camera.copyPose()),g.currentPanoIndex=e,g.preventTapGesture=!1,g.boundingMesh.visible=!0,Xe((function(){g.emit("panoArrived",e,g.camera.copyPose(),n),g.ready=!0})),g.needsRender=!0};if(this.preventTapGesture=!0,z){var F=this.videoTexture.image;F.pause(),F.removeAttribute("src"),F.oncanplay=function(){},F.ontimeupdate=function(){},this.videoTexture.needsUpdate=!0;var V=this.getModelAndBoundingMaterial()||{},H=V.pano0Map,G=V.pano1Map;G&&G!==H&&G!==t&&G.dispose();var q={pano1Matrix:U,pano1Map:t,pano0DepthMap:x&&this.depthCamera?this.depthCamera.renderTarget.texture:null,panoVideoMap:null,panoVideoSize:new a.Vector2,panoVideoMatrix:new a.Matrix4,panoVideoAlpha:0,useBlackTransition:"instant"===y};if("fade"===y){var W=k.clone();W.setPosition(P),q.pano0Matrix=W,I.copy(P),this.updateCamera({offset:P},n,m)}this.setModelAndBoundingMaterial(q),"fly"!==y&&this.panoCircleMeshes.forEach((function(e){return e.visible=!1})),this.renderer.compile(this.scene,this.camera),this.tweenPosition=zi(z,D).onUpdate((function(t){var i=t.progress;g.setModelAndBoundingMaterial({progress:i,modelAlpha:Oi(b,0,i),perspToOrtho:Oi(L,0,Math.min(5*i,1))});var r=new a.Vector3(Oi(I.x,P.x,i),Oi(I.y,P.y,i),Oi(I.z,P.z,i));g.updateCamera({offset:r},n,m),i>.9&&(g.preventTapGesture=!1),g.emit("movingToPano",e,w,i),"fly"===y?n&&g.lastMouseMoveEvent&&g.onMouseMove(g.lastMouseMoveEvent):g.hideIntersectMesh(),g.needsRender=!0})).onComplete((function(){g.tweenPosition&&(g.tweenPosition.completed=!0,g.tweenPosition.destroy()),delete g.tweenPosition,Y()})).onCancel((function(){i.moveCancelCallback&&i.moveCancelCallback()}))}else Y();if(S!==B||O!==_||C!==R){var K=function(e){var t=e.progress,i=Ci(S,B,t),r=Oi(O,_,t),s=Oi(C,R,t);g.updateCamera({longitude:i,latitude:r,fov:s},n,m)},Z=function(){return K({progress:1})};z>0?this.tweenCoordinates=zi(z,D).onUpdate(K).onComplete((function(){g.tweenCoordinates&&(g.tweenCoordinates.destroy(),delete g.tweenCoordinates),Z()})):Z()}},i.prototype.getForwardPanoIndexOrNot=function(e){var t=this,i=this.camera,n=this.currentPanoIndex,r=this.work.observers[n].accessibleNodes;r=r.filter((function(e){var i=t.work.observers[e];return i.loadable||i.active}));var s,o=i.getWorldDirection(new a.Vector3);s=e?e.ray.direction.clone():o.clone();var u=i.pose.offset.clone();if(s.y=u.y=0,0===s.length()||0===u.length())return null;for(var c=0,l=r.filter((function(e){var n=t.work.observers[e].standingPosition.clone().sub(i.pose.offset);return 0!==n.length()&&n.angleTo(o)<i.fov/2/180*Math.PI})).map((function(e){var i=t.work.observers[e].standingPosition.clone();return Object.assign(i,{y:0,panoIndex:e})})).sort((function(e,t){return e.distanceTo(u)-t.distanceTo(u)}));c<l.length;c++){var h=l[c],d=h.clone().sub(u);if(0!==d.length()&&s.angleTo(d)<Math.PI/6)return h.panoIndex}return null},i.prototype.onTapGesture=function(e){var i=this;if(this.interiaMovement=!1,!0!==this.preventTapGesture){var n=null,r=this.work.observers[this.currentPanoIndex],s=r.accessibleNodes.filter((function(e){return i.work.observers[e].position.distanceTo(i.camera.pose.offset)<i.maxAccessibleDistance})),o=this.relativeClientPosition(e.center),u=new a.Raycaster;u.setFromCamera(o,this.camera);var c=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","tap",c,!0)||this.emit("wantsTapGesture",u,o))){this.emit("gesture","tap",c,!0),this.emit("tapGesture",u,o);var l=this.camera.getWorldDirection(new a.Vector3).setY(0).normalize(),h=this.model.intersectRaycaster(u)[0];if(h){var d=qi(s,(function(e){var t=i.work.observers[e].standingPosition.clone();return t.clone().sub(i.camera.pose.offset).setY(0).angleTo(l)>Math.PI/2?1/0:t.distanceTo(h.point)}),!0),p=d[0];d[1]<this.panoTapTriggerRadius&&(n=p)}if(Ve(n)&&(n=this.getForwardPanoIndexOrNot(u)),Ve(n))this.emit("panoSelected",null),this.cannotMoveAnimation();else{var M=this.work.observers[n];if(this.emit("panoSelected",n),M.active){for(var f=Math.PI/6,g=Math.PI/12,A=M.position.clone().setY(0).sub(r.position.clone().setY(0)).normalize(),y=A.clone().applyAxisAngle(new a.Vector3(0,1,0),f),v=A.clone().applyAxisAngle(new a.Vector3(0,1,0),-f),m=[],N=[],D=[],w=0,T=M.accessibleNodes;w<T.length;w++){if((p=T[w])!==this.currentPanoIndex&&p!==n){var x=this.work.observers[p].position.clone().setY(0).sub(M.position.clone().setY(0));A.angleTo(x)<f?D.push(x):y.angleTo(x)<f?m.push(x):v.angleTo(x)<f&&N.push(x)}}var E=(D.length>0?D:t.__spreadArray(t.__spreadArray([],m,!0),N,!0)).slice().sort((function(e,t){return e.angleTo(A)-t.angleTo(A)}))[0],j={};E&&E.angleTo(l)>g&&(j.longitude=Math.atan2(-E.x,-E.z)),this.emit("wantsMoveToPano",n,j,!0)}else this.panoCircleMeshes[n]&&(this.panoCircleMeshes[n].setDisabled(!1),this.panoCircleMeshes[n].setLoading(!0))}}}},i}(An),tr=function(e,t){var i=void 0!==e?e:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e,t){return e(t={exports:{}},t.exports),t.exports}var s=function(){return/Android/i.test(t.userAgent)||/iPhone|iPad|iPod/i.test(t.userAgent)},o=function(e,t){for(var i=0,n=e.length;i<n;i++)t[i]=e[i]},a=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},u=n(r((function(n,r){
372
+ * Licensed under the MIT license */var Zi=function(e,t,i,n){var r,s=["","webkit","Moz","MS","ms","o"],o=t.createElement?t.createElement("div"):n,a=Math.round,u=Math.abs,c=Date.now;function l(e,t,i){return setTimeout(g(e,i),t)}function h(e,t,i){return!!Array.isArray(e)&&(d(e,i[t],i),!0)}function d(e,t,i){var r;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==n)for(r=0;r<e.length;)t.call(i,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(i,e[r],r,e)}function A(t,i,n){var r="DEPRECATED METHOD: "+i+"\n"+n+" AT \n";return function(){var i=new Error("get-stack-trace"),n=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=e.console&&(e.console.warn||e.console.log);return s&&s.call(e.console,r,n),t.apply(this,arguments)}}r="function"!=typeof Object.assign?function(e){if(e===n||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var r=arguments[i];if(r!==n&&null!==r)for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])}return t}:Object.assign;var p=A((function(e,t,i){for(var r=Object.keys(t),s=0;s<r.length;)(!i||i&&e[r[s]]===n)&&(e[r[s]]=t[r[s]]),s++;return e}),"extend","Use `assign`."),M=A((function(e,t){return p(e,t,!0)}),"merge","Use `assign`.");function f(e,t,i){var n,s=t.prototype;(n=e.prototype=Object.create(s)).constructor=e,n._super=s,i&&r(n,i)}function g(e,t){return function(){return e.apply(t,arguments)}}function y(e,t){return"function"==typeof e?e.apply(t&&t[0]||n,t):e}function v(e,t){return e===n?t:e}function m(e,t,i){d(T(t),(function(t){e.addEventListener(t,i,!1)}))}function N(e,t,i){d(T(t),(function(t){e.removeEventListener(t,i,!1)}))}function D(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function w(e,t){return e.indexOf(t)>-1}function T(e){return e.trim().split(/\s+/g)}function x(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var n=0;n<e.length;){if(i&&e[n][i]==t||!i&&e[n]===t)return n;n++}return-1}function E(e){return Array.prototype.slice.call(e,0)}function j(e,t,i){for(var n=[],r=[],s=0;s<e.length;){var o=t?e[s][t]:e[s];x(r,o)<0&&n.push(e[s]),r[s]=o,s++}return i&&(n=t?n.sort((function(e,i){return e[t]>i[t]})):n.sort()),n}function I(e,t){for(var i,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(i=s[a])?i+o:t)in e)return r;a++}return n}var z=1;function b(t){var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||e}var L="ontouchstart"in e,S=I(e,"PointerEvent")!==n,O=L&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),C="touch",P="mouse",k=24,B=["x","y"],U=["clientX","clientY"];function Q(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){y(e.options.enable,[e])&&i.handler(t)},this.init()}function _(e,t,i){var r=i.pointers.length,s=i.changedPointers.length,o=1&t&&r-s==0,a=12&t&&r-s==0;i.isFirst=!!o,i.isFinal=!!a,o&&(e.session={}),i.eventType=t,function(e,t){var i=e.session,r=t.pointers,s=r.length;i.firstInput||(i.firstInput=R(t));s>1&&!i.firstMultiple?i.firstMultiple=R(t):1===s&&(i.firstMultiple=!1);var o=i.firstInput,a=i.firstMultiple,l=a?a.center:o.center,h=t.center=Y(r);t.timeStamp=c(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=G(l,h),t.distance=H(l,h),function(e,t){var i=t.center,n=e.offsetDelta||{},r=e.prevDelta||{},s=e.prevInput||{};1!==t.eventType&&4!==s.eventType||(r=e.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=e.offsetDelta={x:i.x,y:i.y});t.deltaX=r.x+(i.x-n.x),t.deltaY=r.y+(i.y-n.y)}(i,t),t.offsetDirection=V(t.deltaX,t.deltaY);var d=F(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=u(d.x)>u(d.y)?d.x:d.y,t.scale=a?function(e,t){return H(t[0],t[1],U)/H(e[0],e[1],U)}(a.pointers,r):1,t.rotation=a?function(e,t){return G(t[1],t[0],U)+G(e[1],e[0],U)}(a.pointers,r):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,function(e,t){var i,r,s,o,a=e.lastInterval||t,c=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(c>25||a.velocity===n)){var l=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=F(c,l,h);r=d.x,s=d.y,i=u(d.x)>u(d.y)?d.x:d.y,o=V(l,h),e.lastInterval=t}else i=a.velocity,r=a.velocityX,s=a.velocityY,o=a.direction;t.velocity=i,t.velocityX=r,t.velocityY=s,t.direction=o}(i,t);var A=e.element;D(t.srcEvent.target,A)&&(A=t.srcEvent.target);t.target=A}(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function R(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:a(e.pointers[i].clientX),clientY:a(e.pointers[i].clientY)},i++;return{timeStamp:c(),pointers:t,center:Y(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Y(e){var t=e.length;if(1===t)return{x:a(e[0].clientX),y:a(e[0].clientY)};for(var i=0,n=0,r=0;r<t;)i+=e[r].clientX,n+=e[r].clientY,r++;return{x:a(i/t),y:a(n/t)}}function F(e,t,i){return{x:t/e||0,y:i/e||0}}function V(e,t){return e===t?1:u(e)>=u(t)?e<0?2:4:t<0?8:16}function H(e,t,i){i||(i=B);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return Math.sqrt(n*n+r*r)}function G(e,t,i){i||(i=B);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return 180*Math.atan2(r,n)/Math.PI}Q.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(b(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&N(this.element,this.evEl,this.domHandler),this.evTarget&&N(this.target,this.evTarget,this.domHandler),this.evWin&&N(b(this.element),this.evWin,this.domHandler)}};var q={mousedown:1,mousemove:2,mouseup:4},W="mousedown",Z="mousemove mouseup";function X(){this.evEl=W,this.evWin=Z,this.pressed=!1,Q.apply(this,arguments)}f(X,Q,{handler:function(e){var t=q[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var K={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},J={2:C,3:"pen",4:P,5:"kinect"},$="pointerdown",ee="pointermove pointerup pointercancel";function te(){this.evEl=$,this.evWin=ee,Q.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&($="MSPointerDown",ee="MSPointerMove MSPointerUp MSPointerCancel"),f(te,Q,{handler:function(e){var t=this.store,i=!1,n=e.type.toLowerCase().replace("ms",""),r=K[n],s=J[e.pointerType]||e.pointerType,o=s==C,a=x(t,e.pointerId,"pointerId");1&r&&(0===e.button||o)?a<0&&(t.push(e),a=t.length-1):12&r&&(i=!0),a<0||(t[a]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:s,srcEvent:e}),i&&t.splice(a,1))}});var ie={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ne="touchstart",re="touchstart touchmove touchend touchcancel";function se(){this.evTarget=ne,this.evWin=re,this.started=!1,Q.apply(this,arguments)}function oe(e,t){var i=E(e.touches),n=E(e.changedTouches);return 12&t&&(i=j(i.concat(n),"identifier",!0)),[i,n]}f(se,Q,{handler:function(e){var t=ie[e.type];if(1===t&&(this.started=!0),this.started){var i=oe.call(this,e,t);12&t&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:C,srcEvent:e})}}});var ae={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ue="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=ue,this.targetIds={},Q.apply(this,arguments)}function le(e,t){var i=E(e.touches),n=this.targetIds;if(3&t&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,s,o=E(e.changedTouches),a=[],u=this.target;if(s=i.filter((function(e){return D(e.target,u)})),1===t)for(r=0;r<s.length;)n[s[r].identifier]=!0,r++;for(r=0;r<o.length;)n[o[r].identifier]&&a.push(o[r]),12&t&&delete n[o[r].identifier],r++;return a.length?[j(s.concat(a),"identifier",!0),a]:void 0}f(ce,Q,{handler:function(e){var t=ae[e.type],i=le.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:C,srcEvent:e})}});function he(){Q.apply(this,arguments);var e=g(this.handler,this);this.touch=new ce(this.manager,e),this.mouse=new X(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function de(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,Ae.call(this,t)):12&e&&Ae.call(this,t)}function Ae(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var i={x:t.clientX,y:t.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var e=n.indexOf(i);e>-1&&n.splice(e,1)}),2500)}}function pe(e){for(var t=e.srcEvent.clientX,i=e.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],s=Math.abs(t-r.x),o=Math.abs(i-r.y);if(s<=25&&o<=25)return!0}return!1}f(he,Q,{handler:function(e,t,i){var n=i.pointerType==C,r=i.pointerType==P;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)de.call(this,t,i);else if(r&&pe.call(this,i))return;this.callback(e,t,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Me=o?I(o.style,"touchAction"):n,fe=Me!==n,ge="compute",ye="auto",ve="manipulation",me="none",Ne="pan-x",De="pan-y",we=function(){if(!fe)return!1;var t={},i=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!i||e.CSS.supports("touch-action",n)})),t}();function Te(e,t){this.manager=e,this.set(t)}Te.prototype={set:function(e){e==ge&&(e=this.compute()),fe&&this.manager.element.style&&we[e]&&(this.manager.element.style[Me]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return d(this.manager.recognizers,(function(t){y(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(w(e,me))return me;var t=w(e,Ne),i=w(e,De);if(t&&i)return me;if(t||i)return t?Ne:De;if(w(e,ve))return ve;return ye}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var n=this.actions,r=w(n,me)&&!we.none,s=w(n,De)&&!we["pan-y"],o=w(n,Ne)&&!we["pan-x"];if(r){var a=1===e.pointers.length,u=e.distance<2,c=e.deltaTime<250;if(a&&u&&c)return}if(!o||!s)return r||s&&6&i||o&&i&k?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var xe=32;function Ee(e){this.options=r({},this.defaults,e||{}),this.id=z++,this.manager=null,this.options.enable=v(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function je(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ie(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function ze(e,t){var i=t.manager;return i?i.get(e):e}function be(){Ee.apply(this,arguments)}function Le(){be.apply(this,arguments),this.pX=null,this.pY=null}function Se(){be.apply(this,arguments)}function Oe(){Ee.apply(this,arguments),this._timer=null,this._input=null}function Ce(){be.apply(this,arguments)}function Pe(){be.apply(this,arguments)}function ke(){Ee.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Be(e,t){return(t=t||{}).recognizers=v(t.recognizers,Be.defaults.preset),new Ue(e,t)}Ee.prototype={defaults:{},set:function(e){return r(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(h(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=ze(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return h(e,"dropRecognizeWith",this)||(e=ze(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(h(e,"requireFailure",this))return this;var t=this.requireFail;return-1===x(t,e=ze(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(h(e,"dropRequireFailure",this))return this;e=ze(e,this);var t=x(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,i=this.state;function n(i){t.manager.emit(i,e)}i<8&&n(t.options.event+je(i)),n(t.options.event),e.additionalEvent&&n(e.additionalEvent),i>=8&&n(t.options.event+je(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=xe},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=r({},e);if(!y(this.options.enable,[this,t]))return this.reset(),void(this.state=xe);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},f(be,Ee,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,i=e.eventType,n=6&t,r=this.attrTest(e);return n&&(8&i||!r)?16|t:n||r?4&i?8|t:2&t?4|t:2:xe}}),f(Le,be,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(De),e&k&&t.push(Ne),t},directionTest:function(e){var t=this.options,i=!0,n=e.distance,r=e.direction,s=e.deltaX,o=e.deltaY;return r&t.direction||(6&t.direction?(r=0===s?1:s<0?2:4,i=s!=this.pX,n=Math.abs(e.deltaX)):(r=0===o?1:o<0?8:16,i=o!=this.pY,n=Math.abs(e.deltaY))),e.direction=r,i&&n>t.threshold&&r&t.direction},attrTest:function(e){return be.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ie(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),f(Se,be,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),f(Oe,Ee,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!n||!i||12&e.eventType&&!r)this.reset();else if(1&e.eventType)this.reset(),this._timer=l((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return xe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}}),f(Ce,be,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),f(Pe,be,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Le.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return 30&i?t=e.overallVelocity:6&i?t=e.overallVelocityX:i&k&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ie(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),f(ke,Ee,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ve]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(n&&r&&i){if(4!=e.eventType)return this.failTimeout();var s=!this.pTime||e.timeStamp-this.pTime<t.interval,o=!this.pCenter||H(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,o&&s?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=l((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return xe},failTimeout:function(){return this._timer=l((function(){this.state=xe}),this.options.interval,this),xe},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Be.VERSION="2.0.7",Be.defaults={domEvents:!1,touchAction:ge,enable:!0,inputTarget:null,inputClass:null,preset:[[Ce,{enable:!1}],[Se,{enable:!1},["rotate"]],[Pe,{direction:6}],[Le,{direction:6},["swipe"]],[ke],[ke,{event:"doubletap",taps:2},["tap"]],[Oe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ue(e,t){var i;this.options=r({},Be.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((i=this).options.inputClass||(S?te:O?ce:L?he:X))(i,_),this.touchAction=new Te(this,this.options.touchAction),Qe(this,!0),d(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Qe(e,t){var i,n=e.element;n.style&&(d(e.options.cssProps,(function(r,s){i=I(n.style,s),t?(e.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=e.oldCssProps[i]||""})),t||(e.oldCssProps={}))}return Ue.prototype={set:function(e){return r(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var i;this.touchAction.preventDefaults(e);var n=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var s=0;s<n.length;)i=n[s],2===t.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(e),!r&&14&i.state&&(r=t.curRecognizer=i),s++}},get:function(e){if(e instanceof Ee)return e;for(var t=this.recognizers,i=0;i<t.length;i++)if(t[i].options.event==e)return t[i];return null},add:function(e){if(h(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(h(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=x(t,e);-1!==i&&(t.splice(i,1),this.touchAction.update())}return this},on:function(e,t){if(e!==n&&t!==n){var i=this.handlers;return d(T(e),(function(e){i[e]=i[e]||[],i[e].push(t)})),this}},off:function(e,t){if(e!==n){var i=this.handlers;return d(T(e),(function(e){t?i[e]&&i[e].splice(x(i[e],t),1):delete i[e]})),this}},emit:function(e,i){this.options.domEvents&&function(e,i){var n=t.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=i,i.target.dispatchEvent(n)}(e,i);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){i.type=e,i.preventDefault=function(){i.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](i),r++}},destroy:function(){this.element&&Qe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(Be,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:xe,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:k,DIRECTION_ALL:30,Manager:Ue,Input:Q,TouchAction:Te,TouchInput:ce,MouseInput:X,PointerEventInput:te,TouchMouseInput:he,SingleTouchInput:se,Recognizer:Ee,AttrRecognizer:be,Tap:ke,Pan:Le,Swipe:Pe,Pinch:Se,Rotate:Ce,Press:Oe,on:m,off:N,each:d,merge:M,extend:p,assign:r,inherit:f,bindFn:g,prefixed:I}),Be}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{});function Xi(e,t){var i=document.mozFullScreen?"DOMMouseScroll":"mousewheel",n=!!window.addEventListener,r=!!window.attachEvent,s=function(e,t){var i=document.mozFullScreen?"DOMMouseScroll":"mousewheel",n=!!window.addEventListener,r=!!window.attachEvent;return t.__mouseWheelWrapper=function(s){if(s=s||window.event,n&&s.preventDefault(),r&&(s.returnValue=!1),"DOMMouseScroll"==i||"mousewheel"==i){var o=s.wheelDelta;s.delta=o?o/120:-(s.delta||0)/3}t.call(e,s)}}(e,t);n?e.addEventListener(i,s,!1):r&&e.attachEvent("on"+i,s)}function Ki(e,t,i){var n=t.offsetWidth,r=t.offsetHeight,s=t.getBoundingClientRect(),o=s.top,u=s.left;return i&&(u+=n*i.left,o+=r*(1-i.bottom-i.height),n*=i.width,r*=i.height),new a.Vector2((e.x-u)/n*2-1,-(e.y-o)/r*2+1)}!function(){try{var e=document.createElement("canvas");!window.WebGLRenderingContext||!e.getContext("webgl")&&e.getContext("experimental-webgl")}catch(e){return!1}}();var Ji="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"node",$i=Ji.match(/android/i)||Ji.match(/webos/i)||Ji.match(/ipad|iphone|ipod/i)||Ji.match(/iemobile/i)||Ji.match(/opera mini/i)||Ji.match(/blackberry/i)||Ji.match(/windows phone/i),en=function(e){function i(t){var n=e.call(this)||this,r=i.parseArgs(t);return n.ready=!1,n.destroyed=!1,n.ident=r.ident,n.scene=r.scene,n.helper=r.helper,n.camera=r.camera,n.renderer=r.renderer,n.scissor=r.scissor,n.element=r.element,n.model=r.model,n.work=r.work,n.imageOptions=r.imageOptions,n.videoTexture=r.videoTexture,n.networkSubscribe=r.networkSubscribe,n.needsRender=!0,n.preventPanGesture=!1,n.preventTapGesture=!1,n.preventPinchGesture=!1,n.currentPanoIndex=r.panoIndex,Ve(n.work.observers[n.currentPanoIndex])&&(n.currentPanoIndex=0),n.eventUnbinds=[r.element].concat(r.extraElements||[]).map((function(e){return n.bindEvents(e)})),Ke((function(){return n.initAnimation.apply(n,r.initial).then((function(){return n.ready=!0}))})),n}return t.__extends(i,e),i.parseArgs=function(e){return t.__assign({},e)},i.initAnimationEndPose=function(e){return this.parseArgs(e).camera.copyPose()},i.prototype.initAnimation=function(e,t,i){return Promise.resolve()},i.prototype.bindExtraElement=function(e){for(var t=0,i=this.eventUnbinds;t<i.length;t++){if(i[t].element===e)return}this.eventUnbinds.push(this.bindEvents(e))},i.prototype.unbindExtraElement=function(e){for(var t=null,i=-1,n=0,r=this.eventUnbinds;n<r.length;n++){var s=r[n];if(i++,s.element===e){t=s;break}}t&&(t(),this.eventUnbinds.splice(i,1))},i.prototype.resize=function(){this.needsRender=!0},i.prototype.resetModel=function(e,t){this.model=e,this.needsRender=!0},i.prototype.updateWork=function(e,t,i,n){return!1},i.prototype.render=function(e){this.renderer.render(this.scene,this.camera)},i.prototype.destroy=function(){this.destroyed=!0,this.ready=!1,this.off();for(var e=0,t=this.eventUnbinds;e<t.length;e++){(0,t[e])()}this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.tweenPosition&&(this.tweenPosition.destroy(),delete this.tweenCoordinates)},i.prototype.moveToPano=function(e,t,i){void 0===t&&(t={});var n={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone()};t.moveStartCallback&&t.moveStartCallback(e,n),this.emit("moveToPano",e,i),this.currentPanoIndex=e,this.emit("panoArrived",e,{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone()},i),t.moveEndCallback&&t.moveEndCallback(e,n)},i.prototype.updateCamera=function(e,t,i){var n,r,s,o;void 0===e&&(e={});var a=null!==(n=e.longitude)&&void 0!==n?n:this.camera.pose.longitude,u=null!==(r=e.latitude)&&void 0!==r?r:this.camera.pose.latitude,c=null!==(s=e.fov)&&void 0!==s?s:this.camera.pose.fov,l=null!==(o=e.offset)&&void 0!==o?o:this.camera.pose.offset,h=a!==this.camera.pose.longitude||u!==this.camera.pose.latitude,d=c!==this.camera.pose.fov,A=!l.equals(this.camera.pose.offset);this.camera.setFromPose({longitude:a,latitude:u,fov:c,offset:l}),d&&this.emit("cameraFovUpdate",this.camera.pose.fov,t),h&&this.emit("cameraDirectionUpdate",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},t),A&&this.emit("cameraPositionUpdate",this.camera.pose.offset.clone(),t),(d||h||A)&&this.emit("cameraUpdate",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone()},t),this.needsRender=!0},Object.defineProperty(i.prototype,"gesturing",{get:function(){return!1},enumerable:!1,configurable:!0}),i.prototype.onPanGesture=function(e){},i.prototype.onTapGesture=function(e){},i.prototype.onPinchGesture=function(e){},i.prototype.onMouseWheel=function(e){},i.prototype.onMouseMove=function(e){},i.prototype.onMouseOut=function(){},i.prototype.relativeClientPosition=function(e){return Ki(e,this.element,this.scissor)},i.prototype.bindEvents=function(e){var t=this,i=function(e){var i=Ki(e,t.element,t.scissor);return!(Math.abs(i.x)>1||Math.abs(i.y)>1)},n=new Zi.Manager(e),r=function(e){return e.session.firstInput||null};n.add(new Zi.Pan({threshold:10,pointers:0})),n.add(new Zi.Tap({interval:410})),n.add(new Zi.Pinch({threshold:0,pointers:2}).recognizeWith(n.get("pan"))),n.on("panstart pan",(function(e){var s=r(n);s&&!i(s.center)||!0!==t.preventPanGesture&&t.onPanGesture(e)})),n.on("tap",(function(e){var s=r(n);s&&!i(s.center)||!0!==t.preventTapGesture&&t.onTapGesture(e)})),n.on("pinchstart pinch pinchend",(function(e){var s=r(n);s&&!i(s.center)||!0!==t.preventPinchGesture&&t.onPinchGesture(e)}));var s=function(e){var n={x:e.clientX,y:e.clientY};i(n)&&t.onMouseWheel(e)},o=function(e){var n={x:e.clientX,y:e.clientY};i(n)?t.onMouseMove(e):t.onMouseOut()},a=function(){t.onMouseOut()};Xi(e,s),$i||(Zi.on(e,"mousemove",o),Zi.on(e,"mouseout",a));return Object.assign((function(){n.destroy(),function(e,t){var i=document.mozFullScreen?"DOMMouseScroll":"mousewheel",n=!!window.addEventListener,r=!!window.attachEvent;t.__mouseWheelWrapper&&(n?e.removeEventListener(i,t.__mouseWheelWrapper,!1):r&&e.detachEvent("on"+i,t.__mouseWheelWrapper),delete t.__mouseWheelWrapper)}(e,s),$i||(Zi.off(e,"mousemove",o),Zi.off(e,"mouseout",a))}),{element:e})},i}(xt),tn=function(e){function i(t){var n=this,r=i.parseArgs(t);return(n=e.call(this,r)||this).defaultLongitude=r.defaultLongitude,n.defaultLatitude=r.defaultLatitude,n.defaultFov=r.defaultFov,n.maxFov=r.maxFov,n.minFov=r.minFov,n.maxLatitude=r.maxLatitude,n.minLatitude=r.minLatitude,n}return t.__extends(i,e),i.parseArgs=function(i){var n,r,s,o,a,u,c,l=e.parseArgs.call(this,i);return t.__assign(t.__assign({},l),{defaultLongitude:null!==(n=i.defaultLongitude)&&void 0!==n?n:Math.PI/4,defaultLatitude:null!==(r=i.defaultLatitude)&&void 0!==r?r:Math.PI/4,defaultFov:null!==(s=i.defaultFov)&&void 0!==s?s:80,maxFov:null!==(o=i.maxFov)&&void 0!==o?o:120,minFov:null!==(a=i.minFov)&&void 0!==a?a:40,maxLatitude:null!==(u=i.maxLatitude)&&void 0!==u?u:+Math.PI/2,minLatitude:null!==(c=i.minLatitude)&&void 0!==c?c:-Math.PI/2})},i.initAnimationEndPose=function(e){var t,n,r,s=this.parseArgs(e),o=e.initial[0],a=null!==(t=o.longitude)&&void 0!==t?t:s.defaultLongitude,u=Math.max(s.minLatitude,Math.min(s.maxLatitude,null!==(n=o.latitude)&&void 0!==n?n:s.defaultLatitude)),c=null!==(r=o.fov)&&void 0!==r?r:s.defaultFov,l=i.prototype.cameraDistance.call(s);return{longitude:a,latitude:u,fov:c,offset:i.prototype.calculateCameraPosition.call(s,{longitude:u,latitude:u},l,null,!1).clone()}},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i.prototype.updateWork=function(e,t,i,n){return this.work=e,this.currentPanoIndex=t.panoIndex,!0},i.prototype.resetModel=function(t,i){e.prototype.resetModel.call(this,t,i),this.updateCamera({longitude:this.defaultLongitude,latitude:this.defaultLatitude,fov:this.defaultFov},i,!1)},i.prototype.initAnimation=function(e,t,i){var n,r,s,o,u,c,l=this;if(this.destroyed)return Promise.resolve();var h=this.camera,d=this.model;this.preventPanGesture=!0,this.preventTapGesture=!0,this.preventPinchGesture=!0;var A=h.pose.longitude,p=h.pose.latitude,M=h.pose.fov,f=h.pose.offset.clone(),g=(null===(n=d.getMaterial())||void 0===n?void 0:n.modelAlpha)||0,y=null!==(s=null===(r=this.model.getMaterial())||void 0===r?void 0:r.perspToOrtho)&&void 0!==s?s:0,v=null!==(o=e.longitude)&&void 0!==o?o:this.defaultLongitude,m=Math.max(this.minLatitude,Math.min(this.maxLatitude,null!==(u=e.latitude)&&void 0!==u?u:this.defaultLatitude)),N=null!==(c=e.fov)&&void 0!==c?c:this.defaultFov,D=d.bounding.getCenter(new a.Vector3),w=this.cameraDistance(),T=this.calculateCameraPosition({longitude:m,latitude:m},w,null,!1),x={longitude:v,latitude:m,fov:N,offset:T.clone()};return this.emit("initAnimationWillStart",this.currentPanoIndex,x,i),new Promise((function(e){l.tweenCoordinates&&(l.tweenCoordinates.destroy(),delete l.tweenCoordinates);var n=function(e){var t=e.progress,n=Pi(A,v,t),r=Ci(p,m,t),s=Ci(M,N,t);l.updateCamera({longitude:n,latitude:r,fov:s,offset:l.camera.pose.offset},i,!1)},r=function(){n({progress:1}),l.tweenCoordinates&&(l.tweenCoordinates.destroy(),delete l.tweenCoordinates)};t>0?l.tweenCoordinates=zi(t,ji.Quadratic.InOut).onUpdate(n).onComplete(r):r(),l.tweenPosition&&(l.tweenPosition.destroy(),delete l.tweenPosition);var s=function(e){var t=e.progress,n=Ci(0,w,t),r=new a.Vector3(Ci(f.x-D.x,0,t),Ci(f.y-D.y,0,t),Ci(f.z-D.z,0,t)),s=Ci(g,1,t),o=Ci(y,0,t);d.setMaterial({modelAlpha:s,perspToOrtho:o});var u=l.calculateCameraPosition(l.camera.pose,n,r,!1);l.updateCamera({offset:u},i,!1)};r=function(){s({progress:1}),l.updateCamera(l.camera.copyPose(),i,!1),l.tweenPosition&&(l.tweenPosition.destroy(),delete l.tweenPosition),l.needsRender=!0,l.preventPanGesture=!1,l.preventTapGesture=!1,l.preventPinchGesture=!1,e(),l.emit("initAnimationEnded",l.currentPanoIndex,l.camera.copyPose(),i)};t>0?l.tweenPosition=zi(t,ji.Quadratic.InOut).onUpdate(s).onComplete(r).onCancel((function(){l.preventPanGesture=!1,l.preventTapGesture=!1,l.preventPinchGesture=!1,e(),l.emit("initAnimationEnded",l.currentPanoIndex,l.camera.copyPose(),i)})):r()}))},i.prototype.cameraDistance=function(){var e=this.model.bounding,t=this.camera.aspect,i=Math.pow(Math.pow(e.max.x-e.min.x+2,2)+Math.pow(e.max.y-e.min.y+2,2)+Math.pow(e.max.z-e.min.z+2,2),.5),n=i/2/Math.tan(Math.PI*this.defaultFov/360);return t<1&&(n/=t),isNaN(n)?i:n},i.prototype.calculateCameraPosition=function(e,t,i,n){var r=e.longitude,s=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,e.latitude));n&&(s=Math.max(this.minLatitude,Math.min(this.maxLatitude,s)));var o=this.model.bounding.getCenter(new a.Vector3),u=t*Math.cos(s),c=new a.Vector3(Math.sin(r)*u+o.x,Math.sin(s)*t+o.y,Math.cos(r)*u+o.z);return null!==i&&c.add(i),c},i.prototype.updateCamera=function(e,t,i){var n,r,s;void 0===e&&(e={});var o=this,a=o.minFov,u=o.maxFov,c=o.maxLatitude,l=o.minLatitude,h=null!==(n=e.longitude)&&void 0!==n?n:this.camera.pose.longitude,d=null!==(r=e.latitude)&&void 0!==r?r:this.camera.pose.latitude,A=void 0===e.fov||this.emit("wantsChangeCameraFov",e.fov)?this.camera.pose.fov:e.fov,p=null!==(s=e.offset)&&void 0!==s?s:this.calculateCameraPosition({longitude:h,latitude:d},this.cameraDistance(),null,i);i&&(d=Math.max(l,Math.min(c,d)),A=Math.max(a,Math.min(u,A)));var M=h!==this.camera.pose.longitude||d!==this.camera.pose.latitude,f=A!==this.camera.pose.fov,g=!p.equals(this.camera.pose.offset);this.camera.setFromPose({longitude:h,latitude:d,fov:A,offset:p}),f&&this.emit("cameraFovUpdate",this.camera.pose.fov,t),M&&this.emit("cameraDirectionUpdate",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},t),g&&this.emit("cameraPositionUpdate",this.camera.pose.offset.clone(),t),(f||M||g)&&this.emit("cameraUpdate",this.camera.copyPose(),t),this.needsRender=!0,Ht()},i.prototype.getForwardPanoIndexOrNot=function(e){var t=this.work.observers.filter((function(e){return e.active})),i=this.model.intersectRaycaster(e)[0];if(!i)return null;var n=Wi(t,(function(e){return e.standingPosition.distanceTo(i.point)}),!0),r=n[0];return n[1]<5?this.work.observers.indexOf(r):null},i.prototype.coordinatesChangeWithOffset=function(e,t){var i=this.element,n=this.camera,r=i.offsetWidth,s=i.offsetHeight,o=2*t.x/r*n.fov/30,a=2*t.y/s*n.fov/30;return{longitude:Li(e.longitude+o),latitude:Math.max(this.minLatitude,Math.min(this.maxLatitude,e.latitude+a))}},i.prototype.requestInteriaMovement=function(e,t){var i=this;if(!1!==this.interiaMovement){var n=this.coordinatesChangeWithOffset(this.camera.pose,e),r=n.longitude,s=n.latitude;this.updateCamera({longitude:r,latitude:s},t,!0);var o=Math.abs(e.x)>1||Math.abs(e.y)>1;this.emit("interiaPan",this.camera.copyPose(),!o),o?Ke((function(){i.requestInteriaMovement({x:.8*e.x,y:.8*e.y},t)})):this.interiaMovement=!1}},Object.defineProperty(i.prototype,"gesturing",{get:function(){return this.interiaMovement||void 0!==this.lastPanPoint||void 0!==this.lastPinchFov},enumerable:!1,configurable:!0}),i.prototype.onPanGesture=function(e){var t=this;if(!this.tweenCoordinates){this.interiaMovement=!1;var i=this.lastPanPoint&&this.lastPanPoint.pointerLength===e.pointers.length?{x:e.center.x-this.lastPanPoint.x,y:e.center.y-this.lastPanPoint.y}:{x:0,y:0},n=this.relativeClientPosition(e.center),r=this.camera.pose.latitude<Math.PI/6||n.y<0?-1:1,s=this.coordinatesChangeWithOffset(this.camera.pose,{x:i.x*r,y:i.y}),o=s.longitude,a=s.latitude,u=this.calculateCameraPosition({longitude:o,latitude:a},this.cameraDistance(),null,!0),c=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","pan",c,e.isFinal)||this.emit("wantsPanGesture",{longitude:o,latitude:a,fov:this.camera.pose.fov,offset:u.clone()},e.isFinal)))if(this.updateCamera({longitude:o,latitude:a,offset:u},!0,!0),this.emit("gesture","pan",c,e.isFinal),this.emit("panGesture",this.camera.copyPose(),e.isFinal),this.lastPanPoint=e.isFinal?void 0:{pointerLength:e.pointers.length,x:e.center.x,y:e.center.y},e.isFinal)this.emit("wantsInteriaPan",this.camera.copyPose())||(this.interiaMovement=!0,et((function(i){var n=e.velocityX*i*r,s=e.velocityY*i,o=Math.sqrt(n*n+s*s);o>100&&(n=n/o*100,s=s/o*100),t.requestInteriaMovement({x:n,y:s},!0)})))}},i.prototype.onTapGesture=function(e){if(this.interiaMovement=!1,!this.tweenPosition){var t=this.relativeClientPosition(e.center),i=new a.Raycaster;i.setFromCamera(t,this.camera);var n=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","tap",n,!0)||this.emit("wantsTapGesture",i,t))){this.emit("gesture","tap",n,!0),this.emit("tapGesture",i,t);var r;Ve(r=this.getForwardPanoIndexOrNot(i))||(this.emit("panoSelected",r),this.emit("wantsMoveToPano",r,{longitude:this.camera.pose.longitude,latitude:0},!0))}}},i.prototype.onPinchGesture=function(e){this.interiaMovement=!1;var t=this.camera,i=this.lastPinchFov;if("pinchstart"===e.type)return delete this.lastPanPoint,void(this.lastPinchFov=t.fov);"pinchend"===e.type&&(delete this.lastPanPoint,delete this.lastPinchFov);var n="pinchend"===e.type;if(i){var r=i/e.scale,s=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(this.emit("wantsGesture","pinch",s,n)||this.emit("wantsPinchGesture",e.scale,r,n))return;this.updateCamera({fov:r},!0,!0),this.emit("gesture","pinch",s,n),this.emit("pinchGesture",e.scale,r,n)}},i.prototype.onMouseWheel=function(e){var t=this;this.interiaMovement=!1;var i=e.delta,n=this.minFov,r=this.maxFov,s=Math.max(n,Math.min(r,this.camera.fov-i)),o=[{x:e.clientX,y:e.clientY}];this.emit("wantsGesture","mouseWheel",o,!1)||this.emit("wantsMouseWheel",i,s,!1)||(this.updateCamera({fov:s},!0,!0),this.emit("gesture","mouseWheel",o,!1),this.emit("mouseWheel",i,s,!1),clearTimeout(this.onMouseWheelFinalInterval),this.onMouseWheelFinalInterval=window.setTimeout((function(){t.emit("wantsGesture","mouseWheel",o,!0)||t.emit("wantsMouseWheel",i,s,!0)||(t.emit("gesture","mouseWheel",o,!0),t.emit("mouseWheel",0,s,!0))}),200))},i}(en),nn=function(e){function i(t){var n=i.parseArgs(t);return e.call(this,n)||this}return t.__extends(i,e),i.parseArgs=function(i){var n=[t.__assign(t.__assign({},i.initial[0]),{longitude:0,latitude:Math.PI/2}),i.initial[1],i.initial[2]],r=t.__assign(t.__assign({},i),{initial:n,maxLatitude:Math.PI/2,minLatitude:Math.PI/2,defaultLongitude:0,defaultLatitude:Math.PI/2});return e.parseArgs.call(this,r)},i.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},i.prototype.initAnimation=function(t,i,n){var r=this;return e.prototype.initAnimation.call(this,t,i,n).then((function(){var e,t;if(!r.destroyed){var n=null!==(t=null===(e=r.model.getMaterial())||void 0===e?void 0:e.perspToOrtho)&&void 0!==t?t:0;if(0===i)r.model.setMaterial({perspToOrtho:1}),r.needsRender=!0;else var s=zi(250,ji.Linear.None).onUpdate((function(e){var t=e.progress;r.destroyed||(r.model.setMaterial({perspToOrtho:Ci(n,1,t)}),r.needsRender=!0)})).onComplete((function(){return s.destroy()}))}}))},i.prototype.resetModel=function(e,t){this.model=e,this.needsRender=!0;var i=this.calculateCameraPosition({longitude:this.defaultLongitude,latitude:this.defaultLatitude},this.cameraDistance(),null,!1);this.updateCamera({offset:i},t,!1)},i.prototype.getZoomOffsetFromFov=function(e,t,i){var n=new a.Vector3(0,-1,0),r=Math.tan(i/2*Math.PI/180),s=Math.tan(t.fov/2*Math.PI/180),o=(s-r)/s,u=new a.Raycaster;u.setFromCamera(e,t);var c=u.ray.direction,l=c.angleTo(n),h=this.cameraDistance(),d=h*Math.tan(l),A=c.clone().setLength(h*Math.cos(l)).projectOnPlane(n),p=A.length(),M=o/p*A.x*d,f=o/p*A.z*d;return new a.Vector3(M,0,f)},i.prototype.onPanGesture=function(e){if(!this.tweenCoordinates){var t=this.element,i=this.camera,n=i.fov,r=i.matrix,s=i.up,o=t.offsetHeight,u=this.lastPanPoint&&this.lastPanPoint.pointerLength===e.pointers.length?{x:e.center.x-this.lastPanPoint.x,y:e.center.y-this.lastPanPoint.y}:{x:0,y:0},c=this.camera.pose.offset.clone(),l=i.position.y*Math.tan(n/2*Math.PI/180);c.add(function(e,t){var i=new a.Vector3;return i.setFromMatrixColumn(t,0),i.multiplyScalar(-e),i}(2*u.x*l/o,r)),c.add(function(e,t,i){var n=new a.Vector3;return n.setFromMatrixColumn(i,0),n.crossVectors(t,n),n.multiplyScalar(e),n}(2*u.y*l/o,s,r));var h=this.model.bounding,d=h.getCenter(new a.Vector3),A=(h.max.x-h.min.x)/this.defaultFov*i.fov,p=(h.max.y,h.min.y,this.defaultFov,i.fov,(h.max.z-h.min.z)/this.defaultFov*i.fov);c.x=Math.max(d.x-A,Math.min(d.x+A,c.x)),c.z=Math.max(d.z-p,Math.min(d.z+p,c.z));var M=e.pointers.map((function(e){return{x:e.x,y:e.y}}));this.emit("wantsGesture","pan",M,e.isFinal)||this.emit("wantsPanGesture",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:c},e.isFinal)||(this.updateCamera({offset:c},!0,!0),this.emit("gesture","pan",M,e.isFinal),this.emit("panGesture",this.camera.copyPose(),e.isFinal),this.lastPanPoint=e.isFinal?void 0:{pointerLength:e.pointers.length,x:e.center.x,y:e.center.y})}},i.prototype.onMouseWheel=function(e){var t=this,i=e.delta,n=e.clientX,r=e.clientY,s=this.camera,o=this.minFov,a=this.maxFov,u=Math.max(o,Math.min(a,this.camera.fov-i)),c=[{x:e.clientX,y:e.clientY}];if(!(this.emit("wantsGesture","mouseWheel",c,!1)||this.emit("wantsMouseWheel",i,u,!1))){var l=this.relativeClientPosition({x:n,y:r}),h=this.getZoomOffsetFromFov(l,s,u),d=this.camera.pose.offset.clone().add(h);this.updateCamera({offset:d,fov:u},!0,!0),this.emit("gesture","mouseWheel",c,!1),this.emit("mouseWheel",i,u,!1),clearTimeout(this.onMouseWheelFinalInterval),this.onMouseWheelFinalInterval=window.setTimeout((function(){t.emit("wantsGesture","mouseWheel",c,!0)||t.emit("wantsMouseWheel",i,u,!0)||(t.emit("gesture","mouseWheel",c,!0),t.emit("mouseWheel",0,u,!0))}),200)}},i.prototype.onPinchGesture=function(e){var t=this.camera,i=this.lastPinchFov,n=e.scale,r=e.type,s=e.center,o=this.minFov,a=this.maxFov;if("pinchstart"===r)return delete this.lastPanPoint,void(this.lastPinchFov=t.fov);"pinchend"===r&&(delete this.lastPanPoint,delete this.lastPinchFov);var u="pinchend"===r;if(i){var c=i/n,l=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(this.emit("wantsGesture","pinch",l,u)||this.emit("wantsPinchGesture",n,c,u))return;c=Math.max(o,Math.min(a,c));var h=this.relativeClientPosition(s),d=this.getZoomOffsetFromFov(h,t,c),A=this.camera.pose.offset.clone().add(d);this.updateCamera({longitude:0,latitude:Math.PI/2,offset:A,fov:c},!0,!0),this.emit("gesture","pinch",l,u),this.emit("pinchGesture",n,c,u)}},i.prototype.__requestInteriaMovement=function(){},i}(tn),rn=[];function sn(e){return e.onload=e.onerror=He,e.crossOrigin="",/^blob\:/.test(e.src)&&URL.revokeObjectURL(e.src),e.removeAttribute("src"),e}function on(e){e instanceof a.Texture?e.dispose():(sn(e),-1===rn.indexOf(e)&&rn.push(e))}function an(e,t,i,n,r,s,o){if(void 0===e&&(e=""),void 0===t&&(t=He),void 0===i&&(i=He),void 0===n&&(n=He),void 0===r&&(r=He),/\.basis(\?|$)/.test(e)){var a=!1;Ze();var u=function(){!0!==a&&(r(),a=!0)};return new $t({allowHosts:s,networkSubscribe:o}).load(e,(function(e,i){!0!==a?(n(1),t(e,i),a=!0):e.dispose()}),(function(e,t,i){n(e)}),(function(t){!0!==a&&(i(new Error("source load error: "+e)),a=!0)})),{abort:u}}var c=!1,l=null,h=function(e){var r=e.body,s=e.meta,o=URL.createObjectURL(r),a=sn(rn.shift()||at());a.onload=function(){a.onload=a.onerror=He,!0!==c?(Ke((function(){return t(a,s)})),n(1),c=!0):on(a)},a.onerror=function(){a.onload=a.onerror=He,!0!==c&&(i(new Error("source load error: "+o)),c=!0),on(a)},a.src=o};u=function(){!0!==c&&(l?l.abort():(r(),c=!0))};return l=kt(e,{responseType:"blob",allowHosts:s,networkSubscribe:o},(function(e,t){if(l=null,!0!==c)return e instanceof St?(c=!0,r()):e?(c=!0,i(e)):void h(t)}),n),{abort:u}}var un=["right","left","up","down","front","back"];var cn=function(e){function i(t,i){void 0===i&&(i={});var n=e.call(this)||this;return n.renderer=t,n.allowHosts=i.allowHosts,n.networkSubscribe=i.networkSubscribe,n.prevRequest=null,n}return t.__extends(i,e),i.prototype.setAllowHosts=function(e){this.allowHosts=e},i.prototype.load=function(e,i){var n=this,r=l.digest(e),s=He,o=He,u=He,c=He;"function"==typeof i?(s=function(e){return i(null,e)},u=function(e){return i(e)},c=function(e){return i(e)}):(i.onLoad&&(s=i.onLoad),i.onProgress&&(o=i.onProgress),i.onError&&(u=i.onError),i.onAbort&&(c=i.onAbort)),this.abort();for(var h=[],d=function(){h.length=0,n.prevRequest=null},A=!1,p=function(i,o,u){if(A)on(i);else{M(1,u),h[u].image=i,h[u].meta=o;for(var c=0,l=h;c<l.length;c++){if(!l[c].image)return}var p=function(e){var i=new ot;i.generateMipmaps=!0;var n=i.dispose,r=e[0];r instanceof a.Texture?(i.format=r.format,i.encoding=r.encoding,i.minFilter=r.minFilter,i.magFilter=r.magFilter):i.minFilter=a.LinearFilter,r instanceof a.CompressedTexture&&(i.isCompressedTexture=!0);for(var s=0;s<e.length;s++)i.images[s]=e[s];return i.needsUpdate=!0,i.dispose=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var r=0,s=this.images;r<s.length;r++){var o=s[r];o&&on(o)}return this.images.length=[],n.call.apply(n,t.__spreadArray([this],e,!1))},i}(h.map((function(e){return e.image})));p.hash=r,p.meta=h.map((function(e){return e.meta})),A=!0,s(p),n.emit("load",p,e),d()}},M=function(t,i){h[i].progress=Math.max(h[i].progress,t);var r=h.reduce((function(e,t){return t.progress/h.length+e}),0);o(r),n.emit("progress",r,e)},f=function(t){var i=function(e,t){var i=t.index,n=void 0===i?0:i,r=t.images,s=void 0===r?{}:r,o=t.imageOptions,a=void 0===o?{}:o,u=s[e],c=["cube",n,e].join("."),l=$t.isInitialized();return Ut(u,Object.assign({key:c,basisLoaderInitialized:l},a))}(un[t],e);h[t]={source:i,progress:0,handler:{abort:He}},h[t].handler=an(i,(function(e,i){return p(e,i,t)}),(function(t){return function(t,i){if(!0!==A){u(t),n.emit("error",t,e);for(var r=0,s=h;r<s.length;r++){var o=s[r].image;o&&on(o)}A=!0,d()}}(t)}),(function(e){return M(e,t)}),(function(){return function(t){if(!0!==A){c(new Error("source load abort: "+h[t].source)),n.emit("abort",e);for(var i=0,r=h;i<r.length;i++){var s=r[i].image;s&&on(s)}A=!0,d()}}(t)}),g.allowHosts,g.networkSubscribe)},g=this,y=0;y<un.length;y++)f(y);this.prevRequest={abort:function(){for(var e=0,t=h;e<t.length;e++){t[e].handler.abort()}h.length=0}},this.emit("start",e)},i.prototype.abort=function(){this.prevRequest&&(this.prevRequest.abort(),this.prevRequest=null)},i}(xt),ln=function(e){function i(t,i){var n=e.call(this)||this;n.disposed=!1,n.size=t.clone(),n.image=new ImageData(new Uint8ClampedArray([0,0,0,0]),1,1),n.generateMipmaps=!0,n.unpackAlignment=1,n.needsUpdate=!0,n.wrapS=a.ClampToEdgeWrapping,n.wrapT=a.ClampToEdgeWrapping,n.minFilter=a.NearestFilter,n.magFilter=a.NearestFilter,n.renderer=i;var r=n.gl=i.getContext(),s=n.utils=a.WebGLUtils(r,i.extensions,i.capabilities);i.initTexture(n);var o=i.properties.get(n),u=r.getParameter(r.TEXTURE_BINDING_2D);return r.bindTexture(r.TEXTURE_2D,o.__webglTexture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.texImage2D(r.TEXTURE_2D,0,s.convert(n.format),t.x,t.y,0,s.convert(n.format),s.convert(n.type),null),r.bindTexture(r.TEXTURE_2D,u),n.update(n.image,new a.Vector2),n}return t.__extends(i,e),i.prototype.update=function(e,t){if(!this.disposed){var i=this;i.size;var n=i.gl,r=i.utils,s=i.renderer.properties.get(this);if(!s.__webglTexture)throw new Error("UpdatableTexture never initialized");var o=n.getParameter(n.TEXTURE_BINDING_2D);n.bindTexture(n.TEXTURE_2D,s.__webglTexture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.texSubImage2D(n.TEXTURE_2D,0,t.x,t.y,r.convert(this.format),r.convert(this.type),e),n.generateMipmap(n.TEXTURE_2D),n.bindTexture(n.TEXTURE_2D,o)}},i.prototype.dispose=function(){this.disposed=!0,e.prototype.dispose.call(this)},i}(a.Texture);function hn(e,t){return[Math.floor(e%t),Math.floor(e/t)]}var dn=new Qt,An=at();An.crossOrigin="";var pn=Promise.resolve(),Mn=function(e){function i(t){var i=e.call(this)||this;i.texutre=new ln(new a.Vector2(2048,2048),t),i.mappings=[];for(var n=Ze(),r=0;r<16;r++){var s=hn(r,4),o=s[0],u=s[1];i.mappings[r]={idle:!0,loaded:!0,resource:"",timestamp:n,clip:new a.Vector4(0,0,0,0),drawAt:new a.Vector4(o/4,u/4,1/4,1/4)}}return i}return t.__extends(i,e),i.prototype.requestResource=function(e){var t=this;pn=pn.then((function(){return new Promise((function(i){var n=function(){/^blob\:/.test(An.src)&&URL.revokeObjectURL(An.src),An.removeAttribute("src"),i()};dn.loadToImage(An,e,(function(){if(512!==An.width||512!==An.height)t.emit("error",new Error("tile image size must be 512 x 512."));else{var i=t.getMaddpingByResource(e);if(i&&!0!==i.loaded){i.loaded=!0;var r=new a.Vector2(2048*i.drawAt.x,2048*i.drawAt.y);t.texutre.update(An,r),t.emit("update",t.getVisibleMappings())}}n()}),(function(){}),n)}))}))},i.prototype.getMaddpingByResource=function(e){return this.mappings.filter((function(t){return e===t.resource}))[0]},i.prototype.getIdleMapping=function(){return this.mappings.filter((function(e){return e.idle})).sort((function(e,t){return e.timestamp-t.timestamp}))[0]},i.prototype.getHash=function(){return l.digest(this.getVisibleMappings().map((function(e){return e.map((function(e){return e.toArray()}))})))},i.prototype.cleanTiles=function(){for(var e=this.getHash(),t=0,i=this.mappings;t<i.length;t++){i[t].idle=!0}e!==this.getHash&&this.emit("update",this.getVisibleMappings())},i.prototype.loadTiles=function(e){var t=this.getHash(),i=Math.pow(4,2),n=Ze();e.length>i&&((e=e.slice()).length=i);for(var r=0,s=this.mappings;r<s.length;r++){(A=s[r]).idle=!0}for(var o=[],a=0,u=e;a<u.length;a++){var c=Ut((d=u[a]).resource);(A=this.getMaddpingByResource(c))?(A.idle=!1,A.timestamp=n):o.push(d)}for(var l=0,h=o;l<h.length;l++){var d,A;c=Ut((d=h[l]).resource);(A=this.getIdleMapping()).idle=!1,A.resource=c,A.clip=d.clip,A.loaded=!1,A.timestamp=n,this.requestResource(c)}t!==this.getHash&&this.emit("update",this.getVisibleMappings())},i.prototype.getVisibleMappings=function(){return this.mappings.map((function(e){var t=!1===e.idle&&!0===e.loaded?e.drawAt.clone():new a.Vector4(0,0,0,0);return[e.clip.clone(),t.clone()]}))},i.prototype.dispose=function(){this.emit("dispose"),this.mappings.length=0,this.texutre.dispose()},i}(xt);var fn=function(e){function i(){var t=e.call(this)||this,i=new a.RingBufferGeometry(.04,.08,32),n=new a.MeshBasicMaterial({color:1245179,opacity:.8,side:a.DoubleSide,transparent:!0});return t.ringMesh=new a.Mesh(i,n),t.ringMesh.renderOrder=10,t.add(t.ringMesh),t}return t.__extends(i,e),i.prototype.dispose=function(){this.remove(this.ringMesh),this.ringMesh.geometry.dispose(),Array.isArray(this.ringMesh.material)?this.ringMesh.material.forEach((function(e){return e.dispose()})):this.ringMesh.material.dispose()},i}(a.Object3D);function gn(){return new fn}var yn=function(e){function i(t){var n=this,r=i.parseArgs(t);return(n=e.call(this,r)||this).defaultLongitude=r.defaultLongitude,n.defaultLatitude=r.defaultLongitude,n.defaultFov=r.defaultFov,n.maxFov=r.maxFov,n.minFov=r.minFov,n.maxLatitude=r.maxLatitude,n.minLatitude=r.minLatitude,n.moveSpeed=r.moveSpeed,n.intersectMeshCreator=r.intersectMeshCreator,n.interiaMovement=!1,n.intersectMesh=n.intersectMeshCreator(),n.intersectMesh.name="intersect",n.intersectMesh.visible=!1,n.helper.add(n.intersectMesh),n}return t.__extends(i,e),i.parseArgs=function(i){var n,r,s,o,a,u,c,l,h,d=e.parseArgs.call(this,i);return t.__assign(t.__assign({},d),{defaultLongitude:null!==(n=i.defaultLongitude)&&void 0!==n?n:0,defaultLatitude:null!==(r=i.defaultLongitude)&&void 0!==r?r:0,defaultFov:null!==(s=i.defaultFov)&&void 0!==s?s:80,maxFov:null!==(o=i.maxFov)&&void 0!==o?o:120,minFov:null!==(a=i.minFov)&&void 0!==a?a:40,maxLatitude:null!==(u=i.maxLatitude)&&void 0!==u?u:+Math.PI/2,minLatitude:null!==(c=i.minLatitude)&&void 0!==c?c:-Math.PI/2,moveSpeed:null!==(l=i.moveSpeed)&&void 0!==l?l:3.2,intersectMeshCreator:null!==(h=i.intersectMeshCreator)&&void 0!==h?h:gn})},i.initAnimationEndPose=function(e){var t,i,n,r=this.parseArgs(e),s=e.initial[0];return{longitude:null!==(t=s.longitude)&&void 0!==t?t:r.defaultLongitude,latitude:null!==(i=s.latitude)&&void 0!==i?i:r.defaultLatitude,fov:null!==(n=s.fov)&&void 0!==n?n:r.defaultFov,offset:r.work.observers[r.panoIndex].position.clone()}},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.interiaMovement=!1,this.hideIntersectMesh(),this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose())},i.prototype.updateCamera=function(e,t,i){var n,r,s;void 0===e&&(e={});var o=this,a=o.minFov,u=o.maxFov,c=o.maxLatitude,l=o.minLatitude,h=null!==(n=e.longitude)&&void 0!==n?n:this.camera.pose.longitude,d=null!==(r=e.latitude)&&void 0!==r?r:this.camera.pose.latitude,A=void 0===e.fov||this.emit("wantsChangeCameraFov",e.fov)?this.camera.pose.fov:e.fov,p=null!==(s=e.offset)&&void 0!==s?s:this.camera.pose.offset;i&&(d=Math.max(l,Math.min(c,d)),A=Math.max(a,Math.min(u,A)));var M=h!==this.camera.pose.longitude||d!==this.camera.pose.latitude,f=A!==this.camera.pose.fov,g=!p.equals(this.camera.pose.offset);this.camera.setFromPose({longitude:h,latitude:d,fov:A,offset:p}),f&&this.emit("cameraFovUpdate",this.camera.pose.fov,t),M&&this.emit("cameraDirectionUpdate",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},t),g&&this.emit("cameraPositionUpdate",this.camera.pose.offset.clone(),t),(f||M||g)&&this.emit("cameraUpdate",this.camera.copyPose(),t),this.needsRender=!0,Ht()},i.prototype.calculateMovingDuration=function(e,t){switch(typeof e){case"function":return e(t,this.moveSpeed);case"number":return e;case"string":return Number(e);default:return Math.floor(Math.max(Math.min(t/this.moveSpeed*1e3,1500),500))}},i.prototype.initAnimation=function(e,t,i){var n,r,s,o=this;if(this.destroyed)return Promise.resolve();var a=null!==(n=e.longitude)&&void 0!==n?n:this.defaultLongitude,u=null!==(r=e.latitude)&&void 0!==r?r:this.defaultLatitude,c=null!==(s=e.fov)&&void 0!==s?s:this.defaultFov;return new Promise((function(e){o.moveToPano(o.currentPanoIndex,{longitude:a,latitude:u,fov:c,limit:!1,duration:t,moveStartCallback:function(e,t){o.preventPanGesture=!0,o.preventTapGesture=!0,o.emit("initAnimationWillStart",e,t,i)},moveEndCallback:function(t,n){o.preventPanGesture=!1,o.preventTapGesture=!1,e(),o.emit("initAnimationEnded",t,n,i)},moveCancelCallback:function(){o.preventPanGesture=!1,o.preventTapGesture=!1,e(),o.emit("initAnimationEnded",o.currentPanoIndex,o.camera.copyPose(),i)}},i)}))},i.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.emit("intersectionHidden"),this.needsRender=!0},i.prototype.coordinatesChangeWithOffset=function(e,t){var i=2*t.x/this.element.offsetWidth*this.camera.fov/95*this.camera.aspect,n=-2*t.y/this.element.offsetHeight*this.camera.fov/95;return{longitude:e.longitude+i,latitude:e.latitude+n}},i.prototype.requestInteriaMovement=function(e,t){var i=this;if(!1!==this.interiaMovement){var n=this.coordinatesChangeWithOffset(this.camera.pose,e),r=n.longitude,s=n.latitude;this.updateCamera({longitude:r,latitude:s},t,!0);var o=Math.abs(e.x)>1||Math.abs(e.y)>1;this.emit("interiaPan",this.camera.copyPose(),!o),o?Ke((function(){i.requestInteriaMovement({x:.9*e.x,y:.9*e.y*.7},t)})):this.interiaMovement=!1}},Object.defineProperty(i.prototype,"gesturing",{get:function(){return this.interiaMovement||void 0!==this.lastPanPoint||void 0!==this.lastPinchFov},enumerable:!1,configurable:!0}),i.prototype.onPanGesture=function(e){var t=this;this.interiaMovement=!1,this.hideIntersectMesh();var i=this.lastPanPoint&&this.lastPanPoint.pointerLength===e.pointers.length?{x:e.center.x-this.lastPanPoint.x,y:e.center.y-this.lastPanPoint.y}:{x:0,y:0},n=this.coordinatesChangeWithOffset(this.camera.pose,i),r=n.longitude,s=n.latitude;Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(s=this.camera.pose.latitude);var o=e.pointers.map((function(e){return{x:e.x,y:e.y}}));this.emit("wantsGesture","pan",o,e.isFinal)||this.emit("wantsPanGesture",this.camera.copyPose(),e.isFinal)||(this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.updateCamera({longitude:r,latitude:s},!0,!0),this.emit("gesture","pan",o,e.isFinal),this.emit("panGesture",this.camera.copyPose(),e.isFinal),this.lastPanPoint=e.isFinal?void 0:{pointerLength:e.pointers.length,x:e.center.x,y:e.center.y},e.isFinal&&(this.emit("wantsInteriaPan",this.camera.copyPose())||et((function(i){t.interiaMovement=!0;var n=e.velocityX*i,r=e.velocityY*i,s=Math.sqrt(n*n+r*r);s>100&&(n=n/s*100,r=r/s*100),Math.abs(r/n)<Math.tan(20/180*Math.PI)&&(r=0),t.requestInteriaMovement({x:n,y:r},!0)}))))},i.prototype.onPinchGesture=function(e){this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.interiaMovement=!1;var t=this.camera,i=this.lastPinchFov,n=e.scale,r=e.type;if("pinchstart"===r)return this.lastPinchFov=t.fov,void delete this.lastPanPoint;"pinchend"===r&&(delete this.lastPanPoint,delete this.lastPinchFov);var s="pinchend"===r;if(i){var o=i/n,a=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(this.emit("wantsGesture","pinch",a,s)||this.emit("wantsPinchGesture",n,o,s))return;this.updateCamera({fov:o},!0,!0),this.emit("gesture","pinch",a,s),this.emit("pinchGesture",n,o,s)}},i.prototype.onMouseWheel=function(e){var t=this;this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.interiaMovement=!1;var i=e.delta,n=this.minFov,r=this.maxFov,s=Math.max(n,Math.min(r,this.camera.fov-i)),o=[{x:e.clientX,y:e.clientY}];this.emit("wantsGesture","mouseWheel",o,!1)||this.emit("wantsMouseWheel",i,s,!1)||(this.updateCamera({fov:s},!0,!0),this.emit("gesture","mouseWheel",o,!1),this.emit("mouseWheel",i,s,!1),clearTimeout(this.onMouseWheelFinalInterval),this.onMouseWheelFinalInterval=window.setTimeout((function(){t.emit("wantsGesture","mouseWheel",o,!0)||t.emit("wantsMouseWheel",i,s,!0)||(t.emit("gesture","mouseWheel",o,!0),t.emit("mouseWheel",0,s,!0))}),200))},i.prototype.onMouseMove=function(e){var t=this,i=t.camera,n=t.model,r=t.intersectMesh,s=t.lastPanPoint;if(r&&!n.empty&&n.bvhs&&!0===n.bvhs.loaded&&!s){var o=this.relativeClientPosition({x:e.clientX,y:e.clientY}),u=new a.Raycaster;if(u.setFromCamera(o,i),this.emit("wantsShowIntersectionOnModel",u))return this.hideIntersectMesh(),void(this.needsRender=!0);var c=n.intersectRaycaster(u)[0];if(c&&c.face){var l=c.face.normal,h=l.clone().multiplyScalar(.05),d=c.point.clone().add(h);r.position.copy(d);var A=d.clone().add(h);if(r.lookAt(A),Math.abs(l.y)>.99){var p=i.pose.offset.clone().sub(d);r.rotation.z=-Math.atan2(p.z,p.x)}r.visible=!0,this.emit("intersectionOnModelUpdate",c,r),this.needsRender=!0}else this.hideIntersectMesh(),this.needsRender=!0;this.lastMouseMoveEvent={clientX:e.clientX,clientY:e.clientY}}},i.prototype.onMouseOut=function(){this.intersectMesh&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},i}(en),vn=at(),mn=new a.Texture(vn);vn.onload=function(){return mn.needsUpdate=!0},vn.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAR9JREFUOBF10kFOAzEMBdCZFhCbrrgAN+NqHIULsWKDKO3gF+VHoZpa+rXjfH87nq7btr0ty3KZ8FsxnHeQPL748lA/x0Jsq+AwYe0X8nDtGA33BEJUHIEKW/EorHOLI7BHNlkEbju38YkQAIRZxFkHz2HOirKDxNcIzG+fu/6oLiNmqc5ZrlwTeKyAgJF14tMZmSn87pBrxeX/CRABgk/dl1s+C18dio2Pp9nmCQru2UtdvN+7lI9AFsgb3zNMcSp8FF4LYs3UhLfOAvkDJffci8q1J/ByRLKnQ8gUJUFOd2SeZYliCxwiyJCxCbhUGFKF4zPm61hiq7sVyJnPmATyR5IzLSNyDNEFRCDnkAmA8U2RfCsIefYhDeKOQLv7A+l1ZTyjymNxAAAAAElFTkSuQmCC";var Nn=new a.RingBufferGeometry(.06,.07,32).rotateX(-Math.PI/2),Dn=new a.MeshBasicMaterial({map:mn,transparent:!0});function wn(){if("undefined"==typeof document){var e=new a.Texture;return Object.assign(e,{draw:function(e){},retain:!1,pool:!1})}var t=document.createElement("canvas"),i=512,n=256,r=190;t.setAttribute("width",String(i)),t.setAttribute("height",String(i));var s=new a.Texture(t),o=t.getContext("2d");if(!o)throw Error("cannot create canvas context");var u=o.createRadialGradient(n,n,150,n,n,0);function c(){var e=Math.PI/12,t=2*Math.PI/3;o&&(o.beginPath(),o.arc(n,n,r,0*t,1*t-e),o.stroke(),o.beginPath(),o.arc(n,n,r,1*t,2*t-e),o.stroke(),o.beginPath(),o.arc(n,n,r,2*t,3*t-e),o.stroke())}function l(e){o&&(o.clearRect(0,0,i,i),o.lineWidth=20,-1!==e&&(o.globalCompositeOperation="source-over",o.strokeStyle="rgba(255, 255, 255, 1)",c(),o.globalCompositeOperation="source-in",o.beginPath(),o.arc(n,n,r,0,2*Math.PI*e),o.strokeStyle="rgba(255, 255, 255, 1)",o.stroke(),o.globalCompositeOperation="source-over",o.strokeStyle="rgba(255, 255, 255, "+(e?.5:1)+")",c()),o.beginPath(),o.arc(n,n,150,0,2*Math.PI),o.closePath(),o.fillStyle=u,o.fill(),o.fillStyle="rgba(255, 255, 255, 0.01)",o.fillRect(0,0,i,i),s.needsUpdate=!0)}return u.addColorStop(0,"rgba(255, 255, 255, 1)"),u.addColorStop(.15,"rgba(255, 255, 255, 1)"),u.addColorStop(.15,"rgba(255, 255, 255, 0.5)"),u.addColorStop(.4,"rgba(255, 255, 255, 0.0)"),u.addColorStop(1,"rgba(255, 255, 255, 0.0)"),l(0),Object.assign(s,{draw:l,retain:!1,pool:!1})}var Tn=[];var xn=wn();xn.draw(0);var En=wn();En.draw(1);var jn=wn();jn.draw(-1);var In=new a.CircleBufferGeometry(.12,32).rotateX(-Math.PI/2);function zn(){return new a.Mesh(In,new a.MeshBasicMaterial({map:xn,transparent:!0}))}var bn=function(e){function i(){var t=e.call(this)||this;return t.needsRender=!0,t.loading=!1,t.disabled=!1,t.centerMesh=zn(),t.centerMesh.position.y+=.01,t.add(t.centerMesh),t.loadingMesh=new a.Mesh(Nn,Dn),t.loadingMesh.position.y+=.011,t}return t.__extends(i,e),i.prototype.setLoading=function(e){var t=this;this.loading=e,this.stopInterval&&this.stopInterval(),e?(this.add(this.loadingMesh),this.stopInterval=Je((function(){t.loadingMesh.rotateOnAxis(new a.Vector3(0,1,0),.1),t.needsRender=!0}))):this.remove(this.loadingMesh),this.needsRender=!0},i.prototype.setDisabled=function(e){function t(t){var i=t.map;!0===i.pool&&(i.retain=!1),t.map=e?jn:xn}this.disabled=e,Array.isArray(this.centerMesh.material)?this.centerMesh.material.forEach((function(e){t(e)})):t(this.centerMesh.material),this.needsRender=!0},i.prototype.setProgress=function(e){function t(e,t){var i=e.map;0===t||1===t?(!0===i.pool&&(i.retain=!1),0===t&&(e.map=xn),1===t&&(e.map=En)):(!0!==i.pool&&(e.map=function(){for(var e=0,t=Tn;e<t.length;e++){var i=t[e];if(!1===i.retain)return i}var n=wn();return n.pool=!0,n.retain=!0,Tn.push(n),n}()),e.map.draw(t))}this.setLoading(!1),this.setDisabled(!1),e=Math.max(0,Math.min(1,e)),Array.isArray(this.centerMesh.material)?this.centerMesh.material.forEach((function(i){t(i,e)})):t(this.centerMesh.material,e),this.needsRender=!0},i.prototype.setOpacity=function(e){Array.isArray(this.centerMesh.material)?this.centerMesh.material.forEach((function(t){t.opacity=e})):this.centerMesh.material.opacity=e,this.needsRender=!0},i.prototype.dispose=function(){this.setLoading(!1),this.remove(this.centerMesh),this.remove(this.loadingMesh),this.centerMesh.geometry.dispose(),Array.isArray(this.centerMesh.material)?this.centerMesh.material.forEach((function(e){e.dispose()})):this.centerMesh.material.dispose(),this.loadingMesh.geometry.dispose(),Array.isArray(this.loadingMesh.material)?this.loadingMesh.material.forEach((function(e){e.dispose()})):this.loadingMesh.material.dispose()},i}(a.Object3D);function Ln(){return new bn}function Sn(e){var t=Math.abs(Math.cos(e.latitude));return new a.Vector3(-Math.sin(e.longitude)*t,-Math.sin(e.latitude),-Math.cos(e.longitude)*t)}var On;var Cn=new a.OrthographicCamera(-1,1,1,-1,0,1),Pn=new a.BufferGeometry;Pn.setAttribute("position",new a.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),Pn.setAttribute("uv",new a.Float32BufferAttribute([0,2,0,0,2,0],2));var kn=new a.Mesh(Pn),Bn=new a.Scene;Bn.add(kn);for(var Un=function(){function e(e,t){var i;this.renderer=e,this.material=new a.ShaderMaterial({vertexShader:null!==(i=t.vertex)&&void 0!==i?i:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:t.fragment,uniforms:Object.assign({inputBuffer:new a.Uniform(null)},t.uniforms)})}return e.prototype.render=function(e,t){var i=this.renderer.getRenderTarget(),n=kn.material;this.material.uniforms.inputBuffer.value=e.texture,kn.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Bn,Cn),this.renderer.setRenderTarget(i),kn.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Qn=function(){function e(e){this.renderer=e,this.material=new a.ShaderMaterial({vertexShader:"\n void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n uniform vec3 inputValue;\n void main() {\n gl_FragColor = vec4(inputValue, 1.0);\n }\n ",uniforms:Object.assign({inputValue:new a.Uniform(new a.Vector3)})})}return e.prototype.render=function(e,t){var i=this.renderer.getRenderTarget(),n=kn.material;this.material.uniforms.inputValue.value.copy(e),kn.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Bn,Cn),this.renderer.setRenderTarget(i),kn.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),_n=function(e){function i(t){return e.call(this,t,{fragment:"\n uniform sampler2D inputBuffer;\n varying vec2 vUv;\n void main() {\n gl_FragColor = texture2D(inputBuffer, vUv);\n }\n "})||this}return t.__extends(i,e),i}(Un),Rn=function(e){function i(t){return e.call(this,t,{fragment:"\n #include <common>\n uniform sampler2D inputBuffer;\n varying vec2 vUv;\n void main() {\n float scale = 0.25;\n float u = (vUv.x - 0.5) * scale + 0.5;\n float v = (vUv.y - 0.5) * scale + 0.5;\n vec3 rgb = texture2D(inputBuffer, vec2(u, v)).rgb;\n float luminance = linearToRelativeLuminance(rgb) - 0.5;\n luminance = luminance / 2.0 + 0.5;\n gl_FragColor = vec4(luminance, luminance, luminance, 1.0);\n }\n "})||this}return t.__extends(i,e),i}(Un),Yn=function(e){function i(t,i){return void 0===i&&(i=.002),e.call(this,t,{uniforms:{targetBuffer:new a.Uniform(null),inputBuffer:new a.Uniform(null),step:new a.Uniform(i)},vertex:"\n void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",fragment:"\n uniform sampler2D targetBuffer;\n uniform sampler2D inputBuffer;\n uniform float step;\n void main() {\n float target = texture2D(targetBuffer, vec2(0.5, 0.5)).r;\n float current = texture2D(inputBuffer, vec2(0.5, 0.5)).r;\n\n float result;\n if (abs(target - current) < step) {\n result = target;\n } else if (target - current > 0.0) {\n result = current + step;\n } else {\n result = current - step;\n }\n gl_FragColor = vec4(result, result, result, 1.0);\n }\n "})||this}return t.__extends(i,e),Object.defineProperty(i.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(i.prototype,"step",{get:function(){return this.material.uniforms.step.value},set:function(e){this.material.uniforms.step.value=e},enumerable:!1,configurable:!0}),i}(Un),Fn=function(e){function i(t){return e.call(this,t,{uniforms:{inputBuffer:new a.Uniform(null),luminanceAdaptiveBUffer:new a.Uniform(null)},fragment:"\n #include <common>\n uniform sampler2D inputBuffer;\n uniform sampler2D luminanceAdaptiveBUffer;\n varying vec2 vUv;\n\n vec3 hsv2rgb(vec3 c) {\n const vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n }\n\n vec3 rgb2hsv(vec3 c) {\n const vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n\n float d = q.x - min(q.w, q.y);\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + 0.001)), d / (q.x + 0.001), q.x);\n }\n\n void main() {\n vec3 rgb = texture2D(inputBuffer, vUv).rgb;\n float luminance = linearToRelativeLuminance(rgb);\n float delta = (texture2D(luminanceAdaptiveBUffer, vec2(0.5, 0.5)).r - 0.5);\n vec3 hsv = rgb2hsv(rgb);\n if (delta > 0.0) {\n hsv.z -= delta * (1.0 - luminance);\n } else {\n hsv.z -= delta * luminance;\n }\n gl_FragColor = vec4(hsv2rgb(hsv), 1.0);\n }\n\n "})||this}return t.__extends(i,e),Object.defineProperty(i.prototype,"luminanceAdaptiveBUffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBUffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBUffer.value=e},enumerable:!1,configurable:!0}),i}(Un),Vn=function(){function e(e){this.enable=!0,this.renderer=e,this.valuePass=new Qn(this.renderer),this.copyPass=new _n(this.renderer),this.luminancePass=new Rn(this.renderer),this.nextStepPass=new Yn(this.renderer),this.luminanceAdaptivePass=new Fn(this.renderer)}return e.prototype.render=function(e){this.enable?(this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new a.WebGLRenderTarget(1,1,{encoding:this.renderer.outputEncoding}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e),this.luminancePass.render(e,this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new a.WebGLRenderTarget(1,1,{encoding:this.renderer.outputEncoding}),this.valuePass.render(new a.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new a.WebGLRenderTarget(1,1,{encoding:this.renderer.outputEncoding}),this.valuePass.render(new a.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.render(e)):this.copyPass.render(e)},e.prototype.dispose=function(){var e,t,i;null===(e=this.luminanceTargetBuffer)||void 0===e||e.dispose(),null===(t=this.luminancePrevBuffer)||void 0===t||t.dispose(),null===(i=this.luminanceNextBuffer)||void 0===i||i.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},e}(),Hn=(new a.Matrix4).makeRotationAxis(new a.Vector3(0,1,0),Math.PI),Gn=new a.Vector2(16,8),qn=[],Wn=0;Wn<Gn.x;Wn++)for(var Zn=0;Zn<Gn.y;Zn++){qn[Zn*Gn.x+Wn]=[];var Xn=Sn({longitude:2*Math.PI/Gn.x*(Wn+.5),latitude:Math.PI/Gn.y*(Zn+.5)-Math.PI/2});qn[Zn*Gn.x+Wn].push(Xn);for(var Kn=0;Kn<=8;Kn++)for(var Jn=0;Jn<=8;Jn++){var $n=Sn({longitude:2*Math.PI/Gn.x*(Wn+Kn/8),latitude:Math.PI/Gn.y*(Zn+Jn/8)-Math.PI/2});qn[Zn*Gn.x+Wn].push($n)}}var er=new a.MeshDistanceMaterial({nearDistance:0,farDistance:10}),tr=new a.Scene;tr.overrideMaterial=er;var ir=function(e){function i(t){var n=this,r=i.parseArgs(t);(n=e.call(this,r)||this).maxAccessibleDistance=r.maxAccessibleDistance,n.panoTapTriggerRadius=r.panoTapTriggerRadius,n.panoCircleMeshCreator=r.panoCircleMeshCreator;var s=n.model.getMaterial()||{},o=s.pano0Map,u=s.pano1Map;return u&&u!==o&&(n.model.setMaterial({pano1Map:o}),u.dispose()),n.boundingMesh=n.generateBoundingMesh(),n.boundingMesh.setMaterial(n.model.getMaterial()||{}),n.boundingMesh.name="bounding",n.boundingMesh.visible=!1,n.scene.add(n.boundingMesh),n.panoCircleMeshes=[],n.updatePanoCircleMeshes(),n.model.loaded||n.panoCircleMeshes.forEach((function(e){return e.visible=!1})),n.depthCamera=new a.CubeCamera(.01,10,new a.WebGLCubeRenderTarget(64)),r.enableLuminanceAdaptiveEffect&&(n.luminanceAdaptiveEffect=new Vn(n.renderer),n.luminanceAdaptiveEffect.enable=!1,n.postProcessing=function(e){var t;return null===(t=n.luminanceAdaptiveEffect)||void 0===t?void 0:t.render(e)}),n.cubeTextureLoader=new cn(n.renderer,{allowHosts:n.work.allowHosts,networkSubscribe:n.networkSubscribe}),n.cubeTextureLoader.on("start",(function(e){var t,i=e.index;null===(t=n.panoCircleMeshes[i])||void 0===t||t.setProgress(0),n.emit("textureStartLoad",i,n.work.observers[i])})),n.cubeTextureLoader.on("progress",(function(e,t){var i,r=t.index;null===(i=n.panoCircleMeshes[r])||void 0===i||i.setProgress(e),n.emit("textureLoading",e,r,n.work.observers[r])})),n.cubeTextureLoader.on("abort",(function(e){var t,i=e.index;null===(t=n.panoCircleMeshes[i])||void 0===t||t.setProgress(0),n.emit("textureAbort",i,n.work.observers[i])})),n.cubeTextureLoader.on("load",(function(e,t){var i,r=t.index;null===(i=n.panoCircleMeshes[r])||void 0===i||i.setProgress(1),n.emit("textureLoaded",r,n.work.observers[r],e.meta)})),n.cubeTextureLoader.on("error",(function(e,t){var i,r=t.index;null===(i=n.panoCircleMeshes[r])||void 0===i||i.setProgress(0),n.emit("textureError",e,r,n.work.observers[r]),n.emit("error",e)})),n.once("initAnimationWillStart",(function(){(new a.Box3).expandByObject(n.boundingMesh).containsPoint(n.camera.position)&&(n.boundingMesh.visible=!0),n.luminanceAdaptiveEffect&&(n.luminanceAdaptiveEffect.enable=!0)})),n}return t.__extends(i,e),i.parseArgs=function(i){var n,r,s,o,a=e.parseArgs.call(this,i);return t.__assign(t.__assign({},a),{enableLuminanceAdaptiveEffect:null!==(n=i.enableLuminanceAdaptiveEffect)&&void 0!==n&&n,maxAccessibleDistance:null!==(r=i.maxAccessibleDistance)&&void 0!==r?r:5,panoTapTriggerRadius:null!==(s=i.panoTapTriggerRadius)&&void 0!==s?s:1,panoCircleMeshCreator:null!==(o=i.panoCircleMeshCreator)&&void 0!==o?o:Ln})},i.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},i.prototype.getCurrentTileIndicesInCamera=function(){for(var e=this.work.observers[this.currentPanoIndex],t=(new a.Matrix4).compose(e.position,e.quaternion,new a.Vector3(-1,1,1)),i=this.camera.getWorldDirection(new a.Vector3),n=(new a.Matrix4).multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),r=(new a.Frustum).setFromProjectionMatrix(n),s=[],o=0;o<qn.length;o++)for(var u=0,c=qn[o];u<c.length;u++){var l=c[u];if(r.containsPoint(l.clone().applyMatrix4(t))){s.push(o);break}}return s.sort((function(e,t){return qn[e][0].angleTo(i)-qn[t][0].angleTo(i)})),s},i.prototype.tilingPanoIfNeeds=function(){var e,t=this,i=this.camera.pose.fov<=70,n=this.work.observers[this.currentPanoIndex],r=n.images.tiles;if(i&&r&&n.position.equals(this.camera.pose.offset)){this.tileTextureLoader||(this.tileTextureLoader=new Mn(this.renderer),this.tileTextureLoader.on("update",(function(e){t.setModelAndBoundingMaterial({panoTileMap:t.tileTextureLoader.texutre,panoTileMappings:e}),t.needsRender=!0})));for(var s=this.getCurrentTileIndicesInCamera(),o=[],u=0;u<Gn.x*Gn.y;u++)if(-1!==s.indexOf(u)){var c=Math.floor(u%Gn.x),l=Math.floor(u/Gn.x),h=new a.Vector4(c/Gn.x,l/Gn.y,1/Gn.x,1/Gn.y),d=r+"/row-"+(l+1)+"-column-"+(c+1)+".jpg";o.push({resource:d,clip:h})}this.tileTextureLoader.loadTiles(o)}else null===(e=this.tileTextureLoader)||void 0===e||e.cleanTiles()},i.prototype.updateWork=function(e,t,i,n){var r=this;this.ready=!1,this.work=e,this.currentPanoIndex=t.panoIndex,this.cubeTextureLoader.setAllowHosts(this.work.allowHosts);var s={},o=!0;return this.boundingMesh&&(s=this.boundingMesh.getMaterial()||{},o=this.boundingMesh.visible,this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.boundingMesh=this.generateBoundingMesh(!0),this.boundingMesh.name="bounding",this.boundingMesh.visible=o,this.boundingMesh.setMaterial(s),this.scene.add(this.boundingMesh),this.hideIntersectMesh(),this.moveToPano(t.panoIndex,{effect:"fade",duration:i,longitude:t.longitude,latitude:t.latitude,fov:t.fov,moveStartCallback:function(){return r.updatePanoCircleMeshes(!1)}},n),!0},i.prototype.updatePanoCircleMeshes=function(e){var t=this;void 0===e&&(e=!0);var i=[];this.panoCircleMeshes&&(this.panoCircleMeshes.forEach((function(e){e.loading&&i.push(e.panoIndex),t.helper.remove(e),e.dispose()})),this.panoCircleMeshes.length=0);var n=new a.Vector3(0,-1,0);this.panoCircleMeshes=this.work.observers.map((function(r,s){var o=t.panoCircleMeshCreator();if(o.position.copy(r.standingPosition),e&&t.model.loaded){var u=o.position.clone().add(new a.Vector3(0,1,0)),c=new a.Raycaster(u,n,0,1),l=t.model.intersectRaycaster(c)[0];l&&l.point.distanceTo(o.position)>.1&&(o.position.copy(l.point.clone()),o.needsRender=!0)}return o.name="panoCircle_"+s,o.panoIndex=s,t.helper.add(o),o.needsRender=!0,!1===r.active&&(o.setDisabled(!0),i.indexOf(s)>=0&&(o.setDisabled(!1),o.setLoading(!0))),o}));var r=this.work.observers[this.currentPanoIndex].visibleNodes;r=r.filter((function(e){var i=t.work.observers[e];return i.loadable||i.active})),this.panoCircleMeshes.forEach((function(e){e.visible=r.indexOf(e.panoIndex)>=0}));var s=this.camera.position;this.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(s);e.setOpacity(Math.min(1.5/t,1))}))},i.prototype.destroy=function(){var t,i,n,r,s=this;e.prototype.destroy.call(this),null===(t=this.luminanceAdaptiveEffect)||void 0===t||t.dispose(),this.cubeTextureLoader.off(),null===(i=this.tileTextureLoader)||void 0===i||i.dispose(),delete this.pendingLoadTextureHashAndCallback,this.boundingMesh&&(this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.panoCircleMeshes&&(this.panoCircleMeshes.forEach((function(e){s.helper.remove(e),e.dispose()})),this.panoCircleMeshes.length=0),this.interiaMovement=!1;var o=this.videoTexture.image;o.pause(),o.oncanplay=function(){},o.ontimeupdate=function(){};var u={pano0DepthMap:null,panoVideoMap:null,panoVideoSize:new a.Vector2,panoVideoMatrix:new a.Matrix4,panoVideoAlpha:0};this.setModelAndBoundingMaterial(u),null===(n=this.depthCamera)||void 0===n||n.renderTarget.texture.dispose(),null===(r=this.depthCamera)||void 0===r||r.renderTarget.dispose(),delete this.depthCamera},i.prototype.render=function(t){this.work.observers[this.currentPanoIndex].video&&(this.needsRender=!0),e.prototype.render.call(this,t)},i.prototype.generateBoundingMesh=function(e){void 0===e&&(e=!1);var t=this.model.bounding.clone();return this.work.observers.forEach((function(e){t.expandByPoint(e.standingPosition),t.expandByPoint((new a.Vector3).fromArray([e.position.x,2*e.position.y-e.standingPosition.y,e.position.z]))})),e&&t.expandByPoint(this.camera.pose.offset),Mt(t,new a.Vector3(1,0,1))},i.prototype.resetModel=function(e,t){var i=this;this.model=e;var n={};this.boundingMesh&&(n=this.boundingMesh.getMaterial()||{},this.boundingMesh.visible,this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.boundingMesh=this.generateBoundingMesh(),this.boundingMesh.visible=!0,this.boundingMesh.name="bounding",this.boundingMesh.setMaterial(n),this.scene.add(this.boundingMesh),this.needsRender=!0,Gt((function(){i.updatePanoCircleMeshes(),i.updateCamera({},t,!0),i.needsRender=!0}))},i.prototype.moveToPano=function(e,t,i){var n=this;this.ready=!1,this.interiaMovement=!1;var r={index:e,images:this.work.observers[e].images,imageOptions:this.imageOptions},s=l.digest(r),o=function(r,s){if(r)return t.moveCancelCallback&&t.moveCancelCallback(),n.emit("panoLoadError",r,e),n.emit("moveToPanoCanceled",e),void(n.ready=!0);var o=s;n.destroyed?o.dispose():(n.emit("panoLoaded",e),Ke((function(){return n.doMoveToPano(e,o,t,i)})))},a=this.pendingLoadTextureHashAndCallback||[],u=a[0],c=a[1];if(s!==u){if(delete this.pendingLoadTextureHashAndCallback,c&&c(new Error("texture aborted")),this.emit("moveToPano",e,i),this.emit("panoWillLoad",e),!r.images)return void o(new Error("pano images were not existed"));var h=this.getModelAndBoundingMaterial()||{},d=h.pano0Map,A=h.pano1Map,p=void 0;if(d&&d.hash===s?p=d:A&&A.hash===s&&(p=A),p)return void o(null,p);this.pendingLoadTextureHashAndCallback=[s,o],this.cubeTextureLoader.load(r,(function(e,t){var i=n.pendingLoadTextureHashAndCallback||[],r=i[0],o=i[1];s===r&&o?(o(e,t),delete n.pendingLoadTextureHashAndCallback):null==t||t.dispose()}))}},i.prototype.updateCamera=function(t,i,n){var r=this;void 0===t&&(t={}),e.prototype.updateCamera.call(this,t,i,n),this.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(r.camera.pose.offset);e.setOpacity(Math.min(1.5/t,1))}));var s=this.getForwardPanoIndexOrNot();null!==s&&this.panoCircleMeshes[s].setOpacity(1),this.needsRender=!0,Ht(),this.tilingPanoIfNeeds()},i.prototype.cannotMoveAnimation=function(){var e=this;if(this.interiaMovement=!1,!this.tweenCoordinates){var t=this.camera.fov,i=.98*t,n=function(t){var i=t.fov;e.updateCamera({fov:i},!0,!0)};this.tweenCoordinates=Ii({fov:t},{fov:i},200).onUpdate(n).onComplete((function(){var r;null===(r=e.tweenCoordinates)||void 0===r||r.destroy(),e.tweenCoordinates=Ii({fov:i},{fov:t},200).onUpdate(n).onComplete((function(){var t;null===(t=e.tweenCoordinates)||void 0===t||t.destroy(),delete e.tweenCoordinates}))}))}},i.prototype.getModelAndBoundingMaterial=function(){for(var e=0,t=[this.model,this.boundingMesh];e<t.length;e++){return t[e].getMaterial()}return null},i.prototype.setModelAndBoundingMaterial=function(e){for(var t=0,i=[this.model,this.boundingMesh];t<i.length;t++){i[t].setMaterial(e)}},i.prototype.doMoveToPano=function(e,t,i,n){var r,s,o,u,c,l,h,d,A,p,M,f=this;void 0===i&&(i={});var g=i.effect,y=void 0===g?"fly":g,v=i.limit,m=void 0===v||v,N=i.easing,D=void 0===N?ji.Quadratic.InOut:N,w=this.currentPanoIndex,T=this.work.observers[e],x=this.work.observers[w].accessibleNodes.indexOf(e)>=0,E=T.video,j=T.visibleNodes;j=j.filter((function(e){var t=f.work.observers[e];return t.loadable||t.active}));var I=this.calculateMovingDuration(i.duration,this.camera.pose.offset.distanceTo(T.standingPosition)),z=this.camera.pose.offset.clone(),b=null!==(s=null===(r=this.getModelAndBoundingMaterial())||void 0===r?void 0:r.modelAlpha)&&void 0!==s?s:0,L=null!==(u=null===(o=this.model.getMaterial())||void 0===o?void 0:o.perspToOrtho)&&void 0!==u?u:0,S=this.camera.pose.longitude,O=this.camera.pose.latitude,C=this.camera.pose.fov,P=T.position,k=null!==(l=null===(c=this.getModelAndBoundingMaterial())||void 0===c?void 0:c.pano0Matrix)&&void 0!==l?l:new a.Matrix4,B=(new a.Matrix4).compose(T.position,T.quaternion,new a.Vector3(-1,1,1)),U=null!==(h=i.longitude)&&void 0!==h?h:S,Q=null!==(d=i.latitude)&&void 0!==d?d:O,_=null!==(A=i.fov)&&void 0!==A?A:C,R={fov:_,longitude:U,latitude:Q,offset:P.clone()};this.tweenPosition&&(this.tweenPosition.destroy(),delete this.tweenPosition),this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),i.moveStartCallback&&i.moveStartCallback(e,R),this.emit("panoWillArrive",e,R,n),this.needsRender=!0,x&&(tr.add(this.model),er.referencePosition.copy(z),null===(p=this.depthCamera)||void 0===p||p.position.copy(z),null===(M=this.depthCamera)||void 0===M||M.update(this.renderer,tr),this.scene.add(this.model),this.scene.children.unshift(this.scene.children.pop()));var Y=function(){var r=f.getModelAndBoundingMaterial()||{},s=r.pano0Map,o=r.pano1Map;s&&s!==o&&s!==t&&s.dispose();var a={modelAlpha:0,perspToOrtho:0,pano0Matrix:B,pano0Map:t,pano0DepthMap:f.depthCamera?f.depthCamera.renderTarget.texture:null,pano1Matrix:B,pano1Map:t,progress:0};if(E&&Object.keys(E).length>0){var u=f.videoTexture.image;u.oncanplay=function(){u.oncanplay=function(){},u.currentTime=0,u.play(),f.setModelAndBoundingMaterial({panoVideoAlpha:0,panoVideoMap:f.videoTexture,panoVideoSize:E.size,panoVideoMatrix:Hn.clone().multiply(B).multiply(E.matrix)})},u.ontimeupdate=function(){if(u.currentTime>.5&&u.src===(null==E?void 0:E.source)){u.ontimeupdate=function(){};var e=zi(230,D).onUpdate((function(e){var t=e.progress;return f.setModelAndBoundingMaterial({panoVideoAlpha:t})})).onComplete((function(){return e.destroy()}))}};var c=u.playid=qe();(On||(On=new Promise((function(e){var t,i=document.createElement("video");i.muted=!0,i.src="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjM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AHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",i.addEventListener("timeupdate",(function n(){i.removeEventListener("timeupdate",n,!1),clearTimeout(t);var r=document.createElement("canvas");r.width=r.height=1;var s=r.getContext("2d");s?(s.drawImage(i,0,0,1,1),s.getImageData(0,0,1,1).data[3]>10?e(!0):e(!1)):e(!1)}),!1),i.addEventListener("canplay",(function e(){i.removeEventListener("canplay",e,!1),i.play()}),!1),t=window.setTimeout((function(){return e(!1)}),1e3)})))).then((function(e){e&&E&&u.playid===c&&(u.src=E.source)}))}f.setModelAndBoundingMaterial(a),f.panoCircleMeshes.forEach((function(e){e.visible=j.indexOf(e.panoIndex)>=0})),f.updateCamera({offset:P},n,m),f.panoCircleMeshes[e]&&f.panoCircleMeshes[e].setProgress(0),i.moveEndCallback&&i.moveEndCallback(e,f.camera.copyPose()),f.currentPanoIndex=e,f.preventTapGesture=!1,f.boundingMesh.visible=!0,Ke((function(){f.emit("panoArrived",e,f.camera.copyPose(),n),f.ready=!0})),f.needsRender=!0};if(this.preventTapGesture=!0,I){var F=this.videoTexture.image;F.pause(),F.removeAttribute("src"),F.oncanplay=function(){},F.ontimeupdate=function(){},this.videoTexture.needsUpdate=!0;var V=this.getModelAndBoundingMaterial()||{},H=V.pano0Map,G=V.pano1Map;G&&G!==H&&G!==t&&G.dispose();var q={pano1Matrix:B,pano1Map:t,pano0DepthMap:x&&this.depthCamera?this.depthCamera.renderTarget.texture:null,panoVideoMap:null,panoVideoSize:new a.Vector2,panoVideoMatrix:new a.Matrix4,panoVideoAlpha:0,useBlackTransition:"instant"===y};if("fade"===y){var W=k.clone();W.setPosition(P),q.pano0Matrix=W,z.copy(P),this.updateCamera({offset:P},n,m)}this.setModelAndBoundingMaterial(q),"fly"!==y&&this.panoCircleMeshes.forEach((function(e){return e.visible=!1})),this.renderer.compile(this.scene,this.camera),this.tweenPosition=zi(I,D).onUpdate((function(t){var i=t.progress;f.setModelAndBoundingMaterial({progress:i,modelAlpha:Ci(b,0,i),perspToOrtho:Ci(L,0,Math.min(5*i,1))});var r=new a.Vector3(Ci(z.x,P.x,i),Ci(z.y,P.y,i),Ci(z.z,P.z,i));f.updateCamera({offset:r},n,m),i>.9&&(f.preventTapGesture=!1),f.emit("movingToPano",e,w,i),"fly"===y?n&&f.lastMouseMoveEvent&&f.onMouseMove(f.lastMouseMoveEvent):f.hideIntersectMesh(),f.needsRender=!0})).onComplete((function(){f.tweenPosition&&(f.tweenPosition.completed=!0,f.tweenPosition.destroy()),delete f.tweenPosition,Y()})).onCancel((function(){i.moveCancelCallback&&i.moveCancelCallback()}))}else Y();if(S!==U||O!==Q||C!==_){var Z=function(e){var t=e.progress,i=Pi(S,U,t),r=Ci(O,Q,t),s=Ci(C,_,t);f.updateCamera({longitude:i,latitude:r,fov:s},n,m)},X=function(){return Z({progress:1})};I>0?this.tweenCoordinates=zi(I,D).onUpdate(Z).onComplete((function(){f.tweenCoordinates&&(f.tweenCoordinates.destroy(),delete f.tweenCoordinates),X()})):X()}},i.prototype.getForwardPanoIndexOrNot=function(e){var t=this,i=this.camera,n=this.currentPanoIndex,r=this.work.observers[n].accessibleNodes;r=r.filter((function(e){var i=t.work.observers[e];return i.loadable||i.active}));var s,o=i.getWorldDirection(new a.Vector3);s=e?e.ray.direction.clone():o.clone();var u=i.pose.offset.clone();if(s.y=u.y=0,0===s.length()||0===u.length())return null;for(var c=0,l=r.filter((function(e){var n=t.work.observers[e].standingPosition.clone().sub(i.pose.offset);return 0!==n.length()&&n.angleTo(o)<i.fov/2/180*Math.PI})).map((function(e){var i=t.work.observers[e].standingPosition.clone();return Object.assign(i,{y:0,panoIndex:e})})).sort((function(e,t){return e.distanceTo(u)-t.distanceTo(u)}));c<l.length;c++){var h=l[c],d=h.clone().sub(u);if(0!==d.length()&&s.angleTo(d)<Math.PI/6)return h.panoIndex}return null},i.prototype.onTapGesture=function(e){var i=this;if(this.interiaMovement=!1,!0!==this.preventTapGesture){var n=null,r=this.work.observers[this.currentPanoIndex],s=r.accessibleNodes.filter((function(e){return i.work.observers[e].position.distanceTo(i.camera.pose.offset)<i.maxAccessibleDistance})),o=this.relativeClientPosition(e.center),u=new a.Raycaster;u.setFromCamera(o,this.camera);var c=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","tap",c,!0)||this.emit("wantsTapGesture",u,o))){this.emit("gesture","tap",c,!0),this.emit("tapGesture",u,o);var l=this.camera.getWorldDirection(new a.Vector3).setY(0).normalize(),h=this.model.intersectRaycaster(u)[0];if(h){var d=Wi(s,(function(e){var t=i.work.observers[e].standingPosition.clone();return t.clone().sub(i.camera.pose.offset).setY(0).angleTo(l)>Math.PI/2?1/0:t.distanceTo(h.point)}),!0),A=d[0];d[1]<this.panoTapTriggerRadius&&(n=A)}if(Ve(n)&&(n=this.getForwardPanoIndexOrNot(u)),Ve(n))this.emit("panoSelected",null),this.cannotMoveAnimation();else{var p=this.work.observers[n];if(this.emit("panoSelected",n),p.active){for(var M=Math.PI/6,f=Math.PI/12,g=p.position.clone().setY(0).sub(r.position.clone().setY(0)).normalize(),y=g.clone().applyAxisAngle(new a.Vector3(0,1,0),M),v=g.clone().applyAxisAngle(new a.Vector3(0,1,0),-M),m=[],N=[],D=[],w=0,T=p.accessibleNodes;w<T.length;w++){if((A=T[w])!==this.currentPanoIndex&&A!==n){var x=this.work.observers[A].position.clone().setY(0).sub(p.position.clone().setY(0));g.angleTo(x)<M?D.push(x):y.angleTo(x)<M?m.push(x):v.angleTo(x)<M&&N.push(x)}}var E=(D.length>0?D:t.__spreadArray(t.__spreadArray([],m,!0),N,!0)).slice().sort((function(e,t){return e.angleTo(g)-t.angleTo(g)}))[0],j={};E&&E.angleTo(l)>f&&(j.longitude=Math.atan2(-E.x,-E.z)),this.emit("wantsMoveToPano",n,j,!0)}else this.panoCircleMeshes[n]&&(this.panoCircleMeshes[n].setDisabled(!1),this.panoCircleMeshes[n].setLoading(!0))}}}},i}(yn),nr=function(e,t){var i=void 0!==e?e:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e,t){return e(t={exports:{}},t.exports),t.exports}var s=function(){return/Android/i.test(t.userAgent)||/iPhone|iPad|iPod/i.test(t.userAgent)},o=function(e,t){for(var i=0,n=e.length;i<n;i++)t[i]=e[i]},a=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},u=n(r((function(n,r){
373
373
  /**
374
374
  * @license
375
375
  * cardboard-vr-display
@@ -448,7 +448,7 @@ function(e,t){for(var i=e.toByteArray(),n=0;n<i.length&&0==i[n];)++n;if(i.length
448
448
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
449
449
  * THE SOFTWARE.
450
450
  */
451
- !function(e,t){n.exports=t()}(0,(function(){var n,r,s,o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),u=function(){function e(e,t){var i=[],n=!0,r=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){r=!0,s=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=.001,l=1,h=function(e,t){return"data:"+e+","+encodeURIComponent(t)},d=function(e,t,i){return e+(t-e)*i},p=function(){var e=/iPad|iPhone|iPod/.test(t.platform);return function(){return e}}(),M=function(){var e=-1!==t.userAgent.indexOf("Version")&&-1!==t.userAgent.indexOf("Android")&&-1!==t.userAgent.indexOf("Chrome");return function(){return e}}(),f=function(){var e=/^((?!chrome|android).)*safari/i.test(t.userAgent);return function(){return e}}(),g=function(){var e=-1!==t.userAgent.indexOf("Firefox")&&-1!==t.userAgent.indexOf("Android");return function(){return e}}(),A=(n=t.userAgent.match(/.*Chrome\/([0-9]+)/),r=n?parseInt(n[1],10):null,function(){return r}),y=function(){var e=!1;return e=p()&&f()&&-1!==t.userAgent.indexOf("13_4"),function(){return e}}(),v=function(){var e=!1;if(65===A()){var i=t.userAgent.match(/.*Chrome\/([0-9\.]*)/);if(i){var n=i[1].split("."),r=u(n,4);r[0],r[1];var s=r[2],o=r[3];e=3325===parseInt(s,10)&&parseInt(o,10)<148}}return function(){return e}}(),m=function(){var e=-1!==t.userAgent.indexOf("R7 Build");return function(){return e}}(),N=function(){var t=90==e.orientation||-90==e.orientation;return m()?!t:t},D=function(e){return!(isNaN(e)||e<=c||e>l)},w=function(){return Math.max(e.screen.width,e.screen.height)*e.devicePixelRatio},T=function(){return Math.min(e.screen.width,e.screen.height)*e.devicePixelRatio},x=function(e){if(M())return!1;if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0},E=function(){if(document.exitFullscreen)document.exitFullscreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else{if(!document.msExitFullscreen)return!1;document.msExitFullscreen()}return!0},j=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},z=function(e,t,i,n){var r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,t),e.compileShader(r);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,i),e.compileShader(s);var o=e.createProgram();for(var a in e.attachShader(o,r),e.attachShader(o,s),n)e.bindAttribLocation(o,n[a],a);return e.linkProgram(o),e.deleteShader(r),e.deleteShader(s),o},I=function(e,t){for(var i={},n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),r="",s=0;s<n;s++)i[r=e.getActiveUniform(t,s).name.replace("[0]","")]=e.getUniformLocation(t,r);return i},b=function(e,t,i,n,r,s,o){var a=1/(t-i),u=1/(n-r),c=1/(s-o);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+i)*a,e[13]=(r+n)*u,e[14]=(o+s)*c,e[15]=1,e},L=function(){var i,n=!1;return i=t.userAgent||t.vendor||e.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4)))&&(n=!0),n},S=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},O=function(t){if(p()){var i=t.style.width,n=t.style.height;t.style.width=parseInt(i)+1+"px",t.style.height=parseInt(n)+"px",setTimeout((function(){t.style.width=i,t.style.height=n}),100)}e.canvas=t},C=function(){var e=Math.PI/180,t=.25*Math.PI;function i(i,n,r,s){var o=Math.tan(n?n.upDegrees*e:t),a=Math.tan(n?n.downDegrees*e:t),u=Math.tan(n?n.leftDegrees*e:t),c=Math.tan(n?n.rightDegrees*e:t),l=2/(u+c),h=2/(o+a);return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=h,i[6]=0,i[7]=0,i[8]=-(u-c)*l*.5,i[9]=(o-a)*h*.5,i[10]=s/(r-s),i[11]=-1,i[12]=0,i[13]=0,i[14]=s*r/(r-s),i[15]=0,i}function n(e,t,i){var n=t[0],r=t[1],s=t[2],o=t[3],a=n+n,u=r+r,c=s+s,l=n*a,h=n*u,d=n*c,p=r*u,M=r*c,f=s*c,g=o*a,A=o*u,y=o*c;return e[0]=1-(p+f),e[1]=h+y,e[2]=d-A,e[3]=0,e[4]=h-y,e[5]=1-(l+f),e[6]=M+g,e[7]=0,e[8]=d+A,e[9]=M-g,e[10]=1-(l+p),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function r(e,t,i){var n,r,s,o,a,u,c,l,h,d,p,M,f=i[0],g=i[1],A=i[2];return t===e?(e[12]=t[0]*f+t[4]*g+t[8]*A+t[12],e[13]=t[1]*f+t[5]*g+t[9]*A+t[13],e[14]=t[2]*f+t[6]*g+t[10]*A+t[14],e[15]=t[3]*f+t[7]*g+t[11]*A+t[15]):(n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],u=t[5],c=t[6],l=t[7],h=t[8],d=t[9],p=t[10],M=t[11],e[0]=n,e[1]=r,e[2]=s,e[3]=o,e[4]=a,e[5]=u,e[6]=c,e[7]=l,e[8]=h,e[9]=d,e[10]=p,e[11]=M,e[12]=n*f+a*g+h*A+t[12],e[13]=r*f+u*g+d*A+t[13],e[14]=s*f+c*g+p*A+t[14],e[15]=o*f+l*g+M*A+t[15]),e}function s(e,t){var i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],u=t[6],c=t[7],l=t[8],h=t[9],d=t[10],p=t[11],M=t[12],f=t[13],g=t[14],A=t[15],y=i*a-n*o,v=i*u-r*o,m=i*c-s*o,N=n*u-r*a,D=n*c-s*a,w=r*c-s*u,T=l*f-h*M,x=l*g-d*M,E=l*A-p*M,j=h*g-d*f,z=h*A-p*f,I=d*A-p*g,b=y*I-v*z+m*j+N*E-D*x+w*T;return b?(b=1/b,e[0]=(a*I-u*z+c*j)*b,e[1]=(r*z-n*I-s*j)*b,e[2]=(f*w-g*D+A*N)*b,e[3]=(d*D-h*w-p*N)*b,e[4]=(u*E-o*I-c*x)*b,e[5]=(i*I-r*E+s*x)*b,e[6]=(g*m-M*w-A*v)*b,e[7]=(l*w-d*m+p*v)*b,e[8]=(o*z-a*E+c*T)*b,e[9]=(n*E-i*z-s*T)*b,e[10]=(M*D-f*m+A*y)*b,e[11]=(h*m-l*D-p*y)*b,e[12]=(a*x-o*j-u*T)*b,e[13]=(i*j-n*x+r*T)*b,e[14]=(f*v-M*N-g*y)*b,e[15]=(l*N-h*v+d*y)*b,e):null}var o=new Float32Array([0,0,0,1]),a=new Float32Array([0,0,0]);function u(e,t,u,c,l,h){i(e,c||null,h.depthNear,h.depthFar),n(t,u.orientation||o,u.position||a),l&&r(t,t,l),s(t,t)}return function(e,t,i){return!(!e||!t||(e.pose=t,e.timestamp=t.timestamp,u(e.leftProjectionMatrix,e.leftViewMatrix,t,i._getFieldOfView("left"),i._getEyeOffset("left"),i),u(e.rightProjectionMatrix,e.rightViewMatrix,t,i._getFieldOfView("right"),i._getEyeOffset("right"),i),0))}}(),P=function(){var t=e.self!==e.top,i=k(document.referrer),n=k(e.location.href);return t&&i!==n},k=function(e){var t,i=e.indexOf("://");t=-1!==i?i+3:0;var n=e.indexOf("/",t);return-1===n&&(n=e.length),e.substring(0,n)},U=function(e){return e.w>1?(console.warn("getQuaternionAngle: w > 1"),0):2*Math.acos(e.w)},B=(s={},function(e,t){void 0===s[e]&&(console.warn("webvr-polyfill: "+t),s[e]=!0)}),_=function(e,t){B(e,e+" has been deprecated. This may not work on native WebVR displays. "+(t?"Please use "+t+" instead.":""))};function R(e,t,i){if(t){for(var n=[],r=null,s=0;s<t.length;++s)switch(o=t[s]){case e.TEXTURE_BINDING_2D:case e.TEXTURE_BINDING_CUBE_MAP:if((u=t[++s])<e.TEXTURE0||u>e.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),n.push(null,null);break}r||(r=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(u),n.push(e.getParameter(o),null);break;case e.ACTIVE_TEXTURE:r=e.getParameter(e.ACTIVE_TEXTURE),n.push(null);break;default:n.push(e.getParameter(o))}for(i(e),s=0;s<t.length;++s){var o=t[s],a=n[s];switch(o){case e.ACTIVE_TEXTURE:break;case e.ARRAY_BUFFER_BINDING:e.bindBuffer(e.ARRAY_BUFFER,a);break;case e.COLOR_CLEAR_VALUE:e.clearColor(a[0],a[1],a[2],a[3]);break;case e.COLOR_WRITEMASK:e.colorMask(a[0],a[1],a[2],a[3]);break;case e.CURRENT_PROGRAM:e.useProgram(a);break;case e.ELEMENT_ARRAY_BUFFER_BINDING:e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,a);break;case e.FRAMEBUFFER_BINDING:e.bindFramebuffer(e.FRAMEBUFFER,a);break;case e.RENDERBUFFER_BINDING:e.bindRenderbuffer(e.RENDERBUFFER,a);break;case e.TEXTURE_BINDING_2D:if((u=t[++s])<e.TEXTURE0||u>e.TEXTURE31)break;e.activeTexture(u),e.bindTexture(e.TEXTURE_2D,a);break;case e.TEXTURE_BINDING_CUBE_MAP:var u;if((u=t[++s])<e.TEXTURE0||u>e.TEXTURE31)break;e.activeTexture(u),e.bindTexture(e.TEXTURE_CUBE_MAP,a);break;case e.VIEWPORT:e.viewport(a[0],a[1],a[2],a[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:a?e.enable(o):e.disable(o);break;default:console.log("No GL restore behavior for 0x"+o.toString(16))}r&&e.activeTexture(r)}}else i(e)}var Q=R,Y=["attribute vec2 position;","attribute vec3 texCoord;","varying vec2 vTexCoord;","uniform vec4 viewportOffsetScale[2];","void main() {"," vec4 viewport = viewportOffsetScale[int(texCoord.z)];"," vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;"," gl_Position = vec4( position, 1.0, 1.0 );","}"].join("\n"),F=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");function V(e,t,i,n){this.gl=e,this.cardboardUI=t,this.bufferScale=i,this.dirtySubmitFrameBindings=n,this.ctxAttribs=e.getContextAttributes(),this.instanceExt=e.getExtension("ANGLE_instanced_arrays"),this.meshWidth=20,this.meshHeight=20,this.bufferWidth=e.drawingBufferWidth,this.bufferHeight=e.drawingBufferHeight,this.realBindFramebuffer=e.bindFramebuffer,this.realEnable=e.enable,this.realDisable=e.disable,this.realColorMask=e.colorMask,this.realClearColor=e.clearColor,this.realViewport=e.viewport,p()||(this.realCanvasWidth=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"width"),this.realCanvasHeight=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"height")),this.isPatched=!1,this.lastBoundFramebuffer=null,this.cullFace=!1,this.depthTest=!1,this.blend=!1,this.scissorTest=!1,this.stencilTest=!1,this.viewport=[0,0,0,0],this.colorMask=[!0,!0,!0,!0],this.clearColor=[0,0,0,0],this.attribs={position:0,texCoord:1},this.program=z(e,Y,F,this.attribs),this.uniforms=I(e,this.program),this.viewportOffsetScale=new Float32Array(8),this.setTextureBounds(),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.indexCount=0,this.renderTarget=e.createTexture(),this.framebuffer=e.createFramebuffer(),this.depthStencilBuffer=null,this.depthBuffer=null,this.stencilBuffer=null,this.ctxAttribs.depth&&this.ctxAttribs.stencil?this.depthStencilBuffer=e.createRenderbuffer():this.ctxAttribs.depth?this.depthBuffer=e.createRenderbuffer():this.ctxAttribs.stencil&&(this.stencilBuffer=e.createRenderbuffer()),this.patch(),this.onResize()}V.prototype.destroy=function(){var e=this.gl;this.unpatch(),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer),e.deleteTexture(this.renderTarget),e.deleteFramebuffer(this.framebuffer),this.depthStencilBuffer&&e.deleteRenderbuffer(this.depthStencilBuffer),this.depthBuffer&&e.deleteRenderbuffer(this.depthBuffer),this.stencilBuffer&&e.deleteRenderbuffer(this.stencilBuffer),this.cardboardUI&&this.cardboardUI.destroy()},V.prototype.onResize=function(){var e=this.gl,t=this,i=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];Q(e,i,(function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.framebuffer),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.texImage2D(e.TEXTURE_2D,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,t.bufferWidth,t.bufferHeight,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.renderTarget,0),t.ctxAttribs.depth&&t.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t.depthStencilBuffer)):t.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t.depthBuffer)):t.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,t.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,t.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),t.realClearColor.apply(e,t.clearColor)})),this.cardboardUI&&this.cardboardUI.onResize()},V.prototype.patch=function(){if(!this.isPatched){var e=this,t=this.gl.canvas,i=this.gl;p()||(t.width=w()*this.bufferScale,t.height=T()*this.bufferScale,Object.defineProperty(t,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(i){e.bufferWidth=i,e.realCanvasWidth.set.call(t,i),e.onResize()}}),Object.defineProperty(t,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(i){e.bufferHeight=i,e.realCanvasHeight.set.call(t,i),e.onResize()}})),this.lastBoundFramebuffer=i.getParameter(i.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(i.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(t,n){e.lastBoundFramebuffer=n||e.framebuffer,e.realBindFramebuffer.call(i,t,e.lastBoundFramebuffer)},this.cullFace=i.getParameter(i.CULL_FACE),this.depthTest=i.getParameter(i.DEPTH_TEST),this.blend=i.getParameter(i.BLEND),this.scissorTest=i.getParameter(i.SCISSOR_TEST),this.stencilTest=i.getParameter(i.STENCIL_TEST),i.enable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!0;break;case i.DEPTH_TEST:e.depthTest=!0;break;case i.BLEND:e.blend=!0;break;case i.SCISSOR_TEST:e.scissorTest=!0;break;case i.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(i,t)},i.disable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!1;break;case i.DEPTH_TEST:e.depthTest=!1;break;case i.BLEND:e.blend=!1;break;case i.SCISSOR_TEST:e.scissorTest=!1;break;case i.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(i,t)},this.colorMask=i.getParameter(i.COLOR_WRITEMASK),i.colorMask=function(t,n,r,s){e.colorMask[0]=t,e.colorMask[1]=n,e.colorMask[2]=r,e.colorMask[3]=s,e.realColorMask.call(i,t,n,r,s)},this.clearColor=i.getParameter(i.COLOR_CLEAR_VALUE),i.clearColor=function(t,n,r,s){e.clearColor[0]=t,e.clearColor[1]=n,e.clearColor[2]=r,e.clearColor[3]=s,e.realClearColor.call(i,t,n,r,s)},this.viewport=i.getParameter(i.VIEWPORT),i.viewport=function(t,n,r,s){e.viewport[0]=t,e.viewport[1]=n,e.viewport[2]=r,e.viewport[3]=s,e.realViewport.call(i,t,n,r,s)},this.isPatched=!0,O(t)}},V.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,t=this.gl.canvas;p()||(Object.defineProperty(t,"width",this.realCanvasWidth),Object.defineProperty(t,"height",this.realCanvasHeight)),t.width=this.bufferWidth,t.height=this.bufferHeight,e.bindFramebuffer=this.realBindFramebuffer,e.enable=this.realEnable,e.disable=this.realDisable,e.colorMask=this.realColorMask,e.clearColor=this.realClearColor,e.viewport=this.realViewport,this.lastBoundFramebuffer==this.framebuffer&&e.bindFramebuffer(e.FRAMEBUFFER,null),this.isPatched=!1,setTimeout((function(){O(t)}),1)}},V.prototype.setTextureBounds=function(e,t){e||(e=[0,0,.5,1]),t||(t=[.5,0,.5,1]),this.viewportOffsetScale[0]=e[0],this.viewportOffsetScale[1]=e[1],this.viewportOffsetScale[2]=e[2],this.viewportOffsetScale[3]=e[3],this.viewportOffsetScale[4]=t[0],this.viewportOffsetScale[5]=t[1],this.viewportOffsetScale[6]=t[2],this.viewportOffsetScale[7]=t[3]},V.prototype.submitFrame=function(){var e=this.gl,t=this,i=[];if(this.dirtySubmitFrameBindings||i.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),Q(e,i,(function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null);var i=0,n=0;t.instanceExt&&(i=e.getVertexAttrib(t.attribs.position,t.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE),n=e.getVertexAttrib(t.attribs.texCoord,t.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)),t.cullFace&&t.realDisable.call(e,e.CULL_FACE),t.depthTest&&t.realDisable.call(e,e.DEPTH_TEST),t.blend&&t.realDisable.call(e,e.BLEND),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realDisable.call(e,e.STENCIL_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(t.ctxAttribs.alpha||p())&&(t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(t.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.enableVertexAttribArray(t.attribs.position),e.enableVertexAttribArray(t.attribs.texCoord),e.vertexAttribPointer(t.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(t.attribs.texCoord,3,e.FLOAT,!1,20,8),t.instanceExt&&(0!=i&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.position,0),0!=n&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.texCoord,0)),e.activeTexture(e.TEXTURE0),e.uniform1i(t.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.uniform4fv(t.uniforms.viewportOffsetScale,t.viewportOffsetScale),e.drawElements(e.TRIANGLES,t.indexCount,e.UNSIGNED_SHORT,0),t.cardboardUI&&t.cardboardUI.renderNoState(),t.realBindFramebuffer.call(t.gl,e.FRAMEBUFFER,t.framebuffer),t.ctxAttribs.preserveDrawingBuffer||(t.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),t.dirtySubmitFrameBindings||t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.cullFace&&t.realEnable.call(e,e.CULL_FACE),t.depthTest&&t.realEnable.call(e,e.DEPTH_TEST),t.blend&&t.realEnable.call(e,e.BLEND),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realEnable.call(e,e.STENCIL_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),!t.ctxAttribs.alpha&&t.ctxAttribs.preserveDrawingBuffer||t.realClearColor.apply(e,t.clearColor),t.instanceExt&&(0!=i&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.position,i),0!=n&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.texCoord,n))})),p()){var n=e.canvas;n.width==t.bufferWidth&&n.height==t.bufferHeight||(t.bufferWidth=n.width,t.bufferHeight=n.height,t.onResize())}},V.prototype.updateDeviceInfo=function(e){var t=this.gl,i=this,n=[t.ARRAY_BUFFER_BINDING,t.ELEMENT_ARRAY_BUFFER_BINDING];Q(t,n,(function(t){var n=i.computeMeshVertices_(i.meshWidth,i.meshHeight,e);if(t.bindBuffer(t.ARRAY_BUFFER,i.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,n,t.STATIC_DRAW),!i.indexCount){var r=i.computeMeshIndices_(i.meshWidth,i.meshHeight);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,r,t.STATIC_DRAW),i.indexCount=r.length}}))},V.prototype.computeMeshVertices_=function(e,t,i){for(var n=new Float32Array(2*e*t*5),r=i.getLeftEyeVisibleTanAngles(),s=i.getLeftEyeNoLensTanAngles(),o=i.getLeftEyeVisibleScreenRect(s),a=0,u=0;u<2;u++){for(var c=0;c<t;c++)for(var l=0;l<e;l++,a++){var h=l/(e-1),p=c/(t-1),M=h,f=p,g=d(r[0],r[2],h),A=d(r[3],r[1],p),y=Math.sqrt(g*g+A*A),v=i.distortion.distortInverse(y),m=A*v/y;h=(g*v/y-s[0])/(s[2]-s[0]),p=(m-s[3])/(s[1]-s[3]),h=2*(o.x+h*o.width-.5),p=2*(o.y+p*o.height-.5),n[5*a+0]=h,n[5*a+1]=p,n[5*a+2]=M,n[5*a+3]=f,n[5*a+4]=u}var N=r[2]-r[0];r[0]=-(N+r[0]),r[2]=N-r[2],N=s[2]-s[0],s[0]=-(N+s[0]),s[2]=N-s[2],o.x=1-(o.x+o.width)}return n},V.prototype.computeMeshIndices_=function(e,t){for(var i=new Uint16Array(2*(e-1)*(t-1)*6),n=e/2,r=t/2,s=0,o=0,a=0;a<2;a++)for(var u=0;u<t;u++)for(var c=0;c<e;c++,s++)0!=c&&0!=u&&(c<=n==u<=r?(i[o++]=s,i[o++]=s-e-1,i[o++]=s-e,i[o++]=s-e-1,i[o++]=s,i[o++]=s-1):(i[o++]=s-1,i[o++]=s-e,i[o++]=s,i[o++]=s-e,i[o++]=s-1,i[o++]=s-e-1));return i},V.prototype.getOwnPropertyDescriptor_=function(e,t){var i=Object.getOwnPropertyDescriptor(e,t);return void 0!==i.get&&void 0!==i.set||(i.configurable=!0,i.enumerable=!0,i.get=function(){return this.getAttribute(t)},i.set=function(e){this.setAttribute(t,e)}),i};var H=["attribute vec2 position;","uniform mat4 projectionMat;","void main() {"," gl_Position = projectionMat * vec4( position, -1.0, 1.0 );","}"].join("\n"),G=["precision mediump float;","uniform vec4 color;","void main() {"," gl_FragColor = color;","}"].join("\n"),q=Math.PI/180,W=60,K=12,Z=20,X=1,J=.75,$=.3125,ee=4,te=28,ie=1.5;function ne(e){this.gl=e,this.attribs={position:0},this.program=z(e,H,G,this.attribs),this.uniforms=I(e,this.program),this.vertexBuffer=e.createBuffer(),this.gearOffset=0,this.gearVertexCount=0,this.arrowOffset=0,this.arrowVertexCount=0,this.projMat=new Float32Array(16),this.listener=null,this.onResize()}function re(e){this.coefficients=e}ne.prototype.destroy=function(){var e=this.gl;this.listener&&e.canvas.removeEventListener("click",this.listener,!1),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer)},ne.prototype.listen=function(e,t){var i=this.gl.canvas;this.listener=function(n){var r=i.clientWidth/2,s=te*ie;n.clientX>r-s&&n.clientX<r+s&&n.clientY>i.clientHeight-s?e(n):n.clientX<s&&n.clientY<s&&t(n)},i.addEventListener("click",this.listener,!1)},ne.prototype.onResize=function(){var t=this.gl,i=this,n=[t.ARRAY_BUFFER_BINDING];Q(t,n,(function(t){var n=[],r=t.drawingBufferWidth/2,s=Math.max(screen.width,screen.height)*e.devicePixelRatio,o=t.drawingBufferWidth/s*e.devicePixelRatio,a=ee*o/2,u=te*ie*o,c=te*o/2,l=(te*ie-te)*o;function h(e,t){var i=(90-e)*q,s=Math.cos(i),o=Math.sin(i);n.push($*s*c+r,$*o*c+c),n.push(t*s*c+r,t*o*c+c)}n.push(r-a,u),n.push(r-a,t.drawingBufferHeight),n.push(r+a,u),n.push(r+a,t.drawingBufferHeight),i.gearOffset=n.length/2;for(var d=0;d<=6;d++){var p=d*W;h(p,X),h(p+K,X),h(p+Z,J),h(p+(W-Z),J),h(p+(W-K),X)}function M(e,i){n.push(l+e,t.drawingBufferHeight-l-i)}i.gearVertexCount=n.length/2-i.gearOffset,i.arrowOffset=n.length/2;var f=a/Math.sin(45*q);M(0,c),M(c,0),M(c+f,f),M(f,c+f),M(f,c-f),M(0,c),M(c,2*c),M(c+f,2*c-f),M(f,c-f),M(0,c),M(f,c-a),M(te*o,c-a),M(f,c+a),M(te*o,c+a),i.arrowVertexCount=n.length/2-i.arrowOffset,t.bindBuffer(t.ARRAY_BUFFER,i.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,new Float32Array(n),t.STATIC_DRAW)}))},ne.prototype.render=function(){var e=this.gl,t=this,i=[e.CULL_FACE,e.DEPTH_TEST,e.BLEND,e.SCISSOR_TEST,e.STENCIL_TEST,e.COLOR_WRITEMASK,e.VIEWPORT,e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING];Q(e,i,(function(e){e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.BLEND),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.colorMask(!0,!0,!0,!0),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.renderNoState()}))},ne.prototype.renderNoState=function(){var e=this.gl;e.useProgram(this.program),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.enableVertexAttribArray(this.attribs.position),e.vertexAttribPointer(this.attribs.position,2,e.FLOAT,!1,8,0),e.uniform4f(this.uniforms.color,1,1,1,1),b(this.projMat,0,e.drawingBufferWidth,0,e.drawingBufferHeight,.1,1024),e.uniformMatrix4fv(this.uniforms.projectionMat,!1,this.projMat),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.drawArrays(e.TRIANGLE_STRIP,this.gearOffset,this.gearVertexCount),e.drawArrays(e.TRIANGLE_STRIP,this.arrowOffset,this.arrowVertexCount)},re.prototype.distortInverse=function(e){for(var t=0,i=1,n=e-this.distort(t);Math.abs(i-t)>1e-4;){var r=e-this.distort(i),s=i-r*((i-t)/(r-n));t=i,i=s,n=r}return i},re.prototype.distort=function(e){for(var t=e*e,i=0,n=0;n<this.coefficients.length;n++)i=t*(i+this.coefficients[n]);return(i+1)*e};var se=Math.PI/180,oe=180/Math.PI,ae=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0};ae.prototype={constructor:ae,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){var e=this.length();if(0!==e){var t=1/e;this.multiplyScalar(t)}else this.x=0,this.y=0,this.z=0;return this},multiplyScalar:function(e){this.x*=e,this.y*=e,this.z*=e},applyQuaternion:function(e){var t=this.x,i=this.y,n=this.z,r=e.x,s=e.y,o=e.z,a=e.w,u=a*t+s*n-o*i,c=a*i+o*t-r*n,l=a*n+r*i-s*t,h=-r*t-s*i-o*n;return this.x=u*a+h*-r+c*-o-l*-s,this.y=c*a+h*-s+l*-r-u*-o,this.z=l*a+h*-o+u*-s-c*-r,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},crossVectors:function(e,t){var i=e.x,n=e.y,r=e.z,s=t.x,o=t.y,a=t.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this}};var ue,ce,le,he=function(e,t,i,n){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==n?n:1};function de(e){this.width=e.width||w(),this.height=e.height||T(),this.widthMeters=e.widthMeters,this.heightMeters=e.heightMeters,this.bevelMeters=e.bevelMeters}he.prototype={constructor:he,set:function(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},setFromEulerXYZ:function(e,t,i){var n=Math.cos(e/2),r=Math.cos(t/2),s=Math.cos(i/2),o=Math.sin(e/2),a=Math.sin(t/2),u=Math.sin(i/2);return this.x=o*r*s+n*a*u,this.y=n*a*s-o*r*u,this.z=n*r*u+o*a*s,this.w=n*r*s-o*a*u,this},setFromEulerYXZ:function(e,t,i){var n=Math.cos(e/2),r=Math.cos(t/2),s=Math.cos(i/2),o=Math.sin(e/2),a=Math.sin(t/2),u=Math.sin(i/2);return this.x=o*r*s+n*a*u,this.y=n*a*s-o*r*u,this.z=n*r*u-o*a*s,this.w=n*r*s+o*a*u,this},setFromAxisAngle:function(e,t){var i=t/2,n=Math.sin(i);return this.x=e.x*n,this.y=e.y*n,this.z=e.z*n,this.w=Math.cos(i),this},multiply:function(e){return this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var i=e.x,n=e.y,r=e.z,s=e.w,o=t.x,a=t.y,u=t.z,c=t.w;return this.x=i*c+s*o+n*u-r*a,this.y=n*c+s*a+r*o-i*u,this.z=r*c+s*u+i*a-n*o,this.w=s*c-i*o-n*a-r*u,this},inverse:function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.normalize(),this},normalize:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=1):(e=1/e,this.x=this.x*e,this.y=this.y*e,this.z=this.z*e,this.w=this.w*e),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this.x,n=this.y,r=this.z,s=this.w,o=s*e.w+i*e.x+n*e.y+r*e.z;if(o<0?(this.w=-e.w,this.x=-e.x,this.y=-e.y,this.z=-e.z,o=-o):this.copy(e),o>=1)return this.w=s,this.x=i,this.y=n,this.z=r,this;var a=Math.acos(o),u=Math.sqrt(1-o*o);if(Math.abs(u)<.001)return this.w=.5*(s+this.w),this.x=.5*(i+this.x),this.y=.5*(n+this.y),this.z=.5*(r+this.z),this;var c=Math.sin((1-t)*a)/u,l=Math.sin(t*a)/u;return this.w=s*c+this.w*l,this.x=i*c+this.x*l,this.y=n*c+this.y*l,this.z=r*c+this.z*l,this},setFromUnitVectors:(le=1e-6,function(e,t){return void 0===ue&&(ue=new ae),(ce=e.dot(t)+1)<le?(ce=0,Math.abs(e.x)>Math.abs(e.z)?ue.set(-e.y,e.x,0):ue.set(0,-e.z,e.y)):ue.crossVectors(e,t),this.x=ue.x,this.y=ue.y,this.z=ue.z,this.w=ce,this.normalize(),this})};var pe=new de({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),Me=new de({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),fe={CardboardV1:new Ae({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]}),CardboardV2:new Ae({id:"CardboardV2",label:"Cardboard I/O 2015",fov:60,interLensDistance:.064,baselineLensDistance:.035,screenLensDistance:.039,distortionCoefficients:[.34,.55],inverseCoefficients:[-.33836704,-.18162185,.862655,-1.2462051,1.0560602,-.58208317,.21609078,-.05444823,.009177956,-.0009904169,6183535e-11,-16981803e-13]})};function ge(e,t){this.viewer=fe.CardboardV2,this.updateDeviceParams(e),this.distortion=new re(this.viewer.distortionCoefficients);for(var i=0;i<t.length;i++){var n=t[i];fe[n.id]=new Ae(n)}}function Ae(e){this.id=e.id,this.label=e.label,this.fov=e.fov,this.interLensDistance=e.interLensDistance,this.baselineLensDistance=e.baselineLensDistance,this.screenLensDistance=e.screenLensDistance,this.distortionCoefficients=e.distortionCoefficients,this.inverseCoefficients=e.inverseCoefficients}ge.prototype.updateDeviceParams=function(e){this.device=this.determineDevice_(e)||this.device},ge.prototype.getDevice=function(){return this.device},ge.prototype.setViewer=function(e){this.viewer=e,this.distortion=new re(this.viewer.distortionCoefficients)},ge.prototype.determineDevice_=function(e){if(!e)return p()?(console.warn("Using fallback iOS device measurements."),Me):(console.warn("Using fallback Android device measurements."),pe);var t=.0254,i=t/e.xdpi,n=t/e.ydpi;return new de({widthMeters:i*w(),heightMeters:n*T(),bevelMeters:.001*e.bevelMm})},ge.prototype.getDistortedFieldOfViewLeftEye=function(){var e=this.viewer,t=this.device,i=this.distortion,n=e.screenLensDistance,r=(t.widthMeters-e.interLensDistance)/2,s=e.interLensDistance/2,o=e.baselineLensDistance-t.bevelMeters,a=t.heightMeters-o,u=oe*Math.atan(i.distort(r/n)),c=oe*Math.atan(i.distort(s/n)),l=oe*Math.atan(i.distort(o/n)),h=oe*Math.atan(i.distort(a/n));return{leftDegrees:Math.min(u,e.fov),rightDegrees:Math.min(c,e.fov),downDegrees:Math.min(l,e.fov),upDegrees:Math.min(h,e.fov)}},ge.prototype.getLeftEyeVisibleTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,n=Math.tan(-se*e.fov),r=Math.tan(se*e.fov),s=Math.tan(se*e.fov),o=Math.tan(-se*e.fov),a=t.widthMeters/4,u=t.heightMeters/2,c=e.baselineLensDistance-t.bevelMeters-u,l=e.interLensDistance/2-a,h=-c,d=e.screenLensDistance,p=i.distort((l-a)/d),M=i.distort((h+u)/d),f=i.distort((l+a)/d),g=i.distort((h-u)/d),A=new Float32Array(4);return A[0]=Math.max(n,p),A[1]=Math.min(r,M),A[2]=Math.min(s,f),A[3]=Math.max(o,g),A},ge.prototype.getLeftEyeNoLensTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,n=new Float32Array(4),r=i.distortInverse(Math.tan(-se*e.fov)),s=i.distortInverse(Math.tan(se*e.fov)),o=i.distortInverse(Math.tan(se*e.fov)),a=i.distortInverse(Math.tan(-se*e.fov)),u=t.widthMeters/4,c=t.heightMeters/2,l=e.baselineLensDistance-t.bevelMeters-c,h=e.interLensDistance/2-u,d=-l,p=e.screenLensDistance,M=(h-u)/p,f=(d+c)/p,g=(h+u)/p,A=(d-c)/p;return n[0]=Math.max(r,M),n[1]=Math.min(s,f),n[2]=Math.min(o,g),n[3]=Math.max(a,A),n},ge.prototype.getLeftEyeVisibleScreenRect=function(e){var t=this.viewer,i=this.device,n=t.screenLensDistance,r=(i.widthMeters-t.interLensDistance)/2,s=t.baselineLensDistance-i.bevelMeters,o=(e[0]*n+r)/i.widthMeters,a=(e[1]*n+s)/i.heightMeters,u=(e[2]*n+r)/i.widthMeters,c=(e[3]*n+s)/i.heightMeters;return{x:o,y:c,width:u-o,height:a-c}},ge.prototype.getFieldOfViewLeftEye=function(e){return e?this.getUndistortedFieldOfViewLeftEye():this.getDistortedFieldOfViewLeftEye()},ge.prototype.getFieldOfViewRightEye=function(e){var t=this.getFieldOfViewLeftEye(e);return{leftDegrees:t.rightDegrees,rightDegrees:t.leftDegrees,upDegrees:t.upDegrees,downDegrees:t.downDegrees}},ge.prototype.getUndistortedFieldOfViewLeftEye=function(){var e=this.getUndistortedParams_();return{leftDegrees:oe*Math.atan(e.outerDist),rightDegrees:oe*Math.atan(e.innerDist),downDegrees:oe*Math.atan(e.bottomDist),upDegrees:oe*Math.atan(e.topDist)}},ge.prototype.getUndistortedViewportLeftEye=function(){var e=this.getUndistortedParams_(),t=this.viewer,i=this.device,n=t.screenLensDistance,r=i.widthMeters/n,s=i.heightMeters/n,o=i.width/r,a=i.height/s,u=Math.round((e.eyePosX-e.outerDist)*o),c=Math.round((e.eyePosY-e.bottomDist)*a);return{x:u,y:c,width:Math.round((e.eyePosX+e.innerDist)*o)-u,height:Math.round((e.eyePosY+e.topDist)*a)-c}},ge.prototype.getUndistortedParams_=function(){var e=this.viewer,t=this.device,i=this.distortion,n=e.screenLensDistance,r=e.interLensDistance/2/n,s=t.widthMeters/n,o=t.heightMeters/n,a=s/2-r,u=(e.baselineLensDistance-t.bevelMeters)/n,c=e.fov,l=i.distortInverse(Math.tan(se*c)),h=Math.min(a,l),d=Math.min(r,l),p=Math.min(u,l);return{outerDist:h,innerDist:d,topDist:Math.min(o-u,l),bottomDist:p,eyePosX:a,eyePosY:u}},ge.Viewers=fe;var ye={format:1,last_updated:"2019-11-09T17:36:14Z",devices:[{type:"android",rules:[{mdmh:"asus/*/Nexus 7/*"},{ua:"Nexus 7"}],dpi:[320.8,323],bw:3,ac:500},{type:"android",rules:[{mdmh:"asus/*/ASUS_X00PD/*"},{ua:"ASUS_X00PD"}],dpi:245,bw:3,ac:500},{type:"android",rules:[{mdmh:"asus/*/ASUS_X008D/*"},{ua:"ASUS_X008D"}],dpi:282,bw:3,ac:500},{type:"android",rules:[{mdmh:"asus/*/ASUS_Z00AD/*"},{ua:"ASUS_Z00AD"}],dpi:[403,404.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel 2 XL/*"},{ua:"Pixel 2 XL"}],dpi:537.9,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel 3 XL/*"},{ua:"Pixel 3 XL"}],dpi:[558.5,553.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel XL/*"},{ua:"Pixel XL"}],dpi:[537.9,533],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel 3/*"},{ua:"Pixel 3"}],dpi:442.4,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel 2/*"},{ua:"Pixel 2"}],dpi:441,bw:3,ac:500},{type:"android",rules:[{mdmh:"Google/*/Pixel/*"},{ua:"Pixel"}],dpi:[432.6,436.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC6435LVW/*"},{ua:"HTC6435LVW"}],dpi:[449.7,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC One XL/*"},{ua:"HTC One XL"}],dpi:[315.3,314.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"htc/*/Nexus 9/*"},{ua:"Nexus 9"}],dpi:289,bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One M9/*"},{ua:"HTC One M9"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One_M8/*"},{ua:"HTC One_M8"}],dpi:[449.7,447.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One/*"},{ua:"HTC One"}],dpi:472.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/Nexus 6P/*"},{ua:"Nexus 6P"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/BLN-L24/*"},{ua:"HONORBLN-L24"}],dpi:480,bw:4,ac:500},{type:"android",rules:[{mdmh:"Huawei/*/BKL-L09/*"},{ua:"BKL-L09"}],dpi:403,bw:3.47,ac:500},{type:"android",rules:[{mdmh:"LENOVO/*/Lenovo PB2-690Y/*"},{ua:"Lenovo PB2-690Y"}],dpi:[457.2,454.713],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5X/*"},{ua:"Nexus 5X"}],dpi:[422,419.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS345/*"},{ua:"LGMS345"}],dpi:[221.7,219.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D800/*"},{ua:"LG-D800"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D850/*"},{ua:"LG-D850"}],dpi:[537.9,541.9],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/VS985 4G/*"},{ua:"VS985 4G"}],dpi:[537.9,535.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5/*"},{ua:"Nexus 5 B"}],dpi:[442.4,444.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 4/*"},{ua:"Nexus 4"}],dpi:[319.8,318.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LG-P769/*"},{ua:"LG-P769"}],dpi:[240.6,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS323/*"},{ua:"LGMS323"}],dpi:[206.6,204.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGLS996/*"},{ua:"LGLS996"}],dpi:[403.4,401.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/4560MMX/*"},{ua:"4560MMX"}],dpi:[240,219.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/A250/*"},{ua:"Micromax A250"}],dpi:[480,446.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/Micromax AQ4501/*"},{ua:"Micromax AQ4501"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/G5/*"},{ua:"Moto G (5) Plus"}],dpi:[403.4,403],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/DROID RAZR/*"},{ua:"DROID RAZR"}],dpi:[368.1,256.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT830C/*"},{ua:"XT830C"}],dpi:[254,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1021/*"},{ua:"XT1021"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1023/*"},{ua:"XT1023"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1028/*"},{ua:"XT1028"}],dpi:[326.6,327.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1034/*"},{ua:"XT1034"}],dpi:[326.6,328.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1053/*"},{ua:"XT1053"}],dpi:[315.3,316.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1562/*"},{ua:"XT1562"}],dpi:[403.4,402.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/Nexus 6/*"},{ua:"Nexus 6 B"}],dpi:[494.3,489.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1063/*"},{ua:"XT1063"}],dpi:[295,296.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1064/*"},{ua:"XT1064"}],dpi:[295,295.6],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1092/*"},{ua:"XT1092"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1095/*"},{ua:"XT1095"}],dpi:[422,423.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/G4/*"},{ua:"Moto G (4)"}],dpi:401,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/A0001/*"},{ua:"A0001"}],dpi:[403.4,401],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1001/*"},{ua:"ONE E1001"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1003/*"},{ua:"ONE E1003"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1005/*"},{ua:"ONE E1005"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2001/*"},{ua:"ONE A2001"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2003/*"},{ua:"ONE A2003"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2005/*"},{ua:"ONE A2005"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A3000/*"},{ua:"ONEPLUS A3000"}],dpi:401,bw:3,ac:500},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A3003/*"},{ua:"ONEPLUS A3003"}],dpi:401,bw:3,ac:500},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A3010/*"},{ua:"ONEPLUS A3010"}],dpi:401,bw:3,ac:500},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A5000/*"},{ua:"ONEPLUS A5000 "}],dpi:[403.411,399.737],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A5010/*"},{ua:"ONEPLUS A5010"}],dpi:[403,400],bw:2,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A6000/*"},{ua:"ONEPLUS A6000"}],dpi:401,bw:3,ac:500},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A6003/*"},{ua:"ONEPLUS A6003"}],dpi:401,bw:3,ac:500},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A6010/*"},{ua:"ONEPLUS A6010"}],dpi:401,bw:2,ac:500},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A6013/*"},{ua:"ONEPLUS A6013"}],dpi:401,bw:2,ac:500},{type:"android",rules:[{mdmh:"OPPO/*/X909/*"},{ua:"X909"}],dpi:[442.4,444.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9082/*"},{ua:"GT-I9082"}],dpi:[184.7,185.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G360P/*"},{ua:"SM-G360P"}],dpi:[196.7,205.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Nexus S/*"},{ua:"Nexus S"}],dpi:[234.5,229.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[304.8,303.9],bw:5,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-T230NU/*"},{ua:"SM-T230NU"}],dpi:216,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SGH-T399/*"},{ua:"SGH-T399"}],dpi:[217.7,231.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SGH-M919/*"},{ua:"SGH-M919"}],dpi:[440.8,437.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N9005/*"},{ua:"SM-N9005"}],dpi:[386.4,387],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SM-N900A/*"},{ua:"SAMSUNG-SM-N900A"}],dpi:[386.4,387.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9500/*"},{ua:"GT-I9500"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/GT-I9505/*"},{ua:"GT-I9505"}],dpi:439.4,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900F/*"},{ua:"SM-G900F"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900M/*"},{ua:"SM-G900M"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G800F/*"},{ua:"SM-G800F"}],dpi:326.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G906S/*"},{ua:"SM-G906S"}],dpi:[562.7,572.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[306.7,304.8],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-T535/*"},{ua:"SM-T535"}],dpi:[142.6,136.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-N920C/*"},{ua:"SM-N920C"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N920P/*"},{ua:"SM-N920P"}],dpi:[386.3655,390.144],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N920W8/*"},{ua:"SM-N920W8"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300I/*"},{ua:"GT-I9300I"}],dpi:[304.8,305.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9195/*"},{ua:"GT-I9195"}],dpi:[249.4,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SPH-L520/*"},{ua:"SPH-L520"}],dpi:[249.4,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SGH-I717/*"},{ua:"SAMSUNG-SGH-I717"}],dpi:285.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SPH-D710/*"},{ua:"SPH-D710"}],dpi:[217.7,204.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-N7100/*"},{ua:"GT-N7100"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SCH-I605/*"},{ua:"SCH-I605"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Galaxy Nexus/*"},{ua:"Galaxy Nexus"}],dpi:[315.3,314.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910H/*"},{ua:"SM-N910H"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910C/*"},{ua:"SM-N910C"}],dpi:[515.2,520.2],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G130M/*"},{ua:"SM-G130M"}],dpi:[165.9,164.8],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G928I/*"},{ua:"SM-G928I"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G920F/*"},{ua:"SM-G920F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G920P/*"},{ua:"SM-G920P"}],dpi:[522.5,577],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G925F/*"},{ua:"SM-G925F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G925V/*"},{ua:"SM-G925V"}],dpi:[522.5,576.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G930F/*"},{ua:"SM-G930F"}],dpi:576.6,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G935F/*"},{ua:"SM-G935F"}],dpi:533,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G950F/*"},{ua:"SM-G950F"}],dpi:[562.707,565.293],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G955U/*"},{ua:"SM-G955U"}],dpi:[522.514,525.762],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G955F/*"},{ua:"SM-G955F"}],dpi:[522.514,525.762],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G960F/*"},{ua:"SM-G960F"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G9600/*"},{ua:"SM-G9600"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G960T/*"},{ua:"SM-G960T"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G960N/*"},{ua:"SM-G960N"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G960U/*"},{ua:"SM-G960U"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G9608/*"},{ua:"SM-G9608"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G960FD/*"},{ua:"SM-G960FD"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G960W/*"},{ua:"SM-G960W"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G965F/*"},{ua:"SM-G965F"}],dpi:529,bw:2,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/C6903/*"},{ua:"C6903"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"Sony/*/D6653/*"},{ua:"D6653"}],dpi:[428.6,427.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6653/*"},{ua:"E6653"}],dpi:[428.6,425.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6853/*"},{ua:"E6853"}],dpi:[403.4,401.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/SGP321/*"},{ua:"SGP321"}],dpi:[224.7,224.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"TCT/*/ALCATEL ONE TOUCH Fierce/*"},{ua:"ALCATEL ONE TOUCH Fierce"}],dpi:[240,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"THL/*/thl 5000/*"},{ua:"thl 5000"}],dpi:[480,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Fly/*/IQ4412/*"},{ua:"IQ4412"}],dpi:307.9,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"ZTE/*/ZTE Blade L2/*"},{ua:"ZTE Blade L2"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"BENEVE/*/VR518/*"},{ua:"VR518"}],dpi:480,bw:3,ac:500},{type:"ios",rules:[{res:[640,960]}],dpi:[325.1,328.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[640,1136]}],dpi:[317.1,320.2],bw:3,ac:1e3},{type:"ios",rules:[{res:[750,1334]}],dpi:326.4,bw:4,ac:1e3},{type:"ios",rules:[{res:[1242,2208]}],dpi:[453.6,458.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1125,2001]}],dpi:[410.9,415.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1125,2436]}],dpi:458,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/EML-L29/*"},{ua:"EML-L29"}],dpi:428,bw:3.45,ac:500},{type:"android",rules:[{mdmh:"Nokia/*/Nokia 7.1/*"},{ua:"Nokia 7.1"}],dpi:[432,431.9],bw:3,ac:500},{type:"ios",rules:[{res:[1242,2688]}],dpi:458,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G570M/*"},{ua:"SM-G570M"}],dpi:320,bw:3.684,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G970F/*"},{ua:"SM-G970F"}],dpi:438,bw:2.281,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G973F/*"},{ua:"SM-G973F"}],dpi:550,bw:2.002,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G975F/*"},{ua:"SM-G975F"}],dpi:522,bw:2.054,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G977F/*"},{ua:"SM-G977F"}],dpi:505,bw:2.334,ac:500},{type:"ios",rules:[{res:[828,1792]}],dpi:326,bw:5,ac:500}]};function ve(e,t){if(this.dpdb=ye,this.recalculateDeviceParams_(),e){this.onDeviceParamsUpdated=t;var i=new XMLHttpRequest,n=this;i.open("GET",e,!0),i.addEventListener("load",(function(){n.loading=!1,i.status>=200&&i.status<=299?(n.dpdb=JSON.parse(i.response),n.recalculateDeviceParams_()):console.error("Error loading online DPDB!")})),i.send()}}function me(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}function Ne(e,t){this.set(e,t)}function De(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new Ne,this.currentGyroMeasurement=new Ne,this.previousGyroMeasurement=new Ne,p()?this.filterQ=new he(-1,0,0,1):this.filterQ=new he(1,0,0,1),this.previousFilterQ=new he,this.previousFilterQ.copy(this.filterQ),this.accelQ=new he,this.isOrientationInitialized=!1,this.estimatedGravity=new ae,this.measuredGravity=new ae,this.gyroIntegralQ=new he}function we(e,t){this.predictionTimeS=e,this.isDebug=t,this.previousQ=new he,this.previousTimestampS=null,this.deltaQ=new he,this.outQ=new he}function Te(t,i,n,r){this.yawOnly=n,this.accelerometer=new ae,this.gyroscope=new ae,this.filter=new De(t,r),this.posePredictor=new we(i,r),this.isFirefoxAndroid=g(),this.isIOS=p();var s=A();this.isDeviceMotionInRadians=!this.isIOS&&s&&s<66,this.isWithoutDeviceMotion=v()||y(),this.filterToWorldQ=new he,p()?this.filterToWorldQ.setFromAxisAngle(new ae(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new ae(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new he,this.worldToScreenQ=new he,this.originalPoseAdjustQ=new he,this.originalPoseAdjustQ.setFromAxisAngle(new ae(0,0,1),-e.orientation*Math.PI/180),this.setScreenTransform_(),N()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new he,this.orientationOut_=new Float32Array(4),this.start()}ve.prototype.getDeviceParams=function(){return this.deviceParams},ve.prototype.recalculateDeviceParams_=function(){var e=this.calcDeviceParams_();e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},ve.prototype.calcDeviceParams_=function(){var i=this.dpdb;if(!i)return console.error("DPDB not available."),null;if(1!=i.format)return console.error("DPDB has unexpected format version."),null;if(!i.devices||!i.devices.length)return console.error("DPDB does not have a devices section."),null;var n=t.userAgent||t.vendor||e.opera,r=w(),s=T();if(!i.devices)return console.error("DPDB has no devices section."),null;for(var o=0;o<i.devices.length;o++){var a=i.devices[o];if(a.rules)if("ios"==a.type||"android"==a.type){if(p()==("ios"==a.type)){for(var u=!1,c=0;c<a.rules.length;c++){var l=a.rules[c];if(this.ruleMatches_(l,n,r,s)){u=!0;break}}if(u)return new me({xdpi:a.dpi[0]||a.dpi,ydpi:a.dpi[1]||a.dpi,bevelMm:a.bw})}}else console.warn("Device["+o+"] has invalid type.");else console.warn("Device["+o+"] has no rules section.")}return console.warn("No DPDB device match."),null},ve.prototype.ruleMatches_=function(e,t,i,n){if(!e.ua&&!e.res)return!1;if(e.ua&&"SM"===e.ua.substring(0,2)&&(e.ua=e.ua.substring(0,7)),e.ua&&t.indexOf(e.ua)<0)return!1;if(e.res){if(!e.res[0]||!e.res[1])return!1;var r=e.res[0],s=e.res[1];if(Math.min(i,n)!=Math.min(r,s)||Math.max(i,n)!=Math.max(r,s))return!1}return!0},Ne.prototype.set=function(e,t){this.sample=e,this.timestampS=t},Ne.prototype.copy=function(e){this.set(e.sample,e.timestampS)},De.prototype.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},De.prototype.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e,t);var i=t-this.previousGyroMeasurement.timestampS;D(i)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},De.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var i=new he;i.copy(this.filterQ),i.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(i),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var n=new he;n.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),n.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",oe*U(n),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 r=new he;r.copy(this.filterQ),r.multiply(n),this.filterQ.slerp(r,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},De.prototype.getOrientation=function(){return this.filterQ},De.prototype.accelToQuaternion_=function(e){var t=new ae;t.copy(e),t.normalize();var i=new he;return i.setFromUnitVectors(new ae(0,0,-1),t),i.inverse(),i},De.prototype.gyroToQuaternionDelta_=function(e,t){var i=new he,n=new ae;return n.copy(e),n.normalize(),i.setFromAxisAngle(n,e.length()*t),i},we.prototype.getPrediction=function(e,t,i){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=i,e;var n=new ae;n.copy(t),n.normalize();var r=t.length();if(r<20*se)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(oe*r).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var s=r*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(n,s),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=i,this.outQ},Te.prototype.getPosition=function(){return null},Te.prototype.getOrientation=function(){var t=void 0;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ)return this.deviceOrientationFixQ=this.deviceOrientationFixQ||function(){var t=(new he).setFromAxisAngle(new ae(0,0,-1),0),i=new he;return-90===e.orientation?i.setFromAxisAngle(new ae(0,1,0),Math.PI/-2):i.setFromAxisAngle(new ae(0,1,0),Math.PI/2),t.multiply(i)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||((i=new he).setFromAxisAngle(new ae(1,0,0),-Math.PI/2),i),t=this._deviceOrientationQ,(n=new he).copy(t),n.multiply(this.deviceOrientationFilterToWorldQ),n.multiply(this.resetQ),n.multiply(this.worldToScreenQ),n.multiplyQuaternions(this.deviceOrientationFixQ,n),this.yawOnly&&(n.x=0,n.z=0,n.normalize()),this.orientationOut_[0]=n.x,this.orientationOut_[1]=n.y,this.orientationOut_[2]=n.z,this.orientationOut_[3]=n.w,this.orientationOut_;var i,n,r=this.filter.getOrientation();return t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS),(n=new he).copy(this.filterToWorldQ),n.multiply(this.resetQ),n.multiply(t),n.multiply(this.worldToScreenQ),this.yawOnly&&(n.x=0,n.z=0,n.normalize()),this.orientationOut_[0]=n.x,this.orientationOut_[1]=n.y,this.orientationOut_[2]=n.z,this.orientationOut_[3]=n.w,this.orientationOut_},Te.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),N()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},Te.prototype.onDeviceOrientation_=function(e){this._deviceOrientationQ=this._deviceOrientationQ||new he;var t=e.alpha,i=e.beta,n=e.gamma;t=(t||0)*Math.PI/180,i=(i||0)*Math.PI/180,n=(n||0)*Math.PI/180,this._deviceOrientationQ.setFromEulerYXZ(i,t,-n)},Te.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},Te.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,n=e.timeStamp/1e3,r=n-this.previousTimestampS;return r<0?(B("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=n)):r<=c||r>l?(B("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),void(this.previousTimestampS=n)):(this.accelerometer.set(-t.x,-t.y,-t.z),i&&(m()?this.gyroscope.set(-i.beta,i.alpha,i.gamma):this.gyroscope.set(i.alpha,i.beta,i.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,n)),this.filter.addAccelMeasurement(this.accelerometer,n),void(this.previousTimestampS=n))},Te.prototype.onOrientationChange_=function(e){this.setScreenTransform_()},Te.prototype.onMessage_=function(e){var t=e.data;t&&t.type&&"devicemotion"===t.type.toLowerCase()&&this.updateDeviceMotion_(t.deviceMotionEvent)},Te.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),e.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new ae(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new ae(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},Te.prototype.start=function(){this.onDeviceMotionCallback_=this.onDeviceMotion_.bind(this),this.onOrientationChangeCallback_=this.onOrientationChange_.bind(this),this.onMessageCallback_=this.onMessage_.bind(this),this.onDeviceOrientationCallback_=this.onDeviceOrientation_.bind(this),p()&&P()&&e.addEventListener("message",this.onMessageCallback_),e.addEventListener("orientationchange",this.onOrientationChangeCallback_),this.isWithoutDeviceMotion?e.addEventListener("deviceorientation",this.onDeviceOrientationCallback_):e.addEventListener("devicemotion",this.onDeviceMotionCallback_)},Te.prototype.stop=function(){e.removeEventListener("devicemotion",this.onDeviceMotionCallback_),e.removeEventListener("deviceorientation",this.onDeviceOrientationCallback_),e.removeEventListener("orientationchange",this.onOrientationChangeCallback_),e.removeEventListener("message",this.onMessageCallback_)};var xe=60,Ee=new ae(1,0,0),je=new ae(0,0,1),ze=new he;ze.setFromAxisAngle(Ee,-Math.PI/2),ze.multiply((new he).setFromAxisAngle(je,Math.PI/2));var Ie=function(){function e(t){o(this,e),this.config=t,this.sensor=null,this.fusionSensor=null,this._out=new Float32Array(4),this.api=null,this.errors=[],this._sensorQ=new he,this._outQ=new he,this._onSensorRead=this._onSensorRead.bind(this),this._onSensorError=this._onSensorError.bind(this),this.init()}return a(e,[{key:"init",value:function(){var e=null;try{(e=new RelativeOrientationSensor({frequency:xe,referenceFrame:"screen"})).addEventListener("error",this._onSensorError)}catch(e){this.errors.push(e),"SecurityError"===e.name?(console.error("Cannot construct sensors due to the Feature Policy"),console.warn('Attempting to fall back using "devicemotion"; however this will fail in the future without correct permissions.'),this.useDeviceMotion()):"ReferenceError"===e.name?this.useDeviceMotion():console.error(e)}e&&(this.api="sensor",this.sensor=e,this.sensor.addEventListener("reading",this._onSensorRead),this.sensor.start())}},{key:"useDeviceMotion",value:function(){this.api="devicemotion",this.fusionSensor=new Te(this.config.K_FILTER,this.config.PREDICTION_TIME_S,this.config.YAW_ONLY,this.config.DEBUG),this.sensor&&(this.sensor.removeEventListener("reading",this._onSensorRead),this.sensor.removeEventListener("error",this._onSensorError),this.sensor=null)}},{key:"getOrientation",value:function(){if(this.fusionSensor)return this.fusionSensor.getOrientation();if(!this.sensor||!this.sensor.quaternion)return this._out[0]=this._out[1]=this._out[2]=0,this._out[3]=1,this._out;var e=this.sensor.quaternion;this._sensorQ.set(e[0],e[1],e[2],e[3]);var t=this._outQ;return t.copy(ze),t.multiply(this._sensorQ),this.config.YAW_ONLY&&(t.x=t.z=0,t.normalize()),this._out[0]=t.x,this._out[1]=t.y,this._out[2]=t.z,this._out[3]=t.w,this._out}},{key:"_onSensorError",value:function(e){this.errors.push(e.error),"NotAllowedError"===e.error.name?console.error("Permission to access sensor was denied"):"NotReadableError"===e.error.name?console.error("Sensor could not be read"):console.error(e.error),this.useDeviceMotion()}},{key:"_onSensorRead",value:function(){}}]),e}(),be="<svg width='198' height='240' viewBox='0 0 198 240' xmlns='http://www.w3.org/2000/svg'><g fill='none' fill-rule='evenodd'><path d='M149.625 109.527l6.737 3.891v.886c0 .177.013.36.038.549.01.081.02.162.027.242.14 1.415.974 2.998 2.105 3.999l5.72 5.062.081-.09s4.382-2.53 5.235-3.024l25.97 14.993v54.001c0 .771-.386 1.217-.948 1.217-.233 0-.495-.076-.772-.236l-23.967-13.838-.014.024-27.322 15.775-.85-1.323c-4.731-1.529-9.748-2.74-14.951-3.61a.27.27 0 0 0-.007.024l-5.067 16.961-7.891 4.556-.037-.063v27.59c0 .772-.386 1.217-.948 1.217-.232 0-.495-.076-.772-.236l-42.473-24.522c-.95-.549-1.72-1.877-1.72-2.967v-1.035l-.021.047a5.111 5.111 0 0 0-1.816-.399 5.682 5.682 0 0 0-.546.001 13.724 13.724 0 0 1-1.918-.041c-1.655-.153-3.2-.6-4.404-1.296l-46.576-26.89.005.012-10.278-18.75c-1.001-1.827-.241-4.216 1.698-5.336l56.011-32.345a4.194 4.194 0 0 1 2.099-.572c1.326 0 2.572.659 3.227 1.853l.005-.003.227.413-.006.004a9.63 9.63 0 0 0 1.477 2.018l.277.27c1.914 1.85 4.468 2.801 7.113 2.801 1.949 0 3.948-.517 5.775-1.572.013 0 7.319-4.219 7.319-4.219a4.194 4.194 0 0 1 2.099-.572c1.326 0 2.572.658 3.226 1.853l3.25 5.928.022-.018 6.785 3.917-.105-.182 46.881-26.965m0-1.635c-.282 0-.563.073-.815.218l-46.169 26.556-5.41-3.124-3.005-5.481c-.913-1.667-2.699-2.702-4.66-2.703-1.011 0-2.02.274-2.917.792a3825 3825 0 0 1-7.275 4.195l-.044.024a9.937 9.937 0 0 1-4.957 1.353c-2.292 0-4.414-.832-5.976-2.342l-.252-.245a7.992 7.992 0 0 1-1.139-1.534 1.379 1.379 0 0 0-.06-.122l-.227-.414a1.718 1.718 0 0 0-.095-.154c-.938-1.574-2.673-2.545-4.571-2.545-1.011 0-2.02.274-2.917.792L3.125 155.502c-2.699 1.559-3.738 4.94-2.314 7.538l10.278 18.75c.177.323.448.563.761.704l46.426 26.804c1.403.81 3.157 1.332 5.072 1.508a15.661 15.661 0 0 0 2.146.046 4.766 4.766 0 0 1 .396 0c.096.004.19.011.283.022.109 1.593 1.159 3.323 2.529 4.114l42.472 24.522c.524.302 1.058.455 1.59.455 1.497 0 2.583-1.2 2.583-2.852v-26.562l7.111-4.105a1.64 1.64 0 0 0 .749-.948l4.658-15.593c4.414.797 8.692 1.848 12.742 3.128l.533.829a1.634 1.634 0 0 0 2.193.531l26.532-15.317L193 192.433c.523.302 1.058.455 1.59.455 1.497 0 2.583-1.199 2.583-2.852v-54.001c0-.584-.312-1.124-.818-1.416l-25.97-14.993a1.633 1.633 0 0 0-1.636.001c-.606.351-2.993 1.73-4.325 2.498l-4.809-4.255c-.819-.725-1.461-1.933-1.561-2.936a7.776 7.776 0 0 0-.033-.294 2.487 2.487 0 0 1-.023-.336v-.886c0-.584-.312-1.123-.817-1.416l-6.739-3.891a1.633 1.633 0 0 0-.817-.219' fill='#455A64'/><path d='M96.027 132.636l46.576 26.891c1.204.695 1.979 1.587 2.242 2.541l-.01.007-81.374 46.982h-.001c-1.654-.152-3.199-.6-4.403-1.295l-46.576-26.891 83.546-48.235' fill='#FAFAFA'/><path d='M63.461 209.174c-.008 0-.015 0-.022-.002-1.693-.156-3.228-.609-4.441-1.309l-46.576-26.89a.118.118 0 0 1 0-.203l83.546-48.235a.117.117 0 0 1 .117 0l46.576 26.891c1.227.708 2.021 1.612 2.296 2.611a.116.116 0 0 1-.042.124l-.021.016-81.375 46.981a.11.11 0 0 1-.058.016zm-50.747-28.303l46.401 26.79c1.178.68 2.671 1.121 4.32 1.276l81.272-46.922c-.279-.907-1.025-1.73-2.163-2.387l-46.517-26.857-83.313 48.1z' fill='#607D8B'/><path d='M148.327 165.471a5.85 5.85 0 0 1-.546.001c-1.894-.083-3.302-1.038-3.145-2.132a2.693 2.693 0 0 0-.072-1.105l-81.103 46.822c.628.058 1.272.073 1.918.042.182-.009.364-.009.546-.001 1.894.083 3.302 1.038 3.145 2.132l79.257-45.759' fill='#FFF'/><path d='M69.07 211.347a.118.118 0 0 1-.115-.134c.045-.317-.057-.637-.297-.925-.505-.61-1.555-1.022-2.738-1.074a5.966 5.966 0 0 0-.535.001 14.03 14.03 0 0 1-1.935-.041.117.117 0 0 1-.103-.092.116.116 0 0 1 .055-.126l81.104-46.822a.117.117 0 0 1 .171.07c.104.381.129.768.074 1.153-.045.316.057.637.296.925.506.61 1.555 1.021 2.739 1.073.178.008.357.008.535-.001a.117.117 0 0 1 .064.218l-79.256 45.759a.114.114 0 0 1-.059.016zm-3.405-2.372c.089 0 .177.002.265.006 1.266.056 2.353.488 2.908 1.158.227.274.35.575.36.882l78.685-45.429c-.036 0-.072-.001-.107-.003-1.267-.056-2.354-.489-2.909-1.158-.282-.34-.402-.724-.347-1.107a2.604 2.604 0 0 0-.032-.91L63.846 208.97a13.91 13.91 0 0 0 1.528.012c.097-.005.194-.007.291-.007z' fill='#607D8B'/><path d='M2.208 162.134c-1.001-1.827-.241-4.217 1.698-5.337l56.011-32.344c1.939-1.12 4.324-.546 5.326 1.281l.232.41a9.344 9.344 0 0 0 1.47 2.021l.278.27c3.325 3.214 8.583 3.716 12.888 1.23l7.319-4.22c1.94-1.119 4.324-.546 5.325 1.282l3.25 5.928-83.519 48.229-10.278-18.75z' fill='#FAFAFA'/><path d='M12.486 181.001a.112.112 0 0 1-.031-.005.114.114 0 0 1-.071-.056L2.106 162.19c-1.031-1.88-.249-4.345 1.742-5.494l56.01-32.344a4.328 4.328 0 0 1 2.158-.588c1.415 0 2.65.702 3.311 1.882.01.008.018.017.024.028l.227.414a.122.122 0 0 1 .013.038 9.508 9.508 0 0 0 1.439 1.959l.275.266c1.846 1.786 4.344 2.769 7.031 2.769 1.977 0 3.954-.538 5.717-1.557a.148.148 0 0 1 .035-.013l7.284-4.206a4.321 4.321 0 0 1 2.157-.588c1.427 0 2.672.716 3.329 1.914l3.249 5.929a.116.116 0 0 1-.044.157l-83.518 48.229a.116.116 0 0 1-.059.016zm49.53-57.004c-.704 0-1.41.193-2.041.557l-56.01 32.345c-1.882 1.086-2.624 3.409-1.655 5.179l10.221 18.645 83.317-48.112-3.195-5.829c-.615-1.122-1.783-1.792-3.124-1.792a4.08 4.08 0 0 0-2.04.557l-7.317 4.225a.148.148 0 0 1-.035.013 11.7 11.7 0 0 1-5.801 1.569c-2.748 0-5.303-1.007-7.194-2.835l-.278-.27a9.716 9.716 0 0 1-1.497-2.046.096.096 0 0 1-.013-.037l-.191-.347a.11.11 0 0 1-.023-.029c-.615-1.123-1.783-1.793-3.124-1.793z' fill='#607D8B'/><path d='M42.434 155.808c-2.51-.001-4.697-1.258-5.852-3.365-1.811-3.304-.438-7.634 3.059-9.654l12.291-7.098a7.599 7.599 0 0 1 3.789-1.033c2.51 0 4.697 1.258 5.852 3.365 1.811 3.304.439 7.634-3.059 9.654l-12.291 7.098a7.606 7.606 0 0 1-3.789 1.033zm13.287-20.683a7.128 7.128 0 0 0-3.555.971l-12.291 7.098c-3.279 1.893-4.573 5.942-2.883 9.024 1.071 1.955 3.106 3.122 5.442 3.122a7.13 7.13 0 0 0 3.556-.97l12.291-7.098c3.279-1.893 4.572-5.942 2.883-9.024-1.072-1.955-3.106-3.123-5.443-3.123z' fill='#607D8B'/><path d='M149.588 109.407l6.737 3.89v.887c0 .176.013.36.037.549.011.081.02.161.028.242.14 1.415.973 2.998 2.105 3.999l7.396 6.545c.177.156.358.295.541.415 1.579 1.04 2.95.466 3.062-1.282.049-.784.057-1.595.023-2.429l-.003-.16v-1.151l25.987 15.003v54c0 1.09-.77 1.53-1.72.982l-42.473-24.523c-.95-.548-1.72-1.877-1.72-2.966v-34.033' fill='#FAFAFA'/><path d='M194.553 191.25c-.257 0-.54-.085-.831-.253l-42.472-24.521c-.981-.567-1.779-1.943-1.779-3.068v-34.033h.234v34.033c0 1.051.745 2.336 1.661 2.866l42.473 24.521c.424.245.816.288 1.103.122.285-.164.442-.52.442-1.002v-53.933l-25.753-14.868.003 1.106c.034.832.026 1.654-.024 2.439-.054.844-.396 1.464-.963 1.746-.619.309-1.45.173-2.28-.373a5.023 5.023 0 0 1-.553-.426l-7.397-6.544c-1.158-1.026-1.999-2.625-2.143-4.076a9.624 9.624 0 0 0-.027-.238 4.241 4.241 0 0 1-.038-.564v-.82l-6.68-3.856.117-.202 6.738 3.89.058.034v.954c0 .171.012.351.036.533.011.083.021.165.029.246.138 1.395.948 2.935 2.065 3.923l7.397 6.545c.173.153.35.289.527.406.758.499 1.504.63 2.047.359.49-.243.786-.795.834-1.551.05-.778.057-1.591.024-2.417l-.004-.163v-1.355l.175.1 25.987 15.004.059.033v54.068c0 .569-.198.996-.559 1.204a1.002 1.002 0 0 1-.506.131' fill='#607D8B'/><path d='M145.685 163.161l24.115 13.922-25.978 14.998-1.462-.307c-6.534-2.17-13.628-3.728-21.019-4.616-4.365-.524-8.663 1.096-9.598 3.62a2.746 2.746 0 0 0-.011 1.928c1.538 4.267 4.236 8.363 7.995 12.135l.532.845-25.977 14.997-24.115-13.922 75.518-43.6' fill='#FFF'/><path d='M94.282 220.818l-.059-.033-24.29-14.024.175-.101 75.577-43.634.058.033 24.29 14.024-26.191 15.122-.045-.01-1.461-.307c-6.549-2.174-13.613-3.725-21.009-4.614a13.744 13.744 0 0 0-1.638-.097c-3.758 0-7.054 1.531-7.837 3.642a2.62 2.62 0 0 0-.01 1.848c1.535 4.258 4.216 8.326 7.968 12.091l.016.021.526.835.006.01.064.102-.105.061-25.977 14.998-.058.033zm-23.881-14.057l23.881 13.788 24.802-14.32c.546-.315.846-.489 1.017-.575l-.466-.74c-3.771-3.787-6.467-7.881-8.013-12.168a2.851 2.851 0 0 1 .011-2.008c.815-2.199 4.203-3.795 8.056-3.795.557 0 1.117.033 1.666.099 7.412.891 14.491 2.445 21.041 4.621.836.175 1.215.254 1.39.304l25.78-14.884-23.881-13.788-75.284 43.466z' fill='#607D8B'/><path d='M167.23 125.979v50.871l-27.321 15.773-6.461-14.167c-.91-1.996-3.428-1.738-5.624.574a10.238 10.238 0 0 0-2.33 4.018l-6.46 21.628-27.322 15.774v-50.871l75.518-43.6' fill='#FFF'/><path d='M91.712 220.567a.127.127 0 0 1-.059-.016.118.118 0 0 1-.058-.101v-50.871c0-.042.023-.08.058-.101l75.519-43.6a.117.117 0 0 1 .175.101v50.871c0 .041-.023.08-.059.1l-27.321 15.775a.118.118 0 0 1-.094.01.12.12 0 0 1-.071-.063l-6.46-14.168c-.375-.822-1.062-1.275-1.934-1.275-1.089 0-2.364.686-3.5 1.881a10.206 10.206 0 0 0-2.302 3.972l-6.46 21.627a.118.118 0 0 1-.054.068L91.77 220.551a.12.12 0 0 1-.058.016zm.117-50.92v50.601l27.106-15.65 6.447-21.583a10.286 10.286 0 0 1 2.357-4.065c1.18-1.242 2.517-1.954 3.669-1.954.969 0 1.731.501 2.146 1.411l6.407 14.051 27.152-15.676v-50.601l-75.284 43.466z' fill='#607D8B'/><path d='M168.543 126.213v50.87l-27.322 15.774-6.46-14.168c-.91-1.995-3.428-1.738-5.624.574a10.248 10.248 0 0 0-2.33 4.019l-6.461 21.627-27.321 15.774v-50.87l75.518-43.6' fill='#FFF'/><path d='M93.025 220.8a.123.123 0 0 1-.059-.015.12.12 0 0 1-.058-.101v-50.871c0-.042.023-.08.058-.101l75.518-43.6a.112.112 0 0 1 .117 0c.036.02.059.059.059.1v50.871a.116.116 0 0 1-.059.101l-27.321 15.774a.111.111 0 0 1-.094.01.115.115 0 0 1-.071-.062l-6.46-14.168c-.375-.823-1.062-1.275-1.935-1.275-1.088 0-2.363.685-3.499 1.881a10.19 10.19 0 0 0-2.302 3.971l-6.461 21.628a.108.108 0 0 1-.053.067l-27.322 15.775a.12.12 0 0 1-.058.015zm.117-50.919v50.6l27.106-15.649 6.447-21.584a10.293 10.293 0 0 1 2.357-4.065c1.179-1.241 2.516-1.954 3.668-1.954.969 0 1.732.502 2.147 1.412l6.407 14.051 27.152-15.676v-50.601l-75.284 43.466z' fill='#607D8B'/><path d='M169.8 177.083l-27.322 15.774-6.46-14.168c-.91-1.995-3.428-1.738-5.625.574a10.246 10.246 0 0 0-2.329 4.019l-6.461 21.627-27.321 15.774v-50.87l75.518-43.6v50.87z' fill='#FAFAFA'/><path d='M94.282 220.917a.234.234 0 0 1-.234-.233v-50.871c0-.083.045-.161.117-.202l75.518-43.601a.234.234 0 1 1 .35.202v50.871a.233.233 0 0 1-.116.202l-27.322 15.775a.232.232 0 0 1-.329-.106l-6.461-14.168c-.36-.789-.992-1.206-1.828-1.206-1.056 0-2.301.672-3.415 1.844a10.099 10.099 0 0 0-2.275 3.924l-6.46 21.628a.235.235 0 0 1-.107.136l-27.322 15.774a.23.23 0 0 1-.116.031zm.233-50.969v50.331l26.891-15.525 6.434-21.539a10.41 10.41 0 0 1 2.384-4.112c1.201-1.265 2.569-1.991 3.753-1.991 1.018 0 1.818.526 2.253 1.48l6.354 13.934 26.982-15.578v-50.331l-75.051 43.331z' fill='#607D8B'/><path d='M109.894 199.943c-1.774 0-3.241-.725-4.244-2.12a.224.224 0 0 1 .023-.294.233.233 0 0 1 .301-.023c.78.547 1.705.827 2.75.827 1.323 0 2.754-.439 4.256-1.306 5.311-3.067 9.631-10.518 9.631-16.611 0-1.927-.442-3.56-1.278-4.724a.232.232 0 0 1 .323-.327c1.671 1.172 2.591 3.381 2.591 6.219 0 6.242-4.426 13.863-9.865 17.003-1.574.908-3.084 1.356-4.488 1.356zm-2.969-1.542c.813.651 1.82.877 2.968.877h.001c1.321 0 2.753-.327 4.254-1.194 5.311-3.067 9.632-10.463 9.632-16.556 0-1.979-.463-3.599-1.326-4.761.411 1.035.625 2.275.625 3.635 0 6.243-4.426 13.883-9.865 17.023-1.574.909-3.084 1.317-4.49 1.317-.641 0-1.243-.149-1.799-.341z' fill='#607D8B'/><path d='M113.097 197.23c5.384-3.108 9.748-10.636 9.748-16.814 0-2.051-.483-3.692-1.323-4.86-1.784-1.252-4.374-1.194-7.257.47-5.384 3.108-9.748 10.636-9.748 16.814 0 2.051.483 3.692 1.323 4.86 1.784 1.252 4.374 1.194 7.257-.47' fill='#FAFAFA'/><path d='M108.724 198.614c-1.142 0-2.158-.213-3.019-.817-.021-.014-.04.014-.055-.007-.894-1.244-1.367-2.948-1.367-4.973 0-6.242 4.426-13.864 9.865-17.005 1.574-.908 3.084-1.363 4.49-1.363 1.142 0 2.158.309 3.018.913a.23.23 0 0 1 .056.056c.894 1.244 1.367 2.972 1.367 4.997 0 6.243-4.426 13.783-9.865 16.923-1.574.909-3.084 1.276-4.49 1.276zm-2.718-1.109c.774.532 1.688.776 2.718.776 1.323 0 2.754-.413 4.256-1.28 5.311-3.066 9.631-10.505 9.631-16.598 0-1.909-.434-3.523-1.255-4.685-.774-.533-1.688-.799-2.718-.799-1.323 0-2.755.441-4.256 1.308-5.311 3.066-9.631 10.506-9.631 16.599 0 1.909.434 3.517 1.255 4.679z' fill='#607D8B'/><path d='M149.318 114.262l-9.984 8.878 15.893 11.031 5.589-6.112-11.498-13.797' fill='#FAFAFA'/><path d='M169.676 120.84l-9.748 5.627c-3.642 2.103-9.528 2.113-13.147.024-3.62-2.089-3.601-5.488.041-7.591l9.495-5.608-6.729-3.885-81.836 47.071 45.923 26.514 3.081-1.779c.631-.365.869-.898.618-1.39-2.357-4.632-2.593-9.546-.683-14.262 5.638-13.92 24.509-24.815 48.618-28.07 8.169-1.103 16.68-.967 24.704.394.852.145 1.776.008 2.407-.357l3.081-1.778-25.825-14.91' fill='#FAFAFA'/><path d='M113.675 183.459a.47.47 0 0 1-.233-.062l-45.924-26.515a.468.468 0 0 1 .001-.809l81.836-47.071a.467.467 0 0 1 .466 0l6.729 3.885a.467.467 0 0 1-.467.809l-6.496-3.75-80.9 46.533 44.988 25.973 2.848-1.644c.192-.111.62-.409.435-.773-2.416-4.748-2.658-9.814-.7-14.65 2.806-6.927 8.885-13.242 17.582-18.263 8.657-4.998 19.518-8.489 31.407-10.094 8.198-1.107 16.79-.97 24.844.397.739.125 1.561.007 2.095-.301l2.381-1.374-25.125-14.506a.467.467 0 0 1 .467-.809l25.825 14.91a.467.467 0 0 1 0 .809l-3.081 1.779c-.721.417-1.763.575-2.718.413-7.963-1.351-16.457-1.486-24.563-.392-11.77 1.589-22.512 5.039-31.065 9.977-8.514 4.916-14.456 11.073-17.183 17.805-1.854 4.578-1.623 9.376.666 13.875.37.725.055 1.513-.8 2.006l-3.081 1.78a.476.476 0 0 1-.234.062' fill='#455A64'/><path d='M153.316 128.279c-2.413 0-4.821-.528-6.652-1.586-1.818-1.049-2.82-2.461-2.82-3.975 0-1.527 1.016-2.955 2.861-4.02l9.493-5.607a.233.233 0 1 1 .238.402l-9.496 5.609c-1.696.979-2.628 2.263-2.628 3.616 0 1.34.918 2.608 2.585 3.571 3.549 2.049 9.343 2.038 12.914-.024l9.748-5.628a.234.234 0 0 1 .234.405l-9.748 5.628c-1.858 1.072-4.296 1.609-6.729 1.609' fill='#607D8B'/><path d='M113.675 182.992l-45.913-26.508M113.675 183.342a.346.346 0 0 1-.175-.047l-45.913-26.508a.35.35 0 1 1 .35-.607l45.913 26.508a.35.35 0 0 1-.175.654' fill='#455A64'/><path d='M67.762 156.484v54.001c0 1.09.77 2.418 1.72 2.967l42.473 24.521c.95.549 1.72.11 1.72-.98v-54.001' fill='#FAFAFA'/><path d='M112.727 238.561c-.297 0-.62-.095-.947-.285l-42.473-24.521c-1.063-.613-1.895-2.05-1.895-3.27v-54.001a.35.35 0 1 1 .701 0v54.001c0 .96.707 2.18 1.544 2.663l42.473 24.522c.344.198.661.243.87.122.206-.119.325-.411.325-.799v-54.001a.35.35 0 1 1 .7 0v54.001c0 .655-.239 1.154-.675 1.406a1.235 1.235 0 0 1-.623.162' fill='#455A64'/><path d='M112.86 147.512h-.001c-2.318 0-4.499-.522-6.142-1.471-1.705-.984-2.643-2.315-2.643-3.749 0-1.445.952-2.791 2.68-3.788l12.041-6.953c1.668-.962 3.874-1.493 6.212-1.493 2.318 0 4.499.523 6.143 1.472 1.704.984 2.643 2.315 2.643 3.748 0 1.446-.952 2.791-2.68 3.789l-12.042 6.952c-1.668.963-3.874 1.493-6.211 1.493zm12.147-16.753c-2.217 0-4.298.497-5.861 1.399l-12.042 6.952c-1.502.868-2.33 1.998-2.33 3.182 0 1.173.815 2.289 2.293 3.142 1.538.889 3.596 1.378 5.792 1.378h.001c2.216 0 4.298-.497 5.861-1.399l12.041-6.953c1.502-.867 2.33-1.997 2.33-3.182 0-1.172-.814-2.288-2.292-3.142-1.539-.888-3.596-1.377-5.793-1.377z' fill='#607D8B'/><path d='M165.63 123.219l-5.734 3.311c-3.167 1.828-8.286 1.837-11.433.02-3.147-1.817-3.131-4.772.036-6.601l5.734-3.31 11.397 6.58' fill='#FAFAFA'/><path d='M154.233 117.448l9.995 5.771-4.682 2.704c-1.434.827-3.352 1.283-5.399 1.283-2.029 0-3.923-.449-5.333-1.263-1.29-.744-2-1.694-2-2.674 0-.991.723-1.955 2.036-2.713l5.383-3.108m0-.809l-5.734 3.31c-3.167 1.829-3.183 4.784-.036 6.601 1.568.905 3.623 1.357 5.684 1.357 2.077 0 4.159-.46 5.749-1.377l5.734-3.311-11.397-6.58M145.445 179.667c-1.773 0-3.241-.85-4.243-2.245-.067-.092-.057-.275.023-.356.08-.081.207-.12.3-.055.781.548 1.706.812 2.751.811 1.322 0 2.754-.446 4.256-1.313 5.31-3.066 9.631-10.522 9.631-16.615 0-1.927-.442-3.562-1.279-4.726a.235.235 0 0 1 .024-.301.232.232 0 0 1 .3-.027c1.67 1.172 2.59 3.38 2.59 6.219 0 6.242-4.425 13.987-9.865 17.127-1.573.908-3.083 1.481-4.488 1.481zM142.476 178c.814.651 1.82 1.002 2.969 1.002 1.322 0 2.753-.452 4.255-1.32 5.31-3.065 9.631-10.523 9.631-16.617 0-1.98-.463-3.63-1.325-4.793.411 1.035.624 2.26.624 3.62 0 6.242-4.425 13.875-9.865 17.015-1.573.909-3.084 1.376-4.489 1.376a5.49 5.49 0 0 1-1.8-.283z' fill='#607D8B'/><path d='M148.648 176.704c5.384-3.108 9.748-10.636 9.748-16.813 0-2.052-.483-3.693-1.322-4.861-1.785-1.252-4.375-1.194-7.258.471-5.383 3.108-9.748 10.636-9.748 16.813 0 2.051.484 3.692 1.323 4.86 1.785 1.253 4.374 1.195 7.257-.47' fill='#FAFAFA'/><path d='M144.276 178.276c-1.143 0-2.158-.307-3.019-.911a.217.217 0 0 1-.055-.054c-.895-1.244-1.367-2.972-1.367-4.997 0-6.241 4.425-13.875 9.865-17.016 1.573-.908 3.084-1.369 4.489-1.369 1.143 0 2.158.307 3.019.91a.24.24 0 0 1 .055.055c.894 1.244 1.367 2.971 1.367 4.997 0 6.241-4.425 13.875-9.865 17.016-1.573.908-3.084 1.369-4.489 1.369zm-2.718-1.172c.773.533 1.687.901 2.718.901 1.322 0 2.754-.538 4.256-1.405 5.31-3.066 9.631-10.567 9.631-16.661 0-1.908-.434-3.554-1.256-4.716-.774-.532-1.688-.814-2.718-.814-1.322 0-2.754.433-4.256 1.3-5.31 3.066-9.631 10.564-9.631 16.657 0 1.91.434 3.576 1.256 4.738z' fill='#607D8B'/><path d='M150.72 172.361l-.363-.295a24.105 24.105 0 0 0 2.148-3.128 24.05 24.05 0 0 0 1.977-4.375l.443.149a24.54 24.54 0 0 1-2.015 4.46 24.61 24.61 0 0 1-2.19 3.189M115.917 191.514l-.363-.294a24.174 24.174 0 0 0 2.148-3.128 24.038 24.038 0 0 0 1.976-4.375l.443.148a24.48 24.48 0 0 1-2.015 4.461 24.662 24.662 0 0 1-2.189 3.188M114 237.476V182.584 237.476' fill='#607D8B'/><g><path d='M81.822 37.474c.017-.135-.075-.28-.267-.392-.327-.188-.826-.21-1.109-.045l-6.012 3.471c-.131.076-.194.178-.191.285.002.132.002.461.002.578v.043l-.007.128-6.591 3.779c-.001 0-2.077 1.046-2.787 5.192 0 0-.912 6.961-.898 19.745.015 12.57.606 17.07 1.167 21.351.22 1.684 3.001 2.125 3.001 2.125.331.04.698-.027 1.08-.248l75.273-43.551c1.808-1.069 2.667-3.719 3.056-6.284 1.213-7.99 1.675-32.978-.275-39.878-.196-.693-.51-1.083-.868-1.282l-2.086-.79c-.727.028-1.416.467-1.534.535L82.032 37.072l-.21.402' fill='#FFF'/><path d='M144.311 1.701l2.085.79c.358.199.672.589.868 1.282 1.949 6.9 1.487 31.887.275 39.878-.39 2.565-1.249 5.215-3.056 6.284L69.21 93.486a1.78 1.78 0 0 1-.896.258l-.183-.011c0 .001-2.782-.44-3.003-2.124-.56-4.282-1.151-8.781-1.165-21.351-.015-12.784.897-19.745.897-19.745.71-4.146 2.787-5.192 2.787-5.192l6.591-3.779.007-.128v-.043c0-.117 0-.446-.002-.578-.003-.107.059-.21.191-.285l6.012-3.472a.98.98 0 0 1 .481-.11c.218 0 .449.053.627.156.193.112.285.258.268.392l.211-.402 60.744-34.836c.117-.068.806-.507 1.534-.535m0-.997l-.039.001c-.618.023-1.283.244-1.974.656l-.021.012-60.519 34.706a2.358 2.358 0 0 0-.831-.15c-.365 0-.704.084-.98.244l-6.012 3.471c-.442.255-.699.69-.689 1.166l.001.15-6.08 3.487c-.373.199-2.542 1.531-3.29 5.898l-.006.039c-.009.07-.92 7.173-.906 19.875.014 12.62.603 17.116 1.172 21.465l.002.015c.308 2.355 3.475 2.923 3.836 2.98l.034.004c.101.013.204.019.305.019a2.77 2.77 0 0 0 1.396-.392l75.273-43.552c1.811-1.071 2.999-3.423 3.542-6.997 1.186-7.814 1.734-33.096-.301-40.299-.253-.893-.704-1.527-1.343-1.882l-.132-.062-2.085-.789a.973.973 0 0 0-.353-.065' fill='#455A64'/><path d='M128.267 11.565l1.495.434-56.339 32.326' fill='#FFF'/><path d='M74.202 90.545a.5.5 0 0 1-.25-.931l18.437-10.645a.499.499 0 1 1 .499.864L74.451 90.478l-.249.067M75.764 42.654l-.108-.062.046-.171 5.135-2.964.17.045-.045.171-5.135 2.964-.063.017M70.52 90.375V46.421l.063-.036L137.84 7.554v43.954l-.062.036L70.52 90.375zm.25-43.811v43.38l66.821-38.579V7.985L70.77 46.564z' fill='#607D8B'/><path d='M86.986 83.182c-.23.149-.612.384-.849.523l-11.505 6.701c-.237.139-.206.252.068.252h.565c.275 0 .693-.113.93-.252L87.7 83.705c.237-.139.428-.253.425-.256a11.29 11.29 0 0 1-.006-.503c0-.274-.188-.377-.418-.227l-.715.463' fill='#607D8B'/><path d='M75.266 90.782H74.7c-.2 0-.316-.056-.346-.166-.03-.11.043-.217.215-.317l11.505-6.702c.236-.138.615-.371.844-.519l.715-.464a.488.488 0 0 1 .266-.089c.172 0 .345.13.345.421 0 .214.001.363.003.437l.006.004-.004.069c-.003.075-.003.075-.486.356l-11.505 6.702a2.282 2.282 0 0 1-.992.268zm-.6-.25l.034.001h.566c.252 0 .649-.108.866-.234l11.505-6.702c.168-.098.294-.173.361-.214-.004-.084-.004-.218-.004-.437l-.095-.171-.131.049-.714.463c-.232.15-.616.386-.854.525l-11.505 6.702-.029.018z' fill='#607D8B'/><path d='M75.266 89.871H74.7c-.2 0-.316-.056-.346-.166-.03-.11.043-.217.215-.317l11.505-6.702c.258-.151.694-.268.993-.268h.565c.2 0 .316.056.346.166.03.11-.043.217-.215.317l-11.505 6.702a2.282 2.282 0 0 1-.992.268zm-.6-.25l.034.001h.566c.252 0 .649-.107.866-.234l11.505-6.702.03-.018-.035-.001h-.565c-.252 0-.649.108-.867.234l-11.505 6.702-.029.018zM74.37 90.801v-1.247 1.247' fill='#607D8B'/><path d='M68.13 93.901c-.751-.093-1.314-.737-1.439-1.376-.831-4.238-1.151-8.782-1.165-21.352-.015-12.784.897-19.745.897-19.745.711-4.146 2.787-5.192 2.787-5.192l74.859-43.219c.223-.129 2.487-1.584 3.195.923 1.95 6.9 1.488 31.887.275 39.878-.389 2.565-1.248 5.215-3.056 6.283L69.21 93.653c-.382.221-.749.288-1.08.248 0 0-2.781-.441-3.001-2.125-.561-4.281-1.152-8.781-1.167-21.351-.014-12.784.898-19.745.898-19.745.71-4.146 2.787-5.191 2.787-5.191l6.598-3.81.871-.119 6.599-3.83.046-.461L68.13 93.901' fill='#FAFAFA'/><path d='M68.317 94.161l-.215-.013h-.001l-.244-.047c-.719-.156-2.772-.736-2.976-2.292-.568-4.34-1.154-8.813-1.168-21.384-.014-12.654.891-19.707.9-19.777.725-4.231 2.832-5.338 2.922-5.382l6.628-3.827.87-.119 6.446-3.742.034-.334a.248.248 0 0 1 .273-.223.248.248 0 0 1 .223.272l-.059.589-6.752 3.919-.87.118-6.556 3.785c-.031.016-1.99 1.068-2.666 5.018-.007.06-.908 7.086-.894 19.702.014 12.539.597 16.996 1.161 21.305.091.691.689 1.154 1.309 1.452a1.95 1.95 0 0 1-.236-.609c-.781-3.984-1.155-8.202-1.17-21.399-.014-12.653.891-19.707.9-19.777.725-4.231 2.832-5.337 2.922-5.382-.004.001 74.444-42.98 74.846-43.212l.028-.017c.904-.538 1.72-.688 2.36-.433.555.221.949.733 1.172 1.52 2.014 7.128 1.46 32.219.281 39.983-.507 3.341-1.575 5.515-3.175 6.462L69.335 93.869a2.023 2.023 0 0 1-1.018.292zm-.147-.507c.293.036.604-.037.915-.217l75.273-43.551c1.823-1.078 2.602-3.915 2.934-6.106 1.174-7.731 1.731-32.695-.268-39.772-.178-.631-.473-1.032-.876-1.192-.484-.193-1.166-.052-1.921.397l-.034.021-74.858 43.218c-.031.017-1.989 1.069-2.666 5.019-.007.059-.908 7.085-.894 19.702.015 13.155.386 17.351 1.161 21.303.09.461.476.983 1.037 1.139.114.025.185.037.196.039h.001z' fill='#455A64'/><path d='M69.317 68.982c.489-.281.885-.056.885.505 0 .56-.396 1.243-.885 1.525-.488.282-.884.057-.884-.504 0-.56.396-1.243.884-1.526' fill='#FFF'/><path d='M68.92 71.133c-.289 0-.487-.228-.487-.625 0-.56.396-1.243.884-1.526a.812.812 0 0 1 .397-.121c.289 0 .488.229.488.626 0 .56-.396 1.243-.885 1.525a.812.812 0 0 1-.397.121m.794-2.459a.976.976 0 0 0-.49.147c-.548.317-.978 1.058-.978 1.687 0 .486.271.812.674.812a.985.985 0 0 0 .491-.146c.548-.317.978-1.057.978-1.687 0-.486-.272-.813-.675-.813' fill='#8097A2'/><path d='M68.92 70.947c-.271 0-.299-.307-.299-.439 0-.491.361-1.116.79-1.363a.632.632 0 0 1 .303-.096c.272 0 .301.306.301.438 0 .491-.363 1.116-.791 1.364a.629.629 0 0 1-.304.096m.794-2.086a.812.812 0 0 0-.397.121c-.488.283-.884.966-.884 1.526 0 .397.198.625.487.625a.812.812 0 0 0 .397-.121c.489-.282.885-.965.885-1.525 0-.397-.199-.626-.488-.626' fill='#8097A2'/><path d='M69.444 85.35c.264-.152.477-.031.477.272 0 .303-.213.67-.477.822-.263.153-.477.031-.477-.271 0-.302.214-.671.477-.823' fill='#FFF'/><path d='M69.23 86.51c-.156 0-.263-.123-.263-.337 0-.302.214-.671.477-.823a.431.431 0 0 1 .214-.066c.156 0 .263.124.263.338 0 .303-.213.67-.477.822a.431.431 0 0 1-.214.066m.428-1.412c-.1 0-.203.029-.307.09-.32.185-.57.618-.57.985 0 .309.185.524.449.524a.63.63 0 0 0 .308-.09c.32-.185.57-.618.57-.985 0-.309-.185-.524-.45-.524' fill='#8097A2'/><path d='M69.23 86.322l-.076-.149c0-.235.179-.544.384-.661l.12-.041.076.151c0 .234-.179.542-.383.66l-.121.04m.428-1.038a.431.431 0 0 0-.214.066c-.263.152-.477.521-.477.823 0 .214.107.337.263.337a.431.431 0 0 0 .214-.066c.264-.152.477-.519.477-.822 0-.214-.107-.338-.263-.338' fill='#8097A2'/><path d='M139.278 7.769v43.667L72.208 90.16V46.493l67.07-38.724' fill='#455A64'/><path d='M72.083 90.375V46.421l.063-.036 67.257-38.831v43.954l-.062.036-67.258 38.831zm.25-43.811v43.38l66.821-38.579V7.985L72.333 46.564z' fill='#607D8B'/></g><path d='M125.737 88.647l-7.639 3.334V84l-11.459 4.713v8.269L99 100.315l13.369 3.646 13.368-15.314' fill='#455A64'/></g></svg>";function Le(){this.loadIcon_();var e=document.createElement("div");(s=e.style).position="fixed",s.top=0,s.right=0,s.bottom=0,s.left=0,s.backgroundColor="gray",s.fontFamily="sans-serif",s.zIndex=1e6;var t=document.createElement("img");t.src=this.icon,(s=t.style).marginLeft="25%",s.marginTop="25%",s.width="50%",e.appendChild(t);var i=document.createElement("div");(s=i.style).textAlign="center",s.fontSize="16px",s.lineHeight="24px",s.margin="24px 25%",s.width="50%",i.innerHTML="Place your phone into your Cardboard viewer.",e.appendChild(i);var n=document.createElement("div");(s=n.style).backgroundColor="#CFD8DC",s.position="fixed",s.bottom=0,s.width="100%",s.height="48px",s.padding="14px 24px",s.boxSizing="border-box",s.color="#656A6B",e.appendChild(n);var r=document.createElement("div");r.style.float="left",r.innerHTML="No Cardboard viewer?";var s,o=document.createElement("a");o.href="https://www.google.com/get/cardboard/get-cardboard/",o.innerHTML="get one",o.target="_blank",(s=o.style).float="right",s.fontWeight=600,s.textTransform="uppercase",s.borderLeft="1px solid gray",s.paddingLeft="24px",s.textDecoration="none",s.color="#656A6B",n.appendChild(r),n.appendChild(o),this.overlay=e,this.text=i,this.hide()}Le.prototype.show=function(e){e||this.overlay.parentElement?e&&(this.overlay.parentElement&&this.overlay.parentElement!=e&&this.overlay.parentElement.removeChild(this.overlay),e.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var t=this.overlay.querySelector("img").style;N()?(t.width="20%",t.marginLeft="40%",t.marginTop="3%"):(t.width="50%",t.marginLeft="25%",t.marginTop="25%")},Le.prototype.hide=function(){this.overlay.style.display="none"},Le.prototype.showTemporarily=function(e,t){this.show(t),this.timer=setTimeout(this.hide.bind(this),e)},Le.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},Le.prototype.update=function(){this.disableShowTemporarily(),!N()&&L()?this.show():this.hide()},Le.prototype.loadIcon_=function(){this.icon=h("image/svg+xml",be)};var Se="CardboardV1",Oe="WEBVR_CARDBOARD_VIEWER",Ce="webvr-polyfill-viewer-selector";function Pe(e){try{this.selectedKey=localStorage.getItem(Oe)}catch(e){console.error("Failed to load viewer profile: %s",e)}this.selectedKey||(this.selectedKey=e||Se),this.dialog=this.createDialog_(ge.Viewers),this.root=null,this.onChangeCallbacks_=[]}function ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ue(e,t){return e(t={exports:{}},t.exports),t.exports}Pe.prototype.show=function(e){this.root=e,e.appendChild(this.dialog),this.dialog.querySelector("#"+this.selectedKey).checked=!0,this.dialog.style.display="block"},Pe.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},Pe.prototype.getCurrentViewer=function(){return ge.Viewers[this.selectedKey]},Pe.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},Pe.prototype.onChange=function(e){this.onChangeCallbacks_.push(e)},Pe.prototype.fireOnChange_=function(e){for(var t=0;t<this.onChangeCallbacks_.length;t++)this.onChangeCallbacks_[t](e)},Pe.prototype.onSave_=function(){if(this.selectedKey=this.getSelectedKey_(),this.selectedKey&&ge.Viewers[this.selectedKey]){this.fireOnChange_(ge.Viewers[this.selectedKey]);try{localStorage.setItem(Oe,this.selectedKey)}catch(e){console.error("Failed to save viewer profile: %s",e)}this.hide()}else console.error("ViewerSelector.onSave_: this should never happen!")},Pe.prototype.createDialog_=function(e){var t=document.createElement("div");t.classList.add(Ce),t.style.display="none";var i=document.createElement("div");(s=i.style).position="fixed",s.left=0,s.top=0,s.width="100%",s.height="100%",s.background="rgba(0, 0, 0, 0.3)",i.addEventListener("click",this.hide.bind(this));var n=280,r=document.createElement("div"),s=r.style;for(var o in s.boxSizing="border-box",s.position="fixed",s.top="24px",s.left="50%",s.marginLeft=-n/2+"px",s.width=n+"px",s.padding="24px",s.overflow="hidden",s.background="#fafafa",s.fontFamily="'Roboto', sans-serif",s.boxShadow="0px 5px 20px #666",r.appendChild(this.createH1_("Select your viewer")),e)r.appendChild(this.createChoice_(o,e[o].label));return r.appendChild(this.createButton_("Save",this.onSave_.bind(this))),t.appendChild(i),t.appendChild(r),t},Pe.prototype.createH1_=function(e){var t=document.createElement("h1"),i=t.style;return i.color="black",i.fontSize="20px",i.fontWeight="bold",i.marginTop=0,i.marginBottom="24px",t.innerHTML=e,t},Pe.prototype.createChoice_=function(e,t){var i=document.createElement("div");i.style.marginTop="8px",i.style.color="black";var n=document.createElement("input");n.style.fontSize="30px",n.setAttribute("id",e),n.setAttribute("type","radio"),n.setAttribute("value",e),n.setAttribute("name","field");var r=document.createElement("label");return r.style.marginLeft="4px",r.setAttribute("for",e),r.innerHTML=t,i.appendChild(n),i.appendChild(r),i},Pe.prototype.createButton_=function(e,t){var i=document.createElement("button");i.innerHTML=e;var n=i.style;return n.float="right",n.textTransform="uppercase",n.color="#1094f7",n.fontSize="14px",n.letterSpacing=0,n.border=0,n.background="none",n.marginTop="16px",i.addEventListener("click",t),i},void 0!==e||void 0!==i||"undefined"!=typeof self&&self;var Be=ke(Ue((function(i,n){!function(e,t){i.exports=t()}(0,(function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(i,n,r){var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=r(1),u=void 0!==t&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(t.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!e.MSStream,c=function(){function t(){o(this,t),u?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("playsinline",""),this.noSleepVideo.setAttribute("src",a),this.noSleepVideo.addEventListener("timeupdate",function(e){this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())}.bind(this)))}return s(t,[{key:"enable",value:function(){u?(this.disable(),this.noSleepTimer=e.setInterval((function(){e.location.href="/",e.setTimeout(e.stop,0)}),15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){u?this.noSleepTimer&&(e.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),t}();i.exports=c},function(e,t,i){e.exports="data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xI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OtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}])}))}))),_e=1e3,Re=[0,0,.5,1],Qe=[.5,0,.5,1],Ye=e.requestAnimationFrame,Fe=e.cancelAnimationFrame;function Ve(){this.leftProjectionMatrix=new Float32Array(16),this.leftViewMatrix=new Float32Array(16),this.rightProjectionMatrix=new Float32Array(16),this.rightViewMatrix=new Float32Array(16),this.pose=null}function He(e){Object.defineProperties(this,{hasPosition:{writable:!1,enumerable:!0,value:e.hasPosition},hasExternalDisplay:{writable:!1,enumerable:!0,value:e.hasExternalDisplay},canPresent:{writable:!1,enumerable:!0,value:e.canPresent},maxLayers:{writable:!1,enumerable:!0,value:e.maxLayers},hasOrientation:{enumerable:!0,get:function(){return _("VRDisplayCapabilities.prototype.hasOrientation","VRDisplay.prototype.getFrameData"),e.hasOrientation}}})}function Ge(e){var t=!("wakelock"in(e=e||{}))||e.wakelock;this.isPolyfilled=!0,this.displayId=_e++,this.displayName="",this.depthNear=.01,this.depthFar=1e4,this.isPresenting=!1,Object.defineProperty(this,"isConnected",{get:function(){return _("VRDisplay.prototype.isConnected","VRDisplayCapabilities.prototype.hasExternalDisplay"),!1}}),this.capabilities=new He({hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1}),this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.originalParent_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,t&&L()&&(this.wakelock_=new Be)}Ge.prototype.getFrameData=function(e){return C(e,this._getPose(),this)},Ge.prototype.getPose=function(){return _("VRDisplay.prototype.getPose","VRDisplay.prototype.getFrameData"),this._getPose()},Ge.prototype.resetPose=function(){return _("VRDisplay.prototype.resetPose"),this._resetPose()},Ge.prototype.getImmediatePose=function(){return _("VRDisplay.prototype.getImmediatePose","VRDisplay.prototype.getFrameData"),this._getPose()},Ge.prototype.requestAnimationFrame=function(e){return Ye(e)},Ge.prototype.cancelAnimationFrame=function(e){return Fe(e)},Ge.prototype.wrapForFullscreen=function(e){if(p())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var t=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",t.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;if(this.fullscreenElement_&&(this.originalParent_?this.originalParent_.appendChild(this.fullscreenElement_):this.fullscreenElement_.parentElement.removeChild(this.fullscreenElement_)),this.fullscreenElement_=e,this.originalParent_=e.parentElement,this.originalParent_||document.body.appendChild(e),!this.fullscreenWrapper_.parentElement){var i=this.fullscreenElement_.parentElement;i.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),i.removeChild(this.fullscreenElement_)}this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var n=this;function r(){if(n.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];n.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}return r(),this.fullscreenWrapper_},Ge.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var t=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),this.originalParent_===t?t.insertBefore(e,this.fullscreenWrapper_):this.originalParent_&&this.originalParent_.appendChild(e),t.removeChild(this.fullscreenWrapper_),e}},Ge.prototype.requestPresent=function(e){var t=this.isPresenting,i=this;return e instanceof Array||(_("VRDisplay.prototype.requestPresent with non-array argument","an array of VRLayers as the first argument"),e=[e]),new Promise((function(n,r){if(i.capabilities.canPresent)if(0==e.length||e.length>i.capabilities.maxLayers)r(new Error("Invalid number of layers."));else{var s=e[0];if(s.source){var o=s.leftBounds||Re,a=s.rightBounds||Qe;if(t){var u=i.layer_;u.source!==s.source&&(u.source=s.source);for(var c=0;c<4;c++)u.leftBounds[c]=o[c],u.rightBounds[c]=a[c];return i.wrapForFullscreen(i.layer_.source),i.updatePresent_(),void n()}if(i.layer_={predistorted:s.predistorted,source:s.source,leftBounds:o.slice(0),rightBounds:a.slice(0)},i.waitingForPresent_=!1,i.layer_&&i.layer_.source){var l=i.wrapForFullscreen(i.layer_.source),h=function(){var e=j();i.isPresenting=l===e,i.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary").catch((function(e){console.error("screen.orientation.lock() failed due to",e.message)})),i.waitingForPresent_=!1,i.beginPresent_(),n()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),i.removeFullscreenWrapper(),i.disableWakeLock(),i.endPresent_(),i.removeFullscreenListeners_()),i.fireVRDisplayPresentChange_()},d=function(){i.waitingForPresent_&&(i.removeFullscreenWrapper(),i.removeFullscreenListeners_(),i.disableWakeLock(),i.waitingForPresent_=!1,i.isPresenting=!1,r(new Error("Unable to present.")))};i.addFullscreenListeners_(l,h,d),x(l)?(i.enableWakeLock(),i.waitingForPresent_=!0):(p()||M())&&(i.enableWakeLock(),i.isPresenting=!0,i.beginPresent_(),i.fireVRDisplayPresentChange_(),n())}i.waitingForPresent_||p()||(E(),r(new Error("Unable to present.")))}else n()}else r(new Error("VRDisplay is not capable of presenting."))}))},Ge.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.disableWakeLock(),new Promise((function(i,n){e?(!E()&&p()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),M()&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.endPresent_(),t.fireVRDisplayPresentChange_()),i()):n(new Error("Was not presenting to VRDisplay."))}))},Ge.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},Ge.prototype.fireVRDisplayPresentChange_=function(){var t=new CustomEvent("vrdisplaypresentchange",{detail:{display:this}});e.dispatchEvent(t)},Ge.prototype.fireVRDisplayConnect_=function(){var t=new CustomEvent("vrdisplayconnect",{detail:{display:this}});e.dispatchEvent(t)},Ge.prototype.addFullscreenListeners_=function(e,t,i){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=t,this.fullscreenErrorHandler_=i,t&&(document.fullscreenEnabled?e.addEventListener("fullscreenchange",t,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenchange",t,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenchange",t,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenchange",t,!1)),i&&(document.fullscreenEnabled?e.addEventListener("fullscreenerror",i,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenerror",i,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenerror",i,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenerror",i,!1))},Ge.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var t=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",t,!1),e.removeEventListener("webkitfullscreenchange",t,!1),document.removeEventListener("mozfullscreenchange",t,!1),e.removeEventListener("msfullscreenchange",t,!1)}if(this.fullscreenErrorHandler_){var i=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",i,!1),e.removeEventListener("webkitfullscreenerror",i,!1),document.removeEventListener("mozfullscreenerror",i,!1),e.removeEventListener("msfullscreenerror",i,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},Ge.prototype.enableWakeLock=function(){this.wakelock_&&this.wakelock_.enable()},Ge.prototype.disableWakeLock=function(){this.wakelock_&&this.wakelock_.disable()},Ge.prototype.beginPresent_=function(){},Ge.prototype.endPresent_=function(){},Ge.prototype.submitFrame=function(e){},Ge.prototype.getEyeParameters=function(e){return null};var qe={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1},We={LEFT:"left",RIGHT:"right"};function Ke(t){var i=S({},qe);t=S(i,t||{}),Ge.call(this,{wakelock:t.MOBILE_WAKE_LOCK}),this.config=t,this.displayName="Cardboard VRDisplay",this.capabilities=new He({hasPosition:!1,hasOrientation:!0,hasExternalDisplay:!1,canPresent:!0,maxLayers:1}),this.stageParameters=null,this.bufferScale_=this.config.BUFFER_SCALE,this.poseSensor_=new Ie(this.config),this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new ve(this.config.DPDB_URL,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new ge(this.dpdb_.getDeviceParams(),t.ADDITIONAL_VIEWERS),this.viewerSelector_=new Pe(t.DEFAULT_VIEWER),this.viewerSelector_.onChange(this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),this.config.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new Le),p()&&e.addEventListener("resize",this.onResize_.bind(this))}return Ke.prototype=Object.create(Ge.prototype),Ke.prototype._getPose=function(){return{position:null,orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},Ke.prototype._resetPose=function(){this.poseSensor_.resetPose&&this.poseSensor_.resetPose()},Ke.prototype._getFieldOfView=function(e){var t;if(e==We.LEFT)t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=We.RIGHT)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return t},Ke.prototype._getEyeOffset=function(e){var t;if(e==We.LEFT)t=[.5*-this.deviceInfo_.viewer.interLensDistance,0,0];else{if(e!=We.RIGHT)return console.error("Invalid eye provided: %s",e),null;t=[.5*this.deviceInfo_.viewer.interLensDistance,0,0]}return t},Ke.prototype.getEyeParameters=function(e){var t=this._getEyeOffset(e),i=this._getFieldOfView(e),n={offset:t,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_};return Object.defineProperty(n,"fieldOfView",{enumerable:!0,get:function(){return _("VRFieldOfView","VRFrameData's projection matrices"),i}}),n},Ke.prototype.onDeviceParamsUpdated_=function(e){this.config.DEBUG&&console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_)},Ke.prototype.updateBounds_=function(){this.layer_&&this.distorter_&&(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)},Ke.prototype.beginPresent_=function(){var t=this.layer_.source.getContext("webgl");t||(t=this.layer_.source.getContext("experimental-webgl")),t||(t=this.layer_.source.getContext("webgl2")),t&&(this.layer_.predistorted?this.config.CARDBOARD_UI_DISABLED||(t.canvas.width=w()*this.bufferScale_,t.canvas.height=T()*this.bufferScale_,this.cardboardUI_=new ne(t)):(this.config.CARDBOARD_UI_DISABLED||(this.cardboardUI_=new ne(t)),this.distorter_=new V(t,this.cardboardUI_,this.config.BUFFER_SCALE,this.config.DIRTY_SUBMIT_FRAME_BINDINGS),this.distorter_.updateDeviceInfo(this.deviceInfo_)),this.cardboardUI_&&this.cardboardUI_.listen(function(e){this.viewerSelector_.show(this.layer_.source.parentElement),e.stopPropagation(),e.preventDefault()}.bind(this),function(e){this.exitPresent(),e.stopPropagation(),e.preventDefault()}.bind(this)),this.rotateInstructions_&&(N()&&L()?this.rotateInstructions_.showTemporarily(3e3,this.layer_.source.parentElement):this.rotateInstructions_.update()),this.orientationHandler=this.onOrientationChange_.bind(this),e.addEventListener("orientationchange",this.orientationHandler),this.vrdisplaypresentchangeHandler=this.updateBounds_.bind(this),e.addEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler),this.fireVRDisplayDeviceParamsChange_())},Ke.prototype.endPresent_=function(){this.distorter_&&(this.distorter_.destroy(),this.distorter_=null),this.cardboardUI_&&(this.cardboardUI_.destroy(),this.cardboardUI_=null),this.rotateInstructions_&&this.rotateInstructions_.hide(),this.viewerSelector_.hide(),e.removeEventListener("orientationchange",this.orientationHandler),e.removeEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler)},Ke.prototype.updatePresent_=function(){this.endPresent_(),this.beginPresent_()},Ke.prototype.submitFrame=function(e){if(this.distorter_)this.updateBounds_(),this.distorter_.submitFrame();else if(this.cardboardUI_&&this.layer_){var t=this.layer_.source.getContext("webgl");t||(t=this.layer_.source.getContext("experimental-webgl")),t||(t=this.layer_.source.getContext("webgl2"));var i=t.canvas;i.width==this.lastWidth&&i.height==this.lastHeight||this.cardboardUI_.onResize(),this.lastWidth=i.width,this.lastHeight=i.height,this.cardboardUI_.render()}},Ke.prototype.onOrientationChange_=function(e){this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},Ke.prototype.onResize_=function(e){if(this.layer_){var t=this.layer_.source.getContext("webgl");t||(t=this.layer_.source.getContext("experimental-webgl")),t||(t=this.layer_.source.getContext("webgl2"));var i=["position: absolute","top: 0","left: 0","width: 100vw","height: 100vh","border: 0","margin: 0","padding: 0px","box-sizing: content-box"];t.canvas.setAttribute("style",i.join("; ")+";"),O(t.canvas)}},Ke.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},Ke.prototype.fireVRDisplayDeviceParamsChange_=function(){var t=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});e.dispatchEvent(t)},Ke.VRFrameData=Ve,Ke.VRDisplay=Ge,Ke}))}))),c="0.10.12",l={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",PROVIDE_MOBILE_VRDISPLAY:!0,MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1};function h(i){this.config=a(a({},l),i),this.polyfillDisplays=[],this.enabled=!1,this.hasNative="getVRDisplays"in t,this.native={},this.native.getVRDisplays=t.getVRDisplays,this.native.VRFrameData=e.VRFrameData,this.native.VRDisplay=e.VRDisplay,(!this.hasNative||this.config.PROVIDE_MOBILE_VRDISPLAY&&s())&&(this.enable(),this.getVRDisplays().then((function(e){e&&e[0]&&e[0].fireVRDisplayConnect_&&e[0].fireVRDisplayConnect_()})))}h.prototype.getPolyfillDisplays=function(){if(this._polyfillDisplaysPopulated)return this.polyfillDisplays;if(s()){var e=new u({ADDITIONAL_VIEWERS:this.config.ADDITIONAL_VIEWERS,DEFAULT_VIEWER:this.config.DEFAULT_VIEWER,MOBILE_WAKE_LOCK:this.config.MOBILE_WAKE_LOCK,DEBUG:this.config.DEBUG,DPDB_URL:this.config.DPDB_URL,CARDBOARD_UI_DISABLED:this.config.CARDBOARD_UI_DISABLED,K_FILTER:this.config.K_FILTER,PREDICTION_TIME_S:this.config.PREDICTION_TIME_S,ROTATE_INSTRUCTIONS_DISABLED:this.config.ROTATE_INSTRUCTIONS_DISABLED,YAW_ONLY:this.config.YAW_ONLY,BUFFER_SCALE:this.config.BUFFER_SCALE,DIRTY_SUBMIT_FRAME_BINDINGS:this.config.DIRTY_SUBMIT_FRAME_BINDINGS});this.polyfillDisplays.push(e)}return this._polyfillDisplaysPopulated=!0,this.polyfillDisplays},h.prototype.enable=function(){if(this.enabled=!0,this.hasNative&&this.native.VRFrameData){var i=this.native.VRFrameData,n=new this.native.VRFrameData,r=this.native.VRDisplay.prototype.getFrameData;e.VRDisplay.prototype.getFrameData=function(e){e instanceof i?r.call(this,e):(r.call(this,n),e.pose=n.pose,o(n.leftProjectionMatrix,e.leftProjectionMatrix),o(n.rightProjectionMatrix,e.rightProjectionMatrix),o(n.leftViewMatrix,e.leftViewMatrix),o(n.rightViewMatrix,e.rightViewMatrix))}}t.getVRDisplays=this.getVRDisplays.bind(this),e.VRDisplay=u.VRDisplay,e.VRFrameData=u.VRFrameData},h.prototype.getVRDisplays=function(){var e=this;return this.config,this.hasNative?this.native.getVRDisplays.call(t).then((function(t){return t.length>0?t:e.getPolyfillDisplays()})):Promise.resolve(this.getPolyfillDisplays())},h.version=c,h.VRFrameData=u.VRFrameData,h.VRDisplay=u.VRDisplay;var d=Object.freeze({default:h}),p=d&&h||d;return void 0!==i&&i.window&&(i.document||(i.document=i.window.document),i.navigator||(i.navigator=i.window.navigator)),p}("undefined"!=typeof window?window:{screen:{width:512,height:512}},"undefined"!=typeof navigator?navigator:{userAgent:"node"});
451
+ !function(e,t){n.exports=t()}(0,(function(){var n,r,s,o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),u=function(){function e(e,t){var i=[],n=!0,r=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){r=!0,s=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=.001,l=1,h=function(e,t){return"data:"+e+","+encodeURIComponent(t)},d=function(e,t,i){return e+(t-e)*i},A=function(){var e=/iPad|iPhone|iPod/.test(t.platform);return function(){return e}}(),p=function(){var e=-1!==t.userAgent.indexOf("Version")&&-1!==t.userAgent.indexOf("Android")&&-1!==t.userAgent.indexOf("Chrome");return function(){return e}}(),M=function(){var e=/^((?!chrome|android).)*safari/i.test(t.userAgent);return function(){return e}}(),f=function(){var e=-1!==t.userAgent.indexOf("Firefox")&&-1!==t.userAgent.indexOf("Android");return function(){return e}}(),g=(n=t.userAgent.match(/.*Chrome\/([0-9]+)/),r=n?parseInt(n[1],10):null,function(){return r}),y=function(){var e=!1;return e=A()&&M()&&-1!==t.userAgent.indexOf("13_4"),function(){return e}}(),v=function(){var e=!1;if(65===g()){var i=t.userAgent.match(/.*Chrome\/([0-9\.]*)/);if(i){var n=i[1].split("."),r=u(n,4);r[0],r[1];var s=r[2],o=r[3];e=3325===parseInt(s,10)&&parseInt(o,10)<148}}return function(){return e}}(),m=function(){var e=-1!==t.userAgent.indexOf("R7 Build");return function(){return e}}(),N=function(){var t=90==e.orientation||-90==e.orientation;return m()?!t:t},D=function(e){return!(isNaN(e)||e<=c||e>l)},w=function(){return Math.max(e.screen.width,e.screen.height)*e.devicePixelRatio},T=function(){return Math.min(e.screen.width,e.screen.height)*e.devicePixelRatio},x=function(e){if(p())return!1;if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0},E=function(){if(document.exitFullscreen)document.exitFullscreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else{if(!document.msExitFullscreen)return!1;document.msExitFullscreen()}return!0},j=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},I=function(e,t,i,n){var r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,t),e.compileShader(r);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,i),e.compileShader(s);var o=e.createProgram();for(var a in e.attachShader(o,r),e.attachShader(o,s),n)e.bindAttribLocation(o,n[a],a);return e.linkProgram(o),e.deleteShader(r),e.deleteShader(s),o},z=function(e,t){for(var i={},n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),r="",s=0;s<n;s++)i[r=e.getActiveUniform(t,s).name.replace("[0]","")]=e.getUniformLocation(t,r);return i},b=function(e,t,i,n,r,s,o){var a=1/(t-i),u=1/(n-r),c=1/(s-o);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+i)*a,e[13]=(r+n)*u,e[14]=(o+s)*c,e[15]=1,e},L=function(){var i,n=!1;return i=t.userAgent||t.vendor||e.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4)))&&(n=!0),n},S=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},O=function(t){if(A()){var i=t.style.width,n=t.style.height;t.style.width=parseInt(i)+1+"px",t.style.height=parseInt(n)+"px",setTimeout((function(){t.style.width=i,t.style.height=n}),100)}e.canvas=t},C=function(){var e=Math.PI/180,t=.25*Math.PI;function i(i,n,r,s){var o=Math.tan(n?n.upDegrees*e:t),a=Math.tan(n?n.downDegrees*e:t),u=Math.tan(n?n.leftDegrees*e:t),c=Math.tan(n?n.rightDegrees*e:t),l=2/(u+c),h=2/(o+a);return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=h,i[6]=0,i[7]=0,i[8]=-(u-c)*l*.5,i[9]=(o-a)*h*.5,i[10]=s/(r-s),i[11]=-1,i[12]=0,i[13]=0,i[14]=s*r/(r-s),i[15]=0,i}function n(e,t,i){var n=t[0],r=t[1],s=t[2],o=t[3],a=n+n,u=r+r,c=s+s,l=n*a,h=n*u,d=n*c,A=r*u,p=r*c,M=s*c,f=o*a,g=o*u,y=o*c;return e[0]=1-(A+M),e[1]=h+y,e[2]=d-g,e[3]=0,e[4]=h-y,e[5]=1-(l+M),e[6]=p+f,e[7]=0,e[8]=d+g,e[9]=p-f,e[10]=1-(l+A),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function r(e,t,i){var n,r,s,o,a,u,c,l,h,d,A,p,M=i[0],f=i[1],g=i[2];return t===e?(e[12]=t[0]*M+t[4]*f+t[8]*g+t[12],e[13]=t[1]*M+t[5]*f+t[9]*g+t[13],e[14]=t[2]*M+t[6]*f+t[10]*g+t[14],e[15]=t[3]*M+t[7]*f+t[11]*g+t[15]):(n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],u=t[5],c=t[6],l=t[7],h=t[8],d=t[9],A=t[10],p=t[11],e[0]=n,e[1]=r,e[2]=s,e[3]=o,e[4]=a,e[5]=u,e[6]=c,e[7]=l,e[8]=h,e[9]=d,e[10]=A,e[11]=p,e[12]=n*M+a*f+h*g+t[12],e[13]=r*M+u*f+d*g+t[13],e[14]=s*M+c*f+A*g+t[14],e[15]=o*M+l*f+p*g+t[15]),e}function s(e,t){var i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],u=t[6],c=t[7],l=t[8],h=t[9],d=t[10],A=t[11],p=t[12],M=t[13],f=t[14],g=t[15],y=i*a-n*o,v=i*u-r*o,m=i*c-s*o,N=n*u-r*a,D=n*c-s*a,w=r*c-s*u,T=l*M-h*p,x=l*f-d*p,E=l*g-A*p,j=h*f-d*M,I=h*g-A*M,z=d*g-A*f,b=y*z-v*I+m*j+N*E-D*x+w*T;return b?(b=1/b,e[0]=(a*z-u*I+c*j)*b,e[1]=(r*I-n*z-s*j)*b,e[2]=(M*w-f*D+g*N)*b,e[3]=(d*D-h*w-A*N)*b,e[4]=(u*E-o*z-c*x)*b,e[5]=(i*z-r*E+s*x)*b,e[6]=(f*m-p*w-g*v)*b,e[7]=(l*w-d*m+A*v)*b,e[8]=(o*I-a*E+c*T)*b,e[9]=(n*E-i*I-s*T)*b,e[10]=(p*D-M*m+g*y)*b,e[11]=(h*m-l*D-A*y)*b,e[12]=(a*x-o*j-u*T)*b,e[13]=(i*j-n*x+r*T)*b,e[14]=(M*v-p*N-f*y)*b,e[15]=(l*N-h*v+d*y)*b,e):null}var o=new Float32Array([0,0,0,1]),a=new Float32Array([0,0,0]);function u(e,t,u,c,l,h){i(e,c||null,h.depthNear,h.depthFar),n(t,u.orientation||o,u.position||a),l&&r(t,t,l),s(t,t)}return function(e,t,i){return!(!e||!t||(e.pose=t,e.timestamp=t.timestamp,u(e.leftProjectionMatrix,e.leftViewMatrix,t,i._getFieldOfView("left"),i._getEyeOffset("left"),i),u(e.rightProjectionMatrix,e.rightViewMatrix,t,i._getFieldOfView("right"),i._getEyeOffset("right"),i),0))}}(),P=function(){var t=e.self!==e.top,i=k(document.referrer),n=k(e.location.href);return t&&i!==n},k=function(e){var t,i=e.indexOf("://");t=-1!==i?i+3:0;var n=e.indexOf("/",t);return-1===n&&(n=e.length),e.substring(0,n)},B=function(e){return e.w>1?(console.warn("getQuaternionAngle: w > 1"),0):2*Math.acos(e.w)},U=(s={},function(e,t){void 0===s[e]&&(console.warn("webvr-polyfill: "+t),s[e]=!0)}),Q=function(e,t){U(e,e+" has been deprecated. This may not work on native WebVR displays. "+(t?"Please use "+t+" instead.":""))};function _(e,t,i){if(t){for(var n=[],r=null,s=0;s<t.length;++s)switch(o=t[s]){case e.TEXTURE_BINDING_2D:case e.TEXTURE_BINDING_CUBE_MAP:if((u=t[++s])<e.TEXTURE0||u>e.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),n.push(null,null);break}r||(r=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(u),n.push(e.getParameter(o),null);break;case e.ACTIVE_TEXTURE:r=e.getParameter(e.ACTIVE_TEXTURE),n.push(null);break;default:n.push(e.getParameter(o))}for(i(e),s=0;s<t.length;++s){var o=t[s],a=n[s];switch(o){case e.ACTIVE_TEXTURE:break;case e.ARRAY_BUFFER_BINDING:e.bindBuffer(e.ARRAY_BUFFER,a);break;case e.COLOR_CLEAR_VALUE:e.clearColor(a[0],a[1],a[2],a[3]);break;case e.COLOR_WRITEMASK:e.colorMask(a[0],a[1],a[2],a[3]);break;case e.CURRENT_PROGRAM:e.useProgram(a);break;case e.ELEMENT_ARRAY_BUFFER_BINDING:e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,a);break;case e.FRAMEBUFFER_BINDING:e.bindFramebuffer(e.FRAMEBUFFER,a);break;case e.RENDERBUFFER_BINDING:e.bindRenderbuffer(e.RENDERBUFFER,a);break;case e.TEXTURE_BINDING_2D:if((u=t[++s])<e.TEXTURE0||u>e.TEXTURE31)break;e.activeTexture(u),e.bindTexture(e.TEXTURE_2D,a);break;case e.TEXTURE_BINDING_CUBE_MAP:var u;if((u=t[++s])<e.TEXTURE0||u>e.TEXTURE31)break;e.activeTexture(u),e.bindTexture(e.TEXTURE_CUBE_MAP,a);break;case e.VIEWPORT:e.viewport(a[0],a[1],a[2],a[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:a?e.enable(o):e.disable(o);break;default:console.log("No GL restore behavior for 0x"+o.toString(16))}r&&e.activeTexture(r)}}else i(e)}var R=_,Y=["attribute vec2 position;","attribute vec3 texCoord;","varying vec2 vTexCoord;","uniform vec4 viewportOffsetScale[2];","void main() {"," vec4 viewport = viewportOffsetScale[int(texCoord.z)];"," vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;"," gl_Position = vec4( position, 1.0, 1.0 );","}"].join("\n"),F=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");function V(e,t,i,n){this.gl=e,this.cardboardUI=t,this.bufferScale=i,this.dirtySubmitFrameBindings=n,this.ctxAttribs=e.getContextAttributes(),this.instanceExt=e.getExtension("ANGLE_instanced_arrays"),this.meshWidth=20,this.meshHeight=20,this.bufferWidth=e.drawingBufferWidth,this.bufferHeight=e.drawingBufferHeight,this.realBindFramebuffer=e.bindFramebuffer,this.realEnable=e.enable,this.realDisable=e.disable,this.realColorMask=e.colorMask,this.realClearColor=e.clearColor,this.realViewport=e.viewport,A()||(this.realCanvasWidth=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"width"),this.realCanvasHeight=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"height")),this.isPatched=!1,this.lastBoundFramebuffer=null,this.cullFace=!1,this.depthTest=!1,this.blend=!1,this.scissorTest=!1,this.stencilTest=!1,this.viewport=[0,0,0,0],this.colorMask=[!0,!0,!0,!0],this.clearColor=[0,0,0,0],this.attribs={position:0,texCoord:1},this.program=I(e,Y,F,this.attribs),this.uniforms=z(e,this.program),this.viewportOffsetScale=new Float32Array(8),this.setTextureBounds(),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.indexCount=0,this.renderTarget=e.createTexture(),this.framebuffer=e.createFramebuffer(),this.depthStencilBuffer=null,this.depthBuffer=null,this.stencilBuffer=null,this.ctxAttribs.depth&&this.ctxAttribs.stencil?this.depthStencilBuffer=e.createRenderbuffer():this.ctxAttribs.depth?this.depthBuffer=e.createRenderbuffer():this.ctxAttribs.stencil&&(this.stencilBuffer=e.createRenderbuffer()),this.patch(),this.onResize()}V.prototype.destroy=function(){var e=this.gl;this.unpatch(),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer),e.deleteTexture(this.renderTarget),e.deleteFramebuffer(this.framebuffer),this.depthStencilBuffer&&e.deleteRenderbuffer(this.depthStencilBuffer),this.depthBuffer&&e.deleteRenderbuffer(this.depthBuffer),this.stencilBuffer&&e.deleteRenderbuffer(this.stencilBuffer),this.cardboardUI&&this.cardboardUI.destroy()},V.prototype.onResize=function(){var e=this.gl,t=this,i=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];R(e,i,(function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.framebuffer),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.texImage2D(e.TEXTURE_2D,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,t.bufferWidth,t.bufferHeight,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.renderTarget,0),t.ctxAttribs.depth&&t.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t.depthStencilBuffer)):t.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t.depthBuffer)):t.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,t.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,t.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),t.realClearColor.apply(e,t.clearColor)})),this.cardboardUI&&this.cardboardUI.onResize()},V.prototype.patch=function(){if(!this.isPatched){var e=this,t=this.gl.canvas,i=this.gl;A()||(t.width=w()*this.bufferScale,t.height=T()*this.bufferScale,Object.defineProperty(t,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(i){e.bufferWidth=i,e.realCanvasWidth.set.call(t,i),e.onResize()}}),Object.defineProperty(t,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(i){e.bufferHeight=i,e.realCanvasHeight.set.call(t,i),e.onResize()}})),this.lastBoundFramebuffer=i.getParameter(i.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(i.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(t,n){e.lastBoundFramebuffer=n||e.framebuffer,e.realBindFramebuffer.call(i,t,e.lastBoundFramebuffer)},this.cullFace=i.getParameter(i.CULL_FACE),this.depthTest=i.getParameter(i.DEPTH_TEST),this.blend=i.getParameter(i.BLEND),this.scissorTest=i.getParameter(i.SCISSOR_TEST),this.stencilTest=i.getParameter(i.STENCIL_TEST),i.enable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!0;break;case i.DEPTH_TEST:e.depthTest=!0;break;case i.BLEND:e.blend=!0;break;case i.SCISSOR_TEST:e.scissorTest=!0;break;case i.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(i,t)},i.disable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!1;break;case i.DEPTH_TEST:e.depthTest=!1;break;case i.BLEND:e.blend=!1;break;case i.SCISSOR_TEST:e.scissorTest=!1;break;case i.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(i,t)},this.colorMask=i.getParameter(i.COLOR_WRITEMASK),i.colorMask=function(t,n,r,s){e.colorMask[0]=t,e.colorMask[1]=n,e.colorMask[2]=r,e.colorMask[3]=s,e.realColorMask.call(i,t,n,r,s)},this.clearColor=i.getParameter(i.COLOR_CLEAR_VALUE),i.clearColor=function(t,n,r,s){e.clearColor[0]=t,e.clearColor[1]=n,e.clearColor[2]=r,e.clearColor[3]=s,e.realClearColor.call(i,t,n,r,s)},this.viewport=i.getParameter(i.VIEWPORT),i.viewport=function(t,n,r,s){e.viewport[0]=t,e.viewport[1]=n,e.viewport[2]=r,e.viewport[3]=s,e.realViewport.call(i,t,n,r,s)},this.isPatched=!0,O(t)}},V.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,t=this.gl.canvas;A()||(Object.defineProperty(t,"width",this.realCanvasWidth),Object.defineProperty(t,"height",this.realCanvasHeight)),t.width=this.bufferWidth,t.height=this.bufferHeight,e.bindFramebuffer=this.realBindFramebuffer,e.enable=this.realEnable,e.disable=this.realDisable,e.colorMask=this.realColorMask,e.clearColor=this.realClearColor,e.viewport=this.realViewport,this.lastBoundFramebuffer==this.framebuffer&&e.bindFramebuffer(e.FRAMEBUFFER,null),this.isPatched=!1,setTimeout((function(){O(t)}),1)}},V.prototype.setTextureBounds=function(e,t){e||(e=[0,0,.5,1]),t||(t=[.5,0,.5,1]),this.viewportOffsetScale[0]=e[0],this.viewportOffsetScale[1]=e[1],this.viewportOffsetScale[2]=e[2],this.viewportOffsetScale[3]=e[3],this.viewportOffsetScale[4]=t[0],this.viewportOffsetScale[5]=t[1],this.viewportOffsetScale[6]=t[2],this.viewportOffsetScale[7]=t[3]},V.prototype.submitFrame=function(){var e=this.gl,t=this,i=[];if(this.dirtySubmitFrameBindings||i.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),R(e,i,(function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null);var i=0,n=0;t.instanceExt&&(i=e.getVertexAttrib(t.attribs.position,t.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE),n=e.getVertexAttrib(t.attribs.texCoord,t.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)),t.cullFace&&t.realDisable.call(e,e.CULL_FACE),t.depthTest&&t.realDisable.call(e,e.DEPTH_TEST),t.blend&&t.realDisable.call(e,e.BLEND),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realDisable.call(e,e.STENCIL_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(t.ctxAttribs.alpha||A())&&(t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(t.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.enableVertexAttribArray(t.attribs.position),e.enableVertexAttribArray(t.attribs.texCoord),e.vertexAttribPointer(t.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(t.attribs.texCoord,3,e.FLOAT,!1,20,8),t.instanceExt&&(0!=i&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.position,0),0!=n&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.texCoord,0)),e.activeTexture(e.TEXTURE0),e.uniform1i(t.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.uniform4fv(t.uniforms.viewportOffsetScale,t.viewportOffsetScale),e.drawElements(e.TRIANGLES,t.indexCount,e.UNSIGNED_SHORT,0),t.cardboardUI&&t.cardboardUI.renderNoState(),t.realBindFramebuffer.call(t.gl,e.FRAMEBUFFER,t.framebuffer),t.ctxAttribs.preserveDrawingBuffer||(t.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),t.dirtySubmitFrameBindings||t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.cullFace&&t.realEnable.call(e,e.CULL_FACE),t.depthTest&&t.realEnable.call(e,e.DEPTH_TEST),t.blend&&t.realEnable.call(e,e.BLEND),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realEnable.call(e,e.STENCIL_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),!t.ctxAttribs.alpha&&t.ctxAttribs.preserveDrawingBuffer||t.realClearColor.apply(e,t.clearColor),t.instanceExt&&(0!=i&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.position,i),0!=n&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.texCoord,n))})),A()){var n=e.canvas;n.width==t.bufferWidth&&n.height==t.bufferHeight||(t.bufferWidth=n.width,t.bufferHeight=n.height,t.onResize())}},V.prototype.updateDeviceInfo=function(e){var t=this.gl,i=this,n=[t.ARRAY_BUFFER_BINDING,t.ELEMENT_ARRAY_BUFFER_BINDING];R(t,n,(function(t){var n=i.computeMeshVertices_(i.meshWidth,i.meshHeight,e);if(t.bindBuffer(t.ARRAY_BUFFER,i.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,n,t.STATIC_DRAW),!i.indexCount){var r=i.computeMeshIndices_(i.meshWidth,i.meshHeight);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,r,t.STATIC_DRAW),i.indexCount=r.length}}))},V.prototype.computeMeshVertices_=function(e,t,i){for(var n=new Float32Array(2*e*t*5),r=i.getLeftEyeVisibleTanAngles(),s=i.getLeftEyeNoLensTanAngles(),o=i.getLeftEyeVisibleScreenRect(s),a=0,u=0;u<2;u++){for(var c=0;c<t;c++)for(var l=0;l<e;l++,a++){var h=l/(e-1),A=c/(t-1),p=h,M=A,f=d(r[0],r[2],h),g=d(r[3],r[1],A),y=Math.sqrt(f*f+g*g),v=i.distortion.distortInverse(y),m=g*v/y;h=(f*v/y-s[0])/(s[2]-s[0]),A=(m-s[3])/(s[1]-s[3]),h=2*(o.x+h*o.width-.5),A=2*(o.y+A*o.height-.5),n[5*a+0]=h,n[5*a+1]=A,n[5*a+2]=p,n[5*a+3]=M,n[5*a+4]=u}var N=r[2]-r[0];r[0]=-(N+r[0]),r[2]=N-r[2],N=s[2]-s[0],s[0]=-(N+s[0]),s[2]=N-s[2],o.x=1-(o.x+o.width)}return n},V.prototype.computeMeshIndices_=function(e,t){for(var i=new Uint16Array(2*(e-1)*(t-1)*6),n=e/2,r=t/2,s=0,o=0,a=0;a<2;a++)for(var u=0;u<t;u++)for(var c=0;c<e;c++,s++)0!=c&&0!=u&&(c<=n==u<=r?(i[o++]=s,i[o++]=s-e-1,i[o++]=s-e,i[o++]=s-e-1,i[o++]=s,i[o++]=s-1):(i[o++]=s-1,i[o++]=s-e,i[o++]=s,i[o++]=s-e,i[o++]=s-1,i[o++]=s-e-1));return i},V.prototype.getOwnPropertyDescriptor_=function(e,t){var i=Object.getOwnPropertyDescriptor(e,t);return void 0!==i.get&&void 0!==i.set||(i.configurable=!0,i.enumerable=!0,i.get=function(){return this.getAttribute(t)},i.set=function(e){this.setAttribute(t,e)}),i};var H=["attribute vec2 position;","uniform mat4 projectionMat;","void main() {"," gl_Position = projectionMat * vec4( position, -1.0, 1.0 );","}"].join("\n"),G=["precision mediump float;","uniform vec4 color;","void main() {"," gl_FragColor = color;","}"].join("\n"),q=Math.PI/180,W=60,Z=12,X=20,K=1,J=.75,$=.3125,ee=4,te=28,ie=1.5;function ne(e){this.gl=e,this.attribs={position:0},this.program=I(e,H,G,this.attribs),this.uniforms=z(e,this.program),this.vertexBuffer=e.createBuffer(),this.gearOffset=0,this.gearVertexCount=0,this.arrowOffset=0,this.arrowVertexCount=0,this.projMat=new Float32Array(16),this.listener=null,this.onResize()}function re(e){this.coefficients=e}ne.prototype.destroy=function(){var e=this.gl;this.listener&&e.canvas.removeEventListener("click",this.listener,!1),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer)},ne.prototype.listen=function(e,t){var i=this.gl.canvas;this.listener=function(n){var r=i.clientWidth/2,s=te*ie;n.clientX>r-s&&n.clientX<r+s&&n.clientY>i.clientHeight-s?e(n):n.clientX<s&&n.clientY<s&&t(n)},i.addEventListener("click",this.listener,!1)},ne.prototype.onResize=function(){var t=this.gl,i=this,n=[t.ARRAY_BUFFER_BINDING];R(t,n,(function(t){var n=[],r=t.drawingBufferWidth/2,s=Math.max(screen.width,screen.height)*e.devicePixelRatio,o=t.drawingBufferWidth/s*e.devicePixelRatio,a=ee*o/2,u=te*ie*o,c=te*o/2,l=(te*ie-te)*o;function h(e,t){var i=(90-e)*q,s=Math.cos(i),o=Math.sin(i);n.push($*s*c+r,$*o*c+c),n.push(t*s*c+r,t*o*c+c)}n.push(r-a,u),n.push(r-a,t.drawingBufferHeight),n.push(r+a,u),n.push(r+a,t.drawingBufferHeight),i.gearOffset=n.length/2;for(var d=0;d<=6;d++){var A=d*W;h(A,K),h(A+Z,K),h(A+X,J),h(A+(W-X),J),h(A+(W-Z),K)}function p(e,i){n.push(l+e,t.drawingBufferHeight-l-i)}i.gearVertexCount=n.length/2-i.gearOffset,i.arrowOffset=n.length/2;var M=a/Math.sin(45*q);p(0,c),p(c,0),p(c+M,M),p(M,c+M),p(M,c-M),p(0,c),p(c,2*c),p(c+M,2*c-M),p(M,c-M),p(0,c),p(M,c-a),p(te*o,c-a),p(M,c+a),p(te*o,c+a),i.arrowVertexCount=n.length/2-i.arrowOffset,t.bindBuffer(t.ARRAY_BUFFER,i.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,new Float32Array(n),t.STATIC_DRAW)}))},ne.prototype.render=function(){var e=this.gl,t=this,i=[e.CULL_FACE,e.DEPTH_TEST,e.BLEND,e.SCISSOR_TEST,e.STENCIL_TEST,e.COLOR_WRITEMASK,e.VIEWPORT,e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING];R(e,i,(function(e){e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.BLEND),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.colorMask(!0,!0,!0,!0),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.renderNoState()}))},ne.prototype.renderNoState=function(){var e=this.gl;e.useProgram(this.program),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.enableVertexAttribArray(this.attribs.position),e.vertexAttribPointer(this.attribs.position,2,e.FLOAT,!1,8,0),e.uniform4f(this.uniforms.color,1,1,1,1),b(this.projMat,0,e.drawingBufferWidth,0,e.drawingBufferHeight,.1,1024),e.uniformMatrix4fv(this.uniforms.projectionMat,!1,this.projMat),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.drawArrays(e.TRIANGLE_STRIP,this.gearOffset,this.gearVertexCount),e.drawArrays(e.TRIANGLE_STRIP,this.arrowOffset,this.arrowVertexCount)},re.prototype.distortInverse=function(e){for(var t=0,i=1,n=e-this.distort(t);Math.abs(i-t)>1e-4;){var r=e-this.distort(i),s=i-r*((i-t)/(r-n));t=i,i=s,n=r}return i},re.prototype.distort=function(e){for(var t=e*e,i=0,n=0;n<this.coefficients.length;n++)i=t*(i+this.coefficients[n]);return(i+1)*e};var se=Math.PI/180,oe=180/Math.PI,ae=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0};ae.prototype={constructor:ae,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){var e=this.length();if(0!==e){var t=1/e;this.multiplyScalar(t)}else this.x=0,this.y=0,this.z=0;return this},multiplyScalar:function(e){this.x*=e,this.y*=e,this.z*=e},applyQuaternion:function(e){var t=this.x,i=this.y,n=this.z,r=e.x,s=e.y,o=e.z,a=e.w,u=a*t+s*n-o*i,c=a*i+o*t-r*n,l=a*n+r*i-s*t,h=-r*t-s*i-o*n;return this.x=u*a+h*-r+c*-o-l*-s,this.y=c*a+h*-s+l*-r-u*-o,this.z=l*a+h*-o+u*-s-c*-r,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},crossVectors:function(e,t){var i=e.x,n=e.y,r=e.z,s=t.x,o=t.y,a=t.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this}};var ue,ce,le,he=function(e,t,i,n){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==n?n:1};function de(e){this.width=e.width||w(),this.height=e.height||T(),this.widthMeters=e.widthMeters,this.heightMeters=e.heightMeters,this.bevelMeters=e.bevelMeters}he.prototype={constructor:he,set:function(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},setFromEulerXYZ:function(e,t,i){var n=Math.cos(e/2),r=Math.cos(t/2),s=Math.cos(i/2),o=Math.sin(e/2),a=Math.sin(t/2),u=Math.sin(i/2);return this.x=o*r*s+n*a*u,this.y=n*a*s-o*r*u,this.z=n*r*u+o*a*s,this.w=n*r*s-o*a*u,this},setFromEulerYXZ:function(e,t,i){var n=Math.cos(e/2),r=Math.cos(t/2),s=Math.cos(i/2),o=Math.sin(e/2),a=Math.sin(t/2),u=Math.sin(i/2);return this.x=o*r*s+n*a*u,this.y=n*a*s-o*r*u,this.z=n*r*u-o*a*s,this.w=n*r*s+o*a*u,this},setFromAxisAngle:function(e,t){var i=t/2,n=Math.sin(i);return this.x=e.x*n,this.y=e.y*n,this.z=e.z*n,this.w=Math.cos(i),this},multiply:function(e){return this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var i=e.x,n=e.y,r=e.z,s=e.w,o=t.x,a=t.y,u=t.z,c=t.w;return this.x=i*c+s*o+n*u-r*a,this.y=n*c+s*a+r*o-i*u,this.z=r*c+s*u+i*a-n*o,this.w=s*c-i*o-n*a-r*u,this},inverse:function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.normalize(),this},normalize:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=1):(e=1/e,this.x=this.x*e,this.y=this.y*e,this.z=this.z*e,this.w=this.w*e),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this.x,n=this.y,r=this.z,s=this.w,o=s*e.w+i*e.x+n*e.y+r*e.z;if(o<0?(this.w=-e.w,this.x=-e.x,this.y=-e.y,this.z=-e.z,o=-o):this.copy(e),o>=1)return this.w=s,this.x=i,this.y=n,this.z=r,this;var a=Math.acos(o),u=Math.sqrt(1-o*o);if(Math.abs(u)<.001)return this.w=.5*(s+this.w),this.x=.5*(i+this.x),this.y=.5*(n+this.y),this.z=.5*(r+this.z),this;var c=Math.sin((1-t)*a)/u,l=Math.sin(t*a)/u;return this.w=s*c+this.w*l,this.x=i*c+this.x*l,this.y=n*c+this.y*l,this.z=r*c+this.z*l,this},setFromUnitVectors:(le=1e-6,function(e,t){return void 0===ue&&(ue=new ae),(ce=e.dot(t)+1)<le?(ce=0,Math.abs(e.x)>Math.abs(e.z)?ue.set(-e.y,e.x,0):ue.set(0,-e.z,e.y)):ue.crossVectors(e,t),this.x=ue.x,this.y=ue.y,this.z=ue.z,this.w=ce,this.normalize(),this})};var Ae=new de({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),pe=new de({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),Me={CardboardV1:new ge({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]}),CardboardV2:new ge({id:"CardboardV2",label:"Cardboard I/O 2015",fov:60,interLensDistance:.064,baselineLensDistance:.035,screenLensDistance:.039,distortionCoefficients:[.34,.55],inverseCoefficients:[-.33836704,-.18162185,.862655,-1.2462051,1.0560602,-.58208317,.21609078,-.05444823,.009177956,-.0009904169,6183535e-11,-16981803e-13]})};function fe(e,t){this.viewer=Me.CardboardV2,this.updateDeviceParams(e),this.distortion=new re(this.viewer.distortionCoefficients);for(var i=0;i<t.length;i++){var n=t[i];Me[n.id]=new ge(n)}}function ge(e){this.id=e.id,this.label=e.label,this.fov=e.fov,this.interLensDistance=e.interLensDistance,this.baselineLensDistance=e.baselineLensDistance,this.screenLensDistance=e.screenLensDistance,this.distortionCoefficients=e.distortionCoefficients,this.inverseCoefficients=e.inverseCoefficients}fe.prototype.updateDeviceParams=function(e){this.device=this.determineDevice_(e)||this.device},fe.prototype.getDevice=function(){return this.device},fe.prototype.setViewer=function(e){this.viewer=e,this.distortion=new re(this.viewer.distortionCoefficients)},fe.prototype.determineDevice_=function(e){if(!e)return A()?(console.warn("Using fallback iOS device measurements."),pe):(console.warn("Using fallback Android device measurements."),Ae);var t=.0254,i=t/e.xdpi,n=t/e.ydpi;return new de({widthMeters:i*w(),heightMeters:n*T(),bevelMeters:.001*e.bevelMm})},fe.prototype.getDistortedFieldOfViewLeftEye=function(){var e=this.viewer,t=this.device,i=this.distortion,n=e.screenLensDistance,r=(t.widthMeters-e.interLensDistance)/2,s=e.interLensDistance/2,o=e.baselineLensDistance-t.bevelMeters,a=t.heightMeters-o,u=oe*Math.atan(i.distort(r/n)),c=oe*Math.atan(i.distort(s/n)),l=oe*Math.atan(i.distort(o/n)),h=oe*Math.atan(i.distort(a/n));return{leftDegrees:Math.min(u,e.fov),rightDegrees:Math.min(c,e.fov),downDegrees:Math.min(l,e.fov),upDegrees:Math.min(h,e.fov)}},fe.prototype.getLeftEyeVisibleTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,n=Math.tan(-se*e.fov),r=Math.tan(se*e.fov),s=Math.tan(se*e.fov),o=Math.tan(-se*e.fov),a=t.widthMeters/4,u=t.heightMeters/2,c=e.baselineLensDistance-t.bevelMeters-u,l=e.interLensDistance/2-a,h=-c,d=e.screenLensDistance,A=i.distort((l-a)/d),p=i.distort((h+u)/d),M=i.distort((l+a)/d),f=i.distort((h-u)/d),g=new Float32Array(4);return g[0]=Math.max(n,A),g[1]=Math.min(r,p),g[2]=Math.min(s,M),g[3]=Math.max(o,f),g},fe.prototype.getLeftEyeNoLensTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,n=new Float32Array(4),r=i.distortInverse(Math.tan(-se*e.fov)),s=i.distortInverse(Math.tan(se*e.fov)),o=i.distortInverse(Math.tan(se*e.fov)),a=i.distortInverse(Math.tan(-se*e.fov)),u=t.widthMeters/4,c=t.heightMeters/2,l=e.baselineLensDistance-t.bevelMeters-c,h=e.interLensDistance/2-u,d=-l,A=e.screenLensDistance,p=(h-u)/A,M=(d+c)/A,f=(h+u)/A,g=(d-c)/A;return n[0]=Math.max(r,p),n[1]=Math.min(s,M),n[2]=Math.min(o,f),n[3]=Math.max(a,g),n},fe.prototype.getLeftEyeVisibleScreenRect=function(e){var t=this.viewer,i=this.device,n=t.screenLensDistance,r=(i.widthMeters-t.interLensDistance)/2,s=t.baselineLensDistance-i.bevelMeters,o=(e[0]*n+r)/i.widthMeters,a=(e[1]*n+s)/i.heightMeters,u=(e[2]*n+r)/i.widthMeters,c=(e[3]*n+s)/i.heightMeters;return{x:o,y:c,width:u-o,height:a-c}},fe.prototype.getFieldOfViewLeftEye=function(e){return e?this.getUndistortedFieldOfViewLeftEye():this.getDistortedFieldOfViewLeftEye()},fe.prototype.getFieldOfViewRightEye=function(e){var t=this.getFieldOfViewLeftEye(e);return{leftDegrees:t.rightDegrees,rightDegrees:t.leftDegrees,upDegrees:t.upDegrees,downDegrees:t.downDegrees}},fe.prototype.getUndistortedFieldOfViewLeftEye=function(){var e=this.getUndistortedParams_();return{leftDegrees:oe*Math.atan(e.outerDist),rightDegrees:oe*Math.atan(e.innerDist),downDegrees:oe*Math.atan(e.bottomDist),upDegrees:oe*Math.atan(e.topDist)}},fe.prototype.getUndistortedViewportLeftEye=function(){var e=this.getUndistortedParams_(),t=this.viewer,i=this.device,n=t.screenLensDistance,r=i.widthMeters/n,s=i.heightMeters/n,o=i.width/r,a=i.height/s,u=Math.round((e.eyePosX-e.outerDist)*o),c=Math.round((e.eyePosY-e.bottomDist)*a);return{x:u,y:c,width:Math.round((e.eyePosX+e.innerDist)*o)-u,height:Math.round((e.eyePosY+e.topDist)*a)-c}},fe.prototype.getUndistortedParams_=function(){var e=this.viewer,t=this.device,i=this.distortion,n=e.screenLensDistance,r=e.interLensDistance/2/n,s=t.widthMeters/n,o=t.heightMeters/n,a=s/2-r,u=(e.baselineLensDistance-t.bevelMeters)/n,c=e.fov,l=i.distortInverse(Math.tan(se*c)),h=Math.min(a,l),d=Math.min(r,l),A=Math.min(u,l);return{outerDist:h,innerDist:d,topDist:Math.min(o-u,l),bottomDist:A,eyePosX:a,eyePosY:u}},fe.Viewers=Me;var ye={format:1,last_updated:"2019-11-09T17:36:14Z",devices:[{type:"android",rules:[{mdmh:"asus/*/Nexus 7/*"},{ua:"Nexus 7"}],dpi:[320.8,323],bw:3,ac:500},{type:"android",rules:[{mdmh:"asus/*/ASUS_X00PD/*"},{ua:"ASUS_X00PD"}],dpi:245,bw:3,ac:500},{type:"android",rules:[{mdmh:"asus/*/ASUS_X008D/*"},{ua:"ASUS_X008D"}],dpi:282,bw:3,ac:500},{type:"android",rules:[{mdmh:"asus/*/ASUS_Z00AD/*"},{ua:"ASUS_Z00AD"}],dpi:[403,404.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel 2 XL/*"},{ua:"Pixel 2 XL"}],dpi:537.9,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel 3 XL/*"},{ua:"Pixel 3 XL"}],dpi:[558.5,553.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel XL/*"},{ua:"Pixel XL"}],dpi:[537.9,533],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel 3/*"},{ua:"Pixel 3"}],dpi:442.4,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel 2/*"},{ua:"Pixel 2"}],dpi:441,bw:3,ac:500},{type:"android",rules:[{mdmh:"Google/*/Pixel/*"},{ua:"Pixel"}],dpi:[432.6,436.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC6435LVW/*"},{ua:"HTC6435LVW"}],dpi:[449.7,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC One XL/*"},{ua:"HTC One XL"}],dpi:[315.3,314.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"htc/*/Nexus 9/*"},{ua:"Nexus 9"}],dpi:289,bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One M9/*"},{ua:"HTC One M9"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One_M8/*"},{ua:"HTC One_M8"}],dpi:[449.7,447.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One/*"},{ua:"HTC One"}],dpi:472.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/Nexus 6P/*"},{ua:"Nexus 6P"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/BLN-L24/*"},{ua:"HONORBLN-L24"}],dpi:480,bw:4,ac:500},{type:"android",rules:[{mdmh:"Huawei/*/BKL-L09/*"},{ua:"BKL-L09"}],dpi:403,bw:3.47,ac:500},{type:"android",rules:[{mdmh:"LENOVO/*/Lenovo PB2-690Y/*"},{ua:"Lenovo PB2-690Y"}],dpi:[457.2,454.713],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5X/*"},{ua:"Nexus 5X"}],dpi:[422,419.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS345/*"},{ua:"LGMS345"}],dpi:[221.7,219.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D800/*"},{ua:"LG-D800"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D850/*"},{ua:"LG-D850"}],dpi:[537.9,541.9],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/VS985 4G/*"},{ua:"VS985 4G"}],dpi:[537.9,535.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5/*"},{ua:"Nexus 5 B"}],dpi:[442.4,444.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 4/*"},{ua:"Nexus 4"}],dpi:[319.8,318.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LG-P769/*"},{ua:"LG-P769"}],dpi:[240.6,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS323/*"},{ua:"LGMS323"}],dpi:[206.6,204.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGLS996/*"},{ua:"LGLS996"}],dpi:[403.4,401.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/4560MMX/*"},{ua:"4560MMX"}],dpi:[240,219.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/A250/*"},{ua:"Micromax A250"}],dpi:[480,446.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/Micromax AQ4501/*"},{ua:"Micromax AQ4501"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/G5/*"},{ua:"Moto G (5) Plus"}],dpi:[403.4,403],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/DROID RAZR/*"},{ua:"DROID RAZR"}],dpi:[368.1,256.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT830C/*"},{ua:"XT830C"}],dpi:[254,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1021/*"},{ua:"XT1021"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1023/*"},{ua:"XT1023"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1028/*"},{ua:"XT1028"}],dpi:[326.6,327.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1034/*"},{ua:"XT1034"}],dpi:[326.6,328.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1053/*"},{ua:"XT1053"}],dpi:[315.3,316.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1562/*"},{ua:"XT1562"}],dpi:[403.4,402.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/Nexus 6/*"},{ua:"Nexus 6 B"}],dpi:[494.3,489.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1063/*"},{ua:"XT1063"}],dpi:[295,296.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1064/*"},{ua:"XT1064"}],dpi:[295,295.6],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1092/*"},{ua:"XT1092"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1095/*"},{ua:"XT1095"}],dpi:[422,423.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/G4/*"},{ua:"Moto G (4)"}],dpi:401,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/A0001/*"},{ua:"A0001"}],dpi:[403.4,401],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1001/*"},{ua:"ONE E1001"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1003/*"},{ua:"ONE E1003"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1005/*"},{ua:"ONE E1005"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2001/*"},{ua:"ONE A2001"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2003/*"},{ua:"ONE A2003"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2005/*"},{ua:"ONE A2005"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A3000/*"},{ua:"ONEPLUS A3000"}],dpi:401,bw:3,ac:500},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A3003/*"},{ua:"ONEPLUS A3003"}],dpi:401,bw:3,ac:500},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A3010/*"},{ua:"ONEPLUS A3010"}],dpi:401,bw:3,ac:500},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A5000/*"},{ua:"ONEPLUS A5000 "}],dpi:[403.411,399.737],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A5010/*"},{ua:"ONEPLUS A5010"}],dpi:[403,400],bw:2,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A6000/*"},{ua:"ONEPLUS A6000"}],dpi:401,bw:3,ac:500},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A6003/*"},{ua:"ONEPLUS A6003"}],dpi:401,bw:3,ac:500},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A6010/*"},{ua:"ONEPLUS A6010"}],dpi:401,bw:2,ac:500},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A6013/*"},{ua:"ONEPLUS A6013"}],dpi:401,bw:2,ac:500},{type:"android",rules:[{mdmh:"OPPO/*/X909/*"},{ua:"X909"}],dpi:[442.4,444.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9082/*"},{ua:"GT-I9082"}],dpi:[184.7,185.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G360P/*"},{ua:"SM-G360P"}],dpi:[196.7,205.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Nexus S/*"},{ua:"Nexus S"}],dpi:[234.5,229.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[304.8,303.9],bw:5,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-T230NU/*"},{ua:"SM-T230NU"}],dpi:216,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SGH-T399/*"},{ua:"SGH-T399"}],dpi:[217.7,231.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SGH-M919/*"},{ua:"SGH-M919"}],dpi:[440.8,437.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N9005/*"},{ua:"SM-N9005"}],dpi:[386.4,387],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SM-N900A/*"},{ua:"SAMSUNG-SM-N900A"}],dpi:[386.4,387.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9500/*"},{ua:"GT-I9500"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/GT-I9505/*"},{ua:"GT-I9505"}],dpi:439.4,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900F/*"},{ua:"SM-G900F"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900M/*"},{ua:"SM-G900M"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G800F/*"},{ua:"SM-G800F"}],dpi:326.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G906S/*"},{ua:"SM-G906S"}],dpi:[562.7,572.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[306.7,304.8],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-T535/*"},{ua:"SM-T535"}],dpi:[142.6,136.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-N920C/*"},{ua:"SM-N920C"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N920P/*"},{ua:"SM-N920P"}],dpi:[386.3655,390.144],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N920W8/*"},{ua:"SM-N920W8"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300I/*"},{ua:"GT-I9300I"}],dpi:[304.8,305.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9195/*"},{ua:"GT-I9195"}],dpi:[249.4,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SPH-L520/*"},{ua:"SPH-L520"}],dpi:[249.4,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SGH-I717/*"},{ua:"SAMSUNG-SGH-I717"}],dpi:285.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SPH-D710/*"},{ua:"SPH-D710"}],dpi:[217.7,204.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-N7100/*"},{ua:"GT-N7100"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SCH-I605/*"},{ua:"SCH-I605"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Galaxy Nexus/*"},{ua:"Galaxy Nexus"}],dpi:[315.3,314.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910H/*"},{ua:"SM-N910H"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910C/*"},{ua:"SM-N910C"}],dpi:[515.2,520.2],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G130M/*"},{ua:"SM-G130M"}],dpi:[165.9,164.8],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G928I/*"},{ua:"SM-G928I"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G920F/*"},{ua:"SM-G920F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G920P/*"},{ua:"SM-G920P"}],dpi:[522.5,577],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G925F/*"},{ua:"SM-G925F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G925V/*"},{ua:"SM-G925V"}],dpi:[522.5,576.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G930F/*"},{ua:"SM-G930F"}],dpi:576.6,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G935F/*"},{ua:"SM-G935F"}],dpi:533,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G950F/*"},{ua:"SM-G950F"}],dpi:[562.707,565.293],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G955U/*"},{ua:"SM-G955U"}],dpi:[522.514,525.762],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G955F/*"},{ua:"SM-G955F"}],dpi:[522.514,525.762],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G960F/*"},{ua:"SM-G960F"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G9600/*"},{ua:"SM-G9600"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G960T/*"},{ua:"SM-G960T"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G960N/*"},{ua:"SM-G960N"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G960U/*"},{ua:"SM-G960U"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G9608/*"},{ua:"SM-G9608"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G960FD/*"},{ua:"SM-G960FD"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G960W/*"},{ua:"SM-G960W"}],dpi:[569.575,571.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G965F/*"},{ua:"SM-G965F"}],dpi:529,bw:2,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/C6903/*"},{ua:"C6903"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"Sony/*/D6653/*"},{ua:"D6653"}],dpi:[428.6,427.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6653/*"},{ua:"E6653"}],dpi:[428.6,425.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6853/*"},{ua:"E6853"}],dpi:[403.4,401.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/SGP321/*"},{ua:"SGP321"}],dpi:[224.7,224.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"TCT/*/ALCATEL ONE TOUCH Fierce/*"},{ua:"ALCATEL ONE TOUCH Fierce"}],dpi:[240,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"THL/*/thl 5000/*"},{ua:"thl 5000"}],dpi:[480,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Fly/*/IQ4412/*"},{ua:"IQ4412"}],dpi:307.9,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"ZTE/*/ZTE Blade L2/*"},{ua:"ZTE Blade L2"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"BENEVE/*/VR518/*"},{ua:"VR518"}],dpi:480,bw:3,ac:500},{type:"ios",rules:[{res:[640,960]}],dpi:[325.1,328.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[640,1136]}],dpi:[317.1,320.2],bw:3,ac:1e3},{type:"ios",rules:[{res:[750,1334]}],dpi:326.4,bw:4,ac:1e3},{type:"ios",rules:[{res:[1242,2208]}],dpi:[453.6,458.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1125,2001]}],dpi:[410.9,415.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1125,2436]}],dpi:458,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/EML-L29/*"},{ua:"EML-L29"}],dpi:428,bw:3.45,ac:500},{type:"android",rules:[{mdmh:"Nokia/*/Nokia 7.1/*"},{ua:"Nokia 7.1"}],dpi:[432,431.9],bw:3,ac:500},{type:"ios",rules:[{res:[1242,2688]}],dpi:458,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G570M/*"},{ua:"SM-G570M"}],dpi:320,bw:3.684,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G970F/*"},{ua:"SM-G970F"}],dpi:438,bw:2.281,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G973F/*"},{ua:"SM-G973F"}],dpi:550,bw:2.002,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G975F/*"},{ua:"SM-G975F"}],dpi:522,bw:2.054,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G977F/*"},{ua:"SM-G977F"}],dpi:505,bw:2.334,ac:500},{type:"ios",rules:[{res:[828,1792]}],dpi:326,bw:5,ac:500}]};function ve(e,t){if(this.dpdb=ye,this.recalculateDeviceParams_(),e){this.onDeviceParamsUpdated=t;var i=new XMLHttpRequest,n=this;i.open("GET",e,!0),i.addEventListener("load",(function(){n.loading=!1,i.status>=200&&i.status<=299?(n.dpdb=JSON.parse(i.response),n.recalculateDeviceParams_()):console.error("Error loading online DPDB!")})),i.send()}}function me(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}function Ne(e,t){this.set(e,t)}function De(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new Ne,this.currentGyroMeasurement=new Ne,this.previousGyroMeasurement=new Ne,A()?this.filterQ=new he(-1,0,0,1):this.filterQ=new he(1,0,0,1),this.previousFilterQ=new he,this.previousFilterQ.copy(this.filterQ),this.accelQ=new he,this.isOrientationInitialized=!1,this.estimatedGravity=new ae,this.measuredGravity=new ae,this.gyroIntegralQ=new he}function we(e,t){this.predictionTimeS=e,this.isDebug=t,this.previousQ=new he,this.previousTimestampS=null,this.deltaQ=new he,this.outQ=new he}function Te(t,i,n,r){this.yawOnly=n,this.accelerometer=new ae,this.gyroscope=new ae,this.filter=new De(t,r),this.posePredictor=new we(i,r),this.isFirefoxAndroid=f(),this.isIOS=A();var s=g();this.isDeviceMotionInRadians=!this.isIOS&&s&&s<66,this.isWithoutDeviceMotion=v()||y(),this.filterToWorldQ=new he,A()?this.filterToWorldQ.setFromAxisAngle(new ae(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new ae(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new he,this.worldToScreenQ=new he,this.originalPoseAdjustQ=new he,this.originalPoseAdjustQ.setFromAxisAngle(new ae(0,0,1),-e.orientation*Math.PI/180),this.setScreenTransform_(),N()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new he,this.orientationOut_=new Float32Array(4),this.start()}ve.prototype.getDeviceParams=function(){return this.deviceParams},ve.prototype.recalculateDeviceParams_=function(){var e=this.calcDeviceParams_();e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},ve.prototype.calcDeviceParams_=function(){var i=this.dpdb;if(!i)return console.error("DPDB not available."),null;if(1!=i.format)return console.error("DPDB has unexpected format version."),null;if(!i.devices||!i.devices.length)return console.error("DPDB does not have a devices section."),null;var n=t.userAgent||t.vendor||e.opera,r=w(),s=T();if(!i.devices)return console.error("DPDB has no devices section."),null;for(var o=0;o<i.devices.length;o++){var a=i.devices[o];if(a.rules)if("ios"==a.type||"android"==a.type){if(A()==("ios"==a.type)){for(var u=!1,c=0;c<a.rules.length;c++){var l=a.rules[c];if(this.ruleMatches_(l,n,r,s)){u=!0;break}}if(u)return new me({xdpi:a.dpi[0]||a.dpi,ydpi:a.dpi[1]||a.dpi,bevelMm:a.bw})}}else console.warn("Device["+o+"] has invalid type.");else console.warn("Device["+o+"] has no rules section.")}return console.warn("No DPDB device match."),null},ve.prototype.ruleMatches_=function(e,t,i,n){if(!e.ua&&!e.res)return!1;if(e.ua&&"SM"===e.ua.substring(0,2)&&(e.ua=e.ua.substring(0,7)),e.ua&&t.indexOf(e.ua)<0)return!1;if(e.res){if(!e.res[0]||!e.res[1])return!1;var r=e.res[0],s=e.res[1];if(Math.min(i,n)!=Math.min(r,s)||Math.max(i,n)!=Math.max(r,s))return!1}return!0},Ne.prototype.set=function(e,t){this.sample=e,this.timestampS=t},Ne.prototype.copy=function(e){this.set(e.sample,e.timestampS)},De.prototype.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},De.prototype.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e,t);var i=t-this.previousGyroMeasurement.timestampS;D(i)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},De.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var i=new he;i.copy(this.filterQ),i.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(i),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var n=new he;n.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),n.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",oe*B(n),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 r=new he;r.copy(this.filterQ),r.multiply(n),this.filterQ.slerp(r,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},De.prototype.getOrientation=function(){return this.filterQ},De.prototype.accelToQuaternion_=function(e){var t=new ae;t.copy(e),t.normalize();var i=new he;return i.setFromUnitVectors(new ae(0,0,-1),t),i.inverse(),i},De.prototype.gyroToQuaternionDelta_=function(e,t){var i=new he,n=new ae;return n.copy(e),n.normalize(),i.setFromAxisAngle(n,e.length()*t),i},we.prototype.getPrediction=function(e,t,i){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=i,e;var n=new ae;n.copy(t),n.normalize();var r=t.length();if(r<20*se)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(oe*r).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var s=r*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(n,s),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=i,this.outQ},Te.prototype.getPosition=function(){return null},Te.prototype.getOrientation=function(){var t=void 0;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ)return this.deviceOrientationFixQ=this.deviceOrientationFixQ||function(){var t=(new he).setFromAxisAngle(new ae(0,0,-1),0),i=new he;return-90===e.orientation?i.setFromAxisAngle(new ae(0,1,0),Math.PI/-2):i.setFromAxisAngle(new ae(0,1,0),Math.PI/2),t.multiply(i)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||((i=new he).setFromAxisAngle(new ae(1,0,0),-Math.PI/2),i),t=this._deviceOrientationQ,(n=new he).copy(t),n.multiply(this.deviceOrientationFilterToWorldQ),n.multiply(this.resetQ),n.multiply(this.worldToScreenQ),n.multiplyQuaternions(this.deviceOrientationFixQ,n),this.yawOnly&&(n.x=0,n.z=0,n.normalize()),this.orientationOut_[0]=n.x,this.orientationOut_[1]=n.y,this.orientationOut_[2]=n.z,this.orientationOut_[3]=n.w,this.orientationOut_;var i,n,r=this.filter.getOrientation();return t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS),(n=new he).copy(this.filterToWorldQ),n.multiply(this.resetQ),n.multiply(t),n.multiply(this.worldToScreenQ),this.yawOnly&&(n.x=0,n.z=0,n.normalize()),this.orientationOut_[0]=n.x,this.orientationOut_[1]=n.y,this.orientationOut_[2]=n.z,this.orientationOut_[3]=n.w,this.orientationOut_},Te.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),N()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},Te.prototype.onDeviceOrientation_=function(e){this._deviceOrientationQ=this._deviceOrientationQ||new he;var t=e.alpha,i=e.beta,n=e.gamma;t=(t||0)*Math.PI/180,i=(i||0)*Math.PI/180,n=(n||0)*Math.PI/180,this._deviceOrientationQ.setFromEulerYXZ(i,t,-n)},Te.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},Te.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,n=e.timeStamp/1e3,r=n-this.previousTimestampS;return r<0?(U("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=n)):r<=c||r>l?(U("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),void(this.previousTimestampS=n)):(this.accelerometer.set(-t.x,-t.y,-t.z),i&&(m()?this.gyroscope.set(-i.beta,i.alpha,i.gamma):this.gyroscope.set(i.alpha,i.beta,i.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,n)),this.filter.addAccelMeasurement(this.accelerometer,n),void(this.previousTimestampS=n))},Te.prototype.onOrientationChange_=function(e){this.setScreenTransform_()},Te.prototype.onMessage_=function(e){var t=e.data;t&&t.type&&"devicemotion"===t.type.toLowerCase()&&this.updateDeviceMotion_(t.deviceMotionEvent)},Te.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),e.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new ae(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new ae(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},Te.prototype.start=function(){this.onDeviceMotionCallback_=this.onDeviceMotion_.bind(this),this.onOrientationChangeCallback_=this.onOrientationChange_.bind(this),this.onMessageCallback_=this.onMessage_.bind(this),this.onDeviceOrientationCallback_=this.onDeviceOrientation_.bind(this),A()&&P()&&e.addEventListener("message",this.onMessageCallback_),e.addEventListener("orientationchange",this.onOrientationChangeCallback_),this.isWithoutDeviceMotion?e.addEventListener("deviceorientation",this.onDeviceOrientationCallback_):e.addEventListener("devicemotion",this.onDeviceMotionCallback_)},Te.prototype.stop=function(){e.removeEventListener("devicemotion",this.onDeviceMotionCallback_),e.removeEventListener("deviceorientation",this.onDeviceOrientationCallback_),e.removeEventListener("orientationchange",this.onOrientationChangeCallback_),e.removeEventListener("message",this.onMessageCallback_)};var xe=60,Ee=new ae(1,0,0),je=new ae(0,0,1),Ie=new he;Ie.setFromAxisAngle(Ee,-Math.PI/2),Ie.multiply((new he).setFromAxisAngle(je,Math.PI/2));var ze=function(){function e(t){o(this,e),this.config=t,this.sensor=null,this.fusionSensor=null,this._out=new Float32Array(4),this.api=null,this.errors=[],this._sensorQ=new he,this._outQ=new he,this._onSensorRead=this._onSensorRead.bind(this),this._onSensorError=this._onSensorError.bind(this),this.init()}return a(e,[{key:"init",value:function(){var e=null;try{(e=new RelativeOrientationSensor({frequency:xe,referenceFrame:"screen"})).addEventListener("error",this._onSensorError)}catch(e){this.errors.push(e),"SecurityError"===e.name?(console.error("Cannot construct sensors due to the Feature Policy"),console.warn('Attempting to fall back using "devicemotion"; however this will fail in the future without correct permissions.'),this.useDeviceMotion()):"ReferenceError"===e.name?this.useDeviceMotion():console.error(e)}e&&(this.api="sensor",this.sensor=e,this.sensor.addEventListener("reading",this._onSensorRead),this.sensor.start())}},{key:"useDeviceMotion",value:function(){this.api="devicemotion",this.fusionSensor=new Te(this.config.K_FILTER,this.config.PREDICTION_TIME_S,this.config.YAW_ONLY,this.config.DEBUG),this.sensor&&(this.sensor.removeEventListener("reading",this._onSensorRead),this.sensor.removeEventListener("error",this._onSensorError),this.sensor=null)}},{key:"getOrientation",value:function(){if(this.fusionSensor)return this.fusionSensor.getOrientation();if(!this.sensor||!this.sensor.quaternion)return this._out[0]=this._out[1]=this._out[2]=0,this._out[3]=1,this._out;var e=this.sensor.quaternion;this._sensorQ.set(e[0],e[1],e[2],e[3]);var t=this._outQ;return t.copy(Ie),t.multiply(this._sensorQ),this.config.YAW_ONLY&&(t.x=t.z=0,t.normalize()),this._out[0]=t.x,this._out[1]=t.y,this._out[2]=t.z,this._out[3]=t.w,this._out}},{key:"_onSensorError",value:function(e){this.errors.push(e.error),"NotAllowedError"===e.error.name?console.error("Permission to access sensor was denied"):"NotReadableError"===e.error.name?console.error("Sensor could not be read"):console.error(e.error),this.useDeviceMotion()}},{key:"_onSensorRead",value:function(){}}]),e}(),be="<svg width='198' height='240' viewBox='0 0 198 240' xmlns='http://www.w3.org/2000/svg'><g fill='none' fill-rule='evenodd'><path d='M149.625 109.527l6.737 3.891v.886c0 .177.013.36.038.549.01.081.02.162.027.242.14 1.415.974 2.998 2.105 3.999l5.72 5.062.081-.09s4.382-2.53 5.235-3.024l25.97 14.993v54.001c0 .771-.386 1.217-.948 1.217-.233 0-.495-.076-.772-.236l-23.967-13.838-.014.024-27.322 15.775-.85-1.323c-4.731-1.529-9.748-2.74-14.951-3.61a.27.27 0 0 0-.007.024l-5.067 16.961-7.891 4.556-.037-.063v27.59c0 .772-.386 1.217-.948 1.217-.232 0-.495-.076-.772-.236l-42.473-24.522c-.95-.549-1.72-1.877-1.72-2.967v-1.035l-.021.047a5.111 5.111 0 0 0-1.816-.399 5.682 5.682 0 0 0-.546.001 13.724 13.724 0 0 1-1.918-.041c-1.655-.153-3.2-.6-4.404-1.296l-46.576-26.89.005.012-10.278-18.75c-1.001-1.827-.241-4.216 1.698-5.336l56.011-32.345a4.194 4.194 0 0 1 2.099-.572c1.326 0 2.572.659 3.227 1.853l.005-.003.227.413-.006.004a9.63 9.63 0 0 0 1.477 2.018l.277.27c1.914 1.85 4.468 2.801 7.113 2.801 1.949 0 3.948-.517 5.775-1.572.013 0 7.319-4.219 7.319-4.219a4.194 4.194 0 0 1 2.099-.572c1.326 0 2.572.658 3.226 1.853l3.25 5.928.022-.018 6.785 3.917-.105-.182 46.881-26.965m0-1.635c-.282 0-.563.073-.815.218l-46.169 26.556-5.41-3.124-3.005-5.481c-.913-1.667-2.699-2.702-4.66-2.703-1.011 0-2.02.274-2.917.792a3825 3825 0 0 1-7.275 4.195l-.044.024a9.937 9.937 0 0 1-4.957 1.353c-2.292 0-4.414-.832-5.976-2.342l-.252-.245a7.992 7.992 0 0 1-1.139-1.534 1.379 1.379 0 0 0-.06-.122l-.227-.414a1.718 1.718 0 0 0-.095-.154c-.938-1.574-2.673-2.545-4.571-2.545-1.011 0-2.02.274-2.917.792L3.125 155.502c-2.699 1.559-3.738 4.94-2.314 7.538l10.278 18.75c.177.323.448.563.761.704l46.426 26.804c1.403.81 3.157 1.332 5.072 1.508a15.661 15.661 0 0 0 2.146.046 4.766 4.766 0 0 1 .396 0c.096.004.19.011.283.022.109 1.593 1.159 3.323 2.529 4.114l42.472 24.522c.524.302 1.058.455 1.59.455 1.497 0 2.583-1.2 2.583-2.852v-26.562l7.111-4.105a1.64 1.64 0 0 0 .749-.948l4.658-15.593c4.414.797 8.692 1.848 12.742 3.128l.533.829a1.634 1.634 0 0 0 2.193.531l26.532-15.317L193 192.433c.523.302 1.058.455 1.59.455 1.497 0 2.583-1.199 2.583-2.852v-54.001c0-.584-.312-1.124-.818-1.416l-25.97-14.993a1.633 1.633 0 0 0-1.636.001c-.606.351-2.993 1.73-4.325 2.498l-4.809-4.255c-.819-.725-1.461-1.933-1.561-2.936a7.776 7.776 0 0 0-.033-.294 2.487 2.487 0 0 1-.023-.336v-.886c0-.584-.312-1.123-.817-1.416l-6.739-3.891a1.633 1.633 0 0 0-.817-.219' fill='#455A64'/><path d='M96.027 132.636l46.576 26.891c1.204.695 1.979 1.587 2.242 2.541l-.01.007-81.374 46.982h-.001c-1.654-.152-3.199-.6-4.403-1.295l-46.576-26.891 83.546-48.235' fill='#FAFAFA'/><path d='M63.461 209.174c-.008 0-.015 0-.022-.002-1.693-.156-3.228-.609-4.441-1.309l-46.576-26.89a.118.118 0 0 1 0-.203l83.546-48.235a.117.117 0 0 1 .117 0l46.576 26.891c1.227.708 2.021 1.612 2.296 2.611a.116.116 0 0 1-.042.124l-.021.016-81.375 46.981a.11.11 0 0 1-.058.016zm-50.747-28.303l46.401 26.79c1.178.68 2.671 1.121 4.32 1.276l81.272-46.922c-.279-.907-1.025-1.73-2.163-2.387l-46.517-26.857-83.313 48.1z' fill='#607D8B'/><path d='M148.327 165.471a5.85 5.85 0 0 1-.546.001c-1.894-.083-3.302-1.038-3.145-2.132a2.693 2.693 0 0 0-.072-1.105l-81.103 46.822c.628.058 1.272.073 1.918.042.182-.009.364-.009.546-.001 1.894.083 3.302 1.038 3.145 2.132l79.257-45.759' fill='#FFF'/><path d='M69.07 211.347a.118.118 0 0 1-.115-.134c.045-.317-.057-.637-.297-.925-.505-.61-1.555-1.022-2.738-1.074a5.966 5.966 0 0 0-.535.001 14.03 14.03 0 0 1-1.935-.041.117.117 0 0 1-.103-.092.116.116 0 0 1 .055-.126l81.104-46.822a.117.117 0 0 1 .171.07c.104.381.129.768.074 1.153-.045.316.057.637.296.925.506.61 1.555 1.021 2.739 1.073.178.008.357.008.535-.001a.117.117 0 0 1 .064.218l-79.256 45.759a.114.114 0 0 1-.059.016zm-3.405-2.372c.089 0 .177.002.265.006 1.266.056 2.353.488 2.908 1.158.227.274.35.575.36.882l78.685-45.429c-.036 0-.072-.001-.107-.003-1.267-.056-2.354-.489-2.909-1.158-.282-.34-.402-.724-.347-1.107a2.604 2.604 0 0 0-.032-.91L63.846 208.97a13.91 13.91 0 0 0 1.528.012c.097-.005.194-.007.291-.007z' fill='#607D8B'/><path d='M2.208 162.134c-1.001-1.827-.241-4.217 1.698-5.337l56.011-32.344c1.939-1.12 4.324-.546 5.326 1.281l.232.41a9.344 9.344 0 0 0 1.47 2.021l.278.27c3.325 3.214 8.583 3.716 12.888 1.23l7.319-4.22c1.94-1.119 4.324-.546 5.325 1.282l3.25 5.928-83.519 48.229-10.278-18.75z' fill='#FAFAFA'/><path d='M12.486 181.001a.112.112 0 0 1-.031-.005.114.114 0 0 1-.071-.056L2.106 162.19c-1.031-1.88-.249-4.345 1.742-5.494l56.01-32.344a4.328 4.328 0 0 1 2.158-.588c1.415 0 2.65.702 3.311 1.882.01.008.018.017.024.028l.227.414a.122.122 0 0 1 .013.038 9.508 9.508 0 0 0 1.439 1.959l.275.266c1.846 1.786 4.344 2.769 7.031 2.769 1.977 0 3.954-.538 5.717-1.557a.148.148 0 0 1 .035-.013l7.284-4.206a4.321 4.321 0 0 1 2.157-.588c1.427 0 2.672.716 3.329 1.914l3.249 5.929a.116.116 0 0 1-.044.157l-83.518 48.229a.116.116 0 0 1-.059.016zm49.53-57.004c-.704 0-1.41.193-2.041.557l-56.01 32.345c-1.882 1.086-2.624 3.409-1.655 5.179l10.221 18.645 83.317-48.112-3.195-5.829c-.615-1.122-1.783-1.792-3.124-1.792a4.08 4.08 0 0 0-2.04.557l-7.317 4.225a.148.148 0 0 1-.035.013 11.7 11.7 0 0 1-5.801 1.569c-2.748 0-5.303-1.007-7.194-2.835l-.278-.27a9.716 9.716 0 0 1-1.497-2.046.096.096 0 0 1-.013-.037l-.191-.347a.11.11 0 0 1-.023-.029c-.615-1.123-1.783-1.793-3.124-1.793z' fill='#607D8B'/><path d='M42.434 155.808c-2.51-.001-4.697-1.258-5.852-3.365-1.811-3.304-.438-7.634 3.059-9.654l12.291-7.098a7.599 7.599 0 0 1 3.789-1.033c2.51 0 4.697 1.258 5.852 3.365 1.811 3.304.439 7.634-3.059 9.654l-12.291 7.098a7.606 7.606 0 0 1-3.789 1.033zm13.287-20.683a7.128 7.128 0 0 0-3.555.971l-12.291 7.098c-3.279 1.893-4.573 5.942-2.883 9.024 1.071 1.955 3.106 3.122 5.442 3.122a7.13 7.13 0 0 0 3.556-.97l12.291-7.098c3.279-1.893 4.572-5.942 2.883-9.024-1.072-1.955-3.106-3.123-5.443-3.123z' fill='#607D8B'/><path d='M149.588 109.407l6.737 3.89v.887c0 .176.013.36.037.549.011.081.02.161.028.242.14 1.415.973 2.998 2.105 3.999l7.396 6.545c.177.156.358.295.541.415 1.579 1.04 2.95.466 3.062-1.282.049-.784.057-1.595.023-2.429l-.003-.16v-1.151l25.987 15.003v54c0 1.09-.77 1.53-1.72.982l-42.473-24.523c-.95-.548-1.72-1.877-1.72-2.966v-34.033' fill='#FAFAFA'/><path d='M194.553 191.25c-.257 0-.54-.085-.831-.253l-42.472-24.521c-.981-.567-1.779-1.943-1.779-3.068v-34.033h.234v34.033c0 1.051.745 2.336 1.661 2.866l42.473 24.521c.424.245.816.288 1.103.122.285-.164.442-.52.442-1.002v-53.933l-25.753-14.868.003 1.106c.034.832.026 1.654-.024 2.439-.054.844-.396 1.464-.963 1.746-.619.309-1.45.173-2.28-.373a5.023 5.023 0 0 1-.553-.426l-7.397-6.544c-1.158-1.026-1.999-2.625-2.143-4.076a9.624 9.624 0 0 0-.027-.238 4.241 4.241 0 0 1-.038-.564v-.82l-6.68-3.856.117-.202 6.738 3.89.058.034v.954c0 .171.012.351.036.533.011.083.021.165.029.246.138 1.395.948 2.935 2.065 3.923l7.397 6.545c.173.153.35.289.527.406.758.499 1.504.63 2.047.359.49-.243.786-.795.834-1.551.05-.778.057-1.591.024-2.417l-.004-.163v-1.355l.175.1 25.987 15.004.059.033v54.068c0 .569-.198.996-.559 1.204a1.002 1.002 0 0 1-.506.131' fill='#607D8B'/><path d='M145.685 163.161l24.115 13.922-25.978 14.998-1.462-.307c-6.534-2.17-13.628-3.728-21.019-4.616-4.365-.524-8.663 1.096-9.598 3.62a2.746 2.746 0 0 0-.011 1.928c1.538 4.267 4.236 8.363 7.995 12.135l.532.845-25.977 14.997-24.115-13.922 75.518-43.6' fill='#FFF'/><path d='M94.282 220.818l-.059-.033-24.29-14.024.175-.101 75.577-43.634.058.033 24.29 14.024-26.191 15.122-.045-.01-1.461-.307c-6.549-2.174-13.613-3.725-21.009-4.614a13.744 13.744 0 0 0-1.638-.097c-3.758 0-7.054 1.531-7.837 3.642a2.62 2.62 0 0 0-.01 1.848c1.535 4.258 4.216 8.326 7.968 12.091l.016.021.526.835.006.01.064.102-.105.061-25.977 14.998-.058.033zm-23.881-14.057l23.881 13.788 24.802-14.32c.546-.315.846-.489 1.017-.575l-.466-.74c-3.771-3.787-6.467-7.881-8.013-12.168a2.851 2.851 0 0 1 .011-2.008c.815-2.199 4.203-3.795 8.056-3.795.557 0 1.117.033 1.666.099 7.412.891 14.491 2.445 21.041 4.621.836.175 1.215.254 1.39.304l25.78-14.884-23.881-13.788-75.284 43.466z' fill='#607D8B'/><path d='M167.23 125.979v50.871l-27.321 15.773-6.461-14.167c-.91-1.996-3.428-1.738-5.624.574a10.238 10.238 0 0 0-2.33 4.018l-6.46 21.628-27.322 15.774v-50.871l75.518-43.6' fill='#FFF'/><path d='M91.712 220.567a.127.127 0 0 1-.059-.016.118.118 0 0 1-.058-.101v-50.871c0-.042.023-.08.058-.101l75.519-43.6a.117.117 0 0 1 .175.101v50.871c0 .041-.023.08-.059.1l-27.321 15.775a.118.118 0 0 1-.094.01.12.12 0 0 1-.071-.063l-6.46-14.168c-.375-.822-1.062-1.275-1.934-1.275-1.089 0-2.364.686-3.5 1.881a10.206 10.206 0 0 0-2.302 3.972l-6.46 21.627a.118.118 0 0 1-.054.068L91.77 220.551a.12.12 0 0 1-.058.016zm.117-50.92v50.601l27.106-15.65 6.447-21.583a10.286 10.286 0 0 1 2.357-4.065c1.18-1.242 2.517-1.954 3.669-1.954.969 0 1.731.501 2.146 1.411l6.407 14.051 27.152-15.676v-50.601l-75.284 43.466z' fill='#607D8B'/><path d='M168.543 126.213v50.87l-27.322 15.774-6.46-14.168c-.91-1.995-3.428-1.738-5.624.574a10.248 10.248 0 0 0-2.33 4.019l-6.461 21.627-27.321 15.774v-50.87l75.518-43.6' fill='#FFF'/><path d='M93.025 220.8a.123.123 0 0 1-.059-.015.12.12 0 0 1-.058-.101v-50.871c0-.042.023-.08.058-.101l75.518-43.6a.112.112 0 0 1 .117 0c.036.02.059.059.059.1v50.871a.116.116 0 0 1-.059.101l-27.321 15.774a.111.111 0 0 1-.094.01.115.115 0 0 1-.071-.062l-6.46-14.168c-.375-.823-1.062-1.275-1.935-1.275-1.088 0-2.363.685-3.499 1.881a10.19 10.19 0 0 0-2.302 3.971l-6.461 21.628a.108.108 0 0 1-.053.067l-27.322 15.775a.12.12 0 0 1-.058.015zm.117-50.919v50.6l27.106-15.649 6.447-21.584a10.293 10.293 0 0 1 2.357-4.065c1.179-1.241 2.516-1.954 3.668-1.954.969 0 1.732.502 2.147 1.412l6.407 14.051 27.152-15.676v-50.601l-75.284 43.466z' fill='#607D8B'/><path d='M169.8 177.083l-27.322 15.774-6.46-14.168c-.91-1.995-3.428-1.738-5.625.574a10.246 10.246 0 0 0-2.329 4.019l-6.461 21.627-27.321 15.774v-50.87l75.518-43.6v50.87z' fill='#FAFAFA'/><path d='M94.282 220.917a.234.234 0 0 1-.234-.233v-50.871c0-.083.045-.161.117-.202l75.518-43.601a.234.234 0 1 1 .35.202v50.871a.233.233 0 0 1-.116.202l-27.322 15.775a.232.232 0 0 1-.329-.106l-6.461-14.168c-.36-.789-.992-1.206-1.828-1.206-1.056 0-2.301.672-3.415 1.844a10.099 10.099 0 0 0-2.275 3.924l-6.46 21.628a.235.235 0 0 1-.107.136l-27.322 15.774a.23.23 0 0 1-.116.031zm.233-50.969v50.331l26.891-15.525 6.434-21.539a10.41 10.41 0 0 1 2.384-4.112c1.201-1.265 2.569-1.991 3.753-1.991 1.018 0 1.818.526 2.253 1.48l6.354 13.934 26.982-15.578v-50.331l-75.051 43.331z' fill='#607D8B'/><path d='M109.894 199.943c-1.774 0-3.241-.725-4.244-2.12a.224.224 0 0 1 .023-.294.233.233 0 0 1 .301-.023c.78.547 1.705.827 2.75.827 1.323 0 2.754-.439 4.256-1.306 5.311-3.067 9.631-10.518 9.631-16.611 0-1.927-.442-3.56-1.278-4.724a.232.232 0 0 1 .323-.327c1.671 1.172 2.591 3.381 2.591 6.219 0 6.242-4.426 13.863-9.865 17.003-1.574.908-3.084 1.356-4.488 1.356zm-2.969-1.542c.813.651 1.82.877 2.968.877h.001c1.321 0 2.753-.327 4.254-1.194 5.311-3.067 9.632-10.463 9.632-16.556 0-1.979-.463-3.599-1.326-4.761.411 1.035.625 2.275.625 3.635 0 6.243-4.426 13.883-9.865 17.023-1.574.909-3.084 1.317-4.49 1.317-.641 0-1.243-.149-1.799-.341z' fill='#607D8B'/><path d='M113.097 197.23c5.384-3.108 9.748-10.636 9.748-16.814 0-2.051-.483-3.692-1.323-4.86-1.784-1.252-4.374-1.194-7.257.47-5.384 3.108-9.748 10.636-9.748 16.814 0 2.051.483 3.692 1.323 4.86 1.784 1.252 4.374 1.194 7.257-.47' fill='#FAFAFA'/><path d='M108.724 198.614c-1.142 0-2.158-.213-3.019-.817-.021-.014-.04.014-.055-.007-.894-1.244-1.367-2.948-1.367-4.973 0-6.242 4.426-13.864 9.865-17.005 1.574-.908 3.084-1.363 4.49-1.363 1.142 0 2.158.309 3.018.913a.23.23 0 0 1 .056.056c.894 1.244 1.367 2.972 1.367 4.997 0 6.243-4.426 13.783-9.865 16.923-1.574.909-3.084 1.276-4.49 1.276zm-2.718-1.109c.774.532 1.688.776 2.718.776 1.323 0 2.754-.413 4.256-1.28 5.311-3.066 9.631-10.505 9.631-16.598 0-1.909-.434-3.523-1.255-4.685-.774-.533-1.688-.799-2.718-.799-1.323 0-2.755.441-4.256 1.308-5.311 3.066-9.631 10.506-9.631 16.599 0 1.909.434 3.517 1.255 4.679z' fill='#607D8B'/><path d='M149.318 114.262l-9.984 8.878 15.893 11.031 5.589-6.112-11.498-13.797' fill='#FAFAFA'/><path d='M169.676 120.84l-9.748 5.627c-3.642 2.103-9.528 2.113-13.147.024-3.62-2.089-3.601-5.488.041-7.591l9.495-5.608-6.729-3.885-81.836 47.071 45.923 26.514 3.081-1.779c.631-.365.869-.898.618-1.39-2.357-4.632-2.593-9.546-.683-14.262 5.638-13.92 24.509-24.815 48.618-28.07 8.169-1.103 16.68-.967 24.704.394.852.145 1.776.008 2.407-.357l3.081-1.778-25.825-14.91' fill='#FAFAFA'/><path d='M113.675 183.459a.47.47 0 0 1-.233-.062l-45.924-26.515a.468.468 0 0 1 .001-.809l81.836-47.071a.467.467 0 0 1 .466 0l6.729 3.885a.467.467 0 0 1-.467.809l-6.496-3.75-80.9 46.533 44.988 25.973 2.848-1.644c.192-.111.62-.409.435-.773-2.416-4.748-2.658-9.814-.7-14.65 2.806-6.927 8.885-13.242 17.582-18.263 8.657-4.998 19.518-8.489 31.407-10.094 8.198-1.107 16.79-.97 24.844.397.739.125 1.561.007 2.095-.301l2.381-1.374-25.125-14.506a.467.467 0 0 1 .467-.809l25.825 14.91a.467.467 0 0 1 0 .809l-3.081 1.779c-.721.417-1.763.575-2.718.413-7.963-1.351-16.457-1.486-24.563-.392-11.77 1.589-22.512 5.039-31.065 9.977-8.514 4.916-14.456 11.073-17.183 17.805-1.854 4.578-1.623 9.376.666 13.875.37.725.055 1.513-.8 2.006l-3.081 1.78a.476.476 0 0 1-.234.062' fill='#455A64'/><path d='M153.316 128.279c-2.413 0-4.821-.528-6.652-1.586-1.818-1.049-2.82-2.461-2.82-3.975 0-1.527 1.016-2.955 2.861-4.02l9.493-5.607a.233.233 0 1 1 .238.402l-9.496 5.609c-1.696.979-2.628 2.263-2.628 3.616 0 1.34.918 2.608 2.585 3.571 3.549 2.049 9.343 2.038 12.914-.024l9.748-5.628a.234.234 0 0 1 .234.405l-9.748 5.628c-1.858 1.072-4.296 1.609-6.729 1.609' fill='#607D8B'/><path d='M113.675 182.992l-45.913-26.508M113.675 183.342a.346.346 0 0 1-.175-.047l-45.913-26.508a.35.35 0 1 1 .35-.607l45.913 26.508a.35.35 0 0 1-.175.654' fill='#455A64'/><path d='M67.762 156.484v54.001c0 1.09.77 2.418 1.72 2.967l42.473 24.521c.95.549 1.72.11 1.72-.98v-54.001' fill='#FAFAFA'/><path d='M112.727 238.561c-.297 0-.62-.095-.947-.285l-42.473-24.521c-1.063-.613-1.895-2.05-1.895-3.27v-54.001a.35.35 0 1 1 .701 0v54.001c0 .96.707 2.18 1.544 2.663l42.473 24.522c.344.198.661.243.87.122.206-.119.325-.411.325-.799v-54.001a.35.35 0 1 1 .7 0v54.001c0 .655-.239 1.154-.675 1.406a1.235 1.235 0 0 1-.623.162' fill='#455A64'/><path d='M112.86 147.512h-.001c-2.318 0-4.499-.522-6.142-1.471-1.705-.984-2.643-2.315-2.643-3.749 0-1.445.952-2.791 2.68-3.788l12.041-6.953c1.668-.962 3.874-1.493 6.212-1.493 2.318 0 4.499.523 6.143 1.472 1.704.984 2.643 2.315 2.643 3.748 0 1.446-.952 2.791-2.68 3.789l-12.042 6.952c-1.668.963-3.874 1.493-6.211 1.493zm12.147-16.753c-2.217 0-4.298.497-5.861 1.399l-12.042 6.952c-1.502.868-2.33 1.998-2.33 3.182 0 1.173.815 2.289 2.293 3.142 1.538.889 3.596 1.378 5.792 1.378h.001c2.216 0 4.298-.497 5.861-1.399l12.041-6.953c1.502-.867 2.33-1.997 2.33-3.182 0-1.172-.814-2.288-2.292-3.142-1.539-.888-3.596-1.377-5.793-1.377z' fill='#607D8B'/><path d='M165.63 123.219l-5.734 3.311c-3.167 1.828-8.286 1.837-11.433.02-3.147-1.817-3.131-4.772.036-6.601l5.734-3.31 11.397 6.58' fill='#FAFAFA'/><path d='M154.233 117.448l9.995 5.771-4.682 2.704c-1.434.827-3.352 1.283-5.399 1.283-2.029 0-3.923-.449-5.333-1.263-1.29-.744-2-1.694-2-2.674 0-.991.723-1.955 2.036-2.713l5.383-3.108m0-.809l-5.734 3.31c-3.167 1.829-3.183 4.784-.036 6.601 1.568.905 3.623 1.357 5.684 1.357 2.077 0 4.159-.46 5.749-1.377l5.734-3.311-11.397-6.58M145.445 179.667c-1.773 0-3.241-.85-4.243-2.245-.067-.092-.057-.275.023-.356.08-.081.207-.12.3-.055.781.548 1.706.812 2.751.811 1.322 0 2.754-.446 4.256-1.313 5.31-3.066 9.631-10.522 9.631-16.615 0-1.927-.442-3.562-1.279-4.726a.235.235 0 0 1 .024-.301.232.232 0 0 1 .3-.027c1.67 1.172 2.59 3.38 2.59 6.219 0 6.242-4.425 13.987-9.865 17.127-1.573.908-3.083 1.481-4.488 1.481zM142.476 178c.814.651 1.82 1.002 2.969 1.002 1.322 0 2.753-.452 4.255-1.32 5.31-3.065 9.631-10.523 9.631-16.617 0-1.98-.463-3.63-1.325-4.793.411 1.035.624 2.26.624 3.62 0 6.242-4.425 13.875-9.865 17.015-1.573.909-3.084 1.376-4.489 1.376a5.49 5.49 0 0 1-1.8-.283z' fill='#607D8B'/><path d='M148.648 176.704c5.384-3.108 9.748-10.636 9.748-16.813 0-2.052-.483-3.693-1.322-4.861-1.785-1.252-4.375-1.194-7.258.471-5.383 3.108-9.748 10.636-9.748 16.813 0 2.051.484 3.692 1.323 4.86 1.785 1.253 4.374 1.195 7.257-.47' fill='#FAFAFA'/><path d='M144.276 178.276c-1.143 0-2.158-.307-3.019-.911a.217.217 0 0 1-.055-.054c-.895-1.244-1.367-2.972-1.367-4.997 0-6.241 4.425-13.875 9.865-17.016 1.573-.908 3.084-1.369 4.489-1.369 1.143 0 2.158.307 3.019.91a.24.24 0 0 1 .055.055c.894 1.244 1.367 2.971 1.367 4.997 0 6.241-4.425 13.875-9.865 17.016-1.573.908-3.084 1.369-4.489 1.369zm-2.718-1.172c.773.533 1.687.901 2.718.901 1.322 0 2.754-.538 4.256-1.405 5.31-3.066 9.631-10.567 9.631-16.661 0-1.908-.434-3.554-1.256-4.716-.774-.532-1.688-.814-2.718-.814-1.322 0-2.754.433-4.256 1.3-5.31 3.066-9.631 10.564-9.631 16.657 0 1.91.434 3.576 1.256 4.738z' fill='#607D8B'/><path d='M150.72 172.361l-.363-.295a24.105 24.105 0 0 0 2.148-3.128 24.05 24.05 0 0 0 1.977-4.375l.443.149a24.54 24.54 0 0 1-2.015 4.46 24.61 24.61 0 0 1-2.19 3.189M115.917 191.514l-.363-.294a24.174 24.174 0 0 0 2.148-3.128 24.038 24.038 0 0 0 1.976-4.375l.443.148a24.48 24.48 0 0 1-2.015 4.461 24.662 24.662 0 0 1-2.189 3.188M114 237.476V182.584 237.476' fill='#607D8B'/><g><path d='M81.822 37.474c.017-.135-.075-.28-.267-.392-.327-.188-.826-.21-1.109-.045l-6.012 3.471c-.131.076-.194.178-.191.285.002.132.002.461.002.578v.043l-.007.128-6.591 3.779c-.001 0-2.077 1.046-2.787 5.192 0 0-.912 6.961-.898 19.745.015 12.57.606 17.07 1.167 21.351.22 1.684 3.001 2.125 3.001 2.125.331.04.698-.027 1.08-.248l75.273-43.551c1.808-1.069 2.667-3.719 3.056-6.284 1.213-7.99 1.675-32.978-.275-39.878-.196-.693-.51-1.083-.868-1.282l-2.086-.79c-.727.028-1.416.467-1.534.535L82.032 37.072l-.21.402' fill='#FFF'/><path d='M144.311 1.701l2.085.79c.358.199.672.589.868 1.282 1.949 6.9 1.487 31.887.275 39.878-.39 2.565-1.249 5.215-3.056 6.284L69.21 93.486a1.78 1.78 0 0 1-.896.258l-.183-.011c0 .001-2.782-.44-3.003-2.124-.56-4.282-1.151-8.781-1.165-21.351-.015-12.784.897-19.745.897-19.745.71-4.146 2.787-5.192 2.787-5.192l6.591-3.779.007-.128v-.043c0-.117 0-.446-.002-.578-.003-.107.059-.21.191-.285l6.012-3.472a.98.98 0 0 1 .481-.11c.218 0 .449.053.627.156.193.112.285.258.268.392l.211-.402 60.744-34.836c.117-.068.806-.507 1.534-.535m0-.997l-.039.001c-.618.023-1.283.244-1.974.656l-.021.012-60.519 34.706a2.358 2.358 0 0 0-.831-.15c-.365 0-.704.084-.98.244l-6.012 3.471c-.442.255-.699.69-.689 1.166l.001.15-6.08 3.487c-.373.199-2.542 1.531-3.29 5.898l-.006.039c-.009.07-.92 7.173-.906 19.875.014 12.62.603 17.116 1.172 21.465l.002.015c.308 2.355 3.475 2.923 3.836 2.98l.034.004c.101.013.204.019.305.019a2.77 2.77 0 0 0 1.396-.392l75.273-43.552c1.811-1.071 2.999-3.423 3.542-6.997 1.186-7.814 1.734-33.096-.301-40.299-.253-.893-.704-1.527-1.343-1.882l-.132-.062-2.085-.789a.973.973 0 0 0-.353-.065' fill='#455A64'/><path d='M128.267 11.565l1.495.434-56.339 32.326' fill='#FFF'/><path d='M74.202 90.545a.5.5 0 0 1-.25-.931l18.437-10.645a.499.499 0 1 1 .499.864L74.451 90.478l-.249.067M75.764 42.654l-.108-.062.046-.171 5.135-2.964.17.045-.045.171-5.135 2.964-.063.017M70.52 90.375V46.421l.063-.036L137.84 7.554v43.954l-.062.036L70.52 90.375zm.25-43.811v43.38l66.821-38.579V7.985L70.77 46.564z' fill='#607D8B'/><path d='M86.986 83.182c-.23.149-.612.384-.849.523l-11.505 6.701c-.237.139-.206.252.068.252h.565c.275 0 .693-.113.93-.252L87.7 83.705c.237-.139.428-.253.425-.256a11.29 11.29 0 0 1-.006-.503c0-.274-.188-.377-.418-.227l-.715.463' fill='#607D8B'/><path d='M75.266 90.782H74.7c-.2 0-.316-.056-.346-.166-.03-.11.043-.217.215-.317l11.505-6.702c.236-.138.615-.371.844-.519l.715-.464a.488.488 0 0 1 .266-.089c.172 0 .345.13.345.421 0 .214.001.363.003.437l.006.004-.004.069c-.003.075-.003.075-.486.356l-11.505 6.702a2.282 2.282 0 0 1-.992.268zm-.6-.25l.034.001h.566c.252 0 .649-.108.866-.234l11.505-6.702c.168-.098.294-.173.361-.214-.004-.084-.004-.218-.004-.437l-.095-.171-.131.049-.714.463c-.232.15-.616.386-.854.525l-11.505 6.702-.029.018z' fill='#607D8B'/><path d='M75.266 89.871H74.7c-.2 0-.316-.056-.346-.166-.03-.11.043-.217.215-.317l11.505-6.702c.258-.151.694-.268.993-.268h.565c.2 0 .316.056.346.166.03.11-.043.217-.215.317l-11.505 6.702a2.282 2.282 0 0 1-.992.268zm-.6-.25l.034.001h.566c.252 0 .649-.107.866-.234l11.505-6.702.03-.018-.035-.001h-.565c-.252 0-.649.108-.867.234l-11.505 6.702-.029.018zM74.37 90.801v-1.247 1.247' fill='#607D8B'/><path d='M68.13 93.901c-.751-.093-1.314-.737-1.439-1.376-.831-4.238-1.151-8.782-1.165-21.352-.015-12.784.897-19.745.897-19.745.711-4.146 2.787-5.192 2.787-5.192l74.859-43.219c.223-.129 2.487-1.584 3.195.923 1.95 6.9 1.488 31.887.275 39.878-.389 2.565-1.248 5.215-3.056 6.283L69.21 93.653c-.382.221-.749.288-1.08.248 0 0-2.781-.441-3.001-2.125-.561-4.281-1.152-8.781-1.167-21.351-.014-12.784.898-19.745.898-19.745.71-4.146 2.787-5.191 2.787-5.191l6.598-3.81.871-.119 6.599-3.83.046-.461L68.13 93.901' fill='#FAFAFA'/><path d='M68.317 94.161l-.215-.013h-.001l-.244-.047c-.719-.156-2.772-.736-2.976-2.292-.568-4.34-1.154-8.813-1.168-21.384-.014-12.654.891-19.707.9-19.777.725-4.231 2.832-5.338 2.922-5.382l6.628-3.827.87-.119 6.446-3.742.034-.334a.248.248 0 0 1 .273-.223.248.248 0 0 1 .223.272l-.059.589-6.752 3.919-.87.118-6.556 3.785c-.031.016-1.99 1.068-2.666 5.018-.007.06-.908 7.086-.894 19.702.014 12.539.597 16.996 1.161 21.305.091.691.689 1.154 1.309 1.452a1.95 1.95 0 0 1-.236-.609c-.781-3.984-1.155-8.202-1.17-21.399-.014-12.653.891-19.707.9-19.777.725-4.231 2.832-5.337 2.922-5.382-.004.001 74.444-42.98 74.846-43.212l.028-.017c.904-.538 1.72-.688 2.36-.433.555.221.949.733 1.172 1.52 2.014 7.128 1.46 32.219.281 39.983-.507 3.341-1.575 5.515-3.175 6.462L69.335 93.869a2.023 2.023 0 0 1-1.018.292zm-.147-.507c.293.036.604-.037.915-.217l75.273-43.551c1.823-1.078 2.602-3.915 2.934-6.106 1.174-7.731 1.731-32.695-.268-39.772-.178-.631-.473-1.032-.876-1.192-.484-.193-1.166-.052-1.921.397l-.034.021-74.858 43.218c-.031.017-1.989 1.069-2.666 5.019-.007.059-.908 7.085-.894 19.702.015 13.155.386 17.351 1.161 21.303.09.461.476.983 1.037 1.139.114.025.185.037.196.039h.001z' fill='#455A64'/><path d='M69.317 68.982c.489-.281.885-.056.885.505 0 .56-.396 1.243-.885 1.525-.488.282-.884.057-.884-.504 0-.56.396-1.243.884-1.526' fill='#FFF'/><path d='M68.92 71.133c-.289 0-.487-.228-.487-.625 0-.56.396-1.243.884-1.526a.812.812 0 0 1 .397-.121c.289 0 .488.229.488.626 0 .56-.396 1.243-.885 1.525a.812.812 0 0 1-.397.121m.794-2.459a.976.976 0 0 0-.49.147c-.548.317-.978 1.058-.978 1.687 0 .486.271.812.674.812a.985.985 0 0 0 .491-.146c.548-.317.978-1.057.978-1.687 0-.486-.272-.813-.675-.813' fill='#8097A2'/><path d='M68.92 70.947c-.271 0-.299-.307-.299-.439 0-.491.361-1.116.79-1.363a.632.632 0 0 1 .303-.096c.272 0 .301.306.301.438 0 .491-.363 1.116-.791 1.364a.629.629 0 0 1-.304.096m.794-2.086a.812.812 0 0 0-.397.121c-.488.283-.884.966-.884 1.526 0 .397.198.625.487.625a.812.812 0 0 0 .397-.121c.489-.282.885-.965.885-1.525 0-.397-.199-.626-.488-.626' fill='#8097A2'/><path d='M69.444 85.35c.264-.152.477-.031.477.272 0 .303-.213.67-.477.822-.263.153-.477.031-.477-.271 0-.302.214-.671.477-.823' fill='#FFF'/><path d='M69.23 86.51c-.156 0-.263-.123-.263-.337 0-.302.214-.671.477-.823a.431.431 0 0 1 .214-.066c.156 0 .263.124.263.338 0 .303-.213.67-.477.822a.431.431 0 0 1-.214.066m.428-1.412c-.1 0-.203.029-.307.09-.32.185-.57.618-.57.985 0 .309.185.524.449.524a.63.63 0 0 0 .308-.09c.32-.185.57-.618.57-.985 0-.309-.185-.524-.45-.524' fill='#8097A2'/><path d='M69.23 86.322l-.076-.149c0-.235.179-.544.384-.661l.12-.041.076.151c0 .234-.179.542-.383.66l-.121.04m.428-1.038a.431.431 0 0 0-.214.066c-.263.152-.477.521-.477.823 0 .214.107.337.263.337a.431.431 0 0 0 .214-.066c.264-.152.477-.519.477-.822 0-.214-.107-.338-.263-.338' fill='#8097A2'/><path d='M139.278 7.769v43.667L72.208 90.16V46.493l67.07-38.724' fill='#455A64'/><path d='M72.083 90.375V46.421l.063-.036 67.257-38.831v43.954l-.062.036-67.258 38.831zm.25-43.811v43.38l66.821-38.579V7.985L72.333 46.564z' fill='#607D8B'/></g><path d='M125.737 88.647l-7.639 3.334V84l-11.459 4.713v8.269L99 100.315l13.369 3.646 13.368-15.314' fill='#455A64'/></g></svg>";function Le(){this.loadIcon_();var e=document.createElement("div");(s=e.style).position="fixed",s.top=0,s.right=0,s.bottom=0,s.left=0,s.backgroundColor="gray",s.fontFamily="sans-serif",s.zIndex=1e6;var t=document.createElement("img");t.src=this.icon,(s=t.style).marginLeft="25%",s.marginTop="25%",s.width="50%",e.appendChild(t);var i=document.createElement("div");(s=i.style).textAlign="center",s.fontSize="16px",s.lineHeight="24px",s.margin="24px 25%",s.width="50%",i.innerHTML="Place your phone into your Cardboard viewer.",e.appendChild(i);var n=document.createElement("div");(s=n.style).backgroundColor="#CFD8DC",s.position="fixed",s.bottom=0,s.width="100%",s.height="48px",s.padding="14px 24px",s.boxSizing="border-box",s.color="#656A6B",e.appendChild(n);var r=document.createElement("div");r.style.float="left",r.innerHTML="No Cardboard viewer?";var s,o=document.createElement("a");o.href="https://www.google.com/get/cardboard/get-cardboard/",o.innerHTML="get one",o.target="_blank",(s=o.style).float="right",s.fontWeight=600,s.textTransform="uppercase",s.borderLeft="1px solid gray",s.paddingLeft="24px",s.textDecoration="none",s.color="#656A6B",n.appendChild(r),n.appendChild(o),this.overlay=e,this.text=i,this.hide()}Le.prototype.show=function(e){e||this.overlay.parentElement?e&&(this.overlay.parentElement&&this.overlay.parentElement!=e&&this.overlay.parentElement.removeChild(this.overlay),e.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var t=this.overlay.querySelector("img").style;N()?(t.width="20%",t.marginLeft="40%",t.marginTop="3%"):(t.width="50%",t.marginLeft="25%",t.marginTop="25%")},Le.prototype.hide=function(){this.overlay.style.display="none"},Le.prototype.showTemporarily=function(e,t){this.show(t),this.timer=setTimeout(this.hide.bind(this),e)},Le.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},Le.prototype.update=function(){this.disableShowTemporarily(),!N()&&L()?this.show():this.hide()},Le.prototype.loadIcon_=function(){this.icon=h("image/svg+xml",be)};var Se="CardboardV1",Oe="WEBVR_CARDBOARD_VIEWER",Ce="webvr-polyfill-viewer-selector";function Pe(e){try{this.selectedKey=localStorage.getItem(Oe)}catch(e){console.error("Failed to load viewer profile: %s",e)}this.selectedKey||(this.selectedKey=e||Se),this.dialog=this.createDialog_(fe.Viewers),this.root=null,this.onChangeCallbacks_=[]}function ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Be(e,t){return e(t={exports:{}},t.exports),t.exports}Pe.prototype.show=function(e){this.root=e,e.appendChild(this.dialog),this.dialog.querySelector("#"+this.selectedKey).checked=!0,this.dialog.style.display="block"},Pe.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},Pe.prototype.getCurrentViewer=function(){return fe.Viewers[this.selectedKey]},Pe.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},Pe.prototype.onChange=function(e){this.onChangeCallbacks_.push(e)},Pe.prototype.fireOnChange_=function(e){for(var t=0;t<this.onChangeCallbacks_.length;t++)this.onChangeCallbacks_[t](e)},Pe.prototype.onSave_=function(){if(this.selectedKey=this.getSelectedKey_(),this.selectedKey&&fe.Viewers[this.selectedKey]){this.fireOnChange_(fe.Viewers[this.selectedKey]);try{localStorage.setItem(Oe,this.selectedKey)}catch(e){console.error("Failed to save viewer profile: %s",e)}this.hide()}else console.error("ViewerSelector.onSave_: this should never happen!")},Pe.prototype.createDialog_=function(e){var t=document.createElement("div");t.classList.add(Ce),t.style.display="none";var i=document.createElement("div");(s=i.style).position="fixed",s.left=0,s.top=0,s.width="100%",s.height="100%",s.background="rgba(0, 0, 0, 0.3)",i.addEventListener("click",this.hide.bind(this));var n=280,r=document.createElement("div"),s=r.style;for(var o in s.boxSizing="border-box",s.position="fixed",s.top="24px",s.left="50%",s.marginLeft=-n/2+"px",s.width=n+"px",s.padding="24px",s.overflow="hidden",s.background="#fafafa",s.fontFamily="'Roboto', sans-serif",s.boxShadow="0px 5px 20px #666",r.appendChild(this.createH1_("Select your viewer")),e)r.appendChild(this.createChoice_(o,e[o].label));return r.appendChild(this.createButton_("Save",this.onSave_.bind(this))),t.appendChild(i),t.appendChild(r),t},Pe.prototype.createH1_=function(e){var t=document.createElement("h1"),i=t.style;return i.color="black",i.fontSize="20px",i.fontWeight="bold",i.marginTop=0,i.marginBottom="24px",t.innerHTML=e,t},Pe.prototype.createChoice_=function(e,t){var i=document.createElement("div");i.style.marginTop="8px",i.style.color="black";var n=document.createElement("input");n.style.fontSize="30px",n.setAttribute("id",e),n.setAttribute("type","radio"),n.setAttribute("value",e),n.setAttribute("name","field");var r=document.createElement("label");return r.style.marginLeft="4px",r.setAttribute("for",e),r.innerHTML=t,i.appendChild(n),i.appendChild(r),i},Pe.prototype.createButton_=function(e,t){var i=document.createElement("button");i.innerHTML=e;var n=i.style;return n.float="right",n.textTransform="uppercase",n.color="#1094f7",n.fontSize="14px",n.letterSpacing=0,n.border=0,n.background="none",n.marginTop="16px",i.addEventListener("click",t),i},void 0!==e||void 0!==i||"undefined"!=typeof self&&self;var Ue=ke(Be((function(i,n){!function(e,t){i.exports=t()}(0,(function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(i,n,r){var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=r(1),u=void 0!==t&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(t.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!e.MSStream,c=function(){function t(){o(this,t),u?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("playsinline",""),this.noSleepVideo.setAttribute("src",a),this.noSleepVideo.addEventListener("timeupdate",function(e){this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())}.bind(this)))}return s(t,[{key:"enable",value:function(){u?(this.disable(),this.noSleepTimer=e.setInterval((function(){e.location.href="/",e.setTimeout(e.stop,0)}),15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){u?this.noSleepTimer&&(e.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),t}();i.exports=c},function(e,t,i){e.exports="data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu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ACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}])}))}))),Qe=1e3,_e=[0,0,.5,1],Re=[.5,0,.5,1],Ye=e.requestAnimationFrame,Fe=e.cancelAnimationFrame;function Ve(){this.leftProjectionMatrix=new Float32Array(16),this.leftViewMatrix=new Float32Array(16),this.rightProjectionMatrix=new Float32Array(16),this.rightViewMatrix=new Float32Array(16),this.pose=null}function He(e){Object.defineProperties(this,{hasPosition:{writable:!1,enumerable:!0,value:e.hasPosition},hasExternalDisplay:{writable:!1,enumerable:!0,value:e.hasExternalDisplay},canPresent:{writable:!1,enumerable:!0,value:e.canPresent},maxLayers:{writable:!1,enumerable:!0,value:e.maxLayers},hasOrientation:{enumerable:!0,get:function(){return Q("VRDisplayCapabilities.prototype.hasOrientation","VRDisplay.prototype.getFrameData"),e.hasOrientation}}})}function Ge(e){var t=!("wakelock"in(e=e||{}))||e.wakelock;this.isPolyfilled=!0,this.displayId=Qe++,this.displayName="",this.depthNear=.01,this.depthFar=1e4,this.isPresenting=!1,Object.defineProperty(this,"isConnected",{get:function(){return Q("VRDisplay.prototype.isConnected","VRDisplayCapabilities.prototype.hasExternalDisplay"),!1}}),this.capabilities=new He({hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1}),this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.originalParent_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,t&&L()&&(this.wakelock_=new Ue)}Ge.prototype.getFrameData=function(e){return C(e,this._getPose(),this)},Ge.prototype.getPose=function(){return Q("VRDisplay.prototype.getPose","VRDisplay.prototype.getFrameData"),this._getPose()},Ge.prototype.resetPose=function(){return Q("VRDisplay.prototype.resetPose"),this._resetPose()},Ge.prototype.getImmediatePose=function(){return Q("VRDisplay.prototype.getImmediatePose","VRDisplay.prototype.getFrameData"),this._getPose()},Ge.prototype.requestAnimationFrame=function(e){return Ye(e)},Ge.prototype.cancelAnimationFrame=function(e){return Fe(e)},Ge.prototype.wrapForFullscreen=function(e){if(A())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var t=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",t.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;if(this.fullscreenElement_&&(this.originalParent_?this.originalParent_.appendChild(this.fullscreenElement_):this.fullscreenElement_.parentElement.removeChild(this.fullscreenElement_)),this.fullscreenElement_=e,this.originalParent_=e.parentElement,this.originalParent_||document.body.appendChild(e),!this.fullscreenWrapper_.parentElement){var i=this.fullscreenElement_.parentElement;i.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),i.removeChild(this.fullscreenElement_)}this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var n=this;function r(){if(n.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];n.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}return r(),this.fullscreenWrapper_},Ge.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var t=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),this.originalParent_===t?t.insertBefore(e,this.fullscreenWrapper_):this.originalParent_&&this.originalParent_.appendChild(e),t.removeChild(this.fullscreenWrapper_),e}},Ge.prototype.requestPresent=function(e){var t=this.isPresenting,i=this;return e instanceof Array||(Q("VRDisplay.prototype.requestPresent with non-array argument","an array of VRLayers as the first argument"),e=[e]),new Promise((function(n,r){if(i.capabilities.canPresent)if(0==e.length||e.length>i.capabilities.maxLayers)r(new Error("Invalid number of layers."));else{var s=e[0];if(s.source){var o=s.leftBounds||_e,a=s.rightBounds||Re;if(t){var u=i.layer_;u.source!==s.source&&(u.source=s.source);for(var c=0;c<4;c++)u.leftBounds[c]=o[c],u.rightBounds[c]=a[c];return i.wrapForFullscreen(i.layer_.source),i.updatePresent_(),void n()}if(i.layer_={predistorted:s.predistorted,source:s.source,leftBounds:o.slice(0),rightBounds:a.slice(0)},i.waitingForPresent_=!1,i.layer_&&i.layer_.source){var l=i.wrapForFullscreen(i.layer_.source),h=function(){var e=j();i.isPresenting=l===e,i.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary").catch((function(e){console.error("screen.orientation.lock() failed due to",e.message)})),i.waitingForPresent_=!1,i.beginPresent_(),n()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),i.removeFullscreenWrapper(),i.disableWakeLock(),i.endPresent_(),i.removeFullscreenListeners_()),i.fireVRDisplayPresentChange_()},d=function(){i.waitingForPresent_&&(i.removeFullscreenWrapper(),i.removeFullscreenListeners_(),i.disableWakeLock(),i.waitingForPresent_=!1,i.isPresenting=!1,r(new Error("Unable to present.")))};i.addFullscreenListeners_(l,h,d),x(l)?(i.enableWakeLock(),i.waitingForPresent_=!0):(A()||p())&&(i.enableWakeLock(),i.isPresenting=!0,i.beginPresent_(),i.fireVRDisplayPresentChange_(),n())}i.waitingForPresent_||A()||(E(),r(new Error("Unable to present.")))}else n()}else r(new Error("VRDisplay is not capable of presenting."))}))},Ge.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.disableWakeLock(),new Promise((function(i,n){e?(!E()&&A()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),p()&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.endPresent_(),t.fireVRDisplayPresentChange_()),i()):n(new Error("Was not presenting to VRDisplay."))}))},Ge.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},Ge.prototype.fireVRDisplayPresentChange_=function(){var t=new CustomEvent("vrdisplaypresentchange",{detail:{display:this}});e.dispatchEvent(t)},Ge.prototype.fireVRDisplayConnect_=function(){var t=new CustomEvent("vrdisplayconnect",{detail:{display:this}});e.dispatchEvent(t)},Ge.prototype.addFullscreenListeners_=function(e,t,i){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=t,this.fullscreenErrorHandler_=i,t&&(document.fullscreenEnabled?e.addEventListener("fullscreenchange",t,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenchange",t,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenchange",t,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenchange",t,!1)),i&&(document.fullscreenEnabled?e.addEventListener("fullscreenerror",i,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenerror",i,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenerror",i,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenerror",i,!1))},Ge.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var t=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",t,!1),e.removeEventListener("webkitfullscreenchange",t,!1),document.removeEventListener("mozfullscreenchange",t,!1),e.removeEventListener("msfullscreenchange",t,!1)}if(this.fullscreenErrorHandler_){var i=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",i,!1),e.removeEventListener("webkitfullscreenerror",i,!1),document.removeEventListener("mozfullscreenerror",i,!1),e.removeEventListener("msfullscreenerror",i,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},Ge.prototype.enableWakeLock=function(){this.wakelock_&&this.wakelock_.enable()},Ge.prototype.disableWakeLock=function(){this.wakelock_&&this.wakelock_.disable()},Ge.prototype.beginPresent_=function(){},Ge.prototype.endPresent_=function(){},Ge.prototype.submitFrame=function(e){},Ge.prototype.getEyeParameters=function(e){return null};var qe={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1},We={LEFT:"left",RIGHT:"right"};function Ze(t){var i=S({},qe);t=S(i,t||{}),Ge.call(this,{wakelock:t.MOBILE_WAKE_LOCK}),this.config=t,this.displayName="Cardboard VRDisplay",this.capabilities=new He({hasPosition:!1,hasOrientation:!0,hasExternalDisplay:!1,canPresent:!0,maxLayers:1}),this.stageParameters=null,this.bufferScale_=this.config.BUFFER_SCALE,this.poseSensor_=new ze(this.config),this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new ve(this.config.DPDB_URL,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new fe(this.dpdb_.getDeviceParams(),t.ADDITIONAL_VIEWERS),this.viewerSelector_=new Pe(t.DEFAULT_VIEWER),this.viewerSelector_.onChange(this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),this.config.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new Le),A()&&e.addEventListener("resize",this.onResize_.bind(this))}return Ze.prototype=Object.create(Ge.prototype),Ze.prototype._getPose=function(){return{position:null,orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},Ze.prototype._resetPose=function(){this.poseSensor_.resetPose&&this.poseSensor_.resetPose()},Ze.prototype._getFieldOfView=function(e){var t;if(e==We.LEFT)t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=We.RIGHT)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return t},Ze.prototype._getEyeOffset=function(e){var t;if(e==We.LEFT)t=[.5*-this.deviceInfo_.viewer.interLensDistance,0,0];else{if(e!=We.RIGHT)return console.error("Invalid eye provided: %s",e),null;t=[.5*this.deviceInfo_.viewer.interLensDistance,0,0]}return t},Ze.prototype.getEyeParameters=function(e){var t=this._getEyeOffset(e),i=this._getFieldOfView(e),n={offset:t,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_};return Object.defineProperty(n,"fieldOfView",{enumerable:!0,get:function(){return Q("VRFieldOfView","VRFrameData's projection matrices"),i}}),n},Ze.prototype.onDeviceParamsUpdated_=function(e){this.config.DEBUG&&console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_)},Ze.prototype.updateBounds_=function(){this.layer_&&this.distorter_&&(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)},Ze.prototype.beginPresent_=function(){var t=this.layer_.source.getContext("webgl");t||(t=this.layer_.source.getContext("experimental-webgl")),t||(t=this.layer_.source.getContext("webgl2")),t&&(this.layer_.predistorted?this.config.CARDBOARD_UI_DISABLED||(t.canvas.width=w()*this.bufferScale_,t.canvas.height=T()*this.bufferScale_,this.cardboardUI_=new ne(t)):(this.config.CARDBOARD_UI_DISABLED||(this.cardboardUI_=new ne(t)),this.distorter_=new V(t,this.cardboardUI_,this.config.BUFFER_SCALE,this.config.DIRTY_SUBMIT_FRAME_BINDINGS),this.distorter_.updateDeviceInfo(this.deviceInfo_)),this.cardboardUI_&&this.cardboardUI_.listen(function(e){this.viewerSelector_.show(this.layer_.source.parentElement),e.stopPropagation(),e.preventDefault()}.bind(this),function(e){this.exitPresent(),e.stopPropagation(),e.preventDefault()}.bind(this)),this.rotateInstructions_&&(N()&&L()?this.rotateInstructions_.showTemporarily(3e3,this.layer_.source.parentElement):this.rotateInstructions_.update()),this.orientationHandler=this.onOrientationChange_.bind(this),e.addEventListener("orientationchange",this.orientationHandler),this.vrdisplaypresentchangeHandler=this.updateBounds_.bind(this),e.addEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler),this.fireVRDisplayDeviceParamsChange_())},Ze.prototype.endPresent_=function(){this.distorter_&&(this.distorter_.destroy(),this.distorter_=null),this.cardboardUI_&&(this.cardboardUI_.destroy(),this.cardboardUI_=null),this.rotateInstructions_&&this.rotateInstructions_.hide(),this.viewerSelector_.hide(),e.removeEventListener("orientationchange",this.orientationHandler),e.removeEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler)},Ze.prototype.updatePresent_=function(){this.endPresent_(),this.beginPresent_()},Ze.prototype.submitFrame=function(e){if(this.distorter_)this.updateBounds_(),this.distorter_.submitFrame();else if(this.cardboardUI_&&this.layer_){var t=this.layer_.source.getContext("webgl");t||(t=this.layer_.source.getContext("experimental-webgl")),t||(t=this.layer_.source.getContext("webgl2"));var i=t.canvas;i.width==this.lastWidth&&i.height==this.lastHeight||this.cardboardUI_.onResize(),this.lastWidth=i.width,this.lastHeight=i.height,this.cardboardUI_.render()}},Ze.prototype.onOrientationChange_=function(e){this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},Ze.prototype.onResize_=function(e){if(this.layer_){var t=this.layer_.source.getContext("webgl");t||(t=this.layer_.source.getContext("experimental-webgl")),t||(t=this.layer_.source.getContext("webgl2"));var i=["position: absolute","top: 0","left: 0","width: 100vw","height: 100vh","border: 0","margin: 0","padding: 0px","box-sizing: content-box"];t.canvas.setAttribute("style",i.join("; ")+";"),O(t.canvas)}},Ze.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},Ze.prototype.fireVRDisplayDeviceParamsChange_=function(){var t=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});e.dispatchEvent(t)},Ze.VRFrameData=Ve,Ze.VRDisplay=Ge,Ze}))}))),c="0.10.12",l={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",PROVIDE_MOBILE_VRDISPLAY:!0,MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1};function h(i){this.config=a(a({},l),i),this.polyfillDisplays=[],this.enabled=!1,this.hasNative="getVRDisplays"in t,this.native={},this.native.getVRDisplays=t.getVRDisplays,this.native.VRFrameData=e.VRFrameData,this.native.VRDisplay=e.VRDisplay,(!this.hasNative||this.config.PROVIDE_MOBILE_VRDISPLAY&&s())&&(this.enable(),this.getVRDisplays().then((function(e){e&&e[0]&&e[0].fireVRDisplayConnect_&&e[0].fireVRDisplayConnect_()})))}h.prototype.getPolyfillDisplays=function(){if(this._polyfillDisplaysPopulated)return this.polyfillDisplays;if(s()){var e=new u({ADDITIONAL_VIEWERS:this.config.ADDITIONAL_VIEWERS,DEFAULT_VIEWER:this.config.DEFAULT_VIEWER,MOBILE_WAKE_LOCK:this.config.MOBILE_WAKE_LOCK,DEBUG:this.config.DEBUG,DPDB_URL:this.config.DPDB_URL,CARDBOARD_UI_DISABLED:this.config.CARDBOARD_UI_DISABLED,K_FILTER:this.config.K_FILTER,PREDICTION_TIME_S:this.config.PREDICTION_TIME_S,ROTATE_INSTRUCTIONS_DISABLED:this.config.ROTATE_INSTRUCTIONS_DISABLED,YAW_ONLY:this.config.YAW_ONLY,BUFFER_SCALE:this.config.BUFFER_SCALE,DIRTY_SUBMIT_FRAME_BINDINGS:this.config.DIRTY_SUBMIT_FRAME_BINDINGS});this.polyfillDisplays.push(e)}return this._polyfillDisplaysPopulated=!0,this.polyfillDisplays},h.prototype.enable=function(){if(this.enabled=!0,this.hasNative&&this.native.VRFrameData){var i=this.native.VRFrameData,n=new this.native.VRFrameData,r=this.native.VRDisplay.prototype.getFrameData;e.VRDisplay.prototype.getFrameData=function(e){e instanceof i?r.call(this,e):(r.call(this,n),e.pose=n.pose,o(n.leftProjectionMatrix,e.leftProjectionMatrix),o(n.rightProjectionMatrix,e.rightProjectionMatrix),o(n.leftViewMatrix,e.leftViewMatrix),o(n.rightViewMatrix,e.rightViewMatrix))}}t.getVRDisplays=this.getVRDisplays.bind(this),e.VRDisplay=u.VRDisplay,e.VRFrameData=u.VRFrameData},h.prototype.getVRDisplays=function(){var e=this;return this.config,this.hasNative?this.native.getVRDisplays.call(t).then((function(t){return t.length>0?t:e.getPolyfillDisplays()})):Promise.resolve(this.getPolyfillDisplays())},h.version=c,h.VRFrameData=u.VRFrameData,h.VRDisplay=u.VRDisplay;var d=Object.freeze({default:h}),A=d&&h||d;return void 0!==i&&i.window&&(i.document||(i.document=i.window.document),i.navigator||(i.navigator=i.window.navigator)),A}("undefined"!=typeof window?window:{screen:{width:512,height:512}},"undefined"!=typeof navigator?navigator:{userAgent:"node"});
452
452
  /**
453
453
  * @license
454
454
  * webvr-polyfill
@@ -542,4 +542,4 @@ function(e,t){for(var i=e.toByteArray(),n=0;n<i.length&&0==i[n];)++n;if(i.length
542
542
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
543
543
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
544
544
  * THE SOFTWARE.
545
- */function ir(e,t){var i,n,r,s,o=new a.Vector3,u=new a.Vector3,c=null;"VRFrameData"in window&&(c=new window.VRFrameData),"undefined"!=typeof navigator&&navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){n=e,e.length>0?i=e[0]:t&&t(new Error("HMD not available"))})).catch((function(){console.warn("THREE.VREffect: Unable to get VR Displays")})),this.isPresenting=!1,this.scale=1;var l=this,h=e.getSize(new a.Vector2),d=!1,p=e.getPixelRatio();this.getVRDisplay=function(){return i},this.setVRDisplay=function(e){i=e},this.getVRDisplays=function(){return console.warn("THREE.VREffect: getVRDisplays() is being deprecated."),n},this.setSize=function(t,n,r){if(h=new a.Vector2(t,n),d=r,l.isPresenting){var s=i.getEyeParameters("left");e.setPixelRatio(1),e.setSize(2*s.renderWidth,s.renderHeight,!1)}else e.setPixelRatio(p),e.setSize(t,n,r)};var M=e.domElement,f=[0,0,.5,1],g=[.5,0,.5,1];function A(){var t=l.isPresenting;if(l.isPresenting=void 0!==i&&i.isPresenting,l.isPresenting){var n=i.getEyeParameters("left"),r=n.renderWidth,s=n.renderHeight;t||(p=e.getPixelRatio(),h=e.getSize(new a.Vector2),e.setPixelRatio(1),e.setSize(2*r,s,!1))}else t&&(e.setPixelRatio(p),e.setSize(h.width,h.height,d))}window.addEventListener("vrdisplaypresentchange",A,!1),this.setFullScreen=function(e){return new Promise((function(t,n){void 0!==i?l.isPresenting!==e?e?(i.requestPresent([{source:M}]),t()):(i.exitPresent(),t()):t():n(new Error("No VR hardware found."))}))},this.requestPresent=function(){return this.setFullScreen(!0)},this.exitPresent=function(){return this.setFullScreen(!1)},this.requestAnimationFrame=function(e){return void 0!==i?i.requestAnimationFrame(e):window.requestAnimationFrame(e)},this.cancelAnimationFrame=function(e){void 0!==i?i.cancelAnimationFrame(e):window.cancelAnimationFrame(e)},this.submitFrame=function(){void 0!==i&&l.isPresenting&&i.submitFrame()},this.autoSubmitFrame=!0;var y=new a.PerspectiveCamera;y.layers.enable(1);var v=new a.PerspectiveCamera;function m(e,t,i,n){var r=Math.PI/180;return function(e,t,i,n){i=void 0===i?.01:i,n=void 0===n?1e4:n;var r=(t=void 0===t||t)?-1:1,s=new a.Matrix4,o=s.elements,u=function(e){var t=2/(e.leftTan+e.rightTan),i=(e.leftTan-e.rightTan)*t*.5,n=2/(e.upTan+e.downTan);return{scale:[t,n],offset:[i,(e.upTan-e.downTan)*n*.5]}}(e);return o[0]=u.scale[0],o[1]=0,o[2]=u.offset[0]*r,o[3]=0,o[4]=0,o[5]=u.scale[1],o[6]=-u.offset[1]*r,o[7]=0,o[8]=0,o[9]=0,o[10]=n/(i-n)*-r,o[11]=n*i/(i-n),o[12]=0,o[13]=0,o[14]=r,o[15]=0,s.transpose(),s}({upTan:Math.tan(e.upDegrees*r),downTan:Math.tan(e.downDegrees*r),leftTan:Math.tan(e.leftDegrees*r),rightTan:Math.tan(e.rightDegrees*r)},t,i,n)}v.layers.enable(2),this.render=function(t,n){var h,d;if(i&&l.isPresenting){var p=t.autoUpdate;p&&(t.updateMatrixWorld(),t.autoUpdate=!1);var M=i.getEyeParameters("left"),A=i.getEyeParameters("right");o.fromArray(M.offset),u.fromArray(A.offset),Array.isArray(t)&&(console.warn("THREE.VREffect.render() no longer supports arrays. Use object.layers instead."),t=t[0]);var N,D,w=e.getSize(new a.Vector2),T=i.getLayers();if(T.length){var x=T[0];N=null!==x.leftBounds&&4===(null===(h=x.leftBounds)||void 0===h?void 0:h.length)?x.leftBounds:f,D=null!==x.rightBounds&&4===(null===(d=x.rightBounds)||void 0===d?void 0:d.length)?x.rightBounds:g}else N=f,D=g;r={x:Math.round(w.width*N[0]),y:Math.round(w.height*N[1]),width:Math.round(w.width*N[2]),height:Math.round(w.height*N[3])},s={x:Math.round(w.width*D[0]),y:Math.round(w.height*D[1]),width:Math.round(w.width*D[2]),height:Math.round(w.height*D[3])},e.setScissorTest(!0),e.autoClear&&e.clear(),null===n.parent&&n.updateMatrixWorld(),n.matrixWorld.decompose(y.position,y.quaternion,y.scale),n.matrixWorld.decompose(v.position,v.quaternion,v.scale);var E=this.scale;return y.translateOnAxis(o,E),v.translateOnAxis(u,E),i.getFrameData&&c?(i.depthNear=n.near,i.depthFar=n.far,i.getFrameData(c),y.projectionMatrix.elements=[].slice.call(c.leftProjectionMatrix),v.projectionMatrix.elements=[].slice.call(c.rightProjectionMatrix)):(y.projectionMatrix=m(M.fieldOfView,!0,n.near,n.far),v.projectionMatrix=m(A.fieldOfView,!0,n.near,n.far)),e.setViewport(r.x,r.y,r.width,r.height),e.setScissor(r.x,r.y,r.width,r.height),e.render(t,y),e.setViewport(s.x,s.y,s.width,s.height),e.setScissor(s.x,s.y,s.width,s.height),e.render(t,v),e.setViewport(0,0,w.width,w.height),e.setScissorTest(!1),p&&(t.autoUpdate=!0),void(l.autoSubmitFrame&&l.submitFrame())}e.render(t,n)},this.dispose=function(){window.removeEventListener("vrdisplaypresentchange",A,!1)}}var nr=new a.SphereBufferGeometry(.1,32,32);function rr(e,t){Array.isArray(e)?e.forEach((function(e){e instanceof a.MeshBasicMaterial&&e.setValues({color:t})})):e instanceof a.MeshBasicMaterial&&e.setValues({color:t})}var sr=function(e){function i(){var t=e.call(this)||this,i=new a.MeshBasicMaterial({color:8900346,opacity:.5,transparent:!0});return t.mesh=new a.Mesh(nr,i),t.active=!1,t.current=!1,t.add(t.mesh),t}return t.__extends(i,e),i.prototype.isActive=function(){return this.active},i.prototype.isCurrent=function(){return this.current},i.prototype.setActive=function(){!0!==this.active&&(this.active=!0,rr(this.mesh.material,16776960))},i.prototype.setCurrent=function(){!0!==this.current&&(this.current=!0,rr(this.mesh.material,65280))},i.prototype.reset=function(){!1===this.current&&!1===this.active||(this.active=!1,this.current=!1,rr(this.mesh.material,8900346))},i.prototype.dispose=function(){this.remove(this.mesh),Array.isArray(this.mesh.material)?this.mesh.material.forEach((function(e){return e.dispose()})):this.mesh.material.dispose()},i}(a.Object3D);var or=null,ar=function(e){function i(t){var n=this;Ve(or)&&(or=new tr(t.webvrPolyfillConfig||{}));var r=i.parseArgs(t);n=e.call(this,r)||this;var s=r.element,o=r.renderer,a=r.panoIndex,u=void 0===a?0:a;n.effect=new ir(o);var c=s.offsetWidth,l=s.offsetHeight;n.element=s,n.effect.setSize(c,l),n.effect.isPresenting=!0,n.panoSphereMeshes=n.work.observers.map((function(e,t){var i=new sr;return i.name="panoSphereMesh_"+t,i.position.copy(e.position),Object.assign(i,{panoIndex:t}),n.helper.add(i),i}));var h=n.work.observers[u].visibleNodes;h=h.filter((function(e){return n.work.observers[e].active}));var d=n.panoSphereMeshes.filter((function(e){return e.panoIndex===u}))[0];return n.panoSphereMeshes.forEach((function(e){if(e.visible=h.indexOf(e.panoIndex)>=0,d){var t=d.position.distanceTo(e.position)<5;e.visible=e.visible&&t}})),n.intersectMesh.parent&&n.intersectMesh.parent.remove(n.intersectMesh),n.initHelper(s),n}return t.__extends(i,e),i.parseArgs=function(i){var n=t.__assign(t.__assign({},i),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return e.parseArgs.call(this,n)},i.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},i.prototype.destroy=function(){var t=this;e.prototype.destroy.call(this),this.panoSphereMeshes&&(this.panoSphereMeshes.forEach((function(e){t.helper.remove(e),e.dispose()})),this.panoSphereMeshes.length=0),this.destroyHelper()},i.prototype.initHelper=function(e){for(var t="five_webvr_helper_"+qe(),i=1,n=document.getElementsByTagName("meta"),r=0;r<n.length;r++){var s=n[r];if("viewport"===s.getAttribute("name")){var o=(s.getAttribute("content")||"").match(/initial\-scale\=([\d|\.]+)/);o&&(i=Number(o[1])),isNaN(i)&&(i=1)}}var a=function(e){return Math.floor(e*i)+"px"},u=document.createElement("style"),c="\n ."+t+"{\n font-family:sans-serif;\n background:#394043;color:#ffffff;\n position:absolute;display:none;\n -webkit-tap-highlight-color:rgba(0,0,0,0);\n }\n ."+t+" img{\n position:absolute;top:50%;left:50%;\n -webkit-transform:translate(-50%,-100%);\n -moz-transform:translate(-50%,-100%);\n transform:translate(-50%,-100%);\n pointer-events:none;\n width:"+a(132)+";\n height:"+a(162)+";\n }\n ."+t+" ol{\n position:absolute;top:50%;left:50%;\n -webkit-transform:translate(-50%,0);\n -moz-transform:translate(-50%,0);\n transform:translate(-50%,0);\n pointer-events:none;\n margin-top:"+a(38)+";\n font-size:"+a(16)+";\n line-height:"+a(30)+";\n }\n ."+t+" li{\n list-style-type:none;\n white-space:nowrap;\n position:relative;\n padding-left:"+a(14)+";\n }\n ."+t+" li:before{\n content:'';display:block;height:"+a(6)+";width:"+a(6)+";\n position:absolute;top:50%;left:0;\n -webkit-transform:translate(0,-50%);\n -moz-transform:translate(0,-50%);\n transform:translate(0,-50%);\n border-radius:50%;background:#ffffff;\n }\n @media screen and (orientation: portrait){\n ."+t+"{display: block!important}\n }\n ";u.setAttribute("type","text/css"),"styleSheet"in u?u.styleSheet.cssText=c:u.appendChild(document.createTextNode(c));var l=this.helperElement=document.createElement("div");l.className=t,l.innerHTML='\n <img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTMycHgiIGhlaWdodD0iMTYycHgiIHZpZXdCb3g9IjAgMCAxMzIgMTYyIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA0Ni4xICg0NDQ2MykgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+CiAgICA8dGl0bGU+R3JvdXA8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cG9seWdvbiBpZD0icGF0aC0xIiBwb2ludHM9IjY1Ljk4NTM0MjMgOTMuMTg5NjU1MiAwIDkzLjE4OTY1NTIgMCAwLjI0NzE1NTE3MiAxMzEuOTcwNjg1IDAuMjQ3MTU1MTcyIDEzMS45NzA2ODUgOTMuMTg5NjU1MiI+PC9wb2x5Z29uPgogICAgPC9kZWZzPgogICAgPGcgaWQ9IlBhZ2UtMSIgc3Ryb2tlPSJub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hbnNsYXRlKDczLjc1ODUyMSwgNTguOTQxOTI3KSByb3RhdGUoMTgwLjAwMDAwMCkgdHJhbnNsYXRlKC03My43NTg1MjEsIC01OC45NDE5MjcpICI+PC9wYXRoPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="/>\n <ol style="">\n <li>进入:将手机横屏放入VR眼镜中</li>\n <li>前进:视角中心对准蓝点,直至变绿</li>\n <li>退出:将手机竖屏再触碰屏幕</li>\n </ol>\n ';var h=new Wi(l);e.parentNode&&(e.parentNode.insertBefore(u,e),e.parentNode.insertBefore(l,e),this.setHelperElementSize(),h.on("tap",this.vrWantsToExit.bind(this))),this.destroyHelper=function(){h.destroy(),u.parentNode&&u.parentNode.removeChild(u),l.parentNode&&l.parentNode.removeChild(l)}},i.prototype.setHelperElementSize=function(){if(this.helperElement){var e=this.renderer.domElement,t=new a.Vector2(e.offsetWidth,e.offsetHeight),i=t.x*this.scissor.left,n=t.y*(1-this.scissor.bottom-this.scissor.height),r=t.x*this.scissor.width,s=t.y*this.scissor.height;this.helperElement.style.marginLeft=i+"px",this.helperElement.style.marginTop=n+"px",this.helperElement.style.width=r+"px",this.helperElement.style.height=s+"px"}},i.prototype.destroyHelper=function(){},i.prototype.resize=function(){var e=this.element,t=e.offsetWidth,i=e.offsetHeight;this.effect.isPresenting=!1,this.effect.setSize(t,i),this.effect.isPresenting=!0,this.needsRender=!0,this.setHelperElementSize()},i.prototype.doMoveToPano=function(){for(var t=this,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];e.prototype.doMoveToPano.apply(this,i);var r=i[0],s=this.work.observers[r],o=s.visibleNodes;o=o.filter((function(e){return t.work.observers[e].active}));var a=this.panoSphereMeshes.filter((function(e){return e.panoIndex===r}))[0];this.panoSphereMeshes.forEach((function(e){if(e.visible=o.indexOf(e.panoIndex)>=0,a){var t=a.position.distanceTo(e.position)<5;e.visible=e.visible&&t}})),this.needsRender=!0},i.prototype.vrWantsToExit=function(){this.emit("vrWantsToExit")},i.prototype.onPanGesture=function(){},i.prototype.onTapGesture=function(){},i.prototype.onPinchGesture=function(){},i.prototype.onMouseMove=function(){},i.prototype.onMouseOut=function(){},i.prototype.renderIntersect=function(){var e=this,t=e.camera,i=e.model,n=e.intersectMesh,r=e.panoSphereMeshes,s=e.intersectCameraPosition,o=e.intersectCameraVector,u=e.intersectActiveSphereMesh,c=e.intersectActiveDate;if(n){u&&c&&Ke()-c>2e3&&(delete this.intersectActiveDate,u.setCurrent(),this.moveToPano(u.panoIndex,{},!0));var l=t.getWorldDirection(new a.Vector3);if(!(s&&o&&t.pose.offset.equals(s)&&l.equals(o))){var h=t.pose.offset.clone(),d=new a.Raycaster(h,l),p=null,M=null;if(!p)for(var f=0,g=r.filter((function(e){return e.visible}));f<g.length;f++){var A=g[f],y=d.intersectObject(A,!0)[0];if(y){p=y,M=A;break}}if(p||i.empty||(p=i.intersectRaycaster(d)[0]),p&&p.face){var v=p.face.normal,m=new a.Quaternion;m.setFromUnitVectors(new a.Vector3(0,0,-1),v),n.quaternion.copy(m);var N=v.clone().multiplyScalar(.05),D=p.point.clone().add(N);if(n.position.copy(D),n.visible=!0,this.emit("intersectionOnModelUpdate",p,n),r.forEach((function(e){return e.reset()})),M)(A=M).setActive(),this.intersectActiveSphereMesh!==A&&(this.intersectActiveSphereMesh=A,this.intersectActiveDate=Ke());else delete this.intersectActiveSphereMesh,delete this.intersectActiveDate}else n.visible=!1,this.emit("intersectionHidden"),delete this.intersectActiveSphereMesh,delete this.intersectActiveDate;this.intersectCameraPosition=t.pose.offset.clone(),this.intersectCameraVector=l.clone(),this.needsRender=!0}}},i.prototype.render=function(){var e=this,t=e.effect,i=e.camera,n=e.scene,r=t.getVRDisplay(),s=this.camera.pose,o=s.longitude,u=s.latitude;if(r){var c=r.getPose();if(Ve(c.orientation)||i.quaternion.fromArray(c.orientation),r.stageParameters){i.updateMatrix();var l=r.stageParameters.sittingToStandingTransform,h=new a.Matrix4;h.fromArray(l),i.applyMatrix4(h)}}i.updateMatrixWorld(),i.computePose();var d=this.camera.pose,p=d.longitude,M=d.latitude;o===p&&u===M||(this.emit("cameraDirectionUpdate",{longitude:p,latitude:M},!0),this.emit("cameraUpdate",this.camera.copyPose(),!0)),this.renderIntersect(),t.render(n,i)},i}(er),ur=function(e){function i(t){var n=i.parseArgs(t);return e.call(this,n)||this}return t.__extends(i,e),i.parseArgs=function(t){return e.parseArgs.call(this,t)},i.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i.prototype.updateWork=function(e,t,i,n){return this.ready=!1,this.work=e,this.currentPanoIndex=t.panoIndex,this.hideIntersectMesh(),this.moveToPano(t.panoIndex,{duration:0,longitude:t.longitude,latitude:t.latitude,fov:t.fov},n),!0},i.prototype.moveToPano=function(e,t,i){void 0===t&&(t={});var n=this.work.observers[e];n&&this.moveToPosition(n.position,t,i)},i.prototype.moveToPosition=function(e,t,i){var n,r,s,o,u,c,l=this;void 0===t&&(t={});var h=this,d=h.camera,p=h.model,M=h.currentPanoIndex,f=t.duration,g=t.limit,A=void 0===g||g,y=t.easing,v=void 0===y?Ei.Quadratic.InOut:y;this.ready=!1;var m=this.calculateMovingDuration(f,d.pose.offset.distanceTo(e)),N=qi(this.work.observers,(function(t){return t.position.distanceTo(e)})),D=this.work.observers.indexOf(N);this.emit("moveToPano",D,i);var w=d.pose.longitude,T=d.pose.latitude,x=d.pose.fov,E=d.pose.offset.clone(),j=(null===(n=p.getMaterial())||void 0===n?void 0:n.modelAlpha)||0,z=null!==(s=null===(r=this.model.getMaterial())||void 0===r?void 0:r.perspToOrtho)&&void 0!==s?s:0,I=null!==(o=t.longitude)&&void 0!==o?o:w,b=null!==(u=t.latitude)&&void 0!==u?u:T,L=null!==(c=t.fov)&&void 0!==c?c:x,S=e.clone(),O={longitude:I,latitude:b,fov:L,offset:S.clone()};t.moveStartCallback&&t.moveStartCallback(D,O),this.emit("panoWillArrive",D,O,i),this.tweenPosition&&(this.tweenPosition.destroy(),delete this.tweenPosition);var C=function(e){var t=e.progress;l.setModelAndBoundingUniforms({modelAlpha:Oi(j,1,t),perspToOrtho:Oi(z,0,Math.min(5*t,1))});var n=new a.Vector3(Oi(E.x,S.x,t),Oi(E.y,S.y,t),Oi(E.z,S.z,t));l.updateCamera({offset:n},i,A),t>.7&&(l.preventTapGesture=!1),l.emit("movingToPano",D,M,t),i&&l.lastMouseMoveEvent&&l.onMouseMove(l.lastMouseMoveEvent),l.needsRender=!0},P=function(){C({progress:1}),l.preventTapGesture=!1,l.emit("panoArrived",D,l.camera.copyPose(),i),l.needsRender=!0,l.ready=!0};if(this.preventTapGesture=!0,m>0?this.tweenPosition=zi(m,v).onUpdate(C).onComplete((function(){l.tweenPosition&&l.tweenPosition.destroy(),delete l.tweenPosition,t.moveEndCallback&&t.moveEndCallback(D,l.camera.copyPose()),P()})).onCancel((function(){t.moveCancelCallback&&t.moveCancelCallback()})):P(),this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),w!==I||T!==b||x!==L){var k=function(e){var t=e.progress,n=Ci(w,I,t),r=Oi(T,b,t),s=Oi(x,L,t);l.updateCamera({longitude:n,latitude:r,fov:s},i,A)},U=function(){return k({progress:1})};m>0?this.tweenCoordinates=zi(m,v).onUpdate(k).onComplete((function(){l.tweenCoordinates&&(l.tweenCoordinates.destroy(),delete l.tweenCoordinates),U()})):U()}},i.prototype.setModelAndBoundingUniforms=function(e){for(var t=0,i=[this.model];t<i.length;t++){i[t].setMaterial(e)}},i.prototype.onTapGesture=function(e){if(this.interiaMovement=!1,!0!==this.preventTapGesture){var t=this.camera,i=this.model,n=this.relativeClientPosition(e.center),r=new a.Raycaster;r.setFromCamera(n,t);var s=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","tap",s,!0)||this.emit("wantsTapGesture",r,n))){var o=f(r);if(o&&o.face){var u=o.face.normal,c=o.point;if(new a.Vector3(0,1,0).angleTo(u)>Math.PI/3){var l=t.pose.offset.clone().setY(c.y),h=c.clone().sub(l).setLength(.3),d=c.clone().sub(h);r.set(d,new a.Vector3(0,-1,0)),o=f(r)}}if(o){var p=o.point.clone(),M=qi(this.work.observers.filter((function(e){return Math.abs(e.standingPosition.y-p.y)<1})),(function(e){return e.standingPosition.distanceTo(p)}));M&&(p.y=M.position.y,this.emit("gesture","tap",s,!0),this.emit("tapGesture",r,n),this.moveToPosition(p,{},!0))}}}function f(e){return(!0===i.empty?e.intersectObjects(i.children):i.intersectRaycaster(e))[0]}},i}(An),cr=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}("{vs|z-rp@-}n{|]|vv|{H{vs|z-znA-}n{|ZnvH{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-]Vl?-J-C;?E@>EB?Hp|{-sy|n-pnyr-J->@;>Hrp?-|P||q5rp@-rp|6-\n--sy|n--J-yr{tu5rp|6H--sy|n-urn-J-np|5:rp|;\b-<-6H--sy|n-}uv-J-nn{5rp|;9-rp|;\t6H--r{-rp?5=;B-8-}uv-<-]Vl?9-urn-<-]V6H\f|vq-znv{56-\n--rpA-|yq]|vv|{-J-z|qryZnv-7-rpA5}|vv|{9->;=6H--}n{|d|yq]|vv|{-J-5rpA5|yq]|vv|{;\b\t9->;=6-7-}n{|Znv6;\b\tH--rp?-p||q-J-|P||q5}n{|d|yq]|vv|{6H--sy|n-qvn{pr-J-pnyrH--vs-5p||q;\b-I-=;>B6-\n----rp?-n{s|zrqP||q-J-rp?5p||q;9-=;=6H----rpA-}n{|Qv}ynprzr{-J-rr?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;H----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-\n----rp?-n{s|zrqP||q-J-rp?5p||q;9-5p||q;\b-:-=;>B6-<-=;D6H----rpA-}n{|Qv}ynprzr{-J-rr?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----vs5-}n{|Qv}ynprzr{;-JJ-=;=6\n------qvn{pr-J-pnyrH----\fryr\n------qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;H----\f--\f-ryr-\n----rp?-n{s|zrqP||q-J-rp?5p||q;9->;=6H----rpA-}n{|Qv}ynprzr{-J-rr?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;H----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\tr5|yq]|vv|{;\b\t6-7-qvn{pr9->;=6H--tyl]|vv|{-J-}|wrpv|{Znv-7-z|qrycvrZnv-7-ry]|vv|{H\f"),lr=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}("{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-\n--rpA-}n{|P|y|-J-rrPor5}n{|Zn}9-}n{|d|yq]|vv|{;\b\t6H--tylSntP|y|-J-rpA5}n{|P|y|;to9-|}npv\b6H\f"),hr=Object.assign({opacity:new a.Uniform(1),scale:new a.Uniform(13.1),panoMap:new a.Uniform(null),panoDisplacementMap:new a.Uniform(null),panoPosition:new a.Uniform(new a.Vector3),panoMatrix:new a.Uniform(new a.Matrix4)},{emissive:new a.Uniform(new a.Color(0)),emissiveMap:new a.Uniform(null),specular:new a.Uniform(new a.Color(1118481)),specularMap:new a.Uniform(null),normalMap:new a.Uniform(null),bumpMap:new a.Uniform(null),shininess:new a.Uniform(30)},a.UniformsLib.common,a.UniformsLib.lights),dr=new a.SphereBufferGeometry(.01,128,128);var pr=function(e){function i(t,i){void 0===i&&(i={});var n=e.call(this)||this;return n.renderer=t,n.prevRequest=null,n.cubeTextureLoader=new un(t,{allowHosts:n.allowHosts,networkSubscribe:n.networkSubscribe}),n.allowHosts=i.allowHosts,n.networkSubscribe=i.networkSubscribe,n}return t.__extends(i,e),i.prototype.setAllowHosts=function(e){this.allowHosts=e,this.cubeTextureLoader.setAllowHosts(e)},i.prototype.load=function(e,t){var i=this,n=He,r=He,s=He,o=He;"function"==typeof t?(n=t.bind(this,null),s=t.bind(this),o=t.bind(this)):(t.onLoad&&(n=t.onLoad),t.onProgress&&(r=t.onProgress),t.onError&&(s=t.onError),t.onAbort&&(o=t.onAbort));var u=null,c=[0,0],l=function(){u=null,i.prevRequest=null},h=function(t,n){c[n]=t;var s=.8*c[0]+.2*c[1];r(s),i.emit("progress",s,e)};this.cubeTextureLoader.load(e,{onLoad:function(t){h(0,1);var r=e.images.depth;u=on(r,(function(r){var s=Object.assign(function(e,t,i,n){var r=new a.ShaderMaterial({side:a.BackSide,vertexShader:cr,fragmentShader:lr,transparent:!0,uniforms:a.UniformsUtils.clone(hr)}),s=e;s.needsUpdate=!0,s.minFilter=a.LinearFilter,s.magFilter=a.LinearFilter;var o=t instanceof a.Texture?t:new a.Texture(t);return o.needsUpdate=!0,o.minFilter=a.LinearFilter,o.magFilter=a.LinearFilter,r.uniforms.opacity.value=0,r.uniforms.panoMap.value=s,r.uniforms.panoDisplacementMap.value=o,r.uniforms.panoPosition.value=i,r.uniforms.panoMatrix.value=n,Object.assign(new a.Mesh(dr,r),{frustumCulled:!1,dispose:function(){this.material instanceof a.ShaderMaterial&&(this.material.uniforms.panoDisplacementMap.value.dispose(),this.material.uniforms.panoDisplacementMap.value=null,this.material.dispose())}})}(t,r,e.position,e.matrix),{hash:t.hash,meta:t.meta});h(1,1),n(s),i.emit("load",s,e)}),(function(e){t.dispose(),s(e),l()}),(function(e){h(e,1)}),(function(){t.dispose(),o(new Error("source load abort: "+r)),l()}),i.allowHosts,i.networkSubscribe)},onError:function(e){s(e),l()},onAbort:function(e){o(e),l()},onProgress:function(e){h(e,0)}}),this.prevRequest={abort:function(){i.cubeTextureLoader.abort(),null==u||u.abort()}},this.emit("start",e)},i.prototype.abort=function(){this.prevRequest&&(this.prevRequest.abort(),this.prevRequest=null)},i}(xt),Mr=function(e){function i(t){var n=this,r=i.parseArgs(t);(n=e.call(this,r)||this).maxAccessibleDistance=r.maxAccessibleDistance,n.panoCircleMeshCreator=r.panoCircleMeshCreator,n.model.setMaterial({perspToOrtho:0});var s=n.getBounding();return n.boundingMesh=ft(s),n.boundingMesh.setMaterial(n.model.getMaterial()||{}),s.containsPoint(n.camera.pose.offset)||(n.boundingMesh.visible=!1),n.boundingMesh.renderOrder=2,n.boundingMesh.frustumCulled=!1,n.scene.add(n.boundingMesh),n.panoCircleMeshes=[],n.updatePanoCircleMeshes(),n.panoCircleMeshes.forEach((function(e){return e.visible=!1})),n.helper.remove(n.intersectMesh),n.depthTextureLoader=new pr(n.renderer,{allowHosts:n.work.allowHosts,networkSubscribe:n.networkSubscribe}),n.depthTextureLoader.on("start",(function(e){var t,i=e.index;null===(t=n.panoCircleMeshes[i])||void 0===t||t.setProgress(0),n.emit("textureStartLoad",i,n.work.observers[i])})),n.depthTextureLoader.on("progress",(function(e,t){var i,r=t.index;null===(i=n.panoCircleMeshes[r])||void 0===i||i.setProgress(e),n.emit("textureLoading",e,r,n.work.observers[r])})),n.depthTextureLoader.on("abort",(function(e){var t,i=e.index;null===(t=n.panoCircleMeshes[i])||void 0===t||t.setProgress(0),n.emit("textureAbort",i,n.work.observers[i])})),n.depthTextureLoader.on("load",(function(e,t){var i,r=t.index;null===(i=n.panoCircleMeshes[r])||void 0===i||i.setProgress(1),n.emit("textureLoaded",r,n.work.observers[r],e.meta)})),n.depthTextureLoader.on("error",(function(e,t){var i,r=t.index;null===(i=n.panoCircleMeshes[r])||void 0===i||i.setProgress(0),n.emit("textureError",e,r,n.work.observers[r])})),n.once("panoWillArrive",(function(){n.boundingMesh.visible=!0,n.needsRender=!0,n.model.visible=!1})),n}return t.__extends(i,e),i.parseArgs=function(i){var n,r,s=e.parseArgs.call(this,i);return t.__assign(t.__assign({},s),{maxAccessibleDistance:null!==(n=i.maxAccessibleDistance)&&void 0!==n?n:5,panoCircleMeshCreator:null!==(r=i.panoCircleMeshCreator)&&void 0!==r?r:bn})},i.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},i.prototype.getBounding=function(){for(var e=new a.Box3,t=0,i=this.work.observers;t<i.length;t++){var n=i[t].standingPosition.clone();e.expandByPoint(n),n.y+=3,e.expandByPoint(n)}return e.max.x+=4,e.min.x-=4,e.max.z+=4,e.min.z-=4,e},i.prototype.updatePanoCircleMeshes=function(){var e=this,t=[],i=this.model;this.panoCircleMeshes&&(this.panoCircleMeshes.forEach((function(i){i.loading&&t.push(i.panoIndex),e.helper.remove(i),i.dispose()})),this.panoCircleMeshes.length=0);var n=new a.Vector3(0,-1,0);this.panoCircleMeshes=this.work.observers.map((function(r,s){var o=e.panoCircleMeshCreator();if(o.position.copy(r.standingPosition),e.model.loaded){var u=o.position.clone().add(new a.Vector3(0,1,0)),c=new a.Raycaster(u,n,0,1),l=i.intersectRaycaster(c)[0];l&&(o.position.copy(l.point.clone()),o.needsRender=!0)}return o.name="panoCircle_"+s,o.panoIndex=s,e.helper.add(o),o.needsRender=!0,!1===r.active&&(o.setDisabled(!0),t.indexOf(s)>=0&&(o.setDisabled(!1),o.setLoading(!0))),o}));var r=this.work.observers[this.currentPanoIndex].visibleNodes;r=r.filter((function(t){var i=e.work.observers[t];return i.loadable||i.active})),this.panoCircleMeshes.forEach((function(e){e.visible=r.indexOf(e.panoIndex)>=0}));var s=this.camera.position;this.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(s);e.setOpacity(Math.min(1.5/t,1))}))},i.prototype.destroy=function(){var t=this;e.prototype.destroy.call(this),this.depthTextureLoader.off(),delete this.pendingLoadTextureHashAndCallback,this.model&&(this.model.visible=!0),this.panoModel&&(this.scene.remove(this.panoModel),this.panoModel.dispose(),delete this.panoModel),this.boundingMesh&&(this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.panoCircleMeshes&&(this.panoCircleMeshes.forEach((function(e){t.helper.remove(e),e.dispose()})),this.panoCircleMeshes.length=0)},i.prototype.moveToPano=function(e,t,i){var n=this;void 0===t&&(t={}),this.ready=!1,this.interiaMovement=!1;var r={index:e,images:this.work.observers[e].images,imageOptions:this.imageOptions},s=l.digest(r),o=function(r,s){if(r)return t.moveCancelCallback&&t.moveCancelCallback(),n.emit("panoLoadError",r,e),n.emit("moveToPanoCanceled",e),void(n.ready=!0);n.destroyed?null==s||s.dispose():(n.emit("panoLoaded",e),Xe((function(){return n.doMoveToPano(e,s,t,i)})))},u=this.pendingLoadTextureHashAndCallback||[],c=u[0],h=u[1];if(s!==c){if(delete this.pendingLoadTextureHashAndCallback,h&&h(new Error("texture aborted")),this.emit("moveToPano",e,i),this.emit("panoWillLoad",e),!r.images)return void o(new Error("pano images were not existed"));if(!r.images.depth)return void o(new Error("pano depth image were not existed"));var d=this.work.observers[e],p=d.position,M=d.quaternion,f=(new a.Matrix4).compose(p,M,new a.Vector3(-1,1,1)),g=Object.assign({position:p,matrix:f},r);this.pendingLoadTextureHashAndCallback=[s,o],this.depthTextureLoader.load(g,(function(e,t){var i=n.pendingLoadTextureHashAndCallback||[],r=i[0],o=i[1];s===r&&o?(o(e,t),delete n.pendingLoadTextureHashAndCallback):null==t||t.dispose()}))}},i.prototype.updateCamera=function(t,i,n){var r=this;e.prototype.updateCamera.call(this,t,i,n),this.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(r.camera.pose.offset);e.setOpacity(Math.min(1/t,1))}));var s=this.getForwardPanoIndexOrNot();null!==s&&this.panoCircleMeshes[s].setOpacity(1),Ht()},i.prototype.canNotMoveAnimation=function(){var e=this;if(this.interiaMovement=!1,!this.tweenCoordinates){var t=this.camera.fov,i=.98*t,n=function(t){var i=t.fov;return e.updateCamera({fov:i},!0,!0)};this.tweenCoordinates=ji({fov:t},{fov:i},200).onUpdate(n).onComplete((function(){var r;null===(r=e.tweenCoordinates)||void 0===r||r.destroy(),e.tweenCoordinates=ji({fov:i},{fov:t},200).onUpdate(n).onComplete((function(){var t;null===(t=e.tweenCoordinates)||void 0===t||t.destroy(),delete e.tweenCoordinates}))}))}},i.prototype.doMoveToPano=function(e,t,i,n){var r,s,o,u=this;void 0===i&&(i={});var c=i.limit,l=void 0===c||c,h=i.easing,d=void 0===h?Ei.Quadratic.InOut:h,p=this.currentPanoIndex,M=this.panoModel,f=this.currentPanoIndex,g=this.work.observers[e];if(M){var A={pano0Map:M.material.uniforms.panoMap.value,pano0Matrix:M.material.uniforms.panoMatrix.value};M.material.uniforms.opacity.value=1,this.boundingMesh.setMaterial(A)}t.renderOrder=-1;var y={progress:0,pano1Map:t.material.uniforms.panoMap.value,pano1Matrix:t.material.uniforms.panoMatrix.value};t.material.uniforms.opacity.value=0,this.boundingMesh.setMaterial(y),this.model.setMaterial(y),this.panoModel=t,this.scene.add(t);var v=g.visibleNodes.filter((function(e){var t=u.work.observers[e];return t.loadable||t.active})),m=this.camera.pose.offset.distanceTo(g.standingPosition),N=void 0===M?0:this.calculateMovingDuration(i.duration,m),D=this.camera.pose.longitude,w=this.camera.pose.latitude,T=this.camera.pose.offset.clone(),x=this.camera.fov,E=null!==(r=i.longitude)&&void 0!==r?r:D,j=null!==(s=i.latitude)&&void 0!==s?s:w,z=g.position,I=null!==(o=i.fov)&&void 0!==o?o:x,b={longitude:E,latitude:j,fov:I,offset:z.clone()};if(this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.tweenPosition&&(this.tweenPosition.destroy(),delete this.tweenPosition),i.moveStartCallback&&i.moveStartCallback(e,b),this.emit("panoWillArrive",e,b,n),this.needsRender=!0,D!=D||w!==j||x!==I){var L=function(e){var t=e.progress,i=Ci(D,E,t),r=Oi(w,j,t),s=Oi(x,I,t);u.updateCamera({longitude:i,latitude:r,fov:s},n,l),u.needsRender=!0},S=function(){return L({progress:1})};N>0?this.tweenCoordinates=zi(N,d).onUpdate(L).onComplete((function(){var e;null===(e=u.tweenCoordinates)||void 0===e||e.destroy(),delete u.tweenCoordinates,S()})):S()}var O=function(){u.panoCircleMeshes.forEach((function(e){e.visible=v.indexOf(e.panoIndex)>=0})),t.material.uniforms.opacity.value=0,t.material.depthTest=!0,M&&(u.scene.remove(M),M.material.uniforms.panoMap.value.dispose(),M.dispose()),u.updateCamera({offset:z},n,l);var r={progress:1,pano1Map:t.material.uniforms.panoMap.value,pano1Position:t.material.uniforms.panoPosition.value,pano1Matrix:t.material.uniforms.panoMatrix.value,pano0Map:t.material.uniforms.panoMap.value,pano0Position:t.material.uniforms.panoPosition.value,pano0Matrix:t.material.uniforms.panoMatrix.value,modelAlpha:0};u.boundingMesh.setMaterial(r),u.model.setMaterial(r),u.panoCircleMeshes[e]&&u.panoCircleMeshes[e].setProgress(0),i.moveEndCallback&&i.moveEndCallback(e,u.camera.copyPose()),u.currentPanoIndex=e,u.preventTapGesture=!1,Xe((function(){u.emit("panoArrived",e,u.camera.copyPose(),n),u.ready=!0})),u.needsRender=!0};this.preventTapGesture=!0,N>0&&f!==e?(this.panoCircleMeshes.forEach((function(e){return e.visible=!1})),t.material.depthTest=!1,M&&(M.material.depthTest=!1),this.tweenPosition=zi(N,d).onUpdate((function(i){var r=i.progress,s=new a.Vector3(Oi(T.x,z.x,r),Oi(T.y,z.y,r),Oi(T.z,z.z,r));u.updateCamera({offset:s},n,l);var o=(Math.min(Math.max(r,.1),.9)-.1)/.8,c={modelAlpha:Oi(1,0,o)};t.material.uniforms.opacity.value=Oi(0,1,o),M&&(M.material.uniforms.opacity.value=1),u.boundingMesh.setMaterial(c),u.model.setMaterial(c),u.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(s);e.setOpacity(Math.min(1.5/t,1))})),r>.7&&(u.preventTapGesture=!1),u.emit("movingToPano",e,p,r),u.needsRender=!0})).onComplete((function(){u.tweenPosition&&(u.tweenPosition.completed=!0,u.tweenPosition.destroy()),delete u.tweenPosition,O()})).onCancel((function(){i.moveCancelCallback&&i.moveCancelCallback(),u.emit("moveToPanoCanceled",e)}))):O()},i.prototype.getForwardPanoIndexOrNot=function(e){var t=this,i=this.camera,n=this.currentPanoIndex,r=this.work.observers[n].accessibleNodes;r=r.filter((function(e){var i=t.work.observers[e];return i.loadable||i.active}));var s,o=i.getWorldDirection(new a.Vector3);s=e?e.ray.direction.clone():o.clone();var u=i.pose.offset.clone();s.y=u.y=0;for(var c=0,l=r.filter((function(e){return t.work.observers[e].standingPosition.clone().sub(i.pose.offset).angleTo(o)<i.fov/2/180*Math.PI})).map((function(e){var i=t.work.observers[e].standingPosition.clone();return Object.assign(i,{y:0,panoIndex:e})})).sort((function(e,t){return e.distanceTo(u)-t.distanceTo(u)}));c<l.length;c++){var h=l[c],d=h.clone().sub(u);if(d.length()&&s.angleTo(d)<Math.PI/6)return h.panoIndex}return null},i.prototype.onTapGesture=function(e){var t=this;if(this.interiaMovement=!1,!0!==this.preventTapGesture){var i=this.camera,n=this.panoCircleMeshes,r=null,s=void 0,o=this.work.observers[this.currentPanoIndex].accessibleNodes;o=o.filter((function(e){return t.work.observers[e].position.distanceTo(i.pose.offset)<t.maxAccessibleDistance}));var u=this.relativeClientPosition(e.center),c=new a.Raycaster;c.setFromCamera(u,i);var l=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","tap",l,!0)||this.emit("wantsTapGesture",c,u))){var h=c.intersectObjects(this.boundingMesh.children)[0];if(h){var d=h.point.clone(),p=qi(n.filter((function(e){return o.indexOf(e.panoIndex)>=0})),(function(e){return e.position.distanceTo(d)}),!0),M=p[0];if(p[1]<1){var f=h.point.clone();r=M.panoIndex;var g=i.getWorldDirection(new a.Vector3).setY(0),A=(new a.Vector3).copy(f).setY(0).sub(i.pose.offset.clone().setY(0));if(g.angleTo(A)>Math.PI/6){var y=A.x,v=A.z;s={longitude:Math.atan2(-y,-v)}}}}if(Ve(r)&&!Ve(r=this.getForwardPanoIndexOrNot(c))&&h){var m=h.point,N=this.work.observers[r].position.clone();g=m.clone().setY(0).sub(i.getWorldDirection(new a.Vector3).setY(0)),A=m.clone().setY(0).sub(N.clone().setY(0));if(Math.abs(m.y-N.y)<.5&&g.angleTo(A)>Math.PI/6&&g.angleTo(A)<Math.PI/3){y=A.x,v=A.z;s={longitude:Math.atan2(-y,-v)}}}if(Ve(r))this.canNotMoveAnimation();else{var D=this.work.observers[r];this.emit("panoSelected",r),this.emit("gesture","tap",l,!0),this.emit("tapGesture",c,u),D.active?this.emit("wantsMoveToPano",r,s||{},!0):this.panoCircleMeshes[r]&&(this.panoCircleMeshes[r].setDisabled(!1),this.panoCircleMeshes[r].setLoading(!0))}}}},i}(An),fr=["Panorama","DepthPanorama","Model"],gr={Floorplan:en,Topview:tn,Panorama:er,VRPanorama:ar,Model:ur,DepthPanorama:Mr};function Ar(e){for(var t=0,i=fr;t<i.length;t++){var n=i[t];if("string"==typeof e){if(n===e)return!0}else if(e instanceof $i&&e instanceof gr[n])return!0}return!1}var yr=["cameraDirectionUpdate","cameraUpdate","cameraPositionUpdate","panoSelected","moveToPano","moveToPanoCanceled","panoWillArrive","movingToPano","panoArrived","panoWillLoad","panoLoaded","panoLoadError","initAnimationEnded","initAnimationWillStart","wantsGesture","gesture","wantsTapGesture","tapGesture","wantsPanGesture","wantsInteriaPan","panGesture","interiaPan","wantsPinchGesture","pinchGesture","wantsMouseWheel","mouseWheel","wantsShowIntersectionOnModel","intersectionOnModelUpdate","intersectionHidden","textureStartLoad","textureLoading","textureAbort","textureLoaded","textureError"];function vr(e){for(var t,i,n={},r=0,s=e.split(/(\;|\,)/);r<s.length;r++){var o=s[r].split("="),a=null===(t=o[0])||void 0===t?void 0:t.trim(),u=null===(i=o[1])||void 0===i?void 0:i.trim();a&&u&&(n[a]=u)}return n}function mr(){for(var e,t=document.getElementsByTagName("meta"),i=0;i<t.length;i++){var n=t[i];if("viewport"===n.getAttribute("name")){var r=vr(null!==(e=n.getAttribute("content"))&&void 0!==e?e:""),s=Number(r["initial-scale"]);if(!isNaN(s))return s}}return 1}var Nr=[351,63],Dr=[20,20],wr=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Tr=new Float32Array([0,0,1,0,0,1,1,1]),xr=new Uint8Array([0,1,2,1,3,2]),Er=new a.BufferGeometry;Er.setAttribute("position",new a.BufferAttribute(wr,3)),Er.setAttribute("uv",new a.BufferAttribute(Tr,2)),Er.setIndex(new a.BufferAttribute(xr,1));var jr=new a.MeshBasicMaterial({transparent:!0}),zr=new a.Mesh(Er,jr),Ir=new a.Scene;Ir.add(zr);var br=new a.OrthographicCamera(-.5,.5,.5,-.5,.1,1);br.position.set(0,0,.5),br.lookAt(0,0,0);var Lr=new a.Vector4,Sr=new a.Vector4;function Or(e){if(jr.map){var t=e.getViewport(Lr),i=e.getScissor(Sr),n=e.getScissorTest(),r=e.autoClear;e.setViewport(i.x+Dr[0]/3,i.y+Dr[1]/3,Nr[0]/3,Nr[1]/3),e.setScissor(i.x+Dr[0]/3,i.y+Dr[1]/3,Nr[0]/3,Nr[1]/3),e.setScissorTest(!0),e.autoClear=!1,e.render(Ir,br),e.setViewport(t),e.setScissor(i),e.setScissorTest(n),e.autoClear=r}else{var s=new a.Texture,o=new Image;o.onload=function(){s.image=o,s.wrapS=a.ClampToEdgeWrapping,s.wrapT=a.ClampToEdgeWrapping,s.minFilter=a.LinearFilter,s.needsUpdate=!0,jr.needsUpdate=!0,o.onload=function(){}},o.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR/1XPxwJhp5DAV67T9ZPwFdovhBMIGUYoRBN4wim6S3eoXVEHXdLgmwY0x6BQnO4xPJ0Ar5OVxhQF0L9UslRM4yaQQfQImnBegi8vhY2A1k6YLlrj61TwDdNQnIISwiPvpD7TwYQTssZXK47vg8y9Gp2nxRcATkozOEmdCeObSt3IIo+xf/00IDRK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VJtOwgdgO/dOICHGK6jQHaIwdXN4Lwt0LWHr4d6kX8tV+ozqAs+uYCSmO2w+jd4zGNeUYL4nqZxeN5WKVgooSAClmEaYhqhdit89QC7niSbCEM2sdkBuHYxQg9ri5ZjkuhI6DMP+J7cTvEtokEx0aPscyddoFJKpSZqV7G1GTxcpmEthpnw5058c6GfwqpwzGOtGjXSJI3FLYhc+O+jSr9aGhPWQlRshS8AticLX7wnsgbXxt6gsWCpRBa0vRGQM8oB9dhmP3QAwFX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==",jr.map=s}}var Cr=new a.Box3(new a.Vector3(-50,-50,-50),new a.Vector3(50,50,50)),Pr=new a.Vector2,kr=new a.Frustum,Ur=new a.Matrix4,Br=new a.Clock,_r=new WeakMap,Rr=function(e){function i(t){var i,n,r,s,o,u,c,l,h,d,p,M,f,g,A;void 0===t&&(t={});var y=e.call(this)||this;if(y.ident=qe(),y.panoIndex=0,y.needsRender=!1,y.onlyRenderIfNeeds=null===(i=t.onlyRenderIfNeeds)||void 0===i||i,y.maxFps=null!==(n=t.maxFps)&&void 0!==n&&n,y.imageOptions=t.imageOptions||{},y.textureOptions=t.textureOptions||y.imageOptions||{},y.poweredByRealsee=null===(r=t.poweredByRealsee)||void 0===r||r,y.extraElements=[],y.controllerInits={Panorama:null!==(s=t.panorama)&&void 0!==s?s:{},Model:null!==(o=t.model)&&void 0!==o?o:{},Floorplan:null!==(u=t.floorplan)&&void 0!==u?u:{},Topview:null!==(c=t.topview)&&void 0!==c?c:{},DepthPanorama:null!==(l=t.depthPanorama)&&void 0!==l?l:{},VRPanorama:null!==(h=t.vrPanorama)&&void 0!==h?h:{}},y.modeChangeDuration=null!==(d=t.modeChangeDuration)&&void 0!==d?d:1e3,y.panoramaLikeSavedPose={},"undefined"!=typeof window)if(t.renderer)t.renderer instanceof Fe&&y.throwError(new Error("cannot render a internal renderer")),y.renderer=t.renderer;else try{y.renderer=new Fe({preserveDrawingBuffer:t.preserveDrawingBuffer,backgroundColor:t.backgroundColor,backgroundAlpha:t.backgroundAlpha,antialias:t.antialias});var v=mr();y.renderer.setPixelRatio(1===v?window.devicePixelRatio:1),y.renderer.setSize(512,512)}catch(e){e instanceof Error&&y.throwError(e)}y.getPixelsRenderTarget=new a.WebGLRenderTarget(1,1,{encoding:null!==(M=null===(p=y.renderer)||void 0===p?void 0:p.outputEncoding)&&void 0!==M?M:a.sRGBEncoding}),y.scissor=Object.assign({left:0,bottom:0,width:1,height:1},t.scissor),y.camera=new Qe(80),y.scene=new Ye,y.lastLoadWorkTask=Promise.resolve(),y.networkSubscribe=new Pt,y.networkSubscribe.on("network",(function(e,t,i){var n;y.emit("network",e,t,i),null===(n=y.analysis)||void 0===n||n.network(y.work,e,t,i)})),y.model=new wi({allowHosts:[],networkSubscribe:y.networkSubscribe});var m=ft(Cr);if(y.model.add(m),y.model.visible=!1,y.model.name="model_empty",y.model.empty=!0,y.model.loaded=!1,y.readyCallbacks=[],y.modelPending=!1,y.scene.add(y.model),y.helperGroup=new a.Group,y.helperGroup.name="helper",y.scene.add(y.helperGroup),y.videoTexture=new a.VideoTexture(t.videoInstance||function(){var e=document.createElement("video");e.loop=!0,e.autoplay=!0,e.playsInline=!0,e.muted=!0,e.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),e.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),e}()),y.plugins={},t.plugins)for(var N=0,D=t.plugins;N<D.length;N++){var w=D[N];if("function"==typeof w)w(y);else if(Array.isArray(w)){var T=w[0],x=w[1],E=w[2],j=T(y,E);"string"==typeof x&&(y.plugins[x]&&y.throwError(new Error("plugin name "+x+" is exists.")),y.plugins[x]=j)}}return function(e){(t=new a.DirectionalLight(16777215,.5)).position.copy(new a.Vector3(1,1,1)),e.add(t);var t=new a.DirectionalLight(16777215,.3);e.add(t),t=new a.AmbientLight(16777215,.3),e.add(t)}(y.scene),y.state={mode:null!==(f=y.currentMode)&&void 0!==f?f:"Panorama",panoIndex:null!==(g=y.panoIndex)&&void 0!==g?g:0,longitude:y.camera.pose.longitude,latitude:y.camera.pose.latitude,fov:y.camera.pose.fov,offset:y.camera.pose.offset.clone()},y.stateSynced=!1,y.destroyed=!1,y.paused=!0,"undefined"!=typeof window&&(!1!==t.play&&y.play(),!1!==(null!==(A=t.initialBasisLoader)&&void 0!==A&&A)&&("string"==typeof t.initialBasisLoader?y.initBasisLoader(t.initialBasisLoader):y.initBasisLoader()),Je((function(){return y.syncState()}))),y}return t.__extends(i,e),i.prototype.dispose=function(){if(!0!==this.destroyed){this.emit("dispose"),this.destroyed=!0,this.pause(),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var e=this.getElement();e&&e.parentNode&&e.parentNode.removeChild(e),this.scene.remove(this.model);var t=this.model.getMaterial();t&&(t.pano0Map&&t.pano0Map.dispose(),t.pano1Map&&t.pano1Map!==t.pano0Map&&t.pano1Map.dispose()),this.renderer instanceof Fe&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},i.prototype.setScissor=function(e){Object.assign(this.scissor,e),this.controller&&this.controller.resize&&this.controller.resize()},Object.defineProperty(i.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpersVisibleChange",e),this.needsRender=!0)},enumerable:!1,configurable:!0}),i.prototype.appendTo=function(e,t){if(void 0===t&&(t={}),this.renderer)if(this.renderer instanceof Fe){var i=this.getElement();if(i){e.appendChild(i),this.refresh(t);var n=window.getComputedStyle(e).position;"relative"!==n&&"absolute"!==n&&"fixed"!==n&&"sticky"!==n&&(e.style.position="relative")}}else this.throwError(new Error("cannot call appendTo method when render a external renderer"))},i.prototype.refresh=function(e,t){if(void 0===e&&(e={}),this.renderer){var i=this.getElement();if(i){var n=i.parentNode;if(n&&n.nodeName){var r=e.width,s=void 0===r?n.offsetWidth:r,o=e.height,u=void 0===o?n.offsetHeight:o;this.renderer instanceof Fe&&(t&&this.renderer.setPixelRatio(t),this.renderer.setSize(s,u))}var c=this.renderer.getSize(new a.Vector2);this.camera.aspect=c.x/c.y,this.scissor&&(this.camera.aspect*=this.scissor.width/this.scissor.height),this.camera.updateProjectionMatrix(),this.controller&&this.controller.resize&&this.controller.resize(),this.needsRender=!0}}},i.prototype.addExtraElement=function(e){var t=this;return-1===this.extraElements.indexOf(e)&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return t.removeExtraElement(e)}},i.prototype.removeExtraElement=function(e){var t=this.extraElements.indexOf(e);-1!==t&&(this.extraElements.splice(t,1),this.controller&&this.controller.unbindExtraElement(e))},i.prototype.getPose=function(){return this.camera.copyPose()},i.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},i.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},i.prototype.updateCamera=function(e,t,i){var n=this;return void 0===i&&(i=!0),new Promise((function(r,s){if(n.controller){var o=n.getPose(),u=o.longitude,c=o.latitude,l=o.fov,h=o.offset,d=e.longitude,p=void 0===d?u:d,M=e.latitude,f=void 0===M?c:M,g=e.fov,A=void 0===g?l:g,y=e.offset,v=void 0===y?h.clone():y;!1===i&&(n.state.longitude=p,n.state.latitude=f,n.state.fov=A,n.state.offset=v);n.controller.tweenCoordinates&&(n.controller.tweenCoordinates.destroy(),delete n.controller.tweenCoordinates),n.tweenCoordinates&&(n.tweenCoordinates.destroy(),delete n.tweenCoordinates);var m=n.tweenCoordinates=zi(t,Ei.Linear.None).onUpdate((function(e){var t,r=e.progress,s=Ci(u,p,r),o=Oi(c,f,r),d=Oi(l,A,r),M=new a.Vector3(Oi(h.x,v.x,r),Oi(h.y,v.y,r),Oi(h.z,v.z,r));null===(t=n.controller)||void 0===t||t.updateCamera({longitude:s,latitude:o,fov:d,offset:M},i,!0)})).onCancel((function(){for(var e=0,t=D;e<t.length;e++){(0,t[e])()}delete n.tweenCoordinates,s(new Error("updateCamera animation canceled"))})).onComplete((function(){for(var e=0,t=D;e<t.length;e++){(0,t[e])()}m.destroy(),delete n.tweenCoordinates,r()})),N=function(){return m.destroy()},D=[n.on("gesture",N),n.on("load",N)]}else{var w=new Error("controller never initialized");s(w)}}))},i.prototype.getLongitudeAndLatitude=function(){var e=this.getPose();return{longitude:e.longitude,latitude:e.latitude}},i.prototype.getOffset=function(){return this.getPose().offset},i.prototype.getCameraLocal=function(){if("number"==typeof this.panoIndex&&this.controller&&this.work){var e=this.work.observers[this.panoIndex],t=new a.Object3D;return t.position.copy(e.position),t.quaternion.copy(e.quaternion),t.scale.set(1,1,1),t.updateMatrixWorld(!0),function(e,t){var i=new a.Vector3(0,0,-1);i.applyQuaternion(e.quaternion);var n=t.quaternion.clone().inverse();return i.applyQuaternion(n),{theta:Math.atan2(i.x,-i.z),phi:-Math.asin(i.y),lookAtVector:i}}(this.camera,t)}},i.prototype.initBasisLoader=function(e){try{if(!this.renderer)throw new Error("renderer is not initialized.");if("undefined"==typeof Promise||"undefined"==typeof WeakMap||"undefined"==typeof WebAssembly)throw new Error("Basis loader not support.");"string"==typeof e&&$t.setTranscoderPath(e),$t.workerConfig.format||$t.detectSupport(this.renderer),$t._allocateWorker(0)}catch(e){e instanceof Error&&this.throwError(e)}},Object.defineProperty(i.prototype,"work",{get:function(){var e=_r.get(this);if(e&&Fi.get(e))return e},enumerable:!1,configurable:!0}),i.prototype.load=function(e,t,i,n){var r=this;if(void 0===n&&(n=!0),!this.renderer)throw new Error("renderer is not initialized");var s=this.lastLoadWorkTask.then((function(){return!(s=e)||"object"!=typeof s&&"function"!=typeof s||"function"!=typeof s.then?r.load_(e,t,i,n):e.then((function(e){return r.load_(e,t,i,n)}));var s}));return this.lastLoadWorkTask=s.catch((function(e){r.throwError(e)})),s},i.prototype.load_=function(e,n,r,s){var o,a,u,c,l,h,d,p,M,f=this;void 0===s&&(s=!0);var g,A,y,v=Hi(e),m=this.work;void 0===n&&(n=m?"inherit":"initial"),"inherit"===n?(g="number"==typeof this.panoIndex&&v.observers[this.panoIndex]?this.panoIndex:v.initial.panoIndex,A=null!==(o=this.currentMode)&&void 0!==o?o:v.initial.mode,y={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):"initial"===n?(A=null!==(a=this.currentMode)&&void 0!==a?a:v.initial.mode,g=v.initial.panoIndex,y=A===i.Mode.Panorama||A===i.Mode.DepthPanorama||A===i.Mode.Model||A===i.Mode.VRPanorama?{longitude:v.initial.longitude,latitude:v.initial.latitude,fov:v.initial.fov}:{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):(g=null!==(u=n.panoIndex)&&void 0!==u?u:v.initial.panoIndex,A=null!==(l=null!==(c=n.mode)&&void 0!==c?c:this.currentMode)&&void 0!==l?l:"Panorama",y={longitude:null!==(h=n.longitude)&&void 0!==h?h:v.initial.longitude,latitude:null!==(d=n.latitude)&&void 0!==d?d:v.initial.latitude,fov:null!==(p=n.fov)&&void 0!==p?p:v.initial.fov}),this.emit("willLoad",e,v,{panoIndex:g,mode:A,longitude:y.longitude,latitude:y.latitude,fov:y.fov});var N=function(){var i;_r.set(f,v),f.panoIndex=g,f.panoramaLikeSavedPose.longitude=v.initial.longitude,f.panoramaLikeSavedPose.latitude=v.initial.latitude,f.panoramaLikeSavedPose.fov=v.initial.fov;var n=null!=r?r:void 0===m?0:f.modeChangeDuration,o={panoIndex:g,longitude:y.longitude,latitude:y.latitude,fov:y.fov},a=t.__assign(t.__assign({panoIndex:g,initial:[{longitude:y.longitude,latitude:y.latitude,fov:y.fov},n,s]},f.commonParams()),f.controllerInits[A]);f.controller?!1===f.controller.updateWork(v,o,n,!0)&&(f.controller.destroy(),f.controller=f.applyController(A,a)):f.controller=f.applyController(A,a),f.emit("load",e,v,{panoIndex:g,mode:A,longitude:y.longitude,latitude:y.latitude,fov:y.fov}),null===(i=f.analysis)||void 0===i||i.work(v)},D=function(e){var t,i;void 0===e&&(e=He),v.model&&((null===(t=null==m?void 0:m.model)||void 0===t?void 0:t.file)!==(null===(i=v.model)||void 0===i?void 0:i.file)?(f.emit("modelWillLoad",v.model),f.loadModel(v.model,v.allowHosts,e,!0)):e&&(!0===f.model.loaded?e():f.once("modelLoaded",(function(){return e()}))))};return A===i.Mode.Floorplan||A===i.Mode.Topview||A===i.Mode.Model?D((function(){N(),f.needsRender=!0})):(N(),null===(M=this.controller)||void 0===M||M.once("panoLoaded",(function(){f.needsRender=!0,D()}))),this.ready()},i.prototype.changeMode=function(e,n,r,s){var o=this;if(void 0===n&&(n={}),void 0===r&&(r=this.modeChangeDuration),void 0===s&&(s=!0),!this.renderer)throw new Error("renderer is not initialized.");return new Promise((function(a,u){var c;if(!i.Mode.hasOwnProperty(e)){var l=new Error('mode "'+e+'" is not existed');return o.throwError(l),void u(l)}if(e!==i.Mode.Floorplan&&e!==i.Mode.Topview&&e!==i.Mode.Model||!Ve(o.model)&&!0===o.model.loaded){if(Ve(o.controller))return o.currentMode=e,o.panoIndex=null!==(c=n.panoIndex)&&void 0!==c?c:o.panoIndex,o.updateCamera(n,r);var h=o.controller,d=o.currentMode,p=function(){var c,l,p,M;if(o.emit("wantsChangeMode",e,d))u(new Error("change mode canceled."));else{if(o.controller&&d===e)e===i.Mode.Panorama||e===i.Mode.DepthPanorama||e===i.Mode.Model||e===i.Mode.VRPanorama?"number"==typeof n.panoIndex&&n.panoIndex!==o.panoIndex?o.controller.moveToPano(null!==(l=null!==(c=n.panoIndex)&&void 0!==c?c:o.panoIndex)&&void 0!==l?l:0,t.__assign({duration:r},n),s):o.updateCamera(n,r,s).catch((function(){})):("number"==typeof n.panoIndex&&n.panoIndex!==o.panoIndex&&(o.panoIndex=o.controller.currentPanoIndex=n.panoIndex),o.updateCamera(n,r,s).catch((function(){})));else{h.destroy();var f=t.__assign(t.__assign({panoIndex:null!==(M=null!==(p=n.panoIndex)&&void 0!==p?p:o.panoIndex)&&void 0!==M?M:0,initial:[Ar(e)?o.panoramaLikeSavedPose:n,r,s]},o.commonParams()),o.controllerInits[e]);o.saveControllerPose(h),o.controller=o.applyController(e,f),o.controller.once("initAnimationWillStart",(function(t,i){o.emit("modeChange",e,d,t,i)})),o.emit("currentStateChange",o.getCurrentState(),s)}a()}};e===i.Mode.VRPanorama?("undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((function(e){if("granted"==e)return Promise.resolve();var t=new Error("Request DeviceOrientation Permission denied.");return Promise.reject(t)})):Promise.resolve()).then((function(){return p()})).catch((function(e){e instanceof Error&&(o.throwError(e),u(e))})):p()}else{l=new Error("model is not ready.");o.throwError(l)}}))},i.prototype.getPixels=function(e,t,i,n,r){if(void 0===r&&(r=1),!this.renderer)throw new Error("renderer is not initialized.");var s=this.getPixelsRenderTarget,o=this.renderer.getSize(new a.Vector2);e=Math.min(Math.max(e,Math.floor(i/2)),Math.floor(o.x-i)),t=Math.min(Math.max(t,Math.floor(n/2)),Math.floor(o.y-n)),e*=r,t*=r,i*=r,n*=r,s.setSize(o.x*r,o.y*r),s.scissor.set(e,t,i,n),s.scissorTest=!0,this.renderer.setRenderTarget(s);var u=new Uint8Array(i*n*4);return this.controller?this.controller.render(Br.getDelta()):this.renderer.render(this.scene,this.camera),this.renderer.readRenderTargetPixels(s,e,t,i,n,u),this.renderer.setRenderTarget(null),s.setSize(1,1),s.scissor.set(0,0,0,0),s.scissorTest=!1,u},i.prototype.getElement=function(){var e;return null===(e=this.renderer)||void 0===e?void 0:e.domElement},i.prototype.pause=function(){},i.prototype.render=function(e,t){var i=this;if(void 0===t&&(t=!1),this.renderer){if(t){var n=this.renderer.getSize(new a.Vector2);this.scene.traverseVisible((function(e){e.setResolution&&e.setResolution(n.x,n.y)}))}if(this.screenBuffer&&null===this.renderer.getRenderTarget()){var r=this.getDrawingBufferSize(Pr);this.screenBuffer.setSize(r.x,r.y),this.renderer.setRenderTarget(this.screenBuffer),this.controller?this.controller.render(Br.getDelta()):this.renderer.render(this.scene,this.camera),this.poweredByRealsee&&Or(this.renderer),this.renderer.setRenderTarget(null);var s=Ti(this.renderer.getContext());s&&this.throwError(s),e&&Xe(e)}else this.aroundScissor((function(){if(i.renderer){i.controller?i.controller.render(Br.getDelta()):i.renderer.render(i.scene,i.camera),i.poweredByRealsee&&Or(i.renderer);var t=Ti(i.renderer.getContext());t&&i.throwError(t)}e&&Xe(e)}))}},i.prototype.play=function(){var e=this;if(this.pause(),this.needsRender=!0,this.renderer){var t=Ke(),n=Ke(),r=0;this.paused=!1;var s=Je((function(){var s,o;if(!0!==e.paused&&!e.destroyed&&e.renderer){var u=Ke();if(e.maxFps){if(u-t+1<=1e3/e.maxFps)return;t=u}var c=e.renderer.getSize(new a.Vector2),l=[];Ur.multiplyMatrices(e.camera.projectionMatrix,e.camera.matrixWorldInverse),kr.setFromProjectionMatrix(Ur),e.scene.traverse((function(e){e.setResolution&&e.setResolution(c.x,c.y),e.mixer instanceof a.AnimationMixer&&e.mixer.update(Br.getDelta()),(e instanceof a.Mesh||e instanceof a.Line||e instanceof a.Points)&&(e instanceof a.ImmediateRenderObject||!e.frustumCulled||kr.intersectsObject(e))&&l.push(e)}));var h=!1;if(e.currentMode!==i.Mode.VRPanorama&&e.onlyRenderIfNeeds){for(var d=0,p=l;d<p.length;d++){var M=p[d],f=function(t){!0===t.needsRender?(t.needsRender=!1,e.needsRender=!0):t.mixer&&t.mixer.stats.actions.inUse>0&&(e.needsRender=!0)};f(M),M.traverseAncestors(f)}e.controller&&!0===e.controller.needsRender&&(e.controller.needsRender=!1,e.needsRender=!0),!1!==e.needsRender&&(e.render(),h=!0)}else e.render(),h=!0;if(e.needsRender=!1,e.screenBuffer&&null===e.renderer.getRenderTarget()&&(null===(s=e.controller)||void 0===s?void 0:s.postProcessing)){var g=null===(o=e.controller)||void 0===o?void 0:o.postProcessing;e.aroundScissor((function(){return g(e.screenBuffer,Br.getDelta())}))}e.hasListener("renderFrame")&&e.emit("renderFrame",h),e.hasListener("fps")&&(n&&u-n<1e3?r++:(n&&e.emit("fps",r),n=u,r=0))}}));this.pause=function(){e.paused=!0,s(),e.renderer&&e.renderer instanceof Fe&&e.renderer.clear(!0,!0,!0)}}},i.prototype.moveToPano=function(e,t,n){var r;if(void 0===t&&(t={}),void 0===n&&(n=!0),!this.renderer)throw new Error("renderer is not initialized.");var s=this.moveToPanoQueue=this.moveToPanoQueue||[],o=this.controller,a=this.currentMode;if(o)if(a===i.Mode.Floorplan||a===i.Mode.Topview)s.length=0,delete s.dequeue,Ve(e)||(this.panoIndex=e,this.changeMode(i.Mode.Panorama,t));else{if((null===(r=this.controller)||void 0===r?void 0:r.tweenPosition)||(s.length=0,delete s.dequeue),s.push([e,t,n]),s.length>2&&(s.length=2),s.dequeue)return;var u=function(){if(0!==s.length){var e=s.shift(),t=e[0],i=e[1],n=void 0===i?{}:i,r=e[2],a=Object.assign({},n);a.moveEndCallback=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return n.moveEndCallback&&(e=n.moveEndCallback.apply(this,t)),setTimeout(u),e},a.moveCancelCallback=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return n.moveCancelCallback&&(e=n.moveCancelCallback.apply(this,t)),setTimeout(u),e},o&&"moveToPano"in o&&Xe((function(){return o.moveToPano(t,a,r)}))}else delete s.dequeue};s.dequeue=!0,u()}},i.prototype.preloadPano=function(e,i){var n=this;if(void 0===i&&(i=He),!this.work)return Promise.reject(new Error("work never loaded"));var r=this.work.observers[e],s=Ke();return Promise.all(["right","left","up","down","front","back"].map((function(i){var s=t.__assign({key:["cube",e,i].join("."),basisLoaderInitialized:$t.isInitialized()},n.imageOptions);return function(e,t){return void 0===t&&(t={}),e in Ut?Ut[e]:Ut[e]=new Promise((function(i){var n=document.createElement("link");n.href=e,n.rel="preload",n.as="fetch";var r=Ke(),s=document.head||document.getElementsByTagName("head")[0];s&&s.appendChild(n),n.onload=function(){var n;i();var s=Ke(),o={source:e,requestTime:r,responseTime:s,costs:s-r,headers:{}};null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"preload",JSON.stringify(o))}}))}(Bt(r.images[i],s),{networkSubscribe:n.networkSubscribe})}))).then((function(){var e=Ke()-s;return i(e),e}))},i.prototype.project2d=function(e,t){if(void 0===t&&(t=!1),!this.renderer)return null;if(!1===this.model.empty&&t){var i=this.camera.position,n=e.clone().sub(i),r=new a.Raycaster(i,n.clone().normalize()),s=this.model.intersectRaycaster(r)[0];if(s&&s.distance+.01<n.length())return null}var o=e.clone().project(this.camera);if(Math.abs(o.z)>1)return null;var u=this.renderer.getSize(new a.Vector2),c=u.x*this.scissor.width,l=u.y*this.scissor.height,h=u.x*this.scissor.left+(o.x+1)/2*c,d=u.y*(1-this.scissor.bottom-this.scissor.height)+(1-o.y)/2*l;return new a.Vector2(h,d)},i.prototype.getRenderObjects=function(e){Ur.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),kr.setFromProjectionMatrix(Ur),e||(e=this.scene);var t=[];return e.traverseVisible((function(e){(e instanceof a.Mesh||e instanceof a.Line||e instanceof a.Points)&&(e instanceof a.ImmediateRenderObject||!e.frustumCulled||kr.intersectsObject(e))&&t.push(e)})),t},i.prototype.getCurrentState=function(){return t.__assign(t.__assign({},this.camera.copyPose()),{mode:this.currentMode||i.Mode.Panorama,panoIndex:this.panoIndex||0})},i.prototype.setState=function(e,n,r){var s,o,u,c,l,h,d;void 0===n&&(n=!1),void 0===r&&(r=!0),!(e=Object.assign({},e)).offset||e instanceof a.Vector3||(e.offset=new a.Vector3(e.offset.x,e.offset.y,e.offset.z));var p,M,f,g,A=null!==(s=e.panoIndex)&&void 0!==s?s:this.state.panoIndex,y=null!==(o=e.mode)&&void 0!==o?o:this.state.mode;if(e.mode!==i.Mode.Floorplan&&e.mode!==i.Mode.Topview&&e.mode!==i.Mode.Model||!Ve(this.model)&&!0===this.model.loaded){if(this.state.mode!==y){var v=void 0;v=Ar(this.state.mode)&&Ar(y)?this.state:Ar(y)?this.panoramaLikeSavedPose:e;var m=t.__assign(t.__assign({panoIndex:A,initial:[v,this.modeChangeDuration,!1]},this.commonParams()),this.controllerInits[y]),N=gr[y].initAnimationEndPose(m);p=N.longitude,M=N.latitude,f=N.fov,g=N.offset}else p=null!==(u=e.longitude)&&void 0!==u?u:this.state.longitude,M=null!==(c=e.latitude)&&void 0!==c?c:this.state.latitude,f=null!==(l=e.fov)&&void 0!==l?l:this.state.fov,g=null!==(h=e.offset)&&void 0!==h?h:this.state.offset;this.emit("setState",{longitude:p,latitude:M,fov:f,offset:g,mode:y,panoIndex:A}),(A!==this.state.panoIndex||y!==this.state.mode||Math.abs(p-this.state.longitude)>.001||Math.abs(M-this.state.latitude)>.001||Math.abs(f-this.state.fov)>.001||g.distanceTo(this.state.offset)>.001)&&(this.state.panoIndex=A,this.state.mode=y,this.state.longitude=p,this.state.latitude=M,this.state.fov=f,this.state.offset.copy(g),n&&this.syncState(n),this.emit("stateChange",this.state,r),null===(d=this.analysis)||void 0===d||d.state(this.work,this.state))}else this.throwError(new Error("model is not ready."))},i.prototype.aroundScissor=function(e){if(this.renderer){var t=new a.Vector2,i=0!==this.scissor.left||0!==this.scissor.bottom||1!==this.scissor.width||0!==this.scissor.height;if(i){this.renderer.getSize(t);var n=Math.floor(t.x*this.scissor.left),r=Math.floor(t.y*this.scissor.bottom),s=Math.floor(t.x*this.scissor.width),o=Math.floor(t.y*this.scissor.height);this.renderer.setViewport(n,r,s,o),this.renderer.setScissor(n,r,s,o),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,t.x,t.y),this.renderer.setScissor(0,0,t.x,t.y),this.renderer.setScissorTest(!1))}},i.prototype.syncState=function(e){if(void 0===e&&(e=!1),this.controller&&!1!==this.controller.ready&&!0!==this.controller.gesturing&&!this.tweenCoordinates){if(this.readyCallbacks.length){var t=this.currentMode;if(!(t===i.Mode.Floorplan||t===i.Mode.Topview||t===i.Mode.Model)||!this.modelPending)for(var n=void 0;n=this.readyCallbacks.shift();)n()}var r=this.stateSynced;if(this.stateSynced=!1,this.state.mode===this.currentMode){if(this.controller instanceof gr.Model){if(!this.camera.pose.offset.equals(this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return void this.controller.moveToPosition(this.state.offset,s,!1)}}else if(this.state.panoIndex!==this.panoIndex){s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return void this.controller.moveToPano(this.state.panoIndex,s,!1)}if(this.controller instanceof gr.Topview){var o=e?new a.Vector3(this.state.offset.x,this.state.offset.y,this.state.offset.z):new a.Vector3(Pi(this.camera.pose.offset.x,this.state.offset.x,.2),Pi(this.camera.pose.offset.y,this.state.offset.y,.2),Pi(this.camera.pose.offset.z,this.state.offset.z,.2));if(!this.camera.pose.offset.equals(o))return void this.controller.updateCamera({offset:o},!1,!1)}else{var u=Math.PI/45,c=e?this.state.fov:Pi(this.camera.pose.fov,this.state.fov,1),l=e?{longitude:this.state.longitude,latitude:this.state.latitude}:function(e,t,i){if(e.longitude===t.longitude&&e.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var n=bi(e.longitude),r=e.latitude,s=bi(t.longitude),o=t.latitude;s-n>Li?n+=Si:n-s>Li&&(n-=Si);var a=i/Math.sqrt(Math.pow(s-n,2)+Math.pow(o-r,2));return a>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:n+(s-n)*a,latitude:r+(o-r)*a}}({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},u),h=l.longitude,d=l.latitude;if(c!==this.camera.pose.fov||h!==this.camera.pose.longitude||d!==this.camera.pose.latitude)return this.controller.tweenCoordinates&&(this.controller.tweenCoordinates.destroy(),delete this.controller.tweenCoordinates),void this.controller.updateCamera({longitude:h,latitude:d,fov:c},!1,!1)}this.stateSynced=!0,!1===r&&this.emit("stateSynced",this.state)}else{var p={panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};this.changeMode(this.state.mode,p,this.modeChangeDuration,!1)}}},i.prototype.ready=function(){var e=this;return new Promise((function(t){return e.readyCallbacks.push(t)}))},i.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},i.prototype.loadModel=function(e,t,n,r){var s=this,o=e.async||!1;this.emit("modelWillLoad",e);var a=new wi({allowHosts:t,networkSubscribe:this.networkSubscribe});a.once("bvhLoaded",(function(){s.emit("modelBvhLoaded",a)})),a.once("geometryLoaded",(function(){s.emit("modelGeometryLoaded",a)})),a.on("error",(function(e){s.emit("modelLoadError",e,a),s.throwError(e),s.modelPending=!1})),a.on("shownFloorChange",(function(e,t){s.emit("modelShownFloorChange",e,t)})),a.once("loaded",(function(){var t;if(!s.destroyed){a.bounding.max.y-a.bounding.min.y<1.5&&(a.bounding.max.y=a.bounding.min.y+10);var u,c=s.model;c&&(c.show(),u=c.getMaterial()||{},s.scene.remove(c),c.dispose(),a.setTransparent(c.getTransparent())),s.model=Object.assign(a,{loaded:!0}),null===(t=s.controller)||void 0===t||t.resetModel(s.model,r),u&&s.model.setMaterial(u),c&&s.currentMode!==i.Mode.Panorama&&(o=!1);var l=function(){n(),s.emit("modelLoaded",a),Xe((function(){return s.emit("modelMaterialLoaded",a)})),e.bvh&&Gt((function(){return a.buildBVH()})),"function"==typeof gc&&gc(),s.needsRender=!0,s.modelPending=!1};if(o){var h=[].concat(s.model.children);s.model.children.length=0;var d=ft(Cr);d.name="uniformKeeper",d.visible=!1,d.setMaterial(u||{}),s.model.add(d),s.scene.add(s.model);var p=function(){Gt((function(){var e=h.shift();e?(s.model.setMaterial.call(e,s.model.getMaterial()||{}),s.model.add(e),null===s.model.shownFloor?s.model.show():s.model.show(s.model.shownFloor),Xe(p,2)):(s.model.remove(d),l())}))};p()}else c?(s.scene.add(s.model),l()):Gt((function(){s.scene.add(s.model),l()}))}})),this.modelPending=!0,a.load(e,this.textureOptions)},i.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,helper:this.helperGroup,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),model:this.model,work:this.work,imageOptions:this.imageOptions,extraElements:this.extraElements,videoTexture:this.videoTexture,networkSubscribe:this.networkSubscribe}},i.prototype.saveControllerPose=function(e){void 0===e&&(e=this.controller),e&&Ar(e)&&(this.panoramaLikeSavedPose.longitude=this.camera.pose.longitude,this.panoramaLikeSavedPose.latitude=this.camera.pose.latitude,this.panoramaLikeSavedPose.fov=this.camera.pose.fov)},i.prototype.applyController=function(e,n){var r=this;if(!this.renderer)throw new Error("renderer is not initialized.");var s=gr[e];e===this.currentMode||this.model.empty||this.model.show(),this.model.setTransparent(e===i.Mode.Floorplan||e===i.Mode.Topview||e===i.Mode.Model),this.currentMode=e;var o=new s(n);if(o.postProcessing){if(!this.screenBuffer){var u=this.getDrawingBufferSize(Pr);this.screenBuffer=new a.WebGLRenderTarget(u.x,u.y,{encoding:this.renderer.outputEncoding})}}else this.screenBuffer&&(this.screenBuffer.dispose(),delete this.screenBuffer);for(var c=function(e){o.on(e,(function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var s=r.emit.apply(r,t.__spreadArray([e],i,!1));if(s)return!1}))},l=0,h=yr;l<h.length;l++){c(h[l])}if(!1===n.initial[2]){var d=gr[e].initAnimationEndPose(n);this.state.panoIndex=n.panoIndex,this.state.mode=e,this.state.longitude=d.longitude,this.state.latitude=d.latitude,this.state.fov=d.fov,this.state.offset=d.offset}return o.on("initAnimationWillStart",(function(t,i,n){var s;n&&(r.state.mode=e,r.state.panoIndex=t,r.state.longitude=i.longitude,r.state.latitude=i.latitude,r.state.fov=i.fov,r.state.offset.copy(i.offset),r.emit("stateChange",r.state,n),null===(s=r.analysis)||void 0===s||s.state(r.work,r.state))})),o.on("initAnimationEnded",(function(t,i,n){var s;n&&(r.state.mode=e,r.state.panoIndex=t,r.state.longitude=i.longitude,r.state.latitude=i.latitude,r.state.fov=i.fov,r.state.offset.copy(i.offset),r.emit("stateChange",r.state,n),null===(s=r.analysis)||void 0===s||s.state(r.work,r.state))})),o.on("moveToPano",(function(e,t){r.emit("currentStateChange",r.getCurrentState(),t)})),o.on("panoWillArrive",(function(e,t,i){var n;r.panoIndex=e,i&&(r.state.panoIndex=e,r.state.longitude=t.longitude,r.state.latitude=t.latitude,r.state.fov=t.fov,r.state.offset.copy(t.offset),r.emit("stateChange",r.state,i),null===(n=r.analysis)||void 0===n||n.state(r.work,r.state))})),o.on("panoArrived",(function(){"function"==typeof gc&&gc()})),o.on("wantsMoveToPano",(function(e,t,i){var n=r.emit("wantsMoveToPano",e,t,i);n||(n=r.emit("wantsToMoveToPano",e,t,i)),n||r.moveToPano(e,t,i)})),o.on("cameraUpdate",(function(e,t){var i;t&&r.state.mode===r.currentMode&&r.state.panoIndex===r.panoIndex&&(r.state.longitude=e.longitude,r.state.latitude=e.latitude,r.state.fov=e.fov,r.state.offset.copy(e.offset),r.emit("stateChange",r.state,t),null===(i=r.analysis)||void 0===i||i.state(r.work,r.state)),r.emit("currentStateChange",r.getCurrentState(),t)})),o.on("vrWantsToExit",(function(){r.currentMode===i.Mode.VRPanorama&&r.changeMode(i.Mode.Panorama)})),o.on("error",(function(e){return r.throwError(e)})),o},i.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",DepthPanorama:"DepthPanorama",VRPanorama:"VRPanorama"},i.Line=null,i.Easing=Ei,i}(xt);exports.Camera=Qe,exports.Easing=Ei,exports.Five=Rr,exports.HashCubeTexture=ot,exports.InternalWebGLRenderer=Fe,exports.Model=wi,exports.NetworkSubscribe=Pt,exports.PBMContainer=it,exports.PBMGroup=nt,exports.PBMMaterial=dt,exports.PBMMesh=tt,exports.PROXY_CONTROLLER_EVENT_NAMES=yr,exports.Scene=Ye,exports.Subscribe=xt,exports.getViewportScale=mr,exports.parseWork=Hi,exports.stringifyWork=function(e){for(var t,i,n,r,s=e.workCode,o={pano_index:e.initial.panoIndex,pano:e.initial.panoIndex,longitude:e.initial.longitude,latitude:e.initial.latitude},a=null===(i=null===(t=e.model)||void 0===t?void 0:t.bvh)||void 0===i||i,u=null!==(r=null===(n=e.model)||void 0===n?void 0:n.async)&&void 0!==r&&r,c=e.model?{file_url:e.model.file,material_textures:e.model.textures.slice(),material_base_url:e.model.textureBase}:void 0,l={list:[]},h=[],d=0;d<e.observers.length;d++){var p=e.observers[d];h[d]={index:d,active:p.active,visible_nodes:p.visibleNodes.slice(),accessible_nodes:p.accessibleNodes.slice(),quaternion:{x:p.quaternion.x,y:p.quaternion.y,z:p.quaternion.z,w:p.quaternion.w},standing_position:p.standingPosition.toArray(),position:p.position.toArray(),floor:p.floorIndex,floor_index:p.floorIndex},l.list[d]={index:d,active:p.active,loadable:p.loadable,up:p.images.up,down:p.images.down,right:p.images.right,left:p.images.left,front:p.images.front,back:p.images.back},p.video&&(l.list[d].video={source:p.video.source,matrix:p.video.matrix.toArray(),size:p.video.size.toArray()}),p.images.depth&&(l.list[d].depth=p.images.depth),p.images.tiles&&(l.list[d].tiles=p.images.tiles)}var M={bvh:a,modelAsync:u,initial:o,observers:h,panorama:l,work_code:s};return c&&(M.model=c),JSON.stringify(M)};
545
+ */function rr(e,t){var i,n,r,s,o=new a.Vector3,u=new a.Vector3,c=null;"VRFrameData"in window&&(c=new window.VRFrameData),"undefined"!=typeof navigator&&navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){n=e,e.length>0?i=e[0]:t&&t(new Error("HMD not available"))})).catch((function(){console.warn("THREE.VREffect: Unable to get VR Displays")})),this.isPresenting=!1,this.scale=1;var l=this,h=e.getSize(new a.Vector2),d=!1,A=e.getPixelRatio();this.getVRDisplay=function(){return i},this.setVRDisplay=function(e){i=e},this.getVRDisplays=function(){return console.warn("THREE.VREffect: getVRDisplays() is being deprecated."),n},this.setSize=function(t,n,r){if(h=new a.Vector2(t,n),d=r,l.isPresenting){var s=i.getEyeParameters("left");e.setPixelRatio(1),e.setSize(2*s.renderWidth,s.renderHeight,!1)}else e.setPixelRatio(A),e.setSize(t,n,r)};var p=e.domElement,M=[0,0,.5,1],f=[.5,0,.5,1];function g(){var t=l.isPresenting;if(l.isPresenting=void 0!==i&&i.isPresenting,l.isPresenting){var n=i.getEyeParameters("left"),r=n.renderWidth,s=n.renderHeight;t||(A=e.getPixelRatio(),h=e.getSize(new a.Vector2),e.setPixelRatio(1),e.setSize(2*r,s,!1))}else t&&(e.setPixelRatio(A),e.setSize(h.width,h.height,d))}window.addEventListener("vrdisplaypresentchange",g,!1),this.setFullScreen=function(e){return new Promise((function(t,n){void 0!==i?l.isPresenting!==e?e?(i.requestPresent([{source:p}]),t()):(i.exitPresent(),t()):t():n(new Error("No VR hardware found."))}))},this.requestPresent=function(){return this.setFullScreen(!0)},this.exitPresent=function(){return this.setFullScreen(!1)},this.requestAnimationFrame=function(e){return void 0!==i?i.requestAnimationFrame(e):window.requestAnimationFrame(e)},this.cancelAnimationFrame=function(e){void 0!==i?i.cancelAnimationFrame(e):window.cancelAnimationFrame(e)},this.submitFrame=function(){void 0!==i&&l.isPresenting&&i.submitFrame()},this.autoSubmitFrame=!0;var y=new a.PerspectiveCamera;y.layers.enable(1);var v=new a.PerspectiveCamera;function m(e,t,i,n){var r=Math.PI/180;return function(e,t,i,n){i=void 0===i?.01:i,n=void 0===n?1e4:n;var r=(t=void 0===t||t)?-1:1,s=new a.Matrix4,o=s.elements,u=function(e){var t=2/(e.leftTan+e.rightTan),i=(e.leftTan-e.rightTan)*t*.5,n=2/(e.upTan+e.downTan);return{scale:[t,n],offset:[i,(e.upTan-e.downTan)*n*.5]}}(e);return o[0]=u.scale[0],o[1]=0,o[2]=u.offset[0]*r,o[3]=0,o[4]=0,o[5]=u.scale[1],o[6]=-u.offset[1]*r,o[7]=0,o[8]=0,o[9]=0,o[10]=n/(i-n)*-r,o[11]=n*i/(i-n),o[12]=0,o[13]=0,o[14]=r,o[15]=0,s.transpose(),s}({upTan:Math.tan(e.upDegrees*r),downTan:Math.tan(e.downDegrees*r),leftTan:Math.tan(e.leftDegrees*r),rightTan:Math.tan(e.rightDegrees*r)},t,i,n)}v.layers.enable(2),this.render=function(t,n){var h,d;if(i&&l.isPresenting){var A=t.autoUpdate;A&&(t.updateMatrixWorld(),t.autoUpdate=!1);var p=i.getEyeParameters("left"),g=i.getEyeParameters("right");o.fromArray(p.offset),u.fromArray(g.offset),Array.isArray(t)&&(console.warn("THREE.VREffect.render() no longer supports arrays. Use object.layers instead."),t=t[0]);var N,D,w=e.getSize(new a.Vector2),T=i.getLayers();if(T.length){var x=T[0];N=null!==x.leftBounds&&4===(null===(h=x.leftBounds)||void 0===h?void 0:h.length)?x.leftBounds:M,D=null!==x.rightBounds&&4===(null===(d=x.rightBounds)||void 0===d?void 0:d.length)?x.rightBounds:f}else N=M,D=f;r={x:Math.round(w.width*N[0]),y:Math.round(w.height*N[1]),width:Math.round(w.width*N[2]),height:Math.round(w.height*N[3])},s={x:Math.round(w.width*D[0]),y:Math.round(w.height*D[1]),width:Math.round(w.width*D[2]),height:Math.round(w.height*D[3])},e.setScissorTest(!0),e.autoClear&&e.clear(),null===n.parent&&n.updateMatrixWorld(),n.matrixWorld.decompose(y.position,y.quaternion,y.scale),n.matrixWorld.decompose(v.position,v.quaternion,v.scale);var E=this.scale;return y.translateOnAxis(o,E),v.translateOnAxis(u,E),i.getFrameData&&c?(i.depthNear=n.near,i.depthFar=n.far,i.getFrameData(c),y.projectionMatrix.elements=[].slice.call(c.leftProjectionMatrix),v.projectionMatrix.elements=[].slice.call(c.rightProjectionMatrix)):(y.projectionMatrix=m(p.fieldOfView,!0,n.near,n.far),v.projectionMatrix=m(g.fieldOfView,!0,n.near,n.far)),e.setViewport(r.x,r.y,r.width,r.height),e.setScissor(r.x,r.y,r.width,r.height),e.render(t,y),e.setViewport(s.x,s.y,s.width,s.height),e.setScissor(s.x,s.y,s.width,s.height),e.render(t,v),e.setViewport(0,0,w.width,w.height),e.setScissorTest(!1),A&&(t.autoUpdate=!0),void(l.autoSubmitFrame&&l.submitFrame())}e.render(t,n)},this.dispose=function(){window.removeEventListener("vrdisplaypresentchange",g,!1)}}var sr=new a.SphereBufferGeometry(.1,32,32);function or(e,t){Array.isArray(e)?e.forEach((function(e){e instanceof a.MeshBasicMaterial&&e.setValues({color:t})})):e instanceof a.MeshBasicMaterial&&e.setValues({color:t})}var ar=function(e){function i(){var t=e.call(this)||this,i=new a.MeshBasicMaterial({color:8900346,opacity:.5,transparent:!0});return t.mesh=new a.Mesh(sr,i),t.active=!1,t.current=!1,t.add(t.mesh),t}return t.__extends(i,e),i.prototype.isActive=function(){return this.active},i.prototype.isCurrent=function(){return this.current},i.prototype.setActive=function(){!0!==this.active&&(this.active=!0,or(this.mesh.material,16776960))},i.prototype.setCurrent=function(){!0!==this.current&&(this.current=!0,or(this.mesh.material,65280))},i.prototype.reset=function(){!1===this.current&&!1===this.active||(this.active=!1,this.current=!1,or(this.mesh.material,8900346))},i.prototype.dispose=function(){this.remove(this.mesh),Array.isArray(this.mesh.material)?this.mesh.material.forEach((function(e){return e.dispose()})):this.mesh.material.dispose()},i}(a.Object3D);var ur=null,cr=[{zh:"1. 进入: 将手机横屏放入VR眼镜中",en:"1. Enter: Put your phone<br/> horizontally into the VR glasses",ja:"1.入力:電話をVRメガネに水平に置きます"},{zh:"2. 前进: 视角中心对准蓝点, 直至变绿",en:"2. Forward: align the center of the viewing<br/> angle with the blue dot, until it turns green",ja:"2.前方:緑色に変わるまで、<br/>視野角の中心を青い点に合わせます"},{zh:"3. 退出: 将手机竖屏再触碰屏幕",en:"3. Exit: Put the phone in portrait<br/> orientation and then touch the screen",ja:"3.終了:電話を縦向きにしてから<br/>画面にタッチします"}],lr=function(e){function i(t){var n=this;Ve(ur)&&(ur=new nr(t.webvrPolyfillConfig||{}));var r=i.parseArgs(t);n=e.call(this,r)||this;var s=r.element,o=r.renderer,a=r.panoIndex,u=void 0===a?0:a;n.effect=new rr(o);var c=s.offsetWidth,l=s.offsetHeight;n.element=s,n.effect.setSize(c,l),n.effect.isPresenting=!0,n.panoSphereMeshes=n.work.observers.map((function(e,t){var i=new ar;return i.name="panoSphereMesh_"+t,i.position.copy(e.position),Object.assign(i,{panoIndex:t}),n.helper.add(i),i}));var h=n.work.observers[u].visibleNodes;h=h.filter((function(e){return n.work.observers[e].active}));var d=n.panoSphereMeshes.filter((function(e){return e.panoIndex===u}))[0];return n.panoSphereMeshes.forEach((function(e){if(e.visible=h.indexOf(e.panoIndex)>=0,d){var t=d.position.distanceTo(e.position)<5;e.visible=e.visible&&t}})),n.intersectMesh.parent&&n.intersectMesh.parent.remove(n.intersectMesh),n.initHelper(s),n}return t.__extends(i,e),i.parseArgs=function(i){var n=t.__assign(t.__assign({},i),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return e.parseArgs.call(this,n)},i.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},i.prototype.destroy=function(){var t=this;e.prototype.destroy.call(this),this.panoSphereMeshes&&(this.panoSphereMeshes.forEach((function(e){t.helper.remove(e),e.dispose()})),this.panoSphereMeshes.length=0),this.destroyHelper()},i.prototype.initHelper=function(e){for(var t="five_webvr_helper_"+qe(),i=1,n=document.getElementsByTagName("meta"),r=0;r<n.length;r++){var s=n[r];if("viewport"===s.getAttribute("name")){var o=(s.getAttribute("content")||"").match(/initial\-scale\=([\d|\.]+)/);o&&(i=Number(o[1])),isNaN(i)&&(i=1)}}var a=function(e){return Math.floor(e*i)+"px"},u=document.createElement("style"),c="\n ."+t+"{\n font-family:sans-serif;\n background:#394043;color:#ffffff;\n position:absolute;display:none;\n -webkit-tap-highlight-color:rgba(0,0,0,0);\n }\n ."+t+" img{\n position:absolute;top:50%;left:50%;\n -webkit-transform:translate(-50%,-100%);\n -moz-transform:translate(-50%,-100%);\n transform:translate(-50%,-100%);\n pointer-events:none;\n width:"+a(132)+";\n height:"+a(162)+";\n }\n ."+t+" ol{\n position:absolute;top:50%;left:50%;\n -webkit-transform:translate(-50%,0);\n -moz-transform:translate(-50%,0);\n transform:translate(-50%,0);\n pointer-events:none;\n margin-top:"+a(38)+";\n font-size:"+a(16)+";\n line-height:"+a(30)+";\n }\n ."+t+" li{\n list-style-type:none;\n white-space:nowrap;\n position:relative;\n padding-left:"+a(14)+";\n margin-bottom:"+a(12)+";\n }\n @media screen and (orientation: portrait){\n ."+t+"{display: block!important}\n }\n ";u.setAttribute("type","text/css"),"styleSheet"in u?u.styleSheet.cssText=c:u.appendChild(document.createTextNode(c));var l=this.helperElement=document.createElement("div");l.className=t,l.innerHTML='\n <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DEwMDIsNTkuMDQ5MjA3NSBMNzcuMDQwMTAwMiw1OS4wNDkyMDc1IEM3Ny4zMDY0OTY4LDU5LjUxNTQwMTUgNzcuMTU3MTc5OCw2MC4xMDg3NjczIDc2LjcwMTg1Niw2MC4zOTMzNDQ3IEw3MS44NzUwNTA3LDYzLjQxMDA5OCBMNzEuODc1MDUwNyw2My40MTAwOTggQzcxLjQwNjcxNDEsNjMuNzAyODA4NCA3MC43ODk3NjM4LDYzLjU2MDQzNTIgNzAuNDk3MDUzNCw2My4wOTIwOTg3IEM3MC4zMzg5NjQ1LDYyLjgzOTE1NjMgNzAuMzAyMDQzNSw2Mi41Mjg4NDY4IDcwLjM5NjM2ODQsNjIuMjQ1ODcyIEw3Mi44MDk3NzExLDU1LjAwNTY2NCBMNzIuODA5NzcxMSw1NS4wMDU2NjQgQzcyLjk4NDQxODksNTQuNDgxNzIwNyA3My41NTA3Mzg4LDU0LjE5ODU2MDcgNzQuMDc0NjgyMiw1NC4zNzMyMDg0IEM3NC4zMDgwOTMxLDU0LjQ1MTAxMjEgNzQuNTA0NjI5MSw1NC42MTIxMzMxIDc0LjYyNjY5NzUsNTQuODI1NzUyOCBaIiBpZD0iVHJpYW5nbGUiIGZpbGwtb3BhY2l0eT0iMC4yNjYwNDk1OTIiIGZpbGw9IiNGRkZGRkYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDczLjc1ODUyMSwgNTguOTQxOTI3KSByb3RhdGUoMTgwLjAwMDAwMCkgdHJhbnNsYXRlKC03My43NTg1MjEsIC01OC45NDE5MjcpICI+PC9wYXRoPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="/>\n <ol style="">\n '+cr.map((function(e){var t;return"<li>"+(null!==(t=e[navigator.language.split("-")[0]])&&void 0!==t?t:e.zh)+"</li>"})).join("")+"\n </ol>\n ";var h=new Zi(l);e.parentNode&&(e.parentNode.insertBefore(u,e),e.parentNode.insertBefore(l,e),this.setHelperElementSize(),h.on("tap",this.vrWantsToExit.bind(this))),this.destroyHelper=function(){h.destroy(),u.parentNode&&u.parentNode.removeChild(u),l.parentNode&&l.parentNode.removeChild(l)}},i.prototype.setHelperElementSize=function(){if(this.helperElement){var e=this.renderer.domElement,t=new a.Vector2(e.offsetWidth,e.offsetHeight),i=t.x*this.scissor.left,n=t.y*(1-this.scissor.bottom-this.scissor.height),r=t.x*this.scissor.width,s=t.y*this.scissor.height;this.helperElement.style.marginLeft=i+"px",this.helperElement.style.marginTop=n+"px",this.helperElement.style.width=r+"px",this.helperElement.style.height=s+"px"}},i.prototype.destroyHelper=function(){},i.prototype.resize=function(){var e=this.element,t=e.offsetWidth,i=e.offsetHeight;this.effect.isPresenting=!1,this.effect.setSize(t,i),this.effect.isPresenting=!0,this.needsRender=!0,this.setHelperElementSize()},i.prototype.doMoveToPano=function(){for(var t=this,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];e.prototype.doMoveToPano.apply(this,i);var r=i[0],s=this.work.observers[r],o=s.visibleNodes;o=o.filter((function(e){return t.work.observers[e].active}));var a=this.panoSphereMeshes.filter((function(e){return e.panoIndex===r}))[0];this.panoSphereMeshes.forEach((function(e){if(e.visible=o.indexOf(e.panoIndex)>=0,a){var t=a.position.distanceTo(e.position)<5;e.visible=e.visible&&t}})),this.needsRender=!0},i.prototype.vrWantsToExit=function(){this.emit("vrWantsToExit")},i.prototype.onPanGesture=function(){},i.prototype.onTapGesture=function(){},i.prototype.onPinchGesture=function(){},i.prototype.onMouseMove=function(){},i.prototype.onMouseOut=function(){},i.prototype.renderIntersect=function(){var e=this,t=e.camera,i=e.model,n=e.intersectMesh,r=e.panoSphereMeshes,s=e.intersectCameraPosition,o=e.intersectCameraVector,u=e.intersectActiveSphereMesh,c=e.intersectActiveDate;if(n){u&&c&&Ze()-c>2e3&&(delete this.intersectActiveDate,u.setCurrent(),this.moveToPano(u.panoIndex,{},!0));var l=t.getWorldDirection(new a.Vector3);if(!(s&&o&&t.pose.offset.equals(s)&&l.equals(o))){var h=t.pose.offset.clone(),d=new a.Raycaster(h,l),A=null,p=null;if(!A)for(var M=0,f=r.filter((function(e){return e.visible}));M<f.length;M++){var g=f[M],y=d.intersectObject(g,!0)[0];if(y){A=y,p=g;break}}if(A||i.empty||(A=i.intersectRaycaster(d)[0]),A&&A.face){var v=A.face.normal,m=new a.Quaternion;m.setFromUnitVectors(new a.Vector3(0,0,-1),v),n.quaternion.copy(m);var N=v.clone().multiplyScalar(.05),D=A.point.clone().add(N);if(n.position.copy(D),n.visible=!0,this.emit("intersectionOnModelUpdate",A,n),r.forEach((function(e){return e.reset()})),p)(g=p).setActive(),this.intersectActiveSphereMesh!==g&&(this.intersectActiveSphereMesh=g,this.intersectActiveDate=Ze());else delete this.intersectActiveSphereMesh,delete this.intersectActiveDate}else n.visible=!1,this.emit("intersectionHidden"),delete this.intersectActiveSphereMesh,delete this.intersectActiveDate;this.intersectCameraPosition=t.pose.offset.clone(),this.intersectCameraVector=l.clone(),this.needsRender=!0}}},i.prototype.render=function(){var e=this,t=e.effect,i=e.camera,n=e.scene,r=t.getVRDisplay(),s=this.camera.pose,o=s.longitude,u=s.latitude;if(r){var c=r.getPose();if(Ve(c.orientation)||i.quaternion.fromArray(c.orientation),r.stageParameters){i.updateMatrix();var l=r.stageParameters.sittingToStandingTransform,h=new a.Matrix4;h.fromArray(l),i.applyMatrix4(h)}}i.updateMatrixWorld(),i.computePose();var d=this.camera.pose,A=d.longitude,p=d.latitude;o===A&&u===p||(this.emit("cameraDirectionUpdate",{longitude:A,latitude:p},!0),this.emit("cameraUpdate",this.camera.copyPose(),!0)),this.renderIntersect(),t.render(n,i)},i}(ir),hr=function(e){function i(t){var n=i.parseArgs(t);return e.call(this,n)||this}return t.__extends(i,e),i.parseArgs=function(t){return e.parseArgs.call(this,t)},i.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i.prototype.updateWork=function(e,t,i,n){return this.ready=!1,this.work=e,this.currentPanoIndex=t.panoIndex,this.hideIntersectMesh(),this.moveToPano(t.panoIndex,{duration:0,longitude:t.longitude,latitude:t.latitude,fov:t.fov},n),!0},i.prototype.moveToPano=function(e,t,i){void 0===t&&(t={});var n=this.work.observers[e];n&&this.moveToPosition(n.position,t,i)},i.prototype.moveToPosition=function(e,t,i){var n,r,s,o,u,c,l=this;void 0===t&&(t={});var h=this,d=h.camera,A=h.model,p=h.currentPanoIndex,M=t.duration,f=t.limit,g=void 0===f||f,y=t.easing,v=void 0===y?ji.Quadratic.InOut:y;this.ready=!1;var m=this.calculateMovingDuration(M,d.pose.offset.distanceTo(e)),N=Wi(this.work.observers,(function(t){return t.position.distanceTo(e)})),D=this.work.observers.indexOf(N);this.emit("moveToPano",D,i);var w=d.pose.longitude,T=d.pose.latitude,x=d.pose.fov,E=d.pose.offset.clone(),j=(null===(n=A.getMaterial())||void 0===n?void 0:n.modelAlpha)||0,I=null!==(s=null===(r=this.model.getMaterial())||void 0===r?void 0:r.perspToOrtho)&&void 0!==s?s:0,z=null!==(o=t.longitude)&&void 0!==o?o:w,b=null!==(u=t.latitude)&&void 0!==u?u:T,L=null!==(c=t.fov)&&void 0!==c?c:x,S=e.clone(),O={longitude:z,latitude:b,fov:L,offset:S.clone()};t.moveStartCallback&&t.moveStartCallback(D,O),this.emit("panoWillArrive",D,O,i),this.tweenPosition&&(this.tweenPosition.destroy(),delete this.tweenPosition);var C=function(e){var t=e.progress;l.setModelAndBoundingUniforms({modelAlpha:Ci(j,1,t),perspToOrtho:Ci(I,0,Math.min(5*t,1))});var n=new a.Vector3(Ci(E.x,S.x,t),Ci(E.y,S.y,t),Ci(E.z,S.z,t));l.updateCamera({offset:n},i,g),t>.7&&(l.preventTapGesture=!1),l.emit("movingToPano",D,p,t),i&&l.lastMouseMoveEvent&&l.onMouseMove(l.lastMouseMoveEvent),l.needsRender=!0},P=function(){C({progress:1}),l.preventTapGesture=!1,l.emit("panoArrived",D,l.camera.copyPose(),i),l.needsRender=!0,l.ready=!0};if(this.preventTapGesture=!0,m>0?this.tweenPosition=zi(m,v).onUpdate(C).onComplete((function(){l.tweenPosition&&l.tweenPosition.destroy(),delete l.tweenPosition,t.moveEndCallback&&t.moveEndCallback(D,l.camera.copyPose()),P()})).onCancel((function(){t.moveCancelCallback&&t.moveCancelCallback()})):P(),this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),w!==z||T!==b||x!==L){var k=function(e){var t=e.progress,n=Pi(w,z,t),r=Ci(T,b,t),s=Ci(x,L,t);l.updateCamera({longitude:n,latitude:r,fov:s},i,g)},B=function(){return k({progress:1})};m>0?this.tweenCoordinates=zi(m,v).onUpdate(k).onComplete((function(){l.tweenCoordinates&&(l.tweenCoordinates.destroy(),delete l.tweenCoordinates),B()})):B()}},i.prototype.setModelAndBoundingUniforms=function(e){for(var t=0,i=[this.model];t<i.length;t++){i[t].setMaterial(e)}},i.prototype.onTapGesture=function(e){if(this.interiaMovement=!1,!0!==this.preventTapGesture){var t=this.camera,i=this.model,n=this.relativeClientPosition(e.center),r=new a.Raycaster;r.setFromCamera(n,t);var s=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","tap",s,!0)||this.emit("wantsTapGesture",r,n))){var o=M(r);if(o&&o.face){var u=o.face.normal,c=o.point;if(new a.Vector3(0,1,0).angleTo(u)>Math.PI/3){var l=t.pose.offset.clone().setY(c.y),h=c.clone().sub(l).setLength(.3),d=c.clone().sub(h);r.set(d,new a.Vector3(0,-1,0)),o=M(r)}}if(o){var A=o.point.clone(),p=Wi(this.work.observers.filter((function(e){return Math.abs(e.standingPosition.y-A.y)<1})),(function(e){return e.standingPosition.distanceTo(A)}));p&&(A.y=p.position.y,this.emit("gesture","tap",s,!0),this.emit("tapGesture",r,n),this.moveToPosition(A,{},!0))}}}function M(e){return(!0===i.empty?e.intersectObjects(i.children):i.intersectRaycaster(e))[0]}},i}(yn),dr=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}("{vs|z-rp@-}n{|]|vv|{H{vs|z-znA-}n{|ZnvH{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-]Vl?-J-C;?E@>EB?Hp|{-sy|n-pnyr-J->@;>Hrp?-|P||q5rp@-rp|6-\n--sy|n--J-yr{tu5rp|6H--sy|n-urn-J-np|5:rp|;\b-<-6H--sy|n-}uv-J-nn{5rp|;9-rp|;\t6H--r{-rp?5=;B-8-}uv-<-]Vl?9-urn-<-]V6H\f|vq-znv{56-\n--rpA-|yq]|vv|{-J-z|qryZnv-7-rpA5}|vv|{9->;=6H--}n{|d|yq]|vv|{-J-5rpA5|yq]|vv|{;\b\t9->;=6-7-}n{|Znv6;\b\tH--rp?-p||q-J-|P||q5}n{|d|yq]|vv|{6H--sy|n-qvn{pr-J-pnyrH--vs-5p||q;\b-I-=;>B6-\n----rp?-n{s|zrqP||q-J-rp?5p||q;9-=;=6H----rpA-}n{|Qv}ynprzr{-J-rr?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;H----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-\n----rp?-n{s|zrqP||q-J-rp?5p||q;9-5p||q;\b-:-=;>B6-<-=;D6H----rpA-}n{|Qv}ynprzr{-J-rr?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----vs5-}n{|Qv}ynprzr{;-JJ-=;=6\n------qvn{pr-J-pnyrH----\fryr\n------qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;H----\f--\f-ryr-\n----rp?-n{s|zrqP||q-J-rp?5p||q;9->;=6H----rpA-}n{|Qv}ynprzr{-J-rr?Q5}n{|Qv}ynprzr{Zn}9-n{s|zrqP||q6H----qvn{pr-J-pnyr-7-}n{|Qv}ynprzr{;H----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\tr5|yq]|vv|{;\b\t6-7-qvn{pr9->;=6H--tyl]|vv|{-J-}|wrpv|{Znv-7-z|qrycvrZnv-7-ry]|vv|{H\f"),Ar=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=113,n=126,r=0,s="";return arguments[r].split(s).map((function(e){return e.charCodeAt(r)>n?e:String.fromCharCode((e.charCodeAt(r)+i)%n)})).join(s)}("{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-\n--rpA-}n{|P|y|-J-rrPor5}n{|Zn}9-}n{|d|yq]|vv|{;\b\t6H--tylSntP|y|-J-rpA5}n{|P|y|;to9-|}npv\b6H\f"),pr=Object.assign({opacity:new a.Uniform(1),scale:new a.Uniform(13.1),panoMap:new a.Uniform(null),panoDisplacementMap:new a.Uniform(null),panoPosition:new a.Uniform(new a.Vector3),panoMatrix:new a.Uniform(new a.Matrix4)},{emissive:new a.Uniform(new a.Color(0)),emissiveMap:new a.Uniform(null),specular:new a.Uniform(new a.Color(1118481)),specularMap:new a.Uniform(null),normalMap:new a.Uniform(null),bumpMap:new a.Uniform(null),shininess:new a.Uniform(30)},a.UniformsLib.common,a.UniformsLib.lights),Mr=new a.SphereBufferGeometry(.01,128,128);var fr=function(e){function i(t,i){void 0===i&&(i={});var n=e.call(this)||this;return n.renderer=t,n.prevRequest=null,n.cubeTextureLoader=new cn(t,{allowHosts:n.allowHosts,networkSubscribe:n.networkSubscribe}),n.allowHosts=i.allowHosts,n.networkSubscribe=i.networkSubscribe,n}return t.__extends(i,e),i.prototype.setAllowHosts=function(e){this.allowHosts=e,this.cubeTextureLoader.setAllowHosts(e)},i.prototype.load=function(e,t){var i=this,n=He,r=He,s=He,o=He;"function"==typeof t?(n=t.bind(this,null),s=t.bind(this),o=t.bind(this)):(t.onLoad&&(n=t.onLoad),t.onProgress&&(r=t.onProgress),t.onError&&(s=t.onError),t.onAbort&&(o=t.onAbort));var u=null,c=[0,0],l=function(){u=null,i.prevRequest=null},h=function(t,n){c[n]=t;var s=.8*c[0]+.2*c[1];r(s),i.emit("progress",s,e)};this.cubeTextureLoader.load(e,{onLoad:function(t){h(0,1);var r=e.images.depth;u=an(r,(function(r){var s=Object.assign(function(e,t,i,n){var r=new a.ShaderMaterial({side:a.BackSide,vertexShader:dr,fragmentShader:Ar,transparent:!0,uniforms:a.UniformsUtils.clone(pr)}),s=e;s.needsUpdate=!0,s.minFilter=a.LinearFilter,s.magFilter=a.LinearFilter;var o=t instanceof a.Texture?t:new a.Texture(t);return o.needsUpdate=!0,o.minFilter=a.LinearFilter,o.magFilter=a.LinearFilter,r.uniforms.opacity.value=0,r.uniforms.panoMap.value=s,r.uniforms.panoDisplacementMap.value=o,r.uniforms.panoPosition.value=i,r.uniforms.panoMatrix.value=n,Object.assign(new a.Mesh(Mr,r),{frustumCulled:!1,dispose:function(){this.material instanceof a.ShaderMaterial&&(this.material.uniforms.panoDisplacementMap.value.dispose(),this.material.uniforms.panoDisplacementMap.value=null,this.material.dispose())}})}(t,r,e.position,e.matrix),{hash:t.hash,meta:t.meta});h(1,1),n(s),i.emit("load",s,e)}),(function(e){t.dispose(),s(e),l()}),(function(e){h(e,1)}),(function(){t.dispose(),o(new Error("source load abort: "+r)),l()}),i.allowHosts,i.networkSubscribe)},onError:function(e){s(e),l()},onAbort:function(e){o(e),l()},onProgress:function(e){h(e,0)}}),this.prevRequest={abort:function(){i.cubeTextureLoader.abort(),null==u||u.abort()}},this.emit("start",e)},i.prototype.abort=function(){this.prevRequest&&(this.prevRequest.abort(),this.prevRequest=null)},i}(xt),gr=function(e){function i(t){var n=this,r=i.parseArgs(t);(n=e.call(this,r)||this).maxAccessibleDistance=r.maxAccessibleDistance,n.panoCircleMeshCreator=r.panoCircleMeshCreator,n.model.setMaterial({perspToOrtho:0});var s=n.getBounding();return n.boundingMesh=Mt(s),n.boundingMesh.setMaterial(n.model.getMaterial()||{}),s.containsPoint(n.camera.pose.offset)||(n.boundingMesh.visible=!1),n.boundingMesh.renderOrder=2,n.boundingMesh.frustumCulled=!1,n.scene.add(n.boundingMesh),n.panoCircleMeshes=[],n.updatePanoCircleMeshes(),n.panoCircleMeshes.forEach((function(e){return e.visible=!1})),n.helper.remove(n.intersectMesh),n.depthTextureLoader=new fr(n.renderer,{allowHosts:n.work.allowHosts,networkSubscribe:n.networkSubscribe}),n.depthTextureLoader.on("start",(function(e){var t,i=e.index;null===(t=n.panoCircleMeshes[i])||void 0===t||t.setProgress(0),n.emit("textureStartLoad",i,n.work.observers[i])})),n.depthTextureLoader.on("progress",(function(e,t){var i,r=t.index;null===(i=n.panoCircleMeshes[r])||void 0===i||i.setProgress(e),n.emit("textureLoading",e,r,n.work.observers[r])})),n.depthTextureLoader.on("abort",(function(e){var t,i=e.index;null===(t=n.panoCircleMeshes[i])||void 0===t||t.setProgress(0),n.emit("textureAbort",i,n.work.observers[i])})),n.depthTextureLoader.on("load",(function(e,t){var i,r=t.index;null===(i=n.panoCircleMeshes[r])||void 0===i||i.setProgress(1),n.emit("textureLoaded",r,n.work.observers[r],e.meta)})),n.depthTextureLoader.on("error",(function(e,t){var i,r=t.index;null===(i=n.panoCircleMeshes[r])||void 0===i||i.setProgress(0),n.emit("textureError",e,r,n.work.observers[r])})),n.once("panoWillArrive",(function(){n.boundingMesh.visible=!0,n.needsRender=!0,n.model.visible=!1})),n}return t.__extends(i,e),i.parseArgs=function(i){var n,r,s=e.parseArgs.call(this,i);return t.__assign(t.__assign({},s),{maxAccessibleDistance:null!==(n=i.maxAccessibleDistance)&&void 0!==n?n:5,panoCircleMeshCreator:null!==(r=i.panoCircleMeshCreator)&&void 0!==r?r:Ln})},i.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},i.prototype.getBounding=function(){for(var e=new a.Box3,t=0,i=this.work.observers;t<i.length;t++){var n=i[t].standingPosition.clone();e.expandByPoint(n),n.y+=3,e.expandByPoint(n)}return e.max.x+=4,e.min.x-=4,e.max.z+=4,e.min.z-=4,e},i.prototype.updatePanoCircleMeshes=function(){var e=this,t=[],i=this.model;this.panoCircleMeshes&&(this.panoCircleMeshes.forEach((function(i){i.loading&&t.push(i.panoIndex),e.helper.remove(i),i.dispose()})),this.panoCircleMeshes.length=0);var n=new a.Vector3(0,-1,0);this.panoCircleMeshes=this.work.observers.map((function(r,s){var o=e.panoCircleMeshCreator();if(o.position.copy(r.standingPosition),e.model.loaded){var u=o.position.clone().add(new a.Vector3(0,1,0)),c=new a.Raycaster(u,n,0,1),l=i.intersectRaycaster(c)[0];l&&(o.position.copy(l.point.clone()),o.needsRender=!0)}return o.name="panoCircle_"+s,o.panoIndex=s,e.helper.add(o),o.needsRender=!0,!1===r.active&&(o.setDisabled(!0),t.indexOf(s)>=0&&(o.setDisabled(!1),o.setLoading(!0))),o}));var r=this.work.observers[this.currentPanoIndex].visibleNodes;r=r.filter((function(t){var i=e.work.observers[t];return i.loadable||i.active})),this.panoCircleMeshes.forEach((function(e){e.visible=r.indexOf(e.panoIndex)>=0}));var s=this.camera.position;this.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(s);e.setOpacity(Math.min(1.5/t,1))}))},i.prototype.destroy=function(){var t=this;e.prototype.destroy.call(this),this.depthTextureLoader.off(),delete this.pendingLoadTextureHashAndCallback,this.model&&(this.model.visible=!0),this.panoModel&&(this.scene.remove(this.panoModel),this.panoModel.dispose(),delete this.panoModel),this.boundingMesh&&(this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.panoCircleMeshes&&(this.panoCircleMeshes.forEach((function(e){t.helper.remove(e),e.dispose()})),this.panoCircleMeshes.length=0)},i.prototype.moveToPano=function(e,t,i){var n=this;void 0===t&&(t={}),this.ready=!1,this.interiaMovement=!1;var r={index:e,images:this.work.observers[e].images,imageOptions:this.imageOptions},s=l.digest(r),o=function(r,s){if(r)return t.moveCancelCallback&&t.moveCancelCallback(),n.emit("panoLoadError",r,e),n.emit("moveToPanoCanceled",e),void(n.ready=!0);n.destroyed?null==s||s.dispose():(n.emit("panoLoaded",e),Ke((function(){return n.doMoveToPano(e,s,t,i)})))},u=this.pendingLoadTextureHashAndCallback||[],c=u[0],h=u[1];if(s!==c){if(delete this.pendingLoadTextureHashAndCallback,h&&h(new Error("texture aborted")),this.emit("moveToPano",e,i),this.emit("panoWillLoad",e),!r.images)return void o(new Error("pano images were not existed"));if(!r.images.depth)return void o(new Error("pano depth image were not existed"));var d=this.work.observers[e],A=d.position,p=d.quaternion,M=(new a.Matrix4).compose(A,p,new a.Vector3(-1,1,1)),f=Object.assign({position:A,matrix:M},r);this.pendingLoadTextureHashAndCallback=[s,o],this.depthTextureLoader.load(f,(function(e,t){var i=n.pendingLoadTextureHashAndCallback||[],r=i[0],o=i[1];s===r&&o?(o(e,t),delete n.pendingLoadTextureHashAndCallback):null==t||t.dispose()}))}},i.prototype.updateCamera=function(t,i,n){var r=this;e.prototype.updateCamera.call(this,t,i,n),this.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(r.camera.pose.offset);e.setOpacity(Math.min(1/t,1))}));var s=this.getForwardPanoIndexOrNot();null!==s&&this.panoCircleMeshes[s].setOpacity(1),Ht()},i.prototype.canNotMoveAnimation=function(){var e=this;if(this.interiaMovement=!1,!this.tweenCoordinates){var t=this.camera.fov,i=.98*t,n=function(t){var i=t.fov;return e.updateCamera({fov:i},!0,!0)};this.tweenCoordinates=Ii({fov:t},{fov:i},200).onUpdate(n).onComplete((function(){var r;null===(r=e.tweenCoordinates)||void 0===r||r.destroy(),e.tweenCoordinates=Ii({fov:i},{fov:t},200).onUpdate(n).onComplete((function(){var t;null===(t=e.tweenCoordinates)||void 0===t||t.destroy(),delete e.tweenCoordinates}))}))}},i.prototype.doMoveToPano=function(e,t,i,n){var r,s,o,u=this;void 0===i&&(i={});var c=i.limit,l=void 0===c||c,h=i.easing,d=void 0===h?ji.Quadratic.InOut:h,A=this.currentPanoIndex,p=this.panoModel,M=this.currentPanoIndex,f=this.work.observers[e];if(p){var g={pano0Map:p.material.uniforms.panoMap.value,pano0Matrix:p.material.uniforms.panoMatrix.value};p.material.uniforms.opacity.value=1,this.boundingMesh.setMaterial(g)}t.renderOrder=-1;var y={progress:0,pano1Map:t.material.uniforms.panoMap.value,pano1Matrix:t.material.uniforms.panoMatrix.value};t.material.uniforms.opacity.value=0,this.boundingMesh.setMaterial(y),this.model.setMaterial(y),this.panoModel=t,this.scene.add(t);var v=f.visibleNodes.filter((function(e){var t=u.work.observers[e];return t.loadable||t.active})),m=this.camera.pose.offset.distanceTo(f.standingPosition),N=void 0===p?0:this.calculateMovingDuration(i.duration,m),D=this.camera.pose.longitude,w=this.camera.pose.latitude,T=this.camera.pose.offset.clone(),x=this.camera.fov,E=null!==(r=i.longitude)&&void 0!==r?r:D,j=null!==(s=i.latitude)&&void 0!==s?s:w,I=f.position,z=null!==(o=i.fov)&&void 0!==o?o:x,b={longitude:E,latitude:j,fov:z,offset:I.clone()};if(this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.tweenPosition&&(this.tweenPosition.destroy(),delete this.tweenPosition),i.moveStartCallback&&i.moveStartCallback(e,b),this.emit("panoWillArrive",e,b,n),this.needsRender=!0,D!=D||w!==j||x!==z){var L=function(e){var t=e.progress,i=Pi(D,E,t),r=Ci(w,j,t),s=Ci(x,z,t);u.updateCamera({longitude:i,latitude:r,fov:s},n,l),u.needsRender=!0},S=function(){return L({progress:1})};N>0?this.tweenCoordinates=zi(N,d).onUpdate(L).onComplete((function(){var e;null===(e=u.tweenCoordinates)||void 0===e||e.destroy(),delete u.tweenCoordinates,S()})):S()}var O=function(){u.panoCircleMeshes.forEach((function(e){e.visible=v.indexOf(e.panoIndex)>=0})),t.material.uniforms.opacity.value=0,t.material.depthTest=!0,p&&(u.scene.remove(p),p.material.uniforms.panoMap.value.dispose(),p.dispose()),u.updateCamera({offset:I},n,l);var r={progress:1,pano1Map:t.material.uniforms.panoMap.value,pano1Position:t.material.uniforms.panoPosition.value,pano1Matrix:t.material.uniforms.panoMatrix.value,pano0Map:t.material.uniforms.panoMap.value,pano0Position:t.material.uniforms.panoPosition.value,pano0Matrix:t.material.uniforms.panoMatrix.value,modelAlpha:0};u.boundingMesh.setMaterial(r),u.model.setMaterial(r),u.panoCircleMeshes[e]&&u.panoCircleMeshes[e].setProgress(0),i.moveEndCallback&&i.moveEndCallback(e,u.camera.copyPose()),u.currentPanoIndex=e,u.preventTapGesture=!1,Ke((function(){u.emit("panoArrived",e,u.camera.copyPose(),n),u.ready=!0})),u.needsRender=!0};this.preventTapGesture=!0,N>0&&M!==e?(this.panoCircleMeshes.forEach((function(e){return e.visible=!1})),t.material.depthTest=!1,p&&(p.material.depthTest=!1),this.tweenPosition=zi(N,d).onUpdate((function(i){var r=i.progress,s=new a.Vector3(Ci(T.x,I.x,r),Ci(T.y,I.y,r),Ci(T.z,I.z,r));u.updateCamera({offset:s},n,l);var o=(Math.min(Math.max(r,.1),.9)-.1)/.8,c={modelAlpha:Ci(1,0,o)};t.material.uniforms.opacity.value=Ci(0,1,o),p&&(p.material.uniforms.opacity.value=1),u.boundingMesh.setMaterial(c),u.model.setMaterial(c),u.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(s);e.setOpacity(Math.min(1.5/t,1))})),r>.7&&(u.preventTapGesture=!1),u.emit("movingToPano",e,A,r),u.needsRender=!0})).onComplete((function(){u.tweenPosition&&(u.tweenPosition.completed=!0,u.tweenPosition.destroy()),delete u.tweenPosition,O()})).onCancel((function(){i.moveCancelCallback&&i.moveCancelCallback(),u.emit("moveToPanoCanceled",e)}))):O()},i.prototype.getForwardPanoIndexOrNot=function(e){var t=this,i=this.camera,n=this.currentPanoIndex,r=this.work.observers[n].accessibleNodes;r=r.filter((function(e){var i=t.work.observers[e];return i.loadable||i.active}));var s,o=i.getWorldDirection(new a.Vector3);s=e?e.ray.direction.clone():o.clone();var u=i.pose.offset.clone();s.y=u.y=0;for(var c=0,l=r.filter((function(e){return t.work.observers[e].standingPosition.clone().sub(i.pose.offset).angleTo(o)<i.fov/2/180*Math.PI})).map((function(e){var i=t.work.observers[e].standingPosition.clone();return Object.assign(i,{y:0,panoIndex:e})})).sort((function(e,t){return e.distanceTo(u)-t.distanceTo(u)}));c<l.length;c++){var h=l[c],d=h.clone().sub(u);if(d.length()&&s.angleTo(d)<Math.PI/6)return h.panoIndex}return null},i.prototype.onTapGesture=function(e){var t=this;if(this.interiaMovement=!1,!0!==this.preventTapGesture){var i=this.camera,n=this.panoCircleMeshes,r=null,s=void 0,o=this.work.observers[this.currentPanoIndex].accessibleNodes;o=o.filter((function(e){return t.work.observers[e].position.distanceTo(i.pose.offset)<t.maxAccessibleDistance}));var u=this.relativeClientPosition(e.center),c=new a.Raycaster;c.setFromCamera(u,i);var l=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","tap",l,!0)||this.emit("wantsTapGesture",c,u))){var h=c.intersectObjects(this.boundingMesh.children)[0];if(h){var d=h.point.clone(),A=Wi(n.filter((function(e){return o.indexOf(e.panoIndex)>=0})),(function(e){return e.position.distanceTo(d)}),!0),p=A[0];if(A[1]<1){var M=h.point.clone();r=p.panoIndex;var f=i.getWorldDirection(new a.Vector3).setY(0),g=(new a.Vector3).copy(M).setY(0).sub(i.pose.offset.clone().setY(0));if(f.angleTo(g)>Math.PI/6){var y=g.x,v=g.z;s={longitude:Math.atan2(-y,-v)}}}}if(Ve(r)&&!Ve(r=this.getForwardPanoIndexOrNot(c))&&h){var m=h.point,N=this.work.observers[r].position.clone();f=m.clone().setY(0).sub(i.getWorldDirection(new a.Vector3).setY(0)),g=m.clone().setY(0).sub(N.clone().setY(0));if(Math.abs(m.y-N.y)<.5&&f.angleTo(g)>Math.PI/6&&f.angleTo(g)<Math.PI/3){y=g.x,v=g.z;s={longitude:Math.atan2(-y,-v)}}}if(Ve(r))this.canNotMoveAnimation();else{var D=this.work.observers[r];this.emit("panoSelected",r),this.emit("gesture","tap",l,!0),this.emit("tapGesture",c,u),D.active?this.emit("wantsMoveToPano",r,s||{},!0):this.panoCircleMeshes[r]&&(this.panoCircleMeshes[r].setDisabled(!1),this.panoCircleMeshes[r].setLoading(!0))}}}},i}(yn),yr=["Panorama","DepthPanorama","Model"],vr={Floorplan:tn,Topview:nn,Panorama:ir,VRPanorama:lr,Model:hr,DepthPanorama:gr};function mr(e){for(var t=0,i=yr;t<i.length;t++){var n=i[t];if("string"==typeof e){if(n===e)return!0}else if(e instanceof en&&e instanceof vr[n])return!0}return!1}var Nr=["cameraDirectionUpdate","cameraUpdate","cameraPositionUpdate","panoSelected","moveToPano","moveToPanoCanceled","panoWillArrive","movingToPano","panoArrived","panoWillLoad","panoLoaded","panoLoadError","initAnimationEnded","initAnimationWillStart","wantsGesture","gesture","wantsTapGesture","tapGesture","wantsPanGesture","wantsInteriaPan","panGesture","interiaPan","wantsPinchGesture","pinchGesture","wantsMouseWheel","mouseWheel","wantsShowIntersectionOnModel","intersectionOnModelUpdate","intersectionHidden","textureStartLoad","textureLoading","textureAbort","textureLoaded","textureError"];function Dr(e){for(var t,i,n={},r=0,s=e.split(/(\;|\,)/);r<s.length;r++){var o=s[r].split("="),a=null===(t=o[0])||void 0===t?void 0:t.trim(),u=null===(i=o[1])||void 0===i?void 0:i.trim();a&&u&&(n[a]=u)}return n}function wr(){for(var e,t=document.getElementsByTagName("meta"),i=0;i<t.length;i++){var n=t[i];if("viewport"===n.getAttribute("name")){var r=Dr(null!==(e=n.getAttribute("content"))&&void 0!==e?e:""),s=Number(r["initial-scale"]);if(!isNaN(s))return s}}return 1}var Tr=[351,63],xr=[20,20],Er=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),jr=new Float32Array([0,0,1,0,0,1,1,1]),Ir=new Uint8Array([0,1,2,1,3,2]),zr=new a.BufferGeometry;zr.setAttribute("position",new a.BufferAttribute(Er,3)),zr.setAttribute("uv",new a.BufferAttribute(jr,2)),zr.setIndex(new a.BufferAttribute(Ir,1));var br=new a.MeshBasicMaterial({transparent:!0,depthTest:!1}),Lr=new a.Mesh(zr,br),Sr=new a.Scene;Sr.add(Lr);var Or=new a.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Or.position.set(0,0,.5),Or.lookAt(0,0,0);var Cr=new a.Vector4,Pr=new a.Vector4;function kr(e){if(br.map){var t=e.getViewport(Cr),i=e.getScissor(Pr),n=e.getScissorTest(),r=e.autoClear;e.setViewport(i.x+xr[0]/3,i.y+xr[1]/3,Tr[0]/3,Tr[1]/3),e.setScissor(i.x+xr[0]/3,i.y+xr[1]/3,Tr[0]/3,Tr[1]/3),e.setScissorTest(!0),e.autoClear=!1,e.render(Sr,Or),e.setViewport(t),e.setScissor(i),e.setScissorTest(n),e.autoClear=r}else{var s=new a.Texture,o=new Image;o.onload=function(){s.image=o,s.wrapS=a.ClampToEdgeWrapping,s.wrapT=a.ClampToEdgeWrapping,s.minFilter=a.LinearFilter,s.needsUpdate=!0,br.needsUpdate=!0,o.onload=function(){}},o.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK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cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==",br.map=s}}var Br=new a.Box3(new a.Vector3(-50,-50,-50),new a.Vector3(50,50,50)),Ur=new a.Vector2,Qr=new a.Frustum,_r=new a.Matrix4,Rr=new a.Clock,Yr=new WeakMap,Fr=function(e){function i(t){var i,n,r,s,o,u,c,l,h,d,A,p,M,f,g;void 0===t&&(t={});var y=e.call(this)||this;if(y.ident=qe(),y.panoIndex=0,y.needsRender=!1,y.onlyRenderIfNeeds=null===(i=t.onlyRenderIfNeeds)||void 0===i||i,y.maxFps=null!==(n=t.maxFps)&&void 0!==n&&n,y.imageOptions=t.imageOptions||{},y.textureOptions=t.textureOptions||y.imageOptions||{},y.poweredByRealsee=null===(r=t.poweredByRealsee)||void 0===r||r,y.extraElements=[],y.controllerInits={Panorama:null!==(s=t.panorama)&&void 0!==s?s:{},Model:null!==(o=t.model)&&void 0!==o?o:{},Floorplan:null!==(u=t.floorplan)&&void 0!==u?u:{},Topview:null!==(c=t.topview)&&void 0!==c?c:{},DepthPanorama:null!==(l=t.depthPanorama)&&void 0!==l?l:{},VRPanorama:null!==(h=t.vrPanorama)&&void 0!==h?h:{}},y.modeChangeDuration=null!==(d=t.modeChangeDuration)&&void 0!==d?d:1e3,y.panoramaLikeSavedPose={},"undefined"!=typeof window)if(t.renderer)t.renderer instanceof Fe&&y.throwError(new Error("cannot render a internal renderer")),y.renderer=t.renderer;else try{y.renderer=new Fe({preserveDrawingBuffer:t.preserveDrawingBuffer,backgroundColor:t.backgroundColor,backgroundAlpha:t.backgroundAlpha,antialias:t.antialias});var v=wr();y.renderer.setPixelRatio(1===v?window.devicePixelRatio:1),y.renderer.setSize(512,512)}catch(e){e instanceof Error&&y.throwError(e)}y.getPixelsRenderTarget=new a.WebGLRenderTarget(1,1,{encoding:null!==(p=null===(A=y.renderer)||void 0===A?void 0:A.outputEncoding)&&void 0!==p?p:a.sRGBEncoding}),y.scissor=Object.assign({left:0,bottom:0,width:1,height:1},t.scissor),y.camera=new Re(80),y.scene=new Ye,y.lastLoadWorkTask=Promise.resolve(),y.networkSubscribe=new Pt,y.networkSubscribe.on("network",(function(e,t,i){var n;y.emit("network",e,t,i),null===(n=y.analysis)||void 0===n||n.network(y.work,e,t,i)})),y.model=new Ti({allowHosts:[],networkSubscribe:y.networkSubscribe});var m=Mt(Br);if(y.model.add(m),y.model.visible=!1,y.model.name="model_empty",y.model.empty=!0,y.model.loaded=!1,y.readyCallbacks=[],y.modelPending=!1,y.scene.add(y.model),y.helperGroup=new a.Group,y.helperGroup.name="helper",y.scene.add(y.helperGroup),y.videoTexture=new a.VideoTexture(t.videoInstance||function(){var e=document.createElement("video");e.loop=!0,e.autoplay=!0,e.playsInline=!0,e.muted=!0,e.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),e.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),e}()),y.plugins={},t.plugins)for(var N=0,D=t.plugins;N<D.length;N++){var w=D[N];if("function"==typeof w)w(y);else if(Array.isArray(w)){var T=w[0],x=w[1],E=w[2],j=T(y,E);"string"==typeof x&&(y.plugins[x]&&y.throwError(new Error("plugin name "+x+" is exists.")),y.plugins[x]=j)}}return function(e){(t=new a.DirectionalLight(16777215,.5)).position.copy(new a.Vector3(1,1,1)),e.add(t);var t=new a.DirectionalLight(16777215,.3);e.add(t),t=new a.AmbientLight(16777215,.3),e.add(t)}(y.scene),y.state={mode:null!==(M=y.currentMode)&&void 0!==M?M:"Panorama",panoIndex:null!==(f=y.panoIndex)&&void 0!==f?f:0,longitude:y.camera.pose.longitude,latitude:y.camera.pose.latitude,fov:y.camera.pose.fov,offset:y.camera.pose.offset.clone()},y.stateSynced=!1,y.destroyed=!1,y.paused=!0,"undefined"!=typeof window&&(!1!==t.play&&y.play(),!1!==(null!==(g=t.initialBasisLoader)&&void 0!==g&&g)&&("string"==typeof t.initialBasisLoader?y.initBasisLoader(t.initialBasisLoader):y.initBasisLoader()),Je((function(){return y.syncState()}))),y}return t.__extends(i,e),i.prototype.dispose=function(){if(!0!==this.destroyed){this.emit("dispose"),this.destroyed=!0,this.pause(),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var e=this.getElement();e&&e.parentNode&&e.parentNode.removeChild(e),this.scene.remove(this.model);var t=this.model.getMaterial();t&&(t.pano0Map&&t.pano0Map.dispose(),t.pano1Map&&t.pano1Map!==t.pano0Map&&t.pano1Map.dispose()),this.renderer instanceof Fe&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},i.prototype.setScissor=function(e){Object.assign(this.scissor,e),this.controller&&this.controller.resize&&this.controller.resize()},Object.defineProperty(i.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpersVisibleChange",e),this.needsRender=!0)},enumerable:!1,configurable:!0}),i.prototype.appendTo=function(e,t){if(void 0===t&&(t={}),this.renderer)if(this.renderer instanceof Fe){var i=this.getElement();if(i){e.appendChild(i),this.refresh(t);var n=window.getComputedStyle(e).position;"relative"!==n&&"absolute"!==n&&"fixed"!==n&&"sticky"!==n&&(e.style.position="relative")}}else this.throwError(new Error("cannot call appendTo method when render a external renderer"))},i.prototype.refresh=function(e,t){if(void 0===e&&(e={}),this.renderer){var i=this.getElement();if(i){var n=i.parentNode;if(n&&n.nodeName){var r=e.width,s=void 0===r?n.offsetWidth:r,o=e.height,u=void 0===o?n.offsetHeight:o;this.renderer instanceof Fe&&(t&&this.renderer.setPixelRatio(t),this.renderer.setSize(s,u))}var c=this.renderer.getSize(new a.Vector2);this.camera.aspect=c.x/c.y,this.scissor&&(this.camera.aspect*=this.scissor.width/this.scissor.height),this.camera.updateProjectionMatrix(),this.controller&&this.controller.resize&&this.controller.resize(),this.needsRender=!0}}},i.prototype.addExtraElement=function(e){var t=this;return-1===this.extraElements.indexOf(e)&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return t.removeExtraElement(e)}},i.prototype.removeExtraElement=function(e){var t=this.extraElements.indexOf(e);-1!==t&&(this.extraElements.splice(t,1),this.controller&&this.controller.unbindExtraElement(e))},i.prototype.getPose=function(){return this.camera.copyPose()},i.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},i.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},i.prototype.updateCamera=function(e,t,i){var n=this;return void 0===i&&(i=!0),new Promise((function(r,s){if(n.controller){var o=n.getPose(),u=o.longitude,c=o.latitude,l=o.fov,h=o.offset,d=e.longitude,A=void 0===d?u:d,p=e.latitude,M=void 0===p?c:p,f=e.fov,g=void 0===f?l:f,y=e.offset,v=void 0===y?h.clone():y;!1===i&&(n.state.longitude=A,n.state.latitude=M,n.state.fov=g,n.state.offset=v);n.controller.tweenCoordinates&&(n.controller.tweenCoordinates.destroy(),delete n.controller.tweenCoordinates),n.tweenCoordinates&&(n.tweenCoordinates.destroy(),delete n.tweenCoordinates);var m=n.tweenCoordinates=zi(t,ji.Linear.None).onUpdate((function(e){var t,r=e.progress,s=Pi(u,A,r),o=Ci(c,M,r),d=Ci(l,g,r),p=new a.Vector3(Ci(h.x,v.x,r),Ci(h.y,v.y,r),Ci(h.z,v.z,r));null===(t=n.controller)||void 0===t||t.updateCamera({longitude:s,latitude:o,fov:d,offset:p},i,!0)})).onCancel((function(){for(var e=0,t=D;e<t.length;e++){(0,t[e])()}delete n.tweenCoordinates,s(new Error("updateCamera animation canceled"))})).onComplete((function(){for(var e=0,t=D;e<t.length;e++){(0,t[e])()}m.destroy(),delete n.tweenCoordinates,r()})),N=function(){return m.destroy()},D=[n.on("gesture",N),n.on("load",N)]}else{var w=new Error("controller never initialized");s(w)}}))},i.prototype.getLongitudeAndLatitude=function(){var e=this.getPose();return{longitude:e.longitude,latitude:e.latitude}},i.prototype.getOffset=function(){return this.getPose().offset},i.prototype.getCameraLocal=function(){if("number"==typeof this.panoIndex&&this.controller&&this.work){var e=this.work.observers[this.panoIndex],t=new a.Object3D;return t.position.copy(e.position),t.quaternion.copy(e.quaternion),t.scale.set(1,1,1),t.updateMatrixWorld(!0),function(e,t){var i=new a.Vector3(0,0,-1);i.applyQuaternion(e.quaternion);var n=t.quaternion.clone().inverse();return i.applyQuaternion(n),{theta:Math.atan2(i.x,-i.z),phi:-Math.asin(i.y),lookAtVector:i}}(this.camera,t)}},i.prototype.initBasisLoader=function(e){try{if(!this.renderer)throw new Error("renderer is not initialized.");if("undefined"==typeof Promise||"undefined"==typeof WeakMap||"undefined"==typeof WebAssembly)throw new Error("Basis loader not support.");"string"==typeof e&&$t.setTranscoderPath(e),$t.workerConfig.format||$t.detectSupport(this.renderer),$t._allocateWorker(0)}catch(e){e instanceof Error&&this.throwError(e)}},Object.defineProperty(i.prototype,"work",{get:function(){var e=Yr.get(this);if(e&&Vi.get(e))return e},enumerable:!1,configurable:!0}),i.prototype.load=function(e,t,i,n){var r=this;if(void 0===n&&(n=!0),!this.renderer)throw new Error("renderer is not initialized");var s=this.lastLoadWorkTask.then((function(){return!(s=e)||"object"!=typeof s&&"function"!=typeof s||"function"!=typeof s.then?r.load_(e,t,i,n):e.then((function(e){return r.load_(e,t,i,n)}));var s}));return this.lastLoadWorkTask=s.catch((function(e){r.throwError(e)})),s},i.prototype.load_=function(e,n,r,s){var o,a,u,c,l,h,d,A,p,M=this;void 0===s&&(s=!0);var f,g,y,v=Gi(e),m=this.work;void 0===n&&(n=m?"inherit":"initial"),"inherit"===n?(f="number"==typeof this.panoIndex&&v.observers[this.panoIndex]?this.panoIndex:v.initial.panoIndex,g=null!==(o=this.currentMode)&&void 0!==o?o:v.initial.mode,y={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):"initial"===n?(g=null!==(a=this.currentMode)&&void 0!==a?a:v.initial.mode,f=v.initial.panoIndex,y=g===i.Mode.Panorama||g===i.Mode.DepthPanorama||g===i.Mode.Model||g===i.Mode.VRPanorama?{longitude:v.initial.longitude,latitude:v.initial.latitude,fov:v.initial.fov}:{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):(f=null!==(u=n.panoIndex)&&void 0!==u?u:v.initial.panoIndex,g=null!==(l=null!==(c=n.mode)&&void 0!==c?c:this.currentMode)&&void 0!==l?l:"Panorama",y={longitude:null!==(h=n.longitude)&&void 0!==h?h:v.initial.longitude,latitude:null!==(d=n.latitude)&&void 0!==d?d:v.initial.latitude,fov:null!==(A=n.fov)&&void 0!==A?A:v.initial.fov}),this.emit("willLoad",e,v,{panoIndex:f,mode:g,longitude:y.longitude,latitude:y.latitude,fov:y.fov});var N=function(){var i;Yr.set(M,v),M.panoIndex=f,M.panoramaLikeSavedPose.longitude=v.initial.longitude,M.panoramaLikeSavedPose.latitude=v.initial.latitude,M.panoramaLikeSavedPose.fov=v.initial.fov;var n=null!=r?r:void 0===m?0:M.modeChangeDuration,o={panoIndex:f,longitude:y.longitude,latitude:y.latitude,fov:y.fov},a=t.__assign(t.__assign({panoIndex:f,initial:[{longitude:y.longitude,latitude:y.latitude,fov:y.fov},n,s]},M.commonParams()),M.controllerInits[g]);M.controller?!1===M.controller.updateWork(v,o,n,!0)&&(M.controller.destroy(),M.controller=M.applyController(g,a)):M.controller=M.applyController(g,a),M.emit("load",e,v,{panoIndex:f,mode:g,longitude:y.longitude,latitude:y.latitude,fov:y.fov}),null===(i=M.analysis)||void 0===i||i.work(v)},D=function(e){var t,i;void 0===e&&(e=He),v.model&&((null===(t=null==m?void 0:m.model)||void 0===t?void 0:t.file)!==(null===(i=v.model)||void 0===i?void 0:i.file)?(M.emit("modelWillLoad",v.model),M.loadModel(v.model,v.allowHosts,e,!0)):e&&(!0===M.model.loaded?e():M.once("modelLoaded",(function(){return e()}))))};return g===i.Mode.Floorplan||g===i.Mode.Topview||g===i.Mode.Model?D((function(){N(),M.needsRender=!0})):(N(),null===(p=this.controller)||void 0===p||p.once("panoLoaded",(function(){M.needsRender=!0,D()}))),this.ready()},i.prototype.changeMode=function(e,n,r,s){var o=this;if(void 0===n&&(n={}),void 0===r&&(r=this.modeChangeDuration),void 0===s&&(s=!0),!this.renderer)throw new Error("renderer is not initialized.");return new Promise((function(a,u){var c;if(!i.Mode.hasOwnProperty(e)){var l=new Error('mode "'+e+'" is not existed');return o.throwError(l),void u(l)}if(e!==i.Mode.Floorplan&&e!==i.Mode.Topview&&e!==i.Mode.Model||!Ve(o.model)&&!0===o.model.loaded){if(Ve(o.controller))return o.currentMode=e,o.panoIndex=null!==(c=n.panoIndex)&&void 0!==c?c:o.panoIndex,o.updateCamera(n,r);var h=o.controller,d=o.currentMode,A=function(){var c,l,A,p;if(o.emit("wantsChangeMode",e,d))u(new Error("change mode canceled."));else{if(o.controller&&d===e)e===i.Mode.Panorama||e===i.Mode.DepthPanorama||e===i.Mode.Model||e===i.Mode.VRPanorama?"number"==typeof n.panoIndex&&n.panoIndex!==o.panoIndex?o.controller.moveToPano(null!==(l=null!==(c=n.panoIndex)&&void 0!==c?c:o.panoIndex)&&void 0!==l?l:0,t.__assign({duration:r},n),s):o.updateCamera(n,r,s).catch((function(){})):("number"==typeof n.panoIndex&&n.panoIndex!==o.panoIndex&&(o.panoIndex=o.controller.currentPanoIndex=n.panoIndex),o.updateCamera(n,r,s).catch((function(){})));else{h.destroy();var M=t.__assign(t.__assign({panoIndex:null!==(p=null!==(A=n.panoIndex)&&void 0!==A?A:o.panoIndex)&&void 0!==p?p:0,initial:[mr(e)?o.panoramaLikeSavedPose:n,r,s]},o.commonParams()),o.controllerInits[e]);o.saveControllerPose(h),o.controller=o.applyController(e,M),o.controller.once("initAnimationWillStart",(function(t,i){o.emit("modeChange",e,d,t,i)})),o.emit("currentStateChange",o.getCurrentState(),s)}a()}};e===i.Mode.VRPanorama?("undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((function(e){if("granted"==e)return Promise.resolve();var t=new Error("Request DeviceOrientation Permission denied.");return Promise.reject(t)})):Promise.resolve()).then((function(){return A()})).catch((function(e){e instanceof Error&&(o.throwError(e),u(e))})):A()}else{l=new Error("model is not ready.");o.throwError(l)}}))},i.prototype.getPixels=function(e,t,i,n,r){if(void 0===r&&(r=1),!this.renderer)throw new Error("renderer is not initialized.");var s=this.getPixelsRenderTarget,o=this.renderer.getSize(new a.Vector2);e=Math.min(Math.max(e,Math.floor(i/2)),Math.floor(o.x-i)),t=Math.min(Math.max(t,Math.floor(n/2)),Math.floor(o.y-n)),e*=r,t*=r,i*=r,n*=r,s.setSize(o.x*r,o.y*r),s.scissor.set(e,t,i,n),s.scissorTest=!0,this.renderer.setRenderTarget(s);var u=new Uint8Array(i*n*4);return this.controller?this.controller.render(Rr.getDelta()):this.renderer.render(this.scene,this.camera),this.renderer.readRenderTargetPixels(s,e,t,i,n,u),this.renderer.setRenderTarget(null),s.setSize(1,1),s.scissor.set(0,0,0,0),s.scissorTest=!1,u},i.prototype.getElement=function(){var e;return null===(e=this.renderer)||void 0===e?void 0:e.domElement},i.prototype.pause=function(){},i.prototype.render=function(e,t){var i=this;if(void 0===t&&(t=!1),this.renderer){if(t){var n=this.renderer.getSize(new a.Vector2);this.scene.traverseVisible((function(e){e.setResolution&&e.setResolution(n.x,n.y)}))}if(this.screenBuffer&&null===this.renderer.getRenderTarget()){var r=this.getDrawingBufferSize(Ur);this.screenBuffer.setSize(r.x,r.y),this.renderer.setRenderTarget(this.screenBuffer),this.controller?this.controller.render(Rr.getDelta()):this.renderer.render(this.scene,this.camera),this.poweredByRealsee&&kr(this.renderer),this.renderer.setRenderTarget(null);var s=xi(this.renderer.getContext());s&&this.throwError(s),e&&Ke(e)}else this.aroundScissor((function(){if(i.renderer){i.controller?i.controller.render(Rr.getDelta()):i.renderer.render(i.scene,i.camera),i.poweredByRealsee&&kr(i.renderer);var t=xi(i.renderer.getContext());t&&i.throwError(t)}e&&Ke(e)}))}},i.prototype.play=function(){var e=this;if(this.pause(),this.needsRender=!0,this.renderer){var t=Ze(),n=Ze(),r=0;this.paused=!1;var s=Je((function(){var s,o;if(!0!==e.paused&&!e.destroyed&&e.renderer){var u=Ze();if(e.maxFps){if(u-t+1<=1e3/e.maxFps)return;t=u}var c=e.renderer.getSize(new a.Vector2),l=[];_r.multiplyMatrices(e.camera.projectionMatrix,e.camera.matrixWorldInverse),Qr.setFromProjectionMatrix(_r),e.scene.traverse((function(e){e.setResolution&&e.setResolution(c.x,c.y),e.mixer instanceof a.AnimationMixer&&e.mixer.update(Rr.getDelta()),(e instanceof a.Mesh||e instanceof a.Line||e instanceof a.Points)&&(e instanceof a.ImmediateRenderObject||!e.frustumCulled||Qr.intersectsObject(e))&&l.push(e)}));var h=!1;if(e.currentMode!==i.Mode.VRPanorama&&e.onlyRenderIfNeeds){for(var d=0,A=l;d<A.length;d++){var p=A[d],M=function(t){!0===t.needsRender?(t.needsRender=!1,e.needsRender=!0):t.mixer&&t.mixer.stats.actions.inUse>0&&(e.needsRender=!0)};M(p),p.traverseAncestors(M)}e.controller&&!0===e.controller.needsRender&&(e.controller.needsRender=!1,e.needsRender=!0),!1!==e.needsRender&&(e.render(),h=!0)}else e.render(),h=!0;if(e.needsRender=!1,e.screenBuffer&&null===e.renderer.getRenderTarget()&&(null===(s=e.controller)||void 0===s?void 0:s.postProcessing)){var f=null===(o=e.controller)||void 0===o?void 0:o.postProcessing;e.aroundScissor((function(){return f(e.screenBuffer,Rr.getDelta())}))}e.hasListener("renderFrame")&&e.emit("renderFrame",h),e.hasListener("fps")&&(n&&u-n<1e3?r++:(n&&e.emit("fps",r),n=u,r=0))}}));this.pause=function(){e.paused=!0,s(),e.renderer&&e.renderer instanceof Fe&&e.renderer.clear(!0,!0,!0)}}},i.prototype.moveToPano=function(e,t,n){var r;if(void 0===t&&(t={}),void 0===n&&(n=!0),!this.renderer)throw new Error("renderer is not initialized.");var s=this.moveToPanoQueue=this.moveToPanoQueue||[],o=this.controller,a=this.currentMode;if(o)if(a===i.Mode.Floorplan||a===i.Mode.Topview)s.length=0,delete s.dequeue,Ve(e)||(this.panoIndex=e,this.changeMode(i.Mode.Panorama,t));else{if((null===(r=this.controller)||void 0===r?void 0:r.tweenPosition)||(s.length=0,delete s.dequeue),s.push([e,t,n]),s.length>2&&(s.length=2),s.dequeue)return;var u=function(){if(0!==s.length){var e=s.shift(),t=e[0],i=e[1],n=void 0===i?{}:i,r=e[2],a=Object.assign({},n);a.moveEndCallback=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return n.moveEndCallback&&(e=n.moveEndCallback.apply(this,t)),setTimeout(u),e},a.moveCancelCallback=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return n.moveCancelCallback&&(e=n.moveCancelCallback.apply(this,t)),setTimeout(u),e},o&&"moveToPano"in o&&Ke((function(){return o.moveToPano(t,a,r)}))}else delete s.dequeue};s.dequeue=!0,u()}},i.prototype.preloadPano=function(e,i){var n=this;if(void 0===i&&(i=He),!this.work)return Promise.reject(new Error("work never loaded"));var r=this.work.observers[e],s=Ze();return Promise.all(["right","left","up","down","front","back"].map((function(i){var s=t.__assign({key:["cube",e,i].join("."),basisLoaderInitialized:$t.isInitialized()},n.imageOptions);return function(e,t){return void 0===t&&(t={}),e in Bt?Bt[e]:Bt[e]=new Promise((function(i){var n=document.createElement("link");n.href=e,n.rel="preload",n.as="fetch";var r=Ze(),s=document.head||document.getElementsByTagName("head")[0];s&&s.appendChild(n),n.onload=function(){var n;i();var s=Ze(),o={source:e,requestTime:r,responseTime:s,costs:s-r,headers:{}};null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"preload",JSON.stringify(o))}}))}(Ut(r.images[i],s),{networkSubscribe:n.networkSubscribe})}))).then((function(){var e=Ze()-s;return i(e),e}))},i.prototype.project2d=function(e,t){if(void 0===t&&(t=!1),!this.renderer)return null;if(!1===this.model.empty&&t){var i=this.camera.position,n=e.clone().sub(i),r=new a.Raycaster(i,n.clone().normalize()),s=this.model.intersectRaycaster(r)[0];if(s&&s.distance+.01<n.length())return null}var o=e.clone().project(this.camera);if(Math.abs(o.z)>1)return null;var u=this.renderer.getSize(new a.Vector2),c=u.x*this.scissor.width,l=u.y*this.scissor.height,h=u.x*this.scissor.left+(o.x+1)/2*c,d=u.y*(1-this.scissor.bottom-this.scissor.height)+(1-o.y)/2*l;return new a.Vector2(h,d)},i.prototype.getRenderObjects=function(e){_r.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Qr.setFromProjectionMatrix(_r),e||(e=this.scene);var t=[];return e.traverseVisible((function(e){(e instanceof a.Mesh||e instanceof a.Line||e instanceof a.Points)&&(e instanceof a.ImmediateRenderObject||!e.frustumCulled||Qr.intersectsObject(e))&&t.push(e)})),t},i.prototype.getCurrentState=function(){return t.__assign(t.__assign({},this.camera.copyPose()),{mode:this.currentMode||i.Mode.Panorama,panoIndex:this.panoIndex||0})},i.prototype.setState=function(e,n,r){var s,o,u,c,l,h,d;void 0===n&&(n=!1),void 0===r&&(r=!0),!(e=Object.assign({},e)).offset||e instanceof a.Vector3||(e.offset=new a.Vector3(e.offset.x,e.offset.y,e.offset.z));var A,p,M,f,g=null!==(s=e.panoIndex)&&void 0!==s?s:this.state.panoIndex,y=null!==(o=e.mode)&&void 0!==o?o:this.state.mode;if(e.mode!==i.Mode.Floorplan&&e.mode!==i.Mode.Topview&&e.mode!==i.Mode.Model||!Ve(this.model)&&!0===this.model.loaded){if(this.state.mode!==y){var v=void 0;v=mr(this.state.mode)&&mr(y)?this.state:mr(y)?this.panoramaLikeSavedPose:e;var m=t.__assign(t.__assign({panoIndex:g,initial:[v,this.modeChangeDuration,!1]},this.commonParams()),this.controllerInits[y]),N=vr[y].initAnimationEndPose(m);A=N.longitude,p=N.latitude,M=N.fov,f=N.offset}else A=null!==(u=e.longitude)&&void 0!==u?u:this.state.longitude,p=null!==(c=e.latitude)&&void 0!==c?c:this.state.latitude,M=null!==(l=e.fov)&&void 0!==l?l:this.state.fov,f=null!==(h=e.offset)&&void 0!==h?h:this.state.offset;this.emit("setState",{longitude:A,latitude:p,fov:M,offset:f,mode:y,panoIndex:g}),(g!==this.state.panoIndex||y!==this.state.mode||Math.abs(A-this.state.longitude)>.001||Math.abs(p-this.state.latitude)>.001||Math.abs(M-this.state.fov)>.001||f.distanceTo(this.state.offset)>.001)&&(this.state.panoIndex=g,this.state.mode=y,this.state.longitude=A,this.state.latitude=p,this.state.fov=M,this.state.offset.copy(f),n&&this.syncState(n),this.emit("stateChange",this.state,r),null===(d=this.analysis)||void 0===d||d.state(this.work,this.state))}else this.throwError(new Error("model is not ready."))},i.prototype.aroundScissor=function(e){if(this.renderer){var t=new a.Vector2,i=0!==this.scissor.left||0!==this.scissor.bottom||1!==this.scissor.width||0!==this.scissor.height;if(i){this.renderer.getSize(t);var n=Math.floor(t.x*this.scissor.left),r=Math.floor(t.y*this.scissor.bottom),s=Math.floor(t.x*this.scissor.width),o=Math.floor(t.y*this.scissor.height);this.renderer.setViewport(n,r,s,o),this.renderer.setScissor(n,r,s,o),this.renderer.setScissorTest(!0)}e(),i&&(this.renderer.setViewport(0,0,t.x,t.y),this.renderer.setScissor(0,0,t.x,t.y),this.renderer.setScissorTest(!1))}},i.prototype.syncState=function(e){if(void 0===e&&(e=!1),this.controller&&!1!==this.controller.ready&&!0!==this.controller.gesturing&&!this.tweenCoordinates){if(this.readyCallbacks.length){var t=this.currentMode;if(!(t===i.Mode.Floorplan||t===i.Mode.Topview||t===i.Mode.Model)||!this.modelPending)for(var n=void 0;n=this.readyCallbacks.shift();)n()}var r=this.stateSynced;if(this.stateSynced=!1,this.state.mode===this.currentMode){if(this.controller instanceof vr.Model){if(!this.camera.pose.offset.equals(this.state.offset)){var s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return void this.controller.moveToPosition(this.state.offset,s,!1)}}else if(this.state.panoIndex!==this.panoIndex){s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return void this.controller.moveToPano(this.state.panoIndex,s,!1)}if(this.controller instanceof vr.Topview){var o=e?new a.Vector3(this.state.offset.x,this.state.offset.y,this.state.offset.z):new a.Vector3(ki(this.camera.pose.offset.x,this.state.offset.x,.2),ki(this.camera.pose.offset.y,this.state.offset.y,.2),ki(this.camera.pose.offset.z,this.state.offset.z,.2));if(!this.camera.pose.offset.equals(o))return void this.controller.updateCamera({offset:o},!1,!1)}else{var u=Math.PI/45,c=e?this.state.fov:ki(this.camera.pose.fov,this.state.fov,1),l=e?{longitude:this.state.longitude,latitude:this.state.latitude}:function(e,t,i){if(e.longitude===t.longitude&&e.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var n=Li(e.longitude),r=e.latitude,s=Li(t.longitude),o=t.latitude;s-n>Si?n+=Oi:n-s>Si&&(n-=Oi);var a=i/Math.sqrt(Math.pow(s-n,2)+Math.pow(o-r,2));return a>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:n+(s-n)*a,latitude:r+(o-r)*a}}({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},u),h=l.longitude,d=l.latitude;if(c!==this.camera.pose.fov||h!==this.camera.pose.longitude||d!==this.camera.pose.latitude)return this.controller.tweenCoordinates&&(this.controller.tweenCoordinates.destroy(),delete this.controller.tweenCoordinates),void this.controller.updateCamera({longitude:h,latitude:d,fov:c},!1,!1)}this.stateSynced=!0,!1===r&&this.emit("stateSynced",this.state)}else{var A={panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};this.changeMode(this.state.mode,A,this.modeChangeDuration,!1)}}},i.prototype.ready=function(){var e=this;return new Promise((function(t){return e.readyCallbacks.push(t)}))},i.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},i.prototype.loadModel=function(e,t,n,r){var s=this,o=e.async||!1;this.emit("modelWillLoad",e);var a=new Ti({allowHosts:t,networkSubscribe:this.networkSubscribe});a.once("bvhLoaded",(function(){s.emit("modelBvhLoaded",a)})),a.once("geometryLoaded",(function(){s.emit("modelGeometryLoaded",a)})),a.on("error",(function(e){s.emit("modelLoadError",e,a),s.throwError(e),s.modelPending=!1})),a.on("shownFloorChange",(function(e,t){s.emit("modelShownFloorChange",e,t)})),a.once("loaded",(function(){var t;if(!s.destroyed){a.bounding.max.y-a.bounding.min.y<1.5&&(a.bounding.max.y=a.bounding.min.y+10);var u,c=s.model;c&&(c.show(),u=c.getMaterial()||{},s.scene.remove(c),c.dispose(),a.setTransparent(c.getTransparent())),s.model=Object.assign(a,{loaded:!0}),null===(t=s.controller)||void 0===t||t.resetModel(s.model,r),u&&s.model.setMaterial(u),c&&s.currentMode!==i.Mode.Panorama&&(o=!1);var l=function(){n(),s.emit("modelLoaded",a),Ke((function(){return s.emit("modelMaterialLoaded",a)})),e.bvh&&Gt((function(){return a.buildBVH()})),"function"==typeof gc&&gc(),s.needsRender=!0,s.modelPending=!1};if(o){var h=[].concat(s.model.children);s.model.children.length=0;var d=Mt(Br);d.name="uniformKeeper",d.visible=!1,d.setMaterial(u||{}),s.model.add(d),s.scene.add(s.model);var A=function(){Gt((function(){var e=h.shift();e?(s.model.setMaterial.call(e,s.model.getMaterial()||{}),s.model.add(e),null===s.model.shownFloor?s.model.show():s.model.show(s.model.shownFloor),Ke(A,2)):(s.model.remove(d),l())}))};A()}else c?(s.scene.add(s.model),l()):Gt((function(){s.scene.add(s.model),l()}))}})),this.modelPending=!0,a.load(e,this.textureOptions)},i.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,helper:this.helperGroup,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),model:this.model,work:this.work,imageOptions:this.imageOptions,extraElements:this.extraElements,videoTexture:this.videoTexture,networkSubscribe:this.networkSubscribe}},i.prototype.saveControllerPose=function(e){void 0===e&&(e=this.controller),e&&mr(e)&&(this.panoramaLikeSavedPose.longitude=this.camera.pose.longitude,this.panoramaLikeSavedPose.latitude=this.camera.pose.latitude,this.panoramaLikeSavedPose.fov=this.camera.pose.fov)},i.prototype.applyController=function(e,n){var r=this;if(!this.renderer)throw new Error("renderer is not initialized.");var s=vr[e];e===this.currentMode||this.model.empty||this.model.show(),this.model.setTransparent(e===i.Mode.Floorplan||e===i.Mode.Topview||e===i.Mode.Model),this.currentMode=e;var o=new s(n);if(o.postProcessing){if(!this.screenBuffer){var u=this.getDrawingBufferSize(Ur);this.screenBuffer=new a.WebGLRenderTarget(u.x,u.y,{encoding:this.renderer.outputEncoding})}}else this.screenBuffer&&(this.screenBuffer.dispose(),delete this.screenBuffer);for(var c=function(e){o.on(e,(function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var s=r.emit.apply(r,t.__spreadArray([e],i,!1));if(s)return!1}))},l=0,h=Nr;l<h.length;l++){c(h[l])}if(!1===n.initial[2]){var d=vr[e].initAnimationEndPose(n);this.state.panoIndex=n.panoIndex,this.state.mode=e,this.state.longitude=d.longitude,this.state.latitude=d.latitude,this.state.fov=d.fov,this.state.offset=d.offset}return o.on("initAnimationWillStart",(function(t,i,n){var s;n&&(r.state.mode=e,r.state.panoIndex=t,r.state.longitude=i.longitude,r.state.latitude=i.latitude,r.state.fov=i.fov,r.state.offset.copy(i.offset),r.emit("stateChange",r.state,n),null===(s=r.analysis)||void 0===s||s.state(r.work,r.state))})),o.on("initAnimationEnded",(function(t,i,n){var s;n&&(r.state.mode=e,r.state.panoIndex=t,r.state.longitude=i.longitude,r.state.latitude=i.latitude,r.state.fov=i.fov,r.state.offset.copy(i.offset),r.emit("stateChange",r.state,n),null===(s=r.analysis)||void 0===s||s.state(r.work,r.state))})),o.on("moveToPano",(function(e,t){r.emit("currentStateChange",r.getCurrentState(),t)})),o.on("panoWillArrive",(function(e,t,i){var n;r.panoIndex=e,i&&(r.state.panoIndex=e,r.state.longitude=t.longitude,r.state.latitude=t.latitude,r.state.fov=t.fov,r.state.offset.copy(t.offset),r.emit("stateChange",r.state,i),null===(n=r.analysis)||void 0===n||n.state(r.work,r.state))})),o.on("panoArrived",(function(){"function"==typeof gc&&gc()})),o.on("wantsMoveToPano",(function(e,t,i){var n=r.emit("wantsMoveToPano",e,t,i);n||(n=r.emit("wantsToMoveToPano",e,t,i)),n||r.moveToPano(e,t,i)})),o.on("cameraUpdate",(function(e,t){var i;t&&r.state.mode===r.currentMode&&r.state.panoIndex===r.panoIndex&&(r.state.longitude=e.longitude,r.state.latitude=e.latitude,r.state.fov=e.fov,r.state.offset.copy(e.offset),r.emit("stateChange",r.state,t),null===(i=r.analysis)||void 0===i||i.state(r.work,r.state)),r.emit("currentStateChange",r.getCurrentState(),t)})),o.on("vrWantsToExit",(function(){r.currentMode===i.Mode.VRPanorama&&r.changeMode(i.Mode.Panorama)})),o.on("error",(function(e){return r.throwError(e)})),o},i.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",DepthPanorama:"DepthPanorama",VRPanorama:"VRPanorama"},i.Line=null,i.Easing=ji,i}(xt);exports.Camera=Re,exports.Easing=ji,exports.Five=Fr,exports.HashCubeTexture=ot,exports.InternalWebGLRenderer=Fe,exports.Model=Ti,exports.NetworkSubscribe=Pt,exports.PBMContainer=it,exports.PBMGroup=nt,exports.PBMMaterial=dt,exports.PBMMesh=tt,exports.PROXY_CONTROLLER_EVENT_NAMES=Nr,exports.Scene=Ye,exports.Subscribe=xt,exports.getViewportScale=wr,exports.parseWork=Gi,exports.stringifyWork=function(e){for(var t,i,n,r,s=e.workCode,o={pano_index:e.initial.panoIndex,pano:e.initial.panoIndex,longitude:e.initial.longitude,latitude:e.initial.latitude},a=null===(i=null===(t=e.model)||void 0===t?void 0:t.bvh)||void 0===i||i,u=null!==(r=null===(n=e.model)||void 0===n?void 0:n.async)&&void 0!==r&&r,c=e.model?{file_url:e.model.file,material_textures:e.model.textures.slice(),material_base_url:e.model.textureBase}:void 0,l={list:[]},h=[],d=0;d<e.observers.length;d++){var A=e.observers[d];h[d]={index:d,active:A.active,visible_nodes:A.visibleNodes.slice(),accessible_nodes:A.accessibleNodes.slice(),quaternion:{x:A.quaternion.x,y:A.quaternion.y,z:A.quaternion.z,w:A.quaternion.w},standing_position:A.standingPosition.toArray(),position:A.position.toArray(),floor:A.floorIndex,floor_index:A.floorIndex},l.list[d]={index:d,active:A.active,loadable:A.loadable,up:A.images.up,down:A.images.down,right:A.images.right,left:A.images.left,front:A.images.front,back:A.images.back},A.video&&(l.list[d].video={source:A.video.source,matrix:A.video.matrix.toArray(),size:A.video.size.toArray()}),A.images.depth&&(l.list[d].depth=A.images.depth),A.images.tiles&&(l.list[d].tiles=A.images.tiles)}var p={bvh:a,modelAsync:u,initial:o,observers:h,panorama:l,work_code:s};return c&&(p.model=c),JSON.stringify(p)};