@realsee/five 5.0.0-alpha.98 → 6.0.0-alpha.0

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 (197) hide show
  1. package/docs/assets/highlight.css +1 -1
  2. package/docs/assets/main.js +2 -2
  3. package/docs/assets/search.js +1 -1
  4. package/docs/assets/style.css +28 -2
  5. package/docs/classes/five.AnimationFrameLoop.html +5 -5
  6. package/docs/classes/five.BVH.html +2 -2
  7. package/docs/classes/five.BVHIntersect.html +1 -1
  8. package/docs/classes/five.BVHNode.html +2 -2
  9. package/docs/classes/five.BVHVector3.html +1 -1
  10. package/docs/classes/five.BoxBoundingVolume.html +1 -0
  11. package/docs/classes/five.Camera.html +6 -6
  12. package/docs/classes/five.Clipper.html +1 -0
  13. package/docs/classes/five.CullingVolume.html +1 -0
  14. package/docs/classes/five.Five.html +116 -83
  15. package/docs/classes/five.InternalWebGLRenderer.html +1 -1
  16. package/docs/classes/five.IntersectMesh.html +1 -1
  17. package/docs/classes/five.Model.html +37 -37
  18. package/docs/classes/five.NetworkSubscribe.html +22 -15
  19. package/docs/classes/five.PBMContainer.html +9 -11
  20. package/docs/classes/five.PBMGroup.html +2 -18
  21. package/docs/classes/five.PBMMaterialReferenceCache.html +1 -0
  22. package/docs/classes/five.PBMMesh.html +3 -5
  23. package/docs/classes/five.PBMMeshMaterial.html +41 -0
  24. package/docs/classes/five.PanoCircleMesh.html +4 -4
  25. package/docs/classes/five.PanoCircleMeshCustom.html +7 -0
  26. package/docs/classes/five.PanoCircleMeshSolid.html +7 -0
  27. package/docs/classes/five.RegionBoundingVolume.html +1 -0
  28. package/docs/classes/five.RequestScheduler.html +16 -0
  29. package/docs/classes/five.Scene.html +2 -2
  30. package/docs/classes/five.SphereBoundingVolume.html +1 -0
  31. package/docs/classes/five.Subscribe.html +24 -17
  32. package/docs/classes/five.TextureLoader.html +1 -0
  33. package/docs/classes/five.Tile.html +1 -0
  34. package/docs/classes/five.Tile3DModel.html +1 -0
  35. package/docs/classes/five.TileCubeTextureTarget.html +1 -0
  36. package/docs/classes/five.TileNode.html +1 -0
  37. package/docs/classes/five.Tileset.html +5 -0
  38. package/docs/classes/five.TilesetCache.html +1 -0
  39. package/docs/classes/five.TilesetTraverser.html +1 -0
  40. package/docs/classes/five.Work.html +21 -10
  41. package/docs/classes/five.XRButton.html +1 -0
  42. package/docs/classes/gltf_loader.DDSLoader.html +1 -0
  43. package/docs/classes/gltf_loader.DRACOLoader.html +1 -0
  44. package/docs/classes/gltf_loader.GLTFLoader.html +8 -8
  45. package/docs/classes/gltf_loader.GLTFObject.html +3 -3
  46. package/docs/classes/gltf_loader.GLTFParser.html +1 -0
  47. package/docs/classes/gltf_loader.THREEGLTFLoader.html +1 -0
  48. package/docs/classes/line.Line.html +1 -1
  49. package/docs/classes/line.LineGeometry.html +1 -1
  50. package/docs/classes/line.LineMaterial.html +1 -1
  51. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  52. package/docs/classes/line.THREE_Line2.html +1 -1
  53. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  54. package/docs/classes/react.Store.html +13 -13
  55. package/docs/classes/sticker.Sticker.html +9 -9
  56. package/docs/classes/vfx.Airflow.html +1 -0
  57. package/docs/classes/vfx.Flame.html +1 -0
  58. package/docs/classes/vfx.Particle.html +89 -0
  59. package/docs/classes/vfx.SpotLight.html +1 -0
  60. package/docs/enums/five.PBMPointColorType.html +1 -0
  61. package/docs/enums/five.PBMPointShapeType.html +1 -0
  62. package/docs/enums/five.PBMPointSizeType.html +1 -0
  63. package/docs/enums/five.VolumePlaneIntersect.html +1 -0
  64. package/docs/index.html +2 -2
  65. package/docs/interfaces/five.AddableObject.html +9 -1
  66. package/docs/interfaces/five.AnimationFrame.html +1 -1
  67. package/docs/interfaces/five.BoundingVolume.html +1 -0
  68. package/docs/interfaces/five.CameraPose.html +1 -1
  69. package/docs/interfaces/five.ClipperParameter.html +1 -0
  70. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +12 -14
  71. package/docs/interfaces/five.EventCallback.html +107 -113
  72. package/docs/interfaces/five.FiveInitArgs.html +39 -32
  73. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +9 -9
  74. package/docs/interfaces/five.ImageOptions.html +8 -6
  75. package/docs/interfaces/five.ImageURLMappings.html +1 -0
  76. package/docs/interfaces/five.ImageURLOptions.html +15 -1
  77. package/docs/interfaces/five.IntersectMeshInterface.html +2 -2
  78. package/docs/interfaces/five.Intersection.html +4 -4
  79. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +11 -0
  80. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +9 -11
  81. package/docs/interfaces/five.ModelEventCallback.html +7 -13
  82. package/docs/interfaces/five.ModelLodOptions.html +1 -0
  83. package/docs/interfaces/five.MotionKeyframe.html +1 -0
  84. package/docs/interfaces/five.MovePanoOptions.html +17 -14
  85. package/docs/interfaces/five.NetworkOptions.html +9 -0
  86. package/docs/interfaces/five.PBMPanoPicture.html +4 -4
  87. package/docs/interfaces/five.PBMParameters.html +32 -8
  88. package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +1 -0
  89. package/docs/interfaces/five.PanoCircleMeshInterface.html +15 -5
  90. package/docs/interfaces/five.PanoCircleMeshOptions.html +1 -0
  91. package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +1 -0
  92. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +19 -14
  93. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +9 -11
  94. package/docs/interfaces/five.Pose.html +9 -7
  95. package/docs/interfaces/five.Scissor.html +6 -6
  96. package/docs/interfaces/five.State.html +13 -9
  97. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -1
  98. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -1
  99. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -1
  100. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -1
  101. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -1
  102. package/docs/interfaces/five.SubscribeMixinType.waitUnitl.html +1 -0
  103. package/docs/interfaces/five.TextureOptions.html +9 -7
  104. package/docs/interfaces/five.Tile3DModelLoaderOptions.html +3 -0
  105. package/docs/interfaces/five.TileCubeNode.html +1 -0
  106. package/docs/interfaces/five.TileCubeTree.html +1 -0
  107. package/docs/interfaces/five.TileHeader.html +1 -0
  108. package/docs/interfaces/five.TilesetHeader.html +1 -0
  109. package/docs/interfaces/five.TilesetOptions.html +1 -0
  110. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +6 -4
  111. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +17 -15
  112. package/docs/interfaces/five.WebXRControllerParams.html +1 -0
  113. package/docs/interfaces/five.WorkCubeImage.html +7 -7
  114. package/docs/interfaces/five.WorkImage.html +11 -11
  115. package/docs/interfaces/five.WorkInitial.html +13 -9
  116. package/docs/interfaces/five.WorkModel.html +7 -7
  117. package/docs/interfaces/five.WorkObserver.html +21 -15
  118. package/docs/interfaces/five.WorkOptions.html +15 -0
  119. package/docs/interfaces/five.WorkTile.html +1 -1
  120. package/docs/interfaces/five.WorkVideo.html +5 -5
  121. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +29 -0
  122. package/docs/interfaces/gltf_loader.DDS.html +1 -0
  123. package/docs/interfaces/gltf_loader.GLTF.html +2 -2
  124. package/docs/interfaces/gltf_loader.GLTFReference.html +1 -0
  125. package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -0
  126. package/docs/interfaces/react.FiveActionReactCallbacks.html +11 -21
  127. package/docs/interfaces/react.FiveInjectionTypes.html +40 -43
  128. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -1
  129. package/docs/interfaces/sticker.IntersectionLike.html +4 -4
  130. package/docs/interfaces/vfx.ParticleArgs.html +75 -0
  131. package/docs/interfaces/vfx.ParticleTweenKeyframe.html +1 -0
  132. package/docs/interfaces/vue.FiveActionVueCallbacks.html +60 -0
  133. package/docs/modules/five.SubscribeMixinType.html +1 -1
  134. package/docs/modules/five.html +130 -113
  135. package/docs/modules/gltf_loader.html +1 -1
  136. package/docs/modules/line.html +1 -1
  137. package/docs/modules/react.html +36 -36
  138. package/docs/modules/sticker.html +1 -1
  139. package/docs/modules/vfx.html +1 -0
  140. package/docs/modules/vue.html +115 -0
  141. package/docs/modules.html +1 -1
  142. package/exporters/staticify.js +14 -7
  143. package/five/index.d.ts +1208 -252
  144. package/five/index.js +9 -98
  145. package/gltf-loader/index.d.ts +90 -5
  146. package/gltf-loader/index.js +3 -3
  147. package/line/index.d.ts +1 -0
  148. package/line/index.js +3 -3
  149. package/package.json +10 -6
  150. package/react/index.d.ts +61 -69
  151. package/react/index.js +3 -3
  152. package/resource/basis/1.16/basis_transcoder.js +22 -0
  153. package/resource/basis/{basis_transcoder.wasm → 1.16/basis_transcoder.wasm} +0 -0
  154. package/resource/basis/README.md +5 -0
  155. package/resource/draco/1.5.6/draco_decoder.js +34 -0
  156. package/resource/draco/1.5.6/draco_decoder.wasm +0 -0
  157. package/resource/draco/1.5.6/draco_decoder_gltf.js +33 -0
  158. package/resource/draco/1.5.6/draco_decoder_gltf.wasm +0 -0
  159. package/resource/draco/1.5.6/draco_encoder.js +35 -0
  160. package/resource/draco/1.5.6/draco_encoder.wasm +0 -0
  161. package/resource/draco/1.5.6/draco_encoder_wrapper.js +97 -0
  162. package/resource/draco/1.5.6/draco_wasm_wrapper.js +117 -0
  163. package/resource/draco/1.5.6/draco_wasm_wrapper_gltf.js +116 -0
  164. package/resource/draco/README.md +5 -0
  165. package/scripts/five-staticify.js +6 -1
  166. package/sticker/index.d.ts +2 -1
  167. package/sticker/index.js +3 -3
  168. package/umd/five-gltf-loader.js +1 -2
  169. package/umd/five-line.js +1 -2
  170. package/umd/five-react.js +1 -2
  171. package/umd/five-sticker.js +1 -2
  172. package/umd/five-vfx.js +1 -0
  173. package/umd/five-vue.js +1 -0
  174. package/umd/five.js +1 -1
  175. package/umd/five.js.LICENSE.txt +5 -202
  176. package/vfx/index.d.ts +264 -0
  177. package/vfx/index.js +260 -0
  178. package/vue/index.d.ts +443 -0
  179. package/vue/index.js +260 -0
  180. package/docs/classes/five.LegacyPanoCircleMesh.html +0 -5
  181. package/docs/classes/five.PBMMaterial.html +0 -15
  182. package/docs/classes/server.BVH.html +0 -10
  183. package/docs/classes/server.BVHIntersect.html +0 -1
  184. package/docs/classes/server.BVHNode.html +0 -7
  185. package/docs/classes/server.BVHVector3.html +0 -1
  186. package/docs/classes/server.Model.html +0 -63
  187. package/docs/classes/server.PBMGroup.html +0 -9
  188. package/docs/classes/server.PBMMesh.html +0 -7
  189. package/docs/interfaces/server.Intersection.html +0 -7
  190. package/docs/interfaces/server.ModelEventCallback.html +0 -18
  191. package/docs/modules/server.html +0 -18
  192. package/resource/basis/basis_transcoder.js +0 -22
  193. package/resource/gltf/draco_decoder.js +0 -31
  194. package/resource/gltf/draco_decoder.wasm +0 -0
  195. package/resource/gltf/draco_wasm_wrapper.js +0 -119
  196. package/server/index.d.ts +0 -556
  197. package/server/index.js +0 -367
package/five/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @realsee/five
3
3
  *
4
- * Generated: 2022-02-11
5
- * Version: 5.0.0-alpha.98
4
+ * Generated: 2023-09-07
5
+ * Version: 6.0.0-alpha.0
6
6
  *
7
7
  * Terms:
8
8
  * Realsee SDK License Agreement
@@ -257,7 +257,7 @@
257
257
  * Agreement and all related documents shall be drafted in English.
258
258
  */
259
259
 
260
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three"),t=require("tslib"),i=require("protobufjs/minimal");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var r=n(e),s=n(i),o=Number(r.REVISION);if(o<115||o>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');
260
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three"),t=require("protobufjs/minimal");function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(e),i=r(t),o=Number(n.REVISION);if(o<115||o>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');
261
261
  /**
262
262
  * @license
263
263
  * The 'jsrsasign'(RSA-Sign JavaScript Library) License
@@ -347,105 +347,16 @@
347
347
  *
348
348
  * https://code.google.com/p/crypto-js/wiki/License
349
349
  * PART: ext/cryptojs
350
- */var a,u={},c={},A=A||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)))}},A=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 A=0;A<u;A+=o)this._doProcessBlock(n,A);var l=n.splice(0,u);i.sigBytes-=c}return new s.init(l,c)},clone:function(){var e=r.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=A.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){A.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 l.HMAC.init(e,i).finalize(t)}}});var l=i.algo={};return i}(Math);function l(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 h(){return new l(null)}!function(e){for(var t=A,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 g=[];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],A=i[6],l=i[7],h=0;64>h;h++){if(16>h)g[h]=0|e[t+h];else{var d=g[h-15],p=g[h-2];g[h]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+g[h-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+g[h-16]}d=l+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&A)+o[h]+g[h],p=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&r^n&s^r&s),l=A,A=c,c=u,u=a+d|0,a=s,s=r,r=n,n=d+p|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]+A|0,i[7]=i[7]+l|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),A.lib.Cipher||function(e){var t=(g=A).lib,i=t.Base,n=t.WordArray,r=t.BufferedBlockAlgorithm,s=g.enc.Base64,o=g.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=g.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=(g.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=(g.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}})),g=(g.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:g}),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=A,t=e.lib.BlockCipher,i=e.algo,n=[],r=[],s=[],o=[],a=[],u=[],c=[],l=[],h=[],d=[],g=[],p=0;256>p;p++)g[p]=128>p?p<<1:p<<1^283;var M=0,f=0;for(p=0;256>p;p++){var y=(y=f^f<<1^f<<2^f<<3^f<<4)>>>8^255&y^99;n[M]=y,r[y]=M;var m=g[M],v=g[m],N=g[v],D=257*g[y]^16843008*y;s[M]=D<<24|D>>>8,o[M]=D<<16|D>>>16,a[M]=D<<8|D>>>24,u[M]=D,D=16843009*N^65537*v^257*m^16843008*M,c[y]=D<<24|D>>>8,l[y]=D<<16|D>>>16,h[y]=D<<8|D>>>24,d[y]=D,M?(M=m^g[g[g[N^m]]],f^=g[g[f]]):M=f=1}var E=[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^=E[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],A=e[t+1]^i[1],l=e[t+2]^i[2],h=e[t+3]^i[3],d=4,g=1;g<u;g++){var p=n[c>>>24]^r[A>>>16&255]^s[l>>>8&255]^o[255&h]^i[d++],M=n[A>>>24]^r[l>>>16&255]^s[h>>>8&255]^o[255&c]^i[d++],f=n[l>>>24]^r[h>>>16&255]^s[c>>>8&255]^o[255&A]^i[d++];h=n[h>>>24]^r[c>>>16&255]^s[A>>>8&255]^o[255&l]^i[d++],c=p,A=M,l=f}p=(a[c>>>24]<<24|a[A>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^i[d++],M=(a[A>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&c])^i[d++],f=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[c>>>8&255]<<8|a[255&A])^i[d++],h=(a[h>>>24]<<24|a[c>>>16&255]<<16|a[A>>>8&255]<<8|a[255&l])^i[d++],e[t]=p,e[t+1]=M,e[t+2]=f,e[t+3]=h},keySize:8});e.AES=t._createHelper(i)}(),
351
- /*!
352
- Copyright (c) 2011, Yahoo! Inc. All rights reserved.
353
- Code licensed under the BSD License:
354
- http://developer.yahoo.com/yui/license.html
355
- version: 2.9.0
356
- */
357
- c.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?(l.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,A=a*u+c*o;r=((u=o*u+((32767&A)<<15)+i[n]+(1073741823&r))>>>30)+(A>>>15)+a*c+(r>>>30),i[n++]=1073741823&u}return r},a=30):"undefined"!=typeof navigator&&"Netscape"!=navigator.appName?(l.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},a=26):(l.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,A=a*u+c*o;r=((u=o*u+((16383&A)<<14)+i[n]+r)>>28)+(A>>14)+a*c,i[n++]=268435455&u}return r},a=28),l.prototype.DB=a,l.prototype.DM=(1<<a)-1,l.prototype.DV=1<<a;l.prototype.FV=Math.pow(2,52),l.prototype.F1=52-a,l.prototype.F2=2*a-52;var d,g,p=new Array;for(d="0".charCodeAt(0),g=0;g<=9;++g)p[d++]=g;for(d="a".charCodeAt(0),g=10;g<36;++g)p[d++]=g;for(d="A".charCodeAt(0),g=10;g<36;++g)p[d++]=g;function M(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function f(e,t){var i=p[e.charCodeAt(t)];return null==i?-1:i}function y(e){var t=h();return t.fromInt(e),t}function m(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 v(e){this.m=e}function N(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 D(e,t){return e&t}function E(e,t){return e|t}function w(e,t){return e^t}function I(e,t){return e&~t}function T(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 x(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function j(){}function z(e){return e}function C(e){this.r2=h(),this.q3=h(),l.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},N.prototype.convert=function(e){var t=h();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(l.ZERO)>0&&this.m.subTo(t,t),t},N.prototype.revert=function(e){var t=h();return e.copyTo(t),this.reduce(t),t},N.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)},N.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},N.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},l.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},l.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},l.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]:f(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&&l.ZERO.subTo(this,this)},l.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},l.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},l.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},l.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()},l.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()}},l.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()},l.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&&l.ZERO.subTo(t,t)},l.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()},l.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=h());var s=h(),o=this.s,a=e.s,u=this.DB-m(n[n.t-1]);u>0?(n.lShiftTo(u,s),r.lShiftTo(u,i)):(n.copyTo(s),r.copyTo(i));var c=s.t,A=s[c-1];if(0!=A){var d=A*(1<<this.F1)+(c>1?s[c-2]>>this.F2:0),g=this.FV/d,p=(1<<this.F1)/d,M=1<<this.F2,f=i.t,y=f-c,v=null==t?h():t;for(s.dlShiftTo(y,v),i.compareTo(v)>=0&&(i[i.t++]=1,i.subTo(v,i)),l.ONE.dlShiftTo(c,v),v.subTo(s,s);s.t<c;)s[s.t++]=0;for(;--y>=0;){var N=i[--f]==A?this.DM:Math.floor(i[f]*g+(i[f-1]+M)*p);if((i[f]+=s.am(0,N,i,y,0,c))<N)for(s.dlShiftTo(y,v),i.subTo(v,i);i[f]<--N;)i.subTo(v,i)}null!=t&&(i.drShiftTo(c,t),o!=a&&l.ZERO.subTo(t,t)),i.t=c,i.clamp(),u>0&&i.rShiftTo(u,i),o<0&&l.ZERO.subTo(i,i)}}},l.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},l.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},l.prototype.exp=function(e,t){if(e>4294967295||e<1)return l.ONE;var i=h(),n=h(),r=t.convert(this),s=m(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)},l.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=M(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+=M(i));return r?s:"0"},l.prototype.negate=function(){var e=h();return l.ZERO.subTo(this,e),e},l.prototype.abs=function(){return this.s<0?this.negate():this},l.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},l.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+m(this[this.t-1]^this.s&this.DM)},l.prototype.mod=function(e){var t=h();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(l.ZERO)>0&&e.subTo(t,t),t},l.prototype.modPowInt=function(e,t){var i;return i=e<256||t.isEven()?new v(t):new N(t),this.exp(e,i)},l.ZERO=y(0),l.ONE=y(1),j.prototype.convert=z,j.prototype.revert=z,j.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i)},j.prototype.sqrTo=function(e,t){e.squareTo(t)},C.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=h();return e.copyTo(t),this.reduce(t),t},C.prototype.revert=function(e){return e},C.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)},C.prototype.mulTo=function(e,t,i){e.multiplyTo(t,i),this.reduce(i)},C.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var b=[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],S=(1<<26)/b[b.length-1];l.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},l.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=y(i),r=h(),s=h(),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},l.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=f(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&&l.ZERO.subTo(this,this)},l.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(l.ONE.shiftLeft(e-1),E,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(l.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)}},l.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()},l.prototype.changeBit=function(e,t){var i=l.ONE.shiftLeft(e);return this.bitwiseTo(i,t,i),i},l.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()},l.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},l.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]}},l.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()},l.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)},l.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},l.prototype.millerRabin=function(e){var t=this.subtract(l.ONE),i=t.getLowestSetBit();if(i<=0)return!1;var n=t.shiftRight(i);(e=e+1>>1)>b.length&&(e=b.length);for(var r=h(),s=0;s<e;++s){r.fromInt(b[Math.floor(Math.random()*b.length)]);var o=r.modPow(n,this);if(0!=o.compareTo(l.ONE)&&0!=o.compareTo(t)){for(var a=1;a++<i&&0!=o.compareTo(t);)if(0==(o=o.modPowInt(2,this)).compareTo(l.ONE))return!1;if(0!=o.compareTo(t))return!1}}return!0},l.prototype.clone=
350
+ */var a,s={},l=l||function(e,t){var r={},n=r.lib={},i=n.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var r=new e;return t&&r.mixIn(t),r.hasOwnProperty("init")||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},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)}}}(),o=n.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||s).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var a=r[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(o=0;o<i;o+=4)t[n+o>>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r=[],n=0;n<t;n+=4)r.push(4294967296*e.random()|0);return new o.init(r,t)}}),a=r.enc={},s=a.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},l=a.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},u=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},c=n.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),l=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,u=e.min(4*l,i);if(l){for(var c=0;c<l;c+=a)this._doProcessBlock(n,c);var h=n.splice(0,l);r.sigBytes-=u}return new o.init(h,u)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=c.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){c.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,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new h.HMAC.init(e,r).finalize(t)}}});var h=r.algo={};return r}(Math);function u(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function c(){return new u(null)}!function(e){for(var t=l,r=(i=t.lib).WordArray,n=i.Hasher,i=t.algo,o=[],a=[],s=function(e){return 4294967296*(e-(0|e))|0},u=2,c=0;64>c;){var h;e:{h=u;for(var d=e.sqrt(h),p=2;p<=d;p++)if(!(h%p)){h=!1;break e}h=!0}h&&(8>c&&(o[c]=s(e.pow(u,.5))),a[c]=s(e.pow(u,1/3)),c++),u++}var f=[];i=i.SHA256=n.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],d=0;64>d;d++){if(16>d)f[d]=0|e[t+d];else{var p=f[d-15],v=f[d-2];f[d]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+f[d-7]+((v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10)+f[d-16]}p=h+((l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25))+(l&u^~l&c)+a[d]+f[d],v=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&i^n&o^i&o),h=c,c=u,u=l,l=s+p|0,s=o,o=i,i=n,n=p+v|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+l|0,r[5]=r[5]+u|0,r[6]=r[6]+c|0,r[7]=r[7]+h|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=n._createHelper(i),t.HmacSHA256=n._createHmacHelper(i)}(Math),l.lib.Cipher||function(e){var t=(f=l).lib,r=t.Base,n=t.WordArray,i=t.BufferedBlockAlgorithm,o=f.enc.Base64,a=f.algo.EvpKDF,s=t.Cipher=i.extend({cfg:r.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,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.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,r,n){return("string"==typeof r?v:p).encrypt(e,t,r,n)},decrypt:function(t,r,n){return("string"==typeof r?v:p).decrypt(e,t,r,n)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=f.mode={},c=function(e,t,r){var n=this._iv;n?this._iv=undefined:n=this._prevBlock;for(var i=0;i<r;i++)e[t+i]^=n[i]},h=(t.BlockCipherMode=r.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();h.Encryptor=h.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize;c.call(this,e,t,n),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}),h.Decryptor=h.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=e.slice(t,t+n);r.decryptBlock(e,t),c.call(this,e,t,n),this._prevBlock=i}}),u=u.CBC=h,h=(f.pad={}).Pkcs7={pad:function(e,t){for(var r,i=(r=(r=4*t)-e.sigBytes%r)<<24|r<<16|r<<8|r,o=[],a=0;a<r;a+=4)o.push(i);r=n.create(o,r),e.concat(r)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:u,padding:h}),reset:function(){s.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=t.createEncryptor;else r=t.createDecryptor,this._minBufferSize=1;this._mode=r.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 d=t.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),p=(u=(f.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?n.create([1398893684,1701076831]).concat(e).concat(t):t).toString(o)},parse:function(e){var t=(e=o.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var r=n.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return d.create({ciphertext:e,salt:r})}},t.SerializableCipher=r.extend({cfg:r.extend({format:u}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n);return t=i.finalize(t),i=i.cfg,d.create({ciphertext:t,key:r,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),f=(f.kdf={}).OpenSSL={execute:function(e,t,r,i){return i||(i=n.random(8)),e=a.create({keySize:t+r}).compute(e,i),r=n.create(e.words.slice(t),4*r),e.sigBytes=4*t,d.create({key:e,iv:r,salt:i})}},v=t.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:f}),encrypt:function(e,t,r,n){return r=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize),n.iv=r.iv,(e=p.encrypt.call(this,e,t,r.key,n)).mixIn(r),e},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),r=n.kdf.execute(r,e.keySize,e.ivSize,t.salt),n.iv=r.iv,p.decrypt.call(this,e,t,r.key,n)}})}(),function(){for(var e=l,t=e.lib.BlockCipher,r=e.algo,n=[],i=[],o=[],a=[],s=[],u=[],c=[],h=[],d=[],p=[],f=[],v=0;256>v;v++)f[v]=128>v?v<<1:v<<1^283;var A=0,m=0;for(v=0;256>v;v++){var g=(g=m^m<<1^m<<2^m<<3^m<<4)>>>8^255&g^99;n[A]=g,i[g]=A;var y=f[A],b=f[y],x=f[b],w=257*f[g]^16843008*g;o[A]=w<<24|w>>>8,a[A]=w<<16|w>>>16,s[A]=w<<8|w>>>24,u[A]=w,w=16843009*x^65537*b^257*y^16843008*A,c[g]=w<<24|w>>>8,h[g]=w<<16|w>>>16,d[g]=w<<8|w>>>24,p[g]=w,A?(A=y^f[f[f[x^y]]],m^=f[f[m]]):A=m=1}var M=[0,1,2,4,8,16,32,64,128,27,54];r=r.AES=t.extend({_doReset:function(){for(var e=(r=this._key).words,t=r.sigBytes/4,r=4*((this._nRounds=t+6)+1),i=this._keySchedule=[],o=0;o<r;o++)if(o<t)i[o]=e[o];else{var a=i[o-1];o%t?6<t&&4==o%t&&(a=n[a>>>24]<<24|n[a>>>16&255]<<16|n[a>>>8&255]<<8|n[255&a]):(a=n[(a=a<<8|a>>>24)>>>24]<<24|n[a>>>16&255]<<16|n[a>>>8&255]<<8|n[255&a],a^=M[o/t|0]<<24),i[o]=i[o-t]^a}for(e=this._invKeySchedule=[],t=0;t<r;t++)o=r-t,a=t%4?i[o]:i[o-4],e[t]=4>t||4>=o?a:c[n[a>>>24]]^h[n[a>>>16&255]]^d[n[a>>>8&255]]^p[n[255&a]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,s,u,n)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,c,h,d,p,i),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,a,s){for(var l=this._nRounds,u=e[t]^r[0],c=e[t+1]^r[1],h=e[t+2]^r[2],d=e[t+3]^r[3],p=4,f=1;f<l;f++){var v=n[u>>>24]^i[c>>>16&255]^o[h>>>8&255]^a[255&d]^r[p++],A=n[c>>>24]^i[h>>>16&255]^o[d>>>8&255]^a[255&u]^r[p++],m=n[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^a[255&c]^r[p++];d=n[d>>>24]^i[u>>>16&255]^o[c>>>8&255]^a[255&h]^r[p++],u=v,c=A,h=m}v=(s[u>>>24]<<24|s[c>>>16&255]<<16|s[h>>>8&255]<<8|s[255&d])^r[p++],A=(s[c>>>24]<<24|s[h>>>16&255]<<16|s[d>>>8&255]<<8|s[255&u])^r[p++],m=(s[h>>>24]<<24|s[d>>>16&255]<<16|s[u>>>8&255]<<8|s[255&c])^r[p++],d=(s[d>>>24]<<24|s[u>>>16&255]<<16|s[c>>>8&255]<<8|s[255&h])^r[p++],e[t]=v,e[t+1]=A,e[t+2]=m,e[t+3]=d},keySize:8});e.AES=t._createHelper(r)}(),"undefined"!=typeof navigator&&"Microsoft Internet Explorer"==navigator.appName?(u.prototype.am=function(e,t,r,n,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var l=32767&this[e],u=this[e++]>>15,c=s*l+u*a;i=((l=a*l+((32767&c)<<15)+r[n]+(1073741823&i))>>>30)+(c>>>15)+s*u+(i>>>30),r[n++]=1073741823&l}return i},a=30):"undefined"!=typeof navigator&&"Netscape"!=navigator.appName?(u.prototype.am=function(e,t,r,n,i,o){for(;--o>=0;){var a=t*this[e++]+r[n]+i;i=Math.floor(a/67108864),r[n++]=67108863&a}return i},a=26):(u.prototype.am=function(e,t,r,n,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var l=16383&this[e],u=this[e++]>>14,c=s*l+u*a;i=((l=a*l+((16383&c)<<14)+r[n]+i)>>28)+(c>>14)+s*u,r[n++]=268435455&l}return i},a=28),u.prototype.DB=a,u.prototype.DM=(1<<a)-1,u.prototype.DV=1<<a;u.prototype.FV=Math.pow(2,52),u.prototype.F1=52-a,u.prototype.F2=2*a-52;var h,d,p="0123456789abcdefghijklmnopqrstuvwxyz",f=new Array;for(h="0".charCodeAt(0),d=0;d<=9;++d)f[h++]=d;for(h="a".charCodeAt(0),d=10;d<36;++d)f[h++]=d;for(h="A".charCodeAt(0),d=10;d<36;++d)f[h++]=d;function v(e){return p.charAt(e)}function A(e,t){var r=f[e.charCodeAt(t)];return null==r?-1:r}function m(e){var t=c();return t.fromInt(e),t}function g(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function b(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}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=c();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(u.ZERO)>0&&this.m.subTo(t,t),t},b.prototype.revert=function(e){var t=c();return e.copyTo(t),this.reduce(t),t},b.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},u.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},u.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},u.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var a=8==r?255&e[n]:A(e,n);a<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this[this.t++]=a:o+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&u.ZERO.subTo(this,this)},u.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},u.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},u.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},u.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,o=(1<<i)-1,a=Math.floor(e/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t[r+a+1]=this[r]>>i|s,s=(this[r]&o)<<n;for(r=a-1;r>=0;--r)t[r]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},u.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<<n)-1;t[0]=this[r]>>n;for(var a=r+1;a<this.t;++a)t[a-r-1]|=(this[a]&o)<<i,t[a-r]=this[a]>>n;n>0&&(t[this.t-r-1]|=(this.s&o)<<i),t.t=this.t-r,t.clamp()}},u.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},u.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+r.t]=r.am(0,n[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&u.ZERO.subTo(t,t)},u.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},u.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=c());var o=c(),a=this.s,s=e.s,l=this.DB-g(n[n.t-1]);l>0?(n.lShiftTo(l,o),i.lShiftTo(l,r)):(n.copyTo(o),i.copyTo(r));var h=o.t,d=o[h-1];if(0!=d){var p=d*(1<<this.F1)+(h>1?o[h-2]>>this.F2:0),f=this.FV/p,v=(1<<this.F1)/p,A=1<<this.F2,m=r.t,y=m-h,b=null==t?c():t;for(o.dlShiftTo(y,b),r.compareTo(b)>=0&&(r[r.t++]=1,r.subTo(b,r)),u.ONE.dlShiftTo(h,b),b.subTo(o,o);o.t<h;)o[o.t++]=0;for(;--y>=0;){var x=r[--m]==d?this.DM:Math.floor(r[m]*f+(r[m-1]+A)*v);if((r[m]+=o.am(0,x,r,y,0,h))<x)for(o.dlShiftTo(y,b),r.subTo(b,r);r[m]<--x;)r.subTo(b,r)}null!=t&&(r.drShiftTo(h,t),a!=s&&u.ZERO.subTo(t,t)),r.t=h,r.clamp(),l>0&&r.rShiftTo(l,r),a<0&&u.ZERO.subTo(r,r)}}},u.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},u.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},u.prototype.exp=function(e,t){if(e>4294967295||e<1)return u.ONE;var r=c(),n=c(),i=t.convert(this),o=g(e)-1;for(i.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<<o)>0)t.mulTo(n,i,r);else{var a=r;r=n,n=a}return t.revert(r)},u.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 r,n=(1<<t)-1,i=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(r=this[a]>>s)>0&&(i=!0,o=v(r));a>=0;)s<t?(r=(this[a]&(1<<s)-1)<<t-s,r|=this[--a]>>(s+=this.DB-t)):(r=this[a]>>(s-=t)&n,s<=0&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=v(r));return i?o:"0"},u.prototype.negate=function(){var e=c();return u.ZERO.subTo(this,e),e},u.prototype.abs=function(){return this.s<0?this.negate():this},u.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},u.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+g(this[this.t-1]^this.s&this.DM)},u.prototype.mod=function(e){var t=c();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(u.ZERO)>0&&e.subTo(t,t),t},u.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new b(t),this.exp(e,r)},u.ZERO=m(0),u.ONE=m(1),u.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},u.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=m(r),i=c(),o=c(),a="";for(this.divRemTo(n,i,o);i.signum()>0;)a=(r+o.intValue()).toString(e).substr(1)+a,i.divRemTo(n,i,o);return o.intValue().toString(e)+a},u.prototype.intValue=
358
351
  /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */
359
- function(){var e=h();return this.copyTo(e),e},l.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]},l.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},l.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},l.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},l.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},l.prototype.equals=function(e){return 0==this.compareTo(e)},l.prototype.min=function(e){return this.compareTo(e)<0?this:e},l.prototype.max=function(e){return this.compareTo(e)>0?this:e},l.prototype.and=function(e){var t=h();return this.bitwiseTo(e,D,t),t},l.prototype.or=function(e){var t=h();return this.bitwiseTo(e,E,t),t},l.prototype.xor=function(e){var t=h();return this.bitwiseTo(e,w,t),t},l.prototype.andNot=function(e){var t=h();return this.bitwiseTo(e,I,t),t},l.prototype.not=function(){for(var e=h(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},l.prototype.shiftLeft=function(e){var t=h();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},l.prototype.shiftRight=function(e){var t=h();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},l.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+T(this[e]);return this.s<0?this.t*this.DB:-1},l.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,i=0;i<this.t;++i)e+=x(this[i]^t);return e},l.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)},l.prototype.setBit=function(e){return this.changeBit(e,E)},l.prototype.clearBit=function(e){return this.changeBit(e,I)},l.prototype.flipBit=function(e){return this.changeBit(e,w)},l.prototype.add=function(e){var t=h();return this.addTo(e,t),t},l.prototype.subtract=function(e){var t=h();return this.subTo(e,t),t},l.prototype.multiply=function(e){var t=h();return this.multiplyTo(e,t),t},l.prototype.divide=function(e){var t=h();return this.divRemTo(e,t,null),t},l.prototype.remainder=function(e){var t=h();return this.divRemTo(e,null,t),t},l.prototype.divideAndRemainder=function(e){var t=h(),i=h();return this.divRemTo(e,t,i),new Array(t,i)},l.prototype.modPow=function(e,t){var i,n,r=e.bitLength(),s=y(1);if(r<=0)return s;i=r<18?1:r<48?3:r<144?4:r<768?5:6,n=r<8?new v(t):t.isEven()?new C(t):new N(t);var o=new Array,a=3,u=i-1,c=(1<<i)-1;if(o[1]=n.convert(this),i>1){var A=h();for(n.sqrTo(o[1],A);a<=c;)o[a]=h(),n.mulTo(A,o[a-2],o[a]),a+=2}var l,d,g=e.t-1,p=!0,M=h();for(r=m(e[g])-1;g>=0;){for(r>=u?l=e[g]>>r-u&c:(l=(e[g]&(1<<r+1)-1)<<u-r,g>0&&(l|=e[g-1]>>this.DB+r-u)),a=i;0==(1&l);)l>>=1,--a;if((r-=a)<0&&(r+=this.DB,--g),p)o[l].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[l],s)}for(;g>=0&&0==(e[g]&1<<r);)n.sqrTo(s,M),d=s,s=M,M=d,--r<0&&(r=this.DB-1,--g)}return n.revert(s)},l.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return l.ZERO;for(var i=e.clone(),n=this.clone(),r=y(1),s=y(0),o=y(0),a=y(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(l.ONE)?l.ZERO:a.compareTo(e)>=0?a.subtract(e):a.signum()<0?(a.addTo(e,a),a.signum()<0?a.add(e):a):a},l.prototype.pow=function(e){return this.exp(e,new j)},l.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},l.prototype.isProbablePrime=function(e){var t,i=this.abs();if(1==i.t&&i[0]<=b[b.length-1]){for(t=0;t<b.length;++t)if(i[0]==b[t])return!0;return!1}if(i.isEven())return!1;for(t=1;t<b.length;){for(var n=b[t],r=t+1;r<b.length&&n<S;)n*=b[r++];for(n=i.modInt(n);t<r;)if(n%b[t++]==0)return!1}return i.millerRabin(e)},l.prototype.square=function(){var e=h();return this.squareTo(e),e};
352
+ 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]},u.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1};
360
353
  /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */
361
- var L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function O(e){var t,i,n="";for(t=0;t+3<=e.length;t+=3)i=parseInt(e.substring(t,t+3),16),n+=L.charAt(i>>6)+L.charAt(63&i);for(t+1==e.length?(i=parseInt(e.substring(t,t+1),16),n+=L.charAt(i<<2)):t+2==e.length&&(i=parseInt(e.substring(t,t+2),16),n+=L.charAt(i>>2)+L.charAt((3&i)<<4));(3&n.length)>0;)n+="=";return n}function B(e){var t,i,n,r="",s=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t)(n=L.indexOf(e.charAt(t)))<0||(0==s?(r+=M(n>>2),i=3&n,s=1):1==s?(r+=M(i<<2|n>>4),i=15&n,s=2):2==s?(r+=M(i),r+=M(n>>2),i=3&n,s=3):(r+=M(i<<2|n>>4),r+=M(15&n),s=0));return 1==s&&(r+=M(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 k,P,U;
363
- /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function R(){var e;e=(new Date).getTime(),P[U++]^=255&e,P[U++]^=e>>8&255,P[U++]^=e>>16&255,P[U++]^=e>>24&255,U>=256&&(U-=256)}if(null==P){var _;if(P=new Array,U=0,"undefined"!=typeof window&&(void 0!==window.crypto||void 0!==window.msCrypto)){var Y=window.crypto||window.msCrypto;if(Y.getRandomValues){var F=new Uint8Array(32);for(Y.getRandomValues(F),_=0;_<32;++_)P[U++]=F[_]}else if("undefined"!=typeof navigator&&"Netscape"==navigator.appName&&navigator.appVersion<"5"){var H=window.crypto.random(32);for(_=0;_<H.length;++_)P[U++]=255&H.charCodeAt(_)}}for(;U<256;)_=Math.floor(65536*Math.random()),P[U++]=_>>>8,P[U++]=255&_;U=0,R()}function V(){if(null==k){for(R(),(k=new Q).init(P),U=0;U<P.length;++U)P[U]=0;U=0}return k.next()}function G(){}
354
+ var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w="=";function M(e){var t,r,n,i="",o=0;for(t=0;t<e.length&&e.charAt(t)!=w;++t)(n=x.indexOf(e.charAt(t)))<0||(0==o?(i+=v(n>>2),r=3&n,o=1):1==o?(i+=v(r<<2|n>>4),r=15&n,o=2):2==o?(i+=v(r),i+=v(n>>2),r=3&n,o=3):(i+=v(r<<2|n>>4),i+=v(15&n),o=0));return 1==o&&(i+=v(r<<2)),i}
355
+ /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function E(e,t){return new u(e,t)}function C(e,t,r){for(var n="",i=0;n.length<t;)n+=r(String.fromCharCode.apply(String,e.concat([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return n}function I(){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 S(e,t,r){for(var n="",i=0;n.length<t;)n+=r(e+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])),i+=1;return n}function P(e){return M(function(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),(e=e.replace(/-/g,"+")).replace(/_/g,"/")}(e))}function T(e){return decodeURIComponent(function(e){return e.replace(/(..)/g,"%$1")}(e))}function B(e){for(var t="",r=0;r<e.length-1;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t}function R(e){for(var t="",r=0;r<e.length;r++)t+=("0"+e.charCodeAt(r).toString(16)).slice(-2);return t}function O(e){return function(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=x.charAt(r>>6)+x.charAt(63&r);for(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=x.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=x.charAt(r>>2)+x.charAt((3&r)<<4));(3&n.length)>0;)n+=w;return n}(e)}function L(e,t){var r=function(e){var t=O(e).replace(/(.{64})/g,"$1\r\n");return t.replace(/\r\n$/,"")}(e);return"-----BEGIN "+t+"-----\r\n"+r+"\r\n-----END "+t+"-----\r\n"}function D(e,t){if(-1==e.indexOf("-----BEGIN "))throw"can't find PEM header: "+t;return function(e){return M(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 F(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),r=0;r<8;r++)t[r]=t[r].replace(/^0+/,""),""==t[r]&&(t[r]="0");var n=(e=":"+t.join(":")+":").match(/:(0:){2,}/g);if(null===n)return e.slice(1,-1);var i="";for(r=0;r<n.length;r++)n[r].length>i.length&&(i=n[r]);return(e=e.replace(i,"::")).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 k(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function Q(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}I.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},I.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=E(e,16),this.e=parseInt(t,16)}},I.prototype.encrypt=function(e){var t=function(e,t){if(t<e.length+11)throw"Message too long for RSA";for(var r=new Array,n=e.length-1;n>=0&&t>0;){var i=e.charCodeAt(n--);i<128?r[--t]=i:i>127&&i<2048?(r[--t]=63&i|128,r[--t]=i>>6|192):(r[--t]=63&i|128,r[--t]=i>>6&63|128,r[--t]=i>>12|224)}r[--t]=0;for(var o=new SecureRandom,a=new Array;t>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);r[--t]=a[0]}return r[--t]=2,r[--t]=0,new u(r)}(e,this.n.bitLength()+7>>3);if(null==t)return null;var r=this.doPublic(t);if(null==r)return null;var n=r.toString(16);return 0==(1&n.length)?n:"0"+n},I.prototype.encryptOAEP=function(e,t,r){var n=function(e,t,r,n){var i=s.crypto.MessageDigest,o=s.crypto.Util,a=null;if(r||(r="sha1"),"string"==typeof r&&(a=i.getCanonicalAlgName(r),n=i.getHashLength(a),r=function(e){return B(o.hashHex(R(e),a))}),e.length+2*n+2>t)throw"Message too long for RSA";var l,c="";for(l=0;l<t-e.length-2*n-2;l+=1)c+="\0";var h=r("")+c+""+e,d=new Array(n);(new SecureRandom).nextBytes(d);var p=C(d,h.length,r),f=[];for(l=0;l<h.length;l+=1)f[l]=h.charCodeAt(l)^p.charCodeAt(l);var v=C(f,d.length,r),A=[0];for(l=0;l<d.length;l+=1)A[l+1]=d[l]^v.charCodeAt(l);return new u(A.concat(f))}(e,this.n.bitLength()+7>>3,t,r);if(null==n)return null;var i=this.doPublic(n);if(null==i)return null;var o=i.toString(16);return 0==(1&o.length)?o:"0"+o},I.prototype.type="RSA",I.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),r=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(r)<0;)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},I.prototype.setPrivate=function(e,t,r){if(this.isPrivate=!0,"string"!=typeof e)this.n=e,this.e=t,this.d=r;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA private key";this.n=E(e,16),this.e=parseInt(t,16),this.d=E(r,16)}},I.prototype.setPrivateEx=function(e,t,r,n,i,o,a,s){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=E(e,16),this.e=parseInt(t,16),this.d=E(r,16),this.p=E(n,16),this.q=E(i,16),this.dmp1=E(o,16),this.dmq1=E(a,16),this.coeff=E(s,16)},I.prototype.decrypt=function(e){if(e.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=E(e,16),r=this.doPrivate(t);return null==r?null:
364
356
  /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */
365
- function K(e,t){return new l(e,t)}function q(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 W(){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 X(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 Z(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 J(e){return Z(function(e){for(var t=new Array,i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}(e))}function $(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),e=(e=e.replace(/-/g,"+")).replace(/_/g,"/")}function ee(e){return e.length%2==1&&(e="0"+e),function(e){return(e=(e=e.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}(O(e))}function te(e){return B($(e))}function ie(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+"%"+J(t[n]);return i}(e))}function ne(e){return decodeURIComponent(function(e){return e.replace(/(..)/g,"%$1")}(e))}function re(e){for(var t="",i=0;i<e.length-1;i+=2)t+=String.fromCharCode(parseInt(e.substr(i,2),16));return t}function se(e){for(var t="",i=0;i<e.length;i++)t+=("0"+e.charCodeAt(i).toString(16)).slice(-2);return t}function oe(e){var t=function(e){return O(e)}(e).replace(/(.{64})/g,"$1\r\n");return t=t.replace(/\r\n$/,"")}function ae(e,t){return"-----BEGIN "+t+"-----\r\n"+oe(e)+"\r\n-----END "+t+"-----\r\n"}function ue(e,t){if(-1==e.indexOf("-----BEGIN "))throw"can't find PEM header: "+t;return function(e){return B(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 ce(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 Ae(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 ne((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 ne((224|(240&t)>>4).toString(16)+n.toString(16)+r.toString(16))})).join("")}function le(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function he(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}G.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;++t)e[t]=V()},W.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},W.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=K(e,16),this.e=parseInt(t,16)}},W.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 G,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 l(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},W.prototype.encryptOAEP=function(e,t,i){var n=function(e,t,i,n){var r=u.crypto.MessageDigest,s=u.crypto.Util,o=null;if(i||(i="sha1"),"string"==typeof i&&(o=r.getCanonicalAlgName(i),n=r.getHashLength(o),i=function(e){return re(s.hashHex(se(e),o))}),e.length+2*n+2>t)throw"Message too long for RSA";var a,c="";for(a=0;a<t-e.length-2*n-2;a+=1)c+="\0";var A=i("")+c+""+e,h=new Array(n);(new G).nextBytes(h);var d=q(h,A.length,i),g=[];for(a=0;a<A.length;a+=1)g[a]=A.charCodeAt(a)^d.charCodeAt(a);var p=q(g,h.length,i),M=[0];for(a=0;a<h.length;a+=1)M[a+1]=h[a]^p.charCodeAt(a);return new l(M.concat(g))}(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},W.prototype.type="RSA",W.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)},W.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=K(e,16),this.e=parseInt(t,16),this.d=K(i,16)}},W.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=K(e,16),this.e=parseInt(t,16),this.d=K(i,16),this.p=K(n,16),this.q=K(r,16),this.dmp1=K(s,16),this.dmq1=K(o,16),this.coeff=K(a,16)},W.prototype.generate=function(e,t){var i=new G,n=e>>1;this.e=parseInt(t,16);for(var r=new l(t,16);;){for(;this.p=new l(e-n,1,i),0!=this.p.subtract(l.ONE).gcd(r).compareTo(l.ONE)||!this.p.isProbablePrime(10););for(;this.q=new l(n,1,i),0!=this.q.subtract(l.ONE).gcd(r).compareTo(l.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(l.ONE),a=this.q.subtract(l.ONE),u=o.multiply(a);if(0==u.gcd(r).compareTo(l.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},W.prototype.decrypt=function(e){if(e.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=K(e,16),i=this.doPrivate(t);return null==i?null:
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)},W.prototype.decryptOAEP=function(e,t,i){if(e.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var n=K(e,16),r=this.doPrivate(n);return null==r?null:function(e,t,i,n){var r=u.crypto.MessageDigest,s=u.crypto.Util,o=null;for(i||(i="sha1"),"string"==typeof i&&(o=r.getCanonicalAlgName(i),n=r.getHashLength(o),i=function(e){return re(s.hashHex(se(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,c=e.substr(1,n),A=e.substr(n+1),l=X(A,n,i),h=[];for(a=0;a<c.length;a+=1)h[a]=c.charCodeAt(a)^l.charCodeAt(a);var d=X(String.fromCharCode.apply(String,h),e.length-n,i),g=[];for(a=0;a<A.length;a+=1)g[a]=A.charCodeAt(a)^d.charCodeAt(a);if((g=String.fromCharCode.apply(String,g)).substr(0,n)!==i(""))throw"Hash mismatch";var p=(g=g.substr(n)).indexOf("");if((-1!=p?g.substr(0,p).lastIndexOf("\0"):-1)+1!=p)throw"Malformed data";return g.substr(p+1)}(r,this.n.bitLength()+7>>3,t,i)},void 0!==u.lang&&u.lang||(u.lang={}),u.lang.String=function(){},u.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},u.lang.String.isHex=function(e){return le(e)},u.lang.String.isBase64=function(e){return!(!(e=e.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},u.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=$(e),u.lang.String.isBase64(e))},u.lang.String.isIntegerArray=function(e){return!!(e=e.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},u.lang.String.isPrintable=function(e){return null!==e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},u.lang.String.isIA5=function(e){return null!==e.match(/^[\x20-\x21\x23-\x7f]*$/)},u.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 de=function(e,t,i){return null==i&&(i="0"),e.length>=t?e:new Array(t-e.length+1).join(i)+e};function ge(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!==u.crypto&&u.crypto||(u.crypto={}),u.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:A.algo.MD5,sha1:A.algo.SHA1,sha224:A.algo.SHA224,sha256:A.algo.SHA256,sha384:A.algo.SHA384,sha512:A.algo.SHA512,ripemd160:A.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 u.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new u.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 W||e instanceof u.crypto.DSA||e instanceof u.crypto.ECDSA}},u.crypto.Util.md5=function(e){return new u.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(e)},u.crypto.Util.ripemd160=function(e){return new u.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(e)},u.crypto.Util.SECURERANDOMGEN=new G,u.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return u.crypto.Util.SECURERANDOMGEN.nextBytes(t),Z(t)},u.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new l(u.crypto.Util.getRandomHexOfNbytes(e),16)},u.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,i=new Array((e-t)/8+1);return u.crypto.Util.SECURERANDOMGEN.nextBytes(i),i[0]=(255<<t&255^255)&i[0],Z(i)},u.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new l(u.crypto.Util.getRandomHexOfNbits(e),16)},u.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var i=u.crypto.Util.getRandomBigIntegerOfNbits(t);if(-1!=e.compareTo(i))return i}},u.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 u.crypto.Util.getRandomBigIntegerZeroToMax(n).add(e)},u.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=u.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=u.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=u.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=A.enc.Hex.parse(e);this.md.update(t)},this.digest=function(){return this.md.finalize().toString(A.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=u.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},u.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},u.crypto.MessageDigest.getHashLength=function(e){var t=u.crypto.MessageDigest,i=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[i])throw"not supported algorithm: "+e;return t.HASHLENGTH[i]},u.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},u.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=u.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=u.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[i];this.mac=A.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=A.enc.Hex.parse(e);this.mac.update(t)},this.doFinal=function(){return this.mac.finalize().toString(A.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=se(e)),void(this.pass=A.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=ie(e.utf8)),void 0!==e.rstr&&(t=se(e.rstr)),void 0!==e.b64&&(t=B(e.b64)),void 0!==e.b64u&&(t=te(e.b64u)),null==t)throw"KJUR.crypto.Mac unsupported password type: "+e;this.pass=A.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=u.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},u.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 u.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?Ee.getKey(e):Ee.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!==u.crypto.ECDSA&&(this.prvKey=new u.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof W&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof W&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof u.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof u.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!==u.crypto.ECDSA&&(this.pubKey=new u.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof W&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof W&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==u.crypto.ECDSA&&this.pubKey instanceof u.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==u.crypto.DSA&&this.pubKey instanceof u.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=u.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=Ee.getKey(e.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},u.crypto.Cipher=function(e){},u.crypto.Cipher.encrypt=function(e,t,i){if(t instanceof W&&t.isPublic){var n=u.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"},u.crypto.Cipher.decrypt=function(e,t,i){if(t instanceof W&&t.isPrivate){var n=u.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"},u.crypto.Cipher.getAlgByKeyAndName=function(e,t){if(e instanceof W){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},u.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 pe,Me,fe,ye,me,ve,Ne,De,Ee=(pe=function(e,t,i){return Me(A.AES,e,t,i)},Me=function(e,t,i,n){var r=A.enc.Hex.parse(t),s=A.enc.Hex.parse(i),o=A.enc.Hex.parse(n),a={};a.key=s,a.iv=o,a.ciphertext=r;var u=e.decrypt(a,s,{iv:o});return A.enc.Hex.stringify(u)},fe=function(e,t,i){return ye(A.AES,e,t,i)},ye=function(e,t,i,n){var r=A.enc.Hex.parse(t),s=A.enc.Hex.parse(i),o=A.enc.Hex.parse(n),a=e.encrypt(r,s,{iv:o}),u=A.enc.Hex.parse(a.toString());return A.enc.Base64.stringify(u)},me={"AES-256-CBC":{proc:pe,eproc:fe,keylen:32,ivlen:16},"AES-192-CBC":{proc:pe,eproc:fe,keylen:24,ivlen:16},"AES-128-CBC":{proc:pe,eproc:fe,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,t,i){return Me(A.TripleDES,e,t,i)},eproc:function(e,t,i){return ye(A.TripleDES,e,t,i)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,t,i){return Me(A.DES,e,t,i)},eproc:function(e,t,i){return ye(A.DES,e,t,i)},keylen:8,ivlen:8}},ve=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},Ne=function(e,t,i){for(var n=i.substring(0,16),r=A.enc.Hex.parse(n),s=A.enc.Utf8.parse(t),o=me[e].keylen+me[e].ivlen,a="",u=null;;){var c=A.algo.MD5.create();if(null!=u&&c.update(u),c.update(s),c.update(r),u=c.finalize(),(a+=A.enc.Hex.stringify(u)).length>=2*o)break}var l={};return l.keyhex=a.substr(0,2*me[e].keylen),l.ivhex=a.substr(2*me[e].keylen,2*me[e].ivlen),l},De=function(e,t,i,n){var r=A.enc.Base64.parse(e),s=A.enc.Hex.stringify(r);return(0,me[t].proc)(s,i,n)},{version:"1.0.0",parsePKCS5PEM:function(e){return ve(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,i){return Ne(e,t,i)},decryptKeyB64:function(e,t,i,n){return De(e,t,i,n)},getDecryptedKeyHex:function(e,t){var i=ve(e);i.type;var n=i.cipher,r=i.ivsalt,s=i.data,o=Ne(n,t,r).keyhex;return De(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===me[n])throw"KEYUTIL unsupported algorithm: "+n;void 0!==r&&null!=r||(r=function(e){var t=A.lib.WordArray.random(e);return A.enc.Hex.stringify(t)}(me[n].ivlen).toUpperCase());var o=function(e,t,i,n){return(0,me[t].eproc)(e,i,n)}(t,n,Ne(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=we,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 A=i(e,c[1]);if(A.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+A.length;r.pbkdf2Salt=n(e,A[0]);var l=n(e,A[1]);try{r.pbkdf2Iter=parseInt(l,16)}catch(e){throw"malformed format pbkdf2Iter: "+l}return r},getPBKDF2KeyHexFromParam:function(e,t){var i=A.enc.Hex.parse(e.pbkdf2Salt),n=e.pbkdf2Iter,r=A.PBKDF2(t,i,{keySize:6,iterations:n});return A.enc.Hex.stringify(r)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var i=ue(e,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(i),r=Ee.getPBKDF2KeyHexFromParam(n,t),s={};s.ciphertext=A.enc.Hex.parse(n.ciphertext);var o=A.enc.Hex.parse(r),a=A.enc.Hex.parse(n.encryptionSchemeIV),u=A.TripleDES.decrypt(s,o,{iv:a});return A.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(e,t){var i=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(i)},parsePlainPrivatePKCS8Hex:function(e){var t=we,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=ue(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,i=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==i.algoid)t=new W;else if("2a8648ce380401"==i.algoid)t=new u.crypto.DSA;else{if("2a8648ce3d0201"!=i.algoid)throw"unsupported private key algorithm";t=new u.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,i=we.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===i)t=new W;else if("2a8648ce380401"===i)t=new u.crypto.DSA;else{if("2a8648ce3d0201"!==i)throw"unsupported PKCS#8 public key hex";t=new u.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=we,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=we,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}});Ee.getKey=function(e,t,i){var n=(y=we).getChildIdx;y.getV;var r=y.getVbyList,s=u.crypto,o=s.ECDSA,a=s.DSA,c=W,A=ue,h=Ee;if(void 0!==c&&e instanceof c)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 c).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 c).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 c).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 c).setPublic(te(e.n),te(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 c).setPrivateEx(te(e.n),te(e.e),te(e.d),te(e.p),te(e.q),te(e.dp),te(e.dq),te(e.qi)),z;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(z=new c).setPrivate(te(e.n),te(e.e),te(e.d)),z;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var d=(j=new o({curve:e.crv})).ecparams.keylen/4,g="04"+("0000000000"+te(e.x)).slice(-d)+("0000000000"+te(e.y)).slice(-d);return j.setPublicKeyHex(g),j}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){d=(j=new o({curve:e.crv})).ecparams.keylen/4,g="04"+("0000000000"+te(e.x)).slice(-d)+("0000000000"+te(e.y)).slice(-d);var p=("0000000000"+te(e.d)).slice(-d);return j.setPublicKeyHex(g),j.setPrivateKeyHex(p),j}if("pkcs5prv"===i){var M,f=e,y=we;if(9===(M=n(f,0)).length)(z=new c).readPKCS5PrvKeyHex(f);else if(6===M.length)(z=new a).readPKCS5PrvKeyHex(f);else{if(!(M.length>2&&"04"===f.substr(M[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";(z=new o).readPKCS5PrvKeyHex(f)}return z}if("pkcs8prv"===i)return z=h.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===i)return h._getKeyFromPublicPKCS8Hex(e);if("x509pub"===i)return je.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return je.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var m=ue(e,"PUBLIC KEY");return h._getKeyFromPublicPKCS8Hex(m)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var v=A(e,"RSA PRIVATE KEY");return h.getKey(v,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var N=r(S=A(e,"DSA PRIVATE KEY"),0,[1],"02"),D=r(S,0,[2],"02"),E=r(S,0,[3],"02"),w=r(S,0,[4],"02"),I=r(S,0,[5],"02");return(z=new a).setPrivate(new l(N,16),new l(D,16),new l(E,16),new l(w,16),new l(I,16)),z}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){v=A(e,"EC PRIVATE KEY");return h.getKey(v,null,"pkcs5prv")}if(-1!=e.indexOf("-END PRIVATE KEY-"))return h.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var T=h.getDecryptedKeyHex(e,t),x=new W;return x.readPKCS5PrvKeyHex(T),x}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var j,z=r(S=h.getDecryptedKeyHex(e,t),0,[1],"04"),C=r(S,0,[2,0],"06"),b=r(S,0,[3,0],"03").substr(2);if(void 0===u.crypto.OID.oidhex2name[C])throw"undefined OID(hex) in KJUR.crypto.OID: "+C;return(j=new o({curve:u.crypto.OID.oidhex2name[C]})).setPublicKeyHex(b),j.setPrivateKeyHex(z),j.isPublic=!1,j}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var S;N=r(S=h.getDecryptedKeyHex(e,t),0,[1],"02"),D=r(S,0,[2],"02"),E=r(S,0,[3],"02"),w=r(S,0,[4],"02"),I=r(S,0,[5],"02");return(z=new a).setPrivate(new l(N,16),new l(D,16),new l(E,16),new l(w,16),new l(I,16)),z}if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return h.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},Ee.generateKeypair=function(e,t){if("RSA"==e){var i=t;(o=new W).generate(i,"10001"),o.isPrivate=!0,o.isPublic=!0;var n=new W,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,c=t,A=new u.crypto.ECDSA({curve:c}).generateKeyPairHex();return(o=new u.crypto.ECDSA({curve:c})).setPublicKeyHex(A.ecpubhex),o.setPrivateKeyHex(A.ecprvhex),o.isPrivate=!0,o.isPublic=!1,(n=new u.crypto.ECDSA({curve:c})).setPublicKeyHex(A.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=n,a}throw"unknown algorithm: "+e},Ee.getPEM=function(e,t,i,n,r,s){var o=u,a=o.asn1,c=a.DERObjectIdentifier,l=a.DERInteger,h=a.ASN1Util.newObject,d=a.x509.SubjectPublicKeyInfo,g=o.crypto,p=g.DSA,M=g.ECDSA,f=W;function y(e){return h({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 m(e){return h({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function v(e){return h({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!==f&&e instanceof f||void 0!==p&&e instanceof p||void 0!==M&&e instanceof M)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return ae(w=new d(e).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==f&&e instanceof f&&(void 0===i||null==i)&&1==e.isPrivate)return ae(w=y(e).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==M&&e instanceof M&&(void 0===i||null==i)&&1==e.isPrivate){var N=new c({name:e.curveName}).getEncodedHex(),D=m(e).getEncodedHex(),E="";return E+=ae(N,"EC PARAMETERS"),E+=ae(D,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==p&&e instanceof p&&(void 0===i||null==i)&&1==e.isPrivate)return ae(w=v(e).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==f&&e instanceof f&&void 0!==i&&null!=i&&1==e.isPrivate){var w=y(e).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",w,i,n,s)}if("PKCS5PRV"==t&&void 0!==M&&e instanceof M&&void 0!==i&&null!=i&&1==e.isPrivate){w=m(e).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",w,i,n,s)}if("PKCS5PRV"==t&&void 0!==p&&e instanceof p&&void 0!==i&&null!=i&&1==e.isPrivate){w=v(e).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",w,i,n,s)}var I=function(e,t){var i=T(e,t);return new h({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()},T=function(e,t){var i=A.lib.WordArray.random(8),n=A.lib.WordArray.random(8),r=A.PBKDF2(t,i,{keySize:6,iterations:100}),s=A.enc.Hex.parse(e),o=A.TripleDES.encrypt(s,r,{iv:n})+"",a={};return a.ciphertext=o,a.pbkdf2Salt=A.enc.Hex.stringify(i),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=A.enc.Hex.stringify(n),a};if("PKCS8PRV"==t&&null!=f&&e instanceof f&&1==e.isPrivate){var x=y(e).getEncodedHex();w=h({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:x}}]}).getEncodedHex();return void 0===i||null==i?ae(w,"PRIVATE KEY"):ae(D=I(w,i),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==M&&e instanceof M&&1==e.isPrivate){x=new h({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]}).getEncodedHex(),w=h({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:x}}]}).getEncodedHex();return void 0===i||null==i?ae(w,"PRIVATE KEY"):ae(D=I(w,i),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==p&&e instanceof p&&1==e.isPrivate){x=new l({bigint:e.x}).getEncodedHex(),w=h({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:x}}]}).getEncodedHex();return void 0===i||null==i?ae(w,"PRIVATE KEY"):ae(D=I(w,i),"ENCRYPTED PRIVATE KEY")}throw new Error("unsupported object nor format")},Ee.getKeyFromCSRPEM=function(e){var t=ue(e,"CERTIFICATE REQUEST");return Ee.getKeyFromCSRHex(t)},Ee.getKeyFromCSRHex=function(e){var t=Ee.parseCSRHex(e);return Ee.getKey(t.p8pubkeyhex,null,"pkcs8pub")},Ee.parseCSRHex=function(e){var t=we,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},Ee.getKeyID=function(e){var t=Ee,i=we;"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=t.getKey(e));var n=ue(t.getPEM(e)),r=i.getIdxbyList(n,0,[1]),s=i.getV(n,r).substring(2);return u.crypto.Util.hashHex(s,"sha1")},Ee.getJWKFromKey=function(e){var t={};if(e instanceof W&&e.isPrivate)return t.kty="RSA",t.n=ee(e.n.toString(16)),t.e=ee(e.e.toString(16)),t.d=ee(e.d.toString(16)),t.p=ee(e.p.toString(16)),t.q=ee(e.q.toString(16)),t.dp=ee(e.dmp1.toString(16)),t.dq=ee(e.dmq1.toString(16)),t.qi=ee(e.coeff.toString(16)),t;if(e instanceof W&&e.isPublic)return t.kty="RSA",t.n=ee(e.n.toString(16)),t.e=ee(e.e.toString(16)),t;if(e instanceof u.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=ee(i.x),t.y=ee(i.y),t.d=ee(e.prvKeyHex),t}if(e instanceof u.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=ee(i.x),t.y=ee(i.y),t}throw"not supported key object"},void 0!==u.asn1&&u.asn1||(u.asn1={}),u.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 l(n,16).xor(e).add(l.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return ae(e,t)},this.newObject=function(e){var t=u.asn1,i=t.ASN1Object,n=t.DERBoolean,r=t.DERInteger,s=t.DERBitString,o=t.DEROctetString,a=t.DERNull,c=t.DERObjectIdentifier,A=t.DEREnumerated,l=t.DERUTF8String,h=t.DERNumericString,d=t.DERPrintableString,g=t.DERTeletexString,p=t.DERIA5String,M=t.DERUTCTime,f=t.DERGeneralizedTime,y=t.DERVisibleString,m=t.DERBMPString,v=t.DERSequence,N=t.DERSet,D=t.DERTaggedObject,E=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var w=Object.keys(e);if(1!=w.length)throw new Error("key of param shall be only one.");var I=w[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+I+":"))throw new Error("undefined key: "+I);if("bool"==I)return new n(e[I]);if("int"==I)return new r(e[I]);if("bitstr"==I)return new s(e[I]);if("octstr"==I)return new o(e[I]);if("null"==I)return new a(e[I]);if("oid"==I)return new c(e[I]);if("enum"==I)return new A(e[I]);if("utf8str"==I)return new l(e[I]);if("numstr"==I)return new h(e[I]);if("prnstr"==I)return new d(e[I]);if("telstr"==I)return new g(e[I]);if("ia5str"==I)return new p(e[I]);if("utctime"==I)return new M(e[I]);if("gentime"==I)return new f(e[I]);if("visstr"==I)return new y(e[I]);if("bmpstr"==I)return new m(e[I]);if("asn1"==I)return new i(e[I]);if("seq"==I){for(var T=e[I],x=[],j=0;j<T.length;j++){var z=E(T[j]);x.push(z)}return new v({array:x})}if("set"==I){for(T=e[I],x=[],j=0;j<T.length;j++){z=E(T[j]);x.push(z)}return new N({array:x})}if("tag"==I){var C=e[I];if("[object Array]"===Object.prototype.toString.call(C)&&3==C.length){var b=E(C[2]);return new D({tag:C[0],explicit:C[1],obj:b})}return new D(C)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},u.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 l(n,2).toString(10),n=""}return t},u.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 l(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},u.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)},u.asn1.DERAbstractString=function(e){u.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=ie(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))},c.lang.extend(u.asn1.DERAbstractString,u.asn1.ASN1Object),u.asn1.DERAbstractTime=function(e){u.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=J(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}},c.lang.extend(u.asn1.DERAbstractTime,u.asn1.ASN1Object),u.asn1.DERAbstractStructured=function(e){u.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)},c.lang.extend(u.asn1.DERAbstractStructured,u.asn1.ASN1Object),u.asn1.DERBoolean=function(e){u.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},c.lang.extend(u.asn1.DERBoolean,u.asn1.ASN1Object),u.asn1.DERInteger=function(e){u.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=u.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new l(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))},c.lang.extend(u.asn1.DERInteger,u.asn1.ASN1Object),u.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=u.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}u.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))},c.lang.extend(u.asn1.DERBitString,u.asn1.ASN1Object),u.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=u.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}u.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},c.lang.extend(u.asn1.DEROctetString,u.asn1.DERAbstractString),u.asn1.DERNull=function(){u.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},c.lang.extend(u.asn1.DERNull,u.asn1.ASN1Object),u.asn1.DERObjectIdentifier=function(e){u.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=u.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)},c.lang.extend(u.asn1.DERObjectIdentifier,u.asn1.ASN1Object),u.asn1.DEREnumerated=function(e){u.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=u.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new l(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))},c.lang.extend(u.asn1.DEREnumerated,u.asn1.ASN1Object),u.asn1.DERUTF8String=function(e){u.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},c.lang.extend(u.asn1.DERUTF8String,u.asn1.DERAbstractString),u.asn1.DERNumericString=function(e){u.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},c.lang.extend(u.asn1.DERNumericString,u.asn1.DERAbstractString),u.asn1.DERPrintableString=function(e){u.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},c.lang.extend(u.asn1.DERPrintableString,u.asn1.DERAbstractString),u.asn1.DERTeletexString=function(e){u.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},c.lang.extend(u.asn1.DERTeletexString,u.asn1.DERAbstractString),u.asn1.DERIA5String=function(e){u.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},c.lang.extend(u.asn1.DERIA5String,u.asn1.DERAbstractString),u.asn1.DERVisibleString=function(e){u.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"},c.lang.extend(u.asn1.DERVisibleString,u.asn1.DERAbstractString),u.asn1.DERBMPString=function(e){u.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"},c.lang.extend(u.asn1.DERBMPString,u.asn1.DERAbstractString),u.asn1.DERUTCTime=function(e){u.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=J(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=J(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))},c.lang.extend(u.asn1.DERUTCTime,u.asn1.DERAbstractTime),u.asn1.DERGeneralizedTime=function(e){u.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=J(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=J(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))},c.lang.extend(u.asn1.DERGeneralizedTime,u.asn1.DERAbstractTime),u.asn1.DERSequence=function(e){u.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}},c.lang.extend(u.asn1.DERSequence,u.asn1.DERAbstractStructured),u.asn1.DERSet=function(e){u.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)},c.lang.extend(u.asn1.DERSet,u.asn1.DERAbstractStructured),u.asn1.DERTaggedObject=function(e){u.asn1.DERTaggedObject.superclass.constructor.call(this);var t=u.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)},c.lang.extend(u.asn1.DERTaggedObject,u.asn1.ASN1Object);var we=new function(){};function Ie(e,t){for(var i="",n=t/4-e.length,r=0;r<n;r++)i+="0";return i+e}function Te(e,t,i){for(var n="",r=0;n.length<t;)n+=re(i(se(e+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])))),r+=1;return n}function xe(e){for(var t in u.crypto.Util.DIGESTINFOHEAD){var i=u.crypto.Util.DIGESTINFOHEAD[t],n=i.length;if(e.substring(0,n)==i)return[t,e.substring(n)]}return[]}function je(e){var t,i=we,n=i.getChildIdx,r=i.getV,s=i.getTLV,o=i.getVbyList,a=i.getVbyListEx,c=i.getTLVbyList,A=i.getTLVbyListEx,l=i.getIdxbyList,h=i.getIdxbyListEx,d=i.getVidx,g=i.getInt,p=i.oidname,M=i.hextooidstr,f=ue;try{t=u.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=c(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=c(e,0,[0]),i=g(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=A(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 p(a(e,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return c(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 c(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 Ee.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=c(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=c(this.hex,0,[0],"30"),r=new u.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=ue(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 A={critical:!1},h=0;3===n(a,s[c]).length&&(A.critical=!0,h=1),A.oid=i.hextooidstr(o(a,s[c],[0],"06"));var g=l(a,s[c],[1+h]);A.vidx=d(a,g),this.aExtInfo.push(A)}},this.getExtInfo=function(e){var t=this.aExtInfo,i=e;if(e.match(/^[0-9.]+$/)||(i=u.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(je.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 A=s(e,a[u]),l=this.getGeneralNames(A);o.issuer=l[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(p(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(p(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=re(i);return"81"==t?{rfc822:n}:"82"==t?{dns:n}:"86"==t?{uri:n}:"87"==t?{ip:ce(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),A=0;A<c.length;A++)i=u.substr(c[A],2),e=r(u,c[A]),"81"===i&&(t=ne(e),a.push(["MAIL",t])),"82"===i&&(t=ne(e),a.push(["DNS",t])),"84"===i&&(t=je.hex2dn(e,0),a.push(["DN",t])),"86"===i&&(t=ne(e),a.push(["URI",t])),"87"===i&&(t=ce(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=ne(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(ne(a)),"2b06010505073002"===s&&t.caissuer.push(ne(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 A=a(e,u[c],[0],"06"),l=ne(o(e,u[c],[1],"86"));if("2b06010505073001"==A)r.array.push({ocsp:l});else{if("2b06010505073002"!=A)throw new Error("unknown method: "+A);r.array.push({caissuer:l})}}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=p(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]),A=this.getPolicyQualifierInfo(c);t.array.push(A)}}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=re(n)}else if("2b06010505070202"===i){var r=c(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=re(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,c=o.value,A=o.type;if("prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=A)return"mixed";if(u.lang.String.isMail(c))continue;return"mixed"}if("C"==A){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=u.asn1.ASN1Util.oidHexToInt(r);return t.type=u.asn1.x509.OID.oid2atype(a),t.ds=this.HEX2STAG[e.substr(i[1],2)],"bmp"!=t.ds?t.value=ne(s):t.value=Ae(s),t},this.readCertPEM=function(e){this.readCertHex(f(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=ae(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=A(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=M(o(e,0,[0],"06")),r=!1;3==t&&"0101ff"==c(e,0,[1])&&(r=!0);var s=c(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 u={extname:i,extn:s};return r&&(u.critical=!0),u},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+=" "+je.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="+he(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+he(t.e.toString(16))+"\n"),null!=(i=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var a=0;a<i.length;a++){var c=i[a],A=u.asn1.x509.OID.oid2name(c.oid);""===A&&(A=c.oid);var l="";if(!0===c.critical&&(l="CRITICAL"),e+=" "+A+" "+l+":\n","basicConstraints"===A){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"===A)e+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===A)e+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===A){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(e+=" kid="+d.kid.hex+"\n")}else{if("extKeyUsage"===A)e+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"===A)e+=" "+(n=this.getExtSubjectAltName(),JSON.stringify(n.array).replace(/[\[\]\{\}\"]/g,""))+"\n";else if("cRLDistributionPoints"===A)e+=s(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"===A)e+=o(this.getExtAuthorityInfoAccess());else"certificatePolicies"===A&&(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):u.lang.String.isHex(e)&&this.readCertHex(e))}function ze(e){return A.SHA256(e).toString()}we.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},we.getL=function(e,t){var i=we.getLblen(e,t);return i<1?"":e.substr(t+2,2*i)},we.getVblen=function(e,t){var i;return""==(i=we.getL(e,t))?-1:("8"===i.substr(0,1)?new l(i.substr(2),16):new l(i,16)).intValue()},we.getVidx=function(e,t){var i=we.getLblen(e,t);return i<0?i:t+2*(i+1)},we.getV=function(e,t){var i=we.getVidx(e,t),n=we.getVblen(e,t);return e.substr(i,2*n)},we.getTLV=function(e,t){return e.substr(t,2)+we.getL(e,t)+we.getV(e,t)},we.getTLVblen=function(e,t){return 2+2*we.getLblen(e,t)+2*we.getVblen(e,t)},we.getNextSiblingIdx=function(e,t){return we.getVidx(e,t)+2*we.getVblen(e,t)},we.getChildIdx=function(e,t){var i,n,r,s=we,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},we.getNthChildIdx=function(e,t,i){return we.getChildIdx(e,t)[i]},we.getIdxbyList=function(e,t,i,n){var r,s,o=we;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)},we.getIdxbyListEx=function(e,t,i,n){var r,s,o=we;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},we.getTLVbyList=function(e,t,i,n){var r=we,s=r.getIdxbyList(e,t,i,n);return-1==s||s>=e.length?null:r.getTLV(e,s)},we.getTLVbyListEx=function(e,t,i,n){var r=we,s=r.getIdxbyListEx(e,t,i,n);return-1==s?null:r.getTLV(e,s)},we.getVbyList=function(e,t,i,n,r){var s,o,a=we;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)},we.getVbyListEx=function(e,t,i,n,r){var s,o,a=we;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)},we.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=we.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}},we.getOID=function(e,t,i){null==i&&(i=null);try{return"06"!=e.substr(t,2)?i:function(e){if(!le(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+=de((127&s[o]).toString(2),7):(u+=de((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}}(we.getV(e,t))}catch(e){return i}},we.getOIDName=function(e,t,i){null==i&&(i=null);try{var n=we.getOID(e,t,i);if(n==i)return i;var r=u.asn1.x509.OID.oid2name(n);return""==r?n:r}catch(e){return i}},we.getString=function(e,t,i){null==i&&(i=null);try{return re(we.getV(e,t))}catch(e){return i}},we.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 A=i.join(".");return u.length>0&&(A=A+"."+u.join(".")),A},we.dump=function(e,t,i,n){var r=we,s=r.getV,o=r.dump,a=r.getChildIdx,c=e;e instanceof u.asn1.ASN1Object&&(c=e.getEncodedHex());var A=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=c.substr(i,2)))return"00"==(d=s(c,i))?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n";if("02"==l)return n+"INTEGER "+A(d=s(c,i),h)+"\n";if("03"==l){var d=s(c,i);if(r.isASN1HEX(d.substr(2))){var g=n+"BITSTRING, encapsulates\n";return g+=o(d.substr(2),t,0,n+" ")}return n+"BITSTRING "+A(d,h)+"\n"}if("04"==l){d=s(c,i);if(r.isASN1HEX(d)){g=n+"OCTETSTRING, encapsulates\n";return g+=o(d,t,0,n+" ")}return n+"OCTETSTRING "+A(d,h)+"\n"}if("05"==l)return n+"NULL\n";if("06"==l){var p=s(c,i),M=u.asn1.ASN1Util.oidHexToInt(p),f=u.asn1.x509.OID.oid2name(M),y=M.replace(/\./g," ");return""!=f?n+"ObjectIdentifier "+f+" ("+y+")\n":n+"ObjectIdentifier ("+y+")\n"}if("0a"==l)return n+"ENUMERATED "+parseInt(s(c,i))+"\n";if("0c"==l)return n+"UTF8String '"+ne(s(c,i))+"'\n";if("13"==l)return n+"PrintableString '"+ne(s(c,i))+"'\n";if("14"==l)return n+"TeletexString '"+ne(s(c,i))+"'\n";if("16"==l)return n+"IA5String '"+ne(s(c,i))+"'\n";if("17"==l)return n+"UTCTime "+ne(s(c,i))+"\n";if("18"==l)return n+"GeneralizedTime "+ne(s(c,i))+"\n";if("1a"==l)return n+"VisualString '"+ne(s(c,i))+"'\n";if("1e"==l)return n+"BMPString '"+Ae(s(c,i))+"'\n";if("30"==l){if("3000"==c.substr(i,4))return n+"SEQUENCE {}\n";g=n+"SEQUENCE\n";var m=t;if((2==(D=a(c,i)).length||3==D.length)&&"06"==c.substr(D[0],2)&&"04"==c.substr(D[D.length-1],2)){f=r.oidname(s(c,D[0]));var v=JSON.parse(JSON.stringify(t));v.x509ExtName=f,m=v}for(var N=0;N<D.length;N++)g+=o(c,m,D[N],n+" ");return g}if("31"==l){g=n+"SET\n";var D=a(c,i);for(N=0;N<D.length;N++)g+=o(c,t,D[N],n+" ");return g}if(0!=(128&(l=parseInt(l,16)))){var E=31&l;if(0!=(32&l)){for(g=n+"["+E+"]\n",D=a(c,i),N=0;N<D.length;N++)g+=o(c,t,D[N],n+" ");return g}d=s(c,i);if(we.isASN1HEX(d)){var g=n+"["+E+"]\n";return g+=o(d,t,0,n+" ")}return("68747470"==d.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==E)&&(d=ne(d)),g=n+"["+E+"] "+d+"\n"}return n+"UNKNOWN("+l+") "+s(c,i)+"\n"},we.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}},we.isASN1HEX=function(e){var t=we;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},we.checkStrictDER=function(e,t,i,n,r){var s=we;if(void 0===i){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!u.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),c=a.length-2-s.getL(e,t).length;if(c!==2*o)throw new Error("V string length and L's value not the same:"+c+"/"+2*o);if(0===t&&e.length!=a.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+a.length);var A=e.substr(t,2);if("02"===A){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(A,16)){for(var h=s.getVblen(e,t),d=0,g=s.getChildIdx(e,t),p=0;p<g.length;p++){d+=s.getTLV(e,g[p]).length,s.checkStrictDER(e,g[p],i,n,r)}if(2*h!=d)throw new Error("sum of children's TLV length and L unmatch: "+2*h+"!="+d)}},we.oidname=function(e){var t=u.asn1;u.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var i=t.x509.OID.oid2name(e);return""===i&&(i=e),i},void 0!==u.asn1&&u.asn1||(u.asn1={}),void 0!==u.asn1.x509&&u.asn1.x509||(u.asn1.x509={}),u.asn1.x509.Certificate=function(e){u.asn1.x509.Certificate.superclass.constructor.call(this);var t=u.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 u.crypto.Signature({alg:t});n.init(e.cakey),n.updateHex(i),e.sighex=n.sign()},this.getPEM=function(){return ae(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)},ge(u.asn1.x509.Certificate,u.asn1.ASN1Object),u.asn1.x509.TBSCertificate=function(e){u.asn1.x509.TBSCertificate.superclass.constructor.call(this);var t=u.asn1,i=t.x509,n=t.DERTaggedObject,r=t.DERInteger,s=t.DERSequence,o=i.AlgorithmIdentifier,a=i.Time,c=i.X500Name,A=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 c(t.issuer)),e.push(new s({array:[new a(t.notbefore),new a(t.notafter)]})),e.push(new c(t.subject)),e.push(new l(Ee.getKey(t.sbjpubkey))),void 0!==t.ext&&t.ext.length>0&&e.push(new n({tag:"a3",obj:new A(t.ext)})),new u.asn1.DERSequence({array:e}).getEncodedHex()},void 0!==e&&this.setByParam(e)},ge(u.asn1.x509.TBSCertificate,u.asn1.ASN1Object),u.asn1.x509.Extensions=function(e){u.asn1.x509.Extensions.superclass.constructor.call(this);var t=u.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)},ge(u.asn1.x509.Extensions,u.asn1.ASN1Object),u.asn1.x509.Extension=function(e){u.asn1.x509.Extension.superclass.constructor.call(this);var t=u.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)},ge(u.asn1.x509.Extension,u.asn1.ASN1Object),u.asn1.x509.KeyUsage=function(e){u.asn1.x509.KeyUsage.superclass.constructor.call(this,e);var t=je.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 u.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 u.asn1.DERBitString({bin:n})}},ge(u.asn1.x509.KeyUsage,u.asn1.x509.Extension),u.asn1.x509.BasicConstraints=function(e){u.asn1.x509.BasicConstraints.superclass.constructor.call(this,e);var t=u.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))},ge(u.asn1.x509.BasicConstraints,u.asn1.x509.Extension),u.asn1.x509.CRLDistributionPoints=function(e){u.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=u.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 u.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))},ge(u.asn1.x509.CRLDistributionPoints,u.asn1.x509.Extension),u.asn1.x509.DistributionPoint=function(e){u.asn1.x509.DistributionPoint.superclass.constructor.call(this);var t=u.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}]})))},ge(u.asn1.x509.DistributionPoint,u.asn1.ASN1Object),u.asn1.x509.DistributionPointName=function(e){u.asn1.x509.DistributionPointName.superclass.constructor.call(this);var t=u.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)}},ge(u.asn1.x509.DistributionPointName,u.asn1.ASN1Object),u.asn1.x509.CertificatePolicies=function(e){u.asn1.x509.CertificatePolicies.superclass.constructor.call(this,e);var t=u.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)},ge(u.asn1.x509.CertificatePolicies,u.asn1.x509.Extension),u.asn1.x509.PolicyInformation=function(e){u.asn1.x509.PolicyInformation.superclass.constructor.call(this,e);var t=u.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)},ge(u.asn1.x509.PolicyInformation,u.asn1.ASN1Object),u.asn1.x509.PolicyQualifierInfo=function(e){u.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=u.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)},ge(u.asn1.x509.PolicyQualifierInfo,u.asn1.ASN1Object),u.asn1.x509.UserNotice=function(e){u.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=u.asn1.DERSequence;u.asn1.DERInteger;var i=u.asn1.x509.DisplayText,n=u.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)},ge(u.asn1.x509.UserNotice,u.asn1.ASN1Object),u.asn1.x509.NoticeReference=function(e){u.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=u.asn1.DERSequence,i=u.asn1.DERInteger,n=u.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)},ge(u.asn1.x509.NoticeReference,u.asn1.ASN1Object),u.asn1.x509.DisplayText=function(e){u.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"))},ge(u.asn1.x509.DisplayText,u.asn1.DERAbstractString),u.asn1.x509.ExtKeyUsage=function(e){u.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,e);var t=u.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)},ge(u.asn1.x509.ExtKeyUsage,u.asn1.x509.Extension),u.asn1.x509.AuthorityKeyIdentifier=function(e){u.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,e);var t=u,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 u.asn1.DEROctetString(e);else if("object"==typeof e&&u.crypto.Util.isKey(e)||"string"==typeof e&&-1!=e.indexOf("BEGIN ")){var t=e;"string"==typeof e&&(t=Ee.getKey(e));var i=Ee.getKeyID(t);this.asn1KID=new u.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 u.asn1.x509.X500Name(e):"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&-1!=e.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new u.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 u.asn1.DERInteger(e);else if("string"==typeof e&&-1!=e.indexOf("BEGIN ")&&e.indexOf("CERTIFICATE")){var t=new je;t.readCertPEM(e);var i=t.getSerialNumberHex();this.asn1CertSN=new u.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)))},ge(u.asn1.x509.AuthorityKeyIdentifier,u.asn1.x509.Extension),u.asn1.x509.SubjectKeyIdentifier=function(e){u.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,e);var t=u.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&&u.crypto.Util.isKey(e)||"string"==typeof e&&-1!=e.indexOf("BEGIN")){var i=e;"string"==typeof e&&(i=Ee.getKey(e));var n=Ee.getKeyID(i);this.asn1KID=new u.asn1.DEROctetString({hex:n})}},this.oid="2.5.29.14",void 0!==e&&void 0!==e.kid&&this.setKIDByParam(e.kid)},ge(u.asn1.x509.SubjectKeyIdentifier,u.asn1.x509.Extension),u.asn1.x509.AuthorityInfoAccess=function(e){u.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,e),this.setAccessDescriptionArray=function(e){for(var t=new Array,i=u.asn1,n=i.DERSequence,r=i.DERObjectIdentifier,s=i.x509.GeneralName,o=0;o<e.length;o++){var a,c=e[o];if(void 0!==c.ocsp)a=new n({array:[new r({oid:"1.3.6.1.5.5.7.48.1"}),new s({uri:c.ocsp})]});else{if(void 0===c.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(c));a=new n({array:[new r({oid:"1.3.6.1.5.5.7.48.2"}),new s({uri:c.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)},ge(u.asn1.x509.AuthorityInfoAccess,u.asn1.x509.Extension),u.asn1.x509.SubjectAltName=function(e){u.asn1.x509.SubjectAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new u.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)},ge(u.asn1.x509.SubjectAltName,u.asn1.x509.Extension),u.asn1.x509.IssuerAltName=function(e){u.asn1.x509.IssuerAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new u.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)},ge(u.asn1.x509.IssuerAltName,u.asn1.x509.Extension),u.asn1.x509.SubjectDirectoryAttributes=function(e){u.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,e);var t=u.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)},ge(u.asn1.x509.SubjectDirectoryAttributes,u.asn1.x509.Extension),u.asn1.x509.PrivateExtension=function(e){u.asn1.x509.PrivateExtension.superclass.constructor.call(this,e);var t=u,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)},ge(u.asn1.x509.PrivateExtension,u.asn1.x509.Extension),u.asn1.x509.CRL=function(e){u.asn1.x509.CRL.superclass.constructor.call(this);var t=u.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 u.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 ae(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)},ge(u.asn1.x509.CRL,u.asn1.ASN1Object),u.asn1.x509.TBSCertList=function(e){u.asn1.x509.TBSCertList.superclass.constructor.call(this);var t=u.asn1,i=t.DERInteger,n=t.DERSequence,r=t.DERTaggedObject;t.DERObjectIdentifier;var s=t.x509,o=s.AlgorithmIdentifier,a=s.Time,c=s.Extensions,A=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 c(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,u=new i({int:s});e.push(u)}if(e.push(new o({name:t.sigalg})),e.push(new A(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 l=new c(t.ext);e.push(new r({tag:"a0",explicit:!0,obj:l}))}return new n({array:e}).getEncodedHex()},void 0!==e&&this.setByParam(e)},ge(u.asn1.x509.TBSCertList,u.asn1.ASN1Object),u.asn1.x509.CRLEntry=function(e){u.asn1.x509.CRLEntry.superclass.constructor.call(this);var t=u.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))},ge(u.asn1.x509.CRLEntry,u.asn1.ASN1Object),u.asn1.x509.CRLNumber=function(e){u.asn1.x509.CRLNumber.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new u.asn1.DERInteger(this.params.num),this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.20",null!=e&&(this.params=e)},ge(u.asn1.x509.CRLNumber,u.asn1.x509.Extension),u.asn1.x509.CRLReason=function(e){u.asn1.x509.CRLReason.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new u.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.21",null!=e&&(this.params=e)},ge(u.asn1.x509.CRLReason,u.asn1.x509.Extension),u.asn1.x509.OCSPNonce=function(e){u.asn1.x509.OCSPNonce.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new u.asn1.DEROctetString(this.params),this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=e&&(this.params=e)},ge(u.asn1.x509.OCSPNonce,u.asn1.x509.Extension),u.asn1.x509.OCSPNoCheck=function(e){u.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new u.asn1.DERNull,this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=e&&(this.params=e)},ge(u.asn1.x509.OCSPNoCheck,u.asn1.x509.Extension),u.asn1.x509.AdobeTimeStamp=function(e){u.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,e);var t=u.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)},ge(u.asn1.x509.AdobeTimeStamp,u.asn1.x509.Extension),u.asn1.x509.X500Name=function(e){u.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=u.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 je).readCertPEM(e.certissuer),this.hTLV=t.getIssuerHex()):void 0!==e.certsubject?((t=new je).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)},ge(u.asn1.x509.X500Name,u.asn1.ASN1Object),u.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(",")},u.asn1.x509.X500Name.onelineToLDAP=function(e){return u.asn1.x509.X500Name.compatToLDAP(e)},u.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("/")},u.asn1.x509.X500Name.ldapToOneline=function(e){return u.asn1.x509.X500Name.ldapToCompat(e)},u.asn1.x509.RDN=function(e){u.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=u.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 u.asn1.x509.AttributeTypeAndValue({str:e,rule:this.sRule}))},this.addByMultiValuedString=function(e){for(var t=u.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 u.asn1.DERSet({array:this.asn1Array});return this.TLV=r.getEncodedHex(),this.TLV},void 0!==e&&this.setByParam(e)},ge(u.asn1.x509.RDN,u.asn1.ASN1Object),u.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},u.asn1.x509.AttributeTypeAndValue=function(e){u.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=u,i=t.asn1,n=i.DERSequence,r=i.DERUTF8String,s=i.DERPrintableString,o=i.DERTeletexString,a=i.DERIA5String,c=i.DERVisibleString,A=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 c({str:t});if("bmp"==e)return new A({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=u.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)},ge(u.asn1.x509.AttributeTypeAndValue,u.asn1.ASN1Object),u.asn1.x509.SubjectPublicKeyInfo=function(e){u.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=u,i=t.asn1,n=i.DERInteger,r=i.DERBitString,s=i.DERObjectIdentifier,o=i.DERSequence,a=i.ASN1Util.newObject,c=i.x509.AlgorithmIdentifier,A=t.crypto;A.ECDSA,A.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 W){var t=a({seq:[{int:{bigint:e.n}},{int:{int:e.e}}]}).getEncodedHex();this.asn1AlgId=new c({name:"rsaEncryption"}),this.asn1SubjPKey=new r({hex:"00"+t})}}catch(e){}try{if(e instanceof u.crypto.ECDSA){var i=new s({name:e.curveName});this.asn1AlgId=new c({name:"ecPublicKey",asn1params:i}),this.asn1SubjPKey=new r({hex:"00"+e.pubKeyHex})}}catch(e){}try{if(e instanceof u.crypto.DSA){i=new a({seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]});this.asn1AlgId=new c({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)},ge(u.asn1.x509.SubjectPublicKeyInfo,u.asn1.ASN1Object),u.asn1.x509.Time=function(e){u.asn1.x509.Time.superclass.constructor.call(this);var t=u.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)},ge(u.asn1.x509.Time,u.asn1.ASN1Object),u.asn1.x509.AlgorithmIdentifier=function(e){u.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=u.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)}},ge(u.asn1.x509.AlgorithmIdentifier,u.asn1.ASN1Object),u.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},u.asn1.x509.GeneralName=function(e){u.asn1.x509.GeneralName.superclass.constructor.call(this);var t={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},i=u.asn1;i.DERSequence;var n=i.DEROctetString,r=i.DERIA5String,s=i.DERTaggedObject,o=i.ASN1Object,a=i.x509.X500Name,c=ue;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 u.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 A=null;if((h=e.certissuer).match(/^[0-9A-Fa-f]+$/),-1!=h.indexOf("-----BEGIN ")&&(A=c(h)),null==A)throw"certissuer param not cert";(d=new je).hex=A;var l=d.getIssuerHex();(i=new o).hTLV=l}if(void 0!==e.certsubj){this.type="dn",this.explicit=!0;var h,d;A=null;if((h=e.certsubj).match(/^[0-9A-Fa-f]+$/),-1!=h.indexOf("-----BEGIN ")&&(A=c(h)),null==A)throw"certsubj param not cert";(d=new je).hex=A;l=d.getSubjectHex();(i=new o).hTLV=l}if(void 0!==e.ip){this.type="ip",this.explicit=!1;var g,p=e.ip,M="malformed IP address";if(p.match(/^[0-9.]+[.][0-9.]+$/)){if(8!==(g=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}}("["+p.split(".").join(",")+"]")).length)throw M}else if(p.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/))g=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("")}(p);else{if(!p.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw M;g=p}i=new n({hex:g})}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)},ge(u.asn1.x509.GeneralName,u.asn1.ASN1Object),u.asn1.x509.GeneralNames=function(e){u.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=u.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)},ge(u.asn1.x509.GeneralNames,u.asn1.ASN1Object),u.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 u.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 u.asn1.DERObjectIdentifier({oid:t});return this.objCache[e]=i,i}},u.asn1.x509.OID.oid2name=function(e){var t=u.asn1.x509.OID.name2oidList;for(var i in t)if(t[i]==e)return i;return""},u.asn1.x509.OID.oid2atype=function(e){var t=u.asn1.x509.OID.atype2oidList;for(var i in t)if(t[i]==e)return i;return e},u.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=u.asn1.x509.OID.name2oidList;return void 0===t[e]?"":t[e]},u.asn1.x509.X509Util={},u.asn1.x509.X509Util.newCertPEM=function(e){var t=u.asn1.x509;return t.TBSCertificate,new(0,t.Certificate)(e).getPEM()},W.getPosArrayOfChildrenFromHex=function(e){return we.getChildIdx(e,0)},W.getHexValueArrayOfChildrenFromHex=function(e){var t,i=we.getV,n=i(e,(t=W.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]),A=i(e,t[7]),l=i(e,t[8]);return(t=new Array).push(n,r,s,o,a,u,c,A,l),t},W.prototype.readPrivateKeyFromPEMString=function(e){var t=ue(e),i=W.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8])},W.prototype.readPKCS5PrvKeyHex=function(e){var t=W.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},W.prototype.readPKCS8PrvKeyHex=function(e){var t,i,n,r,s,o,a,u,c=we,A=c.getVbyListEx;if(!1===c.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=A(e,0,[2,0,1],"02"),i=A(e,0,[2,0,2],"02"),n=A(e,0,[2,0,3],"02"),r=A(e,0,[2,0,4],"02"),s=A(e,0,[2,0,5],"02"),o=A(e,0,[2,0,6],"02"),a=A(e,0,[2,0,7],"02"),u=A(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)},W.prototype.readPKCS5PubKeyHex=function(e){var t=we,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)},W.prototype.readPKCS8PubKeyHex=function(e){var t=we;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)},W.prototype.readCertPubKeyHex=function(e,t){var i,n;(i=new je).readCertHex(e),n=i.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},W.prototype.sign=function(e,t){var i,n=(i=e,u.crypto.Util.hashString(i,t));return this.signWithMessageHash(n,t)},W.prototype.signWithMessageHash=function(e,t){var i=K(u.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return Ie(this.doPrivate(i).toString(16),this.n.bitLength())},W.prototype.signPSS=function(e,t,i){var n,r=(n=se(e),u.crypto.Util.hashHex(n,t));return void 0===i&&(i=-1),this.signWithMessageHashPSS(r,t,i)},W.prototype.signWithMessageHashPSS=function(e,t,i){var n,r=re(e),s=r.length,o=this.n.bitLength()-1,a=Math.ceil(o/8),c=function(e){return u.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 A="";i>0&&(A=new Array(i),(new G).nextBytes(A),A=String.fromCharCode.apply(String,A));var h=re(c(se("\0\0\0\0\0\0\0\0"+r+A))),d=[];for(n=0;n<a-i-s-2;n+=1)d[n]=0;var g=String.fromCharCode.apply(String,d)+""+A,p=Te(h,g.length,c),M=[];for(n=0;n<g.length;n+=1)M[n]=g.charCodeAt(n)^p.charCodeAt(n);var f=65280>>8*a-o&255;for(M[0]&=~f,n=0;n<s;n++)M.push(h.charCodeAt(n));return M.push(188),Ie(this.doPrivate(new l(M)).toString(16),this.n.bitLength())},W.prototype.verify=function(e,t){if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var i=K(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=xe(r.replace(/^1f+00/,""));if(0==s.length)return!1;var o,a=s[0];return s[1]==(o=e,u.crypto.Util.hashString(o,a))},W.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=K(t,16);if(i.bitLength()>this.n.bitLength())return 0;var n=xe(this.doPublic(i).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==e)},W.prototype.verifyPSS=function(e,t,i,n){var r=function(e){return u.crypto.Util.hashHex(e,i)}(se(e));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(r,t,i,n)},W.prototype.verifyWithMessageHashPSS=function(e,t,i,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r,s=new l(t,16),o=function(e){return u.crypto.Util.hashHex(e,i)},a=re(e),c=a.length,A=this.n.bitLength()-1,h=Math.ceil(A/8);if(-1===n||void 0===n)n=c;else if(-2===n)n=h-c-2;else if(n<-2)throw new Error("invalid salt length");if(h<c+n+2)throw new Error("data too long");var d=this.doPublic(s).toByteArray();for(r=0;r<d.length;r+=1)d[r]&=255;for(;d.length<h;)d.unshift(0);if(188!==d[h-1])throw new Error("encoded message does not end in 0xbc");var g=(d=String.fromCharCode.apply(String,d)).substr(0,h-c-1),p=d.substr(g.length,c),M=65280>>8*h-A&255;if(0!=(g.charCodeAt(0)&M))throw new Error("bits beyond keysize not zero");var f=Te(p,g.length,o),y=[];for(r=0;r<g.length;r+=1)y[r]=g.charCodeAt(r)^f.charCodeAt(r);y[0]&=~M;var m=h-c-n-2;for(r=0;r<m;r+=1)if(0!==y[r])throw new Error("leftmost octets not zero");if(1!==y[m])throw new Error("0x01 marker not found");return p===re(o(se("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,y.slice(-n)))))},W.SALT_LEN_HLEN=-1,W.SALT_LEN_MAX=-2,W.SALT_LEN_RECOVER=-2,je.hex2dn=function(e,t){void 0===t&&(t=0);var i=new je;return we.getTLV(e,t),i.getX500Name(e).str},je.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=we.getChildIdx(e,t),r=0;r<n.length;r++)i.push(je.hex2attrTypeValue(e,n[r]));return(i=i.map((function(e){return e.replace("+","\\+")}))).join("+")},je.hex2attrTypeValue=function(e,t){var i=we,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=u.asn1.ASN1Util.oidHexToInt(s);return u.asn1.x509.OID.oid2atype(o)+"="+re(n(e,r[1]))},je.getPublicKeyFromCertHex=function(e){var t=new je;return t.readCertHex(e),t.getPublicKey()},je.getPublicKeyFromCertPEM=function(e){var t=new je;return t.readCertPEM(e),t.getPublicKey()},je.getPublicKeyInfoPropOfCertPEM=function(e){var t,i,n=we.getVbyList,r={};return r.algparam=null,(t=new je).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},je.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];var Ce,be=[(Ce=new je,Ce.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@@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]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:::::")),Ce)];function Se(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())&&Se(n,t))}function Le(e){return e.getIssuerHex()!==e.getSubjectHex()&&Se(e,be)}!function(e){var t=new je;"string"==typeof e?t.readCertPEM(e):t.readCertHex(e.hex);var i=Le(t);be.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^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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 Oe,Be=(Oe="$$FIVE_EVENT$$","undefined"==typeof Symbol?"$Symbol<".concat(Oe,">$"):Symbol(Oe));function Qe(e){return e[Be]||(e[Be]={}),e[Be]}var ke=function(){function e(){}return e.prototype.hasListener=function(e){var t=Qe(this);return t&&t[e]&&t[e].length>0},e.prototype.on=function(e,t,i){var n=this,r=Qe(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=Qe(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)[Be]||delete i[Be]},e.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];for(var n=!1,r=Qe(this),s=r[e]||[],o=0,a=s.slice();o<a.length;o++){var u=a[o],c=u[0],A=u[1],l=void 0!==A&&A,h=c.apply(void 0,t);l&&this.off(e,c),!1===h&&(n=!0)}return n},e}();function Pe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}var Ue="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),Re="undefined"!=typeof performance?function(){return Ue+performance.now()}:function(){return Date.now()};function _e(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])||_e(e[n])})),e}var Ye=/^([^.]+)(\.([^.]+))*$/;function Fe(e){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(e)}function He(e,t){return Ye.test(e)&&Ye.test(t)&&function(e,t){if("*"===e)return!0;var i=e.split(".").reverse(),n=t.split(".").reverse();if(i.length<=1)return e===t;for(var r=0;r<i.length;r++)if(i[r]!==n[r])return!1;return!0}(e,t)}var Ve=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],Ge=_e(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-/yvn{wvn;p|z/9-/rnyrr;p|z/9-/rnyrr;p{/9-/uv;p|z/9-/uv;p{/9-/ywpq{;p|z/9-/pnyp{|qr;vr/9-/rnyrr;w}/9-/rnyrr:pq{;p|z/-j"))),Ke=function(e){function i(t,i,n){return e.call(this,"[NETWORK]: response error(type: ".concat(i,", reason: ").concat(n,"): ").concat(t))||this}return t.__extends(i,e),i}(Error),qe=function(e){function i(t,i,n){var r=e.call(this,"[NETWORK]: response error(type: ".concat(i,", status: ").concat(n,"): ").concat(t))||this;return r.httpStatus=n,r}return t.__extends(i,e),i}(Error);!function(e){function i(t,i){return e.call(this,"[NETWORK]: request abort(type: ".concat(i,"): ").concat(t))||this}t.__extends(i,e)}(Error);var We=function(e){function i(t,i,n){return e.call(this,"[NETWORK]: request timeout(type: ".concat(i,", timeout: ").concat(n,"ms): ").concat(t))||this}return t.__extends(i,e),i}(Error);function Xe(e){for(var t=0,i=Ve;t<i.length;t++){var n=i[t],r=e.match(n);if(r)return"jsonp_"+r[1]}return null}function Ze(e){return null!==Xe(e)}function Je(e){return Ve.reduce((function(e,t){return e.replace(t,"")}),e)}function $e(e){var t=e.match(/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[2]:location.hostname}!function(e){function i(t,i,n){return e.call(this,"[NETWORK]: request forbidden(type: ".concat(i,", reason: ").concat(n,"): ").concat(t))||this}t.__extends(i,e)}(Error);var et=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(i,e),i}(ke);function tt(e,t,i,n,r){return void 0===t&&(t={}),void 0===i&&(i=Pe),void 0===n&&(n=Pe),void 0===r&&(r=Pe),new Promise((function(s,o){var a,u=t.allowHosts?Ge.concat(t.allowHosts):Ge.slice(),c=$e(e),A=Xe(e);if(0!==location.hostname.length&&!Fe(location.hostname)&&0===Ge.filter((function(e){return He(e,location.hostname)})).length&&!Fe(c)&&0===u.filter((function(e){return He(e,c)})).length){var l=A?"Script":"XMLHttpRequest",h=new Ke(e,l,"request host(".concat(c,") is not allowed"));return n(h),o(h),void(null===(a=t.networkSubscribe)||void 0===a||a.emit("network",e,l,"forbidden",h.message))}if(A){var d=window,g=null,p=!1,M=Re(),f=document.createElement("script");d[A]=function(r){var a,u,c=Re(),l=c-M;if(delete d[A],f.parentNode&&f.parentNode.removeChild(f),null!==g&&(window.clearTimeout(g),g=null),!0!==p){if(0!==r.indexOf("data:")){var h=new qe(e,"Script",500);return n(h),o(h),void(null===(a=t.networkSubscribe)||void 0===a||a.emit("network",e,"Script","error",h.message))}var y=r.split(","),m=(y[0].match(/:(.*?);/)||[])[1],v=y[1];if("arraybuffer"===t.responseType||"blob"===t.responseType){for(var N=atob(y[1]),D=N.length,E=new Uint8Array(D),w=0;w<D;w++)E[w]=N.charCodeAt(w);v="arraybuffer"===t.responseType?E.buffer:new Blob([E],{type:m})}var I={body:v,meta:{source:e,requestTime:M,responseTime:c,costs:l,headers:{}}};i(I),s(I),null===(u=t.networkSubscribe)||void 0===u||u.emit("network",e,"Script","ok",JSON.stringify(I.meta)),p=!0}},f.src=e,document.body.appendChild(f),"number"==typeof t.timeout&&(g=window.setTimeout((function(){var i;if(g=null,!0!==p){p=!0;var r=new We(e,"Script",t.timeout||NaN);n(r),o(r),null===(i=t.networkSubscribe)||void 0===i||i.emit("network",e,"Script","timeout",r.message)}}),t.timeout))}else{var y=Re(),m=!1,v=new XMLHttpRequest,N=function(){v&&(v.removeEventListener("timeout",D,!1),v.removeEventListener("progress",E,!1),v.removeEventListener("load",w,!1),v.removeEventListener("error",I,!1)),v=null,N=Pe},D=function(){var i;if(!0!==m){m=!0,N();var r=new We(e,"XMLHttpRequest",t.timeout||NaN);n(r),o(r),null===(i=t.networkSubscribe)||void 0===i||i.emit("network",e,"XMLHttpRequest","timeout",r.message)}},E=function(e){!0!==m&&e.lengthComputable&&(e.total<=0||r(e.loaded/e.total))},w=function(n){var r;if(!0!==m){var o=this.status;if(0===o||o>=200&&o<400){m=!0,N();var a=Re(),u=a-y,c=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=n.total,l={body:this.response,meta:{source:e,requestTime:y,responseTime:a,costs:u,headers:c,size:A}};i(l),s(l),null===(r=t.networkSubscribe)||void 0===r||r.emit("network",e,"XMLHttpRequest","ok",JSON.stringify(l.meta))}else I.call(this)}},I=function(){var i;if(!0!==m){m=!0,N();var r=new qe(e,"XMLHttpRequest",this.status);n(r),o(r),null===(i=t.networkSubscribe)||void 0===i||i.emit("network",e,"XMLHttpRequest","error",r.message)}};v.addEventListener("timeout",D,!1),v.addEventListener("progress",E,!1),v.addEventListener("load",w,!1),v.addEventListener("error",I,!1),t.responseType&&(v.responseType=t.responseType),"number"==typeof t.timeout&&(v.timeout=t.timeout),v.open("GET",e,!0),v.send(null)}}))}var it={};function nt(e,t,i,n,r,s){return void 0===t&&(t={}),void 0===i&&(i=Pe),void 0===n&&(n=Pe),void 0===r&&(r=Pe),new Promise((function(o,a){var u,c=t.allowHosts?Ge.concat(t.allowHosts):Ge.slice(),A=$e(e);if(0!==location.hostname.length&&!Fe(location.hostname)&&0===Ge.filter((function(e){return He(e,location.hostname)})).length&&!Fe(A)&&0===c.filter((function(e){return He(e,A)})).length){var l=new Ke(e,"Image","request host(".concat(A,") is not allowed"));return n(l),a(l),void(null===(u=t.networkSubscribe)||void 0===u||u.emit("network",e,"Image","forbidden",l.message))}var h=null!=s?s:new Image,d=Re(),g=!1,p=null;"number"==typeof t.timeout&&(p=window.setTimeout((function(){var i;if(h.onload=Pe,h.onerror=Pe,p=null,!0!==g){g=!0;var r=new We(e,"Image",t.timeout);n(r),a(r),null===(i=t.networkSubscribe)||void 0===i||i.emit("network",e,"Image","timeout",r.message)}}),t.timeout)),h.onload=function(){var n;if(h.onload=Pe,h.onerror=Pe,null!==p&&(clearTimeout(p),p=null),!0!==g){var s=Re();g=!0;var a={body:h,meta:{headers:{},source:e,requestTime:d,responseTime:s,costs:s-d}};r(1),i(a),o(a),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"Image","ok",JSON.stringify(a.meta))}},h.onerror=function(){var i;if(h.onload=Pe,h.onerror=Pe,null!==p&&(clearTimeout(p),p=null),!0!==g){g=!0;var r=new qe(e,"Image",0);n(r),a(r),null===(i=t.networkSubscribe)||void 0===i||i.emit("network",e,"Image","ok",r.message)}},r(0),h.src=e}))}var rt=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)}}(),st=16,ot=function(){function e(){this.frames=[],this.stoped=!1,this.time=Re(),this.loop=this.loop.bind(this),this.loop()}return Object.defineProperty(e,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new e),this.sharedInstance},enumerable:!1,configurable:!0}),e.getFrameTime=function(){return st},e.prototype.loop=function(){if(!this.stoped){var e=Re(),t=e-this.time;this.time=e;var i=[];st=t;for(var n=0,r=this.frames;n<r.length;n++){var s=r[n];if(s.delay>0)s.delay=s.delay-1;else{try{s.callback(e,t)}catch(e){console.error(e)}s.once&&i.push(s)}}i.length>0&&(this.frames=this.frames.filter((function(e){return-1===i.indexOf(e)}))),rt(this.loop)}},e.prototype.remove=function(e){var t=this.frames.indexOf(e);t>=0&&this.frames.splice(t,1)},e.prototype.add=function(e,t,i,n){var r=this;void 0===t&&(t=!1),void 0===i&&(i=0),void 0===n&&(n=5);var s={callback:e,once:t,delay:i,order:n};return this.frames.push(s),this.frames.sort((function(e,t){return e.order-t.order})),function(){return r.remove(s)}},e.prototype.disponse=function(){this.stoped=!0,this.frames.length=0},e}(),at="//vrlab-public.ljcdn.com/",ut="//vrlab-image[1-4].ljcdn.com/",ct="//global-public.realsee-cdn.com/",At="//global-image-[1-4].realsee-cdn.com/";function lt(e,t){var i,n=e.split("?")[0],r=n.split(".").pop();if("jpeg"===r&&(r="jpg"),"png"!==r&&"jpg"!==r)return e;var s="";if(void 0!==t.format&&t.format!==r&&(s+="/format/".concat(t.format)),void 0!==t.cut&&(s+="/cut/".concat(t.cut[2],"x").concat(t.cut[3],"x").concat(t.cut[0],"x").concat(t.cut[1])),void 0!==t.quality){var o=null!==(i=t.format)&&void 0!==i?i:r;o&&["jpg","webp","tpg","heif","avif"].indexOf(o)>=0&&(s+="/quality/".concat(t.quality))}if(void 0!==t.size){var a=e.match(/\/cube_(\d+)\//);(a?Number(a[1]):NaN)!==Number(t.size)&&(s+="/thumbnail/".concat(t.size,"x"))}return s.length&&(s="?imageMogr2"+s),n+s}function ht(e,t){return e.indexOf(at)>=0?(/\.basis(\?|$)/.test(e)&&!0!==t.basisLoaderInitialized&&(e=e.replace(/\.basis(\?|$)/,".jpg$1")),lt(function(e,t){var i=t.split("."),n=i[0],r=i.slice(1);if("texture"===n)return e.replace(at,ut.replace("[1-4]","3"));if("pano"===n||"pano_luminance"===n)switch(r[0],r[1]){case"front":case"left":case"up":return e.replace(at,ut.replace("[1-4]","1"));case"down":case"right":case"back":return e.replace(at,ut.replace("[1-4]","2"))}else if("pano_tile"===n||"pano_tile_luminance"===n){r[0],r[1];var s=r[2],o=r[3],a=r[4],u=Math.pow(2,Number(s))*Number(o)+Number(a);if(!isNaN(u))return e.replace(at,"//vr-tile-[1-2].realsee-cdn.com/".replace("[1-2]",String(u%2+1)))}return e.replace(at,ut.replace("[1-4]","3"))}(e,t.key),t)):e.indexOf(ct)>=0?(/\.basis(\?|$)/.test(e)&&!0!==t.basisLoaderInitialized&&(e=e.replace(/\.basis(\?|$)/,".jpg$1")),lt(function(e,t){var i=t.split("."),n=i[0],r=i.slice(1);if("texture"===n)return e.replace(ct,At.replace("[1-4]","3"));if("pano"===n||"pano_luminance"===n)switch(r[0],r[1]){case"front":case"left":case"up":return e.replace(ct,At.replace("[1-4]","1"));case"down":case"right":case"back":return e.replace(ct,At.replace("[1-4]","2"))}else if("pano_tile"===n||"pano_tile_luminance"===n){r[0],r[1];var s=r[2],o=r[3],a=r[4],u=Math.pow(2,Number(s))*Number(o)+Number(a);if(!isNaN(u))return e.replace(ct,"//global-tile-[1-2].realsee-cdn.com/".replace("[1-2]",String(u%2+1)))}return e.replace(ct,At.replace("[1-4]","3"))}(e,t.key),t)):e.indexOf("//test-vr-public.realsee-cdn.com/")>=0?(/\.basis(\?|$)/.test(e)&&!0!==t.basisLoaderInitialized&&(e=e.replace(/\.basis(\?|$)/,".jpg$1")),lt((i=e,t.key,i.replace("//test-vr-public.realsee-cdn.com/","//test-vr-image.realsee-cdn.com/")),t)):e;var i}var dt=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}(r.Mesh),gt=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.needsRender=!0,t.enableTransparent=!0,t}return t.__extends(i,e),i.prototype.getTransparent=function(){return this.enableTransparent},i.prototype.setTransparent=function(e){this.enableTransparent=e,this.traverse((function(t){t instanceof dt&&t.material.forEach((function(t){t.transparent=e}))}))},i.prototype.getMaterial=function(){var e=null;return this.traverse((function(t){if(null===e&&t instanceof dt){var i=t.material[0];e={pano0:i.pano0,pano1:i.pano1,modelAlpha:i.modelAlpha,progress:i.progress,useBlackTransition:i.useBlackTransition,perspToOrtho:i.perspToOrtho,opacity:i.opacity}}})),e},i.prototype.setMaterial=function(e){this.traverse((function(t){t instanceof dt&&t.material.forEach((function(t){void 0!==e.pano0&&(t.pano0=e.pano0),void 0!==e.pano1&&(t.pano1=e.pano1),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)}))}))},i.prototype.disposeMaterial=function(){this.traverse((function(e){if(e instanceof dt){var t=[];e.material.forEach((function(e){var i=e.uniforms;Object.keys(i).map((function(e){if(/^pano\d\_/.test(e))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 dt&&e.geometry.dispose()}))},i}(r.Group),pt=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.floorIndex=0,t}return t.__extends(i,e),i}(gt),Mt=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@-z|qryPr{rH{vs|z-sy|n-}r}a|\\u|Hn\bv{t-rp@-[|znyHn\bv{t-rp@-cvr]|vv|{Hn\bv{t-rp@-|yq]|vv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrrK0v{pyqr-I?l}nlrrK0v{pyqr-Ip|y|l}nlrrK|vq-znv{56-\n--0v{pyqr-IlrrK--0v{pyqr-I?lrrK--0v{pyqr-Ip|y|lrrK--0v{pyqr-Iortv{{|znylrrK--0v{pyqr-Iqrsny{|znylrrK--rpA-n{s|zrq-J-rpA5}|vv|{9->;=6H--rpA-z]|vv|{-J-z|qrycvrZnv-7-n{s|zrqH--[|zny-J-{|znyv\tr5n{s|zrq[|zny6H--cvr]|vv|{-J-:z]|vv|{;\b\tH--|yq]|vv|{-J-5z|qryZnv-7-n{s|zrq6;\b\tH--tyl]|vv|{-J-}|wrpv|{Znv-7-z|qrycvrZnv-7-n{s|zrqH--<<-修正正交相机模拟--rp@-pnzrn[|zny-J-5z|qrycvrZnv-7-rpA5=;=9-=;=9->;=9-=;=66;\b\tH--sy|n-|u|Qvn{pr-J-zn5=;=>9-q|5pnzrn[|zny9-z|qryPr{r-:-pnzrn]|vv|{66H--tyl]|vv|{;-J-zv5-tyl]|vv|{;9-tyl]|vv|{;-7-5-tyl]|vv|{;\t-<-|u|Qvn{pr-69-}r}a|\\u|-6H--tyl]|vv|{;\b-J-zv5-tyl]|vv|{;\b9-tyl]|vv|{;\b-7-5-tyl]|vv|{;\t-<-|u|Qvn{pr-69-}r}a|\\u|-6H\f"),ft=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)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=60qrsv{r-aNb-C;?E@>EB?{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznvH0vs-qrsv{rq5b`RlYbZV[N[PR6{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznvH0vs-qrsv{rq5b`RlYbZV[N[PR6{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-rp@-qvssrH{vs|z-rp@-rzvvrH{vs|z-rp@-}rpynH{vs|z-sy|n-uv{v{rH{vs|z-sy|n-r}|rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH0vs-qrsv{rq5b`Rl]N[\\lcVQR\\6{vs|z-rp?-}n{|cvqr|lv\trH{vs|z-znA-}n{|cvqr|lznvH{vs|z-sy|n-}n{|cvqr|lny}unH{vs|z-nz}yr?Q-}n{|cvqr|lzn}H0r{qvsn\bv{t-rp@-|yq]|vv|{H0v{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{Krp?-|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-<-aNb9-urn-<-]V6H\f|vq-znv{56-\n--rpA-qvssrP|y|-J-rpA5qvssr;to9-|}npv\b6H--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5rp@5=;=69-rp@5=;=69-rp@5=;=69-rp@5=;=66H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--0v{pyqr-I{|znylsntzr{lortv{K--0v{pyqr-I{|znylsntzr{lzn}K--0v{pyqr-Irzvvrzn}lsntzr{K--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--<<-调整曝光值--vnqvn{pr-J-vnqvn{pr-7-r}|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--rp@-}n{|=a|crr-J-5|yq]|vv|{-:-}n{|=lznvh@j;\b\t6-7-zn@5}n{|=lznv6H--rp@-}n{|>a|crr-J-5|yq]|vv|{-:-}n{|>lznvh@j;\b\t6-7-zn@5}n{|>lznv6H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-rrPor5}n{|=lzn}9-}n{|=a|crr6H--rpA-}n{|>P|y|-J-rrPor5}n{|>lzn}9-}n{|>a|crr6H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-rrPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr6;H----}n{|>P|y|;n-J->;=-:-rrPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr6;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-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----}n{|P|y|-J-zv5}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--0vs-qrsv{rq5b`Rl]N[\\lcVQR\\6----rp@-pnzrna|crr-J-|yq]|vv|{-:-pnzrn]|vv|{H----rpA-zn}P||q-J-rpA5pnzrna|crr9->;=6-7-}n{|cvqr|lznvH----rp?--J-rp?5------=;B-8-zn}P||q;-<-zn}P||q;\t-<-}n{|cvqr|lv\tr;9------=;B-:-zn}P||q;\b-<-zn}P||q;\t-<-}n{|cvqr|lv\tr;\b----6H----rpA-vqr|P|y|-J-rr?Q5}n{|cvqr|lzn}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|lny}un6H--0r{qvs--tylSntP|y|-J-rpA5tylSntP|y|;to9-|}npv\b6H--tylSntP|y|-J-zv5}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H\f");function yt(){return"undefined"==typeof document?{}:document.createElementNS("http://www.w3.org/1999/xhtml","img")}var mt=yt();mt.width=mt.height=8;var vt=new r.Texture(mt);vt.name="EMPTY_TEXTURE";var Nt=new r.CubeTexture([mt,mt,mt,mt,mt,mt]);Nt.name="EMPTY_CUBE_TEXTURE",vt.dispose=Nt.dispose=function(){};var Dt=Object.assign({modelAlpha:new r.Uniform(0),progress:new r.Uniform(0),pano0_map:new r.Uniform(Nt),pano0_luminanceMap:new r.Uniform(null),pano0_matrix:new r.Uniform(new r.Matrix4),pano1_map:new r.Uniform(Nt),pano1_luminanceMap:new r.Uniform(null),pano1_matrix:new r.Uniform(new r.Matrix4),modelCenter:new r.Uniform(new r.Vector3),perspToOrtho:new r.Uniform(0)},{exposure:new r.Uniform(1),emissive:new r.Uniform(new r.Color(0)),emissiveMap:new r.Uniform(null),specular:new r.Uniform(new r.Color(1118481)),specularMap:new r.Uniform(null),normalMap:new r.Uniform(null),bumpMap:new r.Uniform(null),shininess:new r.Uniform(30)},r.UniformsLib.common,r.UniformsLib.lights),Et=function(e){function i(t){var i,n,s,o,a,u,c;void 0===t&&(t={});var A=e.call(this,{vertexShader:Mt,fragmentShader:ft,uniforms:r.UniformsUtils.clone(Dt),defines:{USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_BLACK_TRANSITION:!1,USE_PANO_VIDEO:!1},blending:r.NoBlending,lights:!0})||this;return Object.defineProperties(A,{pano0:{get:function(){return this.uniforms.pano0_map.value===Nt?null:{map:this.uniforms.pano0_map.value,luminanceMap:this.uniforms.pano0_luminanceMap.value,matrix:this.uniforms.pano0_matrix.value.clone()}},set:function(e){null===e?(this.uniforms.pano0_map.value=Nt,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity()):(this.uniforms.pano0_map.value=e.map,this.uniforms.pano0_luminanceMap.value=e.luminanceMap,this.uniforms.pano0_matrix.value.copy(e.matrix));var t=null!==this.uniforms.pano0_luminanceMap.value&&null!==this.uniforms.pano1_luminanceMap.value;this.defines.USE_LUMINANCE!==t&&(this.defines.USE_LUMINANCE=t,this.needsUpdate=!0)}},pano1:{get:function(){return this.uniforms.pano1_map.value===Nt?null:{map:this.uniforms.pano1_map.value,luminanceMap:this.uniforms.pano1_luminanceMap.value,matrix:this.uniforms.pano1_matrix.value.clone()}},set:function(e){null===e?(this.uniforms.pano1_map.value=Nt,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity()):(this.uniforms.pano1_map.value=e.map,this.uniforms.pano1_luminanceMap.value=e.luminanceMap,this.uniforms.pano1_matrix.value.copy(e.matrix));var t=null!==this.uniforms.pano0_luminanceMap.value&&null!==this.uniforms.pano1_luminanceMap.value;this.defines.USE_LUMINANCE!==t&&(this.defines.USE_LUMINANCE=t,this.needsUpdate=!0)}},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;var t=e<1?r.NormalBlending:r.NoBlending;t!==this.blending&&(this.blending=t,this.needsUpdate=!0)}},perspToOrtho:{get:function(){return this.uniforms.perspToOrtho.value},set:function(e){this.uniforms.perspToOrtho.value=e}}}),A.pano0=null!==(i=t.pano0)&&void 0!==i?i:null,A.pano1=null!==(n=t.pano1)&&void 0!==n?n:null,A.modelAlpha=null!==(s=t.modelAlpha)&&void 0!==s?s:1,A.progress=null!==(o=t.progress)&&void 0!==o?o:0,A.useBlackTransition=null!==(a=t.useBlackTransition)&&void 0!==a&&a,A.perspToOrtho=null!==(u=t.perspToOrtho)&&void 0!==u?u:0,A.opacity=null!==(c=t.opacity)&&void 0!==c?c:1,A.originOpacity=1,A}return t.__extends(i,e),i}(r.ShaderMaterial),wt=function(e){function i(t){var i=t.preserveDrawingBuffer,n=void 0===i||i,s=t.backgroundColor,o=void 0===s?1579548:s,a=t.backgroundAlpha,u=void 0===a?1:a,c=t.pixelRatio,A=void 0===c?1:c,l=t.antialias,h=void 0!==l&&l,d=e.call(this,{antialias:h,preserveDrawingBuffer:n,alpha:u<1})||this;return d.setPixelRatio(A),d.setClearColor(o,u),d.outputEncoding=r.sRGBEncoding,d.autoClear=!0,d}return t.__extends(i,e),i}(r.WebGLRenderer),It=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}(r.Scene);var Tt=2*Math.PI,xt=Math.PI/2;function jt(e){return e>0&&e<=Tt?e:(e%Tt+Tt)%Tt}var zt,Ct,bt,St,Lt=function(e){function i(t){var i=e.call(this,t,1,.1,1e3)||this;return i.pose={longitude:0,latitude:0,fov:t,distance:0,offset:new r.Vector3},i.computePose(),i}return t.__extends(i,e),i.prototype.computePose=function(){var e=this.getWorldDirection(new r.Vector3);return this.pose.longitude=jt(-Math.atan2(e.x,-e.z)),this.pose.latitude=-Math.asin(e.y/1),this.pose.fov=this.fov,this.pose.distance=0,this.pose.offset.copy(this.position),this},i.prototype.setFromPose=function(e){var t,i,n,s,o,a=jt(null!==(t=e.longitude)&&void 0!==t?t:this.pose.longitude),u=Math.max(1e-4-xt,Math.min(xt-1e-4,null!==(i=e.latitude)&&void 0!==i?i:this.pose.latitude)),c=null!==(n=e.fov)&&void 0!==n?n:this.pose.fov,A=null!==(s=e.distance)&&void 0!==s?s:this.pose.distance,l=null!==(o=e.offset)&&void 0!==o?o:this.pose.offset,h=function(e){var t=Math.abs(Math.cos(e.latitude));return new r.Vector3(-Math.sin(e.longitude)*t,-Math.sin(e.latitude),-Math.cos(e.longitude)*t)}({longitude:a,latitude:u}).normalize();return this.position.set(0,0,0),this.lookAt(h),this.position.add(l).sub(h.clone().setLength(A)),this.fov!==c&&(this.fov=c,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=a,this.pose.latitude=u,this.pose.fov=c,this.pose.distance=A,this.pose.offset.copy(l),this},i.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,distance:this.pose.distance,offset:this.pose.offset.clone()}},i}(r.PerspectiveCamera),Ot=function(){function e(e,t,i){this.x=e,this.y=t,this.z=i}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},e.prototype.set=function(e,t,i){return this.x=e,this.y=t,this.z=i,this},e.prototype.fromArray=function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this},e.prototype.multiplyScalar=function(e){return this.x*=e,this.y*=e,this.z*=e,this},e.prototype.subVectors=function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y+this.z*e.z},e.prototype.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},e.prototype.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},e.prototype.clone=function(){return new e(this.x,this.y,this.z)},e}(),Bt=function(e,t,i){this.extents=e,this.startIndex=t,this.endIndex=i},Qt=function(e,t){this.triangle=e,this.intersectionPoint=t},kt=(zt=new Ot(0,0,0),Ct=new Ot(0,0,0),bt=new Ot(0,0,0),St=new Ot(0,0,0),function(e,t,i,n,r,s){Ct.subVectors(t,e),bt.subVectors(i,e),St.crossVectors(Ct,bt);var o,a=r.dot(St);if(a>0){if(s)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}zt.subVectors(n,e);var u=o*r.dot(bt.crossVectors(zt,bt));if(u<0)return null;var c=o*r.dot(Ct.cross(zt));if(c<0)return null;if(u+c>a)return null;var A=-o*zt.dot(St);if(A<0)return null;var l=A/a;return new Ot(0,0,0).copy(r).multiplyScalar(l).add(n)}),Pt=function(e,t){this.min=e,this.max=t};function Ut(e,t,i){var n=new Pt(0,0);t.x>=0?(n.min=(i.extents[0]-e.x)*t.x,n.max=(i.extents[3]-e.x)*t.x):(n.min=(i.extents[3]-e.x)*t.x,n.max=(i.extents[0]-e.x)*t.x);var r=new Pt(0,0);if(t.y>=0?(r.min=(i.extents[1]-e.y)*t.y,r.max=(i.extents[4]-e.y)*t.y):(r.min=(i.extents[4]-e.y)*t.y,r.max=(i.extents[1]-e.y)*t.y),n.min>r.max||r.min>n.max)return!1;r.min>n.min&&(n.min=r.min),r.max<n.max&&(n.max=r.max);var s=new Pt(0,0);return t.z>=0?(s.min=(i.extents[2]-e.z)*t.z,s.max=(i.extents[5]-e.z)*t.z):(s.min=(i.extents[5]-e.z)*t.z,s.max=(i.extents[2]-e.z)*t.z),!(n.min>s.max||s.min>n.max)&&(s.min>n.min&&(n.min=s.min),s.max<n.max&&(n.max=s.max),!(n.max<0))}function Rt(e,t,i,n,r){if(i>=n)return[0,0,0,0,0,0];for(var s=1/0,o=1/0,a=1/0,u=-1/0,c=-1/0,A=-1/0,l=i,h=void 0,d=void 0;l<n;l++)(d=t[h=6*e[l]])<s&&(s=d),(d=t[h+1])<o&&(o=d),(d=t[h+2])<a&&(a=d),(d=t[h+3])>u&&(u=d),(d=t[h+4])>c&&(c=d),(d=t[h+5])>A&&(A=d);return[s-r,o-r,a-r,u+r,c+r,A+r]}var _t=function(){function e(){}return e.prototype.create=function(e){return this.trianglesArray=e,this},e.prototype.splitNode=function(e){if(!this.trianglesArray)throw new Error("bvh-tree never perpared. call `create` to initialize.");for(var t=this.trianglesArray,i=t.length/9,n=new Uint32Array(i),r=new Float32Array(6*i),s=[],o=1/0,a=1/0,u=1/0,c=-1/0,A=-1/0,l=-1/0,h=0,d=0,g=0,p=void 0,M=void 0,f=void 0,y=void 0,m=void 0,v=void 0,N=void 0;h<i;h++,d+=6,g+=9)n[h]=h,p=y=t[g],(N=t[g+3])<p&&(p=N),N>y&&(y=N),(N=t[g+6])<p&&(p=N),N>y&&(y=N),M=m=t[g+1],(N=t[g+4])<M&&(M=N),N>m&&(m=N),(N=t[g+7])<M&&(M=N),N>m&&(m=N),f=v=t[g+2],(N=t[g+5])<f&&(f=N),N>v&&(v=N),(N=t[g+8])<f&&(f=N),N>v&&(v=N),p<o&&(o=p),y>c&&(c=y),M<a&&(a=M),m>A&&(A=m),f<u&&(u=f),v>l&&(l=v),r[d]=p,r[d+1]=M,r[d+2]=f,r[d+3]=y,r[d+4]=m,r[d+5]=v;var D,E=new Bt([o,a,u,c,A,l],0,i);function w(t){for(var i=t.startIndex,o=t.endIndex,a=t.extents,u=[a[3]-a[0],a[4]-a[1],a[5]-a[2]],c=[0,1,2].sort((function(e,t){return u[t]-u[e]})),A=0;A<3;A++){for(var l=c[A],h=a[l]+a[l+3],d=i,g=o-1,p=-1,M=void 0;d<g;)-1===p?(M=n[d],r[6*M+l]+r[6*M+l+3]<h?d++:p=M):(M=n[g],r[6*M+l]+r[6*M+l+3]>=h||(n[d]=M,n[g]=p,p=-1,d++),g--);if(d>i){var f=new Bt(Rt(n,r,i,d,1e-6),i,d);f.endIndex-f.startIndex>e&&s.push(f);var y=new Bt(Rt(n,r,d,o,1e-6),d,o);y.endIndex-y.startIndex>e&&s.push(y),t.node0=f,t.node1=y,t.startIndex=0,t.endIndex=0;break}}}for(s.push(E);D=s.pop();)w(D);return this.offsetArray=n,this.rootNode=E,this},e.prototype.intersectRay=function(e,t,i){if(!this.trianglesArray)throw new Error("bvh-tree never perpared. call `create` to initialize.");if(!this.rootNode||!this.offsetArray)throw new Error("bvh-tree never perpared. call `splitNode` to perpare.");for(var n,r=this.trianglesArray,s=this.offsetArray,o=this.rootNode,a=[],u=[],c=new Ot(1/t.x,1/t.y,1/t.z),A=[o];n=A.pop();)if(Ut(e,c,n)){n.node0&&A.push(n.node0),n.node1&&A.push(n.node1);for(var l=n.startIndex;l<n.endIndex;l++)a.push(s[l])}for(var h=new Ot(0,0,0),d=new Ot(0,0,0),g=new Ot(0,0,0),p=new Ot(e.x,e.y,e.z),M=new Ot(t.x,t.y,t.z),f=(l=0,void 0),y=a.length;l<y;l++){f=9*a[l],h.x=r[f],h.y=r[f+1],h.z=r[f+2],d.x=r[f+3],d.y=r[f+3+1],d.z=r[f+3+2],g.x=r[f+6],g.y=r[f+6+1],g.z=r[f+6+2];var m=kt(h,d,g,p,M,i);m&&u.push(new Qt([h.clone(),d.clone(),g.clone()],m))}return u},e.prototype.dispose=function(){delete this.offsetArray,delete this.rootNode},e}(),Yt=null,Ft=!1,Ht=[];function Vt(e){if(void 0===e&&(e=!1),e||!Ft)if(Yt)Ft=!1;else{Ft=!0;var t=Ht.shift();if(t){try{t()}catch(e){}ot.shared.add((function(){return Vt(!0)}),!0,2)}else Ft=!1}}function Gt(){Yt=null,Vt()}function Kt(e){return new Promise((function(t,i){Ht.push((function(){try{t(e())}catch(e){i(e)}})),Vt()}))}function qt(){var e={OutWindow:function(){this._windowSize=0}};return e.OutWindow.prototype.create=function(e){this._buffer&&this._windowSize===e||(this._buffer=[]),this._windowSize=e,this._pos=0,this._streamPos=0},e.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}},e.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},e.OutWindow.prototype.setStream=function(e){this.releaseStream(),this._stream=e},e.OutWindow.prototype.init=function(e){e||(this._streamPos=0,this._pos=0)},e.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()},e.OutWindow.prototype.putByte=function(e){this._buffer[this._pos++]=e,this._pos>=this._windowSize&&this.flush()},e.OutWindow.prototype.getByte=function(e){var t=this._pos-e-1;return t<0&&(t+=this._windowSize),this._buffer[t]},e.RangeDecoder=function(){},e.RangeDecoder.prototype.setStream=function(e){this._stream=e},e.RangeDecoder.prototype.releaseStream=function(){this._stream=null},e.RangeDecoder.prototype.init=function(){var e=5;for(this._code=0,this._range=-1;e--;)this._code=this._code<<8|this._stream.readByte()},e.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},e.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)},e.initBitModels=function(e,t){for(;t--;)e[t]=1024},e.BitTreeDecoder=function(e){this._models=[],this._numBitLevels=e},e.BitTreeDecoder.prototype.init=function(){e.initBitModels(this._models,1<<this._numBitLevels)},e.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)},e.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},e.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},e.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new e.BitTreeDecoder(8),this._numPosStates=0},e.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new e.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new e.BitTreeDecoder(3)},e.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(e.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},e.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)},e.Decoder2=function(){this._decoders=[]},e.Decoder2.prototype.init=function(){e.initBitModels(this._decoders,768)},e.Decoder2.prototype.decodeNormal=function(e){var t=1;do{t=t<<1|e.decodeBit(this._decoders,t)}while(t<256);return 255&t},e.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},e.LiteralDecoder=function(){},e.LiteralDecoder.prototype.create=function(t,i){var n;if(!this._coders||this._numPrevBits!==i||this._numPosBits!==t)for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=i,this._coders=[],n=1<<this._numPrevBits+this._numPosBits;n--;)this._coders[n]=new e.Decoder2},e.LiteralDecoder.prototype.init=function(){for(var e=1<<this._numPrevBits+this._numPosBits;e--;)this._coders[e].init()},e.LiteralDecoder.prototype.getDecoder=function(e,t){return this._coders[((e&this._posMask)<<this._numPrevBits)+((255&t)>>>8-this._numPrevBits)]},e.Decoder=function(){this._outWindow=new e.OutWindow,this._rangeDecoder=new e.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new e.BitTreeDecoder(4),this._lenDecoder=new e.LenDecoder,this._repLenDecoder=new e.LenDecoder,this._literalDecoder=new e.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new e.BitTreeDecoder(6),this._posSlotDecoder[1]=new e.BitTreeDecoder(6),this._posSlotDecoder[2]=new e.BitTreeDecoder(6),this._posSlotDecoder[3]=new e.BitTreeDecoder(6)},e.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)},e.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)},e.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),e.initBitModels(this._isMatchDecoders,192),e.initBitModels(this._isRep0LongDecoders,192),e.initBitModels(this._isRepDecoders,12),e.initBitModels(this._isRepG0Decoders,12),e.initBitModels(this._isRepG1Decoders,12),e.initBitModels(this._isRepG2Decoders,12),e.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},e.Decoder.prototype.decode=function(t,i,n){var r,s,o,a,u,c,A=0,l=0,h=0,d=0,g=0,p=0,M=0;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(i),this.init();n<0||p<n;)if(r=p&this._posStateMask,0===this._rangeDecoder.decodeBit(this._isMatchDecoders,(A<<4)+r))s=this._literalDecoder.getDecoder(p++,M),M=A>=7?s.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(l)):s.decodeNormal(this._rangeDecoder),this._outWindow.putByte(M),A=A<4?0:A-(A<10?3:6);else{if(1===this._rangeDecoder.decodeBit(this._isRepDecoders,A))o=0,0===this._rangeDecoder.decodeBit(this._isRepG0Decoders,A)?0===this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(A<<4)+r)&&(A=A<7?9:11,o=1):(0===this._rangeDecoder.decodeBit(this._isRepG1Decoders,A)?a=h:(0===this._rangeDecoder.decodeBit(this._isRepG2Decoders,A)?a=d:(a=g,g=d),d=h),h=l,l=a),0===o&&(o=2+this._repLenDecoder.decode(this._rangeDecoder,r),A=A<7?8:11);else if(g=d,d=h,h=l,o=2+this._lenDecoder.decode(this._rangeDecoder,r),A=A<7?7:10,(u=this._posSlotDecoder[o<=5?o-2:3].decode(this._rangeDecoder))>=4){if(l=(2|1&u)<<(c=(u>>1)-1),u<14)l+=e.reverseDecode2(this._posDecoders,l-u-1,this._rangeDecoder,c);else if(l+=this._rangeDecoder.decodeDirectBits(c-4)<<4,(l+=this._posAlignDecoder.reverseDecode(this._rangeDecoder))<0){if(-1===l)break;return!1}}else l=u;if(l>=p||l>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(l,o),p+=o,M=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},e.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)))},e.decompress=function(t,i,n,r){var s=new e.Decoder;if(!s.setDecoderProperties(t))throw"Incorrect stream properties";if(!s.decode(i,n,r))throw"Error in data stream";return!0},e.decompressFile=function(t,i){var n,r=new e.Decoder;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(n=t.readByte(),n|=t.readByte()<<8,n|=t.readByte()<<16,n+=16777216*t.readByte(),t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,i,n))throw"Error in data stream";return!0},e}var Wt=qt();var Xt="\nvar decodeLZMA = (function() {\n var LZMA = (".concat(qt.toString(),")();\n return function(data, callback) {\n return (").concat(function(e,t,i){try{var n={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},r=n.data.length,s={data:[],offset:0,writeByte:function(e){var t=Math.floor(this.offset/r);this.data[t]||(this.data[t]=new Uint8Array(r)),this.data[t][this.offset%r]=e,this.offset++}};e.decompressFile(n,s);for(var o=new Uint8Array(s.offset),a=0;a<s.offset;a++)o[a]=s.data[Math.floor(a/r)][a%r];i(null,o)}catch(e){i(e)}}.toString(),")(LZMA, data, callback);\n }\n})();\n\nvar decodeLZMAWithWASM = (function() {\n var LZMA_WASM = (").concat(function(){return function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),n=0;n<t.length;n++)i[t.charCodeAt(n)]=n;var r,s,o,a,u,c=.75*e.length,A=e.length,l=0;"="===e[e.length-1]&&(c--,"="===e[e.length-2]&&c--);var h=new ArrayBuffer(c),d=new Uint8Array(h);for(r=0;r<A;r+=4)s=i[e.charCodeAt(r)],o=i[e.charCodeAt(r+1)],a=i[e.charCodeAt(r+2)],u=i[e.charCodeAt(r+3)],d[l++]=s<<2|o>>4,d[l++]=(15&o)<<4|a>>2,d[l++]=(3&a)<<6|63&u;return h}("AGFzbQEAAAABSg1gAABgAX8Bf2ACf38Bf2AEf39/fwBgA39/fwBgAX8AYAJ/fwBgA39/fwF/YAR/f39/AX9gAn9/AGABfwF/YAABf2AEf39/fwF/AhsCA2VudgVhYm9ydAADA2VudgZtZW1vcnkCAAEDJiUBAQkKAgoKCwsLCwsAAgoBAgQKAQYFCAoFBQQEBwgCBwwCAQAABAQBcAABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwc9BgZtZW1vcnkCAAV0YWJsZQEABXJlc2V0AA0KbmV3VThBcnJheQAQCnVucGFja1NpemUAFAZkZWNvZGUAIwgBJAkHAQBBAAsBJQqAViVoAQN/IABBgICAgARLBEAACyMBIgEgAEEBIABBAUsbakEHakF4cSICPwAiA0EQdEsEQCADIAIgAWtB//8DakGAgHxxQRB2IgAgAyAAShtAAEEASARAIABAAEEASARAAAsLCyACJAEgAQsbAQF/QQFBICAAQQdqZ2t0EAEiASAANgIAIAELkQMBAX8gAUUEQA8LIABBADoAACAAIAFqQQFrQQA6AAAgAUECTQRADwsgAEEBakEAOgAAIABBAmpBADoAACAAIAFqIgJBAmtBADoAACACQQNrQQA6AAAgAUEGTQRADwsgAEEDakEAOgAAIAAgAWpBBGtBADoAACABQQhNBEAPC0EAIABrQQNxIgIgAGoiAEEANgIAIAEgAmtBfHEiASAAakEEa0EANgIAIAFBCE0EQA8LIABBBGpBADYCACAAQQhqQQA2AgAgACABaiICQQxrQQA2AgAgAkEIa0EANgIAIAFBGE0EQA8LIABBDGpBADYCACAAQRBqQQA2AgAgAEEUakEANgIAIABBGGpBADYCACAAIAFqIgJBHGtBADYCACACQRhrQQA2AgAgAkEUa0EANgIAIAJBEGtBADYCACAAQQRxQRhqIgIgAGohACABIAJrIQEDQCABQSBPBEAgAEIANwMAIABBCGpCADcDACAAQRBqQgA3AwAgAEEYakIANwMAIAFBIGshASAAQSBqIQAMAQsLC1EBA38gAEH+////AEsEQEEAQSBBLUEnEAAACyAAQQJ0IgMQAiECQQgQASIBQQA2AgAgAUEANgIEIAEgAjYCACABIAA2AgQgAkEIaiADEAMgAQtmAQF/IAFB/P///wFLBEBBAEHAAEEXQSIQAAALIAFBAXQiARACIgJBCGogARADIABFBEBBDBABIQALIABBADYCACAAQQA2AgQgAEEANgIIIAAgAjYCACAAQQA2AgQgACABNgIIIAALCgBBDBABIAAQBQsuAQF/QQgQASIBQQA2AgAgAUEANgIEIAEgADYCBCABQQEgASgCBHQQBjYCACABC6EBAQR/QRAQASIBQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgxBEBAEIQIDQCAAQRBIBEBBAxAHIQMgAigCACAAQQJ0aiADNgIIIABBAWohAAwBCwsgASACNgIEQRAQBCECQQAhAANAIABBEEgEQEEDEAchAyACKAIAIABBAnRqIAM2AgggAEEBaiEADAELCyABIAI2AgggAUEIEAc2AgwgAQs0AQF/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEAOgAUIABBADYCGCAAQQA2AhwgAEEANgIgIABBADYCJCAAQQA2AiggAEEANgIsIABBADYCMCAAQQA2AjQgAEEANgI4IABBADYCPCAAQQA2AkAgAEEANgJEIABBADYCSCAAQQA2AkxBBBAEIQIDQCABQQRIBEBBBhAHIQMgAigCACABQQJ0aiADNgIIIAFBAWohAQwBCwsgACACNgIkIABBBBAHNgIoIABB8wAQBjYCLCAAQcABEAY2AjAgAEEMEAY2AjQgAEEMEAY2AjggAEEMEAY2AjwgAEEMEAY2AkAgAEHAARAGNgJEIAAQCDYCSCAAEAg2AkwgABAJNgIEIAAQCjYCCCAACx8BAX9BCBABIgBBADYCACAAQQA2AgQgABALNgIAIAALCgAjACQBEAwkAwthAQF/IAFB+P///wNLBEBBAEHAAEEXQSIQAAALIAEQAiICQQhqIAEQAyAARQRAQQwQASEACyAAQQA2AgAgAEEANgIEIABBADYCCCAAIAI2AgAgAEEANgIEIAAgATYCCCAACwoAQQwQASAAEA4LBgAgABAPCyoAIAEgACgCCE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EEBgaIAAoAjRBASQEEBgaIAAoAjhBASQEEBgaIAAoAjxBASQEEBgaIAAoAkBBASQEEBgaIAAoAkRBASQEEBgaIAAoAkgQGSAAKAJMEBkLyAwBA38DQCABQQNxIAIgAhsEQCAAIgRBAWohACABIgNBAWohASAEIAMtAAA6AAAgAkEBayECDAELCyAAQQNxRQRAA0AgAkEQTwRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAEEIaiABQQhqKAIANgIAIABBDGogAUEMaigCADYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsgAkEIcQRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAUEIaiEBIABBCGohAAsgAkEEcQRAIAAgASgCADYCACABQQRqIQEgAEEEaiEACyACQQJxBEAgACABLwEAOwEAIAFBAmohASAAQQJqIQALIAJBAXEEQCAAIAEtAAA6AAALDwsgAkEgTwRAAkACQAJAIABBA3EiA0EBRwRAIANBAkYNASADQQNGDQIMAwsgASgCACEFIAAgASIDLQAAOgAAIABBAWoiASABIANBAWoiAS0AADoAAEEBaiIEQQFqIQAgAUEBaiIDQQFqIQEgBCADLQAAOgAAIAJBA2shAgNAIAJBEU8EQCAAIAFBAWooAgAiA0EIdCAFQRh2cjYCACAAQQRqIAFBBWooAgAiBUEIdCADQRh2cjYCACAAQQhqIAFBCWooAgAiA0EIdCAFQRh2cjYCACAAQQxqIAFBDWooAgAiBUEIdCADQRh2cjYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsMAgsgASgCACEFIAAgAS0AADoAACAAQQFqIgRBAWohACABQQFqIgNBAWohASAEIAMtAAA6AAAgAkECayECA0AgAkESTwRAIAAgAUECaigCACIDQRB0IAVBEHZyNgIAIABBBGogAUEGaigCACIFQRB0IANBEHZyNgIAIABBCGogAUEKaigCACIDQRB0IAVBEHZyNgIAIABBDGogAUEOaigCACIFQRB0IANBEHZyNgIAIAFBEGohASAAQRBqIQAgAkEQayECDAELCwwBCyABKAIAIQUgACIEQQFqIQAgAS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IAQgBzYCDCAEIAM2AhAgBCAFOgAUIARBADYCHEEAIQIDQAJAIAJBBE8NACAEIAQoAhwgBigCBCAGKAIAIAJBAWpqai0ACCACQQN0dHI2AhwgAkEBaiECDAELCyAEIAQoAhw2AhggBCgCGEGAIEkEQCAEQYAgNgIYC0EAIQJBACEFQQAhAwNAAkAgA0EITg0AIAYgA0EFahARQf8BcSIEQf8BRwRAQQEhBQsgBCADQQN0dCACciECIANBAWohAwwBCwsgACgCACAFRToAACAAKAIAKAIEIAE2AgAgACgCABAWAkAgACgCACAFIAIQICIBQQFGDQAgAUEDRwRAIAFBAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=")}.toString(),")();\n return function(data, callback) {\n return (").concat(function(e,t,i){try{var n=new WebAssembly.Memory({initial:16}),r=new WebAssembly.Module(e),s=new WebAssembly.Instance(r,{env:{memory:n,abort:function(){i(new Error("webAssembly abort"))}}}).exports,o=s.newU8Array(t.length);new Uint8Array(n.buffer,o+24,t.length).set(t);var a=s.decode(o),u=new Uint32Array(n.buffer,a,4),c=u[0],A=u[2],l=u[3];c?i(null,new Uint8Array(n.buffer,l+24,A).slice(0,A)):i(new Error("lzma deocder error"))}catch(e){i(e)}}.toString(),')(LZMA_WASM, data, callback);\n }\n})();\n\nself.onmessage = function(event) {\n var packet = event.data;\n if (!packet.id) {\n postMessage({ id: packet.id, error: "No incoming id." });\n return;\n }\n if (!packet.data) {\n postMessage({ id: packet.id, error: "No input data." });\n return;\n }\n if (packet.type == "decompress") {\n if (packet.data.constructor !== Uint8Array) {\n postMessage({ id: packet.id, error: "Input data is not Uint8Array." });\n }\n const callback = function(error, result) {\n if (error) {\n postMessage({ id: packet.id, error: error.toString() });\n } else {\n postMessage({ id: packet.id, result: result, error: null }, [ result.buffer ]);\n }\n }\n if (typeof WebAssembly !== "undefined" && WebAssembly.instantiate) {\n decodeLZMAWithWASM(packet.data, callback);\n } else {\n decodeLZMA(packet.data, callback);\n }\n return;\n }\n postMessage({ id: packet.id, error: "type never matched." });\n};\n'),Zt="undefined"!=typeof Worker&&"undefined"!=typeof Blob,Jt="";if(Zt)try{var $t=new Blob([Xt],{type:"text/javascript"});Jt=URL.createObjectURL($t)}catch(e){}var ei=function(){function e(){var e=this;if(!Zt)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var t=this.worker=new Worker(Jt);t.onmessage=function(t){var i=t.data,n=i.id,r=i.result,s=i.error,o=e.getKey(n);e.requests[o]&&(s?e.requests[o](new Error(s)):e.requests[o](null,r),delete e.requests[o])},t.onerror=function(e){return console.error(e)}}return e.prototype.getKey=function(e){return"key_"+String(e)},e.prototype.decompress=function(e,t){var i=++this.callCounter;this.requests[this.getKey(i)]=t,this.worker.postMessage({type:"decompress",id:i,data:e},[e.buffer])},e.prototype.terminate=function(){this.worker.terminate()},e.support=Zt,e}();function ti(e){return Array.prototype.reduce.call(e,(function(e,t,i){return e|t<<8*i}),0)}function ii(e){var t=new Uint8Array(e),i=ti(t.slice(0,4));if(i>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var n=[],r=[],s=4+4*i,o=0;o<i;o++)r[o]=ti(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 ei.support?function(e){for(var t=[],i=e.length,n=function(i){t.push(new Promise((function(t,n){var r=new ei;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++}};Wt.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 ni(e,t){for(var i={},n=0,r=t;n<r.length;n++){var s=r[n];s in e&&(i[s]=e[s])}return i}var ri=!1;try{ri="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}var si=[];function oi(){var e=this.src;this.onerror=this.onload=Pe,this.removeAttribute("src"),/^blob\:/.test(e)&&URL.revokeObjectURL(e),this.close=Pe}function ai(){si.push(this)}function ui(){return Object.assign(new Image,{crossOrigin:"",close:oi})}function ci(e){return new Promise((function(t,i){var n=ui();n.onload=function(){n.onload=n.onerror=Pe,setTimeout((function(){return t(n)}),30)},n.onerror=function(){var e=n.src;n.onload=n.onerror=Pe,n.close(),i(new Error("image load error: ".concat(e)))},n.src=URL.createObjectURL(e)}))}function Ai(e,t){if(t&&(e.width>t.width||e.height>t.height)){var i=function(e,t){var i=si.shift();if(i)return i.width=e,i.height=t,i;if(ri){var n=new OffscreenCanvas(e,t);return Object.assign(n,{close:ai})}return n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),Object.assign(n,{close:ai})}(Math.min(e.width,t.width),Math.min(e.height,t.height)),n=i.getContext("2d");n.clearRect(0,0,i.width,i.height),n.drawImage(e,0,0,i.width,i.height),e.close();var s=new r.Texture(i);s.needsUpdate=!0,s.flipY=!0;var o=s.dispose;return s.dispose=function(){i.close(),o.call(s),delete s.dispose},s}var a=new r.Texture(e);a.needsUpdate=!0,a.flipY=!0;var u=a.dispose;return a.dispose=function(){e.close(),u.call(a),delete a.dispose},a}var li=new r.WebGLRenderTarget(1,1),hi=new r.OrthographicCamera(-1,1,1,-1,0,1),di=new r.BufferGeometry;di.setAttribute("position",new r.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),di.setAttribute("uv",new r.Float32BufferAttribute([0,2,0,0,2,0],2));var gi=new r.Mesh(di),pi=new r.Scene;pi.add(gi);var Mi,fi=new r.RawShaderMaterial({uniforms:{map:{value:null}},vertexShader:"\n void main() {\n gl_Position = vec4(0, 0, 0, 0);\n }\n ",fragmentShader:"\n uniform sampler2D map;\n void main() {\n gl_FragColor = textureCube(map, vec3(0, 0));\n }\n "}),yi=new r.RawShaderMaterial({uniforms:{map:{value:null}},vertexShader:"\n void main() {\n gl_Position = vec4(0, 0, 0, 0);\n }\n ",fragmentShader:"\n uniform samplerCube map;\n void main() {\n gl_FragColor = textureCube(map, vec3(0, 0, 0));\n }\n "});function mi(e,t,i){return void 0!==t.flipY&&(e.flipY=t.flipY),void 0!==t.format&&(e.format=t.format),void 0!==t.encoding&&(e.encoding=t.encoding),void 0!==t.minFilter&&(e.minFilter=t.minFilter),void 0!==t.magFilter&&(e.magFilter=t.magFilter),i?new Promise((function(t){ot.shared.add((function(){try{var n=i.getRenderTarget();i.setRenderTarget(li),e instanceof r.CubeTexture?(gi.material=yi,yi.uniforms.map.value=e,i.render(pi,hi),yi.uniforms.map.value=null):(gi.material=fi,fi.uniforms.map.value=e,i.render(pi,hi),yi.uniforms.map.value=null),i.setRenderTarget(n),t(e)}catch(i){t(e)}}),!0,1)})):Promise.resolve(e)}var vi='\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',Ni={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},Di={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779},Ei=((Mi={})[Ni.cTFBC1]=Di.COMPRESSED_RGB_S3TC_DXT1_EXT,Mi[Ni.cTFBC3]=Di.COMPRESSED_RGBA_S3TC_DXT5_EXT,Mi),wi=function(){function e(){}return e.setTranscoderPath=function(e){return this.transcoderPath=e,this},e.setWorkerLimit=function(e){return this.workerLimit=e,this},e.isInitialized=function(){return 0!==this.workerPool.filter((function(e){return e._initialized})).length},e.detectSupport=function(t){var i=this.workerConfig;if(i.astcSupported=!!t.extensions.get("WEBGL_compressed_texture_astc"),i.bptcSupported=!!t.extensions.get("EXT_texture_compression_bptc"),i.etcSupported=!!t.extensions.get("WEBGL_compressed_texture_etc1"),i.dxtSupported=!!t.extensions.get("WEBGL_compressed_texture_s3tc"),i.pvrtcSupported=!!t.extensions.get("WEBGL_compressed_texture_pvrtc")||!!t.extensions.get("WEBKIT_WEBGL_compressed_texture_pvrtc"),i.astcSupported)i.format=e.BASIS_FORMAT.cTFASTC_4x4;else if(i.bptcSupported)i.format=e.BASIS_FORMAT.cTFBC7_M5;else if(i.dxtSupported)i.format=e.BASIS_FORMAT.cTFBC3;else if(i.pvrtcSupported)i.format=e.BASIS_FORMAT.cTFPVRTC1_4_RGBA;else{if(!i.etcSupported)throw new Error("BasisTextureLoader: No suitable compressed texture format found.");i.format=e.BASIS_FORMAT.cTFETC1}return this},e.createTexture=function(e){var t,i,n=this,s=e.byteLength,o=this._allocateWorker(s).then((function(r){return t=r,i=n.workerNextTaskID++,new Promise((function(n,r){t._callbacks[i]={resolve:n,reject:r},t.postMessage({type:"transcode",id:i,buffer:e},[e])}))})).then((function(e){var t,i=n.workerConfig,s=e.width,o=e.height,a=e.mipmaps;switch(e.format){case Ni.cTFASTC_4x4:t=new r.CompressedTexture(a,s,o,r.RGBA_ASTC_4x4_Format);break;case Ni.cTFBC1:case Ni.cTFBC3:t=new r.CompressedTexture(a,s,o,Ei[i.format],r.UnsignedByteType);break;case Ni.cTFETC1:t=new r.CompressedTexture(a,s,o,r.RGB_ETC1_Format);break;case Ni.cTFPVRTC1_4_RGB:t=new r.CompressedTexture(a,s,o,r.RGB_PVRTC_4BPPV1_Format);break;case Ni.cTFPVRTC1_4_RGBA:t=new r.CompressedTexture(a,s,o,r.RGBA_PVRTC_4BPPV1_Format);break;default:throw new Error("BasisTextureLoader: No supported format available.")}return t.minFilter=1===a.length?r.LinearFilter:r.LinearMipmapLinearFilter,t.magFilter=r.LinearFilter,t.generateMipmaps=!1,t.needsUpdate=!0,t}));return o.catch((function(){return!0})).then((function(){t&&i&&(t._taskLoad-=s,delete t._callbacks[i])})),o},e._initTranscoder=function(){var e=this;if(!this.transcoderPending){var t=new r.FileLoader;t.setPath(this.transcoderPath);var i=new Promise((function(e,i){t.load("basis_transcoder.js",e,void 0,i)})),n=new r.FileLoader;n.setPath(this.transcoderPath),n.setResponseType("arraybuffer");var s=new Promise((function(e,t){n.load("basis_transcoder.wasm",e,void 0,t)}));this.transcoderPending=Promise.all([i,s]).then((function(t){var i=t[0],n=t[1],r=["/* basis_transcoder.js */",i,"/* worker */",vi].join("\n");e.workerSourceURL=URL.createObjectURL(new Blob([r])),e.transcoderBinary=n}))}return this.transcoderPending},e._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.info("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, "'.concat(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}))},e.prototype.dispose=function(){for(var t=0;t<e.workerPool.length;t++)e.workerPool[t].terminate();return e.workerPool.length=0,this},e.BASIS_FORMAT=Ni,e.DXT_FORMAT=Di,e.DXT_FORMAT_MAP=Ei,e.transcoderPath="https://vrlab-public.ljcdn.com/release/static/image/release/five/basis/",e.transcoderBinary=null,e.transcoderPending=null,e.workerLimit=1,e.workerPool=[],e.workerNextTaskID=1,e.workerSourceURL="",e.workerConfig={format:null,astcSupported:!1,bptcSupported:!1,etcSupported:!1,dxtSupported:!1,pvrtcSupported:!1},e}();function Ii(e){var t=e.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}var Ti=function(){function e(e){this.timeout=e.timeout,this.allowHosts=e.allowHosts,this.networkSubscribe=e.networkSubscribe}return e.prototype.setAllowHosts=function(e){this.allowHosts=e},e.prototype.setNetworkSubscribe=function(e){this.networkSubscribe=e},e.prototype.load=function(e,i,n,s,o,a){var u;void 0===i&&(i={}),void 0===n&&(n=Pe),void 0===s&&(s=Pe),void 0===o&&(o=Pe);var c=Ii(e),A={timeout:this.timeout,allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe},l=null!==(u=i.viaAjax)&&void 0!==u&&u,h=Ze(e),d=/^https?:$/.test(c),g=/\.basis$/.test(Je(e).split("?")[0]);if(h?l=!0:d||(l=!1),l){if(g){var p=null,M="arraybuffer";return!0===i.flipY?Promise.reject(new Error(".basis cannnot set flipY: true.")):tt(e,t.__assign(t.__assign({},A),{responseType:M}),void 0,void 0,o).then((function(e){return p=e.meta,wi.createTexture(e.body)})).then((function(e){return!1!==i.preInit?mi(e,t.__assign({flipY:!1,encoding:r.sRGBEncoding},ni(i,["wrapS","wrapT"])),a):e})).then((function(e){var t={meta:p,body:e};return n(t),t})).catch((function(e){return s(e),Promise.reject(e)}))}M="blob";return tt(e,t.__assign(t.__assign({},A),{responseType:M}),void 0,void 0,o).then((function(e){return ci(e.body)})).then((function(e){return Ai(e,i.maxSize)})).then((function(e){return!1!==i.preInit?mi(e,t.__assign({flipY:!0,encoding:r.sRGBEncoding},i),a):e})).then((function(e){var t={meta:null,body:e};return n(t),t})).catch((function(e){return s(e),Promise.reject(e)}))}if(g){var f=new Error("cannot load basis texture via image");return s(f),Promise.reject(f)}var y=null,m=ui();return nt(e,A,void 0,void 0,o,m).then((function(e){return y=e.meta,Ai(e.body,i.maxSize)})).then((function(e){return!1!==i.preInit?mi(e,t.__assign({flipY:!0,encoding:r.sRGBEncoding},i),a):e})).then((function(e){var t={meta:y,body:e};return n(t),t})).catch((function(e){return m.close(),s(e),Promise.reject(e)}))},e.prototype.loadCube=function(e,i,n,s,o,a){var u;void 0===i&&(i={}),void 0===n&&(n=Pe),void 0===s&&(s=Pe),void 0===o&&(o=Pe),Array.isArray(e)||(e=[e.right,e.left,e.up,e.down,e.front,e.back]);for(var c={timeout:this.timeout,allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe},A=[],l=[0,0,0,0,0,0],h=[],d=function(n){var r=e[n],a=Ii(r),d=function(e){l[n]=e,o(l.reduce((function(e,t){return e+t}),0)/6)},g=null!==(u=i.viaAjax)&&void 0!==u&&u,p=/^https?:$/.test(a),M=Ze(r),f=/\.basis$/.test(Je(r).split("?")[0]);if(M?g=!0:p||(g=!1),g)if(f){var y="arraybuffer",m=tt(r,t.__assign(t.__assign({},c),{responseType:y}),void 0,void 0,d).then((function(e){return h[n]=e.meta,wi.createTexture(e.body)}));A.push(m)}else{y="blob",m=tt(r,t.__assign(t.__assign({},c),{responseType:y}),void 0,void 0,d).then((function(e){return h[n]=e.meta,ci(e.body)}));A.push(m)}else{if(f){var v=new Error("cannot load basis texture via image");return s(v),{value:Promise.reject(v)}}var N=ui();m=nt(r,c,void 0,void 0,d,N).then((function(e){return h[n]=e.meta,e.body})).catch((function(e){return N.close(),Promise.reject(e)}));A.push(m)}},g=0;g<6;g++){var p=d(g);if("object"==typeof p)return p.value}return Promise.all(A).then((function(e){return e[0]instanceof r.CompressedTexture?function(e){var t=new r.CubeTexture(e);t.needsUpdate=!0;var i=t.dispose;return t.dispose=function(){for(var n=0,r=e;n<r.length;n++)r[n].dispose();i.call(t),delete t.dispose},t.isCompressedTexture=!0,t.format=e[0].format,t.minFilter=e[0].minFilter,t.magFilter=e[0].magFilter,t}(e):function(e){var t=new r.CubeTexture(e);t.needsUpdate=!0,t.flipY=!1;var i=t.dispose;return t.dispose=function(){for(var n=0,r=e;n<r.length;n++)r[n].close();i.call(t),delete t.dispose},t}(e)})).then((function(e){return!1!==i.preInit?e.isCompressedTexture?mi(e,t.__assign({flipY:!1,encoding:r.sRGBEncoding},ni(i,["wrapS","wrapT"])),a):mi(e,t.__assign({flipY:!1,encoding:r.sRGBEncoding},i),a):e})).then((function(e){var t={body:e,meta:h};return n(t),t})).catch((function(e){for(var t=0,i=A;t<i.length;t++){i[t].then((function(e){e instanceof r.Texture?e.dispose():e.close()})).catch(Pe)}return s(e),Promise.reject(e)}))},e}();const xi=s.Reader,ji=s.util,zi=s.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(s.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Ci=zi.Model=(()=>{function e(e){if(this.chunks=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.chunks=ji.emptyArray,e.decode=function(e,t){e instanceof xi||(e=xi.create(e));let i=void 0===t?e.len:e.pos+t,n=new zi.Model;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:n.chunks&&n.chunks.length||(n.chunks=[]),n.chunks.push(zi.Chunk.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return n},e})();function bi(e){var t,i,n=(new r.Matrix4).set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);function s(e){var t=e.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function o(e){var t=e.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function a(e){return 1e6*s(e.name)+1e3*o(e.name)+function(e){var t=e.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}(e.name)}for(var u=[],c=0,A=(null!==(t=e.chunks)&&void 0!==t?t:[]).sort((function(e,t){return a(e)-a(t)}));c<A.length;c++){var l=s((S=A[c]).name);u[l]||(u[l]=[]),u[l].push(S)}for(var h=[],d=0;d<u.length;d++){var g=u[d];if(g){for(var p=0,M=0,f=0;f<g.length;f++){M+=(S=g[f]).vertices.xyz.length/3,p+=S.faces.indices.length}for(var y=3*M,m=2*M,v=3*M,N=p,D=new ArrayBuffer(4*y+4*m+4*v+4*N),E=new Float32Array(D,0,y),w=new Float32Array(D,4*y,m),I=new Float32Array(D,4*y+4*m,v),T=new Uint32Array(D,4*y+4*m+4*v,N),x=[],j=[1/0,1/0,1/0,-1/0,-1/0,-1/0],z=0,C=0,b=0;b<g.length;b++){var S,L=(S=g[b]).vertices.xyz,O=S.vertices.uvs,B=S.faces.indices,Q=L.length/3,k=B.length,P=[1/0,1/0,1/0,-1/0,-1/0,-1/0];for(f=0;f<Q;f++){var U=L[3*f],R=L[3*f+1],_=L[3*f+2],Y=n.elements,F=1/(Y[3]*U+Y[7]*R+Y[11]*_+Y[15]),H=(Y[0]*U+Y[4]*R+Y[8]*_+Y[12])*F,V=(Y[1]*U+Y[5]*R+Y[9]*_+Y[13])*F,G=(Y[2]*U+Y[6]*R+Y[10]*_+Y[14])*F;E[3*C+3*f]=H,E[3*C+3*f+1]=V,E[3*C+3*f+2]=G,w[2*C+2*f]=O[2*f],w[2*C+2*f+1]=O[2*f+1],H<P[0]&&(P[0]=H),V<P[1]&&(P[1]=V),G<P[2]&&(P[2]=G),H>P[3]&&(P[3]=H),V>P[4]&&(P[4]=V),G>P[5]&&(P[5]=G)}P[0]<j[0]&&(j[0]=P[0]),P[1]<j[1]&&(j[1]=P[1]),P[2]<j[2]&&(j[2]=P[2]),P[3]>j[3]&&(j[3]=P[3]),P[4]>j[4]&&(j[4]=P[4]),P[5]>j[5]&&(j[5]=P[5]);for(f=0;f<k;f++)T[z+f]=C+B[f];x.push({materialIndex:b,name:S.name,chunkName:o(S.name),start:z,count:S.faces.indices.length,texture:null!==(i=S.texture)&&void 0!==i?i:void 0}),C+=Q,z+=k}for(f=0;f<p;f+=3){var K,q,W,X,Z,J,$,ee,te,ie,ne,re,se,oe,ae,ue,ce,Ae,le;K=3*T[f],q=3*T[f+1],W=3*T[f+2],X=E[K],Z=E[K+1],J=E[K+2],$=E[q],ee=E[q+1],te=E[q+2],ie=E[W],ce=(re=E[W+1]-ee)*(ue=J-te)-(se=E[W+2]-te)*(ae=Z-ee),Ae=se*(oe=X-$)-(ne=ie-$)*ue,le=ne*ae-re*oe,I[K]+=ce,I[K+1]+=Ae,I[K+2]+=le,I[q]+=ce,I[q+1]+=Ae,I[q+2]+=le,I[W]+=ce,I[W+1]+=Ae,I[W+2]+=le}h.push({floorIndex:d,vertices:E,uvs:w,indices:T,normals:I,groups:x,extents:j})}}return h}function Si(e,i,n,s){var o=t.__assign({key:"texture.pbm",basisLoaderInitialized:wi.isInitialized()},ni(i,["format","quality","size"]));return e=i.transform?i.transform(e,o):ht(e,o),new Ti({allowHosts:n,networkSubscribe:s}).load(e,{wrapS:r.ClampToEdgeWrapping,wrapT:r.ClampToEdgeWrapping,minFilter:r.LinearFilter,maxSize:"number"==typeof o.size?new r.Vector2(o.size,o.size):void 0,preInit:!0}).then((function(e){var t=e.body;return t.needsUpdate=!0,t}))}function Li(e,t,i,n,s,o,a){void 0===s&&(s={});for(var u=[],c=0,A=bi(e);c<A.length;c++){var l=A[c],h=l.floorIndex,d=l.vertices,g=l.uvs,p=l.indices,M=l.normals,f=l.groups,y=l.extents,m=new r.Box3;m.min.x=y[0],m.min.y=y[1],m.min.z=y[2],m.max.x=y[3],m.max.y=y[4],m.max.z=y[5];var v=new r.BufferGeometry;v.setAttribute("position",new r.BufferAttribute(d,3)),v.setAttribute("uv",new r.BufferAttribute(g,2)),v.setAttribute("normal",new r.BufferAttribute(M,3)),v.setIndex(new r.BufferAttribute(p,1)),v.boundingBox=m,v.boundingSphere=m.getBoundingSphere(new r.Sphere);for(var N=0,D=f;N<D.length;N++){var E=D[N];v.addGroup(E.start,E.count,E.materialIndex)}for(var w=[],I=function(e){var u=i[e.chunkName]||(e.texture?t+e.texture:void 0),c=new Et;if(w.push(c),u){var A=void 0;u in s?A=s[u]:(A=Si(u,n,o,a),s[u]=A),A.then((function(e){c.uniforms.map.value=e,c.uniforms.exposure.value=3.3}),(function(){c.defines.USE_MAP=!1,c.uniforms.color.value=new r.Color(16777215)}))}else c.defines.USE_MAP=!1,c.uniforms.color.value=new r.Color(16777215)},T=0,x=f;T<x.length;T++){I(E=x[T])}var j=new dt(v,w);j.name="model_floor_"+h,j.floorIndex=h,u.push(j)}return{objects:u,texturePromise:Promise.all(Object.keys(s).map((function(e){return s[e].catch(Pe)}))).then(Pe)}}function Oi(e,t){return!1!==(e=Object.assign({},e)).autoResize&&(e.size=t>96?Math.min(e.size||1/0,100):t>48?Math.min(e.size||1/0,200):t>24?Math.min(e.size||1/0,400):t>12?Math.min(e.size||1/0,800):Math.min(e.size||1/0,1024)),e}function Bi(e){return 0===e.indexOf("//")||/^[0-9a-z]+\:\/\//i.test(e)}zi.Chunk=(()=>{function e(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.vertices=null,e.prototype.faces=null,e.prototype.name="",e.prototype.texture="",e.decode=function(e,t){e instanceof xi||(e=xi.create(e));let i=void 0===t?e.len:e.pos+t,n=new zi.Chunk;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:n.vertices=zi.Vertices.decode(e,e.uint32());break;case 2:n.faces=zi.Faces.decode(e,e.uint32());break;case 3:n.name=e.string();break;case 4:n.texture=e.string();break;default:e.skipType(7&t)}}if(!n.hasOwnProperty("vertices"))throw ji.ProtocolError("missing required 'vertices'",{instance:n});if(!n.hasOwnProperty("faces"))throw ji.ProtocolError("missing required 'faces'",{instance:n});if(!n.hasOwnProperty("name"))throw ji.ProtocolError("missing required 'name'",{instance:n});return n},e})(),zi.Vertices=(()=>{function e(e){if(this.xyz=[],this.uvs=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.xyz=ji.emptyArray,e.prototype.uvs=ji.emptyArray,e.decode=function(e,t){e instanceof xi||(e=xi.create(e));let i=void 0===t?e.len:e.pos+t,n=new zi.Vertices;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:if(n.xyz&&n.xyz.length||(n.xyz=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.xyz.push(e.float())}else n.xyz.push(e.float());break;case 2:if(n.uvs&&n.uvs.length||(n.uvs=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.uvs.push(e.float())}else n.uvs.push(e.float());break;default:e.skipType(7&t)}}return n},e})(),zi.Faces=(()=>{function e(e){if(this.indices=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.indices=ji.emptyArray,e.decode=function(e,t){e instanceof xi||(e=xi.create(e));let i=void 0===t?e.len:e.pos+t,n=new zi.Faces;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:if(n.indices&&n.indices.length||(n.indices=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.indices.push(e.uint32())}else n.indices.push(e.uint32());break;default:e.skipType(7&t)}}return n},e})();const Qi=s.Reader,ki=s.util,Pi=s.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(s.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),Ui=Pi.Model=(()=>{function e(e){if(this.meshes=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.meshes=ki.emptyArray,e.decode=function(e,t){e instanceof Qi||(e=Qi.create(e));let i=void 0===t?e.len:e.pos+t,n=new Pi.Model;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:n.meshes&&n.meshes.length||(n.meshes=[]),n.meshes.push(Pi.Mesh.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return n},e})();function Ri(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}function _i(e){var t=e.position,i=e.normal,n=e.uv,s=e.uv2,o=e.groups,a=new r.BufferGeometry;a.setAttribute("position",new r.BufferAttribute(new Float32Array(t.array),3)),i&&a.setAttribute("normal",new r.BufferAttribute(new Float32Array(i.array),3)),n&&a.setAttribute("uv",new r.BufferAttribute(new Float32Array(n.array),2)),s&&a.setAttribute("uv2",new r.BufferAttribute(new Float32Array(s.array),2));for(var u=0,c=o;u<c.length;u++){var A=c[u];a.addGroup(A.start,A.count,A.materialIndex)}return a}function Yi(e,i,n,s,o,a){if(a.hasOwnProperty(e))return a[e];Bi(e=e.split("?")[0])||(e=i+e),0===(e=e.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/")).indexOf("//")&&(e="https:"+e);var u=t.__assign({key:"texture.dome",size:64,basisLoaderInitialized:wi.isInitialized()},ni(n,["quality","format"]));return a[e=n.transform?n.transform(e,u):ht(e,u)]=o.load(e,{wrapS:r.RepeatWrapping,wrapT:r.RepeatWrapping,preInit:!0}).then((function(e){var t=e.body;return s&&t.repeat.copy(s),t.needsUpdate=!0,t.updateMatrix(),t}))}function Fi(e,t,i,n,s){var o=[],a=new Et,u=a.uniforms;u.exposure.value=4.3;var c=a.defines;if(c.USE_MAP=!1,c.USE_UV=!1,e.kd&&(u.diffuse.value=(new r.Color).fromArray(e.kd.rgb)),e.mapkd){var A=null;if(e.mapkdrepeat){var l=e.mapkdrepeat.split(/\s+/).map((function(e){return Number(e)})),h=l[0],d=l[1];A=new r.Vector2(h,d)}o.push(Yi(e.mapkd,t,i,A,n,s).then((function(e){c.USE_MAP=!0,c.USE_UV=!0,u.map.value=e,u.uvTransform.value=e.matrix})).catch(Pe))}if(e.ks&&(u.specular.value=(new r.Color).fromArray(e.ks.rgb)),e.mapks&&o.push(Yi(e.mapks,t,i,null,n,s).then((function(e){u.specularMap.value=e})).catch(Pe)),e.ke&&(u.emissive.value=(new r.Color).fromArray(e.ke.rgb)),e.mapke&&o.push(Yi(e.mapke,t,i,null,n,s).then((function(e){u.emissiveMap.value=e})).catch(Pe)),e.norm&&o.push(Yi(e.norm,t,i,null,n,s).then((function(e){u.normalMap.value=e})).catch(Pe)),e.mapbump&&o.push(Yi(e.mapbump,t,i,null,n,s).then((function(e){u.bumpMap.value=e})).catch(Pe)),e.bump&&o.push(Yi(e.bump,t,i,null,n,s).then((function(e){u.bumpMap.value=e})).catch(Pe)),"number"==typeof e.ns&&(u.shininess.value=e.ns),"number"==typeof e.d){var g=e.d;g>0&&g<1&&(a.originOpacity=g,a.opacity=g)}return{material:a,textureReady:Promise.all(o).then(Pe)}}function Hi(e,t,i,n,s){for(var o,a=[],u=[],c=(o=e,Ui.decode(o).meshes),A=new Ti({allowHosts:n,networkSubscribe:s}),l=new r.Matrix4,h=new r.Vector3,d=new r.Quaternion,g=new r.Vector3,p={},M=0,f=c;M<f.length;M++){var y=f[M],m=y.name,v=y.chunks,N=y.matrix;if("Ceiling"!==m&&"CeilingDrop"!==m)for(var D=0,E=N;D<E.length;D++){var w=E[D];l.elements=w.elements;var I=new pt;I.renderOrder=-3;for(var T=0;T<v.length;T++){var x=_i(v[T].geometry);x.applyMatrix4(l),l.decompose(h,d,g),g.x*g.y*g.z<0&&x.attributes.normal&&x.attributes.position&&x.attributes.uv&&Ri(x);for(var j=[],z=0,C=v[T].material;z<C.length;z++){var b=Fi(C[z],t,i,A,p),S=b.material,L=b.textureReady;u.push(L),j.push(S)}var O=new dt(x,j);O.name="chunk_"+T,I.add(O)}I.floorIndex=0,I.name=m,a.push(I)}}return{objects:a,texturePromise:Promise.all(u).catch(Pe)}}function Vi(e){return null==e}Pi.Mesh=(()=>{function e(e){if(this.chunks=[],this.matrix=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.name="",e.prototype.chunks=ki.emptyArray,e.prototype.matrix=ki.emptyArray,e.decode=function(e,t){e instanceof Qi||(e=Qi.create(e));let i=void 0===t?e.len:e.pos+t,n=new Pi.Mesh;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:n.name=e.string();break;case 2:n.chunks&&n.chunks.length||(n.chunks=[]),n.chunks.push(Pi.Chunk.decode(e,e.uint32()));break;case 3:n.matrix&&n.matrix.length||(n.matrix=[]),n.matrix.push(Pi.Matrix.decode(e,e.uint32()));break;default:e.skipType(7&t)}}if(!n.hasOwnProperty("name"))throw ki.ProtocolError("missing required 'name'",{instance:n});return n},e})(),Pi.Matrix=(()=>{function e(e){if(this.elements=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.elements=ki.emptyArray,e.decode=function(e,t){e instanceof Qi||(e=Qi.create(e));let i=void 0===t?e.len:e.pos+t,n=new Pi.Matrix;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:if(n.elements&&n.elements.length||(n.elements=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.elements.push(e.float())}else n.elements.push(e.float());break;default:e.skipType(7&t)}}return n},e})(),Pi.Chunk=(()=>{function e(e){if(this.material=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.geometry=null,e.prototype.material=ki.emptyArray,e.decode=function(e,t){e instanceof Qi||(e=Qi.create(e));let i=void 0===t?e.len:e.pos+t,n=new Pi.Chunk;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 2:n.geometry=Pi.Geometry.decode(e,e.uint32());break;case 3:n.material&&n.material.length||(n.material=[]),n.material.push(Pi.Material.decode(e,e.uint32()));break;default:e.skipType(7&t)}}if(!n.hasOwnProperty("geometry"))throw ki.ProtocolError("missing required 'geometry'",{instance:n});return n},e})(),Pi.Geometry=(()=>{function e(e){if(this.groups=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.position=null,e.prototype.uv=null,e.prototype.uv2=null,e.prototype.normal=null,e.prototype.groups=ki.emptyArray,e.decode=function(e,t){e instanceof Qi||(e=Qi.create(e));let i=void 0===t?e.len:e.pos+t,n=new Pi.Geometry;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:n.position=Pi.Position.decode(e,e.uint32());break;case 2:n.uv=Pi.UV.decode(e,e.uint32());break;case 3:n.uv2=Pi.UV.decode(e,e.uint32());break;case 4:n.normal=Pi.Normal.decode(e,e.uint32());break;case 5:n.groups&&n.groups.length||(n.groups=[]),n.groups.push(Pi.Group.decode(e,e.uint32()));break;default:e.skipType(7&t)}}if(!n.hasOwnProperty("position"))throw ki.ProtocolError("missing required 'position'",{instance:n});if(!n.hasOwnProperty("normal"))throw ki.ProtocolError("missing required 'normal'",{instance:n});return n},e})(),Pi.Position=(()=>{function e(e){if(this.array=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.array=ki.emptyArray,e.decode=function(e,t){e instanceof Qi||(e=Qi.create(e));let i=void 0===t?e.len:e.pos+t,n=new Pi.Position;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:if(n.array&&n.array.length||(n.array=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.array.push(e.float())}else n.array.push(e.float());break;default:e.skipType(7&t)}}return n},e})(),Pi.UV=(()=>{function e(e){if(this.array=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.array=ki.emptyArray,e.decode=function(e,t){e instanceof Qi||(e=Qi.create(e));let i=void 0===t?e.len:e.pos+t,n=new Pi.UV;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:if(n.array&&n.array.length||(n.array=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.array.push(e.float())}else n.array.push(e.float());break;default:e.skipType(7&t)}}return n},e})(),Pi.Normal=(()=>{function e(e){if(this.array=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.array=ki.emptyArray,e.decode=function(e,t){e instanceof Qi||(e=Qi.create(e));let i=void 0===t?e.len:e.pos+t,n=new Pi.Normal;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:if(n.array&&n.array.length||(n.array=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.array.push(e.float())}else n.array.push(e.float());break;default:e.skipType(7&t)}}return n},e})(),Pi.Group=(()=>{function e(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.start=0,e.prototype.count=0,e.prototype.materialIndex=0,e.decode=function(e,t){e instanceof Qi||(e=Qi.create(e));let i=void 0===t?e.len:e.pos+t,n=new Pi.Group;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:n.start=e.uint32();break;case 2:n.count=e.uint32();break;case 3:n.materialIndex=e.uint32();break;default:e.skipType(7&t)}}if(!n.hasOwnProperty("start"))throw ki.ProtocolError("missing required 'start'",{instance:n});if(!n.hasOwnProperty("count"))throw ki.ProtocolError("missing required 'count'",{instance:n});if(!n.hasOwnProperty("materialIndex"))throw ki.ProtocolError("missing required 'materialIndex'",{instance:n});return n},e})(),Pi.Material=(()=>{function e(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.kd=null,e.prototype.ks=null,e.prototype.ke=null,e.prototype.mapkd="",e.prototype.mapks="",e.prototype.mapke="",e.prototype.norm="",e.prototype.mapbump="",e.prototype.bump="",e.prototype.mapd="",e.prototype.ns=0,e.prototype.d=0,e.prototype.tr=0,e.prototype.mapkdrepeat="",e.decode=function(e,t){e instanceof Qi||(e=Qi.create(e));let i=void 0===t?e.len:e.pos+t,n=new Pi.Material;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:n.kd=Pi.Color.decode(e,e.uint32());break;case 2:n.ks=Pi.Color.decode(e,e.uint32());break;case 3:n.ke=Pi.Color.decode(e,e.uint32());break;case 4:n.mapkd=e.string();break;case 5:n.mapks=e.string();break;case 6:n.mapke=e.string();break;case 7:n.norm=e.string();break;case 8:n.mapbump=e.string();break;case 9:n.bump=e.string();break;case 10:n.mapd=e.string();break;case 11:n.ns=e.float();break;case 12:n.d=e.float();break;case 13:n.tr=e.float();break;case 14:n.mapkdrepeat=e.string();break;default:e.skipType(7&t)}}return n},e})(),Pi.Color=(()=>{function e(e){if(this.rgb=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.rgb=ki.emptyArray,e.decode=function(e,t){e instanceof Qi||(e=Qi.create(e));let i=void 0===t?e.len:e.pos+t,n=new Pi.Color;for(;e.pos<i;){let t=e.uint32();switch(t>>>3){case 1:if(n.rgb&&n.rgb.length||(n.rgb=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.rgb.push(e.float())}else n.rgb.push(e.float());break;default:e.skipType(7&t)}}return n},e})();var Gi=function(e,t){void 0===t&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var i={},n=e.getIndex(),s=e.getAttribute("position"),o=n?n.count:s.count,a=0,u=Object.keys(e.attributes),c={},A={},l=[],h=["getX","getY","getZ","getW"],d=0,g=u.length;d<g;d++){c[v=u[d]]=[],(w=e.morphAttributes[v])&&(A[v]=new Array(w.length).fill().map((function(){return[]})))}var p=Math.log10(1/t),M=Math.pow(10,p);for(d=0;d<o;d++){var f=n?n.getX(d):d,y="",m=0;for(g=u.length;m<g;m++)for(var v=u[m],N=(E=e.getAttribute(v)).itemSize,D=0;D<N;D++)y+="".concat(~~(E[h[D]](f)*M),",");if(y in i)l.push(i[y]);else{for(m=0,g=u.length;m<g;m++){v=u[m];var E=e.getAttribute(v),w=e.morphAttributes[v],I=(N=E.itemSize,c[v]),T=A[v];for(D=0;D<N;D++){var x=h[D];if(I.push(E[x](f)),w)for(var j=0,z=w.length;j<z;j++)T[j].push(w[j][x](f))}}i[y]=a,l.push(a),a++}}var C=e.clone();for(d=0,g=u.length;d<g;d++){v=u[d];var b=e.getAttribute(v),S=new b.array.constructor(c[v]);E=new r.BufferAttribute(S,b.itemSize,b.normalized);if(C.setAttribute(v,E),v in A)for(m=0;m<A[v].length;m++){var L=e.morphAttributes[v][m],O=(S=new L.array.constructor(A[v][m]),new r.BufferAttribute(S,L.itemSize,L.normalized));C.morphAttributes[v][m]=O}}return C.setIndex(l),C};function Ki(e){var i;return new((i=r.Triangle).bind.apply(i,t.__spreadArray([void 0],e.map((function(e){return new r.Vector3(e.x,e.y,e.z)})),!1)))}var qi={at3d:function(e,t){for(var i=Oi(t.textureOptions,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)}return Promise.resolve().then((function(){return tt(e.file,{responseType:"arraybuffer",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe})})).then((function(e){return ii(e.body)})).then((function(e){return Kt((function(){for(var t,i={chunks:[]},n=0,r=e;n<r.length;n++){var s=r[n],o=Ci.decode(s);o.chunks.length&&(t=i.chunks).push.apply(t,o.chunks)}return i}))})).then((function(r){return Kt((function(){return Li(r,e.textureBase,e.textures.slice(),i,n,t.allowHosts,t.networkSubscribe)}))}))},pbm:function(e,t){for(var i=Oi(t.textureOptions,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)}return Promise.resolve().then((function(){return tt(e.file,{responseType:"arraybuffer",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe})})).then((function(e){return Kt((function(){var t=new Uint8Array(e.body);return Ci.decode(t)}))})).then((function(r){return Kt((function(){return Li(r,e.textureBase,e.textures.slice(),i,n,t.allowHosts,t.networkSubscribe)}))}))},dome:function(e,t){return Promise.resolve().then((function(){return tt(e.file,{responseType:"arraybuffer",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe})})).then((function(i){return Hi(new Uint8Array(i.body),e.textureBase,t.textureOptions,t.allowHosts,t.networkSubscribe)}))},domez:function(e,t){return Promise.resolve().then((function(){return tt(e.file,{responseType:"arraybuffer",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe})})).then((function(e){return ii(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 Hi(i,e.textureBase,t.textureOptions,t.allowHosts,t.networkSubscribe)}))}},Wi=function(e){function i(t){void 0===t&&(t={});var i=e.call(this)||this;return i.empty=!0,i.name="model",i.loaded=!1,i.bvhs=Object.assign([],{loaded:!1}),i.bounding=new r.Box3,i.shownFloor=null,i.floorLength=0,i.networkSubscribe=t.networkSubscribe,i.allowHosts=t.allowHosts,i.renderOrder=-3,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=[],s=0,o=this.children;s<o.length;s++){var a=o[s];if(a instanceof dt){for(var u={},c=["a","b","c"],A=Gi(a.geometry),l=A.getAttribute("position").array,h=(null===(t=A.getIndex())||void 0===t?void 0:t.array)||[],d=[],g=[],p=0,M=l.length;p<M;p+=3)d.push(new r.Vector3(l[p],l[p+1],l[p+2]));for(p=0,M=h.length;p<M;p+=3){var f=h[p],y=h[p+1],m=h[p+2],v=(new r.Vector3).crossVectors(d[y].clone().sub(d[f]),d[m].clone().sub(d[f])).normalize();g.push({a:f,b:y,c:m,normal:v})}for(p=0,M=g.length;p<M;p++)for(var N=g[p],D=0;D<3;D++){var E=N[c[D]],w=N[c[(D+1)%3]],I=[Math.min(E,w),Math.max(E,w)];void 0===u[T=I[0]+"-"+I[1]]?u[T]={index1:I[0],index2:I[1],face1:p}:u[T].face2=p}for(var T in u){var x=u[T];if(void 0===x.face2||g[x.face1].normal.dot(g[x.face2].normal)<=i){var j=d[x.index1],z=d[x.index2];n.push(new r.Line3(j,z))}}A.dispose(),d.length=0,g.length=0}}return n},i.prototype.hasFloors=function(){return this.hasFloors_()},i.prototype.hasFloors_=function(){var e=[];return this.traverse((function(t){t instanceof dt&&(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=1,o=null!==(e=t[1])&&void 0!==e?e:.1,a=0!==t.length;this.shownFloor=r=a?t[0]:null,this.traverse((function(e){e instanceof dt&&e.material.forEach((function(t){null===r||r===e.floorIndex?t.opacity=t.originOpacity*s:t.opacity=t.originOpacity*o}))})),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,s=i.direction;if(Vi(t))if(Vi(this.shownFloor)){var o=this.floorLength;t=[];for(var a=-1;a<o;a++)t.push(a)}else t=[this.shownFloor];var u=[],c=[];Array.isArray(t)?c.push.apply(c,t):c.push(t);for(var A=function(t){var i=l.bvhs&&l.bvhs[t];if(i){var o=new Ot(n.x,n.y,n.z),a=new Ot(s.x,s.y,s.z);(c=i.intersectRay(o,a,!0).map((function(e){var t=e.intersectionPoint,i=e.triangle,s=new r.Vector3(t.x,t.y,t.z);return{point:s,face:{normal:Ki(i).getNormal(new r.Vector3)},distance:n.distanceTo(s)}}))).length&&u.push.apply(u,c)}else{var c,A=[];l.traverse((function(e){e instanceof dt&&e.floorIndex===t&&A.push(e)})),(c=e.intersectObjects(A).map((function(e){return{face:e.face?{normal:e.face.normal}:void 0,point:e.point,distance:e.distance}}))).length&&u.push.apply(u,c)}},l=this,h=0,d=c;h<d.length;h++){A(d[h])}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(){if(!this.bvhs.loaded){var e=[];this.traverse((function(t){t instanceof dt&&(e[t.floorIndex]=e[t.floorIndex]||[],e[t.floorIndex].push(t.geometry))})),this.bvhs.length=0;for(var t=0,i=e;t<i.length;t++){for(var n=i[t],r=0,s=0,o=n;s<o.length;s++){r+=(l=o[s]).index?l.index.array.length:l.attributes.position.array.length}for(var a=new Float32Array(3*r),u=0,c=0,A=n;c<A.length;c++){var l,h=(l=A[c]).attributes.position.array,d=l.index?l.index.array:null;if(d){for(var g=d.length,p=0,M=void 0,f=void 0;p<g;p++)M=3*(u+p),f=3*d[p],a[M]=h[f],a[M+1]=h[f+1],a[M+2]=h[f+2];u+=g}else{for(g=h.length/3,p=0,M=void 0,f=void 0;p<g;p++)f=3*p,a[M=3*(u+p)]=h[f],a[M+1]=h[f+1],a[M+2]=h[f+2];u+=g}}var y=(new _t).create(a).splitNode(50);this.bvhs.push(y)}this.bvhs.loaded=!0,this.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(qi)),s=qi[n];if(!s)throw new Error("[MODEL LOAD ERROR]: file type(".concat(n,") does not support."));return this.name=e.file,s(e,{textureOptions:t,allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe}).then((function(e){var t=e.objects,n=e.texturePromise;i.bounding.makeEmpty();for(var s=0,o=t;s<o.length;s++){(A=o[s]).traverse((function(e){if(e instanceof dt){var t=e.geometry;t.boundingBox||t.computeBoundingBox(),t.boundingSphere||t.computeBoundingSphere(),i.bounding.union(t.boundingBox)}})),i.add(A)}for(var a=i.bounding.getCenter(new r.Vector3),u=0,c=t;u<c.length;u++){var A;(A=c[u]).traverse((function(e){if(e instanceof dt)for(var t=0,i=e.material;t<i.length;t++){i[t].uniforms.modelCenter.value=a}}))}i.floorLength=i.hasFloors_(),i.empty=!1,i.loaded=!0,Kt((function(){i.emit("geometryLoaded"),n.then((function(){i.emit("materialLoaded"),i.emit("loaded")}))}))})).catch((function(e){return i.name="",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,this.bvhs.loaded=!1},i}(gt);Object.assign(Wi.prototype,{on:ke.prototype.on,once:ke.prototype.once,off:ke.prototype.off,emit:ke.prototype.emit,hasListener:ke.prototype.hasListener});var Xi=function(){function e(){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={mode:"Panorama",latitude:0,longitude:0,panoIndex:0,fov:80},this.observers=[],this.issuer="none",this.raw={work:null,option:{}}}return e.prototype.toJSON=function(){return this.raw.work},e}();function Zi(){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 Ji(e){return e instanceof Error}function $i(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(!$i(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(!$i(e[s],t[s]))return!1}return!0}return e!=e&&t!=t}function en(e){return"number"==typeof e}function tn(e){return 0==(e&e-1)&&0!==e}function nn(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+=nn(e[s],!1)+",";return r>-1&&(n+=nn(e[s],!1)),n+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return nn(e.toJSON(),t);var o=Object.keys(e).sort(),a=o.length;for(n="",s=0;s<a;){var u=o[s],c=nn(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 rn(e){return String(nn(e,!1))}function sn(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||Fe(s)||Ge.filter((function(e){return He(e,s)})).length>0){var a=String(null!==(t=r.certificate)&&void 0!==t?t:"");if(a){var u=new je;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 A=new je;A.readCertPEM(c);var l=String(null!==(n=r._signature)&&void 0!==n?n:"");if(!l)return new Error("signature is not existed.");if(!1===function(e,t,i){var n=new je;if("string"==typeof i?n.readCertPEM(i):n.readCertHex(i.hex),!1===Le(n))return!1;var r=new W;return r.readCertPubKeyHex(n.hex,6),!!r.verify(e,B(t))}(rn(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"])),l,A))return new Error("signature verify failed.");var h=new Date("string"==typeof r.expire_at&&/^\d+$/.test(r.expire_at)?Number(r.expire_at):r.expire_at);return o<h.getTime()?0===(Array.isArray(r.allow_hosts)?r.allow_hosts:[]).filter((function(e){return He(e,s)})).length?function(e){return new Error("host(".concat(JSON.stringify(e),") is not allowed."))}(s):{issuer:A.getSubjectString()}:function(e){return new Error("date(".concat(e.toString(),") expired."))}(h)}var on=new WeakMap;function an(e,t,i){var n,s=JSON.stringify(t),o=JSON.stringify(e),a=sn(o);e=JSON.parse(o),t=JSON.parse(s);var u=new Xi;u.issuer=a instanceof Error?"none":a.issuer,u.raw={work:e,options:t};var c=null!==(n=e.base_url)&&void 0!==n?n:"";c&&"/"!==c[c.length-1]&&(c+="/");var A=function(e,t){return 0===e.indexOf(t)},l=function(e,n){var r,s=e;if(!0===t.jsonp){s=e.replace(/([\?\#].*)?$/i,"");var o=ze("".concat(s)).slice(0,7);s="".concat(s,".").concat(o,".jsonp")}if(!0===t.shortPath){var a=s.replace(c,"").split("."),u=null!==(r=a.shift())&&void 0!==r?r:"",A=a.join(".");s=Zi(c,ze(u))+(A?"."+A:"")}var l=s.replace(c,"");return t.baseURL&&(s=Zi(t.baseURL,l)),i&&i(e,s,l,n),s},h=function(t,i){var n,r,s,o,a,u,h=t;if(!Bi(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=Zi(d,String(i))),h=Zi(d,h)}return Bi(h)||(h=Zi(c,h)),A(h,c)||console.warn("".concat(h," is not start with base_url(").concat(c,").")),l(h,"panorama")},d=function(e){var t=e;return Bi(t)||(t=Zi(c,e)),A(t,c)||console.warn("".concat(t," is not start with base_url(").concat(c,").")),l(t,"model")},g=function(e,t){void 0===t&&(t="");var i=e;return Bi(i)||(i=Zi(t,i)),Bi(i)||(i=Zi(c,i)),A(i,c)||console.warn("".concat(i," is not start with base_url(").concat(c,").")),l(i,"texture")};if(u.workCode=String(e.work_code||e.code||e.vr_code||e.workCode),u.name=String(e.name),u.expire=new Date("string"==typeof e.expire_at&&/^\d+$/.test(e.expire_at)?Number(e.expire_at):e.expire_at),u.allowHosts=e.allow_hosts||[],Ji(a))return a;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||(u.initial.mode=e.initial.mode),en(e.initial.latitude)&&(u.initial.latitude=e.initial.latitude),en(e.initial.longitude)?u.initial.longitude=e.initial.longitude:en(e.initial.heading)&&(u.initial.longitude=-(360*(e.initial.heading-.25)+90)/180*Math.PI),en(e.initial.fov)&&(u.initial.fov=e.initial.fov),en(e.initial.panoIndex)?u.initial.panoIndex=e.initial.panoIndex:en(e.initial.pano_index)?u.initial.panoIndex=e.initial.pano_index:en(e.initial.pano)&&(u.initial.panoIndex=e.initial.pano)),Ji(a))return a;if(e.model){var p={bvh:!0,async:!1,textureBase:"",textures:[]};"boolean"==typeof t.modelBvh?p.bvh=t.modelBvh:"boolean"==typeof e.model.bvh?p.bvh=e.model.bvh:"boolean"==typeof e.bvh&&(p.bvh=e.bvh),e.model.file?p.file=d(e.model.file):e.model.file_url&&(p.file=d(e.model.file_url)),e.model.textureBase?p.textureBase=e.model.textureBase:e.model.material_base_url&&(p.textureBase=e.model.material_base_url),Array.isArray(e.model.textures)?p.textures=e.model.textures.map((function(e){return g(e,p.textureBase)})):Array.isArray(e.model.material_textures)&&(p.textures=e.model.material_textures.map((function(e){return g(e,p.textureBase)}))),p.file&&(u.model=p)}if(Ji(a))return a;if(e.observers&&Array.isArray(e.observers)){var M=[];e.panorama&&(Array.isArray(e.panorama)?M=e.panorama:Array.isArray(e.panorama.list)?M=e.panorama.list:Array.isArray(e.panorama.info)&&(M=e.panorama.info));for(var f=0;f<e.observers.length;f++){var y={},m=e.observers[f];if(!m)break;var v=M[f]||{};m=Object.assign({},m,v,{active:!1!==m.active&&!1!==v.active}),y.panoIndex=f,y.active=!1!==m.active,y.loadable=!0===m.loadable,y.images={up:h(m.images?m.images.up:m.up,f),down:h(m.images?m.images.down:m.down,f),right:h(m.images?m.images.right:m.right,f),left:h(m.images?m.images.left:m.left,f),front:h(m.images?m.images.front:m.front,f),back:h(m.images?m.images.back:m.back,f)};var N=m.images?m.images.depth:m.depth;N&&(y.images.depth=h(N,f));var D=m.images?m.images.luminance:m.luminance;D&&(y.images.luminance={up:h(D.up,f),down:h(D.down,f),right:h(D.right,f),left:h(D.left,f),front:h(D.front,f),back:h(D.back,f)});var E=m.images?m.images.tiles:m.tiles;if(E){for(var w=[],I=function(e){var t=e.match(/\/cube_(\d+)\//);if(t){var i=Number(t[1]);if(tn(i))return i}return!1},T=function(e,t){return e.replace(/\/cube_(\d+)\//,(function(){return"/cube_".concat(t,"/")}))},x=0,j=E;x<j.length;x++){var z=j[x];if("number"==typeof z){var C=z,b=I(y.images.front);if(!1===b)continue;if((P=Math.max(b,512*Math.pow(2,C)))>2048){var S=T(y.images.up,P),L=T(y.images.down,P),O=T(y.images.right,P),B=T(y.images.left,P),Q=T(y.images.front,P),k=T(y.images.back,P);w.push({level:C,size:P,up:S,down:L,right:O,left:B,front:Q,back:k})}else{S=y.images.up,L=y.images.down,O=y.images.right,B=y.images.left,Q=y.images.front,k=y.images.back;w.push({level:C,size:P,up:S,down:L,right:O,left:B,front:Q,back:k})}}else{var P;if("number"!=typeof(C=z.level))continue;if("number"!=typeof(P=z.size))continue;S=h(z.up,f),L=h(z.down,f),O=h(z.right,f),B=h(z.left,f),Q=h(z.front,f),k=h(z.back,f);w.push({level:C,size:P,up:S,down:L,right:O,left:B,front:Q,back:k})}}w.sort((function(e,t){return e.level-t.level})),y.images.tiles=w}if(m.position instanceof r.Vector3)y.position=m.position.clone();else{if(!Array.isArray(m.position))break;y.position=(new r.Vector3).fromArray(m.position)}if(m.standingPosition instanceof r.Vector3)y.standingPosition=m.standingPosition.clone();else if(Array.isArray(m.standingPosition))y.standingPosition=(new r.Vector3).fromArray(m.standingPosition);else if(m.standing_position instanceof r.Vector3)y.standingPosition=m.standing_position.clone();else{if(!Array.isArray(m.standing_position))break;y.standingPosition=(new r.Vector3).fromArray(m.standing_position)}if(m.quaternion instanceof r.Quaternion)y.quaternion=m.quaternion.clone();else if(Array.isArray(m.quaternion))y.quaternion=(new r.Quaternion).fromArray(m.quaternion);else{if(!m.quaternion)break;var U=m.quaternion,R=U.x,_=U.y,Y=U.z,F=U.w;y.quaternion=new r.Quaternion(R,_,Y,F)}if(Array.isArray(m.accessibleNodes)?y.accessibleNodes=m.accessibleNodes.slice():Array.isArray(m.accessible_nodes)&&(y.accessibleNodes=m.accessible_nodes.slice()),Array.isArray(m.visibleNodes)?y.visibleNodes=m.visibleNodes.slice():Array.isArray(m.visible_nodes)&&(y.visibleNodes=m.visible_nodes.slice()),en(m.floorIndex)?y.floorIndex=m.floorIndex:en(m.floor_index)?y.floorIndex=m.floor_index:y.floorIndex=0,m.video){var H={};"string"==typeof m.video.source&&(H.source=m.video.source),m.video.matrix instanceof r.Matrix4?H.matrix=m.video.matrix.clone():Array.isArray(m.video.matrix)&&(H.matrix=(new r.Matrix4).fromArray(m.video.matrix)),m.video.size instanceof r.Vector2?H.size=m.video.size.clone():Array.isArray(m.video.size)&&(H.size=(new r.Vector2).fromArray(m.video.size)),H.source&&H.matrix&&H.size&&(y.video=H)}u.observers[f]=y}}if(Ji(a))return a;for(var V=0,G=u.observers;V<G.length;V++){if(!(y=G[V]).accessibleNodes){y.accessibleNodes=[];for(var K=0;K<u.observers.length;K++)u.observers[K]!==y&&y.accessibleNodes.push(K)}if(!y.visibleNodes){y.visibleNodes=[];for(K=0;K<u.observers.length;K++)u.observers[K]!==y&&y.visibleNodes.push(K)}}if(Ji(a))return a;var q=_e(u);return on.set(q,{work:o,options:s}),q}function un(e,t,i){"string"==typeof e&&"{"===e.trim()[0]&&(e=JSON.parse(e));var n=on.get(e);if(n){if(t&&!$i(JSON.parse(n.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return e}var r=an(e,null!=t?t:{},i);if(Ji(r))throw new Error("[PARSE FAILED]: "+r.message);return r}function cn(e,t,i){return Math.max(t,Math.min(i,e))}function An(e,t,i){return e+(t-e)*i}function ln(e,t){var i=t[1]-t[0];return e<t[0]?ln(e+i,t):e>=t[1]?ln(e-i,t):e}function hn(e,t,i,n){return n?function(e,t,i,n){var r=n[1]-n[0];return e=ln(e,n),An((t=ln(t,n))-e>r/2?e+r:e-t>r/2?e-r:e,t,i)}(e,t,i,n):An(e,t,i)}var dn=function(){function e(e){for(var i in this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=Re(),this.startVelocity=0,this.duration=0,this.keyframes=[],e){var n=e[i];"number"==typeof n?(this.value[i]=n,this.config[i]={circle:!1}):(this.value[i]=n.value,this.config[i]={circle:n.circle})}this.keyframes=[{progress:0,value:t.__assign({},this.value)},{progress:1,value:t.__assign({},this.value)}]}return e.prototype.getProgress=function(e){var t=e-this.startTime;return t<0?0:t>=this.duration?1:1-function(e,t,i,n){var r=(t*i+2*e)/Math.pow(i,3),s=-(2*t*i+3*e)/Math.pow(i,2),o=t,a=e;return r*Math.pow(n,3)+s*Math.pow(n,2)+o*n+a}(1,this.startVelocity,this.duration,t)},e.prototype.getValue=function(e){for(var i=1;i<this.keyframes.length;i++)if(this.keyframes[i].progress>e){var n=this.keyframes[i-1],r=this.keyframes[i],s={};for(var o in this.config){var a=(e-n.progress)/(r.progress-n.progress);s[o]=hn(n.value[o],r.value[o],a,this.config[o].circle)}return s}return t.__assign({},this.keyframes[this.keyframes.length-1].value)},e.prototype.getProgressVelocity=function(e){var t=e-this.startTime;return t>=this.duration?0:function(e,t,i,n){var r=(t*i+2*e)/Math.pow(i,3),s=-(2*t*i+3*e)/Math.pow(i,2),o=t;return 3*r*Math.pow(n,2)+2*s*n+o}(1,this.startVelocity,this.duration,t)},e.prototype.update=function(e){return!!this.ended||(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(e))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},e.prototype.getKeyFrameSegment=function(e){for(var t=this.getProgress(e),i=1;i<this.keyframes.length;i++)if(this.keyframes[i].progress>t)return[this.keyframes[i-1],this.keyframes[i]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},e.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},e.prototype.set=function(e,t,i,n){var r;void 0===i&&(i=0),n=null!=n?n:Re();var s=this.getProgress(n),o=this.getValue(s),a={};for(var u in this.config)a[u]=null!==(r=e[u])&&void 0!==r?r:o[u];var c=[{progress:0,value:o},{progress:1,value:a}];return this.setKeyframes(c,t,i,n)},e.prototype.setKeyframes=function(e,i,n,r){var s=this;if(void 0===n&&(n=0),e.length<2)throw new Error("keyframes invalid.");return this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise((function(o,a){r=null!=r?r:Re(),s.progress=0,s.ended=!1,s.startTime=r,s.startVelocity=n,s.keyframes=e,s.duration=i,0===i?(s.progress=1,s.value=t.__assign({},e[e.length-1].value)):s.value=t.__assign({},e[0].value),s.callbacks=[o,a]}))},e.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},e}(),gn=yt(),pn=new r.Texture(gn);gn.onload=function(){return pn.needsUpdate=!0},gn.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAR9JREFUOBF10kFOAzEMBdCZFhCbrrgAN+NqHIULsWKDKO3gF+VHoZpa+rXjfH87nq7btr0ty3KZ8FsxnHeQPL748lA/x0Jsq+AwYe0X8nDtGA33BEJUHIEKW/EorHOLI7BHNlkEbju38YkQAIRZxFkHz2HOirKDxNcIzG+fu/6oLiNmqc5ZrlwTeKyAgJF14tMZmSn87pBrxeX/CRABgk/dl1s+C18dio2Pp9nmCQru2UtdvN+7lI9AFsgb3zNMcSp8FF4LYs3UhLfOAvkDJffci8q1J/ByRLKnQ8gUJUFOd2SeZYliCxwiyJCxCbhUGFKF4zPm61hiq7sVyJnPmATyR5IzLSNyDNEFRCDnkAmA8U2RfCsIefYhDeKOQLv7A+l1ZTyjymNxAAAAAElFTkSuQmCC";var Mn=new r.RingBufferGeometry(.06,.07,32).rotateX(-Math.PI/2),fn=new r.MeshBasicMaterial({map:pn,transparent:!0});function yn(){if("undefined"==typeof document){var e=new r.Texture;return Object.assign(e,{draw:function(e){},retain:!1,pool:!1})}var t=document.createElement("canvas"),i=512,n=256,s=190;t.setAttribute("width",String(i)),t.setAttribute("height",String(i));var o=new r.Texture(t),a=t.getContext("2d");if(!a)throw Error("cannot create canvas context");var u=a.createRadialGradient(n,n,150,n,n,0);function c(){var e=Math.PI/12,t=2*Math.PI/3;a&&(a.beginPath(),a.arc(n,n,s,0*t,1*t-e),a.stroke(),a.beginPath(),a.arc(n,n,s,1*t,2*t-e),a.stroke(),a.beginPath(),a.arc(n,n,s,2*t,3*t-e),a.stroke())}function A(e){a&&(a.clearRect(0,0,i,i),a.lineWidth=20,-1!==e&&(a.globalCompositeOperation="source-over",a.strokeStyle="rgba(255, 255, 255, 1)",c(),a.globalCompositeOperation="source-in",a.beginPath(),a.arc(n,n,s,0,2*Math.PI*e),a.strokeStyle="rgba(255, 255, 255, 1)",a.stroke(),a.globalCompositeOperation="source-over",a.strokeStyle="rgba(255, 255, 255, "+(e?.5:1)+")",c()),a.beginPath(),a.arc(n,n,150,0,2*Math.PI),a.closePath(),a.fillStyle=u,a.fill(),a.fillStyle="rgba(255, 255, 255, 0.01)",a.fillRect(0,0,i,i),o.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)"),A(0),Object.assign(o,{draw:A,retain:!1,pool:!1})}var mn=[];var vn=yn();vn.draw(0);var Nn=yn();Nn.draw(1);var Dn=yn();Dn.draw(-1);var En=new r.CircleBufferGeometry(.12,32).rotateX(-Math.PI/2);function wn(){return new r.Mesh(En,new r.MeshBasicMaterial({map:vn,transparent:!0}))}function In(e,t){var i=e.map;0===t||1===t?(!0===i.pool&&(i.retain=!1),0===t&&(e.map=vn),1===t&&(e.map=Nn)):(!0!==i.pool&&(e.map=function(){for(var e=0,t=mn;e<t.length;e++){var i=t[e];if(!1===i.retain)return i}var n=yn();return n.pool=!0,n.retain=!0,mn.push(n),n}()),e.map.draw(t))}var Tn=function(e){function i(){var t=e.call(this)||this;return t.loading=!1,t.disabled=!1,t.current=!1,t.progress=0,t.opacity=0,t.centerMesh=wn(),t.centerMesh.position.y+=.01,t.add(t.centerMesh),t.loadingMesh=new r.Mesh(Mn,fn),t.loadingMesh.position.y+=.011,t.progressMotion=new dn({progress:t.progress}),t.opacityMotion=new dn({opacity:t.opacity}),t.needsRender=!0,t.renderOrder=-2,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=ot.shared.add((function(){t.loadingMesh.rotateOnAxis(new r.Vector3(0,1,0),.1),t.needsRender=!0}))):this.remove(this.loadingMesh),this.needsRender=!0},i.prototype.setDisabled=function(e){this.disabled=e,function(e,t){var i=e.map;!0===i.pool&&(i.retain=!1),e.map=t?Dn:vn}(this.centerMesh.material,e),this.needsRender=!0},i.prototype.setProgress=function(e){this.setLoading(!1),this.setDisabled(!1),this.progress=e=cn(e,0,1),e!==this.progressMotion.getTargetKeyframe().value.progress&&this.progressMotion.set({progress:e},120).catch(Pe)},i.prototype.setOpacity=function(e){this.opacity=e=cn(e,0,1),this.current&&(e=1),e!==this.opacityMotion.getTargetKeyframe().value.opacity&&this.opacityMotion.set({opacity:e},500).catch(Pe)},i.prototype.setCurrent=function(e){this.current!==e&&(this.current=e,this.setOpacity(this.opacity))},i.prototype.updateTime=function(e,t){this.opacityMotion.ended||(this.opacityMotion.update(e),this.centerMesh.material.opacity=this.opacityMotion.value.opacity,this.needsRender=!0),this.progressMotion.ended||(this.progressMotion.update(e),In(this.centerMesh.material,this.progressMotion.value.progress),this.needsRender=!0)},i.prototype.dispose=function(){this.setLoading(!1),this.remove(this.centerMesh),this.remove(this.loadingMesh),this.centerMesh.material.dispose()},i}(r.Object3D),xn=new Float32Array([-.15,0,-.15,.15,0,-.15,-.15,0,.15,.15,0,.15]),jn=new Float32Array([0,1,1,1,0,0,1,0]),zn=new Uint8Array([0,2,1,2,3,1]),Cn=new r.BufferGeometry;Cn.setAttribute("position",new r.BufferAttribute(xn,3)),Cn.setAttribute("uv",new r.BufferAttribute(jn,2)),Cn.setIndex(new r.BufferAttribute(zn,1));var bn,Sn,Ln=(bn=yt(),Sn=new r.Texture,bn.onload=function(){if("undefined"!=typeof document){var e=256,t=document.createElement("canvas");t.setAttribute("width",String(e)),t.setAttribute("height",String(e));var i=t.getContext("2d");if(i){i.drawImage(bn,0,0,e,e),i.globalCompositeOperation="source-out";var n=128;i.beginPath(),i.lineWidth=29.952,i.arc(n,n,84.48,0,2*Math.PI),i.strokeStyle="rgba(255, 255, 255, 1)",i.closePath(),i.stroke(),Sn.image=t,Sn.needsUpdate=!0}}},bn.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAR9JREFUOBF10kFOAzEMBdCZFhCbrrgAN+NqHIULsWKDKO3gF+VHoZpa+rXjfH87nq7btr0ty3KZ8FsxnHeQPL748lA/x0Jsq+AwYe0X8nDtGA33BEJUHIEKW/EorHOLI7BHNlkEbju38YkQAIRZxFkHz2HOirKDxNcIzG+fu/6oLiNmqc5ZrlwTeKyAgJF14tMZmSn87pBrxeX/CRABgk/dl1s+C18dio2Pp9nmCQru2UtdvN+7lI9AFsgb3zNMcSp8FF4LYs3UhLfOAvkDJffci8q1J/ByRLKnQ8gUJUFOd2SeZYliCxwiyJCxCbhUGFKF4zPm61hiq7sVyJnPmATyR5IzLSNyDNEFRCDnkAmA8U2RfCsIefYhDeKOQLv7A+l1ZTyjymNxAAAAAElFTkSuQmCC",Sn),On=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(512)),e.setAttribute("height",String(512));var t=e.getContext("2d");if(t){var i=256,n=199.68;return t.beginPath(),t.arc(i,i,n,0,2*Math.PI),t.fillStyle="rgba(255, 255, 255, 0.1)",t.closePath(),t.fill(),t.save(),t.beginPath(),t.arc(i,i,n,0,2*Math.PI),t.strokeStyle="rgba(255, 255, 255, 0.5)",t.lineWidth=10.24,t.closePath(),t.stroke(),new r.CanvasTexture(e)}}return null}(),Bn=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(512)),e.setAttribute("height",String(512));var t=e.getContext("2d");if(t){var i=256,n=138.24,s=t.createLinearGradient(i-Math.cos(Math.PI/4)*n,i-Math.sin(Math.PI/4)*n,i+Math.cos(Math.PI/4)*n,i+Math.sin(Math.PI/4)*n);return s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.6)"),s.addColorStop(1,"rgba(255, 255, 255, 1)"),t.beginPath(),t.lineWidth=33.28,t.arc(i,i,n,0,2*Math.PI),t.strokeStyle=s,t.shadowBlur=38.4,t.shadowColor="rgba(0, 0, 0, 0.3)",t.closePath(),t.stroke(),new r.CanvasTexture(e)}}return null}(),Qn=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(512)),e.setAttribute("height",String(512));var t=e.getContext("2d");if(t){var i=256,n=199.68,s=t.createLinearGradient(i+Math.cos(Math.PI/4)*n,i-Math.sin(Math.PI/4)*n,i-Math.cos(Math.PI/4)*n,i+Math.sin(Math.PI/4)*n);return s.addColorStop(0,"rgba(255, 255, 255, 0.5)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.1)"),s.addColorStop(1,"rgba(255, 255, 255, 0.5)"),t.beginPath(),t.lineWidth=15.36,t.arc(i,i,n,0,2*Math.PI),t.strokeStyle=s,t.shadowBlur=25.6,t.shadowColor="rgba(0, 0, 0, 0.5)",t.closePath(),t.stroke(),new r.CanvasTexture(e)}}return null}(),kn=function(e,t){var i=128;e.clearRect(0,0,256,256),e.beginPath(),e.lineWidth=29.44,e.arc(i,i,84.48,0,2*Math.PI*t),e.strokeStyle="rgba(255, 255, 255, 0.2)",e.stroke()},Pn=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(256)),e.setAttribute("height",String(256));var t=e.getContext("2d");t&&kn(t,2*Math.PI);var i=new r.CanvasTexture(e);return Object.assign(i,{setProgress:function(e){t&&(kn(t,e),i.needsUpdate=!0)}})}return null},Un=[],Rn=Pn(),_n=function(e){function i(){var i=e.call(this)||this;i.progress=0,i.opacity=0,i.loading=!1,i.current=!1,i.disabled=!1,i.ringRotateMotion=new dn({angle:0}),i.tapMotion=new dn({scale:1,opacity:1}),i.progressMotion=new dn({progress:0}),i.progressOpacityMotion=new dn({opacity:0}),i.opacityMotion=new dn({opacity:0});var n={blending:r.CustomBlending,blendSrc:r.SrcAlphaFactor,blendDst:r.OneMinusSrcAlphaFactor,blendSrcAlpha:r.OneFactor,blendDstAlpha:r.OneMinusSrcAlphaFactor,depthWrite:!1};return i.centerMesh=new r.Mesh(Cn,new r.MeshBasicMaterial(t.__assign(t.__assign({},n),{map:Bn}))),i.ringMesh=new r.Mesh(Cn,new r.MeshBasicMaterial(t.__assign(t.__assign({},n),{map:Qn}))),i.loadingMesh=new r.Mesh(Cn,new r.MeshBasicMaterial(t.__assign(t.__assign({},n),{map:Ln,opacity:.5}))),i.disableMesh=new r.Mesh(Cn,new r.MeshBasicMaterial(t.__assign(t.__assign({},n),{map:On}))),i.progressMesh=new r.Mesh(Cn,new r.MeshBasicMaterial(t.__assign(t.__assign({},n),{map:Rn,opacity:0}))),i.loadingMesh.visible=!1,i.disableMesh.visible=!1,i.ringMesh.position.y=.003,i.disableMesh.position.y=.002,i.centerMesh.position.y=.002,i.loadingMesh.position.y=.005,i.progressMesh.position.y=.004,i.centerMesh.frustumCulled=!1,i.ringMesh.frustumCulled=!1,i.progressMesh.frustumCulled=!1,i.loadingMesh.frustumCulled=!1,i.disableMesh.frustumCulled=!1,i.add(i.centerMesh),i.add(i.ringMesh),i.add(i.progressMesh),i.add(i.loadingMesh),i.add(i.disableMesh),i.needsRender=!0,i}return t.__extends(i,e),i.prototype.setProgress=function(e){this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=cn(e,0,1),this.tapMotion.ended&&(0===this.progress&&this.progressOpacityMotion.set({opacity:1},300).catch(Pe),0===e?(this.progressOpacityMotion.set({opacity:0},300).catch(Pe),this.progressMotion.set({progress:cn(1.2*e,0,1)},0).catch(Pe)):this.progressMotion.set({progress:cn(1.2*e,0,1)},100).catch(Pe)),this.progress=e)},i.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=cn(e,0,1),this.opacityMotion.set({opacity:e},500).catch(Pe))},i.prototype.setCurrent=function(e){if(this.current!==e){if(!0===e&&this.ringRotateMotion.ended){var t=[{progress:0,value:{angle:0}},{progress:1,value:{angle:2*Math.PI}}];this.ringRotateMotion.setKeyframes(t,4e3).catch(Pe)}this.current=e}},i.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,!0===this.disabled&&this.setDisabled(!1),this.loadingMesh.visible=e,this.needsRender=!0)},i.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,!0===this.loading&&this.setLoading(!1),this.disableMesh.visible=e,this.ringMesh.visible=!e,this.centerMesh.visible=!e,this.needsRender=!0)},i.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();return this.progressOpacityMotion.set({opacity:0},0).catch(Pe),this.progressMotion.set({progress:0},0).catch(Pe),this.tapMotion.setKeyframes([{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}],600).then((function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(Pe),e.progressMotion.set({progress:e.progress},120).catch(Pe)})).catch(Pe)},i.prototype.updateTime=function(e,t){var i;if(!this.progressMotion.ended){this.progressMotion.update(e);var n=this.progressMotion.value.progress;if(null!==this.progressMesh.material.map)if(0===n)this.progressMesh.material.map!==Rn&&(Un.push(this.progressMesh.material.map),this.progressMesh.material.map=Rn);else if(1===n)this.progressMesh.material.map!==Rn&&(Un.push(this.progressMesh.material.map),this.progressMesh.material.map=Rn);else{if(this.progressMesh.material.map===Rn){var s=Un.pop()||Pn();this.progressMesh.material.map=s}null===(i=this.progressMesh.material.map)||void 0===i||i.setProgress(n)}this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var o=this.progressOpacityMotion.value.opacity;this.progressMesh.material.opacity=o,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);o=this.opacityMotion.value.opacity*this.tapMotion.value.opacity;this.centerMesh.material.opacity=o,this.ringMesh.material.opacity=o,this.disableMesh.material.opacity=o,this.loadingMesh.material.opacity=o,this.needsRender=!0}if(!0===this.loadingMesh.visible&&(this.loadingMesh.rotateY(-t/120),this.needsRender=!0),!this.tapMotion.ended){this.tapMotion.update(e);var a=this.tapMotion.value.scale;this.centerMesh.scale.set(a,a,a),this.ringMesh.scale.set(a,a,a),this.progressMesh.scale.set(a,a,a);o=this.opacityMotion.value.opacity*this.tapMotion.value.opacity;this.centerMesh.material.opacity=o,this.ringMesh.material.opacity=o,this.disableMesh.material.opacity=o,this.loadingMesh.material.opacity=o,this.needsRender=!0}this.ringRotateMotion.ended||(this.ringRotateMotion.update(e),this.ringMesh.quaternion.setFromEuler(new r.Euler(0,this.ringRotateMotion.value.angle,0)),this.needsRender=!0)},i.prototype.dispose=function(){this.ringRotateMotion.dispose(),this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.progressMesh.material.map!==Rn&&(Un.push(this.progressMesh.material.map),this.progressMesh.material.map=null),this.ringMesh.material.dispose(),this.disableMesh.material.dispose(),this.centerMesh.material.dispose(),this.loadingMesh.material.dispose(),this.progressMesh.material.dispose()},i}(r.Object3D),Yn=new Float32Array([-.15,-.15,0,.15,-.15,0,-.15,.15,0,.15,.15,0]),Fn=new Float32Array([0,0,1,0,0,1,1,1]),Hn=new Uint8Array([0,1,2,1,3,2]),Vn=new r.BufferGeometry;Vn.setAttribute("position",new r.BufferAttribute(Yn,3)),Vn.setAttribute("uv",new r.BufferAttribute(Fn,2)),Vn.setIndex(new r.BufferAttribute(Hn,1));var Gn=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(512)),e.setAttribute("height",String(512));var t=e.getContext("2d");if(t){var i=256;return t.beginPath(),t.lineWidth=76.8,t.arc(i,i,138.24,0,2*Math.PI),t.strokeStyle="rgba(18, 255, 251, 0.8)",t.shadowBlur=25.6,t.shadowColor="rgba(0, 0, 0, 0.4)",t.closePath(),t.stroke(),new r.CanvasTexture(e)}}return null}(),Kn=new r.MeshBasicMaterial({map:Gn,transparent:!0}),qn=function(e){function i(){var t=e.call(this)||this;return t.ringMesh=new r.Mesh(Vn,Kn),t.ringMesh.renderOrder=100,t.add(t.ringMesh),t}return t.__extends(i,e),i.prototype.dispose=function(){this.remove(this.ringMesh)},i}(r.Object3D);function Wn(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function Xn(){return(Wn()+Wn()+"-"+Wn()+"-4"+Wn().substr(0,3)+"-"+Wn()+"-"+Wn()+Wn()+Wn()).toLowerCase()}function Zn(e,t,i){var n=Math.abs(e-t);return n<.001||void 0!==i&&Math.abs(i-n)<.001}function Jn(e,t,i){return!Zn(e,t,i)}function $n(e,t){return e.distanceTo(t)<.001}function er(e,t){return!$n(e,t)}var tr=new r.Vector3(0,0,0),ir=function(e){function i(t,i){void 0===i&&(i=tr);var n=e.call(this)||this,s=new r.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);s.groups.length=0,s.groups.push({start:0,count:36,materialIndex:0}),s.applyMatrix4((new r.Matrix4).makeScale(-1,1,1));var o=new Et;o.defines.USE_MAP=!1,o.defines.USE_UV=!1,o.uniforms.diffuse.value=new r.Color(16777215);var a=new dt(s,[o]);return a.floorIndex=-1,a.position.copy(t.getCenter(new r.Vector3)),a.frustumCulled=!1,n.renderOrder=-3,n.add(a),n.boundingBox=new r.Box3,n.computeBoundingBox(),n}return t.__extends(i,e),i.prototype.computeBoundingBox=function(){this.boundingBox.setFromObject(this)},i.prototype.dispose=function(){this.disposeMaterial(),this.disposeGeometry()},i}(pt);function nr(e,t){return void 0===t&&(t=tr),new ir(e,t)}var rr=2*Math.PI;function sr(e){return(e%rr+rr)%rr}var or=Math.PI,ar=2*or;function ur(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 cr(e,t){e.mode=t.mode,e.panoIndex=t.panoIndex,e.longitude=t.longitude,e.latitude=t.latitude,e.fov=t.fov,e.offset.copy(t.offset)}function Ar(e,t){return e.panoIndex===t.panoIndex&&e.mode===t.mode&&Zn(e.longitude,t.longitude,2*Math.PI)&&Zn(e.latitude,t.latitude)&&Zn(e.fov,t.fov)&&$n(e.offset,t.offset)}var lr=function(e){return Number(e)};function hr(e,t,i){var n;void 0===t&&(t=lr),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}function dr(e){for(var t in e)return!1;return!0}function gr(e){return{longitude:e.longitude,latitude:e.latitude,fov:e.fov,offset:e.offset.clone()}}
357
+ function(e,t){for(var r=e.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=t-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var i="";++n<r.length;){var o=255&r[n];o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&r[n+1]),++n):(i+=String.fromCharCode((15&o)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return i}(r,this.n.bitLength()+7>>3)},I.prototype.decryptOAEP=function(e,t,r){if(e.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var n=E(e,16),i=this.doPrivate(n);return null==i?null:function(e,t,r,n){var i=s.crypto.MessageDigest,o=s.crypto.Util,a=null;for(r||(r="sha1"),"string"==typeof r&&(a=i.getCanonicalAlgName(r),n=i.getHashLength(a),r=function(e){return B(o.hashHex(R(e),a))}),e=e.toByteArray(),l=0;l<e.length;l+=1)e[l]&=255;for(;e.length<t;)e.unshift(0);if((e=String.fromCharCode.apply(String,e)).length<2*n+2)throw"Cipher too short";var l,u=e.substr(1,n),c=e.substr(n+1),h=S(c,n,r),d=[];for(l=0;l<u.length;l+=1)d[l]=u.charCodeAt(l)^h.charCodeAt(l);var p=S(String.fromCharCode.apply(String,d),e.length-n,r),f=[];for(l=0;l<c.length;l+=1)f[l]=c.charCodeAt(l)^p.charCodeAt(l);if((f=String.fromCharCode.apply(String,f)).substr(0,n)!==r(""))throw"Hash mismatch";var v=(f=f.substr(n)).indexOf("");if((-1!=v?f.substr(0,v).lastIndexOf("\0"):-1)+1!=v)throw"Malformed data";return f.substr(v+1)}(i,this.n.bitLength()+7>>3,t,r)},void 0!==s.lang&&s.lang||(s.lang={}),s.lang.String=function(){},s.lang.String.isHex=function(e){return k(e)},s.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 N=function(e,t,r){return null==r&&(r="0"),e.length>=t?e:new Array(t-e.length+1).join(r)+e};void 0!==s.crypto&&s.crypto||(s.crypto={}),s.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:l.algo.MD5,sha1:l.algo.SHA1,sha224:l.algo.SHA224,sha256:l.algo.SHA256,sha384:l.algo.SHA384,sha512:l.algo.SHA512,ripemd160:l.algo.RIPEMD160},this.hashString=function(e,t){return new s.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new s.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")}},s.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=s.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=s.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=s.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=l.enc.Hex.parse(e);this.md.update(t)},this.digest=function(){return this.md.finalize().toString(l.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=s.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},s.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},s.crypto.MessageDigest.getHashLength=function(e){var t=s.crypto.MessageDigest,r=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[r])throw"not supported algorithm: "+e;return t.HASHLENGTH[r]},s.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},s.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 r="",n=t/4-e.length,i=0;i<n;i++)r+="0";return r+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 s.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 r=null;try{r=void 0===t?K.getKey(e):K.getKey(e,t)}catch(e){throw"init failed:"+e}if(!0===r.isPrivate)this.prvKey=r,this.state="SIGN";else{if(!0!==r.isPublic)throw"init failed.:"+r;this.pubKey=r,this.state="VERIFY"}},this.updateString=function(e){this.md.updateString(e)},this.updateHex=function(e){this.md.updateHex(e)},this.verify=function(e){if(this.sHashHex=this.md.digest(),this.pubKey instanceof I&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof I&&"rsa"===this.pubkeyAlgName)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.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=s.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=K.getKey(e.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},s.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 V,U,z,q,H,_,j,G,K=(V=function(e,t,r){return U(l.AES,e,t,r)},U=function(e,t,r,n){var i=l.enc.Hex.parse(t),o=l.enc.Hex.parse(r),a=l.enc.Hex.parse(n),s={};s.key=o,s.iv=a,s.ciphertext=i;var u=e.decrypt(s,o,{iv:a});return l.enc.Hex.stringify(u)},z=function(e,t,r){return q(l.AES,e,t,r)},q=function(e,t,r,n){var i=l.enc.Hex.parse(t),o=l.enc.Hex.parse(r),a=l.enc.Hex.parse(n),s=e.encrypt(i,o,{iv:a}),u=l.enc.Hex.parse(s.toString());return l.enc.Base64.stringify(u)},H={"AES-256-CBC":{proc:V,eproc:z,keylen:32,ivlen:16},"AES-192-CBC":{proc:V,eproc:z,keylen:24,ivlen:16},"AES-128-CBC":{proc:V,eproc:z,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,t,r){return U(l.TripleDES,e,t,r)},eproc:function(e,t,r){return q(l.TripleDES,e,t,r)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,t,r){return U(l.DES,e,t,r)},eproc:function(e,t,r){return q(l.DES,e,t,r)},keylen:8,ivlen:8}},_=function(e){var t={},r=e.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));r&&(t.cipher=r[1],t.ivsalt=r[2]);var n=e.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(t.type=n[1]);var i=-1,o=0;-1!=e.indexOf("\r\n\r\n")&&(i=e.indexOf("\r\n\r\n"),o=2),-1!=e.indexOf("\n\n")&&(i=e.indexOf("\n\n"),o=1);var a=e.indexOf("-----END");if(-1!=i&&-1!=a){var s=e.substring(i+2*o,a-o);s=s.replace(/\s+/g,""),t.data=s}return t},j=function(e,t,r){for(var n=r.substring(0,16),i=l.enc.Hex.parse(n),o=l.enc.Utf8.parse(t),a=H[e].keylen+H[e].ivlen,s="",u=null;;){var c=l.algo.MD5.create();if(null!=u&&c.update(u),c.update(o),c.update(i),u=c.finalize(),(s+=l.enc.Hex.stringify(u)).length>=2*a)break}var h={};return h.keyhex=s.substr(0,2*H[e].keylen),h.ivhex=s.substr(2*H[e].keylen,2*H[e].ivlen),h},G=function(e,t,r,n){var i=l.enc.Base64.parse(e),o=l.enc.Hex.stringify(i);return(0,H[t].proc)(o,r,n)},{version:"1.0.0",parsePKCS5PEM:function(e){return _(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,r){return j(e,t,r)},decryptKeyB64:function(e,t,r,n){return G(e,t,r,n)},getDecryptedKeyHex:function(e,t){var r=_(e),n=r.cipher,i=r.ivsalt,o=r.data,a=j(n,t,i).keyhex;return G(o,n,a,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,r,n,i){var o="";if(void 0!==n&&null!=n||(n="AES-256-CBC"),void 0===H[n])throw"KEYUTIL unsupported algorithm: "+n;if(void 0===i||null==i){var a=function(e){var t=l.lib.WordArray.random(e);return l.enc.Hex.stringify(t)}(H[n].ivlen);i=a.toUpperCase()}var s=function(e,t,r,n){return(0,H[t].eproc)(e,r,n)}(t,n,j(n,r,i).keyhex,i);return o="-----BEGIN "+e+" PRIVATE KEY-----\r\n",o+="Proc-Type: 4,ENCRYPTED\r\n",o+="DEK-Info: "+n+","+i+"\r\n",o+="\r\n",o+=s.replace(/(.{64})/g,"$1\r\n"),o+="\r\n-----END "+e+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(e){var t=W,r=t.getChildIdx,n=t.getV,i={},o=r(e,0);if(2!=o.length)throw"malformed format: SEQUENCE(0).items != 2: "+o.length;i.ciphertext=n(e,o[1]);var a=r(e,o[0]);if(2!=a.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+a.length;if("2a864886f70d01050d"!=n(e,a[0]))throw"this only supports pkcs5PBES2";var s=r(e,a[1]);if(2!=a.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+s.length;var l=r(e,s[1]);if(2!=l.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+l.length;if("2a864886f70d0307"!=n(e,l[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=n(e,l[1]);var u=r(e,s[0]);if(2!=u.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+u.length;if("2a864886f70d01050c"!=n(e,u[0]))throw"this only supports pkcs5PBKDF2";var c=r(e,u[1]);if(c.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+c.length;i.pbkdf2Salt=n(e,c[0]);var h=n(e,c[1]);try{i.pbkdf2Iter=parseInt(h,16)}catch(e){throw"malformed format pbkdf2Iter: "+h}return i},getPBKDF2KeyHexFromParam:function(e,t){var r=l.enc.Hex.parse(e.pbkdf2Salt),n=e.pbkdf2Iter,i=l.PBKDF2(t,r,{keySize:6,iterations:n});return l.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var r=D(e,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(r),i=K.getPBKDF2KeyHexFromParam(n,t),o={};o.ciphertext=l.enc.Hex.parse(n.ciphertext);var a=l.enc.Hex.parse(i),s=l.enc.Hex.parse(n.encryptionSchemeIV),u=l.TripleDES.decrypt(o,a,{iv:s});return l.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(e,t){var r=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(r)},parsePlainPrivatePKCS8Hex:function(e){var t=W,r=t.getChildIdx,n=t.getV,i={algparam:null};if("30"!=e.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var o=r(e,0);if(o.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(o[1],2))throw new Error("malformed PKCS8 private key(code:003)");var a=r(e,o[1]);if(2!=a.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(a[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=n(e,a[0]),"06"==e.substr(a[1],2)&&(i.algparam=n(e,a[1])),"04"!=e.substr(o[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=t.getVidx(e,o[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=D(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,r=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==r.algoid)t=new I;else if(s.crypto.DSA&&"2a8648ce380401"==r.algoid)t=new s.crypto.DSA;else{if(!s.crypto.ECDSA||"2a8648ce3d0201"!=r.algoid)throw"unsupported private key algorithm";t=new s.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,r=W.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===r)t=new I;else if(s.crypto.DSA&&"2a8648ce380401"===r)t=new s.crypto.DSA;else{if(!s.crypto.ECDSA||"2a8648ce3d0201"!==r)throw"unsupported PKCS#8 public key hex";t=new s.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=W,r=t.getChildIdx,n=t.getV,i={};if("30"!=e.substr(0,2))throw"malformed RSA key(code:001)";var o=r(e,0);if(2!=o.length)throw"malformed RSA key(code:002)";if("02"!=e.substr(o[0],2))throw"malformed RSA key(code:003)";if(i.n=n(e,o[0]),"02"!=e.substr(o[1],2))throw"malformed RSA key(code:004)";return i.e=n(e,o[1]),i},parsePublicPKCS8Hex:function(e){var t=W,r=t.getChildIdx,n=t.getV,i={algparam:null},o=r(e,0);if(2!=o.length)throw"outer DERSequence shall have 2 elements: "+o.length;var a=o[0];if("30"!=e.substr(a,2))throw"malformed PKCS8 public key(code:001)";var s=r(e,a);if(2!=s.length)throw"malformed PKCS8 public key(code:002)";if("06"!=e.substr(s[0],2))throw"malformed PKCS8 public key(code:003)";if(i.algoid=n(e,s[0]),"06"==e.substr(s[1],2)?i.algparam=n(e,s[1]):"30"==e.substr(s[1],2)&&(i.algparam={},i.algparam.p=t.getVbyList(e,s[1],[0],"02"),i.algparam.q=t.getVbyList(e,s[1],[1],"02"),i.algparam.g=t.getVbyList(e,s[1],[2],"02")),"03"!=e.substr(o[1],2))throw"malformed PKCS8 public key(code:004)";return i.key=n(e,o[1]).substr(2),i}});K.getKey=function(e,t,r){var n=(g=W).getChildIdx;g.getV;var i=g.getVbyList,o=s.crypto,a=o.ECDSA,l=o.DSA,c=I,h=D,d=K;if(void 0!==c&&e instanceof c)return e;if(void 0!==a&&e instanceof a)return e;if(void 0!==l&&e instanceof l)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new a({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new a({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(R=new c).setPublic(e.n,e.e),R;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(R=new c).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),R;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(R=new c).setPrivate(e.n,e.e,e.d),R;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(R=new l).setPublic(e.p,e.q,e.g,e.y),R;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(R=new l).setPrivate(e.p,e.q,e.g,e.y,e.x),R;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(R=new c).setPublic(P(e.n),P(e.e)),R;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(R=new c).setPrivateEx(P(e.n),P(e.e),P(e.d),P(e.p),P(e.q),P(e.dp),P(e.dq),P(e.qi)),R;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(R=new c).setPrivate(P(e.n),P(e.e),P(e.d)),R;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var p=(B=new a({curve:e.crv})).ecparams.keylen/4,f="04"+("0000000000"+P(e.x)).slice(-p)+("0000000000"+P(e.y)).slice(-p);return B.setPublicKeyHex(f),B}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){p=(B=new a({curve:e.crv})).ecparams.keylen/4,f="04"+("0000000000"+P(e.x)).slice(-p)+("0000000000"+P(e.y)).slice(-p);var v=("0000000000"+P(e.d)).slice(-p);return B.setPublicKeyHex(f),B.setPrivateKeyHex(v),B}if("pkcs5prv"===r){var A,m=e,g=W;if(9===(A=n(m,0)).length)(R=new c).readPKCS5PrvKeyHex(m);else if(6===A.length)(R=new l).readPKCS5PrvKeyHex(m);else{if(!(A.length>2&&"04"===m.substr(A[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";(R=new a).readPKCS5PrvKeyHex(m)}return R}if("pkcs8prv"===r)return R=d.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===r)return d._getKeyFromPublicPKCS8Hex(e);if("x509pub"===r)return X.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return X.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var y=D(e,"PUBLIC KEY");return d._getKeyFromPublicPKCS8Hex(y)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var b=h(e,"RSA PRIVATE KEY");return d.getKey(b,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var x=i(F=h(e,"DSA PRIVATE KEY"),0,[1],"02"),w=i(F,0,[2],"02"),M=i(F,0,[3],"02"),E=i(F,0,[4],"02"),C=i(F,0,[5],"02");return(R=new l).setPrivate(new u(x,16),new u(w,16),new u(M,16),new u(E,16),new u(C,16)),R}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){b=h(e,"EC PRIVATE KEY");return d.getKey(b,null,"pkcs5prv")}if(-1!=e.indexOf("-END PRIVATE KEY-"))return d.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var S=d.getDecryptedKeyHex(e,t),T=new I;return T.readPKCS5PrvKeyHex(S),T}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var B,R=i(F=d.getDecryptedKeyHex(e,t),0,[1],"04"),O=i(F,0,[2,0],"06"),L=i(F,0,[3,0],"03").substr(2);if(void 0===s.crypto.OID.oidhex2name[O])throw"undefined OID(hex) in KJUR.crypto.OID: "+O;return(B=new a({curve:s.crypto.OID.oidhex2name[O]})).setPublicKeyHex(L),B.setPrivateKeyHex(R),B.isPublic=!1,B}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var F;x=i(F=d.getDecryptedKeyHex(e,t),0,[1],"02"),w=i(F,0,[2],"02"),M=i(F,0,[3],"02"),E=i(F,0,[4],"02"),C=i(F,0,[5],"02");return(R=new l).setPrivate(new u(x,16),new u(w,16),new u(M,16),new u(E,16),new u(C,16)),R}if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return d.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},void 0!==s.asn1&&s.asn1||(s.asn1={}),s.asn1.ASN1Util={},s.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),i=2;i<e.length;i+=2){var o=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);if(n+=o.substr(1,7),"0"==o.substr(0,1))t=t+"."+new u(n,2).toString(10),n=""}return t};var W=new function(){};function Y(e){for(var t in s.crypto.Util.DIGESTINFOHEAD){var r=s.crypto.Util.DIGESTINFOHEAD[t],n=r.length;if(e.substring(0,n)==r)return[t,e.substring(n)]}return[]}function X(e){var t,r=W,n=r.getChildIdx,i=r.getV,o=r.getTLV,a=r.getVbyList,l=r.getVbyListEx,u=r.getTLVbyList,c=r.getTLVbyListEx,h=r.getIdxbyList,d=r.getIdxbyListEx,p=r.getVidx,f=r.getInt,v=r.oidname,A=r.hextooidstr,m=D;try{t=s.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]),r=f(t,0);if(r<0||2<r)throw new Error("malformed version field");return this.version=r+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return l(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 r in t)if(e===t[r])return r;return v(l(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=a(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getNotAfter=function(){var e=a(this.hex,0,[0,4+this.foffset,1]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getPublicKeyHex=function(){return r.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return h(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var e=this.getPublicKeyIdx();return h(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return K.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=u(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),r=this.getSignatureValueHex(),n=u(this.hex,0,[0],"30"),i=new s.crypto.Signature({alg:t});return i.init(e),i.updateHex(n),i.verify(r)},this.parseExt=function(e){var t,o,s;if(void 0===e){if(s=this.hex,3!==this.version)return-1;t=h(s,0,[0,7,0],"30"),o=n(s,t)}else{s=D(e);var l=h(s,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(s,l))return void(this.aExtInfo=new Array);t=h(s,0,[0,3,0,1,0],"30"),o=n(s,t),this.hex=s}this.aExtInfo=new Array;for(var u=0;u<o.length;u++){var c={critical:!1},d=0;3===n(s,o[u]).length&&(c.critical=!0,d=1),c.oid=r.hextooidstr(a(s,o[u],[0],"06"));var f=h(s,o[u],[1+d]);c.vidx=p(s,f),this.aExtInfo.push(c)}},this.getExtInfo=function(e){var t=this.aExtInfo,r=e;if(e.match(/^[0-9.]+$/)||(r=s.asn1.x509.OID.name2oid(e)),""!==r)for(var n=0;n<t.length;n++)if(t[n].oid===r)return t[n]},this.getExtBasicConstraints=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("basicConstraints");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.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 a=i(e,10),s=parseInt(a,16);return n.cA=!0,n.pathLen=s,n}throw new Error("hExtV parse error: "+e)},this.getExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("keyUsage");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.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=o(this.hex,t.vidx)}if(8!=e.length&&10!=e.length)throw new Error("malformed key usage value: "+e);var r="000000000000000"+parseInt(e.substr(6),16).toString(2);return 8==e.length&&(r=r.slice(-8)),10==e.length&&(r=r.slice(-16)),""==(r=r.replace(/0+$/,""))&&(r="0"),r},this.getExtKeyUsageString=function(e){for(var t=this.getExtKeyUsageBin(e),r=new Array,n=0;n<t.length;n++)"1"==t.substr(n,1)&&r.push(X.KEYUSAGE_NAME[n]);return r.join(",")},this.getExtSubjectKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("subjectKeyIdentifier");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var n={extname:"subjectKeyIdentifier"};t&&(n.critical=!0);var a=i(e,0);return n.kid={hex:a},n},this.getExtAuthorityKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("authorityKeyIdentifier");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var a={extname:"authorityKeyIdentifier"};t&&(a.critical=!0);for(var s=n(e,0),l=0;l<s.length;l++){var u=e.substr(s[l],2);if("80"===u&&(a.kid={hex:i(e,s[l])}),"a1"===u){var c=o(e,s[l]),h=this.getGeneralNames(c);a.issuer=h[0].dn}"82"===u&&(a.sn={hex:i(e,s[l])})}return a},this.getExtExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("extKeyUsage");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var a={extname:"extKeyUsage",array:[]};t&&(a.critical=!0);for(var s=n(e,0),l=0;l<s.length;l++)a.array.push(v(i(e,s[l])));return a},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var t=new Array,r=o(this.hex,e.vidx);if(""===r)return t;for(var a=n(r,0),s=0;s<a.length;s++)t.push(v(i(r,a[s])));return t},this.getExtSubjectAltName=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("subjectAltName");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.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 r=this.getExtInfo("issuerAltName");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.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),r=[],i=0;i<t.length;i++){var a=this.getGeneralName(o(e,t[i]));void 0!==a&&r.push(a)}return r},this.getGeneralName=function(e){var t=e.substr(0,2),r=i(e,0),n=B(r);return"81"==t?{rfc822:n}:"82"==t?{dns:n}:"86"==t?{uri:n}:"87"==t?{ip:F(r)}:"a4"==t?{dn:this.getX500Name(r)}:void 0},this.getExtSubjectAltName2=function(){var e,t,r,a=this.getExtInfo("subjectAltName");if(void 0===a)return a;for(var s=new Array,l=o(this.hex,a.vidx),u=n(l,0),c=0;c<u.length;c++)r=l.substr(u[c],2),e=i(l,u[c]),"81"===r&&(t=T(e),s.push(["MAIL",t])),"82"===r&&(t=T(e),s.push(["DNS",t])),"84"===r&&(t=X.hex2dn(e,0),s.push(["DN",t])),"86"===r&&(t=T(e),s.push(["URI",t])),"87"===r&&(t=F(e),s.push(["IP",t]));return s},this.getExtCRLDistributionPoints=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("cRLDistributionPoints");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var i={extname:"cRLDistributionPoints",array:[]};t&&(i.critical=!0);for(var a=n(e,0),s=0;s<a.length;s++){var l=o(e,a[s]);i.array.push(this.getDistributionPoint(l))}return i},this.getDistributionPoint=function(e){for(var t={},r=n(e,0),i=0;i<r.length;i++){var a=e.substr(r[i],2),s=o(e,r[i]);"a0"==a&&(t.dpname=this.getDistributionPointName(s))}return t},this.getDistributionPointName=function(e){for(var t={},r=n(e,0),i=0;i<r.length;i++){var a=e.substr(r[i],2),s=o(e,r[i]);"a0"==a&&(t.full=this.getGeneralNames(s))}return t},this.getExtCRLDistributionPointsURI=function(){var e=this.getExtInfo("cRLDistributionPoints");if(void 0===e)return e;for(var t=new Array,r=n(this.hex,e.vidx),i=0;i<r.length;i++)try{var o=T(a(this.hex,r[i],[0,0,0],"86"));t.push(o)}catch(e){}return t},this.getExtAIAInfo=function(){var e=this.getExtInfo("authorityInfoAccess");if(void 0===e)return e;for(var t={ocsp:[],caissuer:[]},r=n(this.hex,e.vidx),i=0;i<r.length;i++){var o=a(this.hex,r[i],[0],"06"),s=a(this.hex,r[i],[1],"86");"2b06010505073001"===o&&t.ocsp.push(T(s)),"2b06010505073002"===o&&t.caissuer.push(T(s))}return t},this.getExtAuthorityInfoAccess=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("authorityInfoAccess");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var i={extname:"authorityInfoAccess",array:[]};t&&(i.critical=!0);for(var s=n(e,0),u=0;u<s.length;u++){var c=l(e,s[u],[0],"06"),h=T(a(e,s[u],[1],"86"));if("2b06010505073001"==c)i.array.push({ocsp:h});else{if("2b06010505073002"!=c)throw new Error("unknown method: "+c);i.array.push({caissuer:h})}}return i},this.getExtCertificatePolicies=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("certificatePolicies");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var i={extname:"certificatePolicies",array:[]};t&&(i.critical=!0);for(var a=n(e,0),s=0;s<a.length;s++){var l=o(e,a[s]),u=this.getPolicyInformation(l);i.array.push(u)}return i},this.getPolicyInformation=function(e){var t={},r=a(e,0,[0],"06");t.policyoid=v(r);var i=d(e,0,[1],"30");if(-1!=i){t.array=[];for(var s=n(e,i),l=0;l<s.length;l++){var u=o(e,s[l]),c=this.getPolicyQualifierInfo(u);t.array.push(c)}}return t},this.getPolicyQualifierInfo=function(e){var t={},r=a(e,0,[0],"06");if("2b06010505070201"===r){var n=l(e,0,[1],"16");t.cps=B(n)}else if("2b06010505070202"===r){var i=u(e,0,[1],"30");t.unotice=this.getUserNotice(i)}return t},this.getUserNotice=function(e){for(var t={},r=n(e,0),i=0;i<r.length;i++){var a=o(e,r[i]);"30"!=a.substr(0,2)&&(t.exptext=this.getDisplayText(a))}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=B(i(e,0)),t},this.getExtCRLNumber=function(e,t){var r={extname:"cRLNumber"};if(t&&(r.critical=!0),"02"==e.substr(0,2))return r.num={hex:i(e,0)},r;throw new Error("hExtV parse error: "+e)},this.getExtCRLReason=function(e,t){var r={extname:"cRLReason"};if(t&&(r.critical=!0),"0a"==e.substr(0,2))return r.code=parseInt(i(e,0),16),r;throw new Error("hExtV parse error: "+e)},this.getExtOcspNonce=function(e,t){var r={extname:"ocspNonce"};t&&(r.critical=!0);var n=i(e,0);return r.hex=n,r},this.getExtOcspNoCheck=function(e,t){var r={extname:"ocspNoCheck"};return t&&(r.critical=!0),r},this.getExtAdobeTimeStamp=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("adobeTimeStamp");if(void 0===r)return;e=o(this.hex,r.vidx),t=r.critical}var i={extname:"adobeTimeStamp"};t&&(i.critical=!0);var a=n(e,0);if(a.length>1){var s=o(e,a[1]),l=this.getGeneralName(s);null!=l.uri&&(i.uri=l.uri)}if(a.length>2){var u=o(e,a[2]);"0101ff"==u&&(i.reqauth=!0),"010100"==u&&(i.reqauth=!1)}return i},this.getX500NameRule=function(e){for(var t=null,r=[],n=0;n<e.length;n++)for(var i=e[n],o=0;o<i.length;o++)r.push(i[o]);for(n=0;n<r.length;n++){var a=r[n],l=a.ds,u=a.value,c=a.type;if("prn"!=l&&"utf8"!=l&&"ia5"!=l)return"mixed";if("ia5"==l){if("CN"!=c)return"mixed";if(s.lang.String.isMail(u))continue;return"mixed"}if("C"==c){if("prn"==l)continue;return"mixed"}if(null==t)t=l;else if(t!==l)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=[],r=n(e,0),i=0;i<r.length;i++)t.push(this.getRDN(o(e,r[i])));return t},this.getRDN=function(e){for(var t=[],r=n(e,0),i=0;i<r.length;i++)t.push(this.getAttrTypeAndValue(o(e,r[i])));return t},this.getAttrTypeAndValue=function(e){var t={type:null,value:null,ds:null},r=n(e,0),i=a(e,r[0],[],"06"),o=a(e,r[1],[]),l=s.asn1.ASN1Util.oidHexToInt(i);return t.type=s.asn1.x509.OID.oid2atype(l),t.ds=this.HEX2STAG[e.substr(r[1],2)],"bmp"!=t.ds?t.value=T(o):t.value=function(e){return e.match(/.{4}/g).map((function(e){var t=parseInt(e.substr(0,2),16),r=parseInt(e.substr(2),16);if(0==t&r<128)return String.fromCharCode(r);if(t<8){var n=128|63&r;return T((192|(7&t)<<3|(192&r)>>6).toString(16)+n.toString(16))}n=128|(15&t)<<2|(192&r)>>6;var i=128|63&r;return T((224|(240&t)>>4).toString(16)+n.toString(16)+i.toString(16))})).join("")}(o),t},this.readCertPEM=function(e){this.readCertHex(m(e))},this.readCertHex=function(e){this.hex=e,this.getVersion();try{h(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=L(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),e},this.getExtParamArray=function(e){null==e&&(-1!=d(this.hex,0,[0,"[3]"])&&(e=c(this.hex,0,[0,"[3]",0],"30")));for(var t=[],r=n(e,0),i=0;i<r.length;i++){var a=o(e,r[i]),s=this.getExtParam(a);null!=s&&t.push(s)}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 r=A(a(e,0,[0],"06")),i=!1;3==t&&"0101ff"==u(e,0,[1])&&(i=!0);var o=u(e,0,[t-1,0]),s=void 0;if("2.5.29.14"==r?s=this.getExtSubjectKeyIdentifier(o,i):"2.5.29.15"==r?s=this.getExtKeyUsage(o,i):"2.5.29.17"==r?s=this.getExtSubjectAltName(o,i):"2.5.29.18"==r?s=this.getExtIssuerAltName(o,i):"2.5.29.19"==r?s=this.getExtBasicConstraints(o,i):"2.5.29.31"==r?s=this.getExtCRLDistributionPoints(o,i):"2.5.29.32"==r?s=this.getExtCertificatePolicies(o,i):"2.5.29.35"==r?s=this.getExtAuthorityKeyIdentifier(o,i):"2.5.29.37"==r?s=this.getExtExtKeyUsage(o,i):"1.3.6.1.5.5.7.1.1"==r?s=this.getExtAuthorityInfoAccess(o,i):"2.5.29.20"==r?s=this.getExtCRLNumber(o,i):"2.5.29.21"==r?s=this.getExtCRLReason(o,i):"1.3.6.1.5.5.7.48.1.2"==r?s=this.getExtOcspNonce(o,i):"1.3.6.1.5.5.7.48.1.5"==r?s=this.getExtOcspNoCheck(o,i):"1.2.840.113583.1.1.9.1"==r&&(s=this.getExtAdobeTimeStamp(o,i)),null!=s)return s;var l={extname:r,extn:o};return i&&(l.critical=!0),l},this.findExt=function(e,t){for(var r=0;r<e.length;r++)if(e[r].extname==t)return e[r];return null},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,r,n,i=function(e){for(var t="",r=e.array,n=0;n<r.length;n++){var i=r[n];if(t+=" policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var o=0;o<i.array.length;o++){var a=i.array[o];void 0!==a.cps&&(t+=" cps: "+a.cps+"\n")}}return t},o=function(e){for(var t="",r=e.array,n=0;n<r.length;n++){var i=r[n];try{void 0!==i.dpname.full[0].uri&&(t+=" "+i.dpname.full[0].uri+"\n")}catch(e){}try{void 0!==i.dname.full[0].dn.hex&&(t+=" "+X.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(e){}}return t},a=function(e){for(var t="",r=e.array,n=0;n<r.length;n++){var i=r[n];void 0!==i.caissuer&&(t+=" caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(t+=" ocsp: "+i.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="+Q(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+Q(t.e.toString(16))+"\n"),null!=(r=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var l=0;l<r.length;l++){var u=r[l],c=s.asn1.x509.OID.oid2name(u.oid);""===c&&(c=u.oid);var h="";if(!0===u.critical&&(h="CRITICAL"),e+=" "+c+" "+h+":\n","basicConstraints"===c){var d=this.getExtBasicConstraints();void 0===d.cA?e+=" {}\n":(e+=" cA=true",void 0!==d.pathLen&&(e+=", pathLen="+d.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 p=this.getExtAuthorityKeyIdentifier();void 0!==p.kid&&(e+=" kid="+p.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+=o(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"===c)e+=a(this.getExtAuthorityInfoAccess());else"certificatePolicies"===c&&(e+=i(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):s.lang.String.isHex(e)&&this.readCertHex(e))}function J(e){return l.SHA256(e).toString()}W.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var r=parseInt(e.substr(t+3,1));return 0==r?-1:0<r&&r<10?r+1:-2},W.getL=function(e,t){var r=W.getLblen(e,t);return r<1?"":e.substr(t+2,2*r)},W.getVblen=function(e,t){var r;return""==(r=W.getL(e,t))?-1:("8"===r.substr(0,1)?new u(r.substr(2),16):new u(r,16)).intValue()},W.getVidx=function(e,t){var r=W.getLblen(e,t);return r<0?r:t+2*(r+1)},W.getV=function(e,t){var r=W.getVidx(e,t),n=W.getVblen(e,t);return e.substr(r,2*n)},W.getTLV=function(e,t){return e.substr(t,2)+W.getL(e,t)+W.getV(e,t)},W.getTLVblen=function(e,t){return 2+2*W.getLblen(e,t)+2*W.getVblen(e,t)},W.getNextSiblingIdx=function(e,t){return W.getVidx(e,t)+2*W.getVblen(e,t)},W.getChildIdx=function(e,t){var r,n,i,o=W,a=[];r=o.getVidx(e,t),n=2*o.getVblen(e,t),"03"==e.substr(t,2)&&(r+=2,n-=2),i=0;for(var s=r;i<=n;){var l=o.getTLVblen(e,s);if((i+=l)<=n&&a.push(s),s+=l,i>=n)break}return a},W.getNthChildIdx=function(e,t,r){return W.getChildIdx(e,t)[r]},W.getIdxbyList=function(e,t,r,n){var i,o,a=W;return 0==r.length?void 0!==n&&e.substr(t,2)!==n?-1:t:(i=r.shift())>=(o=a.getChildIdx(e,t)).length?-1:a.getIdxbyList(e,o[i],r,n)},W.getIdxbyListEx=function(e,t,r,n){var i,o,a=W;if(0==r.length)return void 0!==n&&e.substr(t,2)!==n?-1:t;i=r.shift(),o=a.getChildIdx(e,t);for(var s=0,l=0;l<o.length;l++){var u=e.substr(o[l],2);if("number"==typeof i&&!a.isContextTag(u)&&s==i||"string"==typeof i&&a.isContextTag(u,i))return a.getIdxbyListEx(e,o[l],r,n);a.isContextTag(u)||s++}return-1},W.getTLVbyList=function(e,t,r,n){var i=W,o=i.getIdxbyList(e,t,r,n);return-1==o||o>=e.length?null:i.getTLV(e,o)},W.getTLVbyListEx=function(e,t,r,n){var i=W,o=i.getIdxbyListEx(e,t,r,n);return-1==o?null:i.getTLV(e,o)},W.getVbyList=function(e,t,r,n,i){var o,a,s=W;return-1==(o=s.getIdxbyList(e,t,r,n))||o>=e.length?null:(a=s.getV(e,o),!0===i&&(a=a.substr(2)),a)},W.getVbyListEx=function(e,t,r,n,i){var o,a,s=W;return-1==(o=s.getIdxbyListEx(e,t,r,n))?null:(a=s.getV(e,o),"03"==e.substr(o,2)&&!1!==i&&(a=a.substr(2)),a)},W.getInt=function(e,t,r){null==r&&(r=-1);try{var n=e.substr(t,2);if("02"!=n&&"03"!=n)return r;var i=W.getV(e,t);return"02"==n?parseInt(i,16):function(e){try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var r=parseInt(t,16),n=e.substr(2),i=parseInt(n,16).toString(2);return"0"==i&&(i="00000000"),i=i.slice(0,0-r),parseInt(i,2)}catch(e){return-1}}(i)}catch(e){return r}},W.getOID=function(e,t,r){null==r&&(r=null);try{return"06"!=e.substr(t,2)?r:function(e){if(!k(e))return null;try{var t=[],r=e.substr(0,2),n=parseInt(r,16);t[0]=new String(Math.floor(n/40)),t[1]=new String(n%40);for(var i=e.substr(2),o=[],a=0;a<i.length/2;a++)o.push(parseInt(i.substr(2*a,2),16));var s=[],l="";for(a=0;a<o.length;a++)128&o[a]?l+=N((127&o[a]).toString(2),7):(l+=N((127&o[a]).toString(2),7),s.push(new String(parseInt(l,2))),l="");var u=t.join(".");return s.length>0&&(u=u+"."+s.join(".")),u}catch(e){return null}}(W.getV(e,t))}catch(e){return r}},W.getOIDName=function(e,t,r){null==r&&(r=null);try{var n=W.getOID(e,t,r);if(n==r)return r;var i=s.asn1.x509.OID.oid2name(n);return""==i?n:i}catch(e){return r}},W.getString=function(e,t,r){null==r&&(r=null);try{return B(W.getV(e,t))}catch(e){return r}},W.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},r=[],n=e.substr(0,2),i=parseInt(n,16);r[0]=new String(Math.floor(i/40)),r[1]=new String(i%40);for(var o=e.substr(2),a=[],s=0;s<o.length/2;s++)a.push(parseInt(o.substr(2*s,2),16));var l=[],u="";for(s=0;s<a.length;s++)128&a[s]?u+=t((127&a[s]).toString(2),7):(u+=t((127&a[s]).toString(2),7),l.push(new String(parseInt(u,2))),u="");var c=r.join(".");return l.length>0&&(c=c+"."+l.join(".")),c},W.isContextTag=function(e,t){var r,n;e=e.toLowerCase();try{r=parseInt(e,16)}catch(e){return-1}if(void 0===t)return 128==(192&r);try{return null!=t.match(/^\[[0-9]+\]$/)&&(!((n=parseInt(t.substr(1,t.length-1),10))>31)&&(128==(192&r)&&(31&r)==n))}catch(e){return!1}},W.isASN1HEX=function(e){var t=W;if(e.length%2==1)return!1;var r=t.getVblen(e,0),n=e.substr(0,2),i=t.getL(e,0);return e.length-n.length-i.length==2*r},W.checkStrictDER=function(e,t,r,n,i){var o=W;if(void 0===r){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!s.lang.String.isHex(e))throw new Error("not hex string");r=e.length,i=(n=e.length/2)<128?1:Math.ceil(n.toString(16))+1}if(o.getL(e,t).length>2*i)throw new Error("L of TLV too long: idx="+t);var a=o.getVblen(e,t);if(a>n)throw new Error("value of L too long than hex: idx="+t);var l=o.getTLV(e,t),u=l.length-2-o.getL(e,t).length;if(u!==2*a)throw new Error("V string length and L's value not the same:"+u+"/"+2*a);if(0===t&&e.length!=l.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+l.length);var c=e.substr(t,2);if("02"===c){var h=o.getVidx(e,t);if("00"==e.substr(h,2)&&e.charCodeAt(h+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(c,16)){for(var d=o.getVblen(e,t),p=0,f=o.getChildIdx(e,t),v=0;v<f.length;v++){p+=o.getTLV(e,f[v]).length,o.checkStrictDER(e,f[v],r,n,i)}if(2*d!=p)throw new Error("sum of children's TLV length and L unmatch: "+2*d+"!="+p)}},W.oidname=function(e){var t=s.asn1;s.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var r=t.x509.OID.oid2name(e);return""===r&&(r=e),r},void 0!==s.asn1&&s.asn1||(s.asn1={}),void 0!==s.asn1.x509&&s.asn1.x509||(s.asn1.x509={}),s.asn1.x509.AlgorithmIdentifier={},s.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},s.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],r=new s.asn1.DERObjectIdentifier({oid:t});return this.objCache[e]=r,r},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 r=new s.asn1.DERObjectIdentifier({oid:t});return this.objCache[e]=r,r}},s.asn1.x509.OID.oid2name=function(e){var t=s.asn1.x509.OID.name2oidList;for(var r in t)if(t[r]==e)return r;return""},s.asn1.x509.OID.oid2atype=function(e){var t=s.asn1.x509.OID.atype2oidList;for(var r in t)if(t[r]==e)return r;return e},s.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=s.asn1.x509.OID.name2oidList;return void 0===t[e]?"":t[e]},I.getPosArrayOfChildrenFromHex=function(e){return W.getChildIdx(e,0)},I.getHexValueArrayOfChildrenFromHex=function(e){var t,r=W.getV,n=r(e,(t=I.getPosArrayOfChildrenFromHex(e))[0]),i=r(e,t[1]),o=r(e,t[2]),a=r(e,t[3]),s=r(e,t[4]),l=r(e,t[5]),u=r(e,t[6]),c=r(e,t[7]),h=r(e,t[8]);return(t=new Array).push(n,i,o,a,s,l,u,c,h),t},I.prototype.readPrivateKeyFromPEMString=function(e){var t=D(e),r=I.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},I.prototype.readPKCS5PrvKeyHex=function(e){var t=I.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},I.prototype.readPKCS8PrvKeyHex=function(e){var t,r,n,i,o,a,s,l,u=W,c=u.getVbyListEx;if(!1===u.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=c(e,0,[2,0,1],"02"),r=c(e,0,[2,0,2],"02"),n=c(e,0,[2,0,3],"02"),i=c(e,0,[2,0,4],"02"),o=c(e,0,[2,0,5],"02"),a=c(e,0,[2,0,6],"02"),s=c(e,0,[2,0,7],"02"),l=c(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,r,n,i,o,a,s,l)},I.prototype.readPKCS5PubKeyHex=function(e){var t=W,r=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 i=r(e,n[0]),o=r(e,n[1]);this.setPublic(i,o)},I.prototype.readPKCS8PubKeyHex=function(e){var t=W;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 r=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(r)},I.prototype.readCertPubKeyHex=function(e,t){var r,n;(r=new X).readCertHex(e),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},I.prototype.verify=function(e,t){if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var r=E(t,16),n=this.n.bitLength();if(r.bitLength()>n)return!1;var i=this.doPublic(r).toString(16);if(i.length+3!=n/4)return!1;var o=Y(i.replace(/^1f+00/,""));if(0==o.length)return!1;var a,l=o[0];return o[1]==(a=e,s.crypto.Util.hashString(a,l))},I.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=E(t,16);if(r.bitLength()>this.n.bitLength())return 0;var n=Y(this.doPublic(r).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==e)},I.prototype.verifyPSS=function(e,t,r,n){var i=function(e){return s.crypto.Util.hashHex(e,r)}(R(e));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(i,t,r,n)},I.prototype.verifyWithMessageHashPSS=function(e,t,r,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,o=new u(t,16),a=function(e){return s.crypto.Util.hashHex(e,r)},l=B(e),c=l.length,h=this.n.bitLength()-1,d=Math.ceil(h/8);if(-1===n||void 0===n)n=c;else if(-2===n)n=d-c-2;else if(n<-2)throw new Error("invalid salt length");if(d<c+n+2)throw new Error("data too long");var p=this.doPublic(o).toByteArray();for(i=0;i<p.length;i+=1)p[i]&=255;for(;p.length<d;)p.unshift(0);if(188!==p[d-1])throw new Error("encoded message does not end in 0xbc");var f=(p=String.fromCharCode.apply(String,p)).substr(0,d-c-1),v=p.substr(f.length,c),A=65280>>8*d-h&255;if(0!=(f.charCodeAt(0)&A))throw new Error("bits beyond keysize not zero");var m=pss_mgf1_str(v,f.length,a),g=[];for(i=0;i<f.length;i+=1)g[i]=f.charCodeAt(i)^m.charCodeAt(i);g[0]&=~A;var y=d-c-n-2;for(i=0;i<y;i+=1)if(0!==g[i])throw new Error("leftmost octets not zero");if(1!==g[y])throw new Error("0x01 marker not found");return v===B(a(R("\0\0\0\0\0\0\0\0"+l+String.fromCharCode.apply(String,g.slice(-n)))))},I.SALT_LEN_HLEN=-1,I.SALT_LEN_MAX=-2,I.SALT_LEN_RECOVER=-2,X.hex2dn=function(e,t){void 0===t&&(t=0);var r=new X;return W.getTLV(e,t),r.getX500Name(e).str},X.hex2rdn=function(e,t){if(void 0===t&&(t=0),"31"!==e.substr(t,2))throw new Error("malformed RDN");for(var r=new Array,n=W.getChildIdx(e,t),i=0;i<n.length;i++)r.push(X.hex2attrTypeValue(e,n[i]));return(r=r.map((function(e){return e.replace("+","\\+")}))).join("+")},X.hex2attrTypeValue=function(e,t){var r=W,n=r.getV;if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw new Error("malformed attribute type and value");var i=r.getChildIdx(e,t);2!==i.length||e.substr(i[0],2);var o=n(e,i[0]),a=s.asn1.ASN1Util.oidHexToInt(o);return s.asn1.x509.OID.oid2atype(a)+"="+B(n(e,i[1]))},X.getPublicKeyFromCertHex=function(e){var t=new X;return t.readCertHex(e),t.getPublicKey()},X.getPublicKeyFromCertPEM=function(e){var t=new X;return t.readCertPEM(e),t.getPublicKey()},X.getPublicKeyInfoPropOfCertPEM=function(e){var t,r,n=W.getVbyList,i={};return i.algparam=null,(t=new X).readCertPEM(e),r=t.getPublicKeyHex(),i.keyhex=n(r,0,[1],"03").substr(2),i.algoid=n(r,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=n(r,0,[0,1],"06")),i},X.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];var Z,$=[(Z=new X,Z.readCertPEM(function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}(":::::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[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enSuvv?>|f_?UpYPcQ\\gCb8zxtSvsOQNg>[\\\0\bx\b_o@8\0g`Z<PyUE`8yu}\\g{@`s`zUgErRtve{YdCvoO@>WFDtABNp\0feUWszpQaEYNAc]^xB[@]BDAN8\b}XA=EnO}Pud8TA\t?yPrVv{\\>E]o`BO^RE^X[W[rEU?x\bf>V\tOUwY=>X[\\E`tW[8}VwpFBQcnrPF}yUtd8<Doe_\b[oOVUep@pYY\0cegY{r\t?\bAbq?ff8}UaXoN_D]_X_8yozYFT`N{`\\{zvu?\bDWT}=_<StX\tNx\0\b\t\0aT=c@ucnWfR[vf>RFxAFV}{N`dN^\\<eawBPxx}quT=|{T_R@Fp^Y<ZevRsWaZ]V\tCVrRVtAAc[\tQp|d|tqoQ=T|XX\t=u\\N8XNCx\\aU>wz\tX<e@Vc?dy\\|^FEq|=p`pBdF@bs^d<]vp\\^TZ\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:::::")),Z)];function ee(e,t){var r=e.getIssuerHex();if(r===e.getSubjectHex())return e.verifySignature(e.getPublicKey());var n=function(e,t){for(var r=0,n=t;r<n.length;r++){var i=n[r];if(i.getSubjectHex()===e)return i}}(r,t);return!!n&&(!1!==e.verifySignature(n.getPublicKey())&&ee(n,t))}function te(e){return e.getIssuerHex()!==e.getSubjectHex()&&ee(e,$)}!function(e){var t=new X;"string"==typeof e?t.readCertPEM(e):t.readCertHex(e.hex);var r=te(t);$.push(t)}(function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}(":::::ORTV[-PR_aVSVPNaR:::::ZVVTU\tPPONrtNVONtVWNW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in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},re(e,t)};function ne(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}re(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var ie=function(){return ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ie.apply(this,arguments)};function oe(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}function ae(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function se(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function le(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function ue(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var ce,he=(ce="$$FIVE_EVENT$$","undefined"==typeof Symbol?"$Symbol<".concat(ce,">$"):Symbol(ce));function de(e){return e[he]||(e[he]={}),e[he]}var pe=function(){function e(){}return e.prototype.hasListener=function(e){var t=de(this);return t&&t[e]&&t[e].callbacks.length>0},e.prototype.on=function(e,t,r){var n=this,i=de(this);return i[e]||(i[e]={called:[!1],callbacks:[]}),i[e].callbacks.push([t,r||!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 r,n=de(this);if(n[e]||(n[e]={called:[!1],callbacks:[]}),void 0!==t){for(var i=0;i<n[e].callbacks.length&&n[e].callbacks[i][0]!==t;i++);i<n[e].callbacks.length&&n[e].callbacks.splice(i,1)}else n[e].callbacks.length=0}else(r=this)[he]||delete r[he]},e.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=!1,i=de(this);i[e]||(i[e]={called:[!1],callbacks:[]}),i[e].called=[!0,t];for(var o=0,a=i[e].callbacks.slice();o<a.length;o++){var s=a[o],l=s[0],u=s[1],c=void 0!==u&&u,h=l.apply(void 0,t);c&&this.off(e,l),!1===h&&(n=!0)}return n},e.prototype.waitUnitl=function(e){var t=this,r=de(this);r[e]||(r[e]={called:[!1],callbacks:[]});var n=r[e].called,i=n[0],o=n[1];return i?Promise.resolve(o):new Promise((function(r){t.once(e,(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(e),!0}))}))},e}();function fe(){}var ve="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),Ae="undefined"!=typeof performance?function(){return ve+performance.now()}:function(){return Date.now()};function me(e){Object.freeze(e);var t="function"==typeof e,r=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(e).forEach((function(n){!r.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])||me(e[n])})),e}var ge=/^([^.]+)(\.([^.]+))*$/;function ye(e){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(e)}function be(e,t){return ge.test(e)&&ge.test(t)&&function(e,t){if("*"===e)return!0;var r=e.split(".").reverse(),n=t.split(".").reverse();if(r.length<=1)return e===t;for(var i=0;i<r.length;i++)if(r[i]!==n[i])return!1;return!0}(e,t)}var xe=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],we=me(JSON.parse(function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("h/y|pnyu|/9/xr;p|z/9/yvn{wvn;p|z/9/rnyrr;p|z/9/rnyrr;p{/9/rnyrr;w}/9/uv;p|z/9/uv;p{/9/ywpq{;p|z/9/rnyrr:pq{;p|z/9/rnyrr:pq{;p{/9/rnyrr;nv/9/;p{/9/pq{;p{/9/pnyp{|qr;vr/j"))),Me=function(e){function t(t,r,n){return e.call(this,"[NETWORK]: request proxy error(type: ".concat(r,", reason: ").concat(n,"): ").concat(t))||this}return ne(t,e),t}(Error),Ee=function(e){function t(t,r,n){var i=e.call(this,"[NETWORK]: response error(type: ".concat(r,", status: ").concat(n,"): ").concat(t))||this;return i.httpStatus=n,i}return ne(t,e),t}(Error);!function(e){function t(t,r){return e.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(t))||this}ne(t,e)}(Error);var Ce=function(e){function t(t,r,n){return e.call(this,"[NETWORK]: request timeout(type: ".concat(r,", timeout: ").concat(n,"ms): ").concat(t))||this}return ne(t,e),t}(Error),Ie=function(e){function t(t,r,n){return e.call(this,"[NETWORK]: request forbidden(type: ".concat(r,", reason: ").concat(n,"): ").concat(t))||this}return ne(t,e),t}(Error);function Se(e){for(var t=0,r=xe;t<r.length;t++){var n=r[t],i=e.match(n);if(i)return"jsonp_"+i[1]}return null}function Pe(e){return null!==Se(e)}function Te(e){var t=e.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function Be(e){if(/^blob\:/i.test(e))return"blob:";if(/^data\:/i.test(e))return"data:";var t=e.match(/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/i);return t?t[2]:location.hostname}var Re=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ne(t,e),t}(pe);function Oe(e,t,r,n,i){void 0===t&&(t={}),void 0===r&&(r=fe),void 0===n&&(n=fe),void 0===i&&(i=fe);var o=Ae(),a=e;return Promise.resolve().then((function(){return t.requestProxy?t.requestProxy(e):e})).then((function(e){return/^https\:/.test(location.href)&&/^http\:/.test(e)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(e,"'. This request was automatically upgraded to HTTPS")),e.replace(/^http\:/,"https:")):e})).catch((function(r){var n,i=Se(e)?"Script":"XMLHttpRequest",o=new Me(a,i,r&&r.message?String(r.message):String(r));return null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,i,"proxy-error",o.message),Promise.reject(o)})).then((function(e){return new Promise((function(s,l){var u,c=t.allowHosts?we.concat(t.allowHosts):we.slice(),h=Be(e),d=Se(e);if(0!==location.hostname.length&&!ye(location.hostname)&&0===we.filter((function(e){return be(e,location.hostname)})).length&&!ye(h)&&0===c.filter((function(e){return be(e,h)})).length){var p=d?"Script":"XMLHttpRequest",f=new Ie(e,p,"request host(".concat(h,") is not allowed"));return n(f),l(f),void(null===(u=t.networkSubscribe)||void 0===u||u.emit("network",e,p,"forbidden",f.message))}if(d){var v=window,A=null,m=!1,g=document.createElement("script");v[d]=function(i){var u,c,h=Ae(),p=h-o;if(delete v[d],g.parentNode&&g.parentNode.removeChild(g),null!==A&&(window.clearTimeout(A),A=null),!0!==m){if(0!==i.indexOf("data:")){var f=new Ee(e,"Script",500);return n(f),l(f),void(null===(u=t.networkSubscribe)||void 0===u||u.emit("network",e,"Script","error",f.message))}var y=i.split(","),b=(y[0].match(/:(.*?);/)||[])[1],x=y[1];if("arraybuffer"===t.responseType||"blob"===t.responseType){for(var w=atob(y[1]),M=w.length,E=new Uint8Array(M),C=0;C<M;C++)E[C]=w.charCodeAt(C);x="arraybuffer"===t.responseType?E.buffer:new Blob([E],{type:b})}var I={body:x,meta:{origin:a,source:e,requestTime:o,responseTime:h,costs:p,headers:{}}};r(I),s(I),null===(c=t.networkSubscribe)||void 0===c||c.emit("network",e,"Script","ok",JSON.stringify(I.meta)),m=!0}},g.src=e,document.body.appendChild(g),"number"==typeof t.timeout&&(A=window.setTimeout((function(){var r;if(A=null,!0!==m){m=!0;var i=new Ce(e,"Script",t.timeout||NaN);n(i),l(i),null===(r=t.networkSubscribe)||void 0===r||r.emit("network",e,"Script","timeout",i.message)}}),t.timeout))}else{var y=!1,b=new XMLHttpRequest,x=function(){b&&(b.removeEventListener("timeout",w,!1),b.removeEventListener("progress",M,!1),b.removeEventListener("load",E,!1),b.removeEventListener("error",C,!1)),b=null,x=fe},w=function(){var r;if(!0!==y){y=!0,x();var i=new Ce(e,"XMLHttpRequest",t.timeout||NaN);n(i),l(i),null===(r=t.networkSubscribe)||void 0===r||r.emit("network",e,"XMLHttpRequest","timeout",i.message)}},M=function(e){!0!==y&&e.lengthComputable&&(e.total<=0||i(e.loaded/e.total))},E=function(n){var i;if(!0!==y){var l=this.status;if(0===l||l>=200&&l<400){y=!0,x();var u=Ae(),c=u-o,h=function(e){if(!e)return{};for(var t={},r=e.trim().split("\n"),n=0;n<r.length;n++){var i=r[n],o=i.indexOf(":"),a=i.slice(0,o).trim().toLowerCase(),s=i.slice(o+1).trim();s&&(t[a]?t[a]+=", "+s:t[a]=s)}return t}(this.getAllResponseHeaders()),d=n.total,p={body:this.response,meta:{origin:a,source:e,requestTime:o,responseTime:u,costs:c,headers:h,size:d}};r(p),s(p),null===(i=t.networkSubscribe)||void 0===i||i.emit("network",e,"XMLHttpRequest","ok",JSON.stringify(p.meta))}else C.call(this)}},C=function(){var r;if(!0!==y){y=!0,x();var i=new Ee(e,"XMLHttpRequest",this.status);n(i),l(i),null===(r=t.networkSubscribe)||void 0===r||r.emit("network",e,"XMLHttpRequest","error",i.message)}};b.addEventListener("timeout",w,!1),b.addEventListener("progress",M,!1),b.addEventListener("load",E,!1),b.addEventListener("error",C,!1),t.responseType&&(b.responseType=t.responseType),"number"==typeof t.timeout&&(b.timeout=t.timeout),b.open("GET",e,!0),b.send(null)}}))}))}var Le={};function De(e,t){void 0===t&&(t={});var r=Ae(),n=e;return Promise.resolve().then((function(){return t.requestProxy?t.requestProxy(e):e})).then((function(e){return/^https\:/.test(location.href)&&/^http\:/.test(e)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(e,"'. This request was automatically upgraded to HTTPS")),e.replace(/^http\:/,"https:")):e})).catch((function(r){var i,o=new Me(n,"Link",r&&r.message?String(r.message):String(r));return null===(i=t.networkSubscribe)||void 0===i||i.emit("network",e,"Link","proxy-error",o.message),Promise.reject(o)})).then((function(e){return e in Le?Le[e]:Le[e]=new Promise((function(i,o){var a,s=t.allowHosts?we.concat(t.allowHosts):we.slice(),l=Be(e);if(0!==location.hostname.length&&!ye(location.hostname)&&0===we.filter((function(e){return be(e,location.hostname)})).length&&!ye(l)&&0===s.filter((function(e){return be(e,l)})).length){var u=new Ie(e,"Link","request host(".concat(l,") is not allowed"));return o(u),void(null===(a=t.networkSubscribe)||void 0===a||a.emit("network",e,"Link","forbidden",u.message))}var c=document.createElement("link");c.href=e,c.rel=c.relList&&c.relList.supports("prefetch")?"prefetch":"preload",c.as="fetch",c.crossOrigin="";var h=document.head||document.getElementsByTagName("head")[0];h&&h.appendChild(c);var d=!1;c.onload=function(){var o;if(!0!==d){d=!0,i();var a=Ae(),s={origin:n,source:e,requestTime:r,responseTime:a,costs:a-r,headers:{}};null===(o=t.networkSubscribe)||void 0===o||o.emit("network",e,"Link","preload",JSON.stringify(s))}},c.onerror=function(r){var n;if(!0!==d){d=!0;var i=new Ee(e,"Link",0);o(i),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"Link","error",i.message)}}}))}))}function Fe(e,t,r,n,i,o){void 0===t&&(t={}),void 0===r&&(r=fe),void 0===n&&(n=fe),void 0===i&&(i=fe);var a=Ae(),s=e;return Promise.resolve().then((function(){return t.requestProxy?t.requestProxy(e):e})).then((function(e){return/^https\:/.test(location.href)&&/^http\:/.test(e)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(e,"'. This request was automatically upgraded to HTTPS")),e.replace(/^http\:/,"https:")):e})).catch((function(r){var n,i=new Me(s,"Image",r&&r.message?String(r.message):String(r));return null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"Image","proxy-error",i.message),Promise.reject(i)})).then((function(e){return new Promise((function(l,u){var c,h=t.allowHosts?we.concat(t.allowHosts):we.slice(),d=Be(e);if(0!==location.hostname.length&&!ye(location.hostname)&&0===we.filter((function(e){return be(e,location.hostname)})).length&&!ye(d)&&0===h.filter((function(e){return be(e,d)})).length){var p=new Ie(e,"Image","request host(".concat(d,") is not allowed"));return n(p),u(p),void(null===(c=t.networkSubscribe)||void 0===c||c.emit("network",e,"Image","forbidden",p.message))}var f=null!=o?o:new Image,v=!1,A=null;"number"==typeof t.timeout&&(A=window.setTimeout((function(){var r;if(f.onload=fe,f.onerror=fe,A=null,!0!==v){v=!0;var i=new Ce(e,"Image",t.timeout);n(i),u(i),null===(r=t.networkSubscribe)||void 0===r||r.emit("network",e,"Image","timeout",i.message)}}),t.timeout)),f.onload=function(){var n;if(f.onload=fe,f.onerror=fe,null!==A&&(clearTimeout(A),A=null),!0!==v){var o=Ae();v=!0;var u={body:f,meta:{headers:{},origin:s,source:e,requestTime:a,responseTime:o,costs:o-a}};i(1),r(u),l(u),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"Image","ok",JSON.stringify(u.meta))}},f.onerror=function(){var r;if(f.onload=fe,f.onerror=fe,null!==A&&(clearTimeout(A),A=null),!0!==v){v=!0;var i=new Ee(e,"Image",0);n(i),u(i),null===(r=t.networkSubscribe)||void 0===r||r.emit("network",e,"Image","ok",i.message)}},i(0),f.src=e}))}))}var ke=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)}}(),Qe=16,Ne=function(){function e(){this.frames=[],this.stoped=!1,this.time=Ae(),this.context=null,this.loop=this.loop.bind(this),this.loop()}return Object.defineProperty(e,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new e),this.sharedInstance},enumerable:!1,configurable:!0}),e.getFrameTime=function(){return Qe},e.prototype.loop=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!this.stoped){var r=Ae(),n=r-this.time;this.time=r;var i=[];Qe=n;for(var o=0,a=this.frames;o<a.length;o++){var s=a[o];if(s.delay>0)s.delay=s.delay-1;else{try{s.callback.apply(s,ue([r,n],e,!1))}catch(e){console.error(e)}s.once&&i.push(s)}}i.length>0&&(this.frames=this.frames.filter((function(e){return-1===i.indexOf(e)}))),this.requestAnimationFrame(this.loop)}},e.prototype.setContext=function(e){this.cancelAnimationFrame(this.requestId),this.context=e,this.requestId=this.requestAnimationFrame(this.loop)},e.prototype.getContext=function(){return this.context},e.prototype.requestAnimationFrame=function(e){return this.context?this.context.requestAnimationFrame(e):ke(e)},e.prototype.cancelAnimationFrame=function(e){this.context?this.context.cancelAnimationFrame(e):function(e){var t;if("undefined"!=typeof window){var r=window;t=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||r.msCancelAnimationFrame||function(e){return window.clearTimeout(e)}}else t=function(e){return window.clearTimeout(e)};t(e)}(this.loop),this.requestId=null},e.prototype.remove=function(e){var t=this.frames.indexOf(e);t>=0&&this.frames.splice(t,1)},e.prototype.add=function(e,t,r,n){var i=this;void 0===t&&(t=!1),void 0===r&&(r=0),void 0===n&&(n=5);var o={callback:e,once:t,delay:r,order:n};return this.frames.push(o),this.frames.sort((function(e,t){return e.order-t.order})),function(){return i.remove(o)}},e.prototype.disponse=function(){this.stoped=!0,this.frames.length=0},e}(),Ve={"vrlab-public.ljcdn.com":{type:"tencentCloud",pano:["vrlab-image1.ljcdn.com","vrlab-image2.ljcdn.com"],texture:["vrlab-image3.ljcdn.com"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vrlab-image4.ljcdn.com"]},"vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["vr-image-1.realsee-cdn.cn","vr-image-2.realsee-cdn.cn"],texture:["vr-image-3.realsee-cdn.cn"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vr-image-4.realsee-cdn.cn"]},"vr-public.rscdn.cn":{type:"tencentCloud",pano:["vr-image-1.rscdn.cn","vr-image-2.rscdn.cn"],texture:["vr-image-3.rscdn.cn"],tile:["vr-tile-1.rscdn.cn","vr-tile-2.rscdn.cn"],model:["vr-model-1.rscdn.cn","vr-model-2.rscdn.cn"],default:["vr-image-4.rscdn.cn"]},"mars-public.realsee-cdn.cn":{type:"aliyun",pano:["mars-image-1.realsee-cdn.cn","mars-image-2.realsee-cdn.cn"],texture:["mars-image-3.realsee-cdn.cn"],tile:["mars-tile-1.realsee-cdn.cn","mars-tile-2.realsee-cdn.cn"],model:["mars-model-1.realsee-cdn.cn","mars-model-2.realsee-cdn.cn"],default:["mars-image-4.realsee-cdn.cn"]},"global-public.realsee-cdn.com":{type:"tencentCloud",pano:["global-image-1.realsee-cdn.com","global-image-2.realsee-cdn.com"],texture:["global-image-3.realsee-cdn.com"],tile:["global-tile-1.realsee-cdn.com","global-tile-2.realsee-cdn.com"],model:["global-model-1.realsee-cdn.com","global-model-2.realsee-cdn.com"],default:["global-image-4.realsee-cdn.com"]},"earth-ga-public.realsee-cdn.cn":{type:"tencentCloud",pano:["earth-ga-image-1.realsee-cdn.cn","earth-ga-image-2.realsee-cdn.cn"],texture:["earth-ga-image-3.realsee-cdn.cn"],tile:["earth-ga-tile-1.realsee-cdn.cn","earth-ga-tile-2.realsee-cdn.cn"],model:["earth-ga-model-1.realsee-cdn.cn","earth-ga-model-2.realsee-cdn.cn"],default:["earth-ga-image-4.realsee-cdn.cn"]},"test-vr-public.realsee-cdn.com":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],texture:["test-vr-image.realsee-cdn.com"],tile:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],model:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],default:["test-vr-image.realsee-cdn.com"]},"test-vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],texture:["test-vr-image.realsee-cdn.cn"],tile:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],model:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],default:["test-vr-image.realsee-cdn.cn"]}},Ue=/^https?\:\/\/?([^\/]+)/;function ze(e,t){return e.replace(Ue,(function(e,r){return e.slice(0,e.length-r.length)+t}))}var qe=function(e,t){var r,n=e.split("?")[0],i=n.split(".").pop();if("jpeg"===i&&(i="jpg"),"png"!==i&&"jpg"!==i)return e;var o="";if(void 0!==t.format&&t.format!==i&&(o+="/format/".concat(t.format)),void 0!==t.cut&&(o+="/cut/".concat(t.cut[2],"x").concat(t.cut[3],"x").concat(t.cut[0],"x").concat(t.cut[1])),void 0!==t.quality){var a=null!==(r=t.format)&&void 0!==r?r:i;a&&["jpg","webp","tpg","heif","avif"].indexOf(a)>=0&&(o+="/quality/".concat(t.quality))}if(void 0!==t.size){var s=e.match(/\/cube_(\d+)\//);(s?Number(s[1]):NaN)!==Number(t.size)&&(o+="/thumbnail/".concat(t.size,"x"))}return void 0!==t.sharpen&&(o+="/sharpen/".concat(t.sharpen)),o.length&&(o="?imageMogr2"+o),n+o},He=function(e,t){var r,n=e.split("?")[0],i=n.split(".").pop();if("jpeg"===i&&(i="jpg"),"png"!==i&&"jpg"!==i)return e;var o="",a=[],s=t.format,l=t.quality,u=t.size;if(void 0!==s&&s!==i&&a.push("format,".concat("heif"===s?"heic":s)),void 0!==t.cut){var c=t.cut,h=c[0],d=c[1],p=c[2],f=c[3];a.push("crop,x_".concat(h,",y_").concat(d,",w_").concat(p,",h_").concat(f,",g_nw"))}if(void 0!==l&&100!==l){var v=null!==(r=t.format)&&void 0!==r?r:i;v&&["jpg","webp"].indexOf(v)>=0&&a.push("quality,Q_".concat(l))}return u&&2048!==u&&a.push("resize,w_".concat(u)),void 0!==t.sharpen&&a.push("sharpen,".concat(t.sharpen)),a.length&&(o="?x-oss-process=image/"+a.join("/")),n+o};function _e(e,t){var r=ie(ie({},Ve),t.mappings),n=function(e){var t=e.match(Ue);return null===t?null:t[1]}(e);if(null===n)return e;var i=r[n];return i?(e=function(e,t,r){var n=t.split("."),i=n[0],o=n.slice(1);if("texture"===i)return ze(e,r.texture[0]);if("pano"===i||"pano_luminance"===i)switch(o[0],o[1]){case"front":case"left":case"up":return ze(e,r.pano[0]);case"down":case"right":case"back":return ze(e,r.pano[1])}else if("pano_tile"===i||"pano_tile_luminance"===i){o[0],o[1];var a=o[2],s=o[3],l=o[4],u=Math.pow(2,Number(a))*Number(s)+Number(l);if(!isNaN(u))return ze(e,r.tile[u%2])}else if("model"===i){var c=o[0];if(u=Number(c),!isNaN(u))return ze(e,r.model[u%2])}return ze(e,r.default[0])}(e,t.key,i),/\.basis(\?|$)/.test(e)&&(e=e.replace(/\.basis(\?|$)/,".jpg$1")),"tencentCloud"===i.type?qe(e,t):"aliyun"===i.type?He(e,t):e):e}function je(e,t,r){void 0===t&&(t=_e);var n=t(e,r);if(n===e&&r.cut)throw new Error("ImageURL: cut option not applied.");return n}function Ge(e){return new Promise((function(t){var r=new Image,n=setTimeout((function(){r.onload=r.onerror=function(){},clearTimeout(n),t(!1)}));r.onload=r.onerror=function(){r.onload=r.onerror=function(){},clearTimeout(n),t(2===r.height)},r.src=e}))}var Ke=null;var We,Ye,Xe,Je=function(){function e(){this.numPlanes=0,this.clipperPlanes=null,this.clipperFloors=null}return Object.defineProperty(e,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new e),this.sharedInstance},enumerable:!1,configurable:!0}),e.prototype.update=function(e,t){var r;if(this.clipperFloors=[],e instanceof Array){this.clipperPlanes=new Float32Array(24*e.length);for(var i=function(i){var a=[new n.Plane(new n.Vector3(.5,0,0),-1),new n.Plane(new n.Vector3(-.5,0,0),-1),new n.Plane(new n.Vector3(0,.5,0),-1),new n.Plane(new n.Vector3(0,-.5,0),-1),new n.Plane(new n.Vector3(0,0,.5),-1),new n.Plane(new n.Vector3(0,0,-.5),-1)];a.forEach((function(t){t.applyMatrix4(e[i].clippingBoxMatrix)}));for(var s=o.projectPlanes(a,t),l=0;l<24;l++)o.clipperPlanes[24*i+l]=s[l];var u=null!==(r=e[i].floorIndex)&&void 0!==r?r:-1;o.clipperFloors[i]=u},o=this,a=0;a<e.length;a++)i(a)}},e.prototype.projectPlanes=function(e,t){var r=null!==e?e.length:0,i=4*r,o=t.matrixWorldInverse,a=new n.Matrix3;a.getNormalMatrix(o);for(var s=new Float32Array(i),l=new n.Plane,u=0,c=0;u!==r;++u,c+=4)l.copy(e[u]).applyMatrix4(o,a),l.normal.toArray(s,c),s[c+3]=l.constant;return s},e}(),Ze=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.needsRender=!0,t}return ne(t,e),t}(n.Group),$e=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.needsRender=!0,t}return ne(t,e),t}(n.Mesh),et=function(){function e(){this.cache={}}return e.prototype.clear=function(){for(var e=0,t=Object.keys(this.cache);e<t.length;e++){var r=t[e],n=this.cache[r];0===n.count?n.dispose():n.count=0}},e.prototype.get=function(e,t){return this.cache[e]||(this.cache[e]=ie({count:0},t())),this.cache[e].count++,this.cache[e].value},e}();exports.PBMPointSizeType=void 0,(We=exports.PBMPointSizeType||(exports.PBMPointSizeType={})).FIXED="fixed",We.ADAPTIVE="adaptive",exports.PBMPointShapeType=void 0,(Ye=exports.PBMPointShapeType||(exports.PBMPointShapeType={})).SQUARE="square",Ye.CIRCLE="circle",exports.PBMPointColorType=void 0,(Xe=exports.PBMPointColorType||(exports.PBMPointColorType={})).RGB="rgb",Xe.ALTITUDE="altitude";var tt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.needsRender=!0,t}return ne(t,e),t}(n.Points),rt=(new n.TextureLoader).load("http://vrlab-public.ljcdn.com/release/static/image/release/showcenter/simulation/colorMap2.png");rt.minFilter=n.NearestFilter,rt.magFilter=n.NearestFilter,rt.wrapS=n.RepeatWrapping,rt.wrapT=n.RepeatWrapping;var nt=new Set,it=function(e){function t(){var t=e.call(this)||this;return t.needsRender=!0,t.pbmMaterialParametersVersion=0,t.cache=new et,t.materialParameters={pano0:null,pano1:null,floorIndex:-1,modelAlpha:1,opacity:1,progress:0,useBlackTransition:!1,clippers:null,constantColor:null,useEDL:!1,pointSizeAdaptiveScale:25,pointSize:1,pointColorType:exports.PBMPointColorType.RGB,pointSizeType:exports.PBMPointSizeType.ADAPTIVE,pointShape:exports.PBMPointShapeType.SQUARE,pointMinSize:1,pointMaxSize:20,gradientTexture:rt},t}return ne(t,e),t.prototype.getMaterial=function(){return ie({},this.materialParameters)},t.prototype.setMaterial=function(e){Object.assign(this.materialParameters,e),this.pbmMaterialParametersVersion++,this.needsRender=!0},t.prototype.update=function(e,t){var r=this;this.cache.clear(),nt.clear(),this.traverse((function(n){if(n instanceof $e&&n.material.forEach((function(n){nt.has(n)||(nt.add(n),n.pbmMaterialParametersVersion!==r.pbmMaterialParametersVersion&&(n.pbmMaterialParametersVersion=r.pbmMaterialParametersVersion,Object.assign(n,r.materialParameters)),n.update(e,t,r.cache))})),n instanceof tt){if(nt.has(n.material))return;nt.add(n.material),n.material.pbmMaterialParametersVersion!==r.pbmMaterialParametersVersion&&(n.material.pbmMaterialParametersVersion=r.pbmMaterialParametersVersion,Object.assign(n.material,r.materialParameters)),n.material.update(e,t,r.cache)}}))},t.prototype.disposeMaterial=function(){nt.clear();var e=[];this.traverse((function(t){if(t instanceof $e&&t.material.forEach((function(t){if(!nt.has(t)){nt.add(t);var r=t.uniforms;Object.keys(r).map((function(t){if(/^pano\d\_/.test(t))r[t].value=null;else{var n=r[t].value;n&&"function"==typeof n.dispose&&-1===e.indexOf(n)&&(r[t].value=null,e.push(n))}})),t.dispose()}})),t instanceof tt){if(nt.has(t.material))return;nt.add(t.material),t.material.dispose()}})),e.forEach((function(e){return e.dispose()}))},t.prototype.disposeGeometry=function(){this.traverse((function(e){e instanceof $e&&e.geometry.dispose()}))},t}(n.Group),ot=["right","left","up","down","front","back"];function at(e,t,r,i){var o=new n.Box3;switch(e){case"up":o.min.y=.5,o.max.y=.5,o.min.x=+t-.5,o.max.x=+t-.5+i,o.min.z=.5-r-i,o.max.z=.5-r;break;case"down":o.min.y=-.5,o.max.y=-.5,o.min.x=+t-.5,o.max.x=+t-.5+i,o.min.z=+r-.5,o.max.z=+r-.5+i;break;case"left":o.min.x=-.5,o.max.x=-.5,o.min.z=.5-t-i,o.max.z=.5-t,o.min.y=.5-r-i,o.max.y=.5-r;break;case"right":o.min.x=.5,o.max.x=.5,o.min.z=+t-.5,o.max.z=+t-.5+i,o.min.y=.5-r-i,o.max.y=.5-r;break;case"front":o.min.z=-.5,o.max.z=-.5,o.min.x=+t-.5,o.max.x=+t-.5+i,o.min.y=.5-r-i,o.max.y=.5-r;break;case"back":o.min.z=.5,o.max.z=.5,o.min.x=.5-t-i,o.max.x=.5-t,o.min.y=.5-r-i,o.max.y=.5-r}return o.applyMatrix4((new n.Matrix4).makeRotationY(Math.PI))}var st=function(e,t){if(!(e.level>=t))for(var r=e.level+1,i=e.size/2,o=0,a=[new n.Vector2(e.position.x,e.position.y),new n.Vector2(e.position.x+i,e.position.y),new n.Vector2(e.position.x,e.position.y+i),new n.Vector2(e.position.x+i,e.position.y+i)];o<a.length;o++){var s=a[o],l={face:e.face,level:r,size:i,position:s,box:at(e.face,s.x,s.y,i),children:[]};e.children.push(l),st(l,t)}};function lt(e){var t=ot.map((function(t){return function(e,t){var r={level:0,face:e,position:new n.Vector2(0,0),size:1,box:at(e,0,0,1),children:[]};return st(r,t),r}(t,e)}));return{children:t}}function ut(e,t){for(var r=0,n=e.children;r<n.length;r++){var i=n[r];!1!==t(i)&&ut(i,t)}}var ct=new n.BoxBufferGeometry(1,1,1,1,1);ct.deleteAttribute("uv"),ct.deleteAttribute("normal"),ct.groups=[],ct.scale(-1,1,1);var ht=new n.ShaderMaterial({uniforms:{map:{value:null}},vertexShader:"\nvarying vec3 worldPosition;\nvoid main() {\n vec4 transform = vec4(position, 1.0);\n worldPosition = (modelMatrix * transform).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * transform;\n}\n",fragmentShader:"\nuniform samplerCube map;\nvarying vec3 worldPosition;\nvoid main() {\n gl_FragColor = textureCube(map, worldPosition);\n}\n",depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:n.NoBlending,lights:!1,toneMapped:!1,fog:!1}),dt=new n.Scene;dt.matrixAutoUpdate=!1;var pt,ft=new n.Mesh(ct,ht);function vt(e,t,r){ht.uniforms.map.value=e;var i=r.autoClear;r.autoClear=!1;var o=new n.CubeCamera(.1,2,t);o.matrixAutoUpdate=!1,o.update(r,dt),r.autoClear=i,ht.uniforms.map.value=null}ft.matrixAutoUpdate=!1,dt.add(ft);var At=null!==(pt=Math.SQRT1_2)&&void 0!==pt?pt:Math.sqrt(2),mt={up:new n.Quaternion(At,0,0,At),down:new n.Quaternion(-At,0,0,At),left:new n.Quaternion(0,At,0,At),right:new n.Quaternion(0,-At,0,At),front:new n.Quaternion(0,0,0,1),back:new n.Quaternion(0,1,0,0)},gt=function(){var e=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),t=new Float32Array([0,0,1,0,0,1,1,1]),r=new Uint8Array([0,1,2,1,3,2]),i=new n.BufferGeometry;return i.setAttribute("position",new n.BufferAttribute(e,3)),i.setAttribute("uv",new n.BufferAttribute(t,2)),i.setIndex(new n.BufferAttribute(r,1)),i}(),yt="\nvarying vec2 vUv;\nuniform float flipY;\nvoid main() {\n vUv = vec2(uv.x, mix(uv.y, (1.0 - uv.y), flipY));\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",bt="\nuniform sampler2D map;\nvarying vec2 vUv;\nvoid main() {\n gl_FragColor = texture2D(map, vUv);\n}\n",xt=[];function wt(e){e.uniforms.map.value=null,xt.push(e)}var Mt=[],Et=0;Ne.shared.add((function(){if(Et=6,Mt.length)for(var e=0,t=Mt.splice(0,Et);e<t.length;e++){var r=t[e];Et--,r()}}));var Ct="undefined"!=typeof createImageBitmap;function It(){var e=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){e.onerror=e.onload=e.close=fe,e.removeAttribute("src"),/^blob\:/.test(e.src)&&URL.revokeObjectURL(e.src)}});return e}function St(e){return new Promise((function(t){Mt.push((function(){t(function(e){return Ct?createImageBitmap(e):new Promise((function(t,r){var n=It();n.onload=function(){n.onload=n.onerror=fe,setTimeout((function(){t(n)}),0)},n.onerror=function(){var e=n.src;n.onload=n.onerror=fe,n.close(),r(new Error("image load error: ".concat(e)))},n.src=URL.createObjectURL(e)}))}(e))}))}))}var Pt=[];function Tt(e,t){if(t&&(e.width>t.width||e.height>t.height)){var r=function(e,t){var r=Pt.shift();if(r)return r.width=e,r.height=t,r;var n=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),{close:function(){n.close=fe,Pt.push(n)}});return n}(Math.min(e.width,t.width),Math.min(e.height,t.height)),i=r.getContext("2d");i.clearRect(0,0,r.width,r.height),i.drawImage(e,0,0,r.width,r.height),e.close();var o=new n.Texture(r);o.needsUpdate=!0,o.flipY=!0;var a=o.dispose;return o.dispose=function(){r.close(),a.call(o),o.dispose=a},o}var s=new n.Texture(e);s.needsUpdate=!0,e instanceof ImageBitmap?s.flipY=!1:s.flipY=!0;var l=s.dispose;return s.dispose=function(){e.close(),l.call(s),s.dispose=l},s}var Bt=["right","left","up","down","front","back"],Rt=function(){function e(e,t,r,n,i){this.tileTree=t,this.tileSources=r,this.options=n,this.renderer=i,this.name="",this.needsRender=!1,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.textures=[],this.baseCubeTexture=e}return Object.defineProperty(e.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(e){var t,r,i,o,a;if(null===e)throw new Error("cannot set cubeRenderTarget to null.");e.width!==this.options.textureSize&&e.setSize(this.options.textureSize,this.options.textureSize),e.texture.format=null!==(t=this.options.format)&&void 0!==t?t:n.RGBAFormat,e.texture.minFilter=null!==(r=this.options.minFilter)&&void 0!==r?r:n.LinearFilter,e.texture.magFilter=null!==(i=this.options.magFilter)&&void 0!==i?i:n.LinearFilter,e.texture.wrapS=null!==(o=this.options.wrapS)&&void 0!==o?o:n.ClampToEdgeWrapping,e.texture.wrapT=null!==(a=this.options.wrapT)&&void 0!==a?a:n.ClampToEdgeWrapping,this.baseCubeTexture&&(vt(this.baseCubeTexture,e,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&vt(this._cubeRenderTarget.texture,e,this.renderer),this._cubeRenderTarget=e},enumerable:!1,configurable:!0}),e.prototype.requestTile=function(e){var t,r,i,o,a,s,l=this,u=this.tileSources.filter((function(t){return t.level===e.level}))[0];if(u){var c=u.size,h=Math.pow(2,e.level)*e.position.y,d=Math.pow(2,e.level)*e.position.x,p="".concat((null!==(i=null===(r=null===(t=this.options.imageURL)||void 0===t?void 0:t.options)||void 0===r?void 0:r.key)&&void 0!==i?i:"pano.0").replace(/^pano/,"pano_tile"),".").concat(e.face,".").concat(e.level,".").concat(h,".").concat(d),f=ie(ie({},null!==(a=null===(o=this.options.imageURL)||void 0===o?void 0:o.options)&&void 0!==a?a:{key:"unknown"}),{key:p,size:c*e.size===this.options.tileImageSize?void 0:this.options.tileImageSize,quality:void 0,cut:[c*e.position.x,c*e.position.y,c*e.size,c*e.size]});this.loadingCubeNodes.add(e),this.options.textureLoader.loadTexture(u[e.face],{imageURL:{transform:null===(s=this.options.imageURL)||void 0===s?void 0:s.transform,options:ie({},f)},format:n.RGBAFormat,viaAjax:Ct,allowHosts:this.options.allowHosts,networkSubscribe:this.options.networkSubscribe,requestProxy:this.options.requestProxy}).then((function(t){l.disposed?t.body.dispose():(l.textures.push({face:e.face,level:e.level,position:e.position,size:new n.Vector2(e.size,e.size),texture:t.body,flipY:!t.body.flipY}),l.loadedCubeNodes.add(e))})).catch(fe).then((function(){l.disposed||l.loadingCubeNodes.delete(e)}))}else this.loadedCubeNodes.add(e)},e.prototype.update=function(e,t){var r=this;if(!this.disposed){var i=[];ut(this.tileTree,(function(n){return!r.loadingCubeNodes.has(n)&&(!(n.level>t)&&(!!e.intersectsBox(n.box)&&(r.loadedCubeNodes.has(n)?void 0:(i.push(n),!1))))}));for(var o=0,a=i;o<a.length;o++){var s=a[o];this.requestTile(s)}if(this.cubeRenderTarget&&this.textures.length){var l=this.textures.splice(0,4);!function(e,t,r){var i=new n.Scene;i.matrixAutoUpdate=!1;var o=new n.Group;o.scale.set(1,1,-1),i.add(o);for(var a=[],s=0,l=e;s<l.length;s++){var u=l[s],c=xt.pop()||new n.ShaderMaterial({uniforms:{map:{value:null},flipY:{value:0}},vertexShader:yt,fragmentShader:bt,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:n.NoBlending,lights:!1,toneMapped:!1,fog:!1});a.push(c),c.uniforms.map.value=u.texture,c.uniforms.flipY.value=u.flipY?1:0;var h=new n.Group,d=new n.Mesh(gt,c);d.position.set(u.position.x+u.size.x/2-.5,1-(u.position.y+u.size.y/2)-.5,-.5),d.scale.set(u.size.x,u.size.y,1),h.quaternion.copy(mt[u.face]),h.add(d),o.add(h)}var p=r.autoClear;r.autoClear=!1;var f=new n.CubeCamera(.1,2,t);f.matrixAutoUpdate=!1,f.update(r,i),r.autoClear=p;for(var v=0,A=a;v<A.length;v++)wt(c=A[v])}(l,this.cubeRenderTarget,this.renderer),this.needsRender=!0;for(var u=0,c=l;u<c.length;u++){c[u].texture.dispose()}}}},Object.defineProperty(e.prototype,"tilePending",{get:function(){return this.loadingCubeNodes.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){if(!this._cubeRenderTarget)throw new Error("cubeRenderTarget never set.");return this._cubeRenderTarget.texture},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){if(!this.disposed){this.disposed=!0,this.baseCubeTexture&&(this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this.loadingCubeNodes.clear(),this.loadedCubeNodes.clear();for(var e=0,t=this.textures;e<t.length;e++){t[e].texture.dispose()}this.textures.length=0}},e}(),Ot=function(){function e(){}return e.prototype.loadTexture=function(e,t,r,n,i,o){var a,s,l,u;void 0===t&&(t={}),void 0===r&&(r=fe),void 0===n&&(n=fe),void 0===i&&(i=fe);var c={};void 0!==t.flipY&&(c.flipY=t.flipY),void 0!==t.format&&(c.format=t.format),void 0!==t.minFilter&&(c.minFilter=t.minFilter),void 0!==t.magFilter&&(c.magFilter=t.magFilter);var h=null!==(s=null===(a=t.imageURL)||void 0===a?void 0:a.options)&&void 0!==s?s:{key:"unknown"},d=Te(e=je(e,null===(l=t.imageURL)||void 0===l?void 0:l.transform,h)),p={timeout:t.timeout,allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe},f=null!==(u=t.viaAjax)&&void 0!==u&&u,v=Pe(e),A=/^https?:/.test(d);if(v?f=!0:A||(f=!1),f){return Oe(e,ie(ie({},p),{responseType:"blob"}),void 0,void 0,i).then((function(e){return St(e.body)})).then((function(e){return Tt(e,t.maxSize)})).then((function(e){return Object.assign(e,c),e})).then((function(e){var t={meta:null,body:e};return r(t),t})).catch((function(e){return n(e),Promise.reject(e)}))}var m,g=null;return Promise.resolve().then((function(){return It()})).then((function(t){return m=t,Fe(e,p,void 0,void 0,i,t)})).then((function(e){return g=e.meta,Tt(e.body,t.maxSize)})).then((function(e){return Object.assign(e,c),e})).then((function(e){var t={meta:g,body:e};return r(t),t})).catch((function(e){return m&&m.close(),n(e),Promise.reject(e)}))},e.prototype.loadCubeTexture=function(e,t,r,i,o,a){var s,l,u,c;void 0===t&&(t={}),void 0===r&&(r=fe),void 0===i&&(i=fe),void 0===o&&(o=fe),void 0!==t.format&&t.format,void 0!==t.minFilter&&t.minFilter,void 0!==t.magFilter&&t.magFilter;for(var h=[e[Bt[0]],e[Bt[1]],e[Bt[2]],e[Bt[3]],e[Bt[4]],e[Bt[5]]],d={timeout:t.timeout,allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe},p=[],f=[0,0,0,0,0,0],v=[],A=function(e){var r=null!==(l=null===(s=t.imageURL)||void 0===s?void 0:s.options)&&void 0!==l?l:{key:"unknown"},n=je(h[e],null===(u=t.imageURL)||void 0===u?void 0:u.transform,ie(ie({},r),{key:r.key+"."+Bt[e]})),i=Te(n),a=function(t){f[e]=t,o(f.reduce((function(e,t){return e+t}),0)/6)},A=null!==(c=t.viaAjax)&&void 0!==c&&c,m=/^https?:$/.test(i);if(Pe(n)?A=!0:m||(A=!1),A){var g=Oe(n,ie(ie({},d),{responseType:"blob"}),void 0,void 0,a).then((function(t){return v[e]=t.meta,St(t.body)}));p.push(g)}else{var y;g=Promise.resolve().then((function(){return It()})).then((function(e){return y=e,Fe(n,d,void 0,void 0,a,e)})).then((function(t){return v[e]=t.meta,t.body})).catch((function(e){return y&&y.close(),Promise.reject(e)}));p.push(g)}},m=0;m<6;m++)A(m);return Promise.all(p).then((function(e){return function(e){var t=new n.CubeTexture(e);t.needsUpdate=!0,t.flipY=!1;var r=t.dispose;return t.dispose=function(){for(var n=0,i=e;n<i.length;n++)i[n].close();r.call(t),t.dispose=r},t}(e)})).then((function(e){return Object.assign(e,ie({encoding:n.sRGBEncoding},t)),e})).then((function(e){var t={body:e,meta:v};return r(t),t})).catch((function(e){for(var t=0,r=p;t<r.length;t++){r[t].then((function(e){return e.close()})).catch(fe)}return i(e),Promise.reject(e)}))},e.prototype.loadTiledCubeTexture=function(e,t,r,i,o,a,s){var l=this;return void 0===r&&(r={}),void 0===i&&(i=fe),void 0===o&&(o=fe),void 0===a&&(a=fe),new Promise((function(u,c){var h,d;l.loadCubeTexture(e,{imageURL:{transform:null===(h=r.imageURL)||void 0===h?void 0:h.transform,options:null===(d=r.imageURL)||void 0===d?void 0:d.options},format:n.RGBAFormat,viaAjax:r.viaAjax},(function(e){var n,o,a=e.meta,c=e.body,h=null!==(n=r.tileImageSize)&&void 0!==n?n:512,d=null!==(o=r.tileMaxLevel)&&void 0!==o?o:2,p=Math.max(1024*d,512),f=lt(d),v={meta:a,body:new Rt(c,f,t,{textureSize:p,tileImageSize:h,textureLoader:l,imageURL:r.imageURL,networkSubscribe:r.networkSubscribe,allowHosts:r.allowHosts,timeout:r.timeout},s)};i(v),u(v)}),(function(e){o(e),c(e)}),a,s).catch(fe)}))},e}(),Lt=function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("nvor-sy|n-sy||Hn\bv{t-sy|n-Sy||Hn\bv{t-rp@-[|znyHn\bv{t-rp@-cvr]|vv|{Hn\bv{t-rpA-|yq]|vv|{Hn\bv{t-sy|n-Y|tQr}uH0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrrK0v{pyqr-I?l}nlrrK0v{pyqr-Ip|y|l}nlrrK0v{pyqr-Iunq|zn}l}nlrrK|vq-znv{56-\n--0v{pyqr-IlrrK--0v{pyqr-I?lrrK--0v{pyqr-Ip|y|lrrK--0v{pyqr-Iortv{{|znylrrK--0v{pyqr-Iqrsny{|znylrrK--rpA-n{s|zrq-J-rpA5}|vv|{9->;=6H--rpA-z]|vv|{-J-z|qrycvrZnv-7-n{s|zrqH--[|zny-J-{|znyv\tr5n{s|zrq[|zny6H--Sy||-J-sy||H--cvr]|vv|{-J-:z]|vv|{;\b\tH--|yq]|vv|{-J-z|qryZnv-7-n{s|zrqH--tyl]|vv|{-J-}|wrpv|{Znv-7-z|qrycvrZnv-7-n{s|zrqH--0v{pyqr-Iunq|zn}lrrK--Y|tQr}u-J-y|t?5:z]|vv|{;\t6H\f"),Dt=function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=60qrsv{r-aNb-C;?E@>EB?{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznvH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yr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iyvtul}nlortv{K0v{pyqr-Iyvtul}u|{tl}nlsntzr{K0v{pyqr-Iunq|zn}l}nlsntzr{Krp?-|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-<-aNb9-urn-<-]V6H\f|vq-znv{56-\n--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9->;=6H----r{H--0r{qvs--vs-5q|5cvr]|vv|{9-[|zny6-I-=;=6-\n----qvpnqH--\f--<<前置裁切计算--0vs-qrsv{rq5[bZlPYV]]V[TlO\\e6----rpA-}yn{rH----s|5-v{-v-J-=H-v-I-[bZlPYV]]V[TlO\\eH-v886\n------o||y-pyv}}rq-J-rH------v{-pr{Sy||-J-v{5pyv}}rSy||hvj6H------<<内部展开s|循环,让v{q|能用------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C6-8-=;B6-<-sy|n5[bZlPYV]]V[TlO\\e-<-C69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8->6-8-=;B6-<-sy|n5[bZlPYV]]V[TlO\\e-<-C69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8-?6-8-=;B6-<-sy|n5[bZlPYV]]V[TlO\\e-<-C69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8-@6-8-=;B6-<-sy|n5[bZlPYV]]V[TlO\\e-<-C69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8-A6-8-=;B6-<-sy|n5[bZlPYV]]V[TlO\\e-<-C69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8-B6-8-=;B6-<-sy|n5[bZlPYV]]V[TlO\\e-<-C69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------o||y-v{antrSy||-J-no5Sy||-:-sy|n5pr{Sy||66-I->;=H------pyv}}rq-J-5pr{Sy||-JJ-:>-\v\v-v{antrSy||6-33-pyv}}rqH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f--0r{qvs--<<楼层切割计算--sy|n-sy||\\}npv\b-J->;=H--vs-5sy||V{qr-KJ-=;=-33-no5Sy||-:-sy|n5sy||V{qr66-KJ->;=6-\n----sy||\\}npv\b-J-=;>H--\f--rpA-qvssrP|y|-J-rpA5qvssr;to9-|}npv\b6H--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5rp@5=;=69-rp@5=;=69-rp@5=;=69-rp@5=;=66H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--0v{pyqr-I{|znylsntzr{lortv{K--0v{pyqr-I{|znylsntzr{lzn}K--0v{pyqr-Irzvvrzn}lsntzr{K--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--<<-调整曝光值--vnqvn{pr-J-vnqvn{pr-7-r}|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--rp@-}n{|=a|crr-J-5|yq]|vv|{;\b\t-:-}n{|=lznvh@j;\b\t6-7-zn@5}n{|=lznv6H--rp@-}n{|>a|crr-J-5|yq]|vv|{;\b\t-:-}n{|>lznvh@j;\b\t6-7-zn@5}n{|>lznv6H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-rrPor5}n{|=lzn}9-}n{|=a|crr6H--rpA-}n{|>P|y|-J-rrPor5}n{|>lzn}9-}n{|>a|crr6H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-rrPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr6;H----}n{|>P|y|;n-J->;=-:-rrPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr6;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-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----}n{|P|y|-J-zv5}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--0vs-qrsv{rq5b`Rl]N[\\lcVQR\\6----rp@-pnzrna|crr-J-|yq]|vv|{;\b\t-:-pnzrn]|vv|{H----rpA-zn}P||q-J-rpA5pnzrna|crr9->;=6-7-}n{|cvqr|lznvH----rp?--J-rp?5------=;B-8-zn}P||q;-<-zn}P||q;\t-<-}n{|cvqr|lv\tr;9------=;B-:-zn}P||q;\b-<-zn}P||q;\t-<-}n{|cvqr|lv\tr;\b----6H----rpA-vqr|P|y|-J-rr?Q5}n{|cvqr|lzn}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|lny}un6H--0r{qvs--0vs-qrsv{rq5b`Rl]N[\\l\\]NPVaf6----tylSntP|y|-J-zv5}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H----tylSntP|y|;n-J-|}npv\bH--0ryr----tylSntP|y|-J-rpA5tylSntP|y|;to9-|}npv\b-7-sy||\\}npv\b6H----tylSntP|y|-J-zv5}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs\f"),Ft=new n.WebGLCubeRenderTarget(1).texture;Ft.name="EMPTY_TEXTURE";var kt=Object.assign({modelAlpha:new n.Uniform(0),progress:new n.Uniform(0),pano0_map:new n.Uniform(Ft),pano0_luminanceMap:new n.Uniform(null),pano0_matrix:new n.Uniform(new n.Matrix4),pano1_map:new n.Uniform(Ft),pano1_luminanceMap:new n.Uniform(null),pano1_matrix:new n.Uniform(new n.Matrix4),floorIndex:new n.Uniform(-1),clipperPlanesTexture:new n.Uniform(null),clipperFloors:new n.Uniform([]),constantColor:new n.Uniform(null)},{exposure:new n.Uniform(1),emissive:new n.Uniform(new n.Color(0)),emissiveMap:new n.Uniform(null),specular:new n.Uniform(new n.Color(1118481)),specularMap:new n.Uniform(null),normalMap:new n.Uniform(null),bumpMap:new n.Uniform(null),shininess:new n.Uniform(30)},n.UniformsUtils.clone(n.UniformsLib.common),n.UniformsUtils.clone(n.UniformsLib.lights)),Qt=function(e){function t(t){void 0===t&&(t={});var r,i,o,a,s,l,u,c,h,d,p,f,v,A,m,g,y,b=this;(b=e.call(this,{vertexShader:Lt,fragmentShader:Dt,uniforms:n.UniformsUtils.clone(kt),defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_PANO_VIDEO:!1,USE_POINT_NORMAL:!1,USE_POINT_CIRCLE:!1,USE_POINT_ADAPTIVE_SIZE:!1,USE_POINT_COLOR_ALTITUDE:!1},lights:!0})||this).pbmMaterialParametersVersion=0;var x=null,w=null;return Object.defineProperties(b,{pano0:{get:function(){return x},set:function(e){if(x!==e){x=e,null===e?(this.uniforms.pano0_map.value=Ft,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity()):(this.uniforms.pano0_map.value=e.map instanceof Rt?e.map.texture:e.map,this.uniforms.pano0_luminanceMap.value=e.luminanceMap instanceof Rt?e.luminanceMap.texture:e.luminanceMap,this.uniforms.pano0_matrix.value.copy(e.matrix));var t=null!==this.uniforms.pano0_luminanceMap.value&&null!==this.uniforms.pano1_luminanceMap.value;this.defines.USE_LUMINANCE!==t&&(this.defines.USE_LUMINANCE=t,this.needsUpdate=!0)}}},pano1:{get:function(){return w},set:function(e){if(w!==e){w=e,null===e?(this.uniforms.pano1_map.value=Ft,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity()):(this.uniforms.pano1_map.value=e.map instanceof Rt?e.map.texture:e.map,this.uniforms.pano1_luminanceMap.value=e.luminanceMap instanceof Rt?e.luminanceMap.texture:e.luminanceMap,this.uniforms.pano1_matrix.value.copy(e.matrix));var t=null!==this.uniforms.pano0_luminanceMap.value&&null!==this.uniforms.pano1_luminanceMap.value;this.defines.USE_LUMINANCE!==t&&(this.defines.USE_LUMINANCE=t,this.needsUpdate=!0)}}},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)}},constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(e){this.uniforms.constantColor.value=e;var t=null!==e;this.defines.USE_CONSTANT_COLOR!==t&&(this.defines.USE_CONSTANT_COLOR=t,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},floorIndex:{get:function(){return this.uniforms.floorIndex.value},set:function(e){this.uniforms.floorIndex.value=e}},clippers:{get:function(){return y},set:function(e){y=e,this.needsUpdateClippers=!0}},clipperFloors:{get:function(){return this.uniforms.clipperFloors.value},set:function(e){this.uniforms.clipperFloors.value=e}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(e){e!==this.defines.USE_EDL&&(this.defines.USE_EDL=e,this.needsUpdate=!0)}}}),b.pano0=null!==(r=t.pano0)&&void 0!==r?r:null,b.pano1=null!==(i=t.pano1)&&void 0!==i?i:null,b.modelAlpha=null!==(o=t.modelAlpha)&&void 0!==o?o:1,b.progress=null!==(a=t.progress)&&void 0!==a?a:0,b.useBlackTransition=null!==(s=t.useBlackTransition)&&void 0!==s&&s,b.constantColor=null!==(l=t.constantColor)&&void 0!==l?l:null,b.opacity=null!==(u=t.opacity)&&void 0!==u?u:1,b.floorIndex=null!==(c=t.floorIndex)&&void 0!==c?c:-1,b.clippers=null,b.useEDL=!1,b.pointSizeAdaptiveScale=null!==(h=t.pointSizeAdaptiveScale)&&void 0!==h?h:25,b.pointSize=null!==(d=t.pointSize)&&void 0!==d?d:1,b.pointColorType=null!==(p=t.pointColorType)&&void 0!==p?p:exports.PBMPointColorType.ALTITUDE,b.pointSizeType=null!==(f=t.pointSizeType)&&void 0!==f?f:exports.PBMPointSizeType.ADAPTIVE,b.pointShape=null!==(v=t.pointShape)&&void 0!==v?v:exports.PBMPointShapeType.CIRCLE,b.pointMinSize=null!==(A=t.pointMinSize)&&void 0!==A?A:2,b.pointMaxSize=null!==(m=t.pointMaxSize)&&void 0!==m?m:5,b.gradientTexture=null!==(g=t.gradientTexture)&&void 0!==g?g:null,b}return ne(t,e),t.prototype.update=function(e,t,r){this.transparent=this.floorIndex>-1||this.opacity<1,this.blending=this.transparent?n.NormalBlending:n.NoBlending;var i=this.clippers,o="clippers:".concat(JSON.stringify(i?{clippers:i,cameraMatrix:t.matrixWorld}:null)),a=r.get(o,(function(){var e=null,r=null;i&&i.length&&(Je.shared.update(i,t),e=Je.shared.clipperPlanes,r=Je.shared.clipperFloors);var o=i?i.length:0,a=e?new n.DataTexture(e,length,1,n.RGBAFormat,n.FloatType):null;return{value:{boxCount:o,clipperPlanesTexture:a,clipperFloors:r},dispose:function(){a&&a.dispose()}}})),s=a.boxCount,l=a.clipperPlanesTexture,u=a.clipperFloors,c=s>0&&s;l&&!1!==c?(this.uniforms.clipperPlanesTexture.value=l,this.uniforms.clipperFloors.value=u):(this.uniforms.clipperPlanesTexture.value=null,this.uniforms.clipperFloors.value=null),this.defines.NUM_CLIPPING_BOX!==c&&(this.defines.NUM_CLIPPING_BOX=c,this.needsUpdate=!0)},t}(n.ShaderMaterial);var Nt=function(e){function t(t){var r=t.preserveDrawingBuffer,i=void 0===r||r,o=t.backgroundColor,a=void 0===o?1579548:o,s=t.backgroundAlpha,l=void 0===s?1:s,u=t.pixelRatio,c=void 0===u?1:u,h=t.antialias,d=void 0!==h&&h,p=t.webgl2,f=this;if(void 0!==p&&p){var v=document.createElement("canvas"),A=v.getContext("webgl2");if(null===A)throw new Error("error occurred when getting webgl2 canvas context");f=e.call(this,{antialias:d,preserveDrawingBuffer:i,alpha:l<1,canvas:v,context:A})||this}else f=e.call(this,{antialias:d,preserveDrawingBuffer:i,alpha:l<1})||this;return f.setPixelRatio(c),f.setClearColor(a,l),f.outputEncoding=n.sRGBEncoding,f.autoClear=!0,f}return ne(t,e),t}(n.WebGLRenderer),Vt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ne(t,e),t.prototype.add=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.prototype.add.apply(this,t)},t.prototype.remove=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.prototype.remove.apply(this,t)},t}(n.Scene);function Ut(e,t){var r=Math.abs(Math.cos(e.latitude)),i=-Math.sin(e.longitude)*r,o=-Math.sin(e.latitude),a=-Math.cos(e.longitude)*r;return t?t.set(i,o,a):new n.Vector3(i,o,a)}var zt=2*Math.PI,qt=Math.PI/2;function Ht(e){return e>0&&e<=zt?e:(e%zt+zt)%zt}var _t=function(e){function t(t,r,i,o,a,s){void 0===r&&(r=1),void 0===i&&(i=.01),void 0===o&&(o=1e3),void 0===a&&(a=new n.Vector2),void 0===s&&(s=1);var l=e.call(this)||this;l.fov=t,l.aspect=r,l.near=i,l.far=o,l.perspToOrtho=a,l.orthoDistance=s,l.needsRender=!0,l.pose={longitude:0,latitude:0,fov:t,distance:0,offset:new n.Vector3},l.computePose(),l.perspectiveCamera=new n.PerspectiveCamera(l.fov,l.aspect,.001,l.far);var u=Math.max(l.orthoDistance,.01)*Math.tan(.5*l.fov/180*Math.PI),c=-.5*l.aspect*2*u;return l.orthographicCamera=new n.OrthographicCamera(c,-c,u,-u,.001,l.far),l.computeProjectionMatrix(),l.lastValues={position:l.position.clone(),quaternion:l.quaternion.clone(),scale:l.scale.clone(),fov:l.fov,aspect:l.aspect,near:l.near,far:l.far,perspToOrtho:l.perspToOrtho.clone(),orthoDistance:l.orthoDistance},l.type=l.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",l}return ne(t,e),Object.defineProperty(t.prototype,"zoom",{get:function(){return"OrthographicCamera"===this.type?this.orthographicCamera.zoom:"PerspectiveCamera"===this.type?this.perspectiveCamera.zoom:1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return"OrthographicCamera"===this.type?this.orthographicCamera.top:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return"OrthographicCamera"===this.type?this.orthographicCamera.bottom:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return"OrthographicCamera"===this.type?this.orthographicCamera.left:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return"OrthographicCamera"===this.type?this.orthographicCamera.right:0},enumerable:!1,configurable:!0}),t.prototype.getDirection=function(e){return Ut(this.pose,e)},t.prototype.computePose=function(e){void 0===e&&(e=0);var t=this.getDirection(new n.Vector3);this.pose.longitude=Ht(-Math.atan2(t.x,-t.z)),this.pose.latitude=-Math.asin(t.y/1),this.pose.fov=this.fov,this.pose.distance=e;var r=(new n.Vector3).add(this.position).add(t.clone().setLength(this.pose.distance));return this.pose.offset.copy(r),this},t.prototype.setFromPose=function(e){var t,r,n,i,o,a=Ht(null!==(t=e.longitude)&&void 0!==t?t:this.pose.longitude),s=Math.max(1e-4-qt,Math.min(qt-1e-4,null!==(r=e.latitude)&&void 0!==r?r:this.pose.latitude)),l=null!==(n=e.fov)&&void 0!==n?n:this.pose.fov,u=null!==(i=e.distance)&&void 0!==i?i:this.pose.distance,c=null!==(o=e.offset)&&void 0!==o?o:this.pose.offset,h=Ut({longitude:a,latitude:s}).normalize();return this.position.set(0,0,0),this.lookAt(h),this.position.add(c).sub(h.clone().setLength(u)),this.fov!==l&&(this.fov=l,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=a,this.pose.latitude=s,this.pose.fov=l,this.pose.distance=u,this.pose.offset.copy(c),this.needsRender=!0,this},t.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,distance:this.pose.distance,offset:this.pose.offset.clone()}},t.prototype.computeProjectionMatrix=function(){!function(e,t,r,n){r=Math.pow(r,2);for(var i=0;i<16;i++)n.elements[i]=e.elements[i]+(t.elements[i]-e.elements[i])*r}(this.orthographicCamera.projectionMatrix,this.perspectiveCamera.projectionMatrix,1-this.perspToOrtho.x,this.projectionMatrix),this.projectionMatrixInverse.getInverse(this.projectionMatrix),this.needsRender=!0},t.prototype.setViewOffset=function(e,t,r,n,i,o){this.perspectiveCamera.setViewOffset(e,t,r,n,i,o),this.orthographicCamera.setViewOffset(e,t,r,n,i,o),this.computeProjectionMatrix()},t.prototype.clearViewOffset=function(){this.perspectiveCamera.clearViewOffset(),this.orthographicCamera.clearViewOffset(),this.computeProjectionMatrix()},t.prototype.updateProjectionMatrix=function(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix(),this.computeProjectionMatrix()},Object.defineProperty(t.prototype,"perspectiveProjectionMatrix",{get:function(){return this.perspectiveCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveProjectionMatrixInverse",{get:function(){return this.perspectiveCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrix",{get:function(){return this.orthographicCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrixInverse",{get:function(){return this.orthographicCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),t.prototype.updateTime=function(e,t){var r=!1;if(this.lastValues.fov===this.fov&&this.lastValues.near===this.near&&this.lastValues.far===this.far&&this.lastValues.aspect===this.aspect||(this.perspectiveCamera.fov=this.fov,this.perspectiveCamera.near=this.near,this.perspectiveCamera.far=this.far,this.perspectiveCamera.aspect=this.aspect,this.perspectiveCamera.updateProjectionMatrix(),r=!0),!this.lastValues.position.equals(this.position)||!this.lastValues.quaternion.equals(this.quaternion)||!this.lastValues.scale.equals(this.scale)||this.lastValues.orthoDistance!==this.orthoDistance||this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.aspect!==this.aspect){var n=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),i=-.5*this.aspect*2*n;this.orthographicCamera.left=i,this.orthographicCamera.right=-i,this.orthographicCamera.top=n,this.orthographicCamera.bottom=-n,this.orthographicCamera.updateProjectionMatrix(),r=!0}this.lastValues.perspToOrtho.equals(this.perspToOrtho)||(r=!0),r&&this.computeProjectionMatrix(),this.lastValues.position.copy(this.position),this.lastValues.quaternion.copy(this.quaternion),this.lastValues.scale.copy(this.scale),this.lastValues.fov=this.fov,this.lastValues.aspect=this.aspect,this.lastValues.near=this.near,this.lastValues.far=this.far,this.lastValues.perspToOrtho.copy(this.perspToOrtho),this.lastValues.orthoDistance=this.orthoDistance,this.type=this.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera"},Object.defineProperty(t.prototype,"isPerspectiveCamera",{get:function(){return this.perspToOrtho.x<1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOrthographicCamera",{get:function(){return this.perspToOrtho.x>=1},enumerable:!1,configurable:!0}),t.prototype.copy=function(t,r){return e.prototype.copy.call(this,t,r),this.fov=t.fov,this.aspect=t.aspect,this.near=t.near,this.far=t.far,this.perspToOrtho.copy(t.perspToOrtho),this.orthoDistance=t.orthoDistance,this.updateTime(Ae(),0),this},t}(n.Camera),jt=function(t){e.Loader.call(this,t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}};jt.prototype=Object.assign(Object.create(e.Loader.prototype),{constructor:jt,setDecoderPath:function(e){return this.decoderPath=e,this},setDecoderConfig:function(e){return this.decoderConfig=e,this},setWorkerLimit:function(e){return this.workerLimit=e,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(t,r,n,i){var o=new e.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),"use-credentials"===this.crossOrigin&&o.setWithCredentials(!0),o.load(t,(e=>{var t={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,t).then(r).catch(i)}),n,i)},decodeDracoFile:function(e,t,r,n){var i={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,i).then(t)},decodeGeometry:function(e,t){for(var r in t.attributeTypes){var n=t.attributeTypes[r];void 0!==n.BYTES_PER_ELEMENT&&(t.attributeTypes[r]=n.name)}var i,o=JSON.stringify(t);if(jt.taskCache.has(e)){var a=jt.taskCache.get(e);if(a.key===o)return a.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var s=this.workerNextTaskID++,l=e.byteLength,u=this._getWorker(s,l).then((r=>(i=r,new Promise(((r,n)=>{i._callbacks[s]={resolve:r,reject:n},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return u.catch((()=>!0)).then((()=>{i&&s&&this._releaseTask(i,s)})),jt.taskCache.set(e,{key:o,promise:u}),u},_createGeometry:function(t){var r=new e.BufferGeometry;t.index&&r.setIndex(new e.BufferAttribute(t.index.array,1));for(var n=0;n<t.attributes.length;n++){var i=t.attributes[n],o=i.name,a=i.array,s=i.itemSize;r.setAttribute(o,new e.BufferAttribute(a,s))}return r},_loadLibrary:function(t,r){var n=new e.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(r),new Promise(((e,r)=>{n.load(t,e,void 0,r)}))},preload:function(){return this._initDecoder(),this},_initDecoder:function(){if(this.decoderPending)return this.decoderPending;var e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{var r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);var n=jt.DRACOWorker.toString(),i=["/* draco decoder */",r,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending},_getWorker:function(e,t){return this._initDecoder().then((()=>{var r;this.workerPool.length<this.workerLimit?((r=new Worker(this.workerSourceURL))._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(e){var t=e.data;switch(t.type){case"decode":r._callbacks[t.id].resolve(t);break;case"error":r._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},this.workerPool.push(r)):this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));return(r=this.workerPool[this.workerPool.length-1])._taskCosts[e]=t,r._taskLoad+=t,r}))},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))},dispose:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}),jt.DRACOWorker=function(){var e,t;function r(e,t,r,n,i,o){var a,s,l=o.num_components(),u=r.num_points()*l;switch(i){case Float32Array:a=new e.DracoFloat32Array,t.GetAttributeFloatForAllPoints(r,o,a),s=new Float32Array(u);break;case Int8Array:a=new e.DracoInt8Array,t.GetAttributeInt8ForAllPoints(r,o,a),s=new Int8Array(u);break;case Int16Array:a=new e.DracoInt16Array,t.GetAttributeInt16ForAllPoints(r,o,a),s=new Int16Array(u);break;case Int32Array:a=new e.DracoInt32Array,t.GetAttributeInt32ForAllPoints(r,o,a),s=new Int32Array(u);break;case Uint8Array:a=new e.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(r,o,a),s=new Uint8Array(u);break;case Uint16Array:a=new e.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(r,o,a),s=new Uint16Array(u);break;case Uint32Array:a=new e.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(r,o,a),s=new Uint32Array(u);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var c=0;c<u;c++)s[c]=a.GetValue(c);return e.destroy(a),{name:n,array:s,itemSize:l}}onmessage=function(n){var i=n.data;switch(i.type){case"init":e=i.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":var o=i.buffer,a=i.taskConfig;t.then((e=>{var t=e.draco,n=new t.Decoder,s=new t.DecoderBuffer;s.Init(new Int8Array(o),o.byteLength);try{var l=function(e,t,n,i){var o,a,s=i.attributeIDs,l=i.attributeTypes,u=t.GetEncodedGeometryType(n);if(u===e.TRIANGULAR_MESH)o=new e.Mesh,a=t.DecodeBufferToMesh(n,o);else{if(u!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");o=new e.PointCloud,a=t.DecodeBufferToPointCloud(n,o)}if(!a.ok()||0===o.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+a.error_msg());var c={index:null,attributes:[]};for(var h in s){var d,p,f=self[l[h]];if(i.useUniqueIDs)p=s[h],d=t.GetAttributeByUniqueId(o,p);else{if(-1===(p=t.GetAttributeId(o,e[s[h]])))continue;d=t.GetAttribute(o,p)}c.attributes.push(r(e,t,o,h,f,d))}if(u===e.TRIANGULAR_MESH){for(var v=o.num_faces(),A=new Uint32Array(3*v),m=new e.DracoInt32Array,g=0;g<v;++g){t.GetFaceFromMesh(o,g,m);for(var y=0;y<3;++y)A[3*g+y]=m.GetValue(y)}c.index={array:A,itemSize:1},e.destroy(m)}return e.destroy(o),c}(t,n,s,a),u=l.attributes.map((e=>e.array.buffer));l.index&&u.push(l.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:l},u)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}finally{t.destroy(s),t.destroy(n)}}))}}},jt.taskCache=new WeakMap,jt.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},jt.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},jt.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},jt.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var Gt,Kt=new jt;Kt.setDecoderPath("https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/"),function(e){e[e.Outside=-1]="Outside",e[e.Intersecting=0]="Intersecting",e[e.Inside=1]="Inside"}(Gt||(Gt={}));var Wt=new n.Vector3,Yt=new n.Matrix4,Xt=new n.Matrix3,Jt=new n.Vector3,Zt=new n.Vector3,$t=new n.Vector3,er=new n.Vector3,tr=new n.Vector3,rr=new n.Box3,nr=new n.Matrix4,ir=new n.Ray,or=function(){function e(e){void 0===e&&(e=[]),this.planes=e}return Object.defineProperty(e,"MASK_OUTSIDE",{get:function(){return 4294967295},enumerable:!1,configurable:!0}),Object.defineProperty(e,"MASK_INSIDE",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(e,"MASK_INDETERMINATE",{get:function(){return 2147483647},enumerable:!1,configurable:!0}),e.prototype.setFromFrustum=function(e){return this.planes=e.planes.map((function(e){return e.clone()})),this},e.prototype.computeVisibility=function(e){for(var t=Gt.Inside,r=0,n=this.planes;r<n.length;r++){var i=n[r];switch(e.intersectPlane(i)){case Gt.Outside:return Gt.Outside;case Gt.Intersecting:t=Gt.Intersecting}}return t},e.prototype.computeVisibilityWithPlaneMask=function(t,r){if(r===e.MASK_OUTSIDE||r===e.MASK_INSIDE)return r;for(var n=e.MASK_INSIDE,i=Math.min(32,this.planes.length),o=0;o<i;++o){var a=1<<o;if(0!=(r&a)){var s=this.planes[o],l=t.intersectPlane(s);if(l===Gt.Outside)return e.MASK_OUTSIDE;l===Gt.Intersecting&&(n|=a)}}return n},e}(),ar=function(){function e(){this.type="box",this.center=new n.Vector3,this.halfSize=new n.Vector3,this.rotation=new n.Matrix3}return e.prototype.fromJson=function(e){var t=e.box;this.center.set(t[0],t[1],t[2]);var r=t[3],n=t[4],i=t[5],o=t[6],a=t[7],s=t[8],l=t[9],u=t[10],c=t[11],h=Math.sqrt(r*r+n*n+i*i),d=Math.sqrt(o*o+a*a+s*s),p=Math.sqrt(l*l+u*u+c*c);return this.halfSize.set(h,d,p),this.rotation.fromArray([r/h,n/h,i/h,o/d,a/d,s/d,l/p,u/p,c/p]),this},e.prototype.toJson=function(){return this.rotation.extractBasis(Zt,$t,er),{box:ue(ue(ue(ue([],this.center.toArray(),!0),Zt.multiplyScalar(this.halfSize.x).toArray(),!0),$t.multiplyScalar(this.halfSize.y).toArray(),!0),er.multiplyScalar(this.halfSize.z).toArray(),!0)}},e.prototype.copy=function(e){return this.center.copy(e.center),this.halfSize.copy(e.halfSize),this.rotation.copy(e.rotation),this},e.prototype.clone=function(){return(new e).copy(this)},e.prototype.applyMatrix4=function(e){var t=e.elements,r=Wt.set(t[0],t[1],t[2]).length(),n=Wt.set(t[4],t[5],t[6]).length(),i=Wt.set(t[8],t[9],t[10]).length();e.determinant()<0&&(r=-r),Xt.setFromMatrix4(e);var o=1/r,a=1/n,s=1/i;return Xt.elements[0]*=o,Xt.elements[1]*=o,Xt.elements[2]*=o,Xt.elements[3]*=a,Xt.elements[4]*=a,Xt.elements[5]*=a,Xt.elements[6]*=s,Xt.elements[7]*=s,Xt.elements[8]*=s,this.rotation.premultiply(Xt),this.halfSize.x*=r,this.halfSize.y*=n,this.halfSize.z*=i,this.center.applyMatrix4(e),this},e.prototype.getCenter=function(e){return e.copy(this.center)},e.prototype.distanceSquaredTo=function(e){Jt.copy(e).sub(this.center),this.rotation.extractBasis(Zt,$t,er);var t=0,r=0;return(r=Math.abs(Jt.dot(Zt.normalize()))-this.halfSize.x)>0&&(t+=r*r),(r=Math.abs(Jt.dot($t.normalize()))-this.halfSize.y)>0&&(t+=r*r),(r=Math.abs(Jt.dot(er.normalize()))-this.halfSize.z)>0&&(t+=r*r),t},e.prototype.distanceTo=function(e){return Math.sqrt(this.distanceSquaredTo(e))},e.prototype.getBoundingBox=function(e){return e.makeEmpty(),this.rotation.extractBasis(Zt,$t,er),Zt.setLength(this.halfSize.x),$t.setLength(this.halfSize.y),er.setLength(this.halfSize.z),e.expandByPoint(Wt.copy(this.center).add(Zt)),e.expandByPoint(Wt.copy(this.center).sub(Zt)),e.expandByPoint(Wt.copy(this.center).add($t)),e.expandByPoint(Wt.copy(this.center).sub($t)),e.expandByPoint(Wt.copy(this.center).add(er)),e.expandByPoint(Wt.copy(this.center).sub(er)),e},e.prototype.toGeometry=function(){var e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),t=new Float32Array(24);Wt.set(this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(t,0),Wt.set(-this.halfSize.x,this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(t,3),Wt.set(-this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(t,6),Wt.set(this.halfSize.x,-this.halfSize.y,this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(t,9),Wt.set(this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(t,12),Wt.set(-this.halfSize.x,this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(t,15),Wt.set(-this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(t,18),Wt.set(this.halfSize.x,-this.halfSize.y,-this.halfSize.z).applyMatrix3(this.rotation).add(this.center).toArray(t,21);var r=new n.BufferGeometry;return r.setIndex(new n.BufferAttribute(e,1)),r.setAttribute("position",new n.BufferAttribute(t,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r},e.prototype.intersectPlane=function(e){var t=this.center,r=e.normal,n=this.rotation.elements,i=this.halfSize,o=r.x,a=r.y,s=r.z,l=Math.abs(o*n[0]*i.x+a*n[1]*i.x+s*n[2]*i.x)+Math.abs(o*n[3]*i.y+a*n[4]*i.y+s*n[5]*i.y)+Math.abs(o*n[6]*i.z+a*n[7]*i.z+s*n[8]*i.z),u=r.dot(t)+e.constant;return u<=-l?Gt.Outside:u>=l?Gt.Inside:Gt.Intersecting},e.prototype.intersectRay=function(e){return tr.copy(this.halfSize).multiplyScalar(2),rr.setFromCenterAndSize(Wt.set(0,0,0),tr),this.rotation.extractBasis(Zt,$t,er),Yt.makeBasis(Zt,$t,er),Yt.setPosition(this.center),nr.getInverse(Yt),ir.copy(e).applyMatrix4(nr),ir.intersectsBox(rr)},e}(),sr=function(){function e(){this.type="sphere",this.center=new n.Vector3,this.radius=-1}return e.prototype.fromJson=function(e){var t=e.sphere;return this.center.set(t[0],t[1],t[2]),this.radius=t[3],this},e.prototype.toJson=function(){return{sphere:ue(ue([],this.center.toArray(),!0),[this.radius],!1)}},e.prototype.copy=function(e){return this.center.copy(e.center),this.radius=e.radius,this},e.prototype.clone=function(){return(new e).copy(this)},e.prototype.getBoundingBox=function(e){return e.setFromCenterAndSize(this.center,tr.set(1,1,1).multiplyScalar(2*this.radius)),e},e.prototype.toGeometry=function(){for(var e=32,t=new Float32Array(384),r=0;r<=e;r++){var i=0;i=r/e*Math.PI*2,t[6*r+0]=this.center.x+Math.cos(i)*this.radius,t[6*r+1]=this.center.y+Math.sin(i)*this.radius,t[6*r+2]=this.center.z+0,i=(r+1)/e*Math.PI*2,t[6*r+3]=this.center.x+Math.cos(i)*this.radius,t[6*r+4]=this.center.y+Math.sin(i)*this.radius,t[6*r+5]=this.center.z+0}for(r=e;r<=64;r++){i=0;i=r/e*Math.PI*2,t[6*r+0]=this.center.x+Math.cos(i)*this.radius,t[6*r+1]=this.center.y+0,t[6*r+2]=this.center.z+Math.sin(i)*this.radius,i=(r+1)/e*Math.PI*2,t[6*r+3]=this.center.x+Math.cos(i)*this.radius,t[6*r+4]=this.center.y+0,t[6*r+5]=this.center.z+Math.sin(i)*this.radius}var o=new n.BufferGeometry;return o.setAttribute("position",new n.BufferAttribute(t,3)),o.computeBoundingBox(),o.computeBoundingSphere(),o},e.prototype.applyMatrix4=function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},e.prototype.getCenter=function(e){return e.copy(this.center)},e.prototype.distanceSquaredTo=function(e){var t=this.distanceTo(e);return t*t},e.prototype.distanceTo=function(e){var t=this.center.distanceTo(e)-this.radius;return t<=0?0:t},e.prototype.intersectPlane=function(e){var t=this.center,r=this.radius,n=e.normal.dot(t)+e.constant;return n<-r?Gt.Outside:n<r?Gt.Intersecting:Gt.Inside},e.prototype.intersectRay=function(e){Wt.subVectors(this.center,e.origin);var t=Wt.dot(e.direction),r=Wt.dot(Wt)-t*t,n=this.radius*this.radius;if(r>n)return!1;var i=Math.sqrt(n-r);return!(t+i<0)},e}(),lr=function(){function e(){throw this.type="regin",this.west=0,this.south=0,this.east=0,this.north=0,this.minHeight=0,this.maxHeight=0,new Error("Region bounding volume not supported.")}return e.prototype.fromJson=function(e){var t=e.region;return this.west=t[0],this.south=t[1],this.east=t[2],this.north=t[3],this.minHeight=t[4],this.maxHeight=t[5],this},e.prototype.toJson=function(){return{region:[this.west,this.south,this.east,this.north,this.minHeight,this.maxHeight]}},e.prototype.copy=function(e){return this.west=e.west,this.south=e.south,this.east=e.east,this.north=e.north,this.minHeight=e.minHeight,this.maxHeight=e.maxHeight,this},e.prototype.clone=function(){return(new e).copy(this)},e.prototype.getBoundingBox=function(e){throw new Error("not implemented")},e.prototype.toGeometry=function(){throw new Error("not implemented")},e.prototype.applyMatrix4=function(e){throw new Error("not implemented")},e.prototype.getCenter=function(e){throw new Error("not implemented")},e.prototype.distanceTo=function(e){throw new Error("not implemented")},e.prototype.distanceSquaredTo=function(e){throw new Error("not implemented")},e.prototype.intersectPlane=function(e){throw new Error("not implemented")},e.prototype.intersectRay=function(e){throw new Error("not implemented")},e}();function ur(e){if("box"in e)return(new ar).fromJson(e);if("sphere"in e)return(new sr).fromJson(e);if("region"in e)return(new lr).fromJson(e);throw new Error("BoundingVolume ".concat(JSON.stringify(e)," never suppored."))}var cr=[2621517,3801199,4915345,5963950,7274706,8782079,9575167,10434047,11623423,12482559,13274879,13870335,14464511,15125247,15852031,16446719].map((function(e){return new n.LineBasicMaterial({color:e,depthWrite:!1,transparent:!0})})),hr=function(){var e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),t=new Float32Array(24);Wt.set(1,1,1).toArray(t,0),Wt.set(-1,1,1).toArray(t,3),Wt.set(-1,-1,1).toArray(t,6),Wt.set(1,-1,1).toArray(t,9),Wt.set(1,1,-1).toArray(t,12),Wt.set(-1,1,-1).toArray(t,15),Wt.set(-1,-1,-1).toArray(t,18),Wt.set(1,-1,-1).toArray(t,21);var r=new n.BufferGeometry;return r.setIndex(new n.BufferAttribute(e,1)),r.setAttribute("position",new n.BufferAttribute(t,3)),r.computeBoundingBox(),r.computeBoundingSphere(),r}(),dr=function(){for(var e=32,t=new Float32Array(384),r=0;r<=e;r++){var i=0;i=r/e*Math.PI*2,t[6*r+0]=Math.cos(i),t[6*r+1]=Math.sin(i),t[6*r+2]=0,i=(r+1)/e*Math.PI*2,t[6*r+3]=Math.cos(i),t[6*r+4]=Math.sin(i),t[6*r+5]=0}for(r=e;r<=64;r++){i=0;i=r/e*Math.PI*2,t[6*r+0]=Math.cos(i),t[6*r+1]=0,t[6*r+2]=Math.sin(i),i=(r+1)/e*Math.PI*2,t[6*r+3]=Math.cos(i),t[6*r+4]=0,t[6*r+5]=Math.sin(i)}var o=new n.BufferGeometry;return o.setAttribute("position",new n.BufferAttribute(t,3)),o.computeBoundingBox(),o.computeBoundingSphere(),o}();var pr,fr,vr,Ar,mr=new n.Vector3,gr=function(){function e(t,r,i,o){var a,s,l,u=this;this.parent=null,this.id=t,this.state={visible:!1,frameNumber:0,selectedFrameNumber:0,requestedFrameNumber:0,touchedFrameNumber:0,selectionDepth:0,centerZDepth:0,shouldRefine:!1,distanceToCamera:0,screenSpaceError:0,visibilityPlaneMask:0,inRequestVolume:!1},this.parent=null!=o?o:null,this.tileset=i,this.refine=null!==(a=r.refine)&&void 0!==a?a:this.parent?this.parent.refine:"REPLACE",this.transform=new n.Matrix4,r.transform&&this.transform.fromArray(r.transform),this.parent&&this.transform.premultiply(this.parent.transform),"number"==typeof r.geometricError?this.geometricError=r.geometricError*this.transform.getMaxScaleOnAxis():this.geometricError=null!==(l=null===(s=this.parent)||void 0===s?void 0:s.geometricError)&&void 0!==l?l:0,r.content&&r.content.uri?(this.content={uri:r.content.uri,loadState:"UNLOADED",byteLength:0},void 0!==r.content.group&&(this.content.group=r.content.group),r.content.boundingVolume&&(this.content.boundingVolume=ur(r.content.boundingVolume).applyMatrix4(this.transform)),/\.json$/.test(this.content.uri)?this.type="TILESET":this.type="SCENEGRAPH"):(this.content=null,this.type="EMPTY"),r.boundingVolume&&(this.boundingVolume=ur(r.boundingVolume).applyMatrix4(this.transform)),r.viewerRequestVolume&&(this.viewerRequestVolume=ur(r.viewerRequestVolume).applyMatrix4(this.transform)),this.extras=r.extras||{},r.children?this.children=r.children.map((function(t,r){return new e("".concat(u.id,".").concat(r),t,i,u)})):this.children=[]}return e.prototype.updateState=function(e){if(this.state.frameNumber!==e.frameNumber){if(this.state.frameNumber=e.frameNumber,this.boundingVolume){var t=this.boundingVolume.clone().applyMatrix4(this.tileset.transfrom);this.state.distanceToCamera=t.distanceTo(e.camera.position),this.state.centerZDepth=e.camera.direction.dot(t.getCenter(mr).sub(e.camera.position));var r=this.parent?this.parent.state.visibilityPlaneMask:or.MASK_INDETERMINATE;this.state.visibilityPlaneMask=e.cullingVolume.computeVisibilityWithPlaneMask(t,r),this.state.visible=this.state.visibilityPlaneMask!==or.MASK_OUTSIDE}else this.state.distanceToCamera=0,this.state.centerZDepth=0,this.state.visibilityPlaneMask=or.MASK_INDETERMINATE,this.state.visible=!0;if(this.viewerRequestVolume){var n=this.viewerRequestVolume.clone().applyMatrix4(this.tileset.transfrom);this.state.inRequestVolume=n.distanceSquaredTo(e.camera.position)<=0}else this.state.inRequestVolume=!0;this.state.screenSpaceError=this.getScreenSpaceError(e,this.state.distanceToCamera,!1)}},Object.defineProperty(e.prototype,"selected",{get:function(){return this.state.selectedFrameNumber===this.tileset.frameNumber},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"siblingIndex",{get:function(){var e,t;return null!==(t=null===(e=this.parent)||void 0===e?void 0:e.children.indexOf(this))&&void 0!==t?t:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasTilesetContent",{get:function(){return this.children.length>0&&"TILESET"===this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRenderContent",{get:function(){return"MESH"===this.type||"SCENEGRAPH"===this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contentAvailable",{get:function(){var e;return this.hasRenderContent&&"READY"===(null===(e=this.content)||void 0===e?void 0:e.loadState)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasUnloadedContent",{get:function(){var e;return"UNLOADED"===(null===(e=this.content)||void 0===e?void 0:e.loadState)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasEmptyContent",{get:function(){return"EMPTY"===this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contentReady",{get:function(){var e;return"READY"===(null===(e=this.content)||void 0===e?void 0:e.loadState)||this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contentByteLength",{get:function(){return this.content?this.content.byteLength:0},enumerable:!1,configurable:!0}),e.prototype.loadContent=function(){var e,t=this;if(this.hasEmptyContent||!(null===(e=this.content)||void 0===e?void 0:e.uri))return Promise.resolve(!1);var r=this.content;return r.data?Promise.resolve(!0):(r.loadState="LOADING",this.tileset.requestScheduler.scheduleRequest(this.id,(function(){return t.getPriority()})).then((function(e){return e?t.tileset.options.contentLoader(t).then((function(t){return e.done(),r.loadState=t?"READY":"UNLOADED",t})).catch((function(t){return r.loadState="FAILED",e.done(),Promise.reject(t)})):(r.loadState="UNLOADED",Promise.resolve(!1))})))},e.prototype.unloadContent=function(){return this.content&&(this.content.loadState="UNLOADED",this.content.byteLength=0),!0},e.prototype.getScreenSpaceError=function(e,t,r){var n=this.tileset.transfrom.getMaxScaleOnAxis(),i=this.parent?this.parent.geometricError:this.tileset.geometricError,o=n*(r?i:this.geometricError);if(0===o)return 0;var a=Math.max(t,.001);return o*e.height*this.tileset.viewDistanceScale/(a*e.sseDenominator)},e.prototype.getPriority=function(){var e=this.tileset.traverser,t="ADD"===this.refine||this.tileset.traverser.skipLevelOfDetail;if(t&&!this.state.visible)return-1;if(this.tileset.frameNumber-this.state.touchedFrameNumber>=1)return-1;if("UNLOADED"===this.content.loadState)return-1;var r=this.parent,n=r&&(!t||0===this.state.screenSpaceError)?r.state.screenSpaceError:this.state.screenSpaceError,i=e.root?e.root.state.screenSpaceError:0;return Math.max(i-n,0)},e}(),yr=function(){function e(){this.maxRequests=e.DEFAULT_MAX_REQUESTS,this.activeRequests=0,this.requestQueue=[],this.requestMap=new Map,this.deferred=null}return e.prototype.scheduleRequest=function(e,t){var r=this.requestMap.get(e);if(r)return r;var n={identiy:e,priority:0,getPriority:t,resolve:function(){}},i=new Promise((function(e){return n.resolve=e}));return this.requestQueue.push(n),this.requestMap.set(e,i),this.issueNewRequests(),i},e.prototype.reset=function(){for(var e=0,t=this.requestQueue;e<t.length;e++){t[e].resolve(null)}this.requestQueue.length=0,this.requestMap.clear(),this.activeRequests=0},e.prototype.issueRequest=function(e){var t=this,r=e.identiy,n=e.resolve,i=!1;this.activeRequests++,n({done:function(){i||(i=!0,t.requestMap.delete(r),t.activeRequests--,t.issueNewRequests())}})},e.prototype.issueNewRequests=function(){var e=this;this.deferred||(this.deferred=setTimeout((function(){return e.issueNewRequestsAsync()}),0))},e.prototype.issueNewRequestsAsync=function(){this.deferred=null;var e=Math.max(this.maxRequests-this.activeRequests,0);if(0!==e){this.updateAllRequests();for(var t=0;t<e;t++){var r=this.requestQueue.shift();if(!r)break;this.issueRequest(r)}}},e.prototype.updateAllRequests=function(){for(var e=this.requestQueue,t=0;t<e.length;t++){var r=e[t];!1===this.updateRequest(r)&&(e.splice(t,1),this.requestMap.delete(r.identiy),t--)}e.sort((function(e,t){return e.priority-t.priority}))},e.prototype.updateRequest=function(e){return e.priority=e.getPriority(e.identiy),!(e.priority<0)||(e.resolve(null),!1)},e.DEFAULT_MAX_REQUESTS=6,e}(),br=function(e,t,r){this.item=e,this.previous=t,this.next=r},xr=function(){function e(){this.head=null,this.tail=null,this._length=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),e.prototype.add=function(e){var t=new br(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),this._length++,t},e.prototype.remove=function(e){e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,this._length--},e.prototype.splice=function(e,t){e!==t&&(this.remove(t),this.insert(e,t))},e.prototype.insert=function(e,t){var r=e.next;e.next=t,this.tail===e?this.tail=t:r.previous=t,t.next=r,t.previous=e,this._length++},e.prototype.toArray=function(){for(var e=[],t=this.head;t;)e.push(t),t=t.next;return e},e}(),wr=function(){function e(){this.cacheNodeMap=new Map,this.list=new xr,this.sentinel=this.list.add("sentinel")}return e.prototype.reset=function(){this.list.tail&&this.list.splice(this.list.tail,this.sentinel)},e.prototype.touch=function(e){var t=this.cacheNodeMap.get(e);t&&this.list.splice(this.sentinel,t)},e.prototype.add=function(e,t){if(!this.cacheNodeMap.has(e)){var r=this.list.add(e);this.cacheNodeMap.set(e,r),t&&t(e)}},e.prototype.unloadTile=function(e,t){var r=this.cacheNodeMap.get(e);r&&(this.list.remove(r),this.cacheNodeMap.delete(e),t&&t(e))},e.prototype.unloadTiles=function(e,t){for(var r=this.list.head;r!==this.sentinel&&e();){var n=r.item;r=r.next,this.unloadTile(n,t)}},e.prototype.toArray=function(){for(var e=[],t=0,r=this.list.toArray();t<r.length;t++){var n=r[t];"sentinel"!==n.item&&e.push(n.item)}return e},e}(),Mr=function(){function e(){this.map=new Map,this.array=[],this._length=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),e.prototype.get=function(e){return this.array[e]},e.prototype.set=function(e,t){e>=this.length&&(this._length=e+1),this.map.has(this.array[e])&&this.map.delete(this.array[e]),this.array[e]=t,this.map.set(t,e)},e.prototype.delete=function(e){var t=this.map.get(e);void 0!==t&&t>=0&&(this.array.splice(t,1),this.map.delete(e),this._length--)},e.prototype.push=function(e){if(!this.map.has(e)){var t=this._length++;this.array[t]=e,this.map.set(e,t)}},e.prototype.pop=function(){var e=this.array[--this._length];return this.map.delete(e),e},e.prototype.reset=function(){this.array=[],this.map=new Map,this._length=0},e.prototype.find=function(e){return this.map.has(e)},e}(),Er=function(){function e(t){this.loadSiblings=e.DEFAULT_LOAD_SIBLINGS,this.skipLevelOfDetail=e.DEFAULT_SKIP_LEVEL_OF_DETAIL,this.maxScreenSpaceError=e.DEFAULT_MAX_SCREEN_SPACE_ERROR,this.onTraversalEnd=t,this._traversalStack=new Mr,this._emptyTraversalStack=new Mr,this.root=null,this.selectedTiles=new Map,this.requestedTiles=new Map,this.needsRefinedTiles=new Map,this.emptyTiles=new Map}return e.prototype.traverse=function(e,t){this.root=e,this.reset(),this.updateTile(e,t),this.executeTraversal(e,t)},e.prototype.reset=function(){this.needsRefinedTiles.clear(),this.requestedTiles.clear(),this.selectedTiles.clear(),this.emptyTiles.clear(),this._traversalStack.reset(),this._emptyTraversalStack.reset()},e.prototype.executeTraversal=function(e,t){var r=this._traversalStack;for(e.state.selectionDepth=0,e.state.visible&&e.state.inRequestVolume&&r.push(e);r.length>0;){var n=r.pop(),i=!1;if(this.canTraverse(n,t,!1,!1)){this.updateChildTiles(n,t);var o=n.hasRenderContent?n.state.selectionDepth+1:n.state.selectionDepth;i=this.updateAndPushChildren(n,t,r,o)}var a=n.parent,s=!a||a.state.shouldRefine,l=!i;n.hasRenderContent?"ADD"===n.refine?(this.loadTile(n,t.frameNumber),this.selectTile(n,t)):"REPLACE"===n.refine&&(this.loadTile(n,t.frameNumber),l&&this.selectTile(n,t)):(this.emptyTiles.set(n.id,n),this.loadTile(n,t.frameNumber),l&&this.selectTile(n,t)),this.touchTile(n,t),n.state.shouldRefine=i&&s}this.onTraversalEnd(t)},e.prototype.updateChildTiles=function(e,t){for(var r=0,n=e.children;r<n.length;r++){var i=n[r];this.updateTile(i,t)}return!0},e.prototype.updateAndPushChildren=function(e,t,r,n){for(var i=e.children,o="REPLACE"===e.refine&&e.hasRenderContent&&!this.skipLevelOfDetail,a=!1,s=!0,l=0,u=i;l<u.length;l++){var c=u[l];if(c.state.selectionDepth=n,c.state.visible&&c.state.inRequestVolume?(r.find(c)&&r.delete(c),r.push(c),a=!0):(o||this.loadSiblings)&&(this.loadTile(c,t.frameNumber),this.touchTile(c,t)),o){var h=void 0;h=!!c.state.inRequestVolume&&(c.hasRenderContent?c.contentAvailable:this.executeEmptyTraversal(c,t)),s=s&&h}}return a||(s=!1),s},e.prototype.updateTile=function(e,t){this.updateTileVisibility(e,t)},e.prototype.selectTile=function(e,t){this.shouldSelectTile(e)&&(e.state.selectedFrameNumber=t.frameNumber,this.selectedTiles.set(e.id,e),this.needsRefinedTiles.set(e.id,e))},e.prototype.loadTile=function(e,t){this.shouldLoadTile(e)&&(e.state.requestedFrameNumber=t,this.requestedTiles.set(e.id,e)),this.needsRefinedTiles.set(e.id,e)},e.prototype.touchTile=function(e,t){e.tileset.cache.touch(e),e.state.touchedFrameNumber=t.frameNumber},e.prototype.canTraverse=function(e,t,r,n){return!!e.hasChildren&&(!!e.hasTilesetContent||!(!n&&!e.state.visible)&&(!(e.hasRenderContent&&e.state.selectionDepth>=t.maxLevelOfDetail)&&this.shouldRefine(e,t,r)))},e.prototype.shouldLoadTile=function(e){return e.hasUnloadedContent},e.prototype.shouldSelectTile=function(e){return e.contentAvailable&&!this.skipLevelOfDetail},e.prototype.shouldRefine=function(e,t,r){if(e.hasEmptyContent)return!0;var n=e.state.screenSpaceError;return r&&(n=e.getScreenSpaceError(t,e.state.distanceToCamera,!0)),n>this.maxScreenSpaceError},e.prototype.updateTileVisibility=function(e,t){if(e.updateState(t),e.state.visible&&e.state.inRequestVolume){var r=e.children.length>0;if(e.hasTilesetContent&&r){var n=e.children[0];return this.updateTileVisibility(n,t),void(e.state.visible=n.state.visible)}this.meetsScreenSpaceErrorEarly(e,t)&&(e.state.visible=!1)}},e.prototype.meetsScreenSpaceErrorEarly=function(e,t){var r=e.parent;return!(!r||"ADD"!==r.refine)&&!this.shouldRefine(e,t,!0)},e.prototype.compareDistanceToCamera=function(e,t){return t.state.distanceToCamera-e.state.distanceToCamera},e.prototype.executeEmptyTraversal=function(e,t){var r=!0,n=this._emptyTraversalStack;for(n.push(e);n.length>0&&r;){var i=n.pop();if(this.updateTile(i,t),i.state.visible||this.loadTile(i,t.frameNumber),this.touchTile(i,t),!i.hasRenderContent&&this.canTraverse(i,t,!1,!0))for(var o=0,a=i.children;o<a.length;o++){var s=a[o];n.find(s)&&n.delete(s),n.push(s)}else i.contentAvailable||(r=!1)}return r},e.DEFAULT_SKIP_LEVEL_OF_DETAIL=!1,e.DEFAULT_LOAD_SIBLINGS=!1,e.DEFAULT_MAX_SCREEN_SPACE_ERROR=1,e}(),Cr=function(){function e(t,r,i){var o,a,s=this;this.id=t,this.transfrom=new n.Matrix4,this.asset={version:r.asset.version,tilesetVersion:r.asset.tilesetVersion||"",gltfUpAxis:null!==(o=r.asset.gltfUpAxis)&&void 0!==o?o:"Z"},this.properties=null!==(a=r.properties)&&void 0!==a?a:{},this.options=i,this.traverser=new Er((function(e){return s.onTraversalEnd(e)})),this.cache=new wr,this.requestScheduler=new yr,this.frameNumber=0,this.pendingCount=0,this.tiles=new Map,this.memoryUsageInBytes=0,this.root=new gr("".concat(this.id,".0"),r.root,this),this.geometricError=r.geometricError,this.maxMemoryUsage=e.DEFAULT_MAX_MEMORY_USAGE,this.viewDistanceScale=e.DEFAULT_VIEW_DISTANCE_SCALE}return Object.defineProperty(e.prototype,"maxRequests",{get:function(){return this.requestScheduler.maxRequests},set:function(e){this.requestScheduler.maxRequests=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScreenSpaceError",{get:function(){return this.traverser.maxScreenSpaceError},set:function(e){this.traverser.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedTiles",{get:function(){return this.traverser.selectedTiles},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needsRefinedTiles",{get:function(){return this.traverser.needsRefinedTiles},enumerable:!1,configurable:!0}),e.prototype.reset=function(){for(var e=this,t=[this.root];t.length>0;){for(var r=t.pop(),n=0,i=r.children;n<i.length;n++){var o=i[n];t.push(o)}this.cache.unloadTile(r,(function(t){return e.unloadTile(t)}))}this.cache.reset(),this.traverser.reset(),this.requestScheduler.reset(),this.tiles.clear()},e.prototype.isLoaded=function(){return 0===this.pendingCount&&0!==this.frameNumber},e.prototype.onTraversalEnd=function(e){var t=this;this.selectedTiles.forEach((function(e){t.tiles.set(e.id,e)})),this.traverser.requestedTiles.forEach((function(e){e.hasUnloadedContent&&t.loadTile(e)})),this.cache.unloadTiles((function(){return t.memoryUsageInBytes>1024*t.maxMemoryUsage*1024}),(function(e){t.unloadTile(e),t.tiles.delete(e.id)}))},e.prototype.loadTile=function(e){var t=this;this.pendingCount++,e.loadContent().catch((function(r){var n=r.message||r.toString();return console.error("A 3D tile failed to load: ".concat(e.id," ").concat(n),e,r),t.options.onTileError(e,n),!1})).then((function(r){var n;t.pendingCount--,r&&((null===(n=e.content)||void 0===n?void 0:n.data)&&t.cache.add(e,(function(){t.memoryUsageInBytes+=e.contentByteLength})),t.options.onTileLoad(e))}))},e.prototype.unloadTile=function(e){this.memoryUsageInBytes-=e.contentByteLength,this.options.onTileUnload(e),e.unloadContent()},e.DEFAULT_VIEW_DISTANCE_SCALE=1,e.DEFAULT_MAX_MEMORY_USAGE=16,e.DEFAULT_MAX_SCREEN_SPACE_ERROR=Er.DEFAULT_MAX_SCREEN_SPACE_ERROR,e.DEFAULT_MAX_REQUESTS=yr.DEFAULT_MAX_REQUESTS,e}(),Ir=function(){function e(e,t,r){this.x=e,this.y=t,this.z=r}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},e.prototype.set=function(e,t,r){return this.x=e,this.y=t,this.z=r,this},e.prototype.fromArray=function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this},e.prototype.multiplyScalar=function(e){return this.x*=e,this.y*=e,this.z*=e,this},e.prototype.subVectors=function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y+this.z*e.z},e.prototype.cross=function(e){var t=this.x,r=this.y,n=this.z;return this.x=r*e.z-n*e.y,this.y=n*e.x-t*e.z,this.z=t*e.y-r*e.x,this},e.prototype.crossVectors=function(e,t){var r=e.x,n=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=n*s-i*a,this.y=i*o-r*s,this.z=r*a-n*o,this},e.prototype.clone=function(){return new e(this.x,this.y,this.z)},e}(),Sr=function(e,t,r){this.extents=e,this.startIndex=t,this.endIndex=r},Pr=function(e,t){this.triangle=e,this.intersectionPoint=t},Tr=(pr=new Ir(0,0,0),fr=new Ir(0,0,0),vr=new Ir(0,0,0),Ar=new Ir(0,0,0),function(e,t,r,n,i,o){fr.subVectors(t,e),vr.subVectors(r,e),Ar.crossVectors(fr,vr);var a,s=i.dot(Ar);if(s>0){if(o)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}pr.subVectors(n,e);var l=a*i.dot(vr.crossVectors(pr,vr));if(l<0)return null;var u=a*i.dot(fr.cross(pr));if(u<0)return null;if(l+u>s)return null;var c=-a*pr.dot(Ar);if(c<0)return null;var h=c/s;return new Ir(0,0,0).copy(i).multiplyScalar(h).add(n)}),Br=function(e,t){this.min=e,this.max=t};function Rr(e,t,r){var n=new Br(0,0);t.x>=0?(n.min=(r.extents[0]-e.x)*t.x,n.max=(r.extents[3]-e.x)*t.x):(n.min=(r.extents[3]-e.x)*t.x,n.max=(r.extents[0]-e.x)*t.x);var i=new Br(0,0);if(t.y>=0?(i.min=(r.extents[1]-e.y)*t.y,i.max=(r.extents[4]-e.y)*t.y):(i.min=(r.extents[4]-e.y)*t.y,i.max=(r.extents[1]-e.y)*t.y),n.min>i.max||i.min>n.max)return!1;i.min>n.min&&(n.min=i.min),i.max<n.max&&(n.max=i.max);var o=new Br(0,0);return t.z>=0?(o.min=(r.extents[2]-e.z)*t.z,o.max=(r.extents[5]-e.z)*t.z):(o.min=(r.extents[5]-e.z)*t.z,o.max=(r.extents[2]-e.z)*t.z),!(n.min>o.max||o.min>n.max)&&(o.min>n.min&&(n.min=o.min),o.max<n.max&&(n.max=o.max),!(n.max<0))}function Or(e,t,r,n,i){if(r>=n)return[0,0,0,0,0,0];for(var o=1/0,a=1/0,s=1/0,l=-1/0,u=-1/0,c=-1/0,h=r,d=void 0,p=void 0;h<n;h++)(p=t[d=6*e[h]])<o&&(o=p),(p=t[d+1])<a&&(a=p),(p=t[d+2])<s&&(s=p),(p=t[d+3])>l&&(l=p),(p=t[d+4])>u&&(u=p),(p=t[d+5])>c&&(c=p);return[o-i,a-i,s-i,l+i,u+i,c+i]}function Lr(e,t,r){return e<t?t:e>r?r:e}var Dr=1e-6,Fr=function(){function e(){}return e.prototype.create=function(e){return this.trianglesArray=e,this},e.prototype.splitNode=function(e){if(!this.trianglesArray)throw new Error("bvh-tree never perpared. call `create` to initialize.");for(var t=this.trianglesArray,r=t.length/9,n=new Uint32Array(r),i=new Float32Array(6*r),o=[],a=0,s=1/0,l=1/0,u=1/0,c=-1/0,h=-1/0,d=-1/0,p=0,f=0,v=0,A=void 0,m=void 0,g=void 0,y=void 0,b=void 0,x=void 0,w=void 0;p<r;p++,f+=6,v+=9)n[p]=p,A=y=t[v],(w=t[v+3])<A&&(A=w),w>y&&(y=w),(w=t[v+6])<A&&(A=w),w>y&&(y=w),m=b=t[v+1],(w=t[v+4])<m&&(m=w),w>b&&(b=w),(w=t[v+7])<m&&(m=w),w>b&&(b=w),g=x=t[v+2],(w=t[v+5])<g&&(g=w),w>x&&(x=w),(w=t[v+8])<g&&(g=w),w>x&&(x=w),A<s&&(s=A),y>c&&(c=y),m<l&&(l=m),b>h&&(h=b),g<u&&(u=g),x>d&&(d=x),i[f]=A,i[f+1]=m,i[f+2]=g,i[f+3]=y,i[f+4]=b,i[f+5]=x;var M=new Sr([s,l,u,c,h,d],0,r);function E(t){for(var r=t.startIndex,s=t.endIndex,l=t.extents,u=[l[3]-l[0],l[4]-l[1],l[5]-l[2]],c=[0,1,2].sort((function(e,t){return u[t]-u[e]})),h=0;h<3;h++){for(var d=c[h],p=l[d]+l[d+3],f=r,v=s-1,A=-1,m=void 0;f<=v;)-1===A?(m=n[f],i[6*m+d]+i[6*m+d+3]<p?f++:A=m):(m=n[v],i[6*m+d]+i[6*m+d+3]>=p||(n[f]=m,n[v]=A,A=-1,f++),v--);if(f>r&&f<s){var g=new Sr(Or(n,i,r,f,Dr),r,f);g.endIndex-g.startIndex>e&&(o[a++]=g);var y=new Sr(Or(n,i,f,s,Dr),f,s);y.endIndex-y.startIndex>e&&(o[a++]=y),t.node0=g,t.node1=y,t.startIndex=0,t.endIndex=0;break}}}for(o[a++]=M;a;)E(o[--a]);return this.offsetArray=n,this.rootNode=M,o.length=0,this},e.prototype.intersectRay=function(e,t,r){if(!this.trianglesArray)throw new Error("bvh-tree never perpared. call `create` to initialize.");if(!this.rootNode||!this.offsetArray)throw new Error("bvh-tree never perpared. call `splitNode` to perpare.");for(var n,i=this.trianglesArray,o=this.offsetArray,a=this.rootNode,s=[],l=[],u=new Ir(1/t.x,1/t.y,1/t.z),c=[a];n=c.pop();)if(Rr(e,u,n)){n.node0&&c.push(n.node0),n.node1&&c.push(n.node1);for(var h=n.startIndex;h<n.endIndex;h++)s.push(o[h])}for(var d=new Ir(0,0,0),p=new Ir(0,0,0),f=new Ir(0,0,0),v=new Ir(e.x,e.y,e.z),A=new Ir(t.x,t.y,t.z),m=(h=0,void 0),g=s.length;h<g;h++){m=9*s[h],d.x=i[m],d.y=i[m+1],d.z=i[m+2],p.x=i[m+3],p.y=i[m+3+1],p.z=i[m+3+2],f.x=i[m+6],f.y=i[m+6+1],f.z=i[m+6+2];var y=Tr(d,p,f,v,A,r);y&&l.push(new Pr([d.clone(),p.clone(),f.clone()],y))}return l},e.prototype.trianglesInSphere=function(e,t){if(!this.trianglesArray)throw new Error("bvh-tree never perpared. call `create` to initialize.");if(!this.rootNode||!this.offsetArray)throw new Error("bvh-tree never perpared. call `splitNode` to perpare.");for(var r,n=this.trianglesArray,i=this.offsetArray,o=[this.rootNode],a=[];r=o.pop();){var s=Lr(e.x,r.extents[0],r.extents[3])-e.x,l=Lr(e.y,r.extents[1],r.extents[4])-e.y,u=Lr(e.z,r.extents[2],r.extents[5])-e.z;if(s*s+l*l+u*u<=t*t){r.node0&&o.push(r.node0),r.node1&&o.push(r.node1);for(var c=r.startIndex;c<r.endIndex;c++)a.push(i[c])}}var h=a.length,d=new Float32Array(9*h);for(c=0;c<h;c++){var p=9*a[c];d[9*c]=n[p],d[9*c+1]=n[p+1],d[9*c+2]=n[p+2],d[9*c+3]=n[p+3],d[9*c+4]=n[p+4],d[9*c+5]=n[p+5],d[9*c+6]=n[p+6],d[9*c+7]=n[p+7],d[9*c+8]=n[p+8]}return d},e.prototype.dispose=function(){delete this.offsetArray,delete this.rootNode},e}(),kr=function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("}rpvv|{-uvtu}-sy|nH}rpvv|{-uvtu}-v{H0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6--{vs|z-rp@-p|{n{P|y|H0r{qvs{vs|z-sy|n-|}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-sy||V{qrH0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlPYV]SY\\\\_6--{vs|z-rp@-sy||V{s|H0r{qvs0vs-qrsv{rq5[bZlPYV]]V[TlO\\e6--{vs|z-sy|n-pyv}}rSy||h[bZlPYV]]V[TlO\\ejH--{vs|z-nz}yr?Q-pyv}}r]yn{rarrH0r{qvsn\bv{t-rp@-]|vv|{Hn\bv{t-rp@-P|y|Hn\bv{t-sy|n-Sy||Hn\bv{t-rp@-cvr]|vv|{Hn\bv{t-sy|n-Y|tQr}uHrp@-Yv{rna|_TO5-rp@-nyr-6-\nr{-rp@5-zv5-}|5-nyr;to9-rp@5-=;A>CCC-6-6-7->;=BB-:-rp@5-=;=BB-69-nyr;to-7->?;F?9-rp@5-yraun{R\0ny5-nyr;to9-rp@5-=;==@>@=E-6-6-6-66H\f|vq-znv{56-\n--0vs-qrsv{rq5[bZlPYV]]V[TlO\\e6----rpA-}yn{rH----s|5-v{-v-J-=H-v-I-[bZlPYV]]V[TlO\\eH-v886\n------o||y-pyv}}rq-J-rH------v{-pr{Sy||-J-v{5pyv}}rSy||hvj6H------<<内部展开s|循环,让v{q|能用------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C6-8-=;B6-<-sy|n5[bZlPYV]]V[TlO\\e-<-C69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8->6-8-=;B6-<-sy|n5[bZlPYV]]V[TlO\\e-<-C69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8-?6-8-=;B6-<-sy|n5[bZlPYV]]V[TlO\\e-<-C69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8-@6-8-=;B6-<-sy|n5[bZlPYV]]V[TlO\\e-<-C69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8-A6-8-=;B6-<-sy|n5[bZlPYV]]V[TlO\\e-<-C69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8-B6-8-=;B6-<-sy|n5[bZlPYV]]V[TlO\\e-<-C69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------o||y-v{antrSy||-J-no5Sy||-:-sy|n5pr{Sy||66-I->;=H------pyv}}rq-J-5pr{Sy||-JJ-:>-\v\v-v{antrSy||6-33-pyv}}rqH------vs-5pyv}}rq6-\n--------qvpnqH------\f----\f--0r{qvs--<<楼层切割计算--sy|n-sy||\\}npv\b-J->;=H--vs-5sy||V{qr-KJ-=;=-33-no5Sy||-:-sy|n5sy||V{qr66-KJ->;=6-\n----sy||\\}npv\b-J-=;>H--\f--rp@-pnzrnQvrpv|{-J-{|znyv\tr5pnzrn]|vv|{-:-]|vv|{6H--rp@-p|y|-J-P|y|H--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----vs-5q|5pnzrnQvrpv|{9-[|zny6-I-=;=6-\n------qvpnqH----\f--0r{qvs--0vs-qrsv{rq5b`Rl]\\V[al`UN]RlPV_PYR6----sy|n--J-?;=-7-tyl]|v{P||q;-:->;=H----sy|n--J-?;=-7-tyl]|v{P||q;\b-:->;=H----sy|n-pp-J-7-8-7H----vs-5pp-K->;=6-\n------qvpnqH----\f--0r{qvs--0vs-qrsv{rq5b`RlP\\[`aN[alP\\Y\\_6----tylSntP|y|-J-rpA5p|{n{P|y|;9-p|{n{P|y|;t9-p|{n{P|y|;o9->;=6H--0ryr----tylSntP|y|-J-rpA5Yv{rna|_TO5P|y|69-z|qryNy}un-7-|}npv\b-7-sy||\\}npv\b6H--0r{qvs--0vs-qrsv{rq5b`RlRQY6----tylSntP|y|;n-J-Y|tQr}uH--0r{qvs\f"),Qr=function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("}rpvv|{-uvtu}-sy|nH}rpvv|{-uvtu}-v{Hnvor-rp@-p|y|Hnvor-sy|n-sy||H{vs|z-sy|n-}|v{`v\trH{vs|z-sy|n-}|v{Zn`v\trH{vs|z-sy|n-}|v{Zv{`v\trH{vs|z-sy|n-}|v{`v\trNqn}vr`pnyrH{vs|z-sy|n-|}npv\bH0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6--{vs|z-nz}yr?Q-tnqvr{arrH0r{qvsn\bv{t-rp@-]|vv|{Hn\bv{t-rp@-P|y|H0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6--n\bv{t-rp@-[|znyH0r{qvs0vs-qrsv{rq5b`RlRQY6--n\bv{t-sy|n-Y|tQr}uH0r{qvsn\bv{t-sy|n-Sy||Hn\bv{t-rp@-cvr]|vv|{H0qrsv{r-]V-@;>A>BF?CB@BEFDF@o||y-v]r}rpvrZnv5-znA-z-6-\n--r{-zh-?-jh-@-j-JJ-:->;=H\frp@-_TOa|Yv{rn5-rp@-nyr-6-\n--r{-rp@5-zv5-}|5-nyr;to-7-=;FADECD?FEC-8-rp@5-=;=B?>@?D=>A-69-rp@5-?;A-6-69-nyr;to-7-=;=DD@FF@E=E9-rp@5-yraun{R\0ny5-nyr;to9-rp@5-=;=A=AB-6-6-6-66H\frp@-trP|y|O\bUrvtu5nz}yr?Q-tnqvr{arr9-rpA-|yq]|vv|{6-\n--rp@-p|y|-J-rr?Q5tnqvr{arr9-rp?5|yq]|vv|{;\b-<->=;=9-=;B66;toH--r{-p|y|H\f|vq-znv{56-\n--rpA-z]|vv|{-J-z|qrycvrZnv-7-rpA5}|vv|{9->;=6H--tyl]|vv|{-J-}|wrpv|{Znv-7-z]|vv|{H--<<传递nvor的p|y|到s里使用--<<动态调整}|v{`v\tr--sy|n-rny]|v{`v\tr-J-}|v{`v\trH--0vs-qrsv{rq5b`Rl]\\V[al`VgRlNQN]aVcR6----sy|n-v]r}rpvr-J-sy|n5v]r}rpvrZnv5}|wrpv|{Znv66H----rny]|v{`v\tr-7J-zv5>;=9-}|v{`v\trNqn}vr`pnyr-7-}|v{`v\tr-<-:-z]|vv|{;\t9-v]r}rpvr6H--0r{qvs--<<全局大小约束-rny]|v{`v\tr-J-pynz}5rny]|v{`v\tr9-}|v{Zv{`v\tr9-}|v{Zn`v\tr6H--tyl]|v{`v\tr-J-rny]|v{`v\trH--0vs-qrsv{rq5b`Rl]\\V[alP\\Y\\_lNYaVabQR6----P|y|-J-trP|y|O\bUrvtu5tnqvr{arr9-z|qryZnv-7-rpA5-}|vv|{9->;=-66H--0ryr----P|y|-J-_TOa|Yv{rn5p|y|6H--0r{qvs--0vs-qrsv{rq5b`Rl]\\V[al[\\_ZNY6----[|zny-J-{|znyv\tr5zn@5z|qryZnv6-7-{|zny6H--0r{qvs--]|vv|{-J-5z|qryZnv-7-rpA5-}|vv|{9->;=-66;\b\tH--0vs-qrsv{rq5b`RlRQY6----Y|tQr}u-J-y|t?5:z]|vv|{;\t6H--0r{qvs--Sy||-J-sy||H--cvr]|vv|{-J-:z]|vv|{;\b\tH\f"),Nr=Object.assign({pointSize:new n.Uniform(1),opacity:new n.Uniform(1),pointMaxSize:new n.Uniform(2),pointMinSize:new n.Uniform(5),pointSizeAdaptiveScale:new n.Uniform(25),gradientTexture:new n.Uniform(null),modelAlpha:new n.Uniform(0),floorIndex:new n.Uniform(-1),clipperPlanesTexture:new n.Uniform(null),clipperFloors:new n.Uniform([]),constantColor:new n.Uniform(null)},n.UniformsUtils.clone(n.UniformsLib.common)),Vr=function(e){function t(t){void 0===t&&(t={});var r,i,o,a,s,l,u,c,h,d,p,f,v,A,m,g,y,b,x=this;return x=e.call(this,{vertexShader:Qr,fragmentShader:kr,uniforms:n.UniformsUtils.clone(Nr),defines:{USE_CONSTANT_COLOR:!1,USE_EDL:!1,NUM_CLIPPING_BOX:!1,USE_CLIPFLOOR:!1,USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_PANO_VIDEO:!1,USE_POINT_NORMAL:!1,USE_POINT_SHAPE_CIRCLE:!1,USE_POINT_SIZE_ADAPTIVE:!1}})||this,Object.defineProperties(x,{constantColor:{get:function(){return this.uniforms.constantColor.value},set:function(e){this.uniforms.constantColor.value=e;var t=null!==e;this.defines.USE_CONSTANT_COLOR!==t&&(this.defines.USE_CONSTANT_COLOR=t,this.needsUpdate=!0)}},pointSize:{get:function(){return this.uniforms.pointSize.value},set:function(e){this.uniforms.pointSize.value=e}},pointMaxSize:{get:function(){return this.uniforms.pointMaxSize.value},set:function(e){this.uniforms.pointMaxSize.value=e}},pointMinSize:{get:function(){return this.uniforms.pointMinSize.value},set:function(e){this.uniforms.pointMinSize.value=e}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(e){this.uniforms.modelAlpha.value=e}},floorIndex:{get:function(){return this.uniforms.floorIndex.value},set:function(e){this.uniforms.floorIndex.value=e}},clippers:{get:function(){return b},set:function(e){b=e,this.needsUpdateClippers=!0}},clipperFloors:{get:function(){return this.uniforms.clipperFloors.value},set:function(e){this.uniforms.clipperFloors.value=e}},pointColorType:{get:function(){return!0===this.defines.USE_POINT_COLOR_ALTITUDE?exports.PBMPointColorType.ALTITUDE:exports.PBMPointColorType.RGB},set:function(e){var t=e===exports.PBMPointColorType.ALTITUDE;this.defines.USE_POINT_COLOR_ALTITUDE!==t&&(this.defines.USE_POINT_COLOR_ALTITUDE=t,this.needsUpdate=!0)}},pointSizeType:{get:function(){return!0===this.defines.USE_POINT_SIZE_ADAPTIVE?exports.PBMPointSizeType.ADAPTIVE:exports.PBMPointSizeType.FIXED},set:function(e){var t=e===exports.PBMPointSizeType.ADAPTIVE;this.defines.USE_POINT_SIZE_ADAPTIVE!==t&&(this.defines.USE_POINT_SIZE_ADAPTIVE=t,this.needsUpdate=!0)}},pointShape:{get:function(){return!0===this.defines.USE_POINT_SHAPE_CIRCLE?exports.PBMPointShapeType.CIRCLE:exports.PBMPointShapeType.SQUARE},set:function(e){var t=e===exports.PBMPointShapeType.CIRCLE;this.defines.USE_POINT_SHAPE_CIRCLE!==t&&(this.defines.USE_POINT_SHAPE_CIRCLE=t,this.needsUpdate=!0)}},useEDL:{get:function(){return this.defines.USE_EDL},set:function(e){e!==this.defines.USE_EDL&&(this.defines.USE_EDL=e,this.needsUpdate=!0)}},pointSizeAdaptiveScale:{get:function(){return this.uniforms.pointSizeAdaptiveScale.value},set:function(e){this.uniforms.pointSizeAdaptiveScale.value=e}},gradientTexture:{get:function(){return this.uniforms.gradientTexture.value},set:function(e){this.uniforms.gradientTexture.value=e}}}),x.pbmMaterialParametersVersion=0,x.pano0=null!==(r=t.pano0)&&void 0!==r?r:null,x.pano1=null!==(i=t.pano1)&&void 0!==i?i:null,x.modelAlpha=null!==(o=t.modelAlpha)&&void 0!==o?o:1,x.progress=null!==(a=t.progress)&&void 0!==a?a:0,x.useBlackTransition=null!==(s=t.useBlackTransition)&&void 0!==s&&s,x.constantColor=null!==(l=t.constantColor)&&void 0!==l?l:null,x.opacity=null!==(u=t.opacity)&&void 0!==u?u:1,x.floorIndex=null!==(c=t.floorIndex)&&void 0!==c?c:-1,x.clippers=null,x.clipperPlanesArray=null,x.clipperFloors=null,x.useEDL=null!==(h=t.useEDL)&&void 0!==h&&h,x.pointColorType=null!==(d=t.pointColorType)&&void 0!==d?d:exports.PBMPointColorType.RGB,x.pointSizeType=null!==(p=t.pointSizeType)&&void 0!==p?p:exports.PBMPointSizeType.ADAPTIVE,x.pointShape=null!==(f=t.pointShape)&&void 0!==f?f:exports.PBMPointShapeType.CIRCLE,x.pointSize=null!==(v=t.pointSize)&&void 0!==v?v:1,x.pointMaxSize=null!==(A=t.pointMaxSize)&&void 0!==A?A:20,x.pointMinSize=null!==(m=t.pointMinSize)&&void 0!==m?m:1,x.pointSizeAdaptiveScale=null!==(g=t.pointSizeAdaptiveScale)&&void 0!==g?g:25,x.gradientTexture=null!==(y=t.gradientTexture)&&void 0!==y?y:null,x.transparent=!1,x}return ne(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.update=function(e,t,r){this.transparent=this.floorIndex>-1||this.opacity<1,this.useEDL&&(this.transparent=!1),this.blending=this.transparent?n.NormalBlending:n.NoBlending;var i=this.clippers,o="clippers:".concat(JSON.stringify(i?{clippers:i,cameraMatrix:t.matrixWorld}:null)),a=r.get(o,(function(){var e=null,r=null;i&&i.length&&(Je.shared.update(i,t),e=Je.shared.clipperPlanes,r=Je.shared.clipperFloors);var o=i?i.length:0,a=e?new n.DataTexture(e,length,1,n.RGBAFormat,n.FloatType):null;return{value:{boxCount:o,clipperPlanesTexture:a,clipperFloors:r},dispose:function(){a&&a.dispose()}}})),s=a.boxCount,l=a.clipperPlanesTexture,u=a.clipperFloors,c=s>0&&s;l&&!1!==c?(this.uniforms.clipperPlanesTexture.value=l,this.uniforms.clipperFloors.value=u):(this.uniforms.clipperPlanesTexture.value=null,this.uniforms.clipperFloors.value=null),this.defines.NUM_CLIPPING_BOX!==c&&(this.defines.NUM_CLIPPING_BOX=c,this.needsUpdate=!0)},t}(n.ShaderMaterial);var Ur=new n.Ray,zr=new n.Vector3,qr=new n.Matrix3,Hr=new n.Matrix4,_r=new n.Vector3,jr=new n.Vector3,Gr=new n.Vector3,Kr=new n.Triangle,Wr=function(e){function t(t,r){var n=e.call(this)||this;return n.objType=r,n.renderOrder=-4,n.add(t),n}return ne(t,e),t.prototype.buildBvhTree=function(){if("mesh"===this.objType&&!this.bvhTree){var e=this.parent;this.parent=null,this.updateWorldMatrix(!1,!0);var t=[];this.traverse((function(e){var r,i;if(e instanceof n.Mesh){var o=e.geometry;if(o instanceof n.BufferGeometry){var a=null===(r=o.attributes)||void 0===r?void 0:r.position.array;if(a){var s=null===(i=o.index)||void 0===i?void 0:i.array,l=e.matrixWorld;t.push({position:a,matrix:l,index:s})}}}}));for(var r=0,i=0,o=t;i<o.length;i++){var a=o[i],s=a.index,l=a.position,u=0;u=s?s.length:l.length/3,r+=3*Math.floor(u/3)}for(var c=new Float32Array(3*r),h=0,d=0,p=t;d<p.length;d++){var f=p[d],v=(s=f.index,l=f.position,f.matrix);if(s){for(var A=3*Math.floor(s.length/3),m=0,g=void 0,y=void 0;m<A;m++)g=3*(h+m),y=3*s[m],zr.set(l[y],l[y+1],l[y+2]),zr.applyMatrix4(v),c[g]=zr.x,c[g+1]=zr.y,c[g+2]=zr.z;h+=A}else{for(A=3*Math.floor(l.length/3/3),m=0,g=void 0,y=void 0;m<A;m++)g=3*(h+m),y=3*m,zr.set(l[y],l[y+1],l[y+2]),zr.applyMatrix4(v),c[g]=zr.x,c[g+1]=zr.y,c[g+2]=zr.z;h+=A}}this.bvhTree=(new Fr).create(c).splitNode(200),this.parent=e,this.matrixWorldNeedsUpdate=!0}},t.prototype.intersectRaycaster=function(e){var t=this;if("points"===this.objType){e.params||(e.params={});e.params.Points={threshold:.1};var r=e.intersectObjects(this.children,!0).filter((function(t){if(t.distanceToRay>.1)return!1;if(t.object instanceof n.Points&&t.object.geometry instanceof n.BufferGeometry){var r=t.object.geometry.attributes.normal;if(r){var i=t.index,o=new n.Vector3(r.getX(i),r.getY(i),r.getZ(i));if(o.applyMatrix3(qr.setFromMatrix4(t.object.matrixWorld)).normalize(),t.face=new n.Face3(i,i,i,o),e.ray.direction.dot(o)>0)return!1}}return!0}));return r.map((function(e){return{distance:e.distance,point:e.point,face:e.face?{normal:e.face.normal}:null}}))}if(this.bvhTree){this.updateWorldMatrix(!0,!1),Hr.getInverse(this.matrixWorld),Ur.copy(e.ray).applyMatrix4(Hr);var i=this.bvhTree.intersectRay(Ur.origin,Ur.direction,!0).map((function(r){var i=r.intersectionPoint,o=r.triangle,a=(new n.Vector3).set(i.x,i.y,i.z).applyMatrix4(t.matrixWorld),s=_r.set(o[0].x,o[0].y,o[0].z).applyMatrix4(t.matrixWorld),l=jr.set(o[1].x,o[1].y,o[1].z).applyMatrix4(t.matrixWorld),u=Gr.set(o[2].x,o[2].y,o[2].z).applyMatrix4(t.matrixWorld);return{point:a,face:{normal:Kr.set(s,l,u).getNormal(new n.Vector3)},distance:e.ray.origin.distanceTo(a)}}));return i.filter((function(t){return t.distance>=e.near&&t.distance<=e.far})).sort((function(e,t){return e.distance-t.distance}))}return(r=e.intersectObjects(this.children,!0)).map((function(e){return{distance:e.distance,point:e.point,face:e.face?{normal:e.face.normal}:null}}))},t.prototype.dispose=function(){this.bvhTree=void 0,this.traverse((function(e){if(e instanceof n.Mesh||e instanceof n.Points)if(e.geometry.dispose(),Array.isArray(e.material))for(var t=0,r=e.material;t<r.length;t++){Yr(r[t])}else Yr(e.material)}))},t}(n.Group);function Yr(e){if(e instanceof Vr)!function(e){for(var t=[],r=e.uniforms,n=0,i=Object.keys(r);n<i.length;n++){var o=i[n];if(/^pano\d\_/.test(o))return void(r[o].value=null);if("gradientTexture"===o)return;if("clipperPlanesTexture"===o)return;var a=r[o].value;a&&"function"==typeof a.dispose&&-1===t.indexOf(a)&&(r[o].value=null,t.push(a))}e.dispose();for(var s=0,l=t;s<l.length;s++)l[s].dispose()}(e);else if(e instanceof Qt)!function(e){for(var t=[],r=e.uniforms,n=0,i=Object.keys(r);n<i.length;n++){var o=i[n];if(/^pano\d\_/.test(o))return void(r[o].value=null);if("gradientTexture"===o)return;if("clipperPlanesTexture"===o)return;var a=r[o].value;a&&"function"==typeof a.dispose&&-1===t.indexOf(a)&&(r[o].value=null,t.push(a))}e.dispose();for(var s=0,l=t;s<l.length;s++)l[s].dispose()}(e);else if(e instanceof n.RawShaderMaterial||e instanceof n.ShaderMaterial){for(var t=[],r=e.uniforms,i=0,o=Object.keys(r);i<o.length;i++){(c=r[h=o[i]].value)&&"function"==typeof c.dispose&&-1===t.indexOf(c)&&(r[h].value=null,t.push(c))}e.dispose();for(var a=0,s=t;a<s.length;a++){s[a].dispose()}}else{t=[];for(var l=0,u=Object.keys(e);l<u.length;l++){var c,h=u[l];if(/map$/i.test(h))(c=e[h])&&"function"==typeof c.dispose&&-1===t.indexOf(c)&&(e[h].value=null,t.push(c))}e.dispose();for(var d=0,p=t;d<p.length;d++){p[d].dispose()}}}function Xr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=[];e=e.map((function(e){return(null!=e?e:"").trim()})).filter((function(e){return e.length>0&&!/^\/+$/.test(e)}));for(var n=0;n<e.length;n++){var i=0===n,o=n===e.length-1,a=e[n];i||(a=a.replace(/^\.\//,"").replace(/^\/+/,"")),o||(a=a.replace(/\/+$/,"")),r.push(a)}return r.join("/")}function Jr(e){return 0===e.indexOf("//")||/^[0-9a-z]+\:/i.test(e)}function Zr(e,t){if(e.content&&e.content.uri&&(Jr(e.content.uri)||(e.content.uri=Xr(t,e.content.uri))),e.children)for(var r=0,n=e.children;r<n.length;r++){Zr(n[r],t)}return e}function $r(e,t){return Zr(e.root,t),e}var en,tn,rn=4;function nn(e,t,r){var n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=rn,e.version=n.getUint32(r,!0),r+=rn,e.byteLength=n.getUint32(r,!0),r+=rn,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return r}!function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.DOUBLE=5130]="DOUBLE"}(tn||(tn={}));var on=((en={})[tn.DOUBLE]=Float64Array,en[tn.FLOAT]=Float32Array,en[tn.UNSIGNED_SHORT]=Uint16Array,en[tn.UNSIGNED_INT]=Uint32Array,en[tn.UNSIGNED_BYTE]=Uint8Array,en[tn.BYTE]=Int8Array,en[tn.SHORT]=Int16Array,en[tn.INT]=Int32Array,en),an={DOUBLE:tn.DOUBLE,FLOAT:tn.FLOAT,UNSIGNED_SHORT:tn.UNSIGNED_SHORT,UNSIGNED_INT:tn.UNSIGNED_INT,UNSIGNED_BYTE:tn.UNSIGNED_BYTE,BYTE:tn.BYTE,SHORT:tn.SHORT,INT:tn.INT};function sn(e){var t=on[e];if(!t)throw new Error("Failed to convert GL type");return t}function ln(e){return sn(e).BYTES_PER_ELEMENT}function un(e,t,r,n){void 0===r&&(r=0);var i=sn(e);return r%ln(e)!=0?new i(n?t.slice(r,r+n*ln(e)):t.slice(r)):new i(t,r,null!=n?n:(t.byteLength-r)/ln(e))}var cn=function(){function e(e,t){this.featuresLength=0,this.cachedTypedArrays={},this.json=e,this.buffer=t;var r=this.getGlobalProperty("POINTS_LENGTH",tn.UNSIGNED_INT,1);r&&r.length&&(this.featuresLength=r[0])}return e.prototype.getExtension=function(e){return this.json.extensions&&this.json.extensions[e]},e.prototype.hasProperty=function(e){return Boolean(this.json[e])},e.prototype.getGlobalProperty=function(e,t,r){var n=this.json[e];return"number"==typeof n?new(sn(t))([n]):Array.isArray(n)?new(sn(t))(n):n&&Number.isFinite(n.byteOffset)?this.getTypedArrayFromBinary(e,t,r,1,n.byteOffset):null},e.prototype.getPropertyArray=function(e,t,r){var n=this.json[e];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(t=function(e){var t=an[e];if(!t)throw new Error("Failed to convert GL type");return t}(n.componentType)),this.getTypedArrayFromBinary(e,t,r,this.featuresLength,n.byteOffset)):this.getTypedArrayFromArray(e,t,n)},e.prototype.getProperty=function(e,t,r,n,i){if(!this.json[e])return null;var o=this.getPropertyArray(e,t,r);if(1===r)return i[0]=o[n],i;for(var a=0;a<r;++a)i[a]=o[r*n+a];return i},e.prototype.getTypedArrayFromBinary=function(e,t,r,n,i){var o=this.cachedTypedArrays,a=o[e];return a||(a=un(t,this.buffer.buffer,this.buffer.byteOffset+i,n*r),o[e]=a),a},e.prototype.getTypedArrayFromArray=function(e,t,r){var n=this.cachedTypedArrays,i=n[e];return i||(i=un(t,r),n[e]=i),i},e}(),hn=4,dn="b3dm tile in legacy format.";function pn(e,t,r){var n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function fn(e,t,r){return r=function(e,t,r){var n=new DataView(t),i=0;e.header=e.header||{};var o=n.getUint32(r,!0);r+=hn;var a=n.getUint32(r,!0);r+=hn;var s=n.getUint32(r,!0);r+=hn;var l=n.getUint32(r,!0);r+=hn,s>=570425344?(r-=2*hn,i=o,s=a,l=0,o=0,a=0,console.warn(dn)):l>=570425344&&(r-=hn,i=s,s=o,l=a,o=0,a=0,console.warn(dn));return e.header.featureTableJsonByteLength=o,e.header.featureTableBinaryByteLength=a,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=l,e.header.batchLength=i,r}(e,t,r),r=function(e,t,r){var i=e.header||{},o=i.featureTableJsonByteLength,a=i.featureTableBinaryByteLength,s=i.batchLength;if(e.featureTableJson={BATCH_LENGTH:s||0},o&&o>0){var l=pn(t,r,o);e.featureTableJson=JSON.parse(l)}r+=o||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,e.rtcCenter=new n.Vector3;var u=new cn(e.featureTableJson,e.featureTableBinary);if(Array.isArray(u.json.RTC_CENTER))e.rtcCenter.fromArray(u.json.RTC_CENTER);else{var c=u.getGlobalProperty("RTC_CENTER",tn.FLOAT,3);c&&e.rtcCenter.fromArray(c)}return r}(e,t,r),r=function(e,t,r){var n=e.header||{},i=n.batchTableJsonByteLength,o=n.batchTableBinaryByteLength;if(i&&i>0){var a=pn(t,r,i);e.batchTableJson=JSON.parse(a),r+=i,o&&o>0&&(e.batchTableBinary=new Uint8Array(t,r,o),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=o)}return r}(e,t,r),r}function vn(e,t,r){var n=e.byteLength-r;if(0===n)throw new Error("glTF byte length must be greater than 0.");return r%4!=0&&console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.gltfArrayBuffer=function(e,t,r){var n=void 0!==r?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}(t,r,n),e.byteLength}var An=function(){function t(t){e.Loader.call(this,t),this.dracoLoader=null,this.ddsLoader=null}function r(){var e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}t.prototype=Object.assign(Object.create(e.Loader.prototype),{constructor:t,load:function(t,r,n,i){var o,a=this;o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:e.LoaderUtils.extractUrlBase(t),a.manager.itemStart(t);var s=function(e){i?i(e):console.error(e),a.manager.itemError(t),a.manager.itemEnd(t)},l=new e.FileLoader(a.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),"use-credentials"===a.crossOrigin&&l.setWithCredentials(!0),l.load(t,(function(e){try{a.parse(e,o,(function(e){r(e),a.manager.itemEnd(t)}),s)}catch(e){s(e)}}),n,s)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},parse:function(t,r,u,c){var f,m={};if("string"==typeof t)f=t;else if(e.LoaderUtils.decodeText(new Uint8Array(t,0,4))===l){try{m[n.KHR_BINARY_GLTF]=new h(t)}catch(e){return void(c&&c(e))}f=m[n.KHR_BINARY_GLTF].content}else f=e.LoaderUtils.decodeText(new Uint8Array(t));var g=JSON.parse(f);if(void 0===g.asset||g.asset.version[0]<2)c&&c(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(g.extensionsUsed)for(var y=0;y<g.extensionsUsed.length;++y){var b=g.extensionsUsed[y],x=g.extensionsRequired||[];switch(b){case n.KHR_LIGHTS_PUNCTUAL:m[b]=new o(g);break;case n.KHR_MATERIALS_CLEARCOAT:m[b]=new s;break;case n.KHR_MATERIALS_UNLIT:m[b]=new a;break;case n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:m[b]=new v;break;case n.KHR_DRACO_MESH_COMPRESSION:m[b]=new d(g,this.dracoLoader);break;case n.MSFT_TEXTURE_DDS:m[b]=new i(this.ddsLoader);break;case n.KHR_TEXTURE_TRANSFORM:m[b]=new p;break;case n.KHR_MESH_QUANTIZATION:m[b]=new A;break;default:x.indexOf(b)>=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+b+'".')}}var w=new z(g,m,{path:r||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager});w.fileLoader.setRequestHeader(this.requestHeader),w.parse(u,c)}}});var n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function i(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=n.MSFT_TEXTURE_DDS,this.ddsLoader=e}function o(e){this.name=n.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[n.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function a(){this.name=n.KHR_MATERIALS_UNLIT}function s(){this.name=n.KHR_MATERIALS_CLEARCOAT}o.prototype.loadLight=function(t){var r,n=this.lightDefs[t],i=new e.Color(16777215);void 0!==n.color&&i.fromArray(n.color);var o=void 0!==n.range?n.range:0;switch(n.type){case"directional":(r=new e.DirectionalLight(i)).target.position.set(0,0,-1),r.add(r.target);break;case"point":(r=new e.PointLight(i)).distance=o;break;case"spot":(r=new e.SpotLight(i)).distance=o,n.spot=n.spot||{},n.spot.innerConeAngle=void 0!==n.spot.innerConeAngle?n.spot.innerConeAngle:0,n.spot.outerConeAngle=void 0!==n.spot.outerConeAngle?n.spot.outerConeAngle:Math.PI/4,r.angle=n.spot.outerConeAngle,r.penumbra=1-n.spot.innerConeAngle/n.spot.outerConeAngle,r.target.position.set(0,0,-1),r.add(r.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+n.type+'".')}return r.position.set(0,0,0),r.decay=2,void 0!==n.intensity&&(r.intensity=n.intensity),r.name=n.name||"light_"+t,Promise.resolve(r)},a.prototype.getMaterialType=function(){return e.MeshBasicMaterial},a.prototype.extendParams=function(t,r,n){var i=[];t.color=new e.Color(1,1,1),t.opacity=1;var o=r.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){var a=o.baseColorFactor;t.color.fromArray(a),t.opacity=a[3]}void 0!==o.baseColorTexture&&i.push(n.assignTexture(t,"map",o.baseColorTexture))}return Promise.all(i)},s.prototype.getMaterialType=function(){return e.MeshPhysicalMaterial},s.prototype.extendParams=function(t,r,n){var i=[],o=r.extensions[this.name];if(void 0!==o.clearcoatFactor&&(t.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&i.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&i.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(i.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){var a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new e.Vector2(a,a)}return Promise.all(i)};var l="glTF",u=12,c={JSON:1313821514,BIN:5130562};function h(t){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var r=new DataView(t,0,u);if(this.header={magic:e.LoaderUtils.decodeText(new Uint8Array(t.slice(0,4))),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==l)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var i=new DataView(t,u),o=0;o<i.byteLength;){var a=i.getUint32(o,!0);o+=4;var s=i.getUint32(o,!0);if(o+=4,s===c.JSON){var h=new Uint8Array(t,u+o,a);this.content=e.LoaderUtils.decodeText(h)}else if(s===c.BIN){var d=u+o;this.body=t.slice(d,d+a)}o+=a}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function d(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=n.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}function p(){this.name=n.KHR_TEXTURE_TRANSFORM}function f(t){e.MeshStandardMaterial.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var r=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),n=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),i=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),o=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),a=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),s={specular:{value:(new e.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=s,this.onBeforeCompile=function(e){for(var t in s)e.uniforms[t]=s[t];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),e.fragmentShader=e.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_pars_fragment>",r),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_pars_fragment>",n),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_fragment>",i),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_fragment>",o),e.fragmentShader=e.fragmentShader.replace("#include <lights_physical_fragment>",a)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(e){s.specular.value=e}},specularMap:{get:function(){return s.specularMap.value},set:function(e){s.specularMap.value=e}},glossiness:{get:function(){return s.glossiness.value},set:function(e){s.glossiness.value=e}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(e){s.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function v(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return f},extendParams:function(t,r,n){var i=r.extensions[this.name];t.color=new e.Color(1,1,1),t.opacity=1;var o=[];if(Array.isArray(i.diffuseFactor)){var a=i.diffuseFactor;t.color.fromArray(a),t.opacity=a[3]}if(void 0!==i.diffuseTexture&&o.push(n.assignTexture(t,"map",i.diffuseTexture)),t.emissive=new e.Color(0,0,0),t.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,t.specular=new e.Color(1,1,1),Array.isArray(i.specularFactor)&&t.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture){var s=i.specularGlossinessTexture;o.push(n.assignTexture(t,"glossinessMap",s)),o.push(n.assignTexture(t,"specularMap",s))}return Promise.all(o)},createMaterial:function(t){var r=new f(t);return r.fog=!0,r.color=t.color,r.map=void 0===t.map?null:t.map,r.lightMap=null,r.lightMapIntensity=1,r.aoMap=void 0===t.aoMap?null:t.aoMap,r.aoMapIntensity=1,r.emissive=t.emissive,r.emissiveIntensity=1,r.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,r.bumpMap=void 0===t.bumpMap?null:t.bumpMap,r.bumpScale=1,r.normalMap=void 0===t.normalMap?null:t.normalMap,r.normalMapType=e.TangentSpaceNormalMap,t.normalScale&&(r.normalScale=t.normalScale),r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.specularMap=void 0===t.specularMap?null:t.specularMap,r.specular=t.specular,r.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,r.glossiness=t.glossiness,r.alphaMap=null,r.envMap=void 0===t.envMap?null:t.envMap,r.envMapIntensity=1,r.refractionRatio=.98,r}}}function A(){this.name=n.KHR_MESH_QUANTIZATION}function m(t,r,n,i){e.Interpolant.call(this,t,r,n,i)}d.prototype.decodePrimitive=function(e,t){var r=this.json,n=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},s={},l={};for(var u in o){var c=T[u]||u.toLowerCase();a[c]=o[u]}for(u in e.attributes){c=T[u]||u.toLowerCase();if(void 0!==o[u]){var h=r.accessors[e.attributes[u]],d=C[h.componentType];l[c]=d,s[c]=!0===h.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){n.decodeDracoFile(e,(function(e){for(var r in e.attributes){var n=e.attributes[r],i=s[r];void 0!==i&&(n.normalized=i)}t(e)}),a,l)}))}))},p.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},f.prototype=Object.create(e.MeshStandardMaterial.prototype),f.prototype.constructor=f,f.prototype.copy=function(t){return e.MeshStandardMaterial.prototype.copy.call(this,t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},m.prototype=Object.create(e.Interpolant.prototype),m.prototype.constructor=m,m.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,i=e*n*3+n,o=0;o!==n;o++)t[o]=r[i+o];return t},m.prototype.beforeStart_=m.prototype.copySampleValue_,m.prototype.afterEnd_=m.prototype.copySampleValue_,m.prototype.interpolate_=function(e,t,r,n){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=2*a,l=3*a,u=n-t,c=(r-t)/u,h=c*c,d=h*c,p=e*l,f=p-l,v=-2*d+3*h,A=d-h,m=1-v,g=A-h+c,y=0;y!==a;y++){var b=o[f+y+a],x=o[f+y+s]*u,w=o[p+y+a],M=o[p+y]*u;i[y]=m*b+g*x+v*w+A*M}return i};var g=0,y=1,b=2,x=3,w=4,M=5,E=6,C={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},I={9728:e.NearestFilter,9729:e.LinearFilter,9984:e.NearestMipmapNearestFilter,9985:e.LinearMipmapNearestFilter,9986:e.NearestMipmapLinearFilter,9987:e.LinearMipmapLinearFilter},S={33071:e.ClampToEdgeWrapping,33648:e.MirroredRepeatWrapping,10497:e.RepeatWrapping},P={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},T={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},B={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},R={CUBICSPLINE:void 0,LINEAR:e.InterpolateLinear,STEP:e.InterpolateDiscrete},O="OPAQUE",L="MASK",D="BLEND",F={"image/png":e.RGBAFormat,"image/jpeg":e.RGBFormat};function k(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function Q(e,t,r){for(var n in r.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=r.extensions[n])}function N(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function V(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var r=0,n=t.weights.length;r<n;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){var i=t.extras.targetNames;if(e.morphTargetInfluences.length===i.length){e.morphTargetDictionary={};for(r=0,n=i.length;r<n;r++)e.morphTargetDictionary[i[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function U(e){for(var t="",r=Object.keys(e).sort(),n=0,i=r.length;n<i;n++)t+=r[n]+":"+e[r[n]]+";";return t}function z(t,n,i){this.json=t||{},this.extensions=n||{},this.options=i||{},this.cache=new r,this.associations=new Map,this.primitiveCache={},this.textureLoader=new e.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new e.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function q(t,r,n){var i=r.attributes,o=[];function a(e,r){return n.getDependency("accessor",e).then((function(e){t.setAttribute(r,e)}))}for(var s in i){var l=T[s]||s.toLowerCase();l in t.attributes||o.push(a(i[s],l))}if(void 0!==r.indices&&!t.index){var u=n.getDependency("accessor",r.indices).then((function(e){t.setIndex(e)}));o.push(u)}return N(t,r),function(t,r,n){var i=r.attributes,o=new e.Box3;if(void 0!==i.POSITION){var a=(p=n.json.accessors[i.POSITION]).min,s=p.max;if(void 0!==a&&void 0!==s){o.set(new e.Vector3(a[0],a[1],a[2]),new e.Vector3(s[0],s[1],s[2]));var l=r.targets;if(void 0!==l){for(var u=new e.Vector3,c=new e.Vector3,h=0,d=l.length;h<d;h++){var p,f=l[h];if(void 0!==f.POSITION)a=(p=n.json.accessors[f.POSITION]).min,s=p.max,void 0!==a&&void 0!==s?(c.setX(Math.max(Math.abs(a[0]),Math.abs(s[0]))),c.setY(Math.max(Math.abs(a[1]),Math.abs(s[1]))),c.setZ(Math.max(Math.abs(a[2]),Math.abs(s[2]))),u.max(c)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}o.expandByVector(u)}t.boundingBox=o;var v=new e.Sphere;o.getCenter(v.center),v.radius=o.min.distanceTo(o.max)/2,t.boundingSphere=v}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(t,r,n),Promise.all(o).then((function(){return void 0!==r.targets?function(e,t,r){for(var n=!1,i=!1,o=0,a=t.length;o<a&&(void 0!==(u=t[o]).POSITION&&(n=!0),void 0!==u.NORMAL&&(i=!0),!n||!i);o++);if(!n&&!i)return Promise.resolve(e);var s=[],l=[];for(o=0,a=t.length;o<a;o++){var u=t[o];if(n){var c=void 0!==u.POSITION?r.getDependency("accessor",u.POSITION):e.attributes.position;s.push(c)}i&&(c=void 0!==u.NORMAL?r.getDependency("accessor",u.NORMAL):e.attributes.normal,l.push(c))}return Promise.all([Promise.all(s),Promise.all(l)]).then((function(t){var r=t[0],o=t[1];return n&&(e.morphAttributes.position=r),i&&(e.morphAttributes.normal=o),e.morphTargetsRelative=!0,e}))}(t,r.targets,n):t}))}function H(t,r){var n=t.getIndex();if(null===n){var i=[],o=t.getAttribute("position");if(void 0===o)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(var a=0;a<o.count;a++)i.push(a);t.setIndex(i),n=t.getIndex()}var s=n.count-2,l=[];if(r===e.TriangleFanDrawMode)for(a=1;a<=s;a++)l.push(n.getX(0)),l.push(n.getX(a)),l.push(n.getX(a+1));else for(a=0;a<s;a++)a%2==0?(l.push(n.getX(a)),l.push(n.getX(a+1)),l.push(n.getX(a+2))):(l.push(n.getX(a+2)),l.push(n.getX(a+1)),l.push(n.getX(a)));l.length/3!==s&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var u=t.clone();return u.setIndex(l),u}return z.prototype.parse=function(e,t){var r=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then((function(t){var o={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:r,userData:{}};Q(i,o,n),N(o,n),e(o)})).catch(t)},z.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],n={},i={},o=0,a=t.length;o<a;o++)for(var s=t[o].joints,l=0,u=s.length;l<u;l++)e[s[l]].isBone=!0;for(var c=0,h=e.length;c<h;c++){var d=e[c];void 0!==d.mesh&&(void 0===n[d.mesh]&&(n[d.mesh]=i[d.mesh]=0),n[d.mesh]++,void 0!==d.skin&&(r[d.mesh].isSkinnedMesh=!0))}this.json.meshReferences=n,this.json.meshUses=i},z.prototype.getDependency=function(e,t){var r=e+":"+t,i=this.cache.get(r);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this.loadNode(t);break;case"mesh":i=this.loadMesh(t);break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this.loadBufferView(t);break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this.loadMaterial(t);break;case"texture":i=this.loadTexture(t);break;case"skin":i=this.loadSkin(t);break;case"animation":i=this.loadAnimation(t);break;case"camera":i=this.loadCamera(t);break;case"light":i=this.extensions[n.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(r,i)}return i},z.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var r=this,n=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(n.map((function(t,n){return r.getDependency(e,n)}))),this.cache.add(e,t)}return t},z.prototype.loadBuffer=function(e){var t=this.json.buffers[e],r=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[n.KHR_BINARY_GLTF].body);var i=this.options;return new Promise((function(e,n){r.load(k(t.uri,i.path),e,void 0,(function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))},z.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){var r=t.byteLength||0,n=t.byteOffset||0;return e.slice(n,n+r)}))},z.prototype.loadAccessor=function(t){var r=this,n=this.json,i=this.json.accessors[t];if(void 0===i.bufferView&&void 0===i.sparse)return Promise.resolve(null);var o=[];return void 0!==i.bufferView?o.push(this.getDependency("bufferView",i.bufferView)):o.push(null),void 0!==i.sparse&&(o.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(o).then((function(t){var o,a,s=t[0],l=P[i.type],u=C[i.componentType],c=u.BYTES_PER_ELEMENT,h=c*l,d=i.byteOffset||0,p=void 0!==i.bufferView?n.bufferViews[i.bufferView].byteStride:void 0,f=!0===i.normalized;if(p&&p!==h){var v=Math.floor(d/p),A="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+v+":"+i.count,m=r.cache.get(A);m||(o=new u(s,v*p,i.count*p/c),m=new e.InterleavedBuffer(o,p/c),r.cache.add(A,m)),a=new e.InterleavedBufferAttribute(m,l,d%p/c,f)}else o=null===s?new u(i.count*l):new u(s,d,i.count*l),a=new e.BufferAttribute(o,l,f);if(void 0!==i.sparse){var g=P.SCALAR,y=C[i.sparse.indices.componentType],b=i.sparse.indices.byteOffset||0,x=i.sparse.values.byteOffset||0,w=new y(t[1],b,i.sparse.count*g),M=new u(t[2],x,i.sparse.count*l);null!==s&&(a=new e.BufferAttribute(a.array.slice(),a.itemSize,a.normalized));for(var E=0,I=w.length;E<I;E++){var S=w[E];if(a.setX(S,M[E*l]),l>=2&&a.setY(S,M[E*l+1]),l>=3&&a.setZ(S,M[E*l+2]),l>=4&&a.setW(S,M[E*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a}))},z.prototype.loadTexture=function(t){var r,i=this,o=this.json,a=this.options,s=this.textureLoader,l=self.URL||self.webkitURL,u=o.textures[t],c=u.extensions||{},h=(r=c[n.MSFT_TEXTURE_DDS]?o.images[c[n.MSFT_TEXTURE_DDS].source]:o.images[u.source]).uri,d=!1;return void 0!==r.bufferView&&(h=i.getDependency("bufferView",r.bufferView).then((function(e){d=!0;var t=new Blob([e],{type:r.mimeType});return h=l.createObjectURL(t)}))),Promise.resolve(h).then((function(e){var t=a.manager.getHandler(e);return t||(t=c[n.MSFT_TEXTURE_DDS]?i.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(r,n){t.load(k(e,a.path),r,void 0,n)}))})).then((function(n){!0===d&&l.revokeObjectURL(h),n.flipY=!1,u.name&&(n.name=u.name),r.mimeType in F&&(n.format=F[r.mimeType]);var a=(o.samplers||{})[u.sampler]||{};return n.magFilter=I[a.magFilter]||e.LinearFilter,n.minFilter=I[a.minFilter]||e.LinearMipmapLinearFilter,n.wrapS=S[a.wrapS]||e.RepeatWrapping,n.wrapT=S[a.wrapT]||e.RepeatWrapping,i.associations.set(n,{type:"textures",index:t}),n}))},z.prototype.assignTexture=function(t,r,i){var o=this;return this.getDependency("texture",i.index).then((function(a){if(!a.isCompressedTexture)switch(r){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":a.format=e.RGBFormat}if(void 0===i.texCoord||0==i.texCoord||"aoMap"===r&&1==i.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+r+" not yet supported."),o.extensions[n.KHR_TEXTURE_TRANSFORM]){var s=void 0!==i.extensions?i.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;if(s){var l=this.associations.get(a);a=o.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(a,s),this.associations.set(a,l)}}t[r]=a}))},z.prototype.assignFinalMaterial=function(t){var r=t.geometry,n=t.material,i=void 0!==r.attributes.tangent,o=void 0!==r.attributes.color,a=void 0===r.attributes.normal,s=!0===t.isSkinnedMesh,l=Object.keys(r.morphAttributes).length>0,u=l&&void 0!==r.morphAttributes.normal;if(t.isPoints){var c="PointsMaterial:"+n.uuid,h=this.cache.get(c);h||(h=new e.PointsMaterial,e.Material.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(c,h)),n=h}else if(t.isLine){c="LineBasicMaterial:"+n.uuid;var d=this.cache.get(c);d||(d=new e.LineBasicMaterial,e.Material.prototype.copy.call(d,n),d.color.copy(n.color),this.cache.add(c,d)),n=d}if(i||o||a||s||l){c="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),s&&(c+="skinning:"),i&&(c+="vertex-tangents:"),o&&(c+="vertex-colors:"),a&&(c+="flat-shading:"),l&&(c+="morph-targets:"),u&&(c+="morph-normals:");var p=this.cache.get(c);p||(p=n.clone(),s&&(p.skinning=!0),i&&(p.vertexTangents=!0),o&&(p.vertexColors=!0),a&&(p.flatShading=!0),l&&(p.morphTargets=!0),u&&(p.morphNormals=!0),this.cache.add(c,p),this.associations.set(p,this.associations.get(n))),n=p}n.aoMap&&void 0===r.attributes.uv2&&void 0!==r.attributes.uv&&r.setAttribute("uv2",r.attributes.uv),n.normalScale&&!i&&(n.normalScale.y=-n.normalScale.y),n.clearcoatNormalScale&&!i&&(n.clearcoatNormalScale.y=-n.clearcoatNormalScale.y),t.material=n},z.prototype.loadMaterial=function(t){var r,i=this,o=this.json,a=this.extensions,s=o.materials[t],l={},u=s.extensions||{},c=[];if(u[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var h=a[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];r=h.getMaterialType(),c.push(h.extendParams(l,s,i))}else if(u[n.KHR_MATERIALS_UNLIT]){var d=a[n.KHR_MATERIALS_UNLIT];r=d.getMaterialType(),c.push(d.extendParams(l,s,i))}else{r=e.MeshStandardMaterial;var p=s.pbrMetallicRoughness||{};if(l.color=new e.Color(1,1,1),l.opacity=1,Array.isArray(p.baseColorFactor)){var v=p.baseColorFactor;l.color.fromArray(v),l.opacity=v[3]}void 0!==p.baseColorTexture&&c.push(i.assignTexture(l,"map",p.baseColorTexture)),l.metalness=void 0!==p.metallicFactor?p.metallicFactor:1,l.roughness=void 0!==p.roughnessFactor?p.roughnessFactor:1,void 0!==p.metallicRoughnessTexture&&(c.push(i.assignTexture(l,"metalnessMap",p.metallicRoughnessTexture)),c.push(i.assignTexture(l,"roughnessMap",p.metallicRoughnessTexture)))}!0===s.doubleSided&&(l.side=e.DoubleSide);var A=s.alphaMode||O;if(A===D?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,A===L&&(l.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&r!==e.MeshBasicMaterial&&(c.push(i.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new e.Vector2(1,1),void 0!==s.normalTexture.scale&&l.normalScale.set(s.normalTexture.scale,s.normalTexture.scale)),void 0!==s.occlusionTexture&&r!==e.MeshBasicMaterial&&(c.push(i.assignTexture(l,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(l.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&r!==e.MeshBasicMaterial&&(l.emissive=(new e.Color).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&r!==e.MeshBasicMaterial&&c.push(i.assignTexture(l,"emissiveMap",s.emissiveTexture)),u[n.KHR_MATERIALS_CLEARCOAT]){var m=a[n.KHR_MATERIALS_CLEARCOAT];r=m.getMaterialType(),c.push(m.extendParams(l,{extensions:u},i))}return Promise.all(c).then((function(){var o;return o=r===f?a[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):new r(l),s.name&&(o.name=s.name),o.map&&(o.map.encoding=e.sRGBEncoding),o.emissiveMap&&(o.emissiveMap.encoding=e.sRGBEncoding),N(o,s),i.associations.set(o,{type:"materials",index:t}),s.extensions&&Q(a,o,s),o}))},z.prototype.loadGeometries=function(t){var r=this,i=this.extensions,o=this.primitiveCache;function a(e){return i[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,r).then((function(t){return q(t,e,r)}))}for(var s,l,u=[],c=0,h=t.length;c<h;c++){var d,p=t[c],f=(l=void 0,(l=(s=p).extensions&&s.extensions[n.KHR_DRACO_MESH_COMPRESSION])?"draco:"+l.bufferView+":"+l.indices+":"+U(l.attributes):s.indices+":"+U(s.attributes)+":"+s.mode),v=o[f];if(v)u.push(v.promise);else d=p.extensions&&p.extensions[n.KHR_DRACO_MESH_COMPRESSION]?a(p):q(new e.BufferGeometry,p,r),o[f]={primitive:p,promise:d},u.push(d)}return Promise.all(u)},z.prototype.loadMesh=function(t){for(var r,n=this,i=this.json.meshes[t],o=i.primitives,a=[],s=0,l=o.length;s<l;s++){var u=void 0===o[s].material?(void 0===(r=this.cache).DefaultMaterial&&(r.DefaultMaterial=new e.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:e.FrontSide})),r.DefaultMaterial):this.getDependency("material",o[s].material);a.push(u)}return a.push(n.loadGeometries(o)),Promise.all(a).then((function(r){for(var a=r.slice(0,r.length-1),s=r[r.length-1],l=[],u=0,c=s.length;u<c;u++){var h,d=s[u],p=o[u],f=a[u];if(p.mode===w||p.mode===M||p.mode===E||void 0===p.mode)!0!==(h=!0===i.isSkinnedMesh?new e.SkinnedMesh(d,f):new e.Mesh(d,f)).isSkinnedMesh||h.geometry.attributes.skinWeight.normalized||h.normalizeSkinWeights(),p.mode===M?h.geometry=H(h.geometry,e.TriangleStripDrawMode):p.mode===E&&(h.geometry=H(h.geometry,e.TriangleFanDrawMode));else if(p.mode===y)h=new e.LineSegments(d,f);else if(p.mode===x)h=new e.Line(d,f);else if(p.mode===b)h=new e.LineLoop(d,f);else{if(p.mode!==g)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+p.mode);h=new e.Points(d,f)}Object.keys(h.geometry.morphAttributes).length>0&&V(h,i),h.name=i.name||"mesh_"+t,s.length>1&&(h.name+="_"+u),N(h,i),n.assignFinalMaterial(h),l.push(h)}if(1===l.length)return l[0];var v=new e.Group;for(u=0,c=l.length;u<c;u++)v.add(l[u]);return v}))},z.prototype.loadCamera=function(t){var r,n=this.json.cameras[t],i=n[n.type];if(i)return"perspective"===n.type?r=new e.PerspectiveCamera(e.MathUtils.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):"orthographic"===n.type&&(r=new e.OrthographicCamera(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(r.name=n.name),N(r,n),Promise.resolve(r);console.warn("THREE.GLTFLoader: Missing camera parameters.")},z.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},z.prototype.loadAnimation=function(t){for(var r=this.json.animations[t],n=[],i=[],o=[],a=[],s=[],l=0,u=r.channels.length;l<u;l++){var c=r.channels[l],h=r.samplers[c.sampler],d=c.target,p=void 0!==d.node?d.node:d.id,f=void 0!==r.parameters?r.parameters[h.input]:h.input,v=void 0!==r.parameters?r.parameters[h.output]:h.output;n.push(this.getDependency("node",p)),i.push(this.getDependency("accessor",f)),o.push(this.getDependency("accessor",v)),a.push(h),s.push(d)}return Promise.all([Promise.all(n),Promise.all(i),Promise.all(o),Promise.all(a),Promise.all(s)]).then((function(n){for(var i=n[0],o=n[1],a=n[2],s=n[3],l=n[4],u=[],c=0,h=i.length;c<h;c++){var d=i[c],p=o[c],f=a[c],v=s[c],A=l[c];if(void 0!==d){var g;switch(d.updateMatrix(),d.matrixAutoUpdate=!0,B[A.path]){case B.weights:g=e.NumberKeyframeTrack;break;case B.rotation:g=e.QuaternionKeyframeTrack;break;default:g=e.VectorKeyframeTrack}var y=d.name?d.name:d.uuid,b=void 0!==v.interpolation?R[v.interpolation]:e.InterpolateLinear,x=[];B[A.path]===B.weights?d.traverse((function(e){!0===e.isMesh&&e.morphTargetInfluences&&x.push(e.name?e.name:e.uuid)})):x.push(y);var w=f.array;if(f.normalized){var M;if(w.constructor===Int8Array)M=1/127;else if(w.constructor===Uint8Array)M=1/255;else if(w.constructor==Int16Array)M=1/32767;else{if(w.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");M=1/65535}for(var E=new Float32Array(w.length),C=0,I=w.length;C<I;C++)E[C]=w[C]*M;w=E}for(C=0,I=x.length;C<I;C++){var S=new g(x[C]+"."+B[A.path],p.array,w,b);"CUBICSPLINE"===v.interpolation&&(S.createInterpolant=function(e){return new m(this.times,this.values,this.getValueSize()/3,e)},S.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),u.push(S)}}}var P=r.name?r.name:"animation_"+t;return new e.AnimationClip(P,void 0,u)}))},z.prototype.loadNode=function(t){var r,i=this.json,o=this.extensions,a=this,s=i.meshReferences,l=i.meshUses,u=i.nodes[t];return(r=[],void 0!==u.mesh&&r.push(a.getDependency("mesh",u.mesh).then((function(e){var t;if(s[u.mesh]>1){var r=l[u.mesh]++;(t=e.clone()).name+="_instance_"+r}else t=e;return void 0!==u.weights&&t.traverse((function(e){if(e.isMesh)for(var t=0,r=u.weights.length;t<r;t++)e.morphTargetInfluences[t]=u.weights[t]})),t}))),void 0!==u.camera&&r.push(a.getDependency("camera",u.camera)),u.extensions&&u.extensions[n.KHR_LIGHTS_PUNCTUAL]&&void 0!==u.extensions[n.KHR_LIGHTS_PUNCTUAL].light&&r.push(a.getDependency("light",u.extensions[n.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(r)).then((function(r){var n;if((n=!0===u.isBone?new e.Bone:r.length>1?new e.Group:1===r.length?r[0]:new e.Object3D)!==r[0])for(var i=0,s=r.length;i<s;i++)n.add(r[i]);if(u.name&&(n.userData.name=u.name,n.name=e.PropertyBinding.sanitizeNodeName(u.name)),N(n,u),u.extensions&&Q(o,n,u),void 0!==u.matrix){var l=new e.Matrix4;l.fromArray(u.matrix),n.applyMatrix4(l)}else void 0!==u.translation&&n.position.fromArray(u.translation),void 0!==u.rotation&&n.quaternion.fromArray(u.rotation),void 0!==u.scale&&n.scale.fromArray(u.scale);return a.associations.set(n,{type:"nodes",index:t}),n}))},z.prototype.loadScene=function(){function t(r,n,i,o){var a=i.nodes[r];return o.getDependency("node",r).then((function(t){return void 0===a.skin?t:o.getDependency("skin",a.skin).then((function(e){for(var t=[],n=0,i=(r=e).joints.length;n<i;n++)t.push(o.getDependency("node",r.joints[n]));return Promise.all(t)})).then((function(n){return t.traverse((function(t){if(t.isMesh){for(var i=[],o=[],a=0,s=n.length;a<s;a++){var l=n[a];if(l){i.push(l);var u=new e.Matrix4;void 0!==r.inverseBindMatrices&&u.fromArray(r.inverseBindMatrices.array,16*a),o.push(u)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',r.joints[a])}t.bind(new e.Skeleton(i,o),t.matrixWorld)}})),t}));var r})).then((function(e){n.add(e);var r=[];if(a.children)for(var s=a.children,l=0,u=s.length;l<u;l++){var c=s[l];r.push(t(c,e,i,o))}return Promise.all(r)}))}return function(r){var n=this.json,i=this.extensions,o=this.json.scenes[r],a=new e.Group;o.name&&(a.name=o.name),N(a,o),o.extensions&&Q(i,a,o);for(var s=o.nodes||[],l=[],u=0,c=s.length;u<c;u++)l.push(t(s[u],a,n,this));return Promise.all(l).then((function(){return a}))}}(),t}(),mn=function(t){e.CompressedTextureLoader.call(this,t)};mn.prototype=Object.assign(Object.create(e.CompressedTextureLoader.prototype),{constructor:mn,parse:function(t,r){var n={mipmaps:[],width:0,height:0,format:null,mipmapCount:1};function i(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function o(e,t,r,n){for(var i=r*n*4,o=new Uint8Array(e,t,i),a=new Uint8Array(i),s=0,l=0,u=0;u<n;u++)for(var c=0;c<r;c++){var h=o[l],d=o[++l],p=o[++l],f=o[++l];l++,a[s]=p,a[++s]=d,a[++s]=h,a[++s]=f,s++}return a}var a,s=i("DXT1"),l=i("DXT3"),u=i("DXT5"),c=i("ETC1"),h=new Int32Array(t,0,31);if(542327876!==h[0])return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),n;if(4&!h[20])return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),n;var d=h[21],p=!1;switch(d){case s:a=8,n.format=e.RGB_S3TC_DXT1_Format;break;case l:a=16,n.format=e.RGBA_S3TC_DXT3_Format;break;case u:a=16,n.format=e.RGBA_S3TC_DXT5_Format;break;case c:a=8,n.format=e.RGB_ETC1_Format;break;default:if(!(32===h[22]&&16711680&h[23]&&65280&h[24]&&255&h[25]&&4278190080&h[26]))return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(d)),n;p=!0,a=64,n.format=e.RGBAFormat}n.mipmapCount=1,131072&h[2]&&!1!==r&&(n.mipmapCount=Math.max(1,h[7]));var f=h[28];if(n.isCubemap=!!(512&f),n.isCubemap&&(!(1024&f)||!(2048&f)||!(4096&f)||!(8192&f)||!(16384&f)||!(32768&f)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),n;n.width=h[4],n.height=h[3];for(var v=h[1]+4,A=n.isCubemap?6:1,m=0;m<A;m++)for(var g=n.width,y=n.height,b=0;b<n.mipmapCount;b++){if(p)var x=(w=o(t,v,g,y)).length;else{x=Math.max(4,g)/4*Math.max(4,y)/4*a;var w=new Uint8Array(t,v,x)}var M={data:w,width:g,height:y};n.mipmaps.push(M),v+=x,g=Math.max(g>>1,1),y=Math.max(y>>1,1)}return n}});var gn=(new n.Matrix4).fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);function yn(e,t){var r={uri:e,gltfUpAxis:t.upAxis};return Promise.resolve().then((function(){return Oe(e,{responseType:"arraybuffer",allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe}).then((function(e){return e.body}))})).then((function(e){return Promise.resolve(0).then((function(t){return nn(r,e,t)})).then((function(t){return fn(r,e,t)})).then((function(t){return vn(r,e,t)}))})).then((function(){var e=new n.Matrix4;"Z"!==t.upAxis&&e.premultiply(gn);var i=(new n.Matrix4).setPosition(r.rtcCenter);return e.premultiply(i),function(e,t){function r(e){if(e.isMesh)return function(e){var t=new $e;t.geometry=e.geometry,t.geometry.computeVertexNormals(),t.geometry.computeBoundingBox(),t.geometry.computeBoundingSphere(),t.geometry.addGroup(0,e.geometry.index.count,0);var r=new Qt;r.uniforms.map.value=e.material.map,r.uniforms.map.value&&(r.uniforms.map.value.magFilter=n.LinearFilter,r.uniforms.map.value.minFilter=n.LinearFilter,r.uniforms.map.value.generateMipmaps=!1);return r.uniforms.exposure.value=3.3,r.opacity=1,e.material.dispose(),e.geometry=null,e.material=null,t.material=[r],t.position.copy(e.position),t.quaternion.copy(e.quaternion),t.scale.copy(e.scale),t.matrix.compose(t.position,t.quaternion,t.scale),t.matrixAutoUpdate=!1,t.renderOrder=-1e3,t.frustumCulled=!1,t}(e);for(var t=function(e){var t=new Ze;return t.renderOrder=-4,t.position.copy(e.position),t.quaternion.copy(e.quaternion),t.scale.copy(e.scale),t.matrixAutoUpdate=!1,t.matrix.compose(t.position,t.quaternion,t.scale),t}(e),i=0;i<e.children.length;i++){var o=r(e.children[i]);t.add(o)}return t}return new Promise((function(n,i){var o=t.fileUrl.slice(0,t.fileUrl.lastIndexOf("/")+1),a=function(e){var i=e.scene,o=new Ze;o.renderOrder=-4;var a=r(i);o.add(a),o.name=t.fileUrl,n(o)},s=function(e){i(new Error("error parsing gltf ".concat(t.fileUrl,": ").concat(e.message)))},l=new An,u=new mn(l.manager);l.setDRACOLoader(Kt),l.setDDSLoader(u),l.parse(e,o,a,s)}))}(r.gltfArrayBuffer,{fileUrl:r.uri}).then((function(t){return t.applyMatrix4(e),{type:"b3dm",uri:r.uri,byteLength:r.byteLength,object:t}}))}))}var bn=new n.Vector3,xn=new n.Vector3,wn=new n.Vector3,Mn=new n.Vector3;function En(e,t,r){var n=new cn(e.featureTableJson,e.featureTableBinary);return Promise.resolve().then((function(){var e=n.getExtension("3DTILES_draco_point_compression");return e?function(e,t){return se(this,void 0,void 0,(function(){var r,n,i,o,a,s;return le(this,(function(l){if(r=e.properties||{},n=e.byteOffset,i=e.byteLength,!r||!Number.isFinite(n)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");return o=t.buffer.slice(n,n+i),a=e.properties,s={POSITION:"Float32Array",NORMAL:"Float32Array",RGB:"Uint8Array",RGBA:"Uint8Array"},[2,Kt.decodeGeometry(o.buffer,{attributeIDs:a,attributeTypes:s,useUniqueIDs:!0}).then((function(e){var t=e.getAttribute("POSITION"),r=e.getAttribute("RGB")||e.getAttribute("RGBA"),n=e.getAttribute("NORMAL");return{position:t?Cn(tn.FLOAT,t.array,t.itemSize):null,color:r?Cn(tn.UNSIGNED_BYTE,r.array,r.itemSize):null,normal:n?Cn(tn.FLOAT,n.array,n.itemSize):null}}))]}))}))}(e,n):{position:In(n),color:Sn(n),normal:Tn(n)}})).then((function(t){return e.attributes=t,r}))}function Cn(e,t,r){return{type:e,array:t,size:r}}function In(e){if(e.hasProperty("POSITION")){var t=e.getPropertyArray("POSITION",tn.FLOAT,3);return Cn(tn.FLOAT,t,3)}if(e.hasProperty("POSITION_QUANTIZED")){var r=e.getPropertyArray("POSITION_QUANTIZED",tn.UNSIGNED_SHORT,3),n=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",tn.FLOAT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",tn.FLOAT,3);if(!n||!i)throw new Error("QUANTIZED_VOLUME_SCALE or QUANTIZED_VOLUME_OFFSET never found.");var o=new Float32Array(r.length),a=r.length/3;xn.fromArray(n),wn.fromArray(i);for(var s=0;s<a;s++)bn.fromArray(r,3*s).divideScalar(65535).multiply(xn).add(wn).toArray(o,3*s);return Cn(tn.FLOAT,o,3)}return null}function Sn(e){if(e.hasProperty("RGBA")){var t=e.getPropertyArray("RGBA",tn.UNSIGNED_BYTE,4);return Cn(tn.UNSIGNED_BYTE,t,4)}if(e.hasProperty("RGB")){t=e.getPropertyArray("RGB",tn.UNSIGNED_BYTE,3);return Cn(tn.UNSIGNED_BYTE,t,3)}if(e.hasProperty("RGB565")){for(var r=(t=e.getPropertyArray("RGB565",tn.UNSIGNED_SHORT,1)).length,n=new Uint8Array(3*r),i=0;i<r;i++){var o=Pn(t[i]);n[3*i]=o[0],n[3*i+1]=o[1],n[3*i+2]=o[2]}return Cn(tn.UNSIGNED_BYTE,n,3)}return null}function Pn(e,t){void 0===t&&(t=[0,0,0]);var r=e>>11&31,n=e>>5&63,i=31&e;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}function Tn(e){if(e.hasProperty("NORMAL")){var t=e.getPropertyArray("NORMAL",tn.FLOAT,3);return Cn(tn.FLOAT,t,3)}if(e.hasProperty("NORMAL_OCT16P")){for(var r=(t=e.getPropertyArray("NORMAL_OCT16P",tn.UNSIGNED_BYTE,2)).length/2,n=new Float32Array(3*r),i=0;i<r;i++)Bn(t[2*i],t[2*i+1],255,Mn),Mn.toArray(n,3*i);return Cn(tn.FLOAT,n,3)}return null}function Bn(e,t,r,n){if(e<0||e>r||t<0||t>r)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(r));if(n.x=On(e,0,r),n.y=On(t,0,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*Rn(i),n.y=(1-Math.abs(i))*Rn(n.y)}return n.normalize()}function Rn(e){return e<0?-1:1}function On(e,t,r){return e<t&&(e=t),e>r&&(e=r),e/r*2-1}function Ln(e,t){var r={uri:e};return Promise.resolve().then((function(){return Oe(e,{responseType:"arraybuffer",allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe}).then((function(e){return e.body}))})).then((function(e){return Promise.resolve(0).then((function(t){return nn(r,e,t)})).then((function(t){return fn(r,e,t)})).then((function(e){return En(r,0,e)}))})).then((function(){return function(e){var t=new n.BufferGeometry,r=Dn;e.position&&t.setAttribute("position",new n.BufferAttribute(e.position.array,e.position.size,!1));e.color&&t.setAttribute("color",new n.BufferAttribute(e.color.array,e.color.size,!0));e.normal&&(t.setAttribute("normal",new n.BufferAttribute(e.normal.array,e.normal.size,!1)),r=Fn);t.computeBoundingBox(),t.computeBoundingSphere();var i=new tt(t,r);return i.matrix.compose(i.position,i.quaternion,i.scale),i.matrixAutoUpdate=!1,i.frustumCulled=!1,i.renderOrder=-1e3,Promise.resolve(i)}(r.attributes).then((function(e){var t=new n.Matrix4,i=(new n.Matrix4).setPosition(r.rtcCenter);return t.premultiply(i),e.applyMatrix4(t),{type:"pnts",uri:r.uri,byteLength:r.byteLength,object:e}}))}))}var Dn=new Vr;Dn.dispose=function(){};var Fn=new Vr;function kn(){var e={OutWindow:function(){this._windowSize=0}};return e.OutWindow.prototype.create=function(e){this._buffer&&this._windowSize===e||(this._buffer=[]),this._windowSize=e,this._pos=0,this._streamPos=0},e.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}},e.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},e.OutWindow.prototype.setStream=function(e){this.releaseStream(),this._stream=e},e.OutWindow.prototype.init=function(e){e||(this._streamPos=0,this._pos=0)},e.OutWindow.prototype.copyBlock=function(e,t){var r=this._pos-e-1;for(r<0&&(r+=this._windowSize);t--;)r>=this._windowSize&&(r=0),this._buffer[this._pos++]=this._buffer[r++],this._pos>=this._windowSize&&this.flush()},e.OutWindow.prototype.putByte=function(e){this._buffer[this._pos++]=e,this._pos>=this._windowSize&&this.flush()},e.OutWindow.prototype.getByte=function(e){var t=this._pos-e-1;return t<0&&(t+=this._windowSize),this._buffer[t]},e.RangeDecoder=function(){},e.RangeDecoder.prototype.setStream=function(e){this._stream=e},e.RangeDecoder.prototype.releaseStream=function(){this._stream=null},e.RangeDecoder.prototype.init=function(){var e=5;for(this._code=0,this._range=-1;e--;)this._code=this._code<<8|this._stream.readByte()},e.RangeDecoder.prototype.decodeDirectBits=function(e){for(var t,r=0,n=e;n--;)this._range>>>=1,t=this._code-this._range>>>31,this._code-=this._range&t-1,r=r<<1|1-t,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return r},e.RangeDecoder.prototype.decodeBit=function(e,t){var r=e[t],n=(this._range>>>11)*r;return(2147483648^this._code)<(2147483648^n)?(this._range=n,e[t]+=2048-r>>>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]-=r>>>5,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},e.initBitModels=function(e,t){for(;t--;)e[t]=1024},e.BitTreeDecoder=function(e){this._models=[],this._numBitLevels=e},e.BitTreeDecoder.prototype.init=function(){e.initBitModels(this._models,1<<this._numBitLevels)},e.BitTreeDecoder.prototype.decode=function(e){for(var t=1,r=this._numBitLevels;r--;)t=t<<1|e.decodeBit(this._models,t);return t-(1<<this._numBitLevels)},e.BitTreeDecoder.prototype.reverseDecode=function(e){for(var t,r=1,n=0,i=0;i<this._numBitLevels;++i)r=r<<1|(t=e.decodeBit(this._models,r)),n|=t<<i;return n},e.reverseDecode2=function(e,t,r,n){for(var i,o=1,a=0,s=0;s<n;++s)o=o<<1|(i=r.decodeBit(e,t+o)),a|=i<<s;return a},e.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new e.BitTreeDecoder(8),this._numPosStates=0},e.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new e.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new e.BitTreeDecoder(3)},e.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(e.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},e.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)},e.Decoder2=function(){this._decoders=[]},e.Decoder2.prototype.init=function(){e.initBitModels(this._decoders,768)},e.Decoder2.prototype.decodeNormal=function(e){var t=1;do{t=t<<1|e.decodeBit(this._decoders,t)}while(t<256);return 255&t},e.Decoder2.prototype.decodeWithMatchByte=function(e,t){var r,n,i=1;do{if(r=t>>7&1,t<<=1,i=i<<1|(n=e.decodeBit(this._decoders,(1+r<<8)+i)),r!==n){for(;i<256;)i=i<<1|e.decodeBit(this._decoders,i);break}}while(i<256);return 255&i},e.LiteralDecoder=function(){},e.LiteralDecoder.prototype.create=function(t,r){var n;if(!this._coders||this._numPrevBits!==r||this._numPosBits!==t)for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=r,this._coders=[],n=1<<this._numPrevBits+this._numPosBits;n--;)this._coders[n]=new e.Decoder2},e.LiteralDecoder.prototype.init=function(){for(var e=1<<this._numPrevBits+this._numPosBits;e--;)this._coders[e].init()},e.LiteralDecoder.prototype.getDecoder=function(e,t){return this._coders[((e&this._posMask)<<this._numPrevBits)+((255&t)>>>8-this._numPrevBits)]},e.Decoder=function(){this._outWindow=new e.OutWindow,this._rangeDecoder=new e.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new e.BitTreeDecoder(4),this._lenDecoder=new e.LenDecoder,this._repLenDecoder=new e.LenDecoder,this._literalDecoder=new e.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new e.BitTreeDecoder(6),this._posSlotDecoder[1]=new e.BitTreeDecoder(6),this._posSlotDecoder[2]=new e.BitTreeDecoder(6),this._posSlotDecoder[3]=new e.BitTreeDecoder(6)},e.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)},e.Decoder.prototype.setLcLpPb=function(e,t,r){var n=1<<r;return!(e>8||t>4||r>4)&&(this._literalDecoder.create(t,e),this._lenDecoder.create(n),this._repLenDecoder.create(n),this._posStateMask=n-1,!0)},e.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),e.initBitModels(this._isMatchDecoders,192),e.initBitModels(this._isRep0LongDecoders,192),e.initBitModels(this._isRepDecoders,12),e.initBitModels(this._isRepG0Decoders,12),e.initBitModels(this._isRepG1Decoders,12),e.initBitModels(this._isRepG2Decoders,12),e.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},e.Decoder.prototype.decode=function(t,r,n){var i,o,a,s,l,u,c=0,h=0,d=0,p=0,f=0,v=0,A=0;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(r),this.init();n<0||v<n;)if(i=v&this._posStateMask,0===this._rangeDecoder.decodeBit(this._isMatchDecoders,(c<<4)+i))o=this._literalDecoder.getDecoder(v++,A),A=c>=7?o.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(h)):o.decodeNormal(this._rangeDecoder),this._outWindow.putByte(A),c=c<4?0:c-(c<10?3:6);else{if(1===this._rangeDecoder.decodeBit(this._isRepDecoders,c))a=0,0===this._rangeDecoder.decodeBit(this._isRepG0Decoders,c)?0===this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(c<<4)+i)&&(c=c<7?9:11,a=1):(0===this._rangeDecoder.decodeBit(this._isRepG1Decoders,c)?s=d:(0===this._rangeDecoder.decodeBit(this._isRepG2Decoders,c)?s=p:(s=f,f=p),p=d),d=h,h=s),0===a&&(a=2+this._repLenDecoder.decode(this._rangeDecoder,i),c=c<7?8:11);else if(f=p,p=d,d=h,a=2+this._lenDecoder.decode(this._rangeDecoder,i),c=c<7?7:10,(l=this._posSlotDecoder[a<=5?a-2:3].decode(this._rangeDecoder))>=4){if(h=(2|1&l)<<(u=(l>>1)-1),l<14)h+=e.reverseDecode2(this._posDecoders,h-l-1,this._rangeDecoder,u);else if(h+=this._rangeDecoder.decodeDirectBits(u-4)<<4,(h+=this._posAlignDecoder.reverseDecode(this._rangeDecoder))<0){if(-1===h)break;return!1}}else h=l;if(h>=v||h>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(h,a),v+=a,A=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},e.Decoder.prototype.setDecoderProperties=function(e){var t,r,n,i,o;return!(e.size<5)&&(r=(t=e.readByte())%9,n=(t=~~(t/9))%5,i=~~(t/5),!!this.setLcLpPb(r,n,i)&&(o=e.readByte(),o|=e.readByte()<<8,o|=e.readByte()<<16,o+=16777216*e.readByte(),this.setDictionarySize(o)))},e.decompress=function(t,r,n,i){var o=new e.Decoder;if(!o.setDecoderProperties(t))throw"Incorrect stream properties";if(!o.decode(r,n,i))throw"Error in data stream";return!0},e.decompressFile=function(t,r){var n,i=new e.Decoder;if(!i.setDecoderProperties(t))throw"Incorrect stream properties";if(n=t.readByte(),n|=t.readByte()<<8,n|=t.readByte()<<16,n+=16777216*t.readByte(),t.readByte(),t.readByte(),t.readByte(),t.readByte(),!i.decode(t,r,n))throw"Error in data stream";return!0},e}Fn.defines.USE_POINT_NORMAL=!0,Fn.dispose=function(){};var Qn=kn();var Nn="\nvar decodeLZMA = (function() {\n var LZMA = (".concat(kn.toString(),")();\n return function(data, callback) {\n return (").concat(function(e,t,r){try{var n={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},i=n.data.length,o={data:[],offset:0,writeByte:function(e){var t=Math.floor(this.offset/i);this.data[t]||(this.data[t]=new Uint8Array(i)),this.data[t][this.offset%i]=e,this.offset++}};e.decompressFile(n,o);for(var a=new Uint8Array(o.offset),s=0;s<o.offset;s++)a[s]=o.data[Math.floor(s/i)][s%i];r(null,a)}catch(e){r(e)}}.toString(),")(LZMA, data, callback);\n }\n})();\n\nvar decodeLZMAWithWASM = (function() {\n var LZMA_WASM = (").concat(function(){return function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),n=0;n<64;n++)r[t.charCodeAt(n)]=n;var i,o,a,s,l,u=.75*e.length,c=e.length,h=0;"="===e[e.length-1]&&(u--,"="===e[e.length-2]&&u--);var d=new ArrayBuffer(u),p=new Uint8Array(d);for(i=0;i<c;i+=4)o=r[e.charCodeAt(i)],a=r[e.charCodeAt(i+1)],s=r[e.charCodeAt(i+2)],l=r[e.charCodeAt(i+3)],p[h++]=o<<2|a>>4,p[h++]=(15&a)<<4|s>>2,p[h++]=(3&s)<<6|63&l;return d}("AGFzbQEAAAABSg1gAABgAX8Bf2ACf38Bf2AEf39/fwBgA39/fwBgAX8AYAJ/fwBgA39/fwF/YAR/f39/AX9gAn9/AGABfwF/YAABf2AEf39/fwF/AhsCA2VudgVhYm9ydAADA2VudgZtZW1vcnkCAAEDJiUBAQkKAgoKCwsLCwsAAgoBAgQKAQYFCAoFBQQEBwgCBwwCAQAABAQBcAABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwc9BgZtZW1vcnkCAAV0YWJsZQEABXJlc2V0AA0KbmV3VThBcnJheQAQCnVucGFja1NpemUAFAZkZWNvZGUAIwgBJAkHAQBBAAsBJQqAViVoAQN/IABBgICAgARLBEAACyMBIgEgAEEBIABBAUsbakEHakF4cSICPwAiA0EQdEsEQCADIAIgAWtB//8DakGAgHxxQRB2IgAgAyAAShtAAEEASARAIABAAEEASARAAAsLCyACJAEgAQsbAQF/QQFBICAAQQdqZ2t0EAEiASAANgIAIAELkQMBAX8gAUUEQA8LIABBADoAACAAIAFqQQFrQQA6AAAgAUECTQRADwsgAEEBakEAOgAAIABBAmpBADoAACAAIAFqIgJBAmtBADoAACACQQNrQQA6AAAgAUEGTQRADwsgAEEDakEAOgAAIAAgAWpBBGtBADoAACABQQhNBEAPC0EAIABrQQNxIgIgAGoiAEEANgIAIAEgAmtBfHEiASAAakEEa0EANgIAIAFBCE0EQA8LIABBBGpBADYCACAAQQhqQQA2AgAgACABaiICQQxrQQA2AgAgAkEIa0EANgIAIAFBGE0EQA8LIABBDGpBADYCACAAQRBqQQA2AgAgAEEUakEANgIAIABBGGpBADYCACAAIAFqIgJBHGtBADYCACACQRhrQQA2AgAgAkEUa0EANgIAIAJBEGtBADYCACAAQQRxQRhqIgIgAGohACABIAJrIQEDQCABQSBPBEAgAEIANwMAIABBCGpCADcDACAAQRBqQgA3AwAgAEEYakIANwMAIAFBIGshASAAQSBqIQAMAQsLC1EBA38gAEH+////AEsEQEEAQSBBLUEnEAAACyAAQQJ0IgMQAiECQQgQASIBQQA2AgAgAUEANgIEIAEgAjYCACABIAA2AgQgAkEIaiADEAMgAQtmAQF/IAFB/P///wFLBEBBAEHAAEEXQSIQAAALIAFBAXQiARACIgJBCGogARADIABFBEBBDBABIQALIABBADYCACAAQQA2AgQgAEEANgIIIAAgAjYCACAAQQA2AgQgACABNgIIIAALCgBBDBABIAAQBQsuAQF/QQgQASIBQQA2AgAgAUEANgIEIAEgADYCBCABQQEgASgCBHQQBjYCACABC6EBAQR/QRAQASIBQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgxBEBAEIQIDQCAAQRBIBEBBAxAHIQMgAigCACAAQQJ0aiADNgIIIABBAWohAAwBCwsgASACNgIEQRAQBCECQQAhAANAIABBEEgEQEEDEAchAyACKAIAIABBAnRqIAM2AgggAEEBaiEADAELCyABIAI2AgggAUEIEAc2AgwgAQs0AQF/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhA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ADIgAgBCAAIARIGwshAwNAIAIgA05FBEAgAkEBdCABaiAHaiAFOwEIIAJBAWohAgwBCwsgBgssAQF/AkACQAJAIwRBAWsOAwEBAgALAAtB/////wchAQsgAEGACEEAIAEQFwvBAQECfyAAQQIQBjYCACAAKAIAIgEoAgAgASgCBGpBgAg7AQggACgCACICKAIAIQEgAigCBCABQQJqakGACDsBCCAAKAIMKAIAQQEkBBAYGkEAIQIDQCACQRBIBEAgAiAAKAIEKAIAIgEoAgBBAnZJBH8gAkECdCABaigCCAUACygCAEEBJAQQGBogAiAAKAIIKAIAIgEoAgBBAnZJBH8gAkECdCABaigCCAUACygCAEEBJAQQGBogAkEBaiECDAELCwuHAgEFfyAAIQJBgAYgACgCDCAALQAUanQhAQNAIAMgAUgEQCACKAIgIgQoAgAhBSAEKAIEIANBAXQgBWpqQYAIOwEIIANBAWohAwwBCwsgAiEBQQAhAgNAIAJBBEkEQCACIAEoAiQoAgAiAygCAEECdkkEfyACQQJ0IANqKAIIBQALKAIAQQEkBBAYGiACQQFqIQIMAQsLIAEoAigoAgBBASQEEBgaIAEoAixBASQEEBgaIAAoAjBBASQEEBgaIAAoAjRBASQEEBgaIAAoAjhBASQEEBgaIAAoAjxBASQEEBgaIAAoAkBBASQEEBgaIAAoAkRBASQEEBgaIAAoAkgQGSAAKAJMEBkLyAwBA38DQCABQQNxIAIgAhsEQCAAIgRBAWohACABIgNBAWohASAEIAMtAAA6AAAgAkEBayECDAELCyAAQQNxRQRAA0AgAkEQTwRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAEEIaiABQQhqKAIANgIAIABBDGogAUEMaigCADYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsgAkEIcQRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAUEIaiEBIABBCGohAAsgAkEEcQRAIAAgASgCADYCACABQQRqIQEgAEEEaiEACyACQQJxBEAgACABLwEAOwEAIAFBAmohASAAQQJqIQALIAJBAXEEQCAAIAEtAAA6A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kAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=")}.toString(),")();\n return function(data, callback) {\n return (").concat(function(e,t,r){try{var n=new WebAssembly.Memory({initial:16}),i=new WebAssembly.Module(e),o=new WebAssembly.Instance(i,{env:{memory:n,abort:function(){r(new Error("webAssembly abort"))}}}).exports,a=o.newU8Array(t.length);new Uint8Array(n.buffer,a+24,t.length).set(t);var s=o.decode(a),l=new Uint32Array(n.buffer,s,4),u=l[0],c=l[2],h=l[3];u?r(null,new Uint8Array(n.buffer,h+24,c).slice(0,c)):r(new Error("lzma deocder error"))}catch(e){r(e)}}.toString(),')(LZMA_WASM, data, callback);\n }\n})();\n\nself.onmessage = function(event) {\n var packet = event.data;\n if (!packet.id) {\n postMessage({ id: packet.id, error: "No incoming id." });\n return;\n }\n if (!packet.data) {\n postMessage({ id: packet.id, error: "No input data." });\n return;\n }\n if (packet.type == "decompress") {\n if (packet.data.constructor !== Uint8Array) {\n postMessage({ id: packet.id, error: "Input data is not Uint8Array." });\n }\n const callback = function(error, result) {\n if (error) {\n postMessage({ id: packet.id, error: error.toString() });\n } else {\n postMessage({ id: packet.id, result: result, error: null }, [ result.buffer ]);\n }\n }\n if (typeof WebAssembly !== "undefined" && WebAssembly.instantiate) {\n decodeLZMAWithWASM(packet.data, callback);\n } else {\n decodeLZMA(packet.data, callback);\n }\n return;\n }\n postMessage({ id: packet.id, error: "type never matched." });\n};\n'),Vn="undefined"!=typeof Worker&&"undefined"!=typeof Blob,Un="";if(Vn)try{var zn=new Blob([Nn],{type:"text/javascript"});Un=URL.createObjectURL(zn)}catch(e){}var qn=function(){function e(){var e=this;if(!Vn)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var t=this.worker=new Worker(Un);t.onmessage=function(t){var r=t.data,n=r.id,i=r.result,o=r.error,a=e.getKey(n);e.requests[a]&&(o?e.requests[a](new Error(o)):e.requests[a](null,i),delete e.requests[a])},t.onerror=function(e){return console.error(e)}}return e.prototype.getKey=function(e){return"key_"+String(e)},e.prototype.decompress=function(e,t){var r=++this.callCounter;this.requests[this.getKey(r)]=t,this.worker.postMessage({type:"decompress",id:r,data:e},[e.buffer])},e.prototype.terminate=function(){this.worker.terminate()},e.support=Vn,e}();function Hn(e){return Array.prototype.reduce.call(e,(function(e,t,r){return e|t<<8*r}),0)}function _n(e){var t=new Uint8Array(e),r=Hn(t.slice(0,4));if(r>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var n=[],i=[],o=4+4*r,a=0;a<r;a++)i[a]=Hn(t.slice(4+4*a,8+4*a)),n[a]=a===r-1?t.subarray(o,o+i[a]):t.slice(o,o+i[a]),o+=i[a];return qn.support?function(e){for(var t=[],r=e.length,n=function(r){t.push(new Promise((function(t,n){var i=new qn;i.decompress(e[r],(function(e,r){if(i.terminate(),e)return n(e);t(r)}))})))},i=0;i<r;i++)n(i);return Promise.all(t)}(n):Promise.resolve(function(e){for(var t,r=[],n=e.length,i=function(n){var i={data:e[n],offset:0,readByte:function(){return this.data[this.offset++]}},o=i.data.length,a={data:[],offset:0,writeByte:function(e){var t=Math.floor(this.offset/o);this.data[t]||(this.data[t]=new Uint8Array(o)),this.data[t][this.offset%o]=e,this.offset++}};Qn.decompressFile(i,a),t=new Uint8Array(a.offset);for(var s=0;s<a.offset;s++)t[s]=a.data[Math.floor(s/o)][s%o];r.push(t)},o=0;o<n;o++)i(o);return r}(n))}var jn=!1,Gn=[];function Kn(e){if(void 0===e&&(e=!1),e||!jn){jn=!0;var t=Gn.shift();if(t){try{t()}catch(e){}Ne.shared.add((function(){return Kn(!0)}),!0,2,-100)}else jn=!1}}function Wn(e){return new Promise((function(t,r){Gn.push((function(){try{t(e())}catch(e){r(e)}})),Ne.shared.add((function(){return Kn()}),!0,2,-100)}))}function Yn(e,t){for(var r={},n=0,i=t;n<i.length;n++){var o=i[n];o in e&&(r[o]=e[o])}return r}function Xn(e,t){void 0===t&&(t=!1);var r=typeof e;if("string"===r)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="[",i=e.length-1,o=0;o<i;o++)n+=Xn(e[o],!1)+",";return i>-1&&(n+=Xn(e[o],!1)),n+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return Xn(e.toJSON(),t);var a=Object.keys(e).sort(),s=a.length;for(n="",o=0;o<s;){var l=a[o],u=Xn(e[l],!0);void 0!==u&&(o&&""!==n&&(n+=","),n+=JSON.stringify(l)+":"+u),o++}return"{"+n+"}"}switch(r){case"function":return JSON.stringify(e.toString());case"undefined":return t?void 0:null;case"number":return e;default:return isFinite(e)?e:null}}function Jn(e){return"hash::".concat(Xn(e,!1))}var Zn=new n.WebGLRenderTarget(1,1),$n=new n.OrthographicCamera(-1,1,1,-1,0,1);$n.matrixAutoUpdate=!1;var ei=new n.BufferGeometry;ei.setAttribute("position",new n.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));var ti=new n.Mesh(ei);ti.matrixAutoUpdate=!1;var ri=new n.Scene;ri.add(ti),ri.matrixAutoUpdate=!1;var ni=new n.RawShaderMaterial({uniforms:{map:{value:null}},vertexShader:"\n void main() {\n gl_Position = vec4(0, 0, 0, 0);\n }\n ",fragmentShader:"\n uniform sampler2D map;\n void main() {\n gl_FragColor = texture2D(map, vec2(0, 0));\n }\n ",depthTest:!1,depthWrite:!1,stencilWrite:!1,colorWrite:!1,blending:n.NoBlending,lights:!1,toneMapped:!1}),ii=new n.RawShaderMaterial({uniforms:{map:{value:null}},vertexShader:"\n void main() {\n gl_Position = vec4(0, 0, 0, 0);\n }\n ",fragmentShader:"\n uniform samplerCube map;\n void main() {\n gl_FragColor = textureCube(map, vec3(0, 0, 0));\n }\n ",depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:n.NoBlending,lights:!1,toneMapped:!1}),oi=Promise.resolve();const ai=i.Reader,si=i.util,li=i.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(i.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),ui=li.Model=(()=>{function e(e){if(this.chunks=[],e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.chunks=si.emptyArray,e.prototype.createAt=si.Long?si.Long.fromBits(0,0,!0):0,e.prototype.description="",e.decode=function(e,t){e instanceof ai||(e=ai.create(e));let r=void 0===t?e.len:e.pos+t,n=new li.Model;for(;e.pos<r;){let t=e.uint32();switch(t>>>3){case 1:n.chunks&&n.chunks.length||(n.chunks=[]),n.chunks.push(li.Chunk.decode(e,e.uint32()));break;case 2:n.createAt=e.uint64();break;case 3:n.description=e.string();break;default:e.skipType(7&t)}}return n},e})();li.Chunk=(()=>{function e(e){if(e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.vertices=null,e.prototype.faces=null,e.prototype.name="",e.prototype.texture="",e.decode=function(e,t){e instanceof ai||(e=ai.create(e));let r=void 0===t?e.len:e.pos+t,n=new li.Chunk;for(;e.pos<r;){let t=e.uint32();switch(t>>>3){case 1:n.vertices=li.Vertices.decode(e,e.uint32());break;case 2:n.faces=li.Faces.decode(e,e.uint32());break;case 3:n.name=e.string();break;case 4:n.texture=e.string();break;default:e.skipType(7&t)}}if(!n.hasOwnProperty("vertices"))throw si.ProtocolError("missing required 'vertices'",{instance:n});if(!n.hasOwnProperty("faces"))throw si.ProtocolError("missing required 'faces'",{instance:n});if(!n.hasOwnProperty("name"))throw si.ProtocolError("missing required 'name'",{instance:n});return n},e})(),li.Vertices=(()=>{function e(e){if(this.xyz=[],this.uvs=[],e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.xyz=si.emptyArray,e.prototype.uvs=si.emptyArray,e.decode=function(e,t){e instanceof ai||(e=ai.create(e));let r=void 0===t?e.len:e.pos+t,n=new li.Vertices;for(;e.pos<r;){let t=e.uint32();switch(t>>>3){case 1:if(n.xyz&&n.xyz.length||(n.xyz=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.xyz.push(e.float())}else n.xyz.push(e.float());break;case 2:if(n.uvs&&n.uvs.length||(n.uvs=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.uvs.push(e.float())}else n.uvs.push(e.float());break;default:e.skipType(7&t)}}return n},e})(),li.Faces=(()=>{function e(e){if(this.indices=[],this.normals=[],e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.indices=si.emptyArray,e.prototype.normals=si.emptyArray,e.decode=function(e,t){e instanceof ai||(e=ai.create(e));let r=void 0===t?e.len:e.pos+t,n=new li.Faces;for(;e.pos<r;){let t=e.uint32();switch(t>>>3){case 1:if(n.indices&&n.indices.length||(n.indices=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.indices.push(e.uint32())}else n.indices.push(e.uint32());break;case 2:if(n.normals&&n.normals.length||(n.normals=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.normals.push(e.float())}else n.normals.push(e.float());break;default:e.skipType(7&t)}}return n},e})();var ci=(new n.Matrix4).set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1).elements;function hi(e){var t=e.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function di(e){var t=e.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function pi(e){var t=hi(e.name),r=di(e.name),n=function(e){var t=e.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}(e.name);return 1e6*t+1e3*r+n}function fi(e,t,r,i,o,a){var s=ie({key:"texture.pbm"},Yn(t,["format","quality","size","sharpen","mappings"])),l=(new Ot).loadTexture(e,{imageURL:{transform:t.transform,options:s},wrapS:n.ClampToEdgeWrapping,wrapT:n.ClampToEdgeWrapping,minFilter:n.LinearFilter,maxSize:"number"==typeof s.size?new n.Vector2(s.size,s.size):void 0,allowHosts:r,requestProxy:i,networkSubscribe:o}).then((function(e){var t=e.body;return t.needsUpdate=!0,function(e,t){if(!t)return Promise.resolve(e);var r=t.getRenderTarget();t.setRenderTarget(Zn),e instanceof n.CubeTexture?(ti.material=ii,ii.uniforms.map.value=e,t.render(ri,$n),ii.uniforms.map.value=null):(ti.material=ni,ni.uniforms.map.value=e,t.render(ri,$n),ii.uniforms.map.value=null),t.setRenderTarget(r);var i=oi.then((function(){return new Promise((function(t){Ne.shared.add((function(){t(e)}),!0)}))}));return oi=i.catch((function(){})),i}(t,a)}));return Object.assign(l,{url:e,textureOptions:t})}function vi(e,t,r,i,o,a,s,l,u){void 0===o&&(o={});for(var c=function(e){for(var t,r,n,i="number"==typeof e.createAt?e.createAt:null===e.createAt||void 0===e.createAt?0:e.createAt.toNumber(),o=null!==(t=e.description)&&void 0!==t?t:"",a=[],s=!0,l=0,u=e.chunks;l<u.length;l++)if(!(Z=u[l]).faces.normals||0===Z.faces.normals.length){s=!1;break}for(var c=e.chunks.sort((function(e,t){return pi(e)-pi(t)})),h=[],d=0,p=c;d<p.length;d++){var f=hi((Z=p[d]).name);h[f]||(h[f]=[]),h[f].push(Z)}for(var v=0;v<h.length;v++){var A=h[v];if(A)if(s){for(var m=0,g=0;g<A.length;g++)m+=(Z=A[g]).faces.indices.length;for(var y=new Float32Array(3*m),b=new Float32Array(2*m),x=new Float32Array(3*m),w=new Float32Array(m),M=[],E=[1/0,1/0,1/0,-1/0,-1/0,-1/0],C=0,I=0;I<A.length;I++){var S=[1/0,1/0,1/0,-1/0,-1/0,-1/0],P=(Z=A[I]).vertices.xyz,T=Z.vertices.uvs,B=Z.faces.indices,R=Z.faces.normals,O=B.length;for(g=0;g<O;g++){var L=B[g],D=P[3*L],F=P[3*L+1],k=P[3*L+2],Q=1/(ci[3]*D+ci[7]*F+ci[11]*k+ci[15]),N=(ci[0]*D+ci[4]*F+ci[8]*k+ci[12])*Q,V=(ci[1]*D+ci[5]*F+ci[9]*k+ci[13])*Q,U=(ci[2]*D+ci[6]*F+ci[10]*k+ci[14])*Q;y[3*C+3*g]=N,y[3*C+3*g+1]=V,y[3*C+3*g+2]=U,b[2*C+2*g]=T[2*L],b[2*C+2*g+1]=T[2*L+1];var z=3*Math.floor(g/3),q=R[z],H=R[z+1],_=R[z+2],j=1/(ci[3]*q+ci[7]*H+ci[11]*_+ci[15]),G=(ci[0]*q+ci[4]*H+ci[8]*_+ci[12])*j,K=(ci[1]*q+ci[5]*H+ci[9]*_+ci[13])*j,W=(ci[2]*q+ci[6]*H+ci[10]*_+ci[14])*j;x[3*C+3*g]=G,x[3*C+3*g+1]=K,x[3*C+3*g+2]=W,w[C]=v,N<S[0]&&(S[0]=N),V<S[1]&&(S[1]=V),U<S[2]&&(S[2]=U),N>S[3]&&(S[3]=N),V>S[4]&&(S[4]=V),U>S[5]&&(S[5]=U)}S[0]<E[0]&&(E[0]=S[0]),S[1]<E[1]&&(E[1]=S[1]),S[2]<E[2]&&(E[2]=S[2]),S[3]>E[3]&&(E[3]=S[3]),S[4]>E[4]&&(E[4]=S[4]),S[5]>E[5]&&(E[5]=S[5]),M.push({materialIndex:I,name:Z.name,chunkName:di(Z.name),start:C,count:Z.faces.indices.length,texture:null!==(r=Z.texture)&&void 0!==r?r:void 0}),C+=O}a.push({createAt:i,description:o,vertices:y,uvs:b,normals:x,floors:w,indices:null,floorIndex:v,groups:M,extents:E})}else{m=0;var Y=0;for(g=0;g<A.length;g++)Y+=(Z=A[g]).vertices.xyz.length/3,m+=Z.faces.indices.length;y=new Float32Array(3*Y),b=new Float32Array(2*Y),x=new Float32Array(3*Y),w=new Float32Array(m);var X=new Uint32Array(m),J=(M=[],E=[1/0,1/0,1/0,-1/0,-1/0,-1/0],0);for(C=0,I=0;I<A.length;I++){S=[1/0,1/0,1/0,-1/0,-1/0,-1/0],P=(Z=A[I]).vertices.xyz,T=Z.vertices.uvs,B=Z.faces.indices;var Z,$=P.length/3;for(O=B.length,g=0;g<$;g++)D=P[3*g],F=P[3*g+1],k=P[3*g+2],Q=1/(ci[3]*D+ci[7]*F+ci[11]*k+ci[15]),N=(ci[0]*D+ci[4]*F+ci[8]*k+ci[12])*Q,V=(ci[1]*D+ci[5]*F+ci[9]*k+ci[13])*Q,U=(ci[2]*D+ci[6]*F+ci[10]*k+ci[14])*Q,y[3*C+3*g]=N,y[3*C+3*g+1]=V,y[3*C+3*g+2]=U,b[2*C+2*g]=T[2*g],b[2*C+2*g+1]=T[2*g+1],w[C]=v,N<S[0]&&(S[0]=N),V<S[1]&&(S[1]=V),U<S[2]&&(S[2]=U),N>S[3]&&(S[3]=N),V>S[4]&&(S[4]=V),U>S[5]&&(S[5]=U);for(S[0]<E[0]&&(E[0]=S[0]),S[1]<E[1]&&(E[1]=S[1]),S[2]<E[2]&&(E[2]=S[2]),S[3]>E[3]&&(E[3]=S[3]),S[4]>E[4]&&(E[4]=S[4]),S[5]>E[5]&&(E[5]=S[5]),g=0;g<O;g++)X[J+g]=C+B[g];M.push({materialIndex:I,name:Z.name,chunkName:di(Z.name),start:J,count:Z.faces.indices.length,texture:null!==(n=Z.texture)&&void 0!==n?n:void 0}),C+=$,J+=O}for(g=0;g<m;g+=3){var ee,te,re,ne,ie,oe,ae,se,le,ue,ce,he,de,pe,fe,ve;q=void 0,H=void 0,_=void 0,ee=3*X[g],te=3*X[g+1],re=3*X[g+2],ne=y[ee],ie=y[ee+1],oe=y[ee+2],ae=y[te],se=y[te+1],le=y[te+2],ue=y[re],q=(he=y[re+1]-se)*(ve=oe-le)-(de=y[re+2]-le)*(fe=ie-se),H=de*(pe=ne-ae)-(ce=ue-ae)*ve,_=ce*fe-he*pe,x[ee]+=q,x[ee+1]+=H,x[ee+2]+=_,x[te]+=q,x[te+1]+=H,x[te+2]+=_,x[re]+=q,x[re+1]+=H,x[re+2]+=_}a.push({createAt:i,description:o,vertices:y,uvs:b,normals:x,floors:w,indices:X,floorIndex:v,groups:M,extents:E})}}return a}(e),h=0,d="",p=[],f={},v=0,A=c;v<A.length;v++){var m=A[v],g=m.createAt,y=m.description,b=m.vertices,x=m.uvs,w=m.normals,M=m.floors,E=m.indices,C=m.floorIndex,I=m.groups,S=m.extents,P=new n.Box3;P.min.x=S[0],P.min.y=S[1],P.min.z=S[2],P.max.x=S[3],P.max.y=S[4],P.max.z=S[5];var T=new n.BufferGeometry;T.setAttribute("position",new n.BufferAttribute(b,3)),T.setAttribute("uv",new n.BufferAttribute(x,2)),T.setAttribute("normal",new n.BufferAttribute(w,3)),T.setAttribute("floor",new n.BufferAttribute(M,1)),E&&T.setIndex(new n.BufferAttribute(E,1)),T.boundingBox=P,T.boundingSphere=P.getBoundingSphere(new n.Sphere);for(var B=0,R=I;B<R.length;B++){var O=R[B];T.addGroup(O.start,O.count,O.materialIndex)}for(var L=[],D=0,F=I;D<F.length;D++){O=F[D];var k=r[O.chunkName]||(O.texture?Xr(t||"",O.texture):void 0),Q=new Qt;L.push(Q),k?f[k]?f[k].push(Q):f[k]=[Q]:(Q.defines.USE_MAP=!1,Q.uniforms.diffuse.value=new n.Color(16777215))}var N=new $e(T,L);N.name="model_floor_"+C,N.userData.createAt=g,N.userData.description=y,N.matrix.compose(N.position,N.quaternion,N.scale),N.matrixAutoUpdate=!1,N.frustumCulled=!1,N.renderOrder=-1e3+C,h=g,d=y,p.push(N)}var V="",U=function(e){e=Ai(e,r.length);var t=[],i=Jn(e);if(V===i)return Promise.resolve();V=i;for(var c=function(r){var c=null;r in o&&(Jn(o[r].textureOptions)===Jn(e)?c=o[r]:o[r].then((function(e){return e.dispose()}))),c||(c=fi(r,e,a,s,l,u)),t.push(c.then((function(e){if(V===i)for(var t=0,n=f[r];t<n.length;t++){var o=n[t];o.uniforms.map.value&&o.uniforms.map.value.dispose(),o.uniforms.map.value=e,o.uniforms.exposure.value=3.3}else e.dispose()})).catch((function(){if(V===i)for(var e=0,t=f[r];e<t.length;e++){var o=t[e];o.uniforms.map.value&&o.uniforms.map.value.dispose(),o.uniforms.map.value=null,o.defines.USE_MAP=!1,o.uniforms.diffuse.value=new n.Color(16777215)}})))},h=0,d=Object.keys(f);h<d.length;h++){c(p=d[h])}for(var p in o)delete o[p];return Promise.all(t).then((function(){}))};return{createAt:h,description:d,objects:p,texturePromise:U(i),updateTexture:U}}function Ai(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>22?e.size=Math.min(e.size||1/0,800):t>5&&(e.size=Math.min(e.size||1/0,1024))),e}const mi=i.Reader,gi=i.util,yi=i.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(i.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),bi=yi.Model=(()=>{function e(e){if(this.meshes=[],e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.meshes=gi.emptyArray,e.decode=function(e,t){e instanceof mi||(e=mi.create(e));let r=void 0===t?e.len:e.pos+t,n=new yi.Model;for(;e.pos<r;){let t=e.uint32();if(t>>>3==1)n.meshes&&n.meshes.length||(n.meshes=[]),n.meshes.push(yi.Mesh.decode(e,e.uint32()));else e.skipType(7&t)}return n},e})();function xi(e){for(var t=[0,0,0],r=0;r<e.attributes.normal.array.length/9;r++)t[0]=e.attributes.normal.array[9*r],t[1]=e.attributes.normal.array[9*r+1],t[2]=e.attributes.normal.array[9*r+2],e.attributes.normal.array[9*r]=e.attributes.normal.array[9*r+6],e.attributes.normal.array[9*r+1]=e.attributes.normal.array[9*r+7],e.attributes.normal.array[9*r+2]=e.attributes.normal.array[9*r+8],e.attributes.normal.array[9*r+6]=t[0],e.attributes.normal.array[9*r+7]=t[1],e.attributes.normal.array[9*r+8]=t[2];for(r=0;r<e.attributes.position.array.length/9;r++)t[0]=e.attributes.position.array[9*r],t[1]=e.attributes.position.array[9*r+1],t[2]=e.attributes.position.array[9*r+2],e.attributes.position.array[9*r]=e.attributes.position.array[9*r+6],e.attributes.position.array[9*r+1]=e.attributes.position.array[9*r+7],e.attributes.position.array[9*r+2]=e.attributes.position.array[9*r+8],e.attributes.position.array[9*r+6]=t[0],e.attributes.position.array[9*r+7]=t[1],e.attributes.position.array[9*r+8]=t[2];for(r=0;r<e.attributes.uv.array.length/6;r++)t[0]=e.attributes.uv.array[6*r],t[1]=e.attributes.uv.array[6*r+1],e.attributes.uv.array[6*r]=e.attributes.uv.array[6*r+4],e.attributes.uv.array[6*r+1]=e.attributes.uv.array[6*r+5],e.attributes.uv.array[6*r+4]=t[0],e.attributes.uv.array[6*r+5]=t[1];e.attributes.normal.needsUpdate=!0,e.attributes.position.needsUpdate=!0,e.attributes.uv.needsUpdate=!0}function wi(e){var t=e.position,r=e.normal,i=e.uv,o=e.uv2,a=e.groups,s=new n.BufferGeometry;s.setAttribute("position",new n.BufferAttribute(new Float32Array(t.array),3)),r&&s.setAttribute("normal",new n.BufferAttribute(new Float32Array(r.array),3)),i&&s.setAttribute("uv",new n.BufferAttribute(new Float32Array(i.array),2)),o&&s.setAttribute("uv2",new n.BufferAttribute(new Float32Array(o.array),2));for(var l=0,u=a;l<u.length;l++){var c=u[l];s.addGroup(c.start,c.count,c.materialIndex)}return s}function Mi(e,t,r,i,o,a,s){if(s.hasOwnProperty(e))return s[e];Jr(e=e.split("?")[0])||(e=Xr(t,e)),0===(e=e.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/")).indexOf("//")&&(e="https:"+e);var l=ie({key:"texture.dome",size:64},Yn(r,["quality","format","sharpen","mappings"]));return s[e]=o.loadTexture(e,{imageURL:{transform:r.transform,options:l},wrapS:n.RepeatWrapping,wrapT:n.RepeatWrapping,allowHosts:a.allowHosts,networkSubscribe:a.networkSubscribe,requestProxy:a.requestProxy}).then((function(e){var t=e.body;return i&&t.repeat.copy(i),t.needsUpdate=!0,t.updateMatrix(),t}))}function Ei(e,t,r,i,o,a){var s=[],l=new Qt,u=l.uniforms;u.exposure.value=4.3;var c=l.defines;if(c.USE_MAP=!1,c.USE_UV=!1,e.kd&&(u.diffuse.value=(new n.Color).fromArray(e.kd.rgb)),e.mapkd){var h=null;if(e.mapkdrepeat){var d=e.mapkdrepeat.split(/\s+/).map((function(e){return Number(e)})),p=d[0],f=d[1];h=new n.Vector2(p,f)}s.push(Mi(e.mapkd,t,r,h,i,o,a).then((function(e){c.USE_MAP=!0,c.USE_UV=!0,u.map.value=e,u.uvTransform.value=e.matrix,l.needsUpdate=!0})).catch(fe))}if(e.ks&&(u.specular.value=(new n.Color).fromArray(e.ks.rgb)),e.mapks&&s.push(Mi(e.mapks,t,r,null,i,o,a).then((function(e){u.specularMap.value=e})).catch(fe)),e.ke&&(u.emissive.value=(new n.Color).fromArray(e.ke.rgb)),e.mapke&&s.push(Mi(e.mapke,t,r,null,i,o,a).then((function(e){u.emissiveMap.value=e})).catch(fe)),e.norm&&s.push(Mi(e.norm,t,r,null,i,o,a).then((function(e){u.normalMap.value=e})).catch(fe)),e.mapbump&&s.push(Mi(e.mapbump,t,r,null,i,o,a).then((function(e){u.bumpMap.value=e})).catch(fe)),e.bump&&s.push(Mi(e.bump,t,r,null,i,o,a).then((function(e){u.bumpMap.value=e})).catch(fe)),"number"==typeof e.ns&&(u.shininess.value=e.ns),"number"==typeof e.d){var v=e.d;v>0&&v<1&&(l.opacity=v)}return{material:l,textureReady:Promise.all(s).then(fe)}}function Ci(e,t,r,i,o,a){for(var s,l=[],u=[],c=(s=e,bi.decode(s).meshes),h=new Ot,d={allowHosts:i,requestProxy:o,networkSubscribe:a},p=new n.Matrix4,f=new n.Vector3,v=new n.Quaternion,A=new n.Vector3,m={},g=0,y=c;g<y.length;g++){var b=y[g],x=b.name,w=b.chunks,M=b.matrix;if("Ceiling"!==x&&"CeilingDrop"!==x)for(var E=0,C=M;E<C.length;E++){var I=C[E];p.elements=I.elements;var S=new Ze;S.renderOrder=-4;for(var P=0;P<w.length;P++){var T=wi(w[P].geometry);T.applyMatrix4(p),p.decompose(f,v,A),A.x*A.y*A.z<0&&T.attributes.normal&&T.attributes.position&&T.attributes.uv&&xi(T);for(var B=[],R=0,O=w[P].material;R<O.length;R++){var L=Ei(O[R],t||"",r,h,d,m),D=L.material,F=L.textureReady;u.push(F),B.push(D)}var k=new $e(T,B);k.name="chunk_"+P,k.matrix.compose(k.position,k.quaternion,k.scale),k.matrixAutoUpdate=!1,k.frustumCulled=!1,k.renderOrder=-1e3,S.add(k)}S.name=x,l.push(S)}}return{createAt:0,description:"",objects:l,texturePromise:Promise.all(u).catch(fe),updateTexture:function(e){return Promise.resolve()}}}yi.Mesh=(()=>{function e(e){if(this.chunks=[],this.matrix=[],e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.name="",e.prototype.chunks=gi.emptyArray,e.prototype.matrix=gi.emptyArray,e.decode=function(e,t){e instanceof mi||(e=mi.create(e));let r=void 0===t?e.len:e.pos+t,n=new yi.Mesh;for(;e.pos<r;){let t=e.uint32();switch(t>>>3){case 1:n.name=e.string();break;case 2:n.chunks&&n.chunks.length||(n.chunks=[]),n.chunks.push(yi.Chunk.decode(e,e.uint32()));break;case 3:n.matrix&&n.matrix.length||(n.matrix=[]),n.matrix.push(yi.Matrix.decode(e,e.uint32()));break;default:e.skipType(7&t)}}if(!n.hasOwnProperty("name"))throw gi.ProtocolError("missing required 'name'",{instance:n});return n},e})(),yi.Matrix=(()=>{function e(e){if(this.elements=[],e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.elements=gi.emptyArray,e.decode=function(e,t){e instanceof mi||(e=mi.create(e));let r=void 0===t?e.len:e.pos+t,n=new yi.Matrix;for(;e.pos<r;){let t=e.uint32();if(t>>>3==1)if(n.elements&&n.elements.length||(n.elements=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.elements.push(e.float())}else n.elements.push(e.float());else e.skipType(7&t)}return n},e})(),yi.Chunk=(()=>{function e(e){if(this.material=[],e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.geometry=null,e.prototype.material=gi.emptyArray,e.decode=function(e,t){e instanceof mi||(e=mi.create(e));let r=void 0===t?e.len:e.pos+t,n=new yi.Chunk;for(;e.pos<r;){let t=e.uint32();switch(t>>>3){case 2:n.geometry=yi.Geometry.decode(e,e.uint32());break;case 3:n.material&&n.material.length||(n.material=[]),n.material.push(yi.Material.decode(e,e.uint32()));break;default:e.skipType(7&t)}}if(!n.hasOwnProperty("geometry"))throw gi.ProtocolError("missing required 'geometry'",{instance:n});return n},e})(),yi.Geometry=(()=>{function e(e){if(this.groups=[],e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.position=null,e.prototype.uv=null,e.prototype.uv2=null,e.prototype.normal=null,e.prototype.groups=gi.emptyArray,e.decode=function(e,t){e instanceof mi||(e=mi.create(e));let r=void 0===t?e.len:e.pos+t,n=new yi.Geometry;for(;e.pos<r;){let t=e.uint32();switch(t>>>3){case 1:n.position=yi.Position.decode(e,e.uint32());break;case 2:n.uv=yi.UV.decode(e,e.uint32());break;case 3:n.uv2=yi.UV.decode(e,e.uint32());break;case 4:n.normal=yi.Normal.decode(e,e.uint32());break;case 5:n.groups&&n.groups.length||(n.groups=[]),n.groups.push(yi.Group.decode(e,e.uint32()));break;default:e.skipType(7&t)}}if(!n.hasOwnProperty("position"))throw gi.ProtocolError("missing required 'position'",{instance:n});if(!n.hasOwnProperty("normal"))throw gi.ProtocolError("missing required 'normal'",{instance:n});return n},e})(),yi.Position=(()=>{function e(e){if(this.array=[],e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.array=gi.emptyArray,e.decode=function(e,t){e instanceof mi||(e=mi.create(e));let r=void 0===t?e.len:e.pos+t,n=new yi.Position;for(;e.pos<r;){let t=e.uint32();if(t>>>3==1)if(n.array&&n.array.length||(n.array=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.array.push(e.float())}else n.array.push(e.float());else e.skipType(7&t)}return n},e})(),yi.UV=(()=>{function e(e){if(this.array=[],e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.array=gi.emptyArray,e.decode=function(e,t){e instanceof mi||(e=mi.create(e));let r=void 0===t?e.len:e.pos+t,n=new yi.UV;for(;e.pos<r;){let t=e.uint32();if(t>>>3==1)if(n.array&&n.array.length||(n.array=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.array.push(e.float())}else n.array.push(e.float());else e.skipType(7&t)}return n},e})(),yi.Normal=(()=>{function e(e){if(this.array=[],e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.array=gi.emptyArray,e.decode=function(e,t){e instanceof mi||(e=mi.create(e));let r=void 0===t?e.len:e.pos+t,n=new yi.Normal;for(;e.pos<r;){let t=e.uint32();if(t>>>3==1)if(n.array&&n.array.length||(n.array=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.array.push(e.float())}else n.array.push(e.float());else e.skipType(7&t)}return n},e})(),yi.Group=(()=>{function e(e){if(e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.start=0,e.prototype.count=0,e.prototype.materialIndex=0,e.decode=function(e,t){e instanceof mi||(e=mi.create(e));let r=void 0===t?e.len:e.pos+t,n=new yi.Group;for(;e.pos<r;){let t=e.uint32();switch(t>>>3){case 1:n.start=e.uint32();break;case 2:n.count=e.uint32();break;case 3:n.materialIndex=e.uint32();break;default:e.skipType(7&t)}}if(!n.hasOwnProperty("start"))throw gi.ProtocolError("missing required 'start'",{instance:n});if(!n.hasOwnProperty("count"))throw gi.ProtocolError("missing required 'count'",{instance:n});if(!n.hasOwnProperty("materialIndex"))throw gi.ProtocolError("missing required 'materialIndex'",{instance:n});return n},e})(),yi.Material=(()=>{function e(e){if(e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.kd=null,e.prototype.ks=null,e.prototype.ke=null,e.prototype.mapkd="",e.prototype.mapks="",e.prototype.mapke="",e.prototype.norm="",e.prototype.mapbump="",e.prototype.bump="",e.prototype.mapd="",e.prototype.ns=0,e.prototype.d=0,e.prototype.tr=0,e.prototype.mapkdrepeat="",e.decode=function(e,t){e instanceof mi||(e=mi.create(e));let r=void 0===t?e.len:e.pos+t,n=new yi.Material;for(;e.pos<r;){let t=e.uint32();switch(t>>>3){case 1:n.kd=yi.Color.decode(e,e.uint32());break;case 2:n.ks=yi.Color.decode(e,e.uint32());break;case 3:n.ke=yi.Color.decode(e,e.uint32());break;case 4:n.mapkd=e.string();break;case 5:n.mapks=e.string();break;case 6:n.mapke=e.string();break;case 7:n.norm=e.string();break;case 8:n.mapbump=e.string();break;case 9:n.bump=e.string();break;case 10:n.mapd=e.string();break;case 11:n.ns=e.float();break;case 12:n.d=e.float();break;case 13:n.tr=e.float();break;case 14:n.mapkdrepeat=e.string();break;default:e.skipType(7&t)}}return n},e})(),yi.Color=(()=>{function e(e){if(this.rgb=[],e)for(let t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.rgb=gi.emptyArray,e.decode=function(e,t){e instanceof mi||(e=mi.create(e));let r=void 0===t?e.len:e.pos+t,n=new yi.Color;for(;e.pos<r;){let t=e.uint32();if(t>>>3==1)if(n.rgb&&n.rgb.length||(n.rgb=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)n.rgb.push(e.float())}else n.rgb.push(e.float());else e.skipType(7&t)}return n},e})();var Ii=new n.Vector3,Si=new n.Matrix4,Pi=new n.Frustum;var Ti=function(e){function t(r,i,o){var a,s=this;(s=e.call(this)||this).workCode=r,s.unloadTileQueue=[],s.boundingBox=new n.Box3,s.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,s.needsRefined=!0,s.refined=!1,s.disposed=!1,s.needsRender=!0,s.lastRefineTime=Ae(),s.matrixAutoUpdate=!1,s.renderOrder=-4,s.nodes=new Map,s.nodeGroup=new n.Group,s.nodeGroup.matrixAutoUpdate=!1,s.nodeGroup.renderOrder=-4,s.add(s.nodeGroup),s.debugBoundings=new Map,s.debugBoundingGroup=new n.Group,s.debugBoundingGroup.visible=!1,s.debugBoundingGroup.matrixAutoUpdate=!1,s.debugBoundingGroup.renderOrder=-4,s.add(s.debugBoundingGroup);var l=$r(i,null!==(a=o.resourcePath)&&void 0!==a?a:"");return s.tileset=new Cr(s.workCode,l,{contentLoader:function(e){return s.loadContent(e,{allowHosts:o.allowHosts,requestProxy:o.requestProxy,networkSubscribe:o.networkSubscribe})},onTileLoad:function(){},onTileUnload:function(e){s.unloadTileQueue.push(e)},onTileError:function(e,t){console.error("Tile error",e.id,t)}}),s.tileset.root.boundingVolume&&s.tileset.root.boundingVolume.getBoundingBox(s.boundingBox),s}return ne(t,e),Object.defineProperty(t.prototype,"debug",{get:function(){return this.debugBoundingGroup.visible},set:function(e){this.debugBoundingGroup.visible!==e&&(this.debugBoundingGroup.visible=e,this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){return this.tileset.maxMemoryUsage},set:function(e){this.tileset.maxMemoryUsage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewDistanceScale",{get:function(){return this.tileset.viewDistanceScale},set:function(e){this.tileset.viewDistanceScale=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){return this.tileset.maxRequests},set:function(e){this.tileset.maxRequests=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),t.prototype.loadContent=function(e,t){var r=this;if(!e.content)return Promise.resolve(!1);var i=e.content,o=_e(i.uri,{key:"model-".concat(e.siblingIndex)});return"TILESET"===e.type?Oe(o,{responseType:"text",allowHosts:t.allowHosts,networkSubscribe:t.networkSubscribe,requestProxy:t.requestProxy}).then((function(e){return e.body})).then((function(e){var t=o.slice(0,o.lastIndexOf("/")+1);return $r(JSON.parse(e),t)})).then((function(t){return e.geometricError=t.geometricError,0===e.children.length&&(e.children=[new gr("".concat(e.id,".0"),t.root,e.tileset,e)]),!0})):"SCENEGRAPH"===e.type?Promise.resolve().then((function(){var r,n,i,a,s,l,u,c,h,d;return/\.b3dm$/.test(o)?yn(o,{upAxis:e.tileset.asset.gltfUpAxis,allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe}):/\.pnts$/.test(o)?Ln(o,{allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe}):/\.at3d$/.test(o)?function(e,t){var r,n,i,o=0,a=Ai(null!==(r=t.textureOptions)&&void 0!==r?r:{},null!==(i=null===(n=t.textureArray)||void 0===n?void 0:n.length)&&void 0!==i?i:0),s={};if(t.textureArray)for(var l=0,u=t.textureArray;l<u.length;l++){var c=u[l];s[c]=fi(c,a,t.allowHosts,t.requestProxy,t.networkSubscribe)}return Promise.resolve().then((function(){return Oe(e,{responseType:"arraybuffer",allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe})})).then((function(e){return _n(e.body)})).then((function(e){return Wn((function(){for(var t,r={chunks:[],createAt:void 0,description:void 0},n=0,i=e;n<i.length;n++){var o=i[n],a=ui.decode(o);a.chunks.length&&((t=r.chunks).push.apply(t,a.chunks),r.createAt=a.createAt,r.description=a.description)}return r}))})).then((function(e){return Wn((function(){var r,n,i;return vi(e,null!==(r=t.textureBaseUri)&&void 0!==r?r:"",(null!==(n=t.textureArray)&&void 0!==n?n:[]).slice(),null!==(i=t.textureOptions)&&void 0!==i?i:{},s,t.allowHosts,t.requestProxy,t.networkSubscribe)}))})).then((function(t){var r=new Ze;r.renderOrder=-4,r.name=e;for(var n=0,i=t.objects;n<i.length;n++){var a=i[n];r.add(a)}return t.texturePromise.then((function(){return{type:"at3d",uri:e,byteLength:o,object:r}}))}))}(o,{allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe,textureBaseUri:null===(r=e.extras.at3d)||void 0===r?void 0:r.textureBaseUri,textureArray:null===(n=e.extras.at3d)||void 0===n?void 0:n.textureArray,textureOptions:null===(i=e.extras.at3d)||void 0===i?void 0:i.textureOptions}):/\.pbm$/.test(o)?function(e,t){var r,n,i,o={byteLength:0},a=Ai(null!==(r=t.textureOptions)&&void 0!==r?r:{},null!==(i=null===(n=t.textureArray)||void 0===n?void 0:n.length)&&void 0!==i?i:0),s={};if(t.textureArray)for(var l=0,u=t.textureArray;l<u.length;l++){var c=u[l];s[c]=fi(c,a,t.allowHosts,t.requestProxy,t.networkSubscribe)}return Promise.resolve().then((function(){return Oe(e,{responseType:"arraybuffer",allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe})})).then((function(e){return o.byteLength=e.body.byteLength,Wn((function(){var t=new Uint8Array(e.body);return ui.decode(t)}))})).then((function(e){return Wn((function(){var r,n;return vi(e,null!==(r=t.textureBaseUri)&&void 0!==r?r:"",(null!==(n=t.textureArray)&&void 0!==n?n:[]).slice(),a,s,t.allowHosts,t.requestProxy,t.networkSubscribe)}))})).then((function(t){var r=new Ze;r.renderOrder=-4,r.matrixAutoUpdate=!1,r.matrix.compose(r.position,r.quaternion,r.scale),r.name=e;for(var n=0,i=t.objects;n<i.length;n++){var a=i[n];r.add(a)}return t.texturePromise.then((function(){return{type:"pbm",uri:e,byteLength:o.byteLength,object:r}}))}))}(o,{allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe,textureBaseUri:null===(a=e.extras.pbm)||void 0===a?void 0:a.textureBaseUri,textureArray:null===(s=e.extras.pbm)||void 0===s?void 0:s.textureArray,textureOptions:null===(l=e.extras.pbm)||void 0===l?void 0:l.textureOptions}):/\.dome$/.test(o)?function(e,t){var r={byteLength:0};return Promise.resolve().then((function(){return Oe(e,{responseType:"arraybuffer",allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe})})).then((function(e){return r.byteLength=e.body.byteLength,Ci(new Uint8Array(e.body),t.textureBaseUri||"",t.textureOptions,t.allowHosts,t.requestProxy,t.networkSubscribe)})).then((function(t){var n=new Ze;n.renderOrder=-4,n.matrixAutoUpdate=!1,n.matrix.compose(n.position,n.quaternion,n.scale),n.name=e;for(var i=0,o=t.objects;i<o.length;i++){var a=o[i];n.add(a)}return t.texturePromise.then((function(){return{type:"at3d",uri:e,byteLength:r.byteLength,object:n}}))}))}(o,{allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe,textureBaseUri:null===(u=e.extras.dome)||void 0===u?void 0:u.textureBaseUri,textureOptions:null===(c=e.extras.dome)||void 0===c?void 0:c.textureOptions}):/\.domez$/.test(o)?function(e,t){var r={byteLength:0};return Promise.resolve().then((function(){return Oe(e,{responseType:"arraybuffer",allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe})})).then((function(e){return r.byteLength=e.body.byteLength,_n(e.body)})).then((function(e){var t=e.reduce((function(e,t){return e+t.length}),0),r=new Uint8Array(t),n=0;return e.forEach((function(e){r.set(e,n),n+=e.length})),r})).then((function(e){return Ci(e,t.textureBaseUri||"",t.textureOptions,t.allowHosts,t.requestProxy,t.networkSubscribe)})).then((function(t){var n=new Ze;n.renderOrder=-4,n.name=e;for(var i=0,o=t.objects;i<o.length;i++){var a=o[i];n.add(a)}return t.texturePromise.then((function(){return{type:"at3d",uri:e,byteLength:r.byteLength,object:n}}))}))}(o,{allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe,textureBaseUri:null===(h=e.extras.domez)||void 0===h?void 0:h.textureBaseUri,textureOptions:null===(d=e.extras.domez)||void 0===d?void 0:d.textureOptions}):void 0})).then((function(t){if(!t)return!1;var o={type:t.type,uri:t.uri,byteLength:t.byteLength,object:new Wr(t.object,"pnts"===t.type?"points":"mesh")};if(r.disposed)return o.object.dispose(),i.data=void 0,i.byteLength=0,!1;if("pnts"!==o.type&&o.object.buildBvhTree(),i.data=o,i.byteLength=o.byteLength,o.object.applyMatrix4(e.transform),o.object.updateWorldMatrix(!1,!0),o.object.matrixAutoUpdate=!1,function(e,t){var r=t.tileset.properties.floorInfo;e.traverse((function(e){if(e instanceof $e){if(e.geometry.getAttribute("floor"))return;var t=e.geometry.getAttribute("position"),i=t.count,o=new Float32Array(i);if(r){for(var a=0,s=0;s<i;s++){Ii.set(t.array[3*s+0],t.array[3*s+1],t.array[3*s+2]),Ii.applyMatrix4(e.matrixWorld);var l=Ii.y;o[s]=0;for(var u=0;u<r.length;u++){var c=r[u];if(l<c.ground+c.height){o[s]=u;break}}a+=o[s]}e.renderOrder+=a/i}else for(s=0;s<i;s++)o[s]=0;e.geometry.setAttribute("floor",new n.BufferAttribute(o,1))}}))}(t.object,e),o.object.visible=!1,r.boundingBox.expandByObject(o.object),r.nodes.set(e.id,o.object),r.nodeGroup.add(o.object),e.boundingVolume){var a=function(e,t){var r;if(e instanceof ar)return(r=new n.LineSegments(hr,cr[Math.min(t,cr.length-1)])).position.copy(e.center),r.quaternion.setFromRotationMatrix(Yt.set(e.rotation.elements[0],e.rotation.elements[3],e.rotation.elements[6],0,e.rotation.elements[1],e.rotation.elements[4],e.rotation.elements[7],0,e.rotation.elements[2],e.rotation.elements[5],e.rotation.elements[8],0,0,0,0,1)),r.scale.set(e.halfSize.x,e.halfSize.y,e.halfSize.z),r.matrix.compose(r.position,r.quaternion,r.scale),r;if(e instanceof sr)return(r=new n.LineSegments(dr,cr[Math.min(t,cr.length-1)])).position.copy(e.center),r.scale.set(e.radius,e.radius,e.radius),r.matrix.compose(r.position,r.quaternion,r.scale),r;throw new Error("never")}(e.boundingVolume,e.state.selectionDepth);a.matrixAutoUpdate=!1,a.frustumCulled=!1,a.visible=!0,r.debugBoundings.set(e.id,a),r.debugBoundingGroup.add(a)}return!0})):Promise.resolve(!1)},t.prototype.intersectRaycaster=function(e){var t=this,r=[];return this.tileset.selectedTiles.forEach((function(n){var i;if(null===(i=n.content)||void 0===i?void 0:i.data){if(n.boundingVolume)if(!1===n.boundingVolume.clone().applyMatrix4(t.tileset.transfrom).intersectRay(e.ray))return;var o=n.content.data.object.intersectRaycaster(e);o.length&&r.push.apply(r,o)}})),r.sort((function(e,t){return e.distance-t.distance})),r},t.prototype.update=function(e,t){var r,i,o=this;if(this.tileset.transfrom.equals(this.matrixWorld)||this.tileset.transfrom.copy(this.matrixWorld),this.needsRefined){var a=Ae();if(a-this.lastRefineTime>30){this.lastRefineTime=a,this.tileset.frameNumber++;var s=t.fov/180*Math.PI,l=t.aspect<=1?s:2*Math.atan(Math.tan(.5*s)/t.aspect),u=2*Math.tan(.5*l);Si.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Pi.setFromProjectionMatrix(Si);var c=(new or).setFromFrustum(Pi),h={camera:{position:(new n.Vector3).copy(t.position),direction:t.getDirection(new n.Vector3),up:(new n.Vector3).copy(t.up)},maxLevelOfDetail:this.maxLevelOfDetail,height:e.getSize(new n.Vector2).height,frameNumber:this.tileset.frameNumber,sseDenominator:u,cullingVolume:c};this.tileset.cache.reset(),this.tileset.traverser.traverse(this.tileset.root,h)}}for(this.tileset.tiles.forEach((function(e){var t=e.selected,n=e.id;(r=o.nodes.get(n))&&r.visible!==t&&(r.visible=t,o.needsRender=!0),(r=o.debugBoundings.get(n))&&r.visible!==t&&(r.visible=t,o.needsRender=!0)}));i=this.unloadTileQueue.pop();){var d=i.id,p=i.content;p&&p.data&&(p.data.object.dispose(),p.data=void 0,p.byteLength=0),(r=this.nodes.get(d))&&(this.nodeGroup.remove(r),this.nodes.delete(d),this.needsRender=!0),(r=this.debugBoundings.get(d))&&(this.debugBoundingGroup.remove(r),this.debugBoundings.delete(d),this.needsRender=!0)}this.refined=!0,this.tileset.needsRefinedTiles.forEach((function(e){if(!1!==o.refined&&e.content){var t=e.content.loadState;"UNLOADED"!==t&&"LOADING"!==t||(o.refined=!1)}}))},t.prototype.dispose=function(){var e,t,r=this;for(this.disposed=!0,this.tileset.reset();e=this.unloadTileQueue.pop();){var n=e.id,i=e.content;i&&i.data&&(i.data.object.dispose(),i.data=void 0,i.byteLength=0),(t=this.nodes.get(n))&&(this.nodeGroup.remove(t),this.nodes.delete(n),this.needsRender=!0),(t=this.debugBoundings.get(n))&&(this.debugBoundingGroup.remove(t),this.debugBoundings.delete(n),this.needsRender=!0)}this.nodes.forEach((function(e,t,n){r.nodeGroup.remove(e),e.dispose(),n.delete(t)}))},t.DEFAULT_MAX_LEVEL_OF_DETAIL=1/0,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=Cr.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_MAX_REQUESTS=Cr.DEFAULT_MAX_REQUESTS,t}(n.Object3D),Bi=function(e,t){void 0===t&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var r={},i=e.getIndex(),o=e.getAttribute("position"),a=i?i.count:o.count,s=0,l=Object.keys(e.attributes),u={},c={},h=[],d=["getX","getY","getZ","getW"],p=0,f=l.length;p<f;p++){u[b=l[p]]=[],(E=e.morphAttributes[b])&&(c[b]=new Array(E.length).fill().map((function(){return[]})))}var v=Math.log10(1/t),A=Math.pow(10,v);for(p=0;p<a;p++){var m=i?i.getX(p):p,g="",y=0;for(f=l.length;y<f;y++)for(var b=l[y],x=(M=e.getAttribute(b)).itemSize,w=0;w<x;w++)g+="".concat(~~(M[d[w]](m)*A),",");if(g in r)h.push(r[g]);else{for(y=0,f=l.length;y<f;y++){b=l[y];var M=e.getAttribute(b),E=e.morphAttributes[b],C=(x=M.itemSize,u[b]),I=c[b];for(w=0;w<x;w++){var S=d[w];if(C.push(M[S](m)),E)for(var P=0,T=E.length;P<T;P++)I[P].push(E[P][S](m))}}r[g]=s,h.push(s),s++}}var B=e.clone();for(p=0,f=l.length;p<f;p++){b=l[p];var R=e.getAttribute(b),O=new R.array.constructor(u[b]);M=new n.BufferAttribute(O,R.itemSize,R.normalized);if(B.setAttribute(b,M),b in c)for(y=0;y<c[b].length;y++){var L=e.morphAttributes[b][y],D=(O=new L.array.constructor(c[b][y]),new n.BufferAttribute(O,L.itemSize,L.normalized));B.morphAttributes[b][y]=D}}return B.setIndex(h),B},Ri=new n.Sphere,Oi=new n.Matrix4,Li=new n.Matrix4,Di=(new n.Matrix4).fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),Fi=(new n.Matrix4).fromArray([1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,1]);function ki(e){var t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(e);if(t){var r=String(t[1]).trim().split(".").slice(1).reverse()[0];if(r)return r}return""}var Qi=new n.Box3(new n.Vector3(-.5,-.5,-.5),new n.Vector3(.5,.5,.5)),Ni=new n.Box3,Vi=function(e){function t(t){var r=e.call(this)||this;return r.name="model",r.bounding=new n.Box3(new n.Vector3,new n.Vector3),r.shownFloor=null,r.floorLength=0,r.textureOptions={},r.refined=!1,r.loaded=!1,r.renderer=t,r.matrixAutoUpdate=!1,r.renderOrder=-4,r}return ne(t,e),Object.defineProperty(t,"dracoPath",{get:function(){return Kt.decoderPath},set:function(e){Kt.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shownfloor",{get:function(){var e=this.getMaterial().floorIndex;return-1===e?null:e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.children.length},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,t){void 0===t&&(t=30/180*Math.PI);for(var r=Math.cos(t),i=[],o=0,a=this.children;o<a.length;o++){var s=a[o];if(s instanceof Ti)s.tileset.selectedTiles.forEach((function(t){var o,a,s;if(!(t.boundingVolume&&t.boundingVolume.distanceTo(e.center)>e.radius)){var l=null===(a=null===(o=t.content)||void 0===o?void 0:o.data)||void 0===a?void 0:a.object;if(l&&l.visible&&l.bvhTree){Oi.copy(l.matrixWorld),Li.getInverse(Oi),Ri.copy(e).applyMatrix4(Li);var u={},c=["a","b","c"],h=l.bvhTree.trianglesInSphere(Ri.center,Ri.radius),d=new n.BufferGeometry;d.setAttribute("position",new n.BufferAttribute(h,3));var p=Bi(d),f=p.getAttribute("position").array,v=(null===(s=p.getIndex())||void 0===s?void 0:s.array)||[];d.dispose(),p.dispose();for(var A=[],m=[],g=0,y=f.length;g<y;g+=3){var b=new n.Vector3(f[g],f[g+1],f[g+2]).applyMatrix4(Oi);A.push(b)}for(g=0,y=v.length;g<y;g+=3){var x=v[g],w=v[g+1],M=v[g+2],E=(new n.Vector3).crossVectors(A[w].clone().sub(A[x]),A[M].clone().sub(A[x])).normalize();m.push({a:x,b:w,c:M,normal:E})}for(g=0,y=m.length;g<y;g++)for(var C=m[g],I=0;I<3;I++){var S=C[c[I]],P=C[c[(I+1)%3]],T=[Math.min(S,P),Math.max(S,P)];void 0===u[B=T[0]+"-"+T[1]]?u[B]={index1:T[0],index2:T[1],face1:g}:u[B].face2=g}for(var B in u){var R=u[B];if(void 0===R.face2||m[R.face1].normal.dot(m[R.face2].normal)<=r){var O=A[R.index1],L=A[R.index2];i.push(new n.Line3(O,L))}}A.length=0,m.length=0}}}))}return i},t.prototype.show=function(e){this.setMaterial({floorIndex:null==e?-1:e})},t.prototype.intersectRaycaster=function(e,t){for(var r=[],n=0,i=this.children;n<i.length;n++){var o=i[n];if(o instanceof Ti){var a=o.intersectRaycaster(e);a.length&&r.push.apply(r,a)}}return r.sort((function(e,t){return e.distance-t.distance})),r},t.prototype.load=function(e,t){var r=this;if(void 0===t&&(t={}),!e.model)return Promise.resolve(null);var n=e.workCode,i=e.model,o=e.options;return Promise.resolve().then((function(){var r,a;if(i.file&&i.tileset){var s=i.file,l=i.tileset,u=i.textureBase,c=i.textures;return Oe(l,{allowHosts:e.allowHosts,networkSubscribe:t.networkSubscribe,requestProxy:t.requestProxy,responseType:"text"}).then((function(r){var i,a,h=JSON.parse(r.body),d=h.root,p=h.geometricError;h.geometricError=0;var f=d.boundingVolume?ur(d.boundingVolume):void 0;"lodVersion"in h?(d.transform=Fi.toArray(),"floorInfo"in h&&(h.properties=h.properties||{},h.properties.floorInfo=h.floorInfo.map((function(e){return{ground:-e.ground,height:e.height}})),delete h.floorInfo),h.asset.tilesetVersion=String(h.lodVersion),delete h.lodVersion):d.transform=Di.toArray(),f&&d.transform&&f.applyMatrix4(Li.getInverse(Oi.fromArray(d.transform))),h.root={content:{uri:s},refine:"REPLACE",extras:(i={},i[ki(s)||"at3d"]={textureBaseUri:u,textureArray:c,textureOptions:null!==(a=t.textureOptions)&&void 0!==a?a:{}},i),boundingVolume:f?f.toJson():void 0,viewerRequestVolume:o.viewerRequestVolume?o.viewerRequestVolume.toJson():void 0,geometricError:p,children:[d]};var v=l?l.slice(0,l.lastIndexOf("/")+1):"",A=new Ti(n,h,{resourcePath:v,allowHosts:e.allowHosts,networkSubscribe:t.networkSubscribe,requestProxy:t.requestProxy});return A.matrix.copy(o.transform),A.matrix.decompose(A.position,A.quaternion,A.scale),A.matrixWorldNeedsUpdate=!0,A}))}if(i.tileset){var h=i.tileset;return Oe(h,{allowHosts:e.allowHosts,networkSubscribe:t.networkSubscribe,requestProxy:t.requestProxy,responseType:"text"}).then((function(r){var i=JSON.parse(r.body);o.viewerRequestVolume&&(i.root.viewerRequestVolume=o.viewerRequestVolume.toJson());var a=h?h.slice(0,h.lastIndexOf("/")+1):"",s=new Ti(n,i,{resourcePath:a,allowHosts:e.allowHosts,networkSubscribe:t.networkSubscribe,requestProxy:t.requestProxy});return s.matrix.copy(o.transform),s.matrix.decompose(s.position,s.quaternion,s.scale),s.matrixWorldNeedsUpdate=!0,s}))}if(i.file){var d=i.file,p=i.textureBase,f=i.textures,v={asset:{gltfUpAxis:"Z",version:"0.0"},geometricError:0,root:{content:{uri:d},refine:"REPLACE",geometricError:0,viewerRequestVolume:o.viewerRequestVolume?o.viewerRequestVolume.toJson():void 0,extras:(r={},r[ki(d)||"at3d"]={textureBaseUri:p,textureArray:f,textureOptions:null!==(a=t.textureOptions)&&void 0!==a?a:{}},r)}},A=d?d.slice(0,d.lastIndexOf("/")+1):"",m=new Ti(n,v,{resourcePath:A,allowHosts:e.allowHosts,networkSubscribe:t.networkSubscribe,requestProxy:t.requestProxy});return m.matrix.copy(o.transform),m.matrix.decompose(m.position,m.quaternion,m.scale),m.matrixWorldNeedsUpdate=!0,m}})).then((function(e){return e&&r.add(e),null!=e?e:null}))},t.prototype.update=function(t,r){if(this.children.length){this.bounding.makeEmpty();for(var i=!0,o=0,a=this.children;o<a.length;o++){(h=a[o])instanceof Ti&&(h.update(t,r),h.boundingBox.isEmpty()||(Ni.copy(h.boundingBox).applyMatrix4(h.matrix),this.bounding.union(Ni)),!0===h.needsRender&&(h.needsRender=!1,this.needsRender=!0),!1===h.refined&&(i=!1))}this.bounding.isEmpty()&&this.bounding.copy(Qi);var s=this.refined;if(this.refined=i,!1===s&&!0===this.refined&&this.emit("refined"),!1===this.loaded){for(var l=!0,u=0,c=this.children;u<c.length;u++){var h;(h=c[u])instanceof Ti&&!1===h.refined&&(l=!1)}l&&(this.loaded=!0,this.emit("loaded"))}}else this.refined=!1,this.bounding.set(new n.Vector3,new n.Vector3);e.prototype.update.call(this,t,r)},t.prototype.dispose=function(){var e;for(this.off();e=this.children[0];)e instanceof Ti&&e.dispose(),this.remove(e)},t}(it);function Ui(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var r,n,i;if(Array.isArray(e)){if((r=e.length)!=t.length)return!1;for(n=r;0!=n--;)if(!Ui(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((r=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;for(n=r;0!=n--;){var o=i[n];if(!Ui(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function zi(e){return"number"==typeof e}Object.assign(Vi.prototype,{on:pe.prototype.on,once:pe.prototype.once,off:pe.prototype.off,emit:pe.prototype.emit,hasListener:pe.prototype.hasListener,waitUnitl:pe.prototype.waitUnitl});var qi=function(){return new Error("Invalid input.")},Hi=function(){return new Error("Invalid certificate.")},_i=function(){return new Error("Invalid signature.")},ji=function(e){return new Error("date(".concat(e.toString(),") expired."))},Gi=function(e){return new Error("host(".concat(JSON.stringify(e),") is not allowed."))};function Ki(e,t){void 0===t&&(t=!1);var r=typeof e;if("string"===r)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="[",i=e.length-1,o=0;o<i;o++)n+=Ki(e[o],!1)+",";return i>-1&&(n+=Ki(e[o],!1)),n+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return Ki(e.toJSON(),t);var a=Object.keys(e).sort(),s=a.length;for(n="",o=0;o<s;){var l=a[o],u=Ki(e[l],!0);void 0!==u&&(o&&""!==n&&(n+=","),n+=JSON.stringify(l)+":"+u),o++}return"{"+n+"}"}switch(r){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(e)?e:null}}function Wi(e){return String(Ki(e,!1))}function Yi(e){var t,r,n;if(Array.isArray(e)){var i,o,a=void 0;if(e.length<=0)return qi();for(var s=function(t){var r=Yi(e[t]);if(r instanceof Error)return{value:r};if(a){if(a!==r.issuer)return{value:Hi()}}else a=r.issuer;i?r.expire.getTime()<i.getTime()&&(i=r.expire):i=r.expire,o=o?o.filter((function(e){return-1!==r.allowHosts.indexOf(e)})):r.allowHosts},l=0;l<e.length;l++){var u=s(l);if("object"==typeof u)return u.value}return me({issuer:a,expire:i,allowHosts:o})}var c=JSON.parse(e),h="undefined"!=typeof location?location.hostname:"",d=Date.now();if("object"!=typeof c)return qi();var p=new Date("string"==typeof c.expire_at&&/^\d+$/.test(c.expire_at)?Number(c.expire_at):c.expire_at),f=Array.isArray(c.allow_hosts)?c.allow_hosts:[];if(0===h.length||ye(h)||we.filter((function(e){return be(e,h)})).length>0){var v=String(null!==(t=c.certificate)&&void 0!==t?t:"");if(v){var A=new X;return A.readCertPEM(v),me({issuer:A.getSubjectString(),expire:p,allowHosts:f})}return me({issuer:"none",expire:p,allowHosts:f})}var m=String(null!==(r=c.certificate)&&void 0!==r?r:"");if(!m)return Hi();var g=new X;g.readCertPEM(m);var y=String(null!==(n=c._signature)&&void 0!==n?n:"");if(!y)return _i();var b=Wi(function(e,t){for(var r={},n=0,i=Object.keys(e);n<i.length;n++){var o=i[n];-1===t.indexOf(o)&&(r[o]=e[o])}return r}(c,["_signature"]));return!1===function(e,t,r){var n=new X;if("string"==typeof r?n.readCertPEM(r):n.readCertHex(r.hex),!1===te(n))return!1;var i=new I;return i.readCertPubKeyHex(n.hex,6),!!i.verify(e,M(t))}(b,y,g)?_i():d<p.getTime()?0===f.filter((function(e){return be(e,h)})).length?Gi(h):me({issuer:g.getSubjectString(),expire:p,allowHosts:f}):ji(p)}var Xi=new n.Matrix4,Ji=new WeakMap,Zi=function(){function e(e,t){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={},this.observers=[],this.issuer="none",this.raw={works:[""],options:""},this.options={transform:new n.Matrix4};var r=so(e,t,this);if(r instanceof Error)throw new Error("[PARSE FAILED]: "+r.message+"\nError work input:\n"+JSON.stringify(e))}return e.prototype.toJSON=function(){return this.raw},e.parse=lo,e}();function $i(e){return null==e?"null":Array.isArray(e)?"array":"object"==typeof e?"dict":"value"}function eo(e,t){var r=$i(e),n=$i(t);if("null"===n)return e;if("value"===n)return t;if(n!==r)return JSON.parse(JSON.stringify(t));if("array"===n)for(var i=0;i<t.length;i++)e[i]=eo(e[i],t[i]);else if("dict"===n)for(var o in t)e[o]=eo(e[o],t[o]);return e}function to(e,t){return 0===e.indexOf(t)}function ro(e,t){return"".concat(e,"[").concat(t,"]")}function no(e,t,r,n){var i,o=t;if(!0===n.jsonp){o=t.replace(/([\?\#].*)?$/i,"");var a=J("".concat(o)).slice(0,7);o="".concat(o,".").concat(a,".jsonp")}if(!0===n.shortPath){var s=o.replace(e,"").split("."),l=null!==(i=s.shift())&&void 0!==i?i:"",u=s.join(".");o=Xr(e,J(l))+(u?"."+u:"")}var c=o.replace(e,"");return n.baseURL&&(o=Xr(n.baseURL,c)),o}function io(e,t,r,n,i){var o=r;return Jr(r)||(t&&(t=Xr(t,String(n))),o=Xr(t,o)),Jr(o)||(o=Xr(e,o)),to(o,e)||console.warn("".concat(o," is not start with base_url(").concat(e,").")),no(e,o,0,i)}function oo(e,t,r){var n=t;return Jr(n)||(n=Xr(e,t)),to(n,e)||console.warn("".concat(n," is not start with base_url(").concat(e,").")),no(e,n,0,r)}function ao(e,t,r,n){var i=t;return Jr(i)||(i=Xr(r,i)),Jr(i)||(i=Xr(e,i)),to(i,e)||console.warn("".concat(i," is not start with base_url(").concat(e,").")),no(e,i,0,n)}function so(e,t,r){for(var i,o,a,s,l,u,c,h=JSON.stringify(t),d=[],p=0,f=[].concat(e);p<f.length;p++){var v=f[p];v instanceof Zi?d.push.apply(d,v.raw.works):"string"==typeof v?d.push(v):d.push(JSON.stringify(v))}var A=Yi(d);if(A instanceof Error)return A;t=JSON.parse(h);var m={transform:new n.Matrix4};void 0!==t.debug&&(m.debug=t.debug),t.transform&&(Array.isArray(t.transform)?m.transform.fromArray(t.transform):m.transform.copy(t.transform)),t.viewerRequestVolume&&("clone"in t.viewerRequestVolume?m.viewerRequestVolume=t.viewerRequestVolume.clone():m.viewerRequestVolume=ur(t.viewerRequestVolume)),void 0!==t.modelMaxLevelOfDetail&&t.modelMaxLevelOfDetail>=0&&(m.modelMaxLevelOfDetail=t.modelMaxLevelOfDetail),void 0!==t.modelMaxRequests&&t.modelMaxRequests>=0&&(m.modelMaxRequests=t.modelMaxRequests),void 0!==t.modelMaxMemoryUsage&&t.modelMaxMemoryUsage>=0&&(m.modelMaxMemoryUsage=t.modelMaxMemoryUsage),void 0!==t.modelMaxScreenSpaceError&&t.modelMaxScreenSpaceError>=0&&(m.modelMaxScreenSpaceError=t.modelMaxScreenSpaceError),Object.defineProperty(r,"options",{configurable:!1,get:function(){return m}}),e=d.map((function(e){return JSON.parse(e)})).reduce((function(e,t){return eo(e,t)})),Object.defineProperty(r,"raw",{configurable:!1,get:function(){return{works:d,options:h}}});var g=String(e.work_code||e.code||e.vr_code||e.workCode||e.project_id);Object.defineProperty(r,"workCode",{configurable:!1,get:function(){return g}});var y=String(e.name);if(Object.defineProperty(r,"name",{configurable:!1,get:function(){return y}}),A instanceof Error)return A;Object.defineProperty(r,"issuer",{configurable:!1,get:function(){return A.issuer}}),Object.defineProperty(r,"expire",{configurable:!1,get:function(){return A.expire}}),Object.defineProperty(r,"allowHosts",{configurable:!1,get:function(){return A.allowHosts}});var b=null!==(i=e.base_url)&&void 0!==i?i:"";if(b&&"/"!==b[b.length-1]&&(b+="/"),A instanceof Error)return A;var x,w,M,E,C={work:r};if(e.model.file?x=oo(b,e.model.file,t):e.model.file_url&&(x=oo(b,e.model.file_url,t)),Object.defineProperty(C,"file",{configurable:!1,get:function(){return x}}),e.model.textureBase?w=ao(b,"",e.model.textureBase,t):e.model.material_base_url?w=ao(b,"",e.model.material_base_url,t):C.file&&(w=C.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(C,"textureBase",{configurable:!1,get:function(){return w}}),Array.isArray(e.model.textures)?(M=e.model.textures.map((function(r){var n,i;return ao(b,r,null!==(i=null!==(n=e.model.textureBase)&&void 0!==n?n:e.model.material_base_url)&&void 0!==i?i:"",t)})),Object.freeze(M)):Array.isArray(e.model.material_textures)&&(M=e.model.material_textures.map((function(r){var n,i;return ao(b,r,null!==(i=null!==(n=e.model.textureBase)&&void 0!==n?n:e.model.material_base_url)&&void 0!==i?i:"",t)})),Object.freeze(M)),Object.defineProperty(C,"textures",{configurable:!1,get:function(){return M}}),e.model.tileset?E=oo(b,e.model.tileset,t):e.model.tiles&&e.model.tiles.tileset_url&&(E=oo(b,e.model.tiles.tileset_url,t)),Object.defineProperty(C,"tileset",{configurable:!1,get:function(){return E}}),Object.defineProperty(r,"model",{configurable:!1,get:function(){if(C.file||C.tileset)return C}}),A instanceof Error)return A;var I=[];if(e.observers&&Array.isArray(e.observers)){var S=[];e.panorama&&(Array.isArray(e.panorama)?S=e.panorama:Array.isArray(e.panorama.list)?S=e.panorama.list:Array.isArray(e.panorama.info)&&(S=e.panorama.info));for(var P=function(i){var h={},d=e.observers[i];if(!d)return"break";var p=S[i];if(!p)return"break";d=Object.assign({},d,p,{active:!1!==d.active&&!1!==p.active}),Object.defineProperty(h,"work",{configurable:!1,get:function(){return r}}),Object.defineProperty(h,"index",{configurable:!1,get:function(){return i}});var f=ro(r.workCode,i);Object.defineProperty(h,"panoId",{configurable:!1,get:function(){return f}});var v=!1!==d.active;Object.defineProperty(h,"active",{configurable:!1,get:function(){return v}});var A=!0===d.loadable;Object.defineProperty(h,"loadable",{configurable:!1,get:function(){return A}});var m=d.derived_id;Object.defineProperty(h,"derivedId",{configurable:!1,get:function(){return m}});var g=null!==(c=null!==(l=null!==(a=null===(o=e.panorama)||void 0===o?void 0:o.pano_high_cube_base_url)&&void 0!==a?a:null===(s=e.panorama)||void 0===s?void 0:s.pano_cube_base_url)&&void 0!==l?l:null===(u=e.panorama)||void 0===u?void 0:u.base_url)&&void 0!==c?c:"",y={up:io(b,g,d.images?d.images.up:d.up,i,t),down:io(b,g,d.images?d.images.down:d.down,i,t),right:io(b,g,d.images?d.images.right:d.right,i,t),left:io(b,g,d.images?d.images.left:d.left,i,t),front:io(b,g,d.images?d.images.front:d.front,i,t),back:io(b,g,d.images?d.images.back:d.back,i,t)},x=d.images?d.images.depth:d.depth;x&&(y.depth=io(b,g,x,i,t));var w=d.images?d.images.luminance:d.luminance;w&&(y.luminance=Object.freeze({up:io(b,g,w.up,i,t),down:io(b,g,w.down,i,t),right:io(b,g,w.right,i,t),left:io(b,g,w.left,i,t),front:io(b,g,w.front,i,t),back:io(b,g,w.back,i,t)}));var M=d.images?d.images.tiles:d.tiles;if(M){for(var E=[],C=function(e){var t=e.match(/\/cube_(\d+)\//);if(t){var r=Number(t[1]);if(function(e){return 0==(e&e-1)&&0!==e}(r))return r}return!1},P=function(e,t){return e.replace(/\/cube_(\d+)\//,(function(){return"/cube_".concat(t,"/")}))},T=0,B=M;T<B.length;T++){var R=B[T];if("number"==typeof R){var O=R,L=C(y.front);if(!1===L)continue;if((U=Math.max(L,512*Math.pow(2,O)))>2048){var D=P(y.up,U),F=P(y.down,U),k=P(y.right,U),Q=P(y.left,U),N=P(y.front,U),V=P(y.back,U);E.push(Object.freeze({level:O,size:U,up:D,down:F,right:k,left:Q,front:N,back:V}))}else{D=y.up,F=y.down,k=y.right,Q=y.left,N=y.front,V=y.back;E.push(Object.freeze({level:O,size:U,up:D,down:F,right:k,left:Q,front:N,back:V}))}}else{var U;if("number"!=typeof(O=R.level))continue;if("number"!=typeof(U=R.size))continue;D=io(b,g,R.up,i,t),F=io(b,g,R.down,i,t),k=io(b,g,R.right,i,t),Q=io(b,g,R.left,i,t),N=io(b,g,R.front,i,t),V=io(b,g,R.back,i,t);E.push(Object.freeze({level:O,size:U,up:D,down:F,right:k,left:Q,front:N,back:V}))}}E.sort((function(e,t){return e.level-t.level})),Object.freeze(E),Object.defineProperty(y,"tiles",{configurable:!1,get:function(){return E}})}Object.freeze(y),Object.defineProperty(h,"images",{configurable:!1,get:function(){return y}});var z=new n.Vector3;if(d.position instanceof n.Vector3)z.copy(d.position);else{if(!Array.isArray(d.position))return"break";z.fromArray(d.position)}Object.freeze(z),Object.defineProperty(h,"position",{configurable:!1,get:function(){return z}});var q=new n.Vector3;if(d.standingPosition instanceof n.Vector3)q.copy(d.standingPosition);else if(Array.isArray(d.standingPosition))q.fromArray(d.standingPosition);else if(d.standing_position instanceof n.Vector3)q.copy(d.standing_position);else{if(!Array.isArray(d.standing_position))return"break";q.fromArray(d.standing_position)}Object.freeze(q),Object.defineProperty(h,"standingPosition",{configurable:!1,get:function(){return q}});var H=new n.Quaternion;if(d.quaternion instanceof n.Quaternion)H.copy(d.quaternion);else if(Array.isArray(d.quaternion))H.fromArray(d.quaternion);else{if(!d.quaternion)return"break";var _=d.quaternion,j=_.x,G=_.y,K=_.z,W=_.w;H.set(j,G,K,W)}Object.freeze(H),Object.defineProperty(h,"quaternion",{configurable:!1,get:function(){return H}});var Y,X=0;zi(d.floorIndex)?X=d.floorIndex:zi(d.floor_index)&&(X=d.floor_index),Object.defineProperty(h,"floorIndex",{configurable:!1,get:function(){return X}}),d.video&&(Y={},"string"==typeof d.video.source&&(Y.source=d.video.source),d.video.matrix instanceof n.Matrix4?Y.matrix=d.video.matrix.clone():Array.isArray(d.video.matrix)&&(Y.matrix=(new n.Matrix4).fromArray(d.video.matrix)),d.video.size instanceof n.Vector2?Y.size=d.video.size.clone():Array.isArray(d.video.size)&&(Y.size=(new n.Vector2).fromArray(d.video.size)),Y.source&&Y.matrix&&Y.size&&(h.video=Y)),Object.freeze(Y),Object.defineProperty(h,"video",{configurable:!1,get:function(){return Y}}),Array.isArray(d.accessibleNodes)?h.accessibleIds=d.accessibleNodes.map((function(e){return"string"==typeof e?e:ro(r.workCode,e)})):Array.isArray(d.accessible_nodes)&&(h.accessibleIds=d.accessible_nodes.map((function(e){return"string"==typeof e?e:ro(r.workCode,e)}))),Array.isArray(d.visibleNodes)?h.visibleIds=d.visibleNodes.map((function(e){return"string"==typeof e?e:ro(r.workCode,e)})):Array.isArray(d.visible_nodes)&&(h.visibleIds=d.visible_nodes.map((function(e){return"string"==typeof e?e:ro(r.workCode,e)}))),I[i]=h},T=0;T<e.observers.length;T++){if("break"===P(T))break}}for(var B=function(e){if(e.accessibleIds){var t=e.accessibleIds.filter((function(e){return!!I.find((function(t){return t.panoId===e}))}));Object.freeze(t),Object.defineProperty(e,"accessibleIds",{configurable:!1,get:function(){return t}})}else{for(var r=[],n=0;n<I.length;n++)I[n]!==e&&(Math.abs(I[n].position.y-e.position.y)>3||I[n].position.distanceTo(e.position)>10||r.push(I[n].panoId));Object.freeze(r),Object.defineProperty(e,"accessibleIds",{configurable:!1,get:function(){return r}})}if(e.visibleIds){var i=e.visibleIds.filter((function(e){return!!I.find((function(t){return t.panoId===e}))}));Object.freeze(i),Object.defineProperty(e,"visibleIds",{configurable:!1,get:function(){return i}})}else{var o=e.accessibleIds.slice();Object.freeze(o),Object.defineProperty(e,"visibleIds",{configurable:!1,get:function(){return o}})}},R=0,O=I;R<O.length;R++){B(O[R])}if(Object.freeze(I),Object.defineProperty(r,"observers",{configurable:!1,get:function(){return I}}),A instanceof Error)return A;if(e.initial){if(("Panorama"===e.initial.mode&&0===r.observers.length||"Floorplan"===e.initial.mode||"Topview"===e.initial.mode||"Model"===e.initial.mode||"Mapview"===e.initial.mode||"DepthPanorama"===e.initial.mode)&&(r.initial.mode=e.initial.mode),zi(e.initial.latitude)&&(r.initial.latitude=e.initial.latitude),zi(e.initial.longitude)?r.initial.longitude=e.initial.longitude:zi(e.initial.heading)&&(r.initial.longitude=-(360*(e.initial.heading-.25)+90)/180*Math.PI),zi(e.initial.fov)&&(r.initial.fov=e.initial.fov),r.observers.length>0){var L=void 0;zi(e.initial.panoIndex)?L=e.initial.panoIndex:zi(e.initial.pano_index)?L=e.initial.pano_index:zi(e.initial.pano)&&(L=e.initial.pano),"number"==typeof L&&(L=Lr(L,0,r.observers.length-1),r.initial.panoId=ro(r.workCode,L))}if(zi(e.initial.distance)&&(r.initial.distance=e.initial.distance),Array.isArray(e.initial.offset)){var D=[0,0,0].map((function(t,r){var n=Number(e.initial.offset[r]);return isNaN(n)||!isFinite(n)?0:n}));r.initial.offset=(new n.Vector3).fromArray(D)}!r.initial.mode&&r.initial.panoId&&(r.initial.mode="Panorama")}return A instanceof Error?A:(Ji.set(r,{works:d,options:h}),r)}function lo(e,t){"string"==typeof e&&"{"===e.trim()[0]&&(e=JSON.parse(e));var r=Ji.get(e);if(r){if(t&&!Ui(JSON.parse(r.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return e}try{return new Zi(e,null!=t?t:{})}catch(t){throw new Error("[PARSE FAILED]: "+t.message+"\nError work input:\n"+JSON.stringify(e))}}function uo(e){for(var t={},r=[],i={},o=0,a=e;o<a.length;o++){var s=a[o],l=t[s.workCode];l||(l=t[s.workCode]=(new n.Matrix4).copy(s.options.transform));for(var u=0,c=s.observers;u<c.length;u++){var h=c[u],d={active:h.active,accessibleIds:h.accessibleIds,visibleIds:h.visibleIds,floorIndex:h.floorIndex,images:h.images,index:h.index,loadable:h.loadable,panoId:h.panoId,work:h.work,derivedId:h.derivedId,video:h.video,position:(new n.Vector3).copy(h.position).applyMatrix4(l),standingPosition:(new n.Vector3).copy(h.standingPosition).applyMatrix4(l),quaternion:(new n.Quaternion).setFromRotationMatrix(Xi.makeRotationFromQuaternion(h.quaternion).premultiply(l))};Object.freeze(d),r.push(d),i[d.panoId]=d}}Object.freeze(r);for(var p=e.slice(),f={},v=0,A=p;v<A.length;v++){s=A[v];f[s.workCode]=s}return Object.freeze(Object.assign(p,{get initial(){return p.length>0?p[0].initial:{}},get resolvedObservers(){return r},getWork:function(e){return f[e]},getResolvedObserver:function(e){return i[e]},update:function(){for(var e={},i=0,o=p;i<o.length;i++){var a=o[i],s=a.options.transform,l=t[a.workCode];l?l.equals(s)||(l.copy(s),e[a.workCode]=!0):(t[a.workCode]=(new n.Matrix4).copy(s),e[a.workCode]=!0)}for(var u=0,c=r;u<c.length;u++){var h=c[u];if(!0===e[h.work.workCode]){var d=h.work.observers[h.index],f=h.work.options.transform;h.position.copy(d.position).applyMatrix4(f),h.standingPosition.copy(d.standingPosition).applyMatrix4(f),h.quaternion.setFromRotationMatrix(Xi.makeRotationFromQuaternion(d.quaternion).premultiply(f))}}}}))}function co(e,t,r){return e+(t-e)*r}function ho(e,t){var r=t[1]-t[0];return e<t[0]?ho(e+r,t):e>=t[1]?ho(e-r,t):e}function po(e,t,r,n){return n?function(e,t,r,n){var i=n[1]-n[0];return e=ho(e,n),co((t=ho(t,n))-e>i/2?e+i:e-t>i/2?e-i:e,t,r)}(e,t,r,n):co(e,t,r)}var fo=function(){function e(e){for(var t in this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=Ae(),this.startVelocity=0,this.duration=0,this.keyframes=[],e){var r=e[t];"number"==typeof r?(this.value[t]=r,this.config[t]={circle:!1}):(this.value[t]=r.value,this.config[t]={circle:r.circle})}this.keyframes=[{progress:0,value:ie({},this.value)},{progress:1,value:ie({},this.value)}]}return e.prototype.getProgress=function(e){var t=e-this.startTime;return t<0?0:t>=this.duration?1:1-function(e,t,r,n){var i=(t*r+2*e)/Math.pow(r,3),o=-(2*t*r+3*e)/Math.pow(r,2),a=t,s=e;return i*Math.pow(n,3)+o*Math.pow(n,2)+a*n+s}(1,this.startVelocity,this.duration,t)},e.prototype.getValue=function(e){for(var t=1;t<this.keyframes.length;t++)if(this.keyframes[t].progress>e){var r=this.keyframes[t-1],n=this.keyframes[t],i={};for(var o in this.config){var a=(e-r.progress)/(n.progress-r.progress);i[o]=po(r.value[o],n.value[o],a,this.config[o].circle)}return i}return ie({},this.keyframes[this.keyframes.length-1].value)},e.prototype.getProgressVelocity=function(e){var t=e-this.startTime;return t>=this.duration?0:function(e,t,r,n){var i=(t*r+2*e)/Math.pow(r,3),o=-(2*t*r+3*e)/Math.pow(r,2),a=t;return 3*i*Math.pow(n,2)+2*o*n+a}(1,this.startVelocity,this.duration,t)},e.prototype.update=function(e){return!!this.ended||(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(e))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},e.prototype.getKeyFrameSegment=function(e){for(var t=this.getProgress(e),r=1;r<this.keyframes.length;r++)if(this.keyframes[r].progress>t)return[this.keyframes[r-1],this.keyframes[r]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},e.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},e.prototype.set=function(e,t,r,n){var i;void 0===r&&(r=0),isNaN(t)&&(t=0),isNaN(r)&&(r=0),n=null!=n?n:Ae();var o=this.getProgress(n),a=this.getValue(o),s={};for(var l in this.config)s[l]=null!==(i=e[l])&&void 0!==i?i:a[l];var u=[{progress:0,value:a},{progress:1,value:s}];return this.setKeyframes(u,t,r,n)},e.prototype.setKeyframes=function(e,t,r,n){var i=this;if(void 0===r&&(r=0),e.length<2)throw new Error("keyframes invalid.");return isNaN(t)&&(t=0),isNaN(r)&&(r=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise((function(o,a){n=null!=n?n:Ae(),i.progress=0,i.ended=!1,i.startTime=n,i.startVelocity=r,i.keyframes=e,i.duration=t,0===t?(i.progress=1,i.value=ie({},e[e.length-1].value)):i.value=ie({},e[0].value),i.callbacks=[o,a]}))},e.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},e}(),vo=function(e){return e*(2-e)},Ao=function(){var e=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),r=new Uint8Array([0,2,1,2,3,1]),i=new n.BufferGeometry;return i.setAttribute("position",new n.BufferAttribute(e,3)),i.setAttribute("uv",new n.BufferAttribute(t,2)),i.setIndex(new n.BufferAttribute(r,1)),i}(),mo=function(e){function t(t){void 0===t&&(t={});var r,i,o=this;o=e.call(this)||this;var a=null!==(r=t.color)&&void 0!==r?r:16777215,s=null!==(i=t.scale)&&void 0!==i?i:1;return o.progress=0,o.opacity=0,o.loading=!1,o.current=!1,o.disabled=!1,o.currentMotion=new fo({progress:0}),o.ringMotion=new fo({scale:1,opacity:1}),o.tapMotion=new fo({scale:1,opacity:1}),o.loadingOpacityMotion=new fo({opacity:0}),o.progressMotion=new fo({progress:0}),o.progressOpacityMotion=new fo({opacity:0}),o.opacityMotion=new fo({opacity:0}),o.disableMotion=new fo({progress:0}),o.panoMesh=new n.Mesh(Ao,new n.ShaderMaterial({blending:n.CustomBlending,blendSrc:n.SrcAlphaFactor,blendDst:n.OneMinusSrcAlphaFactor,blendSrcAlpha:n.OneFactor,blendDstAlpha:n.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nuniform vec3 baseColor;\nuniform float circleScale;\nuniform float ringScale;\nuniform float ringOpacity;\nuniform float loadingAngle;\nuniform float loadingOpacity;\nuniform float progress;\nuniform float progressOpacity;\nuniform float expand0;\nuniform float expand1;\nuniform float expandOpacity;\nuniform float opacity;\nuniform float tapScale;\nuniform float tapOpacity;\nuniform float disable;\nvarying vec2 vUv;\n\n#define PI 3.141592653589793\n#define TAU 6.283185307179586\n#define SMOOTH_DIST 0.017\n#define CENTER vec2(0.5, 0.5)\n\nfloat inside(float innerDist) {\n float dist = length(CENTER - vUv);\n return smoothstep(innerDist, innerDist + SMOOTH_DIST, dist);\n}\nfloat outside(float outerDist) {\n float dist = length(CENTER - vUv);\n return 1.0 - smoothstep(outerDist - SMOOTH_DIST, outerDist, dist);\n}\n\nvec4 create_circle() {\n float dist = length(CENTER - vUv);\n float gradient = clamp(0.8 + abs(dot(normalize(vec2(1.0, -1.0)), vUv - CENTER)) * 1.5, 0.0, 1.0);\n return vec4(1.0, 1.0, 1.0, gradient * tapOpacity * inside(0.15 * circleScale * tapScale) * outside(0.234 * circleScale * tapScale));\n}\n\nvec4 create_disable() {\n float dist = length(CENTER - vUv);\n return vec4(1.0, 1.0, 1.0, 0.5 * tapOpacity * outside(0.32 * circleScale * tapScale));\n}\n\nvec4 create_ring() {\n float gradient = clamp(0.5 + abs(dot(normalize(vec2(1.0, 1.0)), vUv - CENTER)), 0.0, 1.0);\n return vec4(1.0, 1.0, 1.0, gradient * tapOpacity * ringOpacity * inside(0.27 * ringScale * tapScale) * outside(0.32 * ringScale * tapScale));\n}\n\nvec4 create_loading() {\n float angle = PI - atan(CENTER.x - vUv.x, CENTER.y - vUv.y);\n angle = mod(angle + loadingAngle, TAU);\n float gradient = (1.0 - smoothstep(0.0, TAU, angle)) * 0.4 + 0.1;\n return vec4(1.0, 1.0, 1.0, gradient * tapOpacity * loadingOpacity * inside(0.208 * circleScale * tapScale) * outside(0.3 * circleScale * tapScale));\n}\n\nvec4 create_progress() {\n float angle = PI + atan(CENTER.x - vUv.x, CENTER.y - vUv.y);\n float bar = (1.0 - step(progress * TAU, angle)) * 0.5;\n return vec4(1.0, 1.0, 1.0, bar * tapOpacity * progressOpacity * inside(0.208 * circleScale * tapScale) * outside(0.3 * circleScale * tapScale));\n}\n\nvec4 create_expand0() {\n float width = 0.2;\n float radius = 0.2 + (0.43 - 0.2) * expand0;\n float dist = length(CENTER - vUv);\n float gradient = (1.0 - clamp((radius - dist) / width, 0.0, 1.0)) * 0.8 * clamp((1.0 - abs(expand0 - 0.5) * 2.0) * 1.2, 0.0, 1.0);\n return vec4(1.0, 1.0, 1.0, gradient * expandOpacity * outside(radius));\n}\n\nvec4 create_expand1() {\n float width = 0.2;\n float radius = 0.2 + (0.43 - 0.2) * expand1;\n float dist = length(CENTER - vUv);\n float gradient = (1.0 - clamp((radius - dist) / width, 0.0, 1.0)) * 0.8 * clamp((1.0 - abs(expand1 - 0.5) * 2.0) * 1.2, 0.0, 1.0);\n return vec4(1.0, 1.0, 1.0, gradient * expandOpacity * outside(radius));\n}\n\nvoid main() {\n gl_FragColor = vec4(1.0, 1.0, 1.0, 0);\n\n vec4 expand1Color = create_expand1();\n gl_FragColor = mix(gl_FragColor, expand1Color, expand1Color.a);\n\n vec4 expand0Color = create_expand0();\n gl_FragColor = mix(gl_FragColor, expand0Color, expand0Color.a);\n\n vec4 progressColor = create_progress();\n gl_FragColor = mix(gl_FragColor, progressColor, progressColor.a);\n\n vec4 loadingColor = create_loading();\n gl_FragColor = mix(gl_FragColor, loadingColor, loadingColor.a);\n\n vec4 circleColor = create_circle();\n gl_FragColor = mix(gl_FragColor, circleColor, circleColor.a);\n\n vec4 ringColor = create_ring();\n gl_FragColor = mix(gl_FragColor, ringColor, ringColor.a);\n\n gl_FragColor = mix(gl_FragColor, create_disable(), disable);\n\n gl_FragColor = vec4(gl_FragColor.rgb * baseColor, gl_FragColor.a * opacity * opacity);\n}\n",uniforms:{baseColor:{value:new n.Color(a)},circleScale:{value:1},ringScale:{value:1},ringOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0}}})),o.renderOrder=-2,o.panoMesh.renderOrder=-2,o.panoMesh.position.y=.004,o.panoMesh.scale.set(s,1,s),o.add(o.panoMesh),o.currentStartTime=Ae(),o.needsRender=!0,o}return ne(t,e),t.prototype.setProgress=function(e){var t=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=Lr(e,0,1),this.tapMotion.ended&&(0===this.progress&&this.progressOpacityMotion.set({opacity:1},500).catch(fe),0===e?this.progressOpacityMotion.set({opacity:0},500).catch(fe).then((function(){t.progressMotion.set({progress:0},0).catch(fe)})):this.progressMotion.set({progress:Lr(1.2*e,0,1)},100).catch(fe)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=Lr(e,0,1),this.opacityMotion.set({opacity:e},200).catch(fe))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(fe),this.current=e,!0===this.current&&(this.currentStartTime=Ae()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,!0===this.disabled&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(fe))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,!0===this.loading&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(fe))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();return this.progressOpacityMotion.set({opacity:0},0).catch(fe),this.progressMotion.set({progress:0},0).catch(fe),this.tapMotion.setKeyframes([{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}],600).then((function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(fe),e.progressMotion.set({progress:e.progress},120).catch(fe)})).catch(fe)},t.prototype.updateTime=function(e,t){if(!this.progressMotion.ended){this.progressMotion.update(e);var r=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=r,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var n=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=n,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);n=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=n,this.needsRender=!0}if(this.visible=0!==this.opacityMotion.value.opacity,(!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(2*Math.PI),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;var i=(e-this.currentStartTime-1500)/2e3;if(i%5<2){var o=1+Math.sin(Math.PI*i)/25*this.currentMotion.value.progress;this.panoMesh.material.uniforms.circleScale.value=o,this.needsRender=!0}var a=(e-this.currentStartTime-1500)/2e3;if(a%5<2){var s=a%1;this.panoMesh.material.uniforms.expand0.value=vo(s)*this.currentMotion.value.progress,this.needsRender=!0}var l=(e-this.currentStartTime-1e3)/2e3;if(l%5<2){s=l%1;this.panoMesh.material.uniforms.expand1.value=vo(s)*this.currentMotion.value.progress,this.needsRender=!0}}this.currentMotion.value.progress>.2&&0===this.progress&&!1===this.loading?(e-this.currentStartTime-1e3)/2e3%5<2?.8!==this.ringMotion.getTargetKeyframe().value.scale&&this.ringMotion.set({scale:.8,opacity:0},600).catch(fe):1!==this.ringMotion.getTargetKeyframe().value.scale&&this.ringMotion.set({scale:1,opacity:1},600).catch(fe):1!==this.ringMotion.getTargetKeyframe().value.scale&&this.ringMotion.set({scale:1,opacity:1},600).catch(fe);if(!this.ringMotion.ended){var u=this.ringMotion.value;o=u.scale,n=u.opacity;this.ringMotion.update(e),this.panoMesh.material.uniforms.ringScale.value=o,this.panoMesh.material.uniforms.ringOpacity.value=n,this.needsRender=!0}if(!this.disableMotion.ended){r=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=r,this.needsRender=!0}},t.prototype.dispose=function(){this.ringMotion.dispose(),this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(n.Object3D),go=function(e){return e*(2-e)},yo=function(){var e=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),r=new Uint8Array([0,2,1,2,3,1]),i=new n.BufferGeometry;return i.setAttribute("position",new n.BufferAttribute(e,3)),i.setAttribute("uv",new n.BufferAttribute(t,2)),i.setIndex(new n.BufferAttribute(r,1)),i}(),bo=function(e){function t(t){void 0===t&&(t={});var r,i,o=this;o=e.call(this)||this;var a=null!==(r=t.color)&&void 0!==r?r:16777215,s=null!==(i=t.scale)&&void 0!==i?i:1;return o.progress=0,o.opacity=0,o.loading=!1,o.current=!1,o.disabled=!1,o.currentMotion=new fo({progress:0}),o.tapMotion=new fo({scale:1,opacity:1}),o.loadingOpacityMotion=new fo({opacity:0}),o.progressMotion=new fo({progress:0}),o.progressOpacityMotion=new fo({opacity:0}),o.opacityMotion=new fo({opacity:0}),o.disableMotion=new fo({progress:0}),o.panoMesh=new n.Mesh(yo,new n.ShaderMaterial({blending:n.CustomBlending,blendSrc:n.SrcAlphaFactor,blendDst:n.OneMinusSrcAlphaFactor,blendSrcAlpha:n.OneFactor,blendDstAlpha:n.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nuniform vec3 baseColor;\nuniform float circleScale;\nuniform float circleOpacity;\nuniform float loadingAngle;\nuniform float loadingOpacity;\nuniform float progress;\nuniform float progressOpacity;\nuniform float expand0;\nuniform float expand1;\nuniform float expandOpacity;\nuniform float opacity;\nuniform float tapScale;\nuniform float tapOpacity;\nuniform float disable;\nvarying vec2 vUv;\n\n#define PI 3.141592653589793\n#define TAU 6.283185307179586\n#define SMOOTH_DIST 0.017\n#define CENTER vec2(0.5, 0.5)\n\nfloat inside(float innerDist) {\n float dist = length(CENTER - vUv);\n return smoothstep(innerDist, innerDist + SMOOTH_DIST, dist);\n}\nfloat outside(float outerDist) {\n float dist = length(CENTER - vUv);\n return 1.0 - smoothstep(outerDist - SMOOTH_DIST, outerDist, dist);\n}\n\nvec4 create_circle() {\n float dist = length(CENTER - vUv);\n return vec4(1.0, 1.0, 1.0, 0.8 * circleOpacity * tapOpacity * inside(0.2 * circleScale * tapScale) * outside(0.3 * circleScale * tapScale));\n}\n\nvec4 create_disable() {\n float dist = length(CENTER - vUv);\n return vec4(1.0, 1.0, 1.0, 0.5 * tapOpacity * outside(0.32 * circleScale * tapScale));\n}\n\nvec4 create_loading() {\n float angle = PI - atan(CENTER.x - vUv.x, CENTER.y - vUv.y);\n angle = mod(angle + loadingAngle, TAU);\n float gradient = (1.0 - smoothstep(0.0, TAU, angle)) * 0.9 + 0.1;\n return vec4(1.0, 1.0, 1.0, gradient * tapOpacity * loadingOpacity * inside(0.2 * circleScale * tapScale) * outside(0.3 * circleScale * tapScale));\n}\n\nvec4 create_progress() {\n float angle = PI + atan(CENTER.x - vUv.x, CENTER.y - vUv.y);\n float bar = (1.0 - step(progress * TAU, angle)) * 0.7;\n return vec4(1.0, 1.0, 1.0, bar * tapOpacity * progressOpacity * inside(0.2 * circleScale * tapScale) * outside(0.3 * circleScale * tapScale));\n}\n\nvec4 create_expand0() {\n float width = 0.2;\n float radius = 0.25 + (0.5 - 0.25) * expand0;\n float dist = length(CENTER - vUv);\n float gradient = (1.0 - clamp((radius - dist) / width, 0.0, 1.0)) * 0.8 * clamp((1.0 - abs(expand0 - 0.5) * 2.0) * 1.2, 0.0, 1.0);\n return vec4(1.0, 1.0, 1.0, gradient * expandOpacity * outside(radius));\n}\n\nvec4 create_expand1() {\n float width = 0.2;\n float radius = 0.25 + (0.48 - 0.25) * expand1;\n float dist = length(CENTER - vUv);\n float gradient = (1.0 - clamp((radius - dist) / width, 0.0, 1.0)) * 0.8 * clamp((1.0 - abs(expand1 - 0.5) * 2.0) * 1.2, 0.0, 1.0);\n return vec4(1.0, 1.0, 1.0, gradient * expandOpacity * outside(radius));\n}\n\nvoid main() {\n gl_FragColor = vec4(1.0, 1.0, 1.0, 0);\n\n vec4 expand1Color = create_expand1();\n gl_FragColor = mix(gl_FragColor, expand1Color, expand1Color.a);\n\n vec4 expand0Color = create_expand0();\n gl_FragColor = mix(gl_FragColor, expand0Color, expand0Color.a);\n\n vec4 circleColor = create_circle();\n gl_FragColor = mix(gl_FragColor, circleColor, circleColor.a);\n\n vec4 progressColor = create_progress();\n gl_FragColor = mix(gl_FragColor, progressColor, progressColor.a);\n\n vec4 loadingColor = create_loading();\n gl_FragColor = mix(gl_FragColor, loadingColor, loadingColor.a);\n\n gl_FragColor = mix(gl_FragColor, create_disable(), disable);\n\n gl_FragColor = vec4(gl_FragColor.rgb * baseColor, gl_FragColor.a * opacity * opacity);\n}\n",uniforms:{baseColor:{value:new n.Color(a)},circleScale:{value:1},circleOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0}}})),o.renderOrder=-2,o.panoMesh.renderOrder=-2,o.panoMesh.position.y=.004,o.panoMesh.scale.set(s,1,s),o.add(o.panoMesh),o.currentStartTime=Ae(),o.needsRender=!0,o}return ne(t,e),t.prototype.setProgress=function(e){var t=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=Lr(e,0,1),this.tapMotion.ended&&(0===this.progress&&this.progressOpacityMotion.set({opacity:1},500).catch(fe),0===e?this.progressOpacityMotion.set({opacity:0},500).catch(fe).then((function(){t.progressMotion.set({progress:0},0).catch(fe)})):this.progressMotion.set({progress:Lr(1.2*e,0,1)},100).catch(fe)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=Lr(e,0,1),this.opacityMotion.set({opacity:e},200).catch(fe))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(fe),this.current=e,!0===this.current&&(this.currentStartTime=Ae()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,!0===this.disabled&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(fe))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,!0===this.loading&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(fe))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();return this.progressOpacityMotion.set({opacity:0},0).catch(fe),this.progressMotion.set({progress:0},0).catch(fe),this.tapMotion.setKeyframes([{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}],600).then((function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(fe),e.progressMotion.set({progress:e.progress},120).catch(fe)})).catch(fe)},t.prototype.updateTime=function(e,t){if(!this.progressMotion.ended){this.progressMotion.update(e);var r=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=r,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var n=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=n,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);n=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=n,this.needsRender=!0}if(this.visible=0!==this.opacityMotion.value.opacity,(!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(2*Math.PI),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.panoMesh.material.uniforms.circleOpacity.value=Math.max(.6,1-Math.max(this.loadingOpacityMotion.value.opacity,this.progressOpacityMotion.value.opacity)),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;var i=(e-this.currentStartTime-1500)/2e3;if(i%5<2){var o=1+Math.sin(Math.PI*i)/25*this.currentMotion.value.progress;this.panoMesh.material.uniforms.circleScale.value=o,this.needsRender=!0}var a=(e-this.currentStartTime-1500)/2e3;if(a%5<2){var s=a%1;this.panoMesh.material.uniforms.expand0.value=go(s)*this.currentMotion.value.progress,this.needsRender=!0}var l=(e-this.currentStartTime-1e3)/2e3;if(l%5<2){s=l%1;this.panoMesh.material.uniforms.expand1.value=go(s)*this.currentMotion.value.progress,this.needsRender=!0}}if(!this.disableMotion.ended){r=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=r,this.needsRender=!0}},t.prototype.dispose=function(){this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(n.Object3D),xo=function(e){return e*(2-e)},wo=function(){var e=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),r=new Uint8Array([0,2,1,2,3,1]),i=new n.BufferGeometry;return i.setAttribute("position",new n.BufferAttribute(e,3)),i.setAttribute("uv",new n.BufferAttribute(t,2)),i.setIndex(new n.BufferAttribute(r,1)),i}(),Mo=function(e){function t(t){void 0===t&&(t={});var r,i,o,a,s,l,u,c=this;c=e.call(this)||this;var h=null!==(r=t.color)&&void 0!==r?r:16777215,d=null!==(i=t.scale)&&void 0!==i?i:1,p=t.map,f=null!==(o=t.mapAlpha)&&void 0!==o?o:1,v=null!==(a=t.mapUseColor)&&void 0!==a&&a,A=null!==(s=t.mapUseReverse)&&void 0!==s&&s,m=null!==(l=t.borderWidth)&&void 0!==l?l:.1,g=null!==(u=t.borderColor)&&void 0!==u?u:16777215;return c.progress=0,c.opacity=0,c.loading=!1,c.current=!1,c.disabled=!1,c.currentMotion=new fo({progress:0}),c.tapMotion=new fo({scale:1,opacity:1}),c.loadingOpacityMotion=new fo({opacity:0}),c.progressMotion=new fo({progress:0}),c.progressOpacityMotion=new fo({opacity:0}),c.opacityMotion=new fo({opacity:0}),c.disableMotion=new fo({progress:0}),c.panoMesh=new n.Mesh(wo,new n.ShaderMaterial({blending:n.CustomBlending,blendSrc:n.SrcAlphaFactor,blendDst:n.OneMinusSrcAlphaFactor,blendSrcAlpha:n.OneFactor,blendDstAlpha:n.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\n#if defined(USE_MAP)\nuniform sampler2D map;\nuniform float mapAlpha;\n#endif\n#if defined(USE_BORDER)\nuniform float borderWidth;\nuniform vec3 borderColor;\n#endif\nuniform vec3 baseColor;\nuniform float circleScale;\nuniform float circleOpacity;\nuniform float loadingAngle;\nuniform float loadingOpacity;\nuniform float progress;\nuniform float progressOpacity;\nuniform float expand0;\nuniform float expand1;\nuniform float expandOpacity;\nuniform float opacity;\nuniform float tapScale;\nuniform float tapOpacity;\nuniform float disable;\nvarying vec2 vUv;\n\n#define PI 3.141592653589793\n#define TAU 6.283185307179586\n#define SMOOTH_DIST 0.017\n#define CENTER vec2(0.5, 0.5)\n\nfloat inside(float innerDist) {\n float dist = length(CENTER - vUv);\n return smoothstep(innerDist, innerDist + SMOOTH_DIST, dist);\n}\nfloat outside(float outerDist) {\n float dist = length(CENTER - vUv);\n return 1.0 - smoothstep(outerDist - SMOOTH_DIST, outerDist, dist);\n}\n\nvec4 create_circle() {\n float dist = length(CENTER - vUv);\n float radius = 0.3 * circleScale * tapScale;\n #if defined(USE_MAP)\n float delta = radius / 0.5;\n vec2 deltaUv = (vUv - CENTER) / delta + CENTER;\n vec4 image = texture2D(map, deltaUv);\n image.a = image.a * mapAlpha;\n #if defined(USE_COLOR)\n image = vec4(baseColor, 1.0) * image;\n #endif\n #endif\n #if defined(USE_REVERSE)\n image = vec4(baseColor, 1.0 - image.a);\n #else\n #if defined(USE_BORDER)\n float borderDist = clamp(borderWidth, 0.0, 1.0);\n float clipAlpha = inside(radius - borderDist * radius);\n float gradient = clamp(borderWidth * 2.0 + abs(dot(normalize(vec2(1.0, -1.0)), vUv - CENTER)), 0.0, 1.0);\n vec4 borderColor = vec4(borderColor, clipAlpha * gradient);\n image = mix(borderColor, image, image.a);\n #endif\n #endif\n return vec4(image.rgb, image.a * circleOpacity * tapOpacity * outside(radius));\n}\n\nvec4 create_disable() {\n float dist = length(CENTER - vUv);\n return vec4(baseColor, 0.5 * tapOpacity * outside(0.32 * circleScale * tapScale));\n}\n\nvec4 create_loading() {\n float angle = PI - atan(CENTER.x - vUv.x, CENTER.y - vUv.y);\n angle = mod(angle + loadingAngle, TAU);\n float gradient = (1.0 - smoothstep(0.0, TAU, angle)) * 0.9 + 0.1;\n float radius = 0.3 * circleScale * tapScale;\n float inner = inside(radius - 0.2 * radius);\n #if defined(USE_BORDER)\n float borderDist = clamp(borderWidth, 0.0, 1.0);\n inner = inside(radius - borderDist * radius);\n #endif\n return vec4(baseColor, gradient * tapOpacity * loadingOpacity * inner * outside(radius));\n}\n\nvec4 create_progress() {\n float angle = PI + atan(CENTER.x - vUv.x, CENTER.y - vUv.y);\n float bar = (1.0 - step(progress * TAU, angle)) * 0.7;\n float radius = 0.3 * circleScale * tapScale;\n float inner = inside(radius - 0.2 * radius);\n #if defined(USE_BORDER)\n float borderDist = clamp(borderWidth, 0.0, 1.0);\n inner = inside(radius - borderDist * radius);\n #endif\n return vec4(baseColor, bar * tapOpacity * progressOpacity * inner * outside(radius));\n}\n\nvec4 create_expand0() {\n float width = 0.2;\n float radius = 0.25 + (0.5 - 0.25) * expand0;\n float dist = length(CENTER - vUv);\n float gradient = (1.0 - clamp((radius - dist) / width, 0.0, 1.0)) * 0.8 * clamp((1.0 - abs(expand0 - 0.5) * 2.0) * 1.2, 0.0, 1.0);\n return vec4(baseColor, gradient * expandOpacity * outside(radius));\n}\n\nvec4 create_expand1() {\n float width = 0.2;\n float radius = 0.25 + (0.48 - 0.25) * expand1;\n float dist = length(CENTER - vUv);\n float gradient = (1.0 - clamp((radius - dist) / width, 0.0, 1.0)) * 0.8 * clamp((1.0 - abs(expand1 - 0.5) * 2.0) * 1.2, 0.0, 1.0);\n return vec4(baseColor, gradient * expandOpacity * outside(radius));\n}\n\nvoid main() {\n gl_FragColor = vec4(baseColor, 0);\n\n vec4 expand1Color = create_expand1();\n gl_FragColor = mix(gl_FragColor, expand1Color, expand1Color.a);\n\n vec4 expand0Color = create_expand0();\n gl_FragColor = mix(gl_FragColor, expand0Color, expand0Color.a);\n\n vec4 circleColor = create_circle();\n gl_FragColor = mix(gl_FragColor, circleColor, circleColor.a);\n\n vec4 progressColor = create_progress();\n gl_FragColor = mix(gl_FragColor, progressColor, progressColor.a);\n\n vec4 loadingColor = create_loading();\n gl_FragColor = mix(gl_FragColor, loadingColor, loadingColor.a);\n\n gl_FragColor = mix(gl_FragColor, create_disable(), disable);\n\n gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);\n}\n",defines:{USE_COLOR:v,USE_MAP:void 0!==p,USE_BORDER:m>0,USE_REVERSE:A},uniforms:{baseColor:{value:new n.Color(h)},circleScale:{value:1},circleOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0},map:{value:p},mapAlpha:{value:f},borderWidth:{value:m},borderColor:{value:new n.Color(g)}}})),c.renderOrder=-2,c.panoMesh.renderOrder=-2,c.panoMesh.position.y=.004,c.panoMesh.scale.set(d,1,d),c.add(c.panoMesh),c.currentStartTime=Ae(),c.needsRender=!0,c}return ne(t,e),t.prototype.setProgress=function(e){var t=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=Lr(e,0,1),this.tapMotion.ended&&(0===this.progress&&this.progressOpacityMotion.set({opacity:1},500).catch(fe),0===e?this.progressOpacityMotion.set({opacity:0},500).catch(fe).then((function(){t.progressMotion.set({progress:0},0).catch(fe)})):this.progressMotion.set({progress:Lr(1.2*e,0,1)},100).catch(fe)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=Lr(e,0,1),this.opacityMotion.set({opacity:e},200).catch(fe))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(fe),this.current=e,!0===this.current&&(this.currentStartTime=Ae()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,!0===this.disabled&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(fe))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,!0===this.loading&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(fe))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();return this.progressOpacityMotion.set({opacity:0},0).catch(fe),this.progressMotion.set({progress:0},0).catch(fe),this.tapMotion.setKeyframes([{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}],600).then((function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(fe),e.progressMotion.set({progress:e.progress},120).catch(fe)})).catch(fe)},t.prototype.updateTime=function(e,t){if(!this.progressMotion.ended){this.progressMotion.update(e);var r=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=r,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var n=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=n,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);n=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=n,this.needsRender=!0}if(this.visible=0!==this.opacityMotion.value.opacity,(!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(2*Math.PI),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.panoMesh.material.uniforms.circleOpacity.value=Math.max(.6,1-Math.max(this.loadingOpacityMotion.value.opacity,this.progressOpacityMotion.value.opacity)),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;var i=(e-this.currentStartTime-1500)/2e3;if(i%5<2){var o=i%1;this.panoMesh.material.uniforms.expand0.value=xo(o)*this.currentMotion.value.progress,this.needsRender=!0}var a=(e-this.currentStartTime-1e3)/2e3;if(a%5<2){o=a%1;this.panoMesh.material.uniforms.expand1.value=xo(o)*this.currentMotion.value.progress,this.needsRender=!0}}if(!this.disableMotion.ended){r=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=r,this.needsRender=!0}},t.prototype.dispose=function(){this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(n.Object3D),Eo=new n.CircleBufferGeometry(.1,16),Co=new n.ShaderMaterial({vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nvarying vec2 vUv;\n\nfloat smoothDist = 0.01;\nvoid main() {\n vec2 center = vec2(0.5, 0.5);\n float dist = length(center - vUv);\n float outerDist = 0.49;\n float innerDist = 0.29;\n\n float outside = 1.0 - smoothstep(outerDist - smoothDist, outerDist, dist);\n float inside = smoothstep(innerDist, innerDist + smoothDist, dist);\n\n vec4 bg = vec4(0.576, 0.635, 1.0, 0.3);\n float gradientAlpha = clamp(abs(dist - (outerDist + innerDist) / 2.0) / (outerDist - innerDist) * 1.5 + 0.1, 0.0, 1.0);\n vec4 gradient = vec4(1.0, 1.0, 1.0, gradientAlpha);\n\n gl_FragColor = mix(bg, gradient, gradient.a);\n\n gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * outside * inside);\n}\n",transparent:!0}),Io=function(e){function t(){var t=e.call(this)||this;return t.ringMesh=new n.Mesh(Eo,Co),t.ringMesh.renderOrder=-2,t.add(t.ringMesh),t}return ne(t,e),t.prototype.dispose=function(){this.remove(this.ringMesh)},t}(n.Object3D);function So(e){return null==e}function Po(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function To(){return(Po()+Po()+"-"+Po()+"-4"+Po().substr(0,3)+"-"+Po()+"-"+Po()+Po()+Po()).toLowerCase()}function Bo(e,t,r){var n=Math.abs(e-t);return n<.001||void 0!==r&&Math.abs(r-n)<.001}function Ro(e,t,r){return!Bo(e,t,r)}function Oo(e,t){return e.distanceTo(t)<.001}function Lo(e,t){return!Oo(e,t)}var Do=new n.Vector3(0,0,0),Fo=function(e){function t(t,r){void 0===r&&(r=Do);var i=e.call(this)||this,o=new n.BoxBufferGeometry(t.max.x-t.min.x+2*r.x,t.max.y-t.min.y+2*r.y,t.max.z-t.min.z+2*r.z,1,1);o.groups.length=0,o.groups.push({start:0,count:36,materialIndex:0}),o.applyMatrix4((new n.Matrix4).makeScale(-1,1,1)),o.computeVertexNormals();var a=new Qt;a.defines.USE_MAP=!1,a.defines.USE_UV=!1,a.defines.USE_PANO_OPACITY=!0,a.uniforms.diffuse.value=new n.Color(10066329),a.depthWrite=!1;var s=new $e(o,[a]);return s.position.copy(t.getCenter(new n.Vector3)),s.frustumCulled=!1,i.add(s),i.boundingBox=new n.Box3,i.boundingBox.setFromObject(i),i.renderOrder=s.renderOrder=-1001,i}return ne(t,e),t.prototype.dispose=function(){this.disposeMaterial(),this.disposeGeometry()},t}(it);var ko=2*Math.PI;function Qo(e){return e>=0&&e<ko?e:(e%ko+ko)%ko}var No=Math.PI,Vo=2*No;function Uo(e,t,r){if(e===t)return t;var n=t-e;return Math.abs(n)<=r?t:e+(n>0?1:-1)*r}function zo(e,t,r){if(e.longitude===t.longitude&&e.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var n=Qo(e.longitude),i=e.latitude,o=Qo(t.longitude),a=t.latitude;o-n>No?n+=Vo:n-o>No&&(n-=Vo);var s=r/Math.sqrt(Math.pow(o-n,2)+Math.pow(a-i,2));return s>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:n+(o-n)*s,latitude:i+(a-i)*s}}!function(){try{var e=document.createElement("canvas");return!(!window.WebGLRenderingContext||!e.getContext("webgl")&&!e.getContext("experimental-webgl"))}catch(e){return!1}}();var qo=function(){var e="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"node";return/android/i.test(e)||/webos/i.test(e)||/ipad|iphone|ipod/i.test(e)||/iemobile/i.test(e)||/opera mini/i.test(e)||/blackberry/i.test(e)||/windows phone/i.test(e)};function Ho(e,t){e.mode=t.mode,e.panoId=t.panoId,e.panoIndex=t.panoIndex,e.longitude=t.longitude,e.latitude=t.latitude,e.fov=t.fov,e.offset.copy(t.offset),e.distance=t.distance}function _o(e,t){return e.panoId===t.panoId&&e.mode===t.mode&&Bo(e.longitude,t.longitude,2*Math.PI)&&Bo(e.latitude,t.latitude)&&Bo(e.fov,t.fov)&&Oo(e.offset,t.offset)&&Bo(e.distance,t.distance)}function jo(e){switch(e){case"Floorplan":case"Mapview":return!0;default:return!1}}function Go(e){switch(e){case"Panorama":case"VRPanorama":case"XRPanorama":case"Model":case"DepthPanorama":return!0;default:return!1}}var Ko=function(e){return Number(e)};function Wo(e,t,r){var n;void 0===t&&(t=Ko),void 0===r&&(r=!1);for(var i,o=1/0,a=0,s=e;a<s.length;a++){var l=s[a],u=t(l);u<=o&&(i=(n=[l,u])[0],o=n[1])}return isFinite(o)||(o=0),r?[i,o]:i}function Yo(e){for(var t in e)return!1;return!0}function Xo(e){return{longitude:e.longitude,latitude:e.latitude,fov:e.fov,offset:e.offset.clone(),distance:e.distance}}
368
358
  /*! Hammer.JS - v2.0.7 - 2016-04-22
369
359
  * http://hammerjs.github.io/
370
360
  *
371
361
  * Copyright (c) 2016 Jorik Tangelder;
372
- * Licensed under the MIT license */var pr=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 A(e,t,i){return setTimeout(f(e,i),t)}function l(e,t,i){return!!Array.isArray(e)&&(h(e,i[t],i),!0)}function h(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 d(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 g=d((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`."),p=d((function(e,t){return g(e,t,!0)}),"merge","Use `assign`.");function M(e,t,i){var n,s=t.prototype;(n=e.prototype=Object.create(s)).constructor=e,n._super=s,i&&r(n,i)}function f(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 m(e,t){return e===n?t:e}function v(e,t,i){h(w(t),(function(t){e.addEventListener(t,i,!1)}))}function N(e,t,i){h(w(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 E(e,t){return e.indexOf(t)>-1}function w(e){return e.trim().split(/\s+/g)}function I(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 T(e){return Array.prototype.slice.call(e,0)}function x(e,t,i){for(var n=[],r=[],s=0;s<e.length;){var o=t?e[s][t]:e[s];I(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 j(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 C(t){var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||e}var b="ontouchstart"in e,S=j(e,"PointerEvent")!==n,L=b&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),O="touch",B="mouse",Q=24,k=["x","y"],P=["clientX","clientY"];function U(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=_(t));s>1&&!i.firstMultiple?i.firstMultiple=_(t):1===s&&(i.firstMultiple=!1);var o=i.firstInput,a=i.firstMultiple,A=a?a.center:o.center,l=t.center=Y(r);t.timeStamp=c(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=G(A,l),t.distance=V(A,l),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=H(t.deltaX,t.deltaY);var h=F(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=h.x,t.overallVelocityY=h.y,t.overallVelocity=u(h.x)>u(h.y)?h.x:h.y,t.scale=a?function(e,t){return V(t[0],t[1],P)/V(e[0],e[1],P)}(a.pointers,r):1,t.rotation=a?function(e,t){return G(t[1],t[0],P)+G(e[1],e[0],P)}(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 A=t.deltaX-a.deltaX,l=t.deltaY-a.deltaY,h=F(c,A,l);r=h.x,s=h.y,i=u(h.x)>u(h.y)?h.x:h.y,o=H(A,l),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 d=e.element;D(t.srcEvent.target,d)&&(d=t.srcEvent.target);t.target=d}(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function _(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 H(e,t){return e===t?1:u(e)>=u(t)?e<0?2:4:t<0?8:16}function V(e,t,i){i||(i=k);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=k);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return 180*Math.atan2(r,n)/Math.PI}U.prototype={handler:function(){},init:function(){this.evEl&&v(this.element,this.evEl,this.domHandler),this.evTarget&&v(this.target,this.evTarget,this.domHandler),this.evWin&&v(C(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(C(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},q="mousedown",W="mousemove mouseup";function X(){this.evEl=q,this.evWin=W,this.pressed=!1,U.apply(this,arguments)}M(X,U,{handler:function(e){var t=K[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:B,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},J={2:O,3:"pen",4:B,5:"kinect"},$="pointerdown",ee="pointermove pointerup pointercancel";function te(){this.evEl=$,this.evWin=ee,U.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&($="MSPointerDown",ee="MSPointerMove MSPointerUp MSPointerCancel"),M(te,U,{handler:function(e){var t=this.store,i=!1,n=e.type.toLowerCase().replace("ms",""),r=Z[n],s=J[e.pointerType]||e.pointerType,o=s==O,a=I(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,U.apply(this,arguments)}function oe(e,t){var i=T(e.touches),n=T(e.changedTouches);return 12&t&&(i=x(i.concat(n),"identifier",!0)),[i,n]}M(se,U,{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:O,srcEvent:e})}}});var ae={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ue="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=ue,this.targetIds={},U.apply(this,arguments)}function Ae(e,t){var i=T(e.touches),n=this.targetIds;if(3&t&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,s,o=T(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?[x(s.concat(a),"identifier",!0),a]:void 0}M(ce,U,{handler:function(e){var t=ae[e.type],i=Ae.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:O,srcEvent:e})}});function le(){U.apply(this,arguments);var e=f(this.handler,this);this.touch=new ce(this.manager,e),this.mouse=new X(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function he(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,de.call(this,t)):12&e&&de.call(this,t)}function de(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 ge(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}M(le,U,{handler:function(e,t,i){var n=i.pointerType==O,r=i.pointerType==B;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)he.call(this,t,i);else if(r&&ge.call(this,i))return;this.callback(e,t,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var pe=o?j(o.style,"touchAction"):n,Me=pe!==n,fe="compute",ye="auto",me="manipulation",ve="none",Ne="pan-x",De="pan-y",Ee=function(){if(!Me)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 we(e,t){this.manager=e,this.set(t)}we.prototype={set:function(e){e==fe&&(e=this.compute()),Me&&this.manager.element.style&&Ee[e]&&(this.manager.element.style[pe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return h(this.manager.recognizers,(function(t){y(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(E(e,ve))return ve;var t=E(e,Ne),i=E(e,De);if(t&&i)return ve;if(t||i)return t?Ne:De;if(E(e,me))return me;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=E(n,ve)&&!Ee.none,s=E(n,De)&&!Ee["pan-y"],o=E(n,Ne)&&!Ee["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&Q?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Ie=32;function Te(e){this.options=r({},this.defaults,e||{}),this.id=z++,this.manager=null,this.options.enable=m(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function xe(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function je(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 Ce(){Te.apply(this,arguments)}function be(){Ce.apply(this,arguments),this.pX=null,this.pY=null}function Se(){Ce.apply(this,arguments)}function Le(){Te.apply(this,arguments),this._timer=null,this._input=null}function Oe(){Ce.apply(this,arguments)}function Be(){Ce.apply(this,arguments)}function Qe(){Te.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ke(e,t){return(t=t||{}).recognizers=m(t.recognizers,ke.defaults.preset),new Pe(e,t)}Te.prototype={defaults:{},set:function(e){return r(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(l(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 l(e,"dropRecognizeWith",this)||(e=ze(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(l(e,"requireFailure",this))return this;var t=this.requireFail;return-1===I(t,e=ze(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(l(e,"dropRequireFailure",this))return this;e=ze(e,this);var t=I(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+xe(i)),n(t.options.event),e.additionalEvent&&n(e.additionalEvent),i>=8&&n(t.options.event+xe(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Ie},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=Ie);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},M(Ce,Te,{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:Ie}}),M(be,Ce,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(De),e&Q&&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 Ce.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=je(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),M(Se,Ce,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ve]},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)}}),M(Le,Te,{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=A((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Ie},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)))}}),M(Oe,Ce,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ve]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),M(Be,Ce,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return be.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&Q&&(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=je(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),M(Qe,Te,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[me]},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||V(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=A((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Ie},failTimeout:function(){return this._timer=A((function(){this.state=Ie}),this.options.interval,this),Ie},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ke.VERSION="2.0.7",ke.defaults={domEvents:!1,touchAction:fe,enable:!0,inputTarget:null,inputClass:null,preset:[[Oe,{enable:!1}],[Se,{enable:!1},["rotate"]],[Be,{direction:6}],[be,{direction:6},["swipe"]],[Qe],[Qe,{event:"doubletap",taps:2},["tap"]],[Le]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Pe(e,t){var i;this.options=r({},ke.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:L?ce:b?le:X))(i,R),this.touchAction=new we(this,this.options.touchAction),Ue(this,!0),h(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 Ue(e,t){var i,n=e.element;n.style&&(h(e.options.cssProps,(function(r,s){i=j(n.style,s),t?(e.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=e.oldCssProps[i]||""})),t||(e.oldCssProps={}))}return Pe.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 Te)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(l(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(l(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=I(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 h(w(e),(function(e){i[e]=i[e]||[],i[e].push(t)})),this}},off:function(e,t){if(e!==n){var i=this.handlers;return h(w(e),(function(e){t?i[e]&&i[e].splice(I(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&&Ue(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(ke,{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:Ie,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:Q,DIRECTION_ALL:30,Manager:Pe,Input:U,TouchAction:we,TouchInput:ce,MouseInput:X,PointerEventInput:te,TouchMouseInput:le,SingleTouchInput:se,Recognizer:Te,AttrRecognizer:Ce,Tap:Qe,Pan:be,Swipe:Be,Pinch:Se,Rotate:Oe,Press:Le,on:v,off:N,each:h,merge:p,extend:g,assign:r,inherit:M,bindFn:f,prefixed:j}),ke}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{});function Mr(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 fr(e,t,i){var n=t.offsetWidth,s=t.offsetHeight,o=t.getBoundingClientRect(),a=o.top,u=o.left;return i&&(u+=n*i.left,a+=s*(1-i.bottom-i.height),n*=i.width,s*=i.height),new r.Vector2((e.x-u)/n*2-1,-(e.y-a)/s*2+1)}!function(){try{var e=document.createElement("canvas");!window.WebGLRenderingContext||!e.getContext("webgl")&&e.getContext("experimental-webgl")}catch(e){return!1}}();var yr=new r.OrthographicCamera(-1,1,1,-1,0,1),mr=new r.BufferGeometry;mr.setAttribute("position",new r.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),mr.setAttribute("uv",new r.Float32BufferAttribute([0,2,0,0,2,0],2));var vr=new r.Mesh(mr),Nr=new r.Scene;Nr.add(vr);var Dr=function(){function e(e,t){var i;this.renderer=e,this.material=new r.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 r.Uniform(null)},t.uniforms),defines:Object.assign({},t.defines),blending:r.NoBlending,depthWrite:!1,depthTest:!1})}return e.prototype.render=function(e,t){var i=this.renderer.getRenderTarget(),n=vr.material;this.material.uniforms.inputBuffer.value=e.texture,vr.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Nr,yr),this.renderer.setRenderTarget(i),vr.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Er=function(){function e(e){this.renderer=e,this.material=new r.ShaderMaterial({vertexShader:"\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nuniform vec3 inputValue;\nvoid main() {\n gl_FragColor = vec4(inputValue, 1.0);\n}\n",uniforms:Object.assign({inputValue:new r.Uniform(new r.Vector3)}),blending:r.NoBlending,depthWrite:!1,depthTest:!1})}return e.prototype.render=function(e,t){var i=this.renderer.getRenderTarget(),n=vr.material;this.material.uniforms.inputValue.value.copy(e),vr.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Nr,yr),this.renderer.setRenderTarget(i),vr.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),wr=function(e){function i(t){return e.call(this,t,{fragment:"\nuniform sampler2D inputBuffer;\nvarying vec2 vUv;\nvoid main() {\n gl_FragColor = texture2D(inputBuffer, vUv);\n}\n"})||this}return t.__extends(i,e),i}(Dr),Ir=function(){function e(e){this.enable=!0,this.renderer=e,this.copyPass=new wr(this.renderer)}return e.prototype.render=function(e,t,i){this.copyPass.render(e,t)},e.prototype.dispose=function(){this.copyPass.dispose()},e}(),Tr=function(e){function i(t){var n,r=e.call(this)||this,s=i.parseArgs(t);return r.pending=!0,r.userAction=s.initial[3],r.destroyed=!1,r.ident=s.ident,r.scene=s.scene,r.helper=s.helper,r.camera=s.camera,r.renderer=s.renderer,r.scissor=s.scissor,r.element=s.element,r.model=s.model,r.enableIOSEDR=null!==(n=s.enableIOSEDR)&&void 0!==n&&n,r.work=s.work,r.imageOptions=s.imageOptions,r.videoTexture=s.videoTexture,r.networkSubscribe=s.networkSubscribe,r.needsRender=!0,r.maxFov=120,r.minFov=40,r.maxLatitude=+Math.PI/2,r.minLatitude=-Math.PI/2,r.cameraMotion=new dn({longitude:{value:r.camera.pose.longitude,circle:[0,2*Math.PI]},latitude:r.camera.pose.latitude,fov:r.camera.pose.fov}),r.eventUnbinds=[s.element].concat(s.extraElements||[]).map((function(e){return r.bindEvents(e)})),ot.shared.add((function(){return r.initAnimation.apply(r,s.initial)}),!0),r}return t.__extends(i,e),i.parseArgs=function(e){return t.__assign({},e)},i.initAnimationEndState=function(e){var t=this.parseArgs(e);return{longitude:t.camera.pose.longitude,latitude:t.camera.pose.latitude,fov:t.camera.pose.fov,offset:t.camera.pose.offset.clone()}},i.prototype.destroy=function(){var e;this.destroyed=!0,this.off(),this.cameraMotion.dispose();for(var t=0,i=this.eventUnbinds;t<i.length;t++){(0,i[t])()}this.effect&&(this.effect.dispose(),delete this.effect),delete this.panState,null===(e=this.pressState)||void 0===e||e.stop(),delete this.pressState},i.prototype.isReady=function(){return!1===this.pending&&!0===this.cameraMotion.ended},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=0,i=this.eventUnbinds;t<i.length;t++){if(i[t].element===e)break}},i.prototype.updateRenderSize=function(){this.needsRender=!0},i.prototype.updateModel=function(e){this.model=e,this.needsRender=!0},i.prototype.updateWork=function(e,t,i,n,r){return this.work=e,this.userAction=r,!1},i.prototype.updateTime=function(e,t){if(!this.destroyed){var i={};this.cameraMotion.ended&&(this.cameraMotion.update(e),i.longitude=this.cameraMotion.value.longitude,i.latitude=this.cameraMotion.value.latitude,i.fov=this.cameraMotion.value.fov),dr(i)&&this.setCamera(i)}},i.prototype.render=function(e){this.renderer.render(this.scene,this.camera)},i.prototype.postProcessing=function(e,t,i){this.destroyed||(this.effect||(this.effect=new Ir(this.renderer)),this.effect.render(e,t,i))},i.prototype.updateCamera=function(e,t,i){return this.userAction=i,this.cameraMotion.set(e,t)},i.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(Re())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:this.camera.pose.offset.clone()}},i.prototype.moveToPano=function(e,t,i){void 0===t&&(t={}),this.userAction=i;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,this.userAction),this.emit("panoWillArrive",e,n,this.userAction),this.emit("panoArrived",e,n,this.userAction),t.moveEndCallback&&t.moveEndCallback(e,n)},i.prototype.initAnimation=function(e,t,i,n){this.pending=!1,this.userAction=n},i.prototype.setCamera=function(e){var t,i,n,r,s;void 0===e&&(e={});var o=null!==(t=e.longitude)&&void 0!==t?t:this.camera.pose.longitude,a=null!==(i=e.latitude)&&void 0!==i?i:this.camera.pose.latitude,u=null!==(n=e.fov)&&void 0!==n?n:this.camera.pose.fov,c=null!==(r=e.distance)&&void 0!==r?r:this.camera.pose.distance,A=null!==(s=e.offset)&&void 0!==s?s:this.camera.pose.offset,l=this.camera.position.clone(),h=Jn(o,this.camera.pose.longitude,2*Math.PI)||Jn(a,this.camera.pose.latitude),d=Jn(u,this.camera.pose.fov),g=Jn(c,this.camera.pose.distance),p=er(A,this.camera.pose.offset);this.camera.setFromPose({longitude:o,latitude:a,fov:u,distance:c,offset:A});var M=er(l,this.camera.position);d&&this.emit("cameraFovUpdate",u,this.userAction),h&&this.emit("cameraDirectionUpdate",{longitude:o,latitude:a},this.userAction),M&&this.emit("cameraPositionUpdate",this.camera.position.clone(),this.userAction),(d||h||p||g)&&this.emit("cameraUpdate",{longitude:o,latitude:a,fov:u,offset:A},this.userAction),this.needsRender=!0,(Yt||0!==Ht.length)&&(Yt&&clearTimeout(Yt),Yt=window.setTimeout(Gt,200))},i.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var n=e.pointers.map((function(e){return ni(e,["x","y"])}));this.emit("wantsGesture","pan",n,e.isFinal)||this.emit("gesture","pan",n,e.isFinal)}},i.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return ni(e,["x","y"])}));this.emit("wantsGesture","tap",t,!0)||this.emit("gesture","tap",t,!0)},i.prototype.onPressGesture=function(e,t){var i,n=[e];if(this.emit("wantsGesture","press",n,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;this.emit("gesture","press",n,t)},i.prototype.onPinchGesture=function(e){var t=e.pointers.map((function(e){return ni(e,["x","y"])}));this.emit("wantsGesture","pinch",t,e.isFinal)||this.emit("gesture","pinch",t,e.isFinal)},i.prototype.onMouseWheel=function(e){var t=[{x:e.clientX,y:e.clientY,delta:e.delta}];this.emit("wantsGesture","mouseWheel",t,!1)||this.emit("gesture","mouseWheel",t,!1)},i.prototype.onMouseMove=function(e){},i.prototype.onMouseOut=function(){},i.prototype.relativeClientPosition=function(e){return fr(e,this.element,this.scissor)},i.prototype.bindEvents=function(e){var t=this,i=function(e){var i=fr(e,t.element,t.scissor);return!(Math.abs(i.x)>1||Math.abs(i.y)>1)},n=new pr.Manager(e),r=function(e){return e.session.firstInput||null};n.add(new pr.Pan({threshold:10,pointers:0})),n.add(new pr.Tap({interval:410})),n.add(new pr.Pinch({threshold:0,pointers:2}).recognizeWith(n.get("pan"))),n.on("panstart pan",(function(e){var s=r(n);s&&!i(s.center)||(t.onPanGesture(e),l())})),n.on("tap",(function(e){var s=r(n);s&&!i(s.center)||(t.onTapGesture(e),l())})),n.on("pinchstart pinch pinchend",(function(e){var s=r(n);s&&!i(s.center)||(t.onPinchGesture(e),l())}));var s=function(e){var n={x:e.clientX,y:e.clientY};i(n)&&(t.onMouseWheel(e),l())},o=function(e){if(!((n="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"node").match(/android/i)||n.match(/webos/i)||n.match(/ipad|iphone|ipod/i)||n.match(/iemobile/i)||n.match(/opera mini/i)||n.match(/blackberry/i)||n.match(/windows phone/i))){var n,r={x:e.clientX,y:e.clientY};i(r)?(t.onMouseMove(e),t.pressState&&Math.abs(e.clientX-t.pressState.x)>10&&Math.abs(e.clientY-t.pressState.y)>10&&l()):t.onMouseOut()}},a=function(){t.onMouseOut(),l()},u=function(e,n){if(i(e)){t.pressState={x:e.x,y:e.y,time:t.pressState?t.pressState.time:n,stop:Pe};var r=n-t.pressState.time;t.onPressGesture({x:e.x,y:e.y,delta:r},!1),t.pressState&&(t.pressState.stop=ot.shared.add((function(t){return u({x:e.x,y:e.y},t)}),!0,1))}else l()},c=function(e){l(),e.touches.length>1||e.changedTouches.length<=0||u({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY},Re())},A=function(e){l(),u({x:e.clientX,y:e.clientY},Re())},l=function(){var e;if(t.pressState){var i=Re()-t.pressState.time;t.onPressGesture({x:t.pressState.x,y:t.pressState.y,delta:i},!0),null===(e=t.pressState)||void 0===e||e.stop(),delete t.pressState}},h=function(t){if(t&&"function"==typeof t.preventDefault&&t.currentTarget===e&&t.preventDefault(),"function"==typeof getSelection){var i=getSelection();i&&i.focusNode&&(i.removeAllRanges&&i.removeAllRanges(),i.empty&&i.empty())}};Mr(e,s),pr.on(e,"mousemove",o),pr.on(e,"mouseout",a),pr.on(e,"touchstart",c),pr.on(e,"touchend",l),pr.on(e,"touchcancel",l),pr.on(e,"mousedown",A),pr.on(e,"mouseup",l),pr.on(e,"touchstart",h);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),pr.off(e,"mousemove",o),pr.off(e,"mouseout",a),pr.off(e,"touchstart",c),pr.off(e,"touchend",l),pr.off(e,"touchcancel",l),pr.off(e,"mousedown",A),pr.off(e,"mouseup",l),pr.off(e,"touchstart",h)}),{element:e})},i}(ke),xr=function(e){function i(t){var n,r,s,o,a=this,u=i.parseArgs(t);return(a=e.call(this,u)||this).defaultLongitude=u.defaultLongitude,a.defaultLatitude=u.defaultLatitude,a.defaultFov=u.defaultFov,a.maxFov=u.maxFov,a.minFov=u.minFov,a.maxLatitude=u.maxLatitude,a.minLatitude=u.minLatitude,a.locationMotion=new dn({x:a.camera.pose.offset.x,y:a.camera.pose.offset.y,z:a.camera.pose.offset.z,distance:a.camera.pose.distance,modelAlpha:null!==(r=null===(n=a.model.getMaterial())||void 0===n?void 0:n.modelAlpha)&&void 0!==r?r:0,perspToOrtho:null!==(o=null===(s=a.model.getMaterial())||void 0===s?void 0:s.perspToOrtho)&&void 0!==o?o:0}),a}return t.__extends(i,e),i.parseArgs=function(i){var n,r,s,o,a,u,c,A=e.parseArgs.call(this,i);return t.__assign(t.__assign({},A),{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,i,n,s=this.parseArgs(e),o=e.initial[1];return{longitude:null!==(t=o.longitude)&&void 0!==t?t:s.defaultLongitude,latitude:cn(null!==(i=o.latitude)&&void 0!==i?i:s.defaultLatitude,s.minLatitude,s.maxLatitude),fov:null!==(n=o.fov)&&void 0!==n?n:s.defaultFov,offset:e.model.bounding.getCenter(new r.Vector3)}},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.locationMotion.dispose(),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),delete this.mouseWheelState,delete this.panState},i.prototype.isReady=function(){return!1!==this.locationMotion.ended&&e.prototype.isReady.call(this)},i.prototype.updateWork=function(e,t,i,n,r){return this.work=e,!0},i.prototype.updateModel=function(t){e.prototype.updateModel.call(this,t);var i=t.bounding.getCenter(new r.Vector3),n=this.cameraDistance(t);this.locationMotion.set({x:i.x,y:i.y,z:i.z,distance:n},0).catch(Pe)},i.prototype.updateTime=function(e,t){if(!this.destroyed){var i={},n={};this.locationMotion.ended||(this.locationMotion.update(e),i.modelAlpha=this.locationMotion.value.modelAlpha,i.perspToOrtho=cn(1-10*(1-this.locationMotion.value.perspToOrtho),0,1),n.distance=this.locationMotion.value.distance,n.offset=new r.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),n.longitude=this.cameraMotion.value.longitude,n.latitude=this.cameraMotion.value.latitude,n.fov=this.cameraMotion.value.fov),dr(i)||this.model.setMaterial(i),dr(n)||this.setCamera(n)}},i.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(Re())[1],t=this.locationMotion.getKeyFrameSegment(Re())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new r.Vector3(t.value.x,t.value.y,t.value.z)}},i.prototype.initAnimation=function(e,t,i,n){var s,o,a,u=this;if(!this.destroyed){this.pending=!1,this.userAction=n;var c=this.model.bounding.getCenter(new r.Vector3),A={longitude:null!==(s=t.longitude)&&void 0!==s?s:this.defaultLongitude,latitude:cn(null!==(o=t.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:cn(null!==(a=t.fov)&&void 0!==a?a:this.defaultFov,this.minFov,this.maxFov),offset:this.model.bounding.getCenter(new r.Vector3)},l=this.cameraDistance(this.model),h=ni(A,["longitude","latitude","fov"]),d={x:c.x,y:c.y,z:c.z,distance:l,modelAlpha:1,perspToOrtho:0};this.emit("initAnimationWillStart",e,A,this.userAction),this.cameraMotion.set(h,i).catch(Pe),this.locationMotion.set(d,i).then((function(){u.emit("initAnimationEnded",e,A,u.userAction)}),(function(t){var i=gr(u.camera.pose);u.emit("initAnimationEnded",e,i,u.userAction)}))}},i.prototype.updateRenderSize=function(){this.locationMotion.set({distance:this.cameraDistance(this.model)},0)},i.prototype.cameraDistance=function(e){var t=e.bounding,i=this.camera.aspect,n=Math.pow(Math.pow(t.max.x-t.min.x+1,2)+Math.pow(t.max.y-t.min.y+1,2)+Math.pow(t.max.z-t.min.z+1,2),.5),r=n/2/Math.tan(Math.PI*this.defaultFov/360);return i<1&&(r/=i),isNaN(r)?n:r},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=hr(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:sr(e.longitude+o),latitude:cn(e.latitude+a,this.minLatitude,this.maxLatitude)}},i.prototype.requestInteriaMovement=function(e){var t=this;if(!1!==this.interiaMovement){var i=this.coordinatesChangeWithOffset({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude},e),n=i.longitude,r=i.latitude,s={longitude:n,latitude:r,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset};this.cameraMotion.set({longitude:n,latitude:r},0).catch(Pe);var o=Math.abs(e.x)>1||Math.abs(e.y)>1;this.emit("interiaPan",s,!o),o?ot.shared.add((function(){t.requestInteriaMovement({x:.8*e.x,y:.8*e.y})}),!0,1):this.interiaMovement=!1}},i.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var n=e.pointers.map((function(e){return ni(e,["x","y"])}));if(!this.emit("wantsGesture","pan",n,e.isFinal)){var r={x:e.center.x-t.x,y:e.center.y-t.y},s=this.relativeClientPosition(e.center),o=this.camera.pose.latitude<Math.PI/6||s.y<0?-1:1;r.x*=o;var a=this.coordinatesChangeWithOffset({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude},r),u={longitude:a.longitude,latitude:a.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset};if(!this.emit("wantsPanGesture",u,e.isFinal))if(this.emit("gesture","pan",n,e.isFinal),this.emit("panGesture",u,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({longitude:u.longitude,latitude:u.latitude,fov:u.fov},0).catch(Pe),e.isFinal)if(!this.emit("wantsInteriaPan",u)){this.interiaMovement=!0;var c=ot.getFrameTime(),A=e.velocityX*c*o,l=e.velocityY*c,h=Math.sqrt(A*A+l*l);h>100&&(A=A/h*100,l=l/h*100),this.requestInteriaMovement({x:A,y:l})}}}},i.prototype.onPinchGesture=function(e){var t,i=null===(t=this.pinchState)||void 0===t?void 0:t.fov,n=!1;if("pinchstart"===e.type)return this.pinchState={fov:this.cameraMotion.value.fov},void delete this.panState;if("pinchend"===e.type&&(n=!0,delete this.panState,delete this.pinchState),void 0!==i){var r=e.pointers.map((function(e){return ni(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,n)){var s=cn(i/e.scale,this.minFov,this.maxFov);this.emit("wantsPinchGesture",e.scale,s,n)||this.emit("wantsChangeCameraFov",s)||(this.emit("gesture","pinch",r,n),this.emit("pinchGesture",e.scale,s,n),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:s},0).catch(Pe))}}},i.prototype.onMouseWheel=function(e){var t=this,i=e.delta,n=[{x:e.clientX,y:e.clientY}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=this.minFov,s=this.maxFov,o=cn(this.camera.fov-i,r,s);this.emit("wantsMouseWheel",i,o,!1)||this.emit("wantsChangeCameraFov",o)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",i,o,!1),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:o},0).catch(Pe),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",i,o,!0)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,o,!0))}),200)})}},i.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return ni(e,["x","y"])}));if(!this.emit("wantsGesture","tap",t,!0)){var i=this.relativeClientPosition(e.center),n=new r.Raycaster;if(n.setFromCamera(i,this.camera),!this.emit("wantsTapGesture",n,i,!0)){this.emit("gesture","tap",t,!0),this.emit("tapGesture",n,i,!0),this.interiaMovement=!1;var s=this.getForwardPanoIndexOrNot(n);if(!Vi(s)){this.emit("panoSelected",s);var o={longitude:this.camera.pose.longitude,latitude:0};this.emit("wantsMoveToPano",s,o,!0)}}}},i.prototype.onPressGesture=function(e,t){var i,n,s=[e];if(this.emit("wantsGesture","press",s,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;var o=this.relativeClientPosition(e),a=new r.Raycaster;if(a.setFromCamera(o,this.camera),this.emit("wantsPressGesture",a,o,e.delta,t))return null===(n=this.pressState)||void 0===n||n.stop(),void delete this.pressState;this.emit("gesture","press",s,t),this.emit("pressGesture",a,o,e.delta,t)},i}(Tr);var jr=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=[i.initial[0],t.__assign(t.__assign({},i.initial[1]),{longitude:0,latitude:Math.PI/2}),i.initial[2],i.initial[3]],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.updateModel=function(e){this.model=e,this.needsRender=!0;var t=e.bounding.getCenter(new r.Vector3);this.locationMotion.set({x:t.x,y:t.y,z:t.z,distance:this.cameraDistance(e)},0).catch(Pe)},i.prototype.initAnimation=function(e,t,i,n){var s,o=this;if(!this.destroyed){this.pending=!1,this.userAction=n;var a=this.model.bounding.getCenter(new r.Vector3),u={longitude:0,latitude:Math.PI/2,fov:cn(null!==(s=t.fov)&&void 0!==s?s:this.defaultFov,this.minFov,this.maxFov),offset:this.model.bounding.getCenter(new r.Vector3)},c=this.cameraDistance(this.model),A=ni(u,["longitude","latitude","fov"]),l={x:a.x,y:a.y,z:a.z,distance:c,modelAlpha:1,perspToOrtho:1};this.cameraMotion.set(A,i).catch(Pe),this.locationMotion.set(l,i).then((function(){o.emit("initAnimationEnded",e,u,o.userAction)}),(function(t){var i=gr(o.camera.pose);o.emit("initAnimationEnded",e,i,o.userAction)}))}},i.prototype.getZoomOffsetFromFov=function(e,t,i){var n=new r.Vector3(0,-1,0),s=Math.tan(i/2*Math.PI/180),o=Math.tan(t.fov/2*Math.PI/180),a=(o-s)/o,u=new r.Raycaster;u.setFromCamera(e,t);var c=u.ray.direction,A=c.angleTo(n),l=this.cameraDistance(this.model),h=l*Math.tan(A),d=c.clone().setLength(l*Math.cos(A)).projectOnPlane(n),g=d.length(),p=a/g*d.x*h,M=a/g*d.z*h;return new r.Vector3(p,0,M)},i.prototype.requestInteriaMovement=function(e){},i.prototype.onPanGesture=function(e){var t=this.renderer.getSize(new r.Vector2),i=this.panState,n=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:n,x:e.center.x,y:e.center.y},void 0!==i&&i.pointerLength===n){var s=e.pointers.map((function(e){return ni(e,["x","y"])}));if(!this.emit("wantsGesture","pan",s,e.isFinal)){var o=e.center.x-i.x,a=e.center.y-i.y,u=new r.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),c=this.camera.position.y*Math.tan(this.camera.fov/2*Math.PI/180);u.add(function(e,t){var i=new r.Vector3;return i.setFromMatrixColumn(t,0),i.multiplyScalar(-e),i}(2*o*c/t.y,this.camera.matrix)),u.add(function(e,t,i){var n=new r.Vector3;return n.setFromMatrixColumn(i,0),n.crossVectors(t,n),n.multiplyScalar(e),n}(2*a*c/t.y,this.camera.up,this.camera.matrix));var A=this.model.bounding,l=A.getCenter(new r.Vector3),h=(A.max.x-A.min.x)/this.defaultFov*this.cameraMotion.value.fov,d=(A.max.y,A.min.y,this.defaultFov,this.cameraMotion.value.fov,(A.max.z-A.min.z)/this.defaultFov*this.cameraMotion.value.fov);u.x=cn(u.x,l.x-h,l.x+h),u.z=cn(u.z,l.z-d,l.z+d),u.y=l.y;var g={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:u};this.emit("wantsPanGesture",g,e.isFinal)||(this.emit("gesture","pan",s,e.isFinal),this.emit("panGesture",g,e.isFinal),this.userAction=!0,this.locationMotion.set({x:u.x,y:u.y,z:u.z},0).catch(Pe))}}},i.prototype.onPinchGesture=function(e){var t,i=null===(t=this.pinchState)||void 0===t?void 0:t.fov,n=!1;if("pinchstart"===e.type)return this.pinchState={fov:this.cameraMotion.value.fov},void delete this.panState;if("pinchend"===e.type&&(n=!0,delete this.panState,delete this.pinchState),void 0!==i){var r=e.pointers.map((function(e){return ni(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,n)){var s=cn(i/e.scale,this.minFov,this.maxFov),o=this.relativeClientPosition({x:e.center.x,y:e.center.y}),a=this.getZoomOffsetFromFov(o,this.camera,s),u=this.camera.pose.offset.clone().add(a);this.emit("wantsPinchGesture",e.scale,s,n)||this.emit("wantsChangeCameraFov",s)||(this.emit("gesture","pinch",r,n),this.emit("pinchGesture",e.scale,s,n),this.userAction=!0,this.locationMotion.set({x:u.x,y:u.y,z:u.z},0).catch(Pe),this.cameraMotion.set({longitude:0,latitude:Math.PI/2,fov:s},0).catch(Pe))}}},i.prototype.onMouseWheel=function(e){var t=this,i=e.delta,n=[{x:e.clientX,y:e.clientY}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=cn(this.cameraMotion.value.fov-i,this.minFov,this.maxFov),s=this.relativeClientPosition({x:e.clientX,y:e.clientY}),o=this.getZoomOffsetFromFov(s,this.camera,r),a=this.camera.pose.offset.clone().add(o);this.emit("wantsMouseWheel",i,r,!1)||this.emit("wantsChangeCameraFov",r)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",i,r,!1),this.userAction=!0,this.locationMotion.set({x:a.x,y:a.y,z:a.z},0).catch(Pe),this.cameraMotion.set({longitude:0,latitude:Math.PI/2,fov:r},0).catch(Pe),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",i,r,!0)||t.emit("wantsChangeCameraFov",r)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,r,!0))}),200)})}},i}(xr);function zr(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+=zr(e[s],!1)+",";return r>-1&&(n+=zr(e[s],!1)),n+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return zr(e.toJSON(),t);var o=Object.keys(e).sort(),a=o.length;for(n="",s=0;s<a;){var u=o[s],c=zr(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 e;default:return isFinite(e)?e:null}}function Cr(e){return ze(String(zr(e,!1)))}var br,Sr=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,A,l,h=e.parseArgs.call(this,i);return t.__assign(t.__assign({},h),{defaultLongitude:null!==(n=i.defaultLongitude)&&void 0!==n?n:0,defaultLatitude:null!==(r=i.defaultLatitude)&&void 0!==r?r:0,defaultFov:null!==(s=i.defaultFov)&&void 0!==s?s:90,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!==(A=i.moveSpeed)&&void 0!==A?A:3.2,intersectMeshCreator:null!==(l=i.intersectMeshCreator)&&void 0!==l?l:function(){return new qn}})},i.initAnimationEndPose=function(e){var t,i,n,r=this.parseArgs(e),s=e.initial,o=s[0],a=s[1];return{longitude:null!==(t=a.longitude)&&void 0!==t?t:r.defaultLongitude,latitude:cn(null!==(i=a.latitude)&&void 0!==i?i:r.defaultLatitude,r.minLatitude,r.maxLatitude),fov:cn(null!==(n=a.fov)&&void 0!==n?n:r.defaultFov,r.minFov,r.maxFov),offset:r.work.observers[o].position.clone()}},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.interiaMovement=!1,this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose()),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),delete this.mouseWheelState,delete this.mouseMoveState,delete this.panState},i.prototype.isReady=function(){return!this.interiaMovement&&(!this.panState&&(!this.pinchState&&(!this.mouseWheelState&&e.prototype.isReady.call(this))))},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.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.emit("intersectionHidden"),this.needsRender=!0},i.prototype.coordinatesForOffset=function(e){var t=this.cameraMotion.value.fov,i=this.camera.aspect,n=this.renderer.getSize(new r.Vector2);return{longitude:2*e.x/n.x*t/95*i,latitude:-2*e.y/n.y*t/95}},i.prototype.cameraBounce=function(){var e=this.cameraMotion.value,t=e.longitude,i=e.latitude,n=e.fov,r=[{progress:0,value:{longitude:t,latitude:i,fov:n}},{progress:.5,value:{longitude:t,latitude:i,fov:.98*n}},{progress:1,value:{longitude:t,latitude:i,fov:n}}];this.cameraMotion.setKeyframes(r,500).catch(Pe)},i.prototype.requestInteriaMovement=function(e){var t=this;if(!1!==this.interiaMovement){var i=this.coordinatesForOffset(e),n=sr(this.cameraMotion.value.longitude+i.longitude),r=cn(this.cameraMotion.value.latitude+i.latitude,this.minLatitude,this.maxLatitude),s={longitude:n,latitude:r,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone()};this.cameraMotion.set({longitude:n,latitude:r},0).catch(Pe);var o=Math.abs(e.x)>1||Math.abs(e.y)>1;this.emit("interiaPan",s,!o),o?ot.shared.add((function(i,n){var r=Math.min(.05625*n,1),s={x:e.x*r,y:e.y*r*.7};t.requestInteriaMovement(s)}),!0,1):this.interiaMovement=!1}},i.prototype.onPanGesture=function(e){var t=this.panState,i=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:i,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===i){var n=e.pointers.map((function(e){return ni(e,["x","y"])}));if(!this.emit("wantsGesture","pan",n,e.isFinal)){var r={x:e.center.x-t.x,y:e.center.y-t.y},s=this.coordinatesForOffset(r),o=sr(this.cameraMotion.value.longitude+s.longitude),a=cn(this.cameraMotion.value.latitude+s.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(a=this.cameraMotion.value.latitude);var u={longitude:o,latitude:a,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone()};if(!this.emit("wantsPanGesture",u,e.isFinal)){this.emit("gesture","pan",n,e.isFinal),this.emit("panGesture",u,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh();var c={longitude:u.longitude,latitude:u.latitude,fov:u.fov};if(this.cameraMotion.set(c,0).catch(Pe),e.isFinal)if(!this.emit("wantsInteriaPan",u)){var A=ot.getFrameTime();this.interiaMovement=!0;var l=e.velocityX*A,h=e.velocityY*A,d=Math.sqrt(l*l+h*h);d>100&&(l=l/d*100,h=h/d*100),Math.abs(h/l)<Math.tan(20/180*Math.PI)&&(h=0),this.requestInteriaMovement({x:l,y:h})}}}}},i.prototype.onPinchGesture=function(e){var t,i=null===(t=this.pinchState)||void 0===t?void 0:t.fov,n=e.scale,r=!1;if("pinchstart"===e.type)return this.pinchState={fov:this.cameraMotion.value.fov},void delete this.panState;if("pinchend"===e.type&&(r=!0,delete this.panState,delete this.pinchState),void 0!==i){var s=e.pointers.map((function(e){return ni(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",s,r)){var o=cn(i/n,this.minFov,this.maxFov);this.emit("wantsPinchGesture",n,o,r)||this.emit("wantsChangeCameraFov",o)||(this.emit("gesture","pinch",s,r),this.emit("pinchGesture",n,o,r),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:o},0).catch(Pe))}}},i.prototype.onMouseWheel=function(e){var t=this,i=e.delta,n=[{x:e.clientX,y:e.clientY}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=cn(this.cameraMotion.value.fov-i,this.minFov,this.maxFov);this.emit("wantsMouseWheel",i,r,!1)||this.emit("wantsChangeCameraFov",r)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",i,r,!1),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:r},0).catch(Pe),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",i,r,!0)||t.emit("wantsChangeCameraFov",r)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,r,!0))}),200)})}},i.prototype.onMouseMove=function(e){if(this.intersectMesh.parent&&!this.model.empty&&this.model.bvhs&&!0===this.model.bvhs.loaded&&!this.panState){var t=this.relativeClientPosition({x:e.clientX,y:e.clientY}),i=new r.Raycaster;if(i.setFromCamera(t,this.camera),this.emit("wantsShowIntersectionOnModel",i))this.hideIntersectMesh();else{var n=this.model.intersectRaycaster(i)[0];if(n&&n.face){var s=n.face.normal,o=s.clone().multiplyScalar(.05),a=n.point.clone().add(o);this.intersectMesh.position.copy(a);var u=a.clone().add(o);if(this.intersectMesh.lookAt(u),Math.abs(s.y)>.99){var c=this.camera.position.clone().sub(a);this.intersectMesh.rotation.z=-Math.atan2(c.z,c.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",n,this.intersectMesh)}else this.hideIntersectMesh();this.mouseMoveState={clientX:e.clientX,clientY:e.clientY}}}},i.prototype.onMouseOut=function(){this.intersectMesh.parent&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},i.prototype.onPressGesture=function(e,t){var i,n,s=[e];if(this.emit("wantsGesture","press",s,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;var o=this.relativeClientPosition(e),a=new r.Raycaster;if(a.setFromCamera(o,this.camera),this.emit("wantsPressGesture",a,o,e.delta,t))return null===(n=this.pressState)||void 0===n||n.stop(),void delete this.pressState;this.emit("gesture","press",s,t),this.emit("pressGesture",a,o,e.delta,t)},i}(Tr);var Lr,Or=function(e){function i(t,i){return void 0===i&&(i=.5),e.call(this,t,{uniforms:{inputBuffer:new r.Uniform(null),scale:new r.Uniform(i)},fragment:"\n#include <common>\nuniform sampler2D inputBuffer;\nuniform float scale;\nvarying vec2 vUv;\n\nvoid main() {\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 = clamp(linearToRelativeLuminance(rgb), 0.1, 0.9);\n gl_FragColor = vec4(luminance);\n}\n"})||this}return t.__extends(i,e),i}(Dr),Br=function(e){function i(t,i){void 0===i&&(i=.002);var n=e.call(this,t,{uniforms:{targetBuffer:new r.Uniform(null),inputBuffer:new r.Uniform(null),step:new r.Uniform(i)},fragment:"\n uniform sampler2D targetBuffer;\n uniform sampler2D inputBuffer;\n uniform float step;\n varying vec2 vUv;\n void main() {\n\n #ifdef GL_EXT_shader_texture_lod\n #if __VERSION__ < 300\n float target = texture2DLodEXT(targetBuffer, vUv, 5.0).r;\n #else\n float target = textureLod(targetBuffer, vUv, 5.0).r;\n #endif\n #else\n float target = texture2D(targetBuffer, vUv).r;\n #endif\n float current = texture2D(inputBuffer, vUv).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 n.material.extensions.shaderTextureLOD=!0,n}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}(Dr),Qr=function(e){function i(t){var i=e.call(this,t,{uniforms:{inputBuffer:new r.Uniform(null),luminanceAdaptiveBuffer:new r.Uniform(null),progress:new r.Uniform(0)},fragment:"\n #include <common>\n uniform sampler2D inputBuffer;\n uniform sampler2D luminanceAdaptiveBuffer;\n uniform float progress;\n varying vec2 vUv;\n\n void main() {\n float middleGrey = 0.8;\n float whitePoint = 8.0;\n float exposure = 1.5;\n vec4 inputColor = texture2D(inputBuffer, vUv);\n vec3 rgb = inputColor.rgb * exposure;\n float alpha = inputColor.a;\n float luminance = linearToRelativeLuminance(rgb);\n float lumAvg = texture2D(luminanceAdaptiveBuffer, vec2(0.5)).r;\n float lumScaled = (luminance * middleGrey) / max(lumAvg, 1e-6);\n float lumCompressed = lumScaled * (1.0 + lumScaled / (whitePoint * whitePoint));\n lumCompressed /= (1.0 + lumScaled);\n rgb = clamp(lumCompressed * rgb, 0.0, 1.0);\n gl_FragColor = mix(inputColor, vec4(rgb, alpha), progress * 0.9);\n }\n "})||this;return i.material.transparent=!0,i}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}),Object.defineProperty(i.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),i}(Dr),kr=function(e){function i(t){var i=e.call(this,t)||this;return i.enableTime=Re(),i.renderer=t,i.valuePass=new Er(i.renderer),i.luminancePass=new Or(i.renderer,.75),i.nextStepPass=new Br(i.renderer,.002),i.luminanceAdaptivePass=new Qr(i.renderer),i}return t.__extends(i,e),i.prototype.render=function(e,t,i){if(!this.enable)return this.enableTime=null,void this.copyPass.render(e);null===this.enableTime&&(this.enableTime=Re()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new r.WebGLRenderTarget(128,128,{minFilter:r.LinearMipmapLinearFilter,magFilter:r.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:r.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e,this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new r.WebGLRenderTarget(1,1,{minFilter:r.NearestFilter,magFilter:r.NearestFilter,type:r.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new r.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new r.WebGLRenderTarget(1,1,{minFilter:r.NearestFilter,magFilter:r.NearestFilter,type:r.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new r.Vector3(.5,.5,.5),this.luminanceNextBuffer),this.luminanceAdaptivePass.luminanceAdaptiveBuffer=this.luminanceNextBuffer.texture),this.copyPass.render(this.luminanceNextBuffer,this.luminancePrevBuffer),this.nextStepPass.render(this.luminancePrevBuffer,this.luminanceNextBuffer),this.luminanceAdaptivePass.progress=Math.min((Re()-this.enableTime)/3e3,1),this.luminanceAdaptivePass.render(e,t)},i.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()},i}(Ir),Pr=["up","down","left","right","front","back"],Ur=null!==(Lr=Math.SQRT1_2)&&void 0!==Lr?Lr:Math.sqrt(2),Rr={up:new r.Quaternion(Ur,0,0,Ur),down:new r.Quaternion(-Ur,0,0,Ur),left:new r.Quaternion(0,Ur,0,Ur),right:new r.Quaternion(0,-Ur,0,Ur),front:new r.Quaternion(0,0,0,1),back:new r.Quaternion(0,1,0,0)},_r=(new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0),Math.PI),Yr=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Fr=new Float32Array([0,0,1,0,0,1,1,1]),Hr=new Uint8Array([0,1,2,1,3,2]),Vr=new r.BufferGeometry;Vr.setAttribute("position",new r.BufferAttribute(Yr,3)),Vr.setAttribute("uv",new r.BufferAttribute(Fr,2)),Vr.setIndex(new r.BufferAttribute(Hr,1));var Gr=function(e){function i(){var t=e.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null}},vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\n#if defined(USE_LUMINANCE)\nuniform sampler2D luminanceMap;\n#endif\nuniform sampler2D map;\nvarying vec2 vUv;\n\nvoid main() {\n gl_FragColor = texture2D(map, vUv);\n #if defined(USE_LUMINANCE)\n gl_FragColor.a = 1.0 - texture2D(luminanceMap, vUv).r;\n #endif\n}\n"})||this;return t.depthTest=!1,t.depthWrite=!1,t.blending=r.NoBlending,t.map=t.uniforms.map.value,t.luminanceMap=t.uniforms.luminanceMap.value,Object.defineProperties(t,{map:{get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},luminanceMap:{get:function(){return this.uniforms.luminanceMap.value},set:function(e){this.uniforms.luminanceMap.value=e,this.defines.USE_LUMINANCE=null!==e,this.needsUpdate=!0}}}),t}return t.__extends(i,e),i}(r.ShaderMaterial),Kr=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.level=0,t.sideCount=0,t.col=0,t.row=0,t.index=0,t.type="up",t}return t.__extends(i,e),i}(r.Box3),qr=function(e){function i(t,i){var n=this,s=new Gr;return s.visible=!1,(n=e.call(this,Vr,s)||this).position.copy(t.getCenter(new r.Vector3)),n.quaternion.copy(Rr[t.type]),n.scale.setScalar(1/Math.pow(2,t.level)),n.level=t.level,n.activeTime=-1,n.disposed=!1,n.needsRender=!1,n.frustumCulled=!1,i.then((function(e){var t=e[0],i=e[1];n.disposed?(t.dispose(),null==i||i.dispose()):(n.material.map=t,n.material.luminanceMap=i,n.material.needsUpdate=!0,n.material.visible=!0)})).catch(Pe),n}return t.__extends(i,e),i.getBox=function(e,t,i){var n=new Kr,r=Math.pow(2,e),s=1/r,o=i%r,a=Math.floor(i/r);switch(n.level=e,n.index=i,n.sideCount=r,n.row=a,n.col=o,n.type=t,t){case"up":n.min.y=.5,n.max.y=.5,n.min.x=+o*s-.5,n.max.x=+o*s-.5+s,n.min.z=-a*s+.5-s,n.max.z=-a*s+.5;break;case"down":n.min.y=-.5,n.max.y=-.5,n.min.x=+o*s-.5,n.max.x=+o*s-.5+s,n.min.z=+a*s-.5,n.max.z=+a*s-.5+s;break;case"left":n.min.x=-.5,n.max.x=-.5,n.min.z=-o*s+.5-s,n.max.z=-o*s+.5,n.min.y=-a*s+.5-s,n.max.y=-a*s+.5;break;case"right":n.min.x=.5,n.max.x=.5,n.min.z=+o*s-.5,n.max.z=+o*s-.5+s,n.min.y=-a*s+.5-s,n.max.y=-a*s+.5;break;case"front":n.min.z=-.5,n.max.z=-.5,n.min.x=+o*s-.5,n.max.x=+o*s-.5+s,n.min.y=-a*s+.5-s,n.max.y=-a*s+.5;break;case"back":n.min.z=.5,n.max.z=.5,n.min.x=-o*s+.5-s,n.max.x=-o*s+.5,n.min.y=-a*s+.5-s,n.max.y=-a*s+.5}return n},i.prototype.updateTime=function(e){},i.prototype.dispose=function(){var e;this.disposed=!0,this.material.map&&(this.material.map.dispose(),null===(e=this.material.luminanceMap)||void 0===e||e.dispose()),this.material.dispose()},i}(r.Mesh),Wr=function(e){function i(){var t=e.call(this)||this;return t.needsRender=!1,t.name="tiling",t}return t.__extends(i,e),i}(r.Group),Xr=function(){function e(e,t){this.disposed=!1,this.textureLoader=new Ti(e),this.level=0,this.panoIndex=0,this.tiles=[],this.resource=[],this.luminance=null,this.imageOptions=t,this.object=new Wr}return e.prototype.setAllowHosts=function(e){this.textureLoader.setAllowHosts(e)},e.prototype.setNetworkSubscribe=function(e){this.textureLoader.setNetworkSubscribe(e)},e.prototype.cleanup=function(){for(var e=0;e<this.tiles.length;e++)if(this.tiles[e]){var t=this.tiles[e],i="level-group:"+e,n=this.object.getObjectByName(i);for(var r in t){var s=t[r];s.dispose(),n.remove(s),delete t[r],this.object.needsRender=!0}}},e.prototype.setRotation=function(e){if(!this.disposed){var t=(new r.Quaternion).multiplyQuaternions(e,_r);this.object.quaternion.equals(t)||(this.object.quaternion.copy(t),this.object.needsRender=!0)}},e.prototype.setPosition=function(e){this.disposed||this.object.position.equals(e)||(this.object.position.copy(e),this.object.needsRender=!0)},e.prototype.setResource=function(e){if(!this.disposed&&this.resource!==e){this.cleanup(),this.resource=e;for(var t=0;t<e.length;t++){var i=e[t].level;this.tiles[i]={};var n="level-group:"+i,s=this.object.getObjectByName(n);s||((s=new r.Group).name=n,s.renderOrder=-2),this.object.add(s)}this.object.needsRender=!0}},e.prototype.setLuminance=function(e){this.luminance=e},e.prototype.getTileResources=function(e){for(var t,i=null!==(t=this.imageOptions.size)&&void 0!==t?t:2048,n=[],r=this.resource.length-1;r>=0;r--)this.resource[r].level<=e&&512*Math.pow(2,this.resource[r].level)>i&&n.unshift(this.resource[r]);return n},e.prototype.update=function(e,i,n){var s=this;if(!this.disposed){this.level=i;var o=(new r.PerspectiveCamera).copy(e);o.position.set(0,0,0),o.quaternion.premultiply(this.object.quaternion.clone().inverse()),o.updateMatrixWorld(!0),o.updateProjectionMatrix();for(var a=o.getWorldDirection(new r.Vector3),u=(new r.Frustum).setFromProjectionMatrix((new r.Matrix4).multiplyMatrices(o.projectionMatrix,o.matrixWorldInverse)),c=this.getTileResources(i),A=function(e){if(e){for(var i=[],o=e.level,c=Math.pow(2,o),A=c*c,h=l.object.getObjectByName("level-group:"+o),d=0,g=Pr;d<g.length;d++)for(var p=g[d],M=0;M<A;M++){var f=qr.getBox(o,p,M);u.intersectsBox(f)&&i.push(f)}i.sort((function(e,t){return e.getCenter(new r.Vector3).angleTo(a)-t.getCenter(new r.Vector3).angleTo(a)}));for(var y=[],m=0,v=i;m<v.length;m++){var N=(f=v[m]).sideCount,D=f.row,E=f.col,w=(p=f.type,"tile-level:".concat(o,"-face:").concat(p,"-row:").concat(D,"-col:").concat(E));if(!l.tiles[o][w]){var I=e[p],T=e.size,x=T/N,j=[x*E,x*D,x,x],z=t.__assign({key:"pano_tile.".concat(l.panoIndex,".").concat(p,".").concat(o,".").concat(D,".").concat(E),basisLoaderInitialized:wi.isInitialized(),cut:j},ni(l.imageOptions,["format"]));o<=1&&("jpg"===z.format||/\.jpg$/.test(I))?(1024!==x&&(z.size=1024),z.quality=70):512!==x&&(z.size=512);var C=l.imageOptions.transform?l.imageOptions.transform(I,z):ht(I,z),b=l.textureLoader.load(C,{preInit:!0}).then((function(e){return e.body})),S=null;if(l.luminance){var L=l.luminance[p],O=L.match(/\/cube_(\d+)\//),B=!!O&&Number(O[1]);if(!1!==B){var Q=T/B,k=t.__assign(t.__assign({},z),{size:256,cut:[j[0]/Q,j[1]/Q,j[2]/Q,j[3]/Q],key:"pano_tile_luminance.".concat(l.panoIndex,".").concat(p,".").concat(o,".").concat(D,".").concat(E)}),P=l.imageOptions.transform?l.imageOptions.transform(L,k):ht(L,k);S=l.textureLoader.load(P,{format:r.LuminanceFormat,preInit:!0}).then((function(e){return e.body})).catch((function(){return null}))}}(_=l.tiles[o][w]=new qr(f,Promise.all([b,S]))).name=w,_.renderOrder=o,h.add(_)}l.tiles[o][w].activeTime=n,y.push(w)}for(var U=0,R=Object.keys(l.tiles[o]).sort((function(e,t){return s.tiles[o][t].activeTime-s.tiles[o][e].activeTime})).slice(Math.max(24,y.length));U<R.length;U++){w=R[U];var _=l.tiles[o][w];h.remove(_),_.dispose(),delete l.tiles[o][w],l.object.needsRender=!0}}},l=this,h=0,d=c;h<d.length;h++){A(d[h])}for(var g=0;g<this.tiles.length;g++)if(this.tiles[g]){var p=c.length>0&&g<=c[c.length-1].level;for(var M in this.tiles[g])this.tiles[g][M].visible!==p&&(this.tiles[g][M].visible=p,this.tiles[g][M].needsRender=!0),this.tiles[g][M].updateTime(n)}}},e.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},e}(),Zr=new Float32Array([-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,-1,-1,1,-1,-1]),Jr=new Uint8Array([0,2,1,2,3,1,4,6,5,6,7,5,8,10,9,10,11,9,12,14,13,14,15,13,16,18,17,18,19,17,20,22,21,22,23,21]),$r=new r.BufferGeometry;$r.setAttribute("position",new r.BufferAttribute(Zr,3)),$r.setIndex(new r.BufferAttribute(Jr,1));var es=function(){function e(){this.material=new r.ShaderMaterial({vertexShader:"\n#if defined(USE_PANO_VIDEO)\nvarying vec3 worldPosition;\n#endif\nvoid main() {\n vec4 transformed = vec4(position, 1.0);\n #if defined(USE_PANO_VIDEO)\n worldPosition = (modelMatrix * transformed).xyz;\n #endif\n gl_Position = projectionMatrix * modelViewMatrix * transformed;\n}\n",fragmentShader:"\nuniform vec2 size;\nuniform mat4 matrix;\nuniform float alpha;\nuniform sampler2D map;\n#if defined(USE_PANO_VIDEO)\nvarying vec3 worldPosition;\n#endif\n#include <common>\nvoid main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n #if defined(USE_PANO_VIDEO)\n vec3 cameraToVertex = worldPosition - cameraPosition;\n vec4 mapCoods = vec4(cameraToVertex, 1.0) * matrix;\n vec2 uv = vec2(\n 0.5 + mapCoods.x / mapCoods.z / size.x,\n 0.5 - mapCoods.y / mapCoods.z / size.y\n );\n vec4 videoColor = texture2D(map, uv);\n float match = (1.0 - step(0.0, mapCoods.z)) * (1.0 - step(0.5, abs(uv.x - 0.5))) * (1.0 - step(0.5, abs(uv.y - 0.5)));\n float blendAlpha = clamp(0.0, 1.0, 5.0 * (1.0 - clamp(distance(uv, vec2(0.5, 0.5)) / 0.55 , 0.0, 1.0)));\n gl_FragColor = vec4(videoColor.rgb, match * blendAlpha * alpha);\n #endif\n}\n",uniforms:{size:new r.Uniform(null),matrix:new r.Uniform(null),alpha:new r.Uniform(null),map:new r.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:r.CustomBlending,blendSrc:r.SrcAlphaFactor,blendDst:r.OneMinusSrcAlphaFactor,blendSrcAlpha:r.OneFactor,blendDstAlpha:r.OneMinusSrcAlphaFactor}),this.object=new r.Mesh($r,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.alphaMotion=new dn({alpha:0})}return e.prototype.setMaterial=function(e){e?(this.material.uniforms.size.value=e.size,this.material.uniforms.matrix.value=e.matrix,this.material.uniforms.map.value=e.map,this.alphaMotion.set({alpha:e.alpha},500).catch(Pe),this.material.uniforms.alpha.value=e.alpha):(this.material.uniforms.size.value=null,this.material.uniforms.matrix.value=null,this.material.uniforms.map.value=null,this.alphaMotion.set({alpha:0},0).catch(Pe));var t=null!==e;t!==this.material.defines.USE_PANO_VIDEO&&(this.material.defines.USE_PANO_VIDEO=t,this.material.needsUpdate=!0,this.object.visible=null!==e)},e.prototype.updateTime=function(e){this.alphaMotion.ended||(this.alphaMotion.update(e),this.material.uniforms.alpha.value=this.alphaMotion.value.alpha)},e.prototype.dispose=function(){this.material.dispose()},e}(),ts=(new r.Matrix4).makeRotationAxis(new r.Vector3(0,1,0),Math.PI),is=new r.Vector3(-1,1,1),ns=function(e){function i(t){var n,r,s,o,a,u,c,A=this,l=i.parseArgs(t);(A=e.call(this,l)||this).initAnimationed=!1,A.currentPanoIndex=l.initial[0],A.maxAccessibleDistance=l.maxAccessibleDistance,A.panoTapTriggerRadius=l.panoTapTriggerRadius,A.panoCircleMeshCreator=l.panoCircleMeshCreator,A.tileLevelForFov=l.tileLevelForFov;var h=A.model.getMaterial()||{},d=h.pano0,g=h.pano1;d&&(null==g?void 0:g.map)!==d.map&&(A.model.setMaterial({pano0:g}),d.map.dispose(),null===(n=d.luminanceMap)||void 0===n||n.dispose()),A.boundingMesh=A.generateBoundingMesh(),A.boundingMesh.setMaterial(A.model.getMaterial()||{}),A.boundingMesh.visible=!1,A.scene.add(A.boundingMesh),A.panoMeshes=[],A.updatePanoMeshes(),A.locationMotion=new dn({count:0,distance:A.camera.pose.distance,modelAlpha:null!==(s=null===(r=A.model.getMaterial())||void 0===r?void 0:r.modelAlpha)&&void 0!==s?s:0,perspToOrtho:null!==(a=null===(o=A.model.getMaterial())||void 0===o?void 0:o.perspToOrtho)&&void 0!==a?a:0}),A.panoResources={},A.panoResources[A.locationMotion.keyframes[0].key=A.locationMotion.keyframes[1].key=Xn()]={panoIndex:A.currentPanoIndex,workCode:A.work.workCode,panoPicture:null!==(c=null===(u=A.model.getMaterial())||void 0===u?void 0:u.pano1)&&void 0!==c?c:null,position:A.camera.pose.offset.clone(),effect:"fly"};var p={allowHosts:A.work.allowHosts,networkSubscribe:A.networkSubscribe};return A.textureLoader=new Ti(p),A.tiling=new Xr(p,A.imageOptions),A.scene.add(A.tiling.object),A.panoVideo=new es,A.scene.add(A.panoVideo.object),A}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),{maxAccessibleDistance:null!==(n=i.maxAccessibleDistance)&&void 0!==n?n:5,panoTapTriggerRadius:null!==(r=i.panoTapTriggerRadius)&&void 0!==r?r:.5,panoCircleMeshCreator:null!==(s=i.panoCircleMeshCreator)&&void 0!==s?s:function(){return new _n},tileLevelForFov:null!==(o=i.tileLevelForFov)&&void 0!==o?o:function(e,t){var i=2*Math.atan(Math.tan(e/180*Math.PI/2)*(t.width/t.height))/Math.PI*180,n=Math.max(t.width/i,t.height/e),r=a.imageOptions.size;if(void 0===r&&a.work.observers[0]){var s=a.work.observers[0].images.up.match(/\/cube_(\d+)\//);s&&(r=Number(s[1]))}return void 0===r&&(r=2048),r<8192&&n>40?4:r<4096&&n>24?3:r<2048&&n>10?2:r<1024&&n>6?1:0}})},i.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},i.prototype.destroy=function(){var t,i,n=this;e.prototype.destroy.call(this),this.scene.remove(this.tiling.object),this.tiling.dispose(),this.locationMotion.dispose(),delete this.pendingTextureTask,this.boundingMesh&&(this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.panoMeshes&&(this.panoMeshes.forEach((function(e){n.helper.remove(e),e.dispose()})),this.panoMeshes.length=0),this.interiaMovement=!1;var r=this.videoTexture.image;r.pause(),r.oncanplay=function(){},r.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var s=null!==(t=this.model.getMaterial())&&void 0!==t?t:{},o=s.pano0,a=s.pano1,u=0,c=Object.keys(this.panoResources);u<c.length;u++){var A=c[u],l=this.panoResources[A];if(l.panoPicture){var h=l.panoPicture.map;h&&h!==(null==o?void 0:o.map)&&h!==(null==a?void 0:a.map)&&(h.dispose(),null===(i=l.panoPicture.luminanceMap)||void 0===i||i.dispose(),l.panoPicture=null)}delete this.panoResources[A]}},i.prototype.isReady=function(){return!0===this.locationMotion.ended&&e.prototype.isReady.call(this)},i.prototype.updateWork=function(e,t,i,n,r){var s=this;this.userAction=r,this.work=e,this.currentPanoIndex=t,this.textureLoader.setAllowHosts(this.work.allowHosts),this.tiling.setAllowHosts(this.work.allowHosts),this.tiling.cleanup(),this.initAnimationed=!1;var o={},a=!0;this.boundingMesh&&(o=this.boundingMesh.getMaterial()||{},a=this.boundingMesh.visible,this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.boundingMesh=this.generateBoundingMesh(!0),this.boundingMesh.visible=a,this.boundingMesh.setMaterial(o),this.scene.add(this.boundingMesh),this.hideIntersectMesh(),this.updatePanoMeshes();for(var u=0,c=this.panoMeshes;u<c.length;u++){c[u].visible=!1}return this.moveToPano(t,{effect:"fade",duration:n,longitude:i.longitude,latitude:i.latitude,fov:i.fov,moveEndCallback:function(){s.initAnimationed=!0},moveCancelCallback:function(){s.initAnimationed=!0}},r),!0},i.prototype.updateModel=function(e){this.model=e;var t={},i=!0;this.boundingMesh&&(t=this.boundingMesh.getMaterial()||{},i=this.boundingMesh.visible,this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.boundingMesh=this.generateBoundingMesh(),this.boundingMesh.visible=i,this.boundingMesh.name="bounding",this.boundingMesh.setMaterial(t),this.scene.add(this.boundingMesh),this.updatePanoMeshes()},i.prototype.updateTime=function(e,t){var i,n,s,o,a,u,c;if(!this.destroyed){var A={},l={},h=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),d=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]);if(!1===this.locationMotion.ended){this.locationMotion.update(e);var g=this.locationMotion.getKeyFrameSegment(e),p=g[0],M=g[1],f=this.panoResourceFromLocationMotionKeyframe(p),y=this.panoResourceFromLocationMotionKeyframe(M),m=(new r.Vector3).copy(f.position),v=(new r.Vector3).copy(y.position),N=this.locationMotion.value.count-M.value.count+1;A.modelAlpha=this.locationMotion.value.modelAlpha,A.perspToOrtho=cn(1-10*(1-this.locationMotion.value.perspToOrtho),0,1),A.useBlackTransition="instant"===y.effect,y.panoPicture&&(N<1?f.panoPicture&&(A.pano0=f.panoPicture):A.pano0=y.panoPicture,A.pano1=y.panoPicture),"fade"===y.effect&&(A.pano0&&f.panoPicture&&(A.pano0={map:A.pano0.map,luminanceMap:A.pano0.luminanceMap,matrix:f.panoPicture.matrix.clone().setPosition(y.position)}),m.copy(v)),A.progress=N,l.distance=this.locationMotion.value.distance,l.offset=new r.Vector3(m.x+(v.x-m.x)*N,m.y+(v.y-m.y)*N,m.z+(v.z-m.z)*N);for(var D=[],E=[],w=0,I=this.locationMotion.keyframes;w<I.length;w++){var T=I[w],x=T.key,j=T.progress;void 0!==x&&(D.push(x),j>=this.locationMotion.progress&&E.push(x))}for(var z=0,C=Object.keys(this.panoResources);z<C.length;z++){var b=C[z];if(!(E.indexOf(b)>=0)){var S=this.panoResources[b];if(S.panoPicture){var L=S.panoPicture.map;if(L){if(L===(null===(i=A.pano0)||void 0===i?void 0:i.map))continue;if(L===(null===(n=A.pano1)||void 0===n?void 0:n.map))continue;L.dispose(),null===(s=S.panoPicture.luminanceMap)||void 0===s||s.dispose(),S.panoPicture=null}}D.indexOf(b)>=0||delete this.panoResources[b]}}f.workCode===y.workCode?this.currentPanoIndex=N<.5?f.panoIndex:y.panoIndex:this.currentPanoIndex=y.panoIndex,this.emit("movingToPano",d.panoIndex,h.panoIndex,this.locationMotion.progress)}if(!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),l.longitude=this.cameraMotion.value.longitude,l.latitude=this.cameraMotion.value.latitude,l.fov=this.cameraMotion.value.fov),!1===dr(A)&&(this.model.setMaterial(A),this.boundingMesh.setMaterial(A)),!1===dr(l)&&this.setCamera(l),this.camera.pose.distance>.1)for(var O=0;O<this.work.observers.length;O++){(P=this.panoMeshes[O])&&(P.visible=!1)}else{var B=this.work.observers[this.currentPanoIndex];if(B){var Q=B.visibleNodes.concat(this.currentPanoIndex),k=this.getForwardPanoIndexOrNot();for(O=0;O<this.work.observers.length;O++){var P,U=this.work.observers[O];if(P=this.panoMeshes[O])if(U.loadable||U.active)if(-1!==Q.indexOf(O)){P.visible=!0;var R=P.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);P.setCurrent(k===O),P.setOpacity(R<.01?0:cn(2/R,.5,1)),P.updateTime&&P.updateTime(e,t)}else P.visible=!1;else P.visible=!1}}}this.boundingMesh.visible=Boolean(null===(o=this.boundingMesh.getMaterial())||void 0===o?void 0:o.pano0)&&this.boundingMesh.boundingBox.containsPoint(this.camera.position);var _=this.tiling.object.visible;if(!1!==this.tileLevelForFov&&this.initAnimationed){var Y=d.panoIndex,F=this.work.observers[Y];if(F)if($n(this.camera.position,F.position)){this.tiling.object.visible=!0,this.enableIOSEDR&&this.tiling.setLuminance(null!==(a=F.images.luminance)&&void 0!==a?a:null),this.tiling.panoIndex!==Y&&this.tiling.cleanup(),this.tiling.panoIndex=Y,this.tiling.setResource(null!==(c=null===(u=F.images)||void 0===u?void 0:u.tiles)&&void 0!==c?c:[]),this.tiling.setRotation(F.quaternion),this.tiling.setPosition(F.position);var H=this.renderer.getSize(new r.Vector2);H.width*=this.scissor.width,H.height*=this.scissor.height,this.tiling.update(this.camera,this.tileLevelForFov(this.camera.fov,H),e)}else this.tiling.object.visible=!1;else this.tiling.object.visible=!1}else this.tiling.object.visible=!1;_!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0),this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},i.prototype.render=function(t){var i=this.work.observers[this.currentPanoIndex];i&&i.video&&(this.needsRender=!0),e.prototype.render.call(this,t)},i.prototype.postProcessing=function(e,t,i){if(!this.destroyed)return this.effect||(this.effect=new kr(this.renderer)),this.effect.render(e,t,i)},i.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(Re())[1],t=this.locationMotion.getKeyFrameSegment(Re())[1],i=this.panoResourceFromLocationMotionKeyframe(t),n=this.work.observers[i.panoIndex];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:n?n.position.clone():this.camera.position.clone()}},i.prototype.moveToPano=function(e,i,n){var s,o,a,u=this,c=this.work.observers[e],A=t.__assign({key:"pano.".concat(e),basisLoaderInitialized:wi.isInitialized()},ni(this.imageOptions,["format","size","quality"])),l=null!==(s=this.imageOptions.transform)&&void 0!==s?s:ht,h={right:l(c.images.right,t.__assign(t.__assign({},A),{key:"".concat(A.key,".right")})),left:l(c.images.left,t.__assign(t.__assign({},A),{key:"".concat(A.key,".left")})),up:l(c.images.up,t.__assign(t.__assign({},A),{key:"".concat(A.key,".up")})),down:l(c.images.down,t.__assign(t.__assign({},A),{key:"".concat(A.key,".down")})),front:l(c.images.front,t.__assign(t.__assign({},A),{key:"".concat(A.key,".front")})),back:l(c.images.back,t.__assign(t.__assign({},A),{key:"".concat(A.key,".back")}))},d={key:"pano_luminance.".concat(e),basisLoaderInitialized:wi.isInitialized(),size:A.size?A.size/2:1024},g=this.enableIOSEDR&&c.images.luminance?{right:l(c.images.luminance.right,t.__assign(t.__assign({},d),{key:"".concat(d.key,".right")})),left:l(c.images.luminance.left,t.__assign(t.__assign({},d),{key:"".concat(d.key,".left")})),up:l(c.images.luminance.up,t.__assign(t.__assign({},d),{key:"".concat(d.key,".up")})),down:l(c.images.luminance.down,t.__assign(t.__assign({},d),{key:"".concat(d.key,".down")})),front:l(c.images.luminance.front,t.__assign(t.__assign({},d),{key:"".concat(d.key,".front")})),back:l(c.images.luminance.back,t.__assign(t.__assign({},d),{key:"".concat(d.key,".back")}))}:null,p="pano:"+Cr(h);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===p)return;var M=this.pendingTextureTask.panoIndex;null===(o=this.panoMeshes[M])||void 0===o||o.setProgress(0),this.emit("textureAbort",M,c),this.pendingTextureTask.onError(new Error("texture aborted"))}var f,y=this.model.getMaterial()||{},m=y.pano0,v=y.pano1;if(m&&m.map.name===p&&null!==m.luminanceMap===this.enableIOSEDR?f=m:(null==v?void 0:v.map.name)===p&&null!==v.luminanceMap===this.enableIOSEDR&&(f=v),f){var N={panoIndex:e,workCode:this.work.workCode,effect:null!==(a=i.effect)&&void 0!==a?a:"fly",panoPicture:{map:f.map,luminanceMap:f.luminanceMap,matrix:(new r.Matrix4).compose(c.position,c.quaternion,is)},position:c.position.clone()};this.doMoveToPano(e,N,i,n)}else{this.pending=!0,this.pendingTextureTask={panoIndex:e,hash:p,onLoad:function(t,s){var o,a;if(u.pending=!1,u.destroyed)t.body.dispose();else{t.body.name=p,u.emit("panoLoaded",e);var A={panoIndex:e,workCode:u.work.workCode,effect:null!==(o=i.effect)&&void 0!==o?o:"fly",panoPicture:{map:t.body,luminanceMap:null!==(a=null==s?void 0:s.body)&&void 0!==a?a:null,matrix:(new r.Matrix4).compose(c.position,c.quaternion,is)},position:c.position.clone()};u.doMoveToPano(e,A,i,n)}},onError:function(t){u.pending=!1,i.moveCancelCallback&&i.moveCancelCallback(),u.emit("panoLoadError",t,e),u.emit("moveToPanoCanceled",e)}};var D=this.panoMeshes[e];D&&D.tap&&D.tap(),Promise.all([this.textureLoader.loadCube(h,{format:r.RGBFormat,viaAjax:!0},void 0,void 0,(function(t){var i,n;u.emit("textureLoading",t,e,c),(null===(i=u.pendingTextureTask)||void 0===i?void 0:i.hash)===p&&(null===(n=u.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer),g?this.textureLoader.loadCube(g,{format:r.LuminanceFormat}).catch((function(){return null})):Promise.resolve(null)]).then((function(t){var i,n,r=t[0],s=t[1];(null===(i=u.pendingTextureTask)||void 0===i?void 0:i.hash)===p?(u.pendingTextureTask.onLoad(r,s),null===(n=u.panoMeshes[e])||void 0===n||n.setProgress(0),delete u.pendingTextureTask,u.emit("textureLoaded",e,c,r.meta)):(r.body.dispose(),null==s||s.body.dispose())})).catch((function(t){var i,n;(null===(i=u.pendingTextureTask)||void 0===i?void 0:i.hash)===p&&(u.pendingTextureTask.onError(t),null===(n=u.panoMeshes[e])||void 0===n||n.setProgress(0),delete u.pendingTextureTask,u.emit("textureError",t,e,c),u.emit("error",t))})),this.emit("textureStartLoad",e,c)}},i.prototype.initAnimation=function(e,t,i,n){var r,s,o,a=this;if(!this.destroyed){var u=!1;this.pending=!1,this.userAction=n,this.moveToPano(e,{longitude:null!==(r=t.longitude)&&void 0!==r?r:this.defaultLongitude,latitude:cn(null!==(s=t.latitude)&&void 0!==s?s:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:cn(null!==(o=t.fov)&&void 0!==o?o:this.defaultFov,this.minFov,this.maxFov),duration:i,moveStartCallback:function(e,t){u=!0,a.emit("initAnimationWillStart",e,t,a.userAction)},moveEndCallback:function(e,t){a.emit("initAnimationEnded",e,t,a.userAction),a.initAnimationed=!0},moveCancelCallback:function(){var e={longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone()};!1===u&&a.emit("initAnimationWillStart",a.currentPanoIndex,e,a.userAction),a.emit("initAnimationEnded",a.currentPanoIndex,e,a.userAction),a.initAnimationed=!0}},n)}},i.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},i.prototype.locationMotionKeyframesLength=function(e){for(var t=0,i=1;i<e.length;i++){var n=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,r=this.panoResourceFromLocationMotionKeyframe(e[i]).position;t+=n.distanceTo(r)*(e[i].value.count-e[i-1].value.count)}return t},i.prototype.updatePanoMeshes=function(e){void 0===e&&(e=!0);for(var t={},i=0,n=this.panoMeshes;i<n.length;i++){t[(u=n[i]).name]=u}this.panoMeshes.length=0;for(var s=0;s<this.work.observers.length;s++){var o="panoCircle_".concat(this.work.workCode,"_").concat(s),a=this.work.observers[s],u=void 0;if(t[o]?(u=t[o],delete t[o]):((u=this.panoCircleMeshCreator()).name=o,this.helper.add(u)),u.position.copy(a.standingPosition),e&&this.model.loaded&&this.model.bvhs.loaded){var c=new r.Vector3(0,-1,0),A=new r.Vector3(0,.1,0).add(u.position),l=new r.Raycaster(A,c,0,.1),h=this.model.intersectRaycaster(l)[0];h&&h.point.distanceTo(u.position)>.01&&u.position.copy(h.point)}this.panoMeshes[s]=u}for(var d=0,g=Object.keys(t);d<g.length;d++){var p=g[d];this.helper.remove(t[p]),t[p].dispose(),delete t[p]}},i.prototype.generateBoundingMesh=function(e){void 0===e&&(e=!1);for(var t=this.model.bounding.clone(),i=0,n=this.work.observers;i<n.length;i++){var s=n[i];t.expandByPoint(s.standingPosition),t.expandByPoint((new r.Vector3).fromArray([s.position.x,2*s.position.y-s.standingPosition.y,s.position.z]))}e&&t.expandByPoint(this.camera.position);var o=nr(t,new r.Vector3(1,0,1));return o.name="panorama_bounding",o},i.prototype.doMoveToPano=function(e,i,n,s){var o,a,u,c=this;void 0===n&&(n={}),this.userAction=s;var A=Re(),l=Xn();this.tiling.cleanup(),this.panoResources[l]=i;var h,d,g;if(this.locationMotion.ended){var p=this.locationMotion.getKeyFrameSegment(A);p[0];var M=p[1],f=this.locationMotion.value,y=this.panoResourceFromLocationMotionKeyframe(M).position,m=i.position;h=Math.max(y.distanceTo(m),1),d=[{key:M.key,progress:0,value:t.__assign(t.__assign({},f),{count:0})},{key:l,progress:1,value:{distance:0,perspToOrtho:0,modelAlpha:0,count:1}}],g=0}else{var v=this.locationMotion.getKeyFrameSegment(A),N=v[0],D=(M=v[1],f=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(N).position),E=(y=this.panoResourceFromLocationMotionKeyframe(M).position,m=i.position,M.value.count-f.count),w=Math.max(D.distanceTo(y),1)*E;h=w+Math.max(y.distanceTo(m),1),d=[{key:N.key,progress:0,value:t.__assign({},f)},{key:M.key,progress:w/h,value:M.value},{key:l,progress:1,value:{count:M.value.count+1,distance:0,perspToOrtho:0,modelAlpha:0}}];var I=this.locationMotionKeyframesLength(this.locationMotion.keyframes),T=this.locationMotionKeyframesLength(d);g=this.locationMotion.getProgressVelocity(A)*I/T}var x=this.calculateMovingDuration(n.duration,h),j={longitude:n.longitude,latitude:n.latitude,fov:n.fov},z={longitude:null!==(o=j.longitude)&&void 0!==o?o:this.camera.pose.longitude,latitude:null!==(a=j.latitude)&&void 0!==a?a:this.camera.pose.latitude,fov:null!==(u=j.fov)&&void 0!==u?u:this.camera.pose.fov,offset:i.position.clone()};n.moveStartCallback&&n.moveStartCallback(e,z),this.emit("panoWillArrive",e,z,this.userAction),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Pe,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(j,x).catch(Pe),this.locationMotion.setKeyframes(d,x,g).then((function(){var t,i,o,a={longitude:c.camera.pose.longitude,latitude:c.camera.pose.latitude,fov:c.camera.pose.fov,offset:c.camera.pose.offset.clone()};n.moveEndCallback&&n.moveEndCallback(e,a),c.emit("panoArrived",e,a,s);var u=c.work.observers[c.currentPanoIndex];if(u&&u.video&&c.videoTexture&&c.videoTexture.image instanceof HTMLVideoElement){var A=ts.clone().multiply(null!==(o=null===(i=null===(t=c.model.getMaterial())||void 0===t?void 0:t.pano1)||void 0===i?void 0:i.matrix)&&void 0!==o?o:new r.Matrix4).multiply(u.video.matrix),l={map:c.videoTexture,size:u.video.size,matrix:A,alpha:1},h=Xn(),d=c.videoTexture.image;d.setAttribute("uuid",h),(br||(br=new Promise((function(e){var t,i=document.createElement("video");i.muted=!0,i.src="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCB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Aw",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&&u.video&&d.getAttribute("uuid")===h&&(d.oncanplay=function(){d.oncanplay=Pe,d.play()},d.ontimeupdate=function(){d.currentTime>.5&&(d.ontimeupdate=Pe,c.panoVideo.setMaterial(l))},d.src=u.video.source)})).catch((function(){d.removeAttribute("uuid")}))}}),(function(){n.moveCancelCallback&&n.moveCancelCallback(),c.emit("moveToPanoCanceled",e)}))},i.prototype.getForwardPanoIndexOrNot=function(e){var t=this,i=this.camera.getWorldDirection(new r.Vector3),n=this.camera.position.clone(),s=this.work.observers[this.currentPanoIndex];if(!s)return null;var o=s.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var i=t.work.observers[e],s=i.standingPosition.clone().sub(n);return 0!==s.length()&&(!(s.angleTo(new r.Vector3(0,-1,0))<Math.PI/12)&&(i.loadable||i.active))})),a=(e?e.ray.direction.clone():i.clone()).setY(0);if(0===a.length())return null;for(var u=o.slice().sort((function(e,i){var r=t.work.observers[e].position.clone().setY(n.y),s=t.work.observers[i].position.clone().setY(n.y);return r.distanceTo(n)-s.distanceTo(n)})),c=0,A=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];c<A.length;c++)for(var l=A[c],h=0,d=u;h<d.length;h++){var g=d[h],p=this.work.observers[g].position.clone().setY(n.y).sub(n);if(0!==p.length()&&a.angleTo(p)<l)return g}return null},i.prototype.onTapGesture=function(e){var i=this,n=e.pointers.map((function(e){return ni(e,["x","y"])}));if(!this.emit("wantsGesture","tap",n,!0)){var s=this.relativeClientPosition(e.center),o=new r.Raycaster;if(o.setFromCamera(s,this.camera),!this.emit("wantsTapGesture",o,s,!0)){this.emit("gesture","tap",n,!0),this.emit("tapGesture",o,s,!0),this.interiaMovement=!1;var a=this.camera.getWorldDirection(new r.Vector3).setY(0),u=null,c=this.work.observers[this.currentPanoIndex];if(c){var A=c.accessibleNodes.filter((function(e){if(e===i.currentPanoIndex)return!1;var t=i.work.observers[e];return!(t.position.distanceTo(i.camera.position)>i.maxAccessibleDistance)&&(t.loadable||t.active)})),l=this.model.intersectRaycaster(o)[0];if(l){var h=hr(A,(function(e){var t=i.work.observers[e].standingPosition.clone();return t.clone().sub(i.camera.position).setY(0).angleTo(a)>Math.PI/2?1/0:t.distanceTo(l.point)}),!0),d=h[0];h[1]<this.panoTapTriggerRadius&&(u=d)}Vi(u)&&(u=this.getForwardPanoIndexOrNot(o));for(var g=0,p=this.locationMotion.keyframes;g<p.length;g++){var M=p[g],f=this.panoResourceFromLocationMotionKeyframe(M);if(!(M.progress<this.locationMotion.progress)&&f.panoIndex===u){u=null;break}}if(this.emit("panoSelected",u),Vi(u))!0===this.locationMotion.ended&&this.cameraBounce();else{var y=this.work.observers[u];if(y.active){for(var m={},v=Math.PI/6,N=Math.PI/12,D=new r.Vector3(0,1,0),E=y.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),w=E.clone().applyAxisAngle(D,v),I=E.clone().applyAxisAngle(D,-v),T=[],x=[],j=[],z=0,C=y.accessibleNodes;z<C.length;z++){if((d=C[z])!==this.currentPanoIndex&&d!==u){var b=this.work.observers[d].position.clone().sub(y.position).setY(0);E.angleTo(b)<v?j.push(b):w.angleTo(b)<v?T.push(b):I.angleTo(b)<v&&x.push(b)}}var S=(j.length>0?j:t.__spreadArray(t.__spreadArray([],T,!0),x,!0)).slice().sort((function(e,t){return e.angleTo(E)-t.angleTo(E)}))[0];S&&S.angleTo(a)>N&&(m.longitude=Math.atan2(-S.x,-S.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(m.latitude=cn(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(m.fov=this.defaultFov),this.emit("wantsMoveToPano",u,m,!0)}else this.panoMeshes[u]&&(this.panoMeshes[u].setDisabled(!1),this.panoMeshes[u].setLoading(!0))}}}}},i}(Sr),rs=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
- /**
374
- * @license
375
- * cardboard-vr-display
376
- * Copyright (c) 2015-2017 Google
377
- * Licensed under the Apache License, Version 2.0 (the "License");
378
- * you may not use this file except in compliance with the License.
379
- * You may obtain a copy of the License at
380
- *
381
- * http://www.apache.org/licenses/LICENSE-2.0
382
- *
383
- * Unless required by applicable law or agreed to in writing, software
384
- * distributed under the License is distributed on an "AS IS" BASIS,
385
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
386
- * See the License for the specific language governing permissions and
387
- * limitations under the License.
388
- */
389
- /**
390
- * @license
391
- * gl-preserve-state
392
- * Copyright (c) 2016, Brandon Jones.
393
- *
394
- * Permission is hereby granted, free of charge, to any person obtaining a copy
395
- * of this software and associated documentation files (the "Software"), to deal
396
- * in the Software without restriction, including without limitation the rights
397
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
398
- * copies of the Software, and to permit persons to whom the Software is
399
- * furnished to do so, subject to the following conditions:
400
- *
401
- * The above copyright notice and this permission notice shall be included in
402
- * all copies or substantial portions of the Software.
403
- *
404
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
405
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
406
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
407
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
408
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
409
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
410
- * THE SOFTWARE.
411
- */
412
- /**
413
- * @license
414
- * webvr-polyfill-dpdb
415
- * Copyright (c) 2015-2017 Google
416
- * Licensed under the Apache License, Version 2.0 (the "License");
417
- * you may not use this file except in compliance with the License.
418
- * You may obtain a copy of the License at
419
- *
420
- * http://www.apache.org/licenses/LICENSE-2.0
421
- *
422
- * Unless required by applicable law or agreed to in writing, software
423
- * distributed under the License is distributed on an "AS IS" BASIS,
424
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
425
- * See the License for the specific language governing permissions and
426
- * limitations under the License.
427
- */
428
- /**
429
- * @license
430
- * nosleep.js
431
- * Copyright (c) 2017, Rich Tibbett
432
- *
433
- * Permission is hereby granted, free of charge, to any person obtaining a copy
434
- * of this software and associated documentation files (the "Software"), to deal
435
- * in the Software without restriction, including without limitation the rights
436
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
437
- * copies of the Software, and to permit persons to whom the Software is
438
- * furnished to do so, subject to the following conditions:
439
- *
440
- * The above copyright notice and this permission notice shall be included in
441
- * all copies or substantial portions of the Software.
442
- *
443
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
444
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
445
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
446
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
447
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
448
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
449
- * THE SOFTWARE.
450
- */
451
- !function(e,t){n.exports=t()}(0,(function(){var n,r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},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}}(),o=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")}}(),a=.001,u=1,c=function(e,t){return"data:"+e+","+encodeURIComponent(t)},A=function(e,t,i){return e+(t-e)*i},l=function(){var e=/iPad|iPhone|iPod/.test(t.platform);return function(){return e}}(),h=function(){var e=-1!==t.userAgent.indexOf("Version")&&-1!==t.userAgent.indexOf("Android")&&-1!==t.userAgent.indexOf("Chrome");return function(){return e}}(),d=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}}(),p=function(){var e=t.userAgent.match(/.*Chrome\/([0-9]+)/),i=e?parseInt(e[1],10):null;return function(){return i}}(),M=function(){var e=!1;return e=l()&&d()&&-1!==t.userAgent.indexOf("13_4"),function(){return e}}(),f=function(){var e=!1;if(65===p()){var i=t.userAgent.match(/.*Chrome\/([0-9\.]*)/);if(i){var n=i[1].split("."),r=o(n,4);r[0],r[1];var s=r[2],a=r[3];e=3325===parseInt(s,10)&&parseInt(a,10)<148}}return function(){return e}}(),y=function(){var e=-1!==t.userAgent.indexOf("R7 Build");return function(){return e}}(),m=function(){var t=90==e.orientation||-90==e.orientation;return y()?!t:t},v=function(e){return!(isNaN(e)||e<=a||e>u)},N=function(){return Math.max(e.screen.width,e.screen.height)*e.devicePixelRatio},D=function(){return Math.min(e.screen.width,e.screen.height)*e.devicePixelRatio},E=function(e){if(h())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},w=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},I=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},T=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},x=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},j=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},z=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},C=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},b=function(t){if(l()){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},S=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),A=2/(u+c),l=2/(o+a);return i[0]=A,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=l,i[6]=0,i[7]=0,i[8]=-(u-c)*A*.5,i[9]=(o-a)*l*.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,A=n*a,l=n*u,h=n*c,d=r*u,g=r*c,p=s*c,M=o*a,f=o*u,y=o*c;return e[0]=1-(d+p),e[1]=l+y,e[2]=h-f,e[3]=0,e[4]=l-y,e[5]=1-(A+p),e[6]=g+M,e[7]=0,e[8]=h+f,e[9]=g-M,e[10]=1-(A+d),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,A,l,h,d,g,p=i[0],M=i[1],f=i[2];return t===e?(e[12]=t[0]*p+t[4]*M+t[8]*f+t[12],e[13]=t[1]*p+t[5]*M+t[9]*f+t[13],e[14]=t[2]*p+t[6]*M+t[10]*f+t[14],e[15]=t[3]*p+t[7]*M+t[11]*f+t[15]):(n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],u=t[5],c=t[6],A=t[7],l=t[8],h=t[9],d=t[10],g=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]=A,e[8]=l,e[9]=h,e[10]=d,e[11]=g,e[12]=n*p+a*M+l*f+t[12],e[13]=r*p+u*M+h*f+t[13],e[14]=s*p+c*M+d*f+t[14],e[15]=o*p+A*M+g*f+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],A=t[8],l=t[9],h=t[10],d=t[11],g=t[12],p=t[13],M=t[14],f=t[15],y=i*a-n*o,m=i*u-r*o,v=i*c-s*o,N=n*u-r*a,D=n*c-s*a,E=r*c-s*u,w=A*p-l*g,I=A*M-h*g,T=A*f-d*g,x=l*M-h*p,j=l*f-d*p,z=h*f-d*M,C=y*z-m*j+v*x+N*T-D*I+E*w;return C?(C=1/C,e[0]=(a*z-u*j+c*x)*C,e[1]=(r*j-n*z-s*x)*C,e[2]=(p*E-M*D+f*N)*C,e[3]=(h*D-l*E-d*N)*C,e[4]=(u*T-o*z-c*I)*C,e[5]=(i*z-r*T+s*I)*C,e[6]=(M*v-g*E-f*m)*C,e[7]=(A*E-h*v+d*m)*C,e[8]=(o*j-a*T+c*w)*C,e[9]=(n*T-i*j-s*w)*C,e[10]=(g*D-p*v+f*y)*C,e[11]=(l*v-A*D-d*y)*C,e[12]=(a*I-o*x-u*w)*C,e[13]=(i*x-n*I+r*w)*C,e[14]=(p*m-g*N-M*y)*C,e[15]=(A*N-l*m+h*y)*C,e):null}var o=new Float32Array([0,0,0,1]),a=new Float32Array([0,0,0]);function u(e,t,u,c,A,l){i(e,c||null,l.depthNear,l.depthFar),n(t,u.orientation||o,u.position||a),A&&r(t,t,A),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))}}(),L=function(){var t=e.self!==e.top,i=O(document.referrer),n=O(e.location.href);return t&&i!==n},O=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)},Q=(n={},function(e,t){void 0===n[e]&&(console.warn("webvr-polyfill: "+t),n[e]=!0)}),k=function(e,t){Q(e,e+" has been deprecated. This may not work on native WebVR displays. "+(t?"Please use "+t+" instead.":""))};function P(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 U=P,R=["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"),_=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");function Y(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,l()||(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=T(e,R,_,this.attribs),this.uniforms=x(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()}Y.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()},Y.prototype.onResize=function(){var e=this.gl,t=this,i=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];U(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()},Y.prototype.patch=function(){if(!this.isPatched){var e=this,t=this.gl.canvas,i=this.gl;l()||(t.width=N()*this.bufferScale,t.height=D()*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,b(t)}},Y.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,t=this.gl.canvas;l()||(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(){b(t)}),1)}},Y.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]},Y.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),U(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||l())&&(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))})),l()){var n=e.canvas;n.width==t.bufferWidth&&n.height==t.bufferHeight||(t.bufferWidth=n.width,t.bufferHeight=n.height,t.onResize())}},Y.prototype.updateDeviceInfo=function(e){var t=this.gl,i=this,n=[t.ARRAY_BUFFER_BINDING,t.ELEMENT_ARRAY_BUFFER_BINDING];U(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}}))},Y.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),d=c/(t-1),g=h,p=d,M=A(r[0],r[2],h),f=A(r[3],r[1],d),y=Math.sqrt(M*M+f*f),m=i.distortion.distortInverse(y),v=f*m/y;h=(M*m/y-s[0])/(s[2]-s[0]),d=(v-s[3])/(s[1]-s[3]),h=2*(o.x+h*o.width-.5),d=2*(o.y+d*o.height-.5),n[5*a+0]=h,n[5*a+1]=d,n[5*a+2]=g,n[5*a+3]=p,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},Y.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},Y.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 F=["attribute vec2 position;","uniform mat4 projectionMat;","void main() {"," gl_Position = projectionMat * vec4( position, -1.0, 1.0 );","}"].join("\n"),H=["precision mediump float;","uniform vec4 color;","void main() {"," gl_FragColor = color;","}"].join("\n"),V=Math.PI/180,G=60,K=12,q=20,W=1,X=.75,Z=.3125,J=4,$=28,ee=1.5;function te(e){this.gl=e,this.attribs={position:0},this.program=T(e,F,H,this.attribs),this.uniforms=x(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 ie(e){this.coefficients=e}te.prototype.destroy=function(){var e=this.gl;this.listener&&e.canvas.removeEventListener("click",this.listener,!1),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer)},te.prototype.listen=function(e,t){var i=this.gl.canvas;this.listener=function(n){var r=i.clientWidth/2,s=$*ee;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)},te.prototype.onResize=function(){var t=this.gl,i=this,n=[t.ARRAY_BUFFER_BINDING];U(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=J*o/2,u=$*ee*o,c=$*o/2,A=($*ee-$)*o;function l(e,t){var i=(90-e)*V,s=Math.cos(i),o=Math.sin(i);n.push(Z*s*c+r,Z*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 h=0;h<=6;h++){var d=h*G;l(d,W),l(d+K,W),l(d+q,X),l(d+(G-q),X),l(d+(G-K),W)}function g(e,i){n.push(A+e,t.drawingBufferHeight-A-i)}i.gearVertexCount=n.length/2-i.gearOffset,i.arrowOffset=n.length/2;var p=a/Math.sin(45*V);g(0,c),g(c,0),g(c+p,p),g(p,c+p),g(p,c-p),g(0,c),g(c,2*c),g(c+p,2*c-p),g(p,c-p),g(0,c),g(p,c-a),g($*o,c-a),g(p,c+a),g($*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)}))},te.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];U(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()}))},te.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),j(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)},ie.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},ie.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 ne=Math.PI/180,re=180/Math.PI,se=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0};se.prototype={constructor:se,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,A=a*n+r*i-s*t,l=-r*t-s*i-o*n;return this.x=u*a+l*-r+c*-o-A*-s,this.y=c*a+l*-s+A*-r-u*-o,this.z=A*a+l*-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 oe,ae,ue,ce=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 Ae(e){this.width=e.width||N(),this.height=e.height||D(),this.widthMeters=e.widthMeters,this.heightMeters=e.heightMeters,this.bevelMeters=e.bevelMeters}ce.prototype={constructor:ce,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,A=Math.sin(t*a)/u;return this.w=s*c+this.w*A,this.x=i*c+this.x*A,this.y=n*c+this.y*A,this.z=r*c+this.z*A,this},setFromUnitVectors:(ue=1e-6,function(e,t){return void 0===oe&&(oe=new se),(ae=e.dot(t)+1)<ue?(ae=0,Math.abs(e.x)>Math.abs(e.z)?oe.set(-e.y,e.x,0):oe.set(0,-e.z,e.y)):oe.crossVectors(e,t),this.x=oe.x,this.y=oe.y,this.z=oe.z,this.w=ae,this.normalize(),this})};var le=new Ae({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),he=new Ae({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),de={CardboardV1:new pe({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 pe({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=de.CardboardV2,this.updateDeviceParams(e),this.distortion=new ie(this.viewer.distortionCoefficients);for(var i=0;i<t.length;i++){var n=t[i];de[n.id]=new pe(n)}}function pe(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 ie(this.viewer.distortionCoefficients)},ge.prototype.determineDevice_=function(e){if(!e)return l()?(console.warn("Using fallback iOS device measurements."),he):(console.warn("Using fallback Android device measurements."),le);var t=.0254,i=t/e.xdpi,n=t/e.ydpi;return new Ae({widthMeters:i*N(),heightMeters:n*D(),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=re*Math.atan(i.distort(r/n)),c=re*Math.atan(i.distort(s/n)),A=re*Math.atan(i.distort(o/n)),l=re*Math.atan(i.distort(a/n));return{leftDegrees:Math.min(u,e.fov),rightDegrees:Math.min(c,e.fov),downDegrees:Math.min(A,e.fov),upDegrees:Math.min(l,e.fov)}},ge.prototype.getLeftEyeVisibleTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,n=Math.tan(-ne*e.fov),r=Math.tan(ne*e.fov),s=Math.tan(ne*e.fov),o=Math.tan(-ne*e.fov),a=t.widthMeters/4,u=t.heightMeters/2,c=e.baselineLensDistance-t.bevelMeters-u,A=e.interLensDistance/2-a,l=-c,h=e.screenLensDistance,d=i.distort((A-a)/h),g=i.distort((l+u)/h),p=i.distort((A+a)/h),M=i.distort((l-u)/h),f=new Float32Array(4);return f[0]=Math.max(n,d),f[1]=Math.min(r,g),f[2]=Math.min(s,p),f[3]=Math.max(o,M),f},ge.prototype.getLeftEyeNoLensTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,n=new Float32Array(4),r=i.distortInverse(Math.tan(-ne*e.fov)),s=i.distortInverse(Math.tan(ne*e.fov)),o=i.distortInverse(Math.tan(ne*e.fov)),a=i.distortInverse(Math.tan(-ne*e.fov)),u=t.widthMeters/4,c=t.heightMeters/2,A=e.baselineLensDistance-t.bevelMeters-c,l=e.interLensDistance/2-u,h=-A,d=e.screenLensDistance,g=(l-u)/d,p=(h+c)/d,M=(l+u)/d,f=(h-c)/d;return n[0]=Math.max(r,g),n[1]=Math.min(s,p),n[2]=Math.min(o,M),n[3]=Math.max(a,f),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:re*Math.atan(e.outerDist),rightDegrees:re*Math.atan(e.innerDist),downDegrees:re*Math.atan(e.bottomDist),upDegrees:re*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,A=i.distortInverse(Math.tan(ne*c)),l=Math.min(a,A),h=Math.min(r,A),d=Math.min(u,A);return{outerDist:l,innerDist:h,topDist:Math.min(o-u,A),bottomDist:d,eyePosX:a,eyePosY:u}},ge.Viewers=de;var Me={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 fe(e,t){if(this.dpdb=Me,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 ye(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}function me(e,t){this.set(e,t)}function ve(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new me,this.currentGyroMeasurement=new me,this.previousGyroMeasurement=new me,l()?this.filterQ=new ce(-1,0,0,1):this.filterQ=new ce(1,0,0,1),this.previousFilterQ=new ce,this.previousFilterQ.copy(this.filterQ),this.accelQ=new ce,this.isOrientationInitialized=!1,this.estimatedGravity=new se,this.measuredGravity=new se,this.gyroIntegralQ=new ce}function Ne(e,t){this.predictionTimeS=e,this.isDebug=t,this.previousQ=new ce,this.previousTimestampS=null,this.deltaQ=new ce,this.outQ=new ce}function De(t,i,n,r){this.yawOnly=n,this.accelerometer=new se,this.gyroscope=new se,this.filter=new ve(t,r),this.posePredictor=new Ne(i,r),this.isFirefoxAndroid=g(),this.isIOS=l();var s=p();this.isDeviceMotionInRadians=!this.isIOS&&s&&s<66,this.isWithoutDeviceMotion=f()||M(),this.filterToWorldQ=new ce,l()?this.filterToWorldQ.setFromAxisAngle(new se(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new se(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new ce,this.worldToScreenQ=new ce,this.originalPoseAdjustQ=new ce,this.originalPoseAdjustQ.setFromAxisAngle(new se(0,0,1),-e.orientation*Math.PI/180),this.setScreenTransform_(),m()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new ce,this.orientationOut_=new Float32Array(4),this.start()}fe.prototype.getDeviceParams=function(){return this.deviceParams},fe.prototype.recalculateDeviceParams_=function(){var e=this.calcDeviceParams_();e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},fe.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=N(),s=D();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(l()==("ios"==a.type)){for(var u=!1,c=0;c<a.rules.length;c++){var A=a.rules[c];if(this.ruleMatches_(A,n,r,s)){u=!0;break}}if(u)return new ye({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},fe.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},me.prototype.set=function(e,t){this.sample=e,this.timestampS=t},me.prototype.copy=function(e){this.set(e.sample,e.timestampS)},ve.prototype.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},ve.prototype.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e,t);var i=t-this.previousGyroMeasurement.timestampS;v(i)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},ve.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 ce;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 ce;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)",re*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 ce;r.copy(this.filterQ),r.multiply(n),this.filterQ.slerp(r,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},ve.prototype.getOrientation=function(){return this.filterQ},ve.prototype.accelToQuaternion_=function(e){var t=new se;t.copy(e),t.normalize();var i=new ce;return i.setFromUnitVectors(new se(0,0,-1),t),i.inverse(),i},ve.prototype.gyroToQuaternionDelta_=function(e,t){var i=new ce,n=new se;return n.copy(e),n.normalize(),i.setFromAxisAngle(n,e.length()*t),i},Ne.prototype.getPrediction=function(e,t,i){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=i,e;var n=new se;n.copy(t),n.normalize();var r=t.length();if(r<20*ne)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(re*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},De.prototype.getPosition=function(){return null},De.prototype.getOrientation=function(){var t=void 0;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ)return this.deviceOrientationFixQ=this.deviceOrientationFixQ||function(){var t=(new ce).setFromAxisAngle(new se(0,0,-1),0),i=new ce;return-90===e.orientation?i.setFromAxisAngle(new se(0,1,0),Math.PI/-2):i.setFromAxisAngle(new se(0,1,0),Math.PI/2),t.multiply(i)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||((i=new ce).setFromAxisAngle(new se(1,0,0),-Math.PI/2),i),t=this._deviceOrientationQ,(n=new ce).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 ce).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_},De.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),m()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},De.prototype.onDeviceOrientation_=function(e){this._deviceOrientationQ=this._deviceOrientationQ||new ce;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)},De.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},De.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,n=e.timeStamp/1e3,r=n-this.previousTimestampS;return r<0?(Q("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=n)):r<=a||r>u?(Q("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&&(y()?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))},De.prototype.onOrientationChange_=function(e){this.setScreenTransform_()},De.prototype.onMessage_=function(e){var t=e.data;t&&t.type&&"devicemotion"===t.type.toLowerCase()&&this.updateDeviceMotion_(t.deviceMotionEvent)},De.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),e.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new se(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new se(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},De.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),l()&&L()&&e.addEventListener("message",this.onMessageCallback_),e.addEventListener("orientationchange",this.onOrientationChangeCallback_),this.isWithoutDeviceMotion?e.addEventListener("deviceorientation",this.onDeviceOrientationCallback_):e.addEventListener("devicemotion",this.onDeviceMotionCallback_)},De.prototype.stop=function(){e.removeEventListener("devicemotion",this.onDeviceMotionCallback_),e.removeEventListener("deviceorientation",this.onDeviceOrientationCallback_),e.removeEventListener("orientationchange",this.onOrientationChangeCallback_),e.removeEventListener("message",this.onMessageCallback_)};var Ee=60,we=new se(1,0,0),Ie=new se(0,0,1),Te=new ce;Te.setFromAxisAngle(we,-Math.PI/2),Te.multiply((new ce).setFromAxisAngle(Ie,Math.PI/2));var xe=function(){function e(t){r(this,e),this.config=t,this.sensor=null,this.fusionSensor=null,this._out=new Float32Array(4),this.api=null,this.errors=[],this._sensorQ=new ce,this._outQ=new ce,this._onSensorRead=this._onSensorRead.bind(this),this._onSensorError=this._onSensorError.bind(this),this.init()}return s(e,[{key:"init",value:function(){var e=null;try{(e=new RelativeOrientationSensor({frequency:Ee,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 De(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(Te),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}(),je="<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 ze(){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()}ze.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;m()?(t.width="20%",t.marginLeft="40%",t.marginTop="3%"):(t.width="50%",t.marginLeft="25%",t.marginTop="25%")},ze.prototype.hide=function(){this.overlay.style.display="none"},ze.prototype.showTemporarily=function(e,t){this.show(t),this.timer=setTimeout(this.hide.bind(this),e)},ze.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},ze.prototype.update=function(){this.disableShowTemporarily(),!m()&&z()?this.show():this.hide()},ze.prototype.loadIcon_=function(){this.icon=c("image/svg+xml",je)};var Ce="CardboardV1",be="WEBVR_CARDBOARD_VIEWER",Se="webvr-polyfill-viewer-selector";function Le(e){try{this.selectedKey=localStorage.getItem(be)}catch(e){console.error("Failed to load viewer profile: %s",e)}this.selectedKey||(this.selectedKey=e||Ce),this.dialog=this.createDialog_(ge.Viewers),this.root=null,this.onChangeCallbacks_=[]}function Oe(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}Le.prototype.show=function(e){this.root=e,e.appendChild(this.dialog),this.dialog.querySelector("#"+this.selectedKey).checked=!0,this.dialog.style.display="block"},Le.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},Le.prototype.getCurrentViewer=function(){return ge.Viewers[this.selectedKey]},Le.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},Le.prototype.onChange=function(e){this.onChangeCallbacks_.push(e)},Le.prototype.fireOnChange_=function(e){for(var t=0;t<this.onChangeCallbacks_.length;t++)this.onChangeCallbacks_[t](e)},Le.prototype.onSave_=function(){if(this.selectedKey=this.getSelectedKey_(),this.selectedKey&&ge.Viewers[this.selectedKey]){this.fireOnChange_(ge.Viewers[this.selectedKey]);try{localStorage.setItem(be,this.selectedKey)}catch(e){console.error("Failed to save viewer profile: %s",e)}this.hide()}else console.error("ViewerSelector.onSave_: this should never happen!")},Le.prototype.createDialog_=function(e){var t=document.createElement("div");t.classList.add(Se),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},Le.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},Le.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},Le.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 Qe=Oe(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///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNh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AAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}])}))}))),ke=1e3,Pe=[0,0,.5,1],Ue=[.5,0,.5,1],Re=e.requestAnimationFrame,_e=e.cancelAnimationFrame;function Ye(){this.leftProjectionMatrix=new Float32Array(16),this.leftViewMatrix=new Float32Array(16),this.rightProjectionMatrix=new Float32Array(16),this.rightViewMatrix=new Float32Array(16),this.pose=null}function Fe(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 k("VRDisplayCapabilities.prototype.hasOrientation","VRDisplay.prototype.getFrameData"),e.hasOrientation}}})}function He(e){var t=!("wakelock"in(e=e||{}))||e.wakelock;this.isPolyfilled=!0,this.displayId=ke++,this.displayName="",this.depthNear=.01,this.depthFar=1e4,this.isPresenting=!1,Object.defineProperty(this,"isConnected",{get:function(){return k("VRDisplay.prototype.isConnected","VRDisplayCapabilities.prototype.hasExternalDisplay"),!1}}),this.capabilities=new Fe({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&&z()&&(this.wakelock_=new Qe)}He.prototype.getFrameData=function(e){return S(e,this._getPose(),this)},He.prototype.getPose=function(){return k("VRDisplay.prototype.getPose","VRDisplay.prototype.getFrameData"),this._getPose()},He.prototype.resetPose=function(){return k("VRDisplay.prototype.resetPose"),this._resetPose()},He.prototype.getImmediatePose=function(){return k("VRDisplay.prototype.getImmediatePose","VRDisplay.prototype.getFrameData"),this._getPose()},He.prototype.requestAnimationFrame=function(e){return Re(e)},He.prototype.cancelAnimationFrame=function(e){return _e(e)},He.prototype.wrapForFullscreen=function(e){if(l())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_},He.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}},He.prototype.requestPresent=function(e){var t=this.isPresenting,i=this;return e instanceof Array||(k("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||Pe,a=s.rightBounds||Ue;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 A=i.wrapForFullscreen(i.layer_.source),d=function(){var e=I();i.isPresenting=A===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_()},g=function(){i.waitingForPresent_&&(i.removeFullscreenWrapper(),i.removeFullscreenListeners_(),i.disableWakeLock(),i.waitingForPresent_=!1,i.isPresenting=!1,r(new Error("Unable to present.")))};i.addFullscreenListeners_(A,d,g),E(A)?(i.enableWakeLock(),i.waitingForPresent_=!0):(l()||h())&&(i.enableWakeLock(),i.isPresenting=!0,i.beginPresent_(),i.fireVRDisplayPresentChange_(),n())}i.waitingForPresent_||l()||(w(),r(new Error("Unable to present.")))}else n()}else r(new Error("VRDisplay is not capable of presenting."))}))},He.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.disableWakeLock(),new Promise((function(i,n){e?(!w()&&l()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),h()&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.endPresent_(),t.fireVRDisplayPresentChange_()),i()):n(new Error("Was not presenting to VRDisplay."))}))},He.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},He.prototype.fireVRDisplayPresentChange_=function(){var t=new CustomEvent("vrdisplaypresentchange",{detail:{display:this}});e.dispatchEvent(t)},He.prototype.fireVRDisplayConnect_=function(){var t=new CustomEvent("vrdisplayconnect",{detail:{display:this}});e.dispatchEvent(t)},He.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))},He.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}},He.prototype.enableWakeLock=function(){this.wakelock_&&this.wakelock_.enable()},He.prototype.disableWakeLock=function(){this.wakelock_&&this.wakelock_.disable()},He.prototype.beginPresent_=function(){},He.prototype.endPresent_=function(){},He.prototype.submitFrame=function(e){},He.prototype.getEyeParameters=function(e){return null};var Ve={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},Ge={LEFT:"left",RIGHT:"right"};function Ke(t){var i=C({},Ve);t=C(i,t||{}),He.call(this,{wakelock:t.MOBILE_WAKE_LOCK}),this.config=t,this.displayName="Cardboard VRDisplay",this.capabilities=new Fe({hasPosition:!1,hasOrientation:!0,hasExternalDisplay:!1,canPresent:!0,maxLayers:1}),this.stageParameters=null,this.bufferScale_=this.config.BUFFER_SCALE,this.poseSensor_=new xe(this.config),this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new fe(this.config.DPDB_URL,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new ge(this.dpdb_.getDeviceParams(),t.ADDITIONAL_VIEWERS),this.viewerSelector_=new Le(t.DEFAULT_VIEWER),this.viewerSelector_.onChange(this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),this.config.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new ze),l()&&e.addEventListener("resize",this.onResize_.bind(this))}return Ke.prototype=Object.create(He.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==Ge.LEFT)t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=Ge.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==Ge.LEFT)t=[.5*-this.deviceInfo_.viewer.interLensDistance,0,0];else{if(e!=Ge.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 k("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=N()*this.bufferScale_,t.canvas.height=D()*this.bufferScale_,this.cardboardUI_=new te(t)):(this.config.CARDBOARD_UI_DISABLED||(this.cardboardUI_=new te(t)),this.distorter_=new Y(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_&&(m()&&z()?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("; ")+";"),b(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=Ye,Ke.VRDisplay=He,Ke}))}))),c="0.10.12",A={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 l(i){this.config=a(a({},A),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_()})))}l.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},l.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},l.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())},l.version=c,l.VRFrameData=u.VRFrameData,l.VRDisplay=u.VRDisplay;var h=Object.freeze({default:l}),d=h&&l||h;return void 0!==i&&i.window&&(i.document||(i.document=i.window.document),i.navigator||(i.navigator=i.window.navigator)),d}("undefined"!=typeof window?window:{screen:{width:512,height:512}},"undefined"!=typeof navigator?navigator:{userAgent:"node"});function ss(e,t){var i,n,s,o,a=new r.Vector3,u=new r.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 A=this,l=e.getSize(new r.Vector2),h=!1,d=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,s){if(l=new r.Vector2(t,n),h=s,A.isPresenting){var o=i.getEyeParameters("left");e.setPixelRatio(1),e.setSize(2*o.renderWidth,o.renderHeight,!1)}else e.setPixelRatio(d),e.setSize(t,n,s)};var g=e.domElement,p=[0,0,.5,1],M=[.5,0,.5,1];function f(){var t=A.isPresenting;if(A.isPresenting=void 0!==i&&i.isPresenting,A.isPresenting){var n=i.getEyeParameters("left"),s=n.renderWidth,o=n.renderHeight;t||(d=e.getPixelRatio(),l=e.getSize(new r.Vector2),e.setPixelRatio(1),e.setSize(2*s,o,!1))}else t&&(e.setPixelRatio(d),e.setSize(l.width,l.height,h))}window.addEventListener("vrdisplaypresentchange",f,!1),this.setFullScreen=function(e){return new Promise((function(t,n){void 0!==i?A.isPresenting!==e?e?(i.requestPresent([{source:g}]),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&&A.isPresenting&&i.submitFrame()},this.autoSubmitFrame=!0;var y=new r.PerspectiveCamera;y.layers.enable(1);var m=new r.PerspectiveCamera;function v(e,t,i,n){var s=Math.PI/180;return function(e,t,i,n){i=void 0===i?.01:i,n=void 0===n?1e4:n;var s=(t=void 0===t||t)?-1:1,o=new r.Matrix4,a=o.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 a[0]=u.scale[0],a[1]=0,a[2]=u.offset[0]*s,a[3]=0,a[4]=0,a[5]=u.scale[1],a[6]=-u.offset[1]*s,a[7]=0,a[8]=0,a[9]=0,a[10]=n/(i-n)*-s,a[11]=n*i/(i-n),a[12]=0,a[13]=0,a[14]=s,a[15]=0,o.transpose(),o}({upTan:Math.tan(e.upDegrees*s),downTan:Math.tan(e.downDegrees*s),leftTan:Math.tan(e.leftDegrees*s),rightTan:Math.tan(e.rightDegrees*s)},t,i,n)}m.layers.enable(2),this.render=function(t,n){var l,h;if(i&&A.isPresenting){var d=t.autoUpdate;d&&(t.updateMatrixWorld(),t.autoUpdate=!1);var g=i.getEyeParameters("left"),f=i.getEyeParameters("right");a.fromArray(g.offset),u.fromArray(f.offset),Array.isArray(t)&&(console.warn("THREE.VREffect.render() no longer supports arrays. Use object.layers instead."),t=t[0]);var N,D,E=e.getSize(new r.Vector2),w=i.getLayers();if(w.length){var I=w[0];N=null!==I.leftBounds&&4===(null===(l=I.leftBounds)||void 0===l?void 0:l.length)?I.leftBounds:p,D=null!==I.rightBounds&&4===(null===(h=I.rightBounds)||void 0===h?void 0:h.length)?I.rightBounds:M}else N=p,D=M;s={x:Math.round(E.width*N[0]),y:Math.round(E.height*N[1]),width:Math.round(E.width*N[2]),height:Math.round(E.height*N[3])},o={x:Math.round(E.width*D[0]),y:Math.round(E.height*D[1]),width:Math.round(E.width*D[2]),height:Math.round(E.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(m.position,m.quaternion,m.scale);var T=this.scale;return y.translateOnAxis(a,T),m.translateOnAxis(u,T),i.getFrameData&&c?(i.depthNear=n.near,i.depthFar=n.far,i.getFrameData(c),y.projectionMatrix.elements=[].slice.call(c.leftProjectionMatrix),m.projectionMatrix.elements=[].slice.call(c.rightProjectionMatrix)):(y.projectionMatrix=v(g.fieldOfView,!0,n.near,n.far),m.projectionMatrix=v(f.fieldOfView,!0,n.near,n.far)),e.setViewport(s.x,s.y,s.width,s.height),e.setScissor(s.x,s.y,s.width,s.height),e.render(t,y),e.setViewport(o.x,o.y,o.width,o.height),e.setScissor(o.x,o.y,o.width,o.height),e.render(t,m),e.setViewport(0,0,E.width,E.height),e.setScissorTest(!1),d&&(t.autoUpdate=!0),void(A.autoSubmitFrame&&A.submitFrame())}e.render(t,n)},this.dispose=function(){window.removeEventListener("vrdisplaypresentchange",f,!1)}}var os=new r.SphereBufferGeometry(.1,32,32);function as(e,t){e.setValues({color:t})}var us=function(e){function i(){var t=e.call(this)||this,i=new r.MeshBasicMaterial({color:8900346,opacity:.5,transparent:!0});return t.mesh=new r.Mesh(os,i),t.current=!1,t.add(t.mesh),t.loading=!1,t.disabled=!1,t.progress=0,t.opacity=1,t.needsRender=!0,t}return t.__extends(i,e),i.prototype.draw=function(){this.progress>0?as(this.mesh.material,16776960):this.current?as(this.mesh.material,65280):as(this.mesh.material,8900346)},i.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e)},i.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e)},i.prototype.setProgress=function(e){this.progress!==e&&(this.progress=e)},i.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e)},i.prototype.setCurrent=function(e){this.current!==e&&(this.current=e,this.draw())},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}(r.Object3D),cs=null,As=[{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/>画面にタッチします"}];var ls=function(e){function i(t){var n=this;Vi(cs)&&(cs=new rs(t.webvrPolyfillConfig||{}));var r=i.parseArgs(t);return(n=e.call(this,r)||this).effect=new ss(n.renderer),n.effect.setSize(n.element.offsetWidth,n.element.offsetHeight),n.effect.isPresenting=!0,n.initHelper(n.element),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(){e.prototype.destroy.call(this),this.destroyHelper();for(var t=0,i=this.panoMeshes;t<i.length;t++){var n=i[t];this.helper.remove(n),n.dispose()}this.panoMeshes.length=0},i.prototype.isReady=function(){return!1},i.prototype.updateRenderSize=function(){this.effect.isPresenting=!1,this.effect.setSize(this.element.offsetWidth,this.element.offsetHeight),this.effect.isPresenting=!0,this.needsRender=!0,this.setHelperElementSize()},i.prototype.updatePanoMeshes=function(){var e=this;this.panoMeshes.forEach((function(t){e.helper.remove(t),t.dispose()})),this.panoMeshes.length=0;for(var t=0;t<this.work.observers.length;t++){var i=this.work.observers[t],n=new us;n.name="panoSphere_".concat(this.work.workCode,"_").concat(t),n.position.copy(i.position),n.needsRender=!0,this.helper.add(n),this.panoMeshes[t]=n}},i.prototype.updateTime=function(e,t){var i,n;if(!this.destroyed){this.needsRender=!0,this.intersect(e);var s={},o={};if(!1===this.locationMotion.ended){this.locationMotion.update(e);var a=this.locationMotion.getKeyFrameSegment(e),u=a[0],c=a[1],A=this.panoResourceFromLocationMotionKeyframe(u),l=this.panoResourceFromLocationMotionKeyframe(c),h=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),d=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),g=A.position,p=l.position,M=this.locationMotion.value.count-c.value.count+1;s.modelAlpha=this.locationMotion.value.modelAlpha,s.perspToOrtho=cn(1-10*(1-this.locationMotion.value.perspToOrtho),0,1),s.useBlackTransition="instant"===l.effect,l.panoPicture&&(M<1?A.panoPicture&&(s.pano0=A.panoPicture):s.pano0=l.panoPicture,s.pano1=l.panoPicture),"fade"===l.effect&&(s.pano0&&A.panoPicture&&(s.pano0={map:s.pano0.map,luminanceMap:s.pano0.luminanceMap,matrix:A.panoPicture.matrix.clone().setPosition(l.position)}),g.copy(p)),s.progress=M,o.distance=this.locationMotion.value.distance,o.offset=new r.Vector3(g.x+(p.x-g.x)*M,g.y+(p.y-g.y)*M,g.z+(p.z-g.z)*M);for(var f=[],y=[],m=0,v=this.locationMotion.keyframes;m<v.length;m++){var N=(S=v[m]).key,D=S.progress;void 0!==N&&(f.push(N),D>=this.locationMotion.progress&&y.push(N))}for(var E=0,w=Object.keys(this.panoResources);E<w.length;E++){var I=w[E];if(!(y.indexOf(I)>=0)){var T=this.panoResources[I];if(T.panoPicture){var x=T.panoPicture.map;if(x){if(x===(null===(i=s.pano0)||void 0===i?void 0:i.map))continue;if(x===(null===(n=s.pano1)||void 0===n?void 0:n.map))continue;x.dispose(),T.panoPicture=null}}f.indexOf(I)>=0||delete this.panoResources[I]}}this.currentPanoIndex=M<.5?A.panoIndex:l.panoIndex,this.emit("movingToPano",d.panoIndex,h.panoIndex,this.locationMotion.progress)}for(var j=this.work.observers[this.currentPanoIndex].visibleNodes.concat(this.currentPanoIndex),z=[],C=0,b=this.locationMotion.keyframes;C<b.length;C++){var S;(S=b[C]).progress>=this.locationMotion.progress&&z.push(this.panoResourceFromLocationMotionKeyframe(S).panoIndex)}for(var L=0;L<this.work.observers.length;L++){var O=this.work.observers[L],B=this.panoMeshes[L];if(B.visible=!0,z.indexOf(L)>=0)B.visible=!1;else if(O.loadable||O.active)if(-1===j.indexOf(L))B.visible=!1;else{B.visible=!0;var Q=B.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Q<.01?B.setOpacity(0):B.setOpacity(cn(1.5/Q,0,1))}else B.visible=!0}!1===dr(s)&&(this.model.setMaterial(s),this.boundingMesh.setMaterial(s)),o.offset&&this.camera.position.copy(o.offset);var k=this.camera.pose.longitude,P=this.camera.pose.latitude,U=this.effect.getVRDisplay();if(U){var R=U.getPose();R&&R.orientation&&this.camera.quaternion.fromArray(R.orientation)}this.camera.updateMatrixWorld(),this.camera.computePose(),k===this.camera.pose.longitude&&P===this.camera.pose.latitude||(this.cameraMotion.set(ni(this.camera.pose,["longitude","latitude"]),0).catch(Pe),this.emit("cameraDirectionUpdate",ni(this.camera.pose,["longitude","latitude"]),!0),this.emit("cameraUpdate",gr(ni(this.camera.pose,["longitude","latitude","fov","offset"])),!0))}},i.prototype.render=function(){this.effect.render(this.scene,this.camera)},i.prototype.setCamera=function(e){},i.prototype.initHelper=function(e){for(var t=this,i="five_webvr_helper_"+Xn(),n=1,r=document.getElementsByTagName("meta"),s=0;s<r.length;s++){var o=r[s];if("viewport"===o.getAttribute("name")){var a=(o.getAttribute("content")||"").match(/initial\-scale\=([\d|\.]+)/);a&&(n=Number(a[1])),isNaN(n)&&(n=1)}}var u=document.createElement("style");u.setAttribute("type","text/css");var c,A,l=(A=function(e){return Math.floor(e*n)+"px"},"\n .".concat(c=i,"{\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 .").concat(c," 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:").concat(A(132),";\n height:").concat(A(162),";\n }\n .").concat(c," 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:").concat(A(38),";\n font-size:").concat(A(16),";\n line-height:").concat(A(30),";\n }\n .").concat(c," li{\n list-style-type:none;\n white-space:nowrap;\n position:relative;\n padding-left:").concat(A(14),";\n margin-bottom:").concat(A(12),";\n }\n @media screen and (orientation: portrait){\n .").concat(c,"{display: block!important}\n }\n "));"styleSheet"in u?u.styleSheet.cssText=l:u.appendChild(document.createTextNode(l));var h=this.helperElement=document.createElement("div");h.className=i,h.innerHTML='\n <img src="'.concat("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTMycHgiIGhlaWdodD0iMTYycHgiIHZpZXdCb3g9IjAgMCAxMzIgMTYyIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3Jn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zLjU2MDQzNTIgNzAuNDk3MDUzNCw2My4wOTIwOTg3IEM3MC4zMzg5NjQ1LDYyLjgzOTE1NjMgNzAuMzAyMDQzNSw2Mi41Mjg4NDY4IDcwLjM5NjM2ODQsNjIuMjQ1ODcyIEw3Mi44MDk3NzExLDU1LjAwNTY2NCBMNzIuODA5NzcxMSw1NS4wMDU2NjQgQzcyLjk4NDQxODksNTQuNDgxNzIwNyA3My41NTA3Mzg4LDU0LjE5ODU2MDcgNzQuMDc0NjgyMiw1NC4zNzMyMDg0IEM3NC4zMDgwOTMxLDU0LjQ1MTAxMjEgNzQuNTA0NjI5MSw1NC42MTIxMzMxIDc0LjYyNjY5NzUsNTQuODI1NzUyOCBaIiBpZD0iVHJpYW5nbGUiIGZpbGwtb3BhY2l0eT0iMC4yNjYwNDk1OTIiIGZpbGw9IiNGRkZGRkYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDczLjc1ODUyMSwgNTguOTQxOTI3KSByb3RhdGUoMTgwLjAwMDAwMCkgdHJhbnNsYXRlKC03My43NTg1MjEsIC01OC45NDE5MjcpICI+PC9wYXRoPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",'"/>\n <ol>\n ').concat(As.map((function(e){var t;return"<li>".concat(null!==(t=e[navigator.language.split("-")[0]])&&void 0!==t?t:e.zh,"</li>")})).join(""),"\n </ol>\n ");var d=new pr(h);e.parentNode&&(e.parentNode.insertBefore(u,e),e.parentNode.insertBefore(h,e),this.setHelperElementSize(),d.on("tap",(function(){return t.emit("vrWantsToExit")}))),this.destroyHelper=function(){d.destroy(),u.parentNode&&u.parentNode.removeChild(u),h.parentNode&&h.parentNode.removeChild(h)}},i.prototype.destroyHelper=function(){},i.prototype.setHelperElementSize=function(){if(this.helperElement){var e=new r.Vector2(this.element.offsetWidth,this.element.offsetHeight),t=e.x*this.scissor.left,i=e.y*(1-this.scissor.bottom-this.scissor.height),n=e.x*this.scissor.width,s=e.y*this.scissor.height;this.helperElement.style.marginLeft=t+"px",this.helperElement.style.marginTop=i+"px",this.helperElement.style.width=n+"px",this.helperElement.style.height=s+"px"}},i.prototype.intersect=function(e){if(!1!==this.locationMotion.ended){if(this.activePanoMesh&&this.activeTime&&e-this.activeTime>2e3){var t=this.panoMeshes.indexOf(this.activePanoMesh);return t>=0&&this.moveToPano(t,{},!0),delete this.activePanoMesh,void delete this.activeTime}for(var i=0,n=this.panoMeshes;i<n.length;i++){(l=n[i]).setCurrent(!1)}for(var s=this.camera.getWorldDirection(new r.Vector3),o=new r.Raycaster(this.camera.position,s),a=void 0,u=[],c=0,A=this.panoMeshes;c<A.length;c++){var l;if(!1!==(l=A[c]).visible){var h=o.intersectObject(l,!0)[0];h&&u.push({panoMesh:l,intersection:h})}}var d=u.sort((function(e,t){return e.intersection.distance-t.intersection.distance}))[0];if(d&&(a=d.intersection,d.panoMesh.setCurrent(!0),this.activePanoMesh!==d.panoMesh&&(this.activePanoMesh=d.panoMesh,this.activeTime=e)),a||this.model.empty||(a=this.model.intersectRaycaster(o)[0]),a&&a.face){var g=a.face.normal,p=new r.Quaternion;p.setFromUnitVectors(new r.Vector3(0,0,-1),g),this.intersectMesh.quaternion.copy(p);var M=g.clone().multiplyScalar(.05),f=a.point.clone().add(M);this.intersectMesh.position.copy(f),this.intersectMesh.visible=!0,this.emit("intersectionOnModelUpdate",a,this.intersectMesh)}else this.intersectMesh.visible=!1,this.emit("intersectionHidden")}else this.intersectMesh.visible=!1},i.prototype.onPanGesture=function(){},i.prototype.onTapGesture=function(){},i.prototype.onPinchGesture=function(){},i.prototype.onMouseMove=function(){},i.prototype.onMouseOut=function(){},i}(ns),hs=function(e){function i(t){var n,r,s,o,a=this,u=i.parseArgs(t);return(a=e.call(this,u)||this).currentPanoIndex=u.initial[0],a.locationMotion=new dn({x:a.camera.pose.offset.x,y:a.camera.pose.offset.y,z:a.camera.pose.offset.z,distance:a.camera.pose.distance,modelAlpha:null!==(r=null===(n=a.model.getMaterial())||void 0===n?void 0:n.modelAlpha)&&void 0!==r?r:0,perspToOrtho:null!==(o=null===(s=a.model.getMaterial())||void 0===s?void 0:s.perspToOrtho)&&void 0!==o?o:0}),a}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),this.locationMotion.dispose()},i.prototype.isReady=function(){return!1!==this.locationMotion.ended&&e.prototype.isReady.call(this)},i.prototype.updateWork=function(e,t,i,n,r){this.work=e,this.currentPanoIndex=t,this.hideIntersectMesh();var s={duration:0,longitude:i.longitude,latitude:i.latitude,fov:i.fov};return this.moveToPano(t,s,r),!0},i.prototype.updateTime=function(e,t){if(!this.destroyed){var i={},n={};if(!this.locationMotion.ended){this.locationMotion.update(e),i.modelAlpha=this.locationMotion.value.modelAlpha,i.perspToOrtho=cn(1-10*(1-this.locationMotion.value.perspToOrtho),0,1),n.distance=this.locationMotion.value.distance,n.offset=new r.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var s=new r.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),o=hr(this.work.observers,(function(e){return e.position.distanceTo(s)}));this.currentPanoIndex=this.work.observers.indexOf(o)}this.cameraMotion.ended||(this.cameraMotion.update(e),n.longitude=this.cameraMotion.value.longitude,n.latitude=this.cameraMotion.value.latitude,n.fov=this.cameraMotion.value.fov),dr(i)||this.model.setMaterial(i),dr(n)||this.setCamera(n)}},i.prototype.initAnimation=function(e,t,i,n){var r,s,o,a=this;this.destroyed||(this.pending=!1,this.userAction=n,this.moveToPano(e,{longitude:null!==(r=t.longitude)&&void 0!==r?r:this.defaultLongitude,latitude:cn(null!==(s=t.latitude)&&void 0!==s?s:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:cn(null!==(o=t.fov)&&void 0!==o?o:this.defaultFov,this.minFov,this.maxFov),duration:i,moveStartCallback:function(e,t){a.emit("initAnimationWillStart",e,t,a.userAction)},moveEndCallback:function(e,t){a.emit("initAnimationEnded",e,t,a.userAction)},moveCancelCallback:function(){var e=a.currentPanoIndex,t={longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone()};a.emit("initAnimationEnded",e,t,a.userAction)}},n))},i.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(Re())[1],t=this.locationMotion.getKeyFrameSegment(Re())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new r.Vector3(t.value.x,t.value.y,t.value.z)}},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,s,o,a=this;void 0===t&&(t={}),this.userAction=i;for(var u=Re(),c=new r.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z).distanceTo(e),A=this.locationMotion.getProgressVelocity(u),l=0,h=1;h<this.locationMotion.keyframes.length;h++){var d=this.locationMotion.keyframes[h-1].value,g=d.x,p=d.y,M=d.z,f=this.locationMotion.keyframes[h].value,y=f.x,m=f.y,v=f.z;l+=Math.sqrt(Math.pow(y-g,2)+Math.pow(m-p,2)+Math.pow(v-M,2))}var N=0===c?0:A*l/c,D=this.calculateMovingDuration(t.duration,c),E={x:e.x,y:e.y,z:e.z,distance:0,modelAlpha:1,perspToOrtho:0},w={longitude:t.longitude,latitude:t.latitude,fov:t.fov},I={longitude:null!==(n=w.longitude)&&void 0!==n?n:this.camera.pose.longitude,latitude:null!==(s=w.latitude)&&void 0!==s?s:this.camera.pose.latitude,fov:null!==(o=w.fov)&&void 0!==o?o:this.camera.pose.fov,offset:e.clone()},T=hr(this.work.observers,(function(t){return t.position.distanceTo(e)})),x=this.work.observers.indexOf(T);this.emit("moveToPano",x,this.userAction),t.moveStartCallback&&t.moveStartCallback(x,I),this.emit("panoWillArrive",x,I,this.userAction),this.cameraMotion.set(w,D).catch(Pe),this.locationMotion.set(E,D,N).then((function(){var e=gr(a.camera.pose);t.moveEndCallback&&t.moveEndCallback(x,e),a.emit("panoArrived",x,e,a.userAction)}),(function(){t.moveCancelCallback&&t.moveCancelCallback(),a.emit("moveToPanoCanceled",x)}))},i.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return ni(e,["x","y"])}));if(!this.emit("wantsGesture","tap",t,!0)){var i=this.relativeClientPosition(e.center),n=new r.Raycaster;if(n.setFromCamera(i,this.camera),!this.emit("wantsTapGesture",n,i,!0)){this.emit("gesture","tap",t,!0),this.emit("tapGesture",n,i,!0),this.interiaMovement=!1;var s=this.model.intersectRaycaster(n)[0];if(s&&s.face){var o=s.face.normal,a=s.point;if(new r.Vector3(0,1,0).angleTo(o)>Math.PI/3){var u=this.camera.position.clone().setY(a.y),c=a.clone().sub(u).setLength(.3),A=a.clone().sub(c);n.set(A,new r.Vector3(0,-1,0)),s=this.model.intersectRaycaster(n)[0]}}if(s){var l=s.point.clone(),h=hr(this.work.observers.filter((function(e){return Math.abs(e.standingPosition.y-l.y)<1})),(function(e){return e.standingPosition.distanceTo(l)}));if(h)return l.y=h.position.y,void this.moveToPosition(l,{},!0)}this.cameraBounce()}}},i}(Sr),ds=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-aNb-J-C;?E@>EB?Hp|{-sy|n-pnyr-J->@;>Hrp?-|P||q5rp@-rp|6-\n--sy|n--J-yr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-z|qrycvrZnv-7-ry]|vv|{H\f"),gs=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"),ps=Object.assign({opacity:new r.Uniform(1),scale:new r.Uniform(13.1),panoMap:new r.Uniform(null),panoDisplacementMap:new r.Uniform(null),panoPosition:new r.Uniform(new r.Vector3),panoMatrix:new r.Uniform(new r.Matrix4)},{emissive:new r.Uniform(new r.Color(0)),emissiveMap:new r.Uniform(null),specular:new r.Uniform(new r.Color(1118481)),specularMap:new r.Uniform(null),normalMap:new r.Uniform(null),bumpMap:new r.Uniform(null),shininess:new r.Uniform(30)},r.UniformsLib.common,r.UniformsLib.lights),Ms=new r.SphereBufferGeometry(.01,128,128);var fs=function(){function e(e){void 0===e&&(e={}),this.textureLoader=new Ti({allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe}),this.allowHosts=e.allowHosts,this.networkSubscribe=e.networkSubscribe}return e.prototype.setAllowHosts=function(e){this.allowHosts=e,this.textureLoader.setAllowHosts(e)},e.prototype.setNetworkSubscribe=function(e){this.networkSubscribe=e,this.textureLoader.setNetworkSubscribe(e)},e.prototype.load=function(e,i,n,s,o,a,u,c){var A=[0,0],l=function(e,t){A[t]=e,u(.8*A[0]+.2*A[1])},h=[this.textureLoader.load(e,{viaAjax:!0},void 0,void 0,(function(e){return l(e,1)}),c),this.textureLoader.loadCube(i,{viaAjax:!0},void 0,void 0,(function(e){return l(e,0)}),c)];return Promise.all(h).then((function(e){var i=e[0],a=e[1],u={body:function(e,t,i,n){var s=new r.ShaderMaterial({side:r.BackSide,vertexShader:ds,fragmentShader:gs,transparent:!0,uniforms:r.UniformsUtils.clone(ps)}),o=t;return o.needsUpdate=!0,o.minFilter=r.LinearFilter,o.magFilter=r.LinearFilter,e.needsUpdate=!0,e.minFilter=r.LinearFilter,e.magFilter=r.LinearFilter,s.uniforms.opacity.value=0,s.uniforms.panoMap.value=o,s.uniforms.panoDisplacementMap.value=e,s.uniforms.panoPosition.value=i,s.uniforms.panoMatrix.value=n,Object.assign(new r.Mesh(Ms,s),{frustumCulled:!1,dispose:function(){this.material instanceof r.ShaderMaterial&&(this.material.uniforms.panoDisplacementMap.value.dispose(),this.material.uniforms.panoDisplacementMap.value=null,this.material.dispose())}})}(i.body,a.body,n,s),meta:t.__spreadArray([i.meta],a.meta,!0)};return o(u),u})).catch((function(e){for(var t=0,i=h;t<i.length;t++){i[t].then((function(e){return e.body.dispose()})).catch(Pe)}return a(e),Promise.reject(e)}))},e}(),ys=new r.Vector3(-1,1,1),ms=function(e){function i(t){var n,s,o,a,u,c,A,l=this,h=i.parseArgs(t);return(l=e.call(this,h)||this).currentPanoIndex=h.initial[0],l.maxAccessibleDistance=h.maxAccessibleDistance,l.panoTapTriggerRadius=h.panoTapTriggerRadius,l.panoCircleMeshCreator=h.panoCircleMeshCreator,l.boundingMesh=l.generateBoundingMesh(),l.boundingMesh.setMaterial(l.model.getMaterial()||{}),l.boundingMesh.visible=!1,l.scene.add(l.boundingMesh),l.panoModelGroup=new r.Group,l.panoModelGroup.name="panoModels",l.scene.add(l.panoModelGroup),l.panoMeshes=[],l.updatePanoMeshes(),l.helper.remove(l.intersectMesh),l.locationMotion=new dn({count:0,distance:l.camera.pose.distance,modelAlpha:null!==(s=null===(n=l.model.getMaterial())||void 0===n?void 0:n.modelAlpha)&&void 0!==s?s:0,perspToOrtho:null!==(a=null===(o=l.model.getMaterial())||void 0===o?void 0:o.perspToOrtho)&&void 0!==a?a:0}),l.panoResources={},l.panoResources[l.locationMotion.keyframes[0].key=l.locationMotion.keyframes[1].key=Xn()]={panoIndex:l.currentPanoIndex,workCode:l.work.workCode,matrix:null!==(A=null===(c=null===(u=l.model.getMaterial())||void 0===u?void 0:u.pano1)||void 0===c?void 0:c.matrix)&&void 0!==A?A:new r.Matrix4,position:l.camera.pose.offset.clone(),effect:"fly"},l.depthTextureLoader=new fs({allowHosts:l.work.allowHosts,networkSubscribe:l.networkSubscribe}),l}return t.__extends(i,e),i.parseArgs=function(i){var n,r,s,o=e.parseArgs.call(this,i);return t.__assign(t.__assign({},o),{maxAccessibleDistance:null!==(n=i.maxAccessibleDistance)&&void 0!==n?n:5,panoTapTriggerRadius:null!==(r=i.panoTapTriggerRadius)&&void 0!==r?r:1,panoCircleMeshCreator:null!==(s=i.panoCircleMeshCreator)&&void 0!==s?s:function(){return new _n}})},i.initAnimationEndPose=function(t){var i=this.parseArgs(t);return e.initAnimationEndPose.call(this,i)},i.prototype.destroy=function(){var t,i=this;if(e.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.pendingTextureTask,this.model&&(this.model.visible=!0),this.panoModelGroup){for(var n=0,r=this.panoModelGroup.children;n<r.length;n++){var s=r[n];"function"==typeof s.dispose&&s.dispose()}this.scene.remove(this.panoModelGroup)}this.boundingMesh&&(this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.panoMeshes&&(this.panoMeshes.forEach((function(e){i.helper.remove(e),e.dispose()})),this.panoMeshes.length=0);for(var o=null!==(t=this.model.getMaterial())&&void 0!==t?t:{},a=o.pano0,u=o.pano1,c=0,A=Object.keys(this.panoResources);c<A.length;c++){var l=A[c],h=this.panoResources[l];h.panoModel&&h.panoModel.material.uniforms.panoMap.value!==(null==a?void 0:a.map)&&h.panoModel.material.uniforms.panoMap.value!==(null==u?void 0:u.map)&&(this.panoModelGroup.remove(h.panoModel),h.panoModel.material.uniforms.panoMap.value.dispose(),h.panoModel.dispose(),delete h.panoModel),delete this.panoResources[l]}this.interiaMovement=!1},i.prototype.isReady=function(){return!1===this.locationMotion.ended&&e.prototype.isReady.call(this)},i.prototype.updateWork=function(e,t,i,n,r){this.userAction=r,this.work=e,this.currentPanoIndex=t,this.depthTextureLoader.setAllowHosts(this.work.allowHosts);var s={},o=!0;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.visible=o,this.boundingMesh.setMaterial(s),this.scene.add(this.boundingMesh),this.hideIntersectMesh(),this.updatePanoMeshes();for(var a=0,u=this.panoMeshes;a<u.length;a++){u[a].visible=!1}return this.moveToPano(t,{effect:"fade",duration:n,longitude:i.longitude,latitude:i.latitude,fov:i.fov},r),!0},i.prototype.updateTime=function(e,t){var i,n,s;if(!this.destroyed){var o={},a={};if(!1===this.locationMotion.ended){this.locationMotion.update(e);var u=this.locationMotion.getKeyFrameSegment(e),c=u[0],A=u[1],l=this.panoResourceFromLocationMotionKeyframe(c),h=this.panoResourceFromLocationMotionKeyframe(A),d=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),p=(new r.Vector3).copy(l.position),M=(new r.Vector3).copy(h.position),f=this.locationMotion.value.count-A.value.count+1;o.modelAlpha=this.locationMotion.value.modelAlpha,o.perspToOrtho=cn(1-10*(1-this.locationMotion.value.perspToOrtho),0,1),o.useBlackTransition="instant"===h.effect;for(var y=0,m=this.panoModelGroup.children;y<m.length;y++){var v=m[y];v.visible=v===l.panoModel||v===h.panoModel}l.panoModel&&(l.panoModel.material.uniforms.opacity.value=1-f,l.panoModel.material.depthTest=0!==f),h.panoModel&&(h.panoModel.material.uniforms.opacity.value=f,h.panoModel.material.depthTest=1!==f),h.panoModel&&(f<1?l.panoModel&&(o.pano0={map:l.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:l.matrix}):o.pano0={map:h.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:h.matrix},o.pano1={map:h.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:h.matrix}),"fade"===h.effect&&(o.pano0&&(o.pano0={map:o.pano0.map,luminanceMap:null,matrix:l.matrix.clone().setPosition(h.position)}),p.copy(M)),o.progress=f,a.distance=this.locationMotion.value.distance,a.offset=new r.Vector3(p.x+(M.x-p.x)*f,p.y+(M.y-p.y)*f,p.z+(M.z-p.z)*f);for(var N=[],D=[],E=0,w=this.locationMotion.keyframes;E<w.length;E++){var I=w[E],T=I.key,x=I.progress;void 0!==T&&(N.push(T),x>=this.locationMotion.progress&&D.push(T))}for(var j=0,z=Object.keys(this.panoResources);j<z.length;j++){var C=z[j];if(!(D.indexOf(C)>=0)){var b=this.panoResources[C];if(b.panoModel){if(b.panoModel.material.uniforms.panoMap.value===(null===(i=o.pano0)||void 0===i?void 0:i.map))continue;if(b.panoModel.material.uniforms.panoMap.value===(null===(n=o.pano1)||void 0===n?void 0:n.map))continue;this.panoModelGroup.remove(b.panoModel),b.panoModel.material.uniforms.panoMap.value.dispose(),b.panoModel.dispose(),delete b.panoModel}N.indexOf(C)>=0||delete this.panoResources[C]}}l.workCode===h.workCode?this.currentPanoIndex=f<.5?l.panoIndex:h.panoIndex:this.currentPanoIndex=h.panoIndex,this.emit("movingToPano",g.panoIndex,d.panoIndex,this.locationMotion.progress)}if(!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),!1===dr(o)&&(this.model.setMaterial(o),this.boundingMesh.setMaterial(o)),!1===dr(a)&&this.setCamera(a),this.camera.pose.distance>.1)for(var S=0;S<this.work.observers.length;S++){(Q=this.panoMeshes[S])&&(Q.visible=!1)}else{var L=this.work.observers[this.currentPanoIndex];if(L){var O=L.visibleNodes.concat(this.currentPanoIndex),B=this.getForwardPanoIndexOrNot();for(S=0;S<this.work.observers.length;S++){var Q,k=this.work.observers[S];if(Q=this.panoMeshes[S])if(k.loadable||k.active)if(-1!==O.indexOf(S)){Q.visible=!0;var P=Q.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Q.setCurrent(B===S),Q.setOpacity(P<.01?0:cn(2/P,.5,1)),Q.updateTime&&Q.updateTime(e,t)}else Q.visible=!1;else Q.visible=!1}}}this.boundingMesh.visible=Boolean(null===(s=this.boundingMesh.getMaterial())||void 0===s?void 0:s.pano0)&&this.boundingMesh.boundingBox.containsPoint(this.camera.position)}},i.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(Re())[1],t=this.locationMotion.getKeyFrameSegment(Re())[1],i=this.panoResourceFromLocationMotionKeyframe(t),n=this.work.observers[i.panoIndex];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:n?n.position.clone():this.camera.position.clone()}},i.prototype.moveToPano=function(e,i,n){var s,o,a=this;void 0===i&&(i={});var u=this.work.observers[e].images.depth,c=t.__assign({key:"pano.".concat(e),basisLoaderInitialized:wi.isInitialized()},ni(this.imageOptions,["format","size","quality"])),A=null!==(s=this.imageOptions.transform)&&void 0!==s?s:ht,l={right:A(this.work.observers[e].images.right,t.__assign(t.__assign({},c),{key:"pano.".concat(e,".right")})),left:A(this.work.observers[e].images.left,t.__assign(t.__assign({},c),{key:"pano.".concat(e,".left")})),up:A(this.work.observers[e].images.up,t.__assign(t.__assign({},c),{key:"pano.".concat(e,".up")})),down:A(this.work.observers[e].images.down,t.__assign(t.__assign({},c),{key:"pano.".concat(e,".down")})),front:A(this.work.observers[e].images.front,t.__assign(t.__assign({},c),{key:"pano.".concat(e,".front")})),back:A(this.work.observers[e].images.back,t.__assign(t.__assign({},c),{key:"pano.".concat(e,".back")}))},h=this.work.observers[e],d=h.position,g=h.quaternion,p=(new r.Matrix4).compose(d,g,new r.Vector3(-1,1,1)),M="pano:"+Cr(l);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===M)return;var f=this.pendingTextureTask.panoIndex;null===(o=this.panoMeshes[f])||void 0===o||o.setProgress(0),this.emit("textureAbort",f,this.work.observers[f]),this.pendingTextureTask.onError(new Error("texture aborted"))}this.pending=!0,this.pendingTextureTask={panoIndex:e,hash:M,onLoad:function(t){a.pending=!1,a.destroyed?t.body.dispose():(t.body.name=M,a.emit("panoLoaded",e),a.doMoveToPano(e,t.body,i,n))},onError:function(t){a.pending=!1,i.moveCancelCallback&&i.moveCancelCallback(),a.emit("panoLoadError",t,e),a.emit("moveToPanoCanceled",e)}};var y=this.panoMeshes[e];y&&y.tap&&y.tap(),this.depthTextureLoader.load(u,l,d,p,(function(t){var i,n;(null===(i=a.pendingTextureTask)||void 0===i?void 0:i.hash)===M?(a.pendingTextureTask.onLoad(t),null===(n=a.panoMeshes[e])||void 0===n||n.setProgress(0),delete a.pendingTextureTask,a.emit("textureLoaded",e,a.work.observers[e],t.meta)):t.body.dispose()}),(function(t){var i,n;(null===(i=a.pendingTextureTask)||void 0===i?void 0:i.hash)===M&&(a.pendingTextureTask.onError(t),null===(n=a.panoMeshes[e])||void 0===n||n.setProgress(0),delete a.pendingTextureTask,a.emit("textureError",t,e,a.work.observers[e]),a.emit("error",t))}),(function(t){var i,n;a.emit("textureLoading",t,e,a.work.observers[e]),(null===(i=a.pendingTextureTask)||void 0===i?void 0:i.hash)===M&&(null===(n=a.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer),this.emit("textureStartLoad",e,this.work.observers[e])},i.prototype.initAnimation=function(e,t,i,n){var r,s,o,a=this;if(!this.destroyed){var u=!1;this.pending=!1,this.userAction=n,this.moveToPano(e,{longitude:null!==(r=t.longitude)&&void 0!==r?r:this.defaultLongitude,latitude:cn(null!==(s=t.latitude)&&void 0!==s?s:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:cn(null!==(o=t.fov)&&void 0!==o?o:this.defaultFov,this.minFov,this.maxFov),duration:i,moveStartCallback:function(e,t){u=!0,a.emit("initAnimationWillStart",e,t,a.userAction)},moveEndCallback:function(e,t){a.emit("initAnimationEnded",e,t,a.userAction)},moveCancelCallback:function(){var e=gr(a.camera.pose);!1===u&&a.emit("initAnimationWillStart",a.currentPanoIndex,e,a.userAction),a.emit("initAnimationEnded",a.currentPanoIndex,e,a.userAction)}},n)}},i.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},i.prototype.locationMotionKeyframesLength=function(e){for(var t=0,i=1;i<e.length;i++){var n=this.panoResourceFromLocationMotionKeyframe(e[i-1]).position,r=this.panoResourceFromLocationMotionKeyframe(e[i]).position;t+=n.distanceTo(r)*(e[i].value.count-e[i-1].value.count)}return t},i.prototype.updatePanoMeshes=function(){for(var e={},t=0,i=this.panoMeshes;t<i.length;t++){e[(o=i[t]).name]=o}this.panoMeshes.length=0;for(var n=0;n<this.work.observers.length;n++){var r="panoCircle_".concat(this.work.workCode,"_").concat(n),s=this.work.observers[n],o=void 0;e[r]?(o=e[r],delete e[r]):((o=this.panoCircleMeshCreator()).name=r,this.helper.add(o)),o.position.copy(s.standingPosition),this.panoMeshes[n]=o}for(var a=0,u=Object.keys(e);a<u.length;a++){var c=u[a];this.helper.remove(e[c]),e[c].dispose(),delete e[c]}},i.prototype.generateBoundingMesh=function(e){void 0===e&&(e=!1);for(var t=this.model.bounding.clone(),i=0,n=this.work.observers;i<n.length;i++){var s=n[i];t.expandByPoint(s.standingPosition),t.expandByPoint((new r.Vector3).fromArray([s.position.x,2*s.position.y-s.standingPosition.y,s.position.z]))}e&&t.expandByPoint(this.camera.position);var o=nr(t,new r.Vector3(1,0,1));return o.name="panorama_bounding",o.frustumCulled=!1,o},i.prototype.doMoveToPano=function(e,i,n,s){var o,a,u,c,A=this;void 0===n&&(n={}),this.userAction=s;var l=Re(),h=Xn(),d=this.work.observers[e],g=this.panoResources[h]={panoIndex:e,workCode:this.work.workCode,effect:null!==(o=n.effect)&&void 0!==o?o:"fly",panoModel:i,matrix:(new r.Matrix4).compose(d.position,d.quaternion,ys),position:d.position.clone()};i.visible=!1,i.renderOrder=-1,this.panoModelGroup.add(i);var p,M,f;if(this.locationMotion.ended){var y=this.locationMotion.getKeyFrameSegment(l);y[0];var m=y[1],v=this.locationMotion.value,N=this.panoResourceFromLocationMotionKeyframe(m).position,D=g.position;p=Math.max(N.distanceTo(D),1),M=[{key:m.key,progress:0,value:t.__assign(t.__assign({},v),{count:0})},{key:h,progress:1,value:{distance:0,perspToOrtho:0,modelAlpha:0,count:1}}],f=0}else{var E=this.locationMotion.getKeyFrameSegment(l),w=E[0],I=(m=E[1],v=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(w).position),T=(N=this.panoResourceFromLocationMotionKeyframe(m).position,D=g.position,m.value.count-v.count),x=Math.max(I.distanceTo(N),1)*T;p=x+Math.max(N.distanceTo(D),1),M=[{key:w.key,progress:0,value:t.__assign({},v)},{key:m.key,progress:x/p,value:m.value},{key:h,progress:1,value:{count:m.value.count+1,distance:0,perspToOrtho:0,modelAlpha:0}}];var j=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(M);f=this.locationMotion.getProgressVelocity(l)*j/z}var C=this.calculateMovingDuration(n.duration,p),b={longitude:n.longitude,latitude:n.latitude,fov:n.fov},S={longitude:null!==(a=b.longitude)&&void 0!==a?a:this.camera.pose.longitude,latitude:null!==(u=b.latitude)&&void 0!==u?u:this.camera.pose.latitude,fov:null!==(c=b.fov)&&void 0!==c?c:this.camera.pose.fov,offset:d.position.clone()};n.moveStartCallback&&n.moveStartCallback(e,S),this.emit("panoWillArrive",e,S,this.userAction),this.cameraMotion.set(b,C).catch(Pe),this.locationMotion.setKeyframes(M,C,f).then((function(){var t={longitude:A.camera.pose.longitude,latitude:A.camera.pose.latitude,fov:A.camera.pose.fov,offset:A.camera.pose.offset.clone()};n.moveEndCallback&&n.moveEndCallback(e,t),A.emit("panoArrived",e,t,s)}),(function(){n.moveCancelCallback&&n.moveCancelCallback(),A.emit("moveToPanoCanceled",e)}))},i.prototype.getForwardPanoIndexOrNot=function(e){var t=this,i=this.camera.getWorldDirection(new r.Vector3),n=this.camera.position.clone(),s=this.work.observers[this.currentPanoIndex];if(!s)return null;var o=s.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var i=t.work.observers[e],s=i.standingPosition.clone().sub(n);return 0!==s.length()&&(!(s.angleTo(new r.Vector3(0,-1,0))<Math.PI/12)&&(i.loadable||i.active))})),a=(e?e.ray.direction.clone():i.clone()).setY(0);if(0===a.length())return null;for(var u=o.slice().sort((function(e,i){var r=t.work.observers[e].position.clone().setY(n.y),s=t.work.observers[i].position.clone().setY(n.y);return r.distanceTo(n)-s.distanceTo(n)})),c=0,A=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];c<A.length;c++)for(var l=A[c],h=0,d=u;h<d.length;h++){var g=d[h],p=this.work.observers[g].position.clone().setY(n.y).sub(n);if(0!==p.length()&&a.angleTo(p)<l)return g}return null},i.prototype.onTapGesture=function(e){var i=this,n=e.pointers.map((function(e){return ni(e,["x","y"])}));if(!this.emit("wantsGesture","tap",n,!0)){var s=this.relativeClientPosition(e.center),o=new r.Raycaster;if(o.setFromCamera(s,this.camera),!this.emit("wantsTapGesture",o,s,!0)){this.emit("gesture","tap",n,!0),this.emit("tapGesture",o,s,!0),this.interiaMovement=!1;var a=this.camera.getWorldDirection(new r.Vector3).setY(0),u=null,c=this.work.observers[this.currentPanoIndex];if(c){var A=c.accessibleNodes.filter((function(e){if(e===i.currentPanoIndex)return!1;var t=i.work.observers[e];return!(t.position.distanceTo(i.camera.position)>i.maxAccessibleDistance)&&(t.loadable||t.active)})),l=o.intersectObject(this.boundingMesh,!0)[0];if(l){var h=hr(A,(function(e){var t=i.work.observers[e].standingPosition.clone();return t.clone().sub(i.camera.position).setY(0).angleTo(a)>Math.PI/2?1/0:t.distanceTo(l.point)}),!0),d=h[0];h[1]<this.panoTapTriggerRadius&&(u=d)}Vi(u)&&(u=this.getForwardPanoIndexOrNot(o));for(var g=0,p=this.locationMotion.keyframes;g<p.length;g++){var M=p[g],f=this.panoResourceFromLocationMotionKeyframe(M);if(!(M.progress<this.locationMotion.progress)&&f.panoIndex===u){u=null;break}}if(this.emit("panoSelected",u),Vi(u))!0===this.locationMotion.ended&&this.cameraBounce();else{var y=this.work.observers[u];if(y.active){for(var m={},v=Math.PI/6,N=Math.PI/12,D=new r.Vector3(0,1,0),E=y.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),w=E.clone().applyAxisAngle(D,v),I=E.clone().applyAxisAngle(D,-v),T=[],x=[],j=[],z=0,C=y.accessibleNodes;z<C.length;z++){if((d=C[z])!==this.currentPanoIndex&&d!==u){var b=this.work.observers[d].position.clone().sub(y.position).setY(0);E.angleTo(b)<v?j.push(b):w.angleTo(b)<v?T.push(b):I.angleTo(b)<v&&x.push(b)}}var S=(j.length>0?j:t.__spreadArray(t.__spreadArray([],T,!0),x,!0)).slice().sort((function(e,t){return e.angleTo(E)-t.angleTo(E)}))[0];S&&S.angleTo(a)>N&&(m.longitude=Math.atan2(-S.x,-S.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(m.latitude=cn(0,this.minLatitude,this.maxLatitude)),this.emit("wantsMoveToPano",u,m,!0)}else this.panoMeshes[u]&&(this.panoMeshes[u].setDisabled(!1),this.panoMeshes[u].setLoading(!0))}}}}},i}(Sr),vs=["Panorama","DepthPanorama","Model"],Ns={Floorplan:xr,Topview:jr,Panorama:ns,VRPanorama:ls,Model:hs,DepthPanorama:ms};function Ds(e){for(var t=0,i=vs;t<i.length;t++){var n=i[t];if("string"==typeof e){if(n===e)return!0}else if(e instanceof Tr&&e instanceof Ns[n])return!0}return!1}var Es=["cameraDirectionUpdate","cameraUpdate","cameraPositionUpdate","panoSelected","moveToPano","moveToPanoCanceled","panoWillArrive","movingToPano","panoArrived","panoWillLoad","panoLoaded","panoLoadError","initAnimationEnded","initAnimationWillStart","wantsGesture","gesture","wantsTapGesture","tapGesture","wantsPressGesture","pressGesture","wantsPanGesture","wantsInteriaPan","panGesture","interiaPan","wantsPinchGesture","pinchGesture","wantsMouseWheel","mouseWheel","wantsShowIntersectionOnModel","intersectionOnModelUpdate","intersectionHidden","textureStartLoad","textureLoading","textureAbort","textureLoaded","textureError"];function ws(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 Is(){for(var e,t=document.getElementsByTagName("meta"),i=0;i<t.length;i++){var n=t[i];if("viewport"===n.getAttribute("name")){var r=ws(null!==(e=n.getAttribute("content"))&&void 0!==e?e:""),s=Number(r["initial-scale"]);if(!isNaN(s))return s}}return 1}var Ts=[351,63],xs=[20,20],js=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),zs=new Float32Array([0,0,1,0,0,1,1,1]),Cs=new Uint8Array([0,1,2,1,3,2]),bs=new r.BufferGeometry;bs.setAttribute("position",new r.BufferAttribute(js,3)),bs.setAttribute("uv",new r.BufferAttribute(zs,2)),bs.setIndex(new r.BufferAttribute(Cs,1));var Ss=new r.MeshBasicMaterial({transparent:!0,depthTest:!1}),Ls=new r.Mesh(bs,Ss),Os=new r.Scene;Os.add(Ls);var Bs=new r.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Bs.position.set(0,0,.5),Bs.lookAt(0,0,0);var Qs=new r.Vector4,ks=new r.Vector4;function Ps(e){if(Ss.map){var t=e.getViewport(Qs),i=e.getScissor(ks),n=e.getScissorTest(),s=e.autoClear;e.setViewport(i.x+xs[0]/3,i.y+xs[1]/3,Ts[0]/3,Ts[1]/3),e.setScissor(i.x+xs[0]/3,i.y+xs[1]/3,Ts[0]/3,Ts[1]/3),e.setScissorTest(!0),e.autoClear=!1,e.render(Os,Bs),e.setViewport(t),e.setScissor(i),e.setScissorTest(n),e.autoClear=s}else{var o=new r.Texture,a=new Image;a.onload=function(){o.image=a,o.wrapS=r.ClampToEdgeWrapping,o.wrapT=r.ClampToEdgeWrapping,o.minFilter=r.LinearFilter,o.needsUpdate=!0,Ss.needsUpdate=!0,a.onload=function(){}},a.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/00IDR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IVJtOwgdgO/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==",Ss.map=o}}var Us=new r.Box3(new r.Vector3(-50,-50,-50),new r.Vector3(50,50,50)),Rs=new r.Vector2,_s=new r.Frustum,Ys=new r.Matrix4,Fs=new r.Clock,Hs=new WeakMap,Vs=function(e){function i(i){var n,s,o,a,u,c,A,l,h,d;void 0===i&&(i={});var g=e.call(this)||this;if(g.ident=Xn(),g.renderSwitch01=0,g.panoIndex=0,g.needsRender=!1,g.onlyRenderIfNeeds=null===(n=i.onlyRenderIfNeeds)||void 0===n||n,g.imageOptions=t.__assign({},null!==(s=i.imageOptions)&&void 0!==s?s:{}),g.textureOptions=t.__assign({},null!==(o=i.textureOptions)&&void 0!==o?o:{}),g.poweredByRealsee=null===(a=i.poweredByRealsee)||void 0===a||a,g.extraElements=[],g.controllerInits={Panorama:Object.assign({},i.panorama),Model:Object.assign({},i.model),Floorplan:Object.assign({},i.floorplan),Topview:Object.assign({},i.topview),DepthPanorama:Object.assign({},i.depthPanorama),VRPanorama:Object.assign({},i.vrPanorama)},g.fps={testCount:0,testTime:Re()},g.modeChangeDuration=null!==(u=i.modeChangeDuration)&&void 0!==u?u:1e3,g.panoramaLikeSavedPose={},"undefined"!=typeof window)if(i.renderer)i.renderer instanceof wt&&g.throwError(new Error("cannot render a internal renderer")),g.renderer=i.renderer;else try{g.renderer=new wt({preserveDrawingBuffer:i.preserveDrawingBuffer,backgroundColor:i.backgroundColor,backgroundAlpha:i.backgroundAlpha,antialias:i.antialias});var p=Is();g.renderer.setPixelRatio(1===p?window.devicePixelRatio:1),g.renderer.setSize(512,512)}catch(e){e instanceof Error&&g.throwError(e)}g.getPixelsRenderTarget=new r.WebGLRenderTarget(1,1,{encoding:null!==(A=null===(c=g.renderer)||void 0===c?void 0:c.outputEncoding)&&void 0!==A?A:r.sRGBEncoding}),g.scissor=Object.assign({left:0,bottom:0,width:1,height:1},i.scissor),g.camera=new Lt(80),g.scene=new It,g.lastLoadWorkTask=Promise.resolve(),g.networkSubscribe=new et,g.networkSubscribe.on("network",(function(e,t,i,n){var r;g.emit("network",e,t,i,n),null===(r=g.analysis)||void 0===r||r.network(g.work,e,t,i,n)})),g.model=new Wi({allowHosts:[],networkSubscribe:g.networkSubscribe});var M=nr(Us);if(M.name="model_empty",g.model.add(M),g.model.visible=!1,g.readyCallbacks=[],g.modelPending=!1,g.syncingState=!1,g.scene.add(g.model),g.helperGroup=new r.Group,g.helperGroup.name="helper",g.scene.add(g.helperGroup),g.videoTexture=new r.VideoTexture(i.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}()),function(e){(t=new r.DirectionalLight(16777215,.5)).position.copy(new r.Vector3(1,1,1)),e.add(t);var t=new r.DirectionalLight(16777215,.3);e.add(t),t=new r.AmbientLight(16777215,.3),e.add(t)}(g.scene),g.state={mode:null!==(l=g.currentMode)&&void 0!==l?l:"Panorama",panoIndex:null!==(h=g.panoIndex)&&void 0!==h?h:0,longitude:g.camera.pose.longitude,latitude:g.camera.pose.latitude,fov:g.camera.pose.fov,offset:g.camera.pose.offset.clone()},g.stateSynced=!1,g._enableIOSEDR=!1,g.destroyed=!1,g.paused=!0,"undefined"!=typeof window&&(!1!==i.play&&g.play(),!1!==(null!==(d=i.initialBasisLoader)&&void 0!==d&&d)&&("string"==typeof i.initialBasisLoader?g.initBasisLoader(i.initialBasisLoader):g.initBasisLoader()),g.stopAnimationLoop=ot.shared.add((function(e,t){g.updateTime(e,t)}),!1,0,10)),g.plugins={},i.plugins&&i.plugins.length)for(var f=0,y=i.plugins;f<y.length;f++){var m=y[f];if("function"==typeof m)m(g);else if(Array.isArray(m)){var v=m[0],N=m[1],D=m[2];if("function"==typeof v){var E=v(g,D);"string"==typeof N&&(g.plugins[N]?g.throwError(new Error("plugin name ".concat(N," is exists."))):g.plugins[N]=E)}}}return g}return t.__extends(i,e),i.prototype.dispose=function(){var e;if(!0!==this.destroyed){this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var t=this.getElement();t&&t.parentNode&&t.parentNode.removeChild(t),this.scene.remove(this.model);var i=this.model.getMaterial();i&&(i.pano0&&i.pano0.map.dispose(),i.pano1&&i.pano1.map!==(null===(e=i.pano0)||void 0===e?void 0:e.map)&&i.pano1.map.dispose()),this.model.dispose(),this.renderer instanceof wt&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},i.prototype.setScissor=function(e){Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize()},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}),Object.defineProperty(i.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(e){this._enableIOSEDR!==e&&(this._enableIOSEDR=e,this.currentMode&&"Panorama"===this.currentMode&&this.changeMode(this.currentMode,{},0,!1,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"enablePostProcessing",{get:function(){return void 0!==this.screenBuffer},set:function(e){var t,i;if(e){if(!this.screenBuffer){var n=this.getDrawingBufferSize(Rs);this.screenBuffer=new r.WebGLRenderTarget(n.x,n.y,{encoding:null!==(i=null===(t=this.renderer)||void 0===t?void 0:t.outputEncoding)&&void 0!==i?i:r.sRGBEncoding})}}else this.screenBuffer&&(this.screenBuffer.dispose(),delete this.screenBuffer);this.needsRender=!0},enumerable:!1,configurable:!0}),i.prototype.updateConfiguration=function(e){var t=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),"Panorama"===this.currentMode&&(t=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),"Model"===this.currentMode&&(t=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),"Floorplan"===this.currentMode&&(t=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),"Topview"===this.currentMode&&(t=!0)),e.depthPanorama&&(Object.assign(this.controllerInits.DepthPanorama,e.depthPanorama),"DepthPanorama"===this.currentMode&&(t=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),"VRPanorama"===this.currentMode&&(t=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),"Panorama"!==this.currentMode&&"DepthPanorama"!==this.currentMode&&"VRPanorama"!==this.currentMode||(t=!0)),t&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)},i.prototype.appendTo=function(e,t){if(void 0===t&&(t={}),this.renderer)if(this.renderer instanceof wt){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 s=e.width,o=void 0===s?n.offsetWidth:s,a=e.height,u=void 0===a?n.offsetHeight:a;this.renderer instanceof wt&&(t&&this.renderer.setPixelRatio(t),this.renderer.setSize(o,u))}var c=this.renderer.getSize(new r.Vector2);this.camera.aspect=c.x*this.scissor.width/(c.y*this.scissor.height),this.camera.updateProjectionMatrix(),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(),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(){var e=this.camera.copyPose();return{longitude:e.longitude,latitude:e.latitude,fov:e.fov,offset:e.offset}},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){return void 0===i&&(i=!0),this.controller?this.controller.updateCamera(e,t,i):Promise.reject(new Error("controller is not initialized."))},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 r.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 r.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&&wi.setTranscoderPath(e),wi.workerConfig.format||wi.detectSupport(this.renderer),wi._allocateWorker(0)}catch(e){e instanceof Error&&this.throwError(e)}},Object.defineProperty(i.prototype,"work",{get:function(){var e=Hs.get(this);if(e&&on.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,A,l,h,d,g,p=this;void 0===s&&(s=!0);var M,f,y,m=un(e),v=this.work;void 0===n&&(n=v?"inherit":"initial"),"inherit"===n?(M="number"==typeof this.panoIndex&&m.observers[this.panoIndex]?this.panoIndex:m.initial.panoIndex,f=null!==(o=this.currentMode)&&void 0!==o?o:m.initial.mode,y={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):"initial"===n?(f=null!==(a=this.currentMode)&&void 0!==a?a:m.initial.mode,M=m.initial.panoIndex,y=f===i.Mode.Panorama||f===i.Mode.DepthPanorama||f===i.Mode.Model||f===i.Mode.VRPanorama?{longitude:m.initial.longitude,latitude:m.initial.latitude,fov:m.initial.fov}:{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):(M=null!==(u=n.panoIndex)&&void 0!==u?u:m.initial.panoIndex,f=null!==(A=null!==(c=n.mode)&&void 0!==c?c:this.currentMode)&&void 0!==A?A:"Panorama",y={longitude:null!==(l=n.longitude)&&void 0!==l?l:m.initial.longitude,latitude:null!==(h=n.latitude)&&void 0!==h?h:m.initial.latitude,fov:null!==(d=n.fov)&&void 0!==d?d:m.initial.fov}),this.emit("willLoad",e,m,{panoIndex:M,mode:f,longitude:y.longitude,latitude:y.latitude,fov:y.fov});var N=function(){var i;p.panoIndex=M,p.panoramaLikeSavedPose.longitude=m.initial.longitude,p.panoramaLikeSavedPose.latitude=m.initial.latitude,p.panoramaLikeSavedPose.fov=m.initial.fov;var n=p.controller?null!=r?r:p.modeChangeDuration:0,o=t.__assign(t.__assign({initial:[M,y,n,s]},p.commonParams()),p.controllerInits[f]);p.controller?!1===p.controller.updateWork(m,M,y,n,s)&&(p.controller.destroy(),p.controller=p.applyController(f,o)):p.controller=p.applyController(f,o),p.emit("load",e,m,{panoIndex:M,mode:f,longitude:y.longitude,latitude:y.latitude,fov:y.fov}),null===(i=p.analysis)||void 0===i||i.work(m)},D=function(e){var t;void 0===e&&(e=Pe),m.model&&(p.model.name!==(null===(t=m.model)||void 0===t?void 0:t.file)?(p.emit("modelWillLoad",m.model),p.loadModel(m.model,m.allowHosts,e,!0)):e&&e())};return Hs.set(this,m),f===i.Mode.Floorplan||f===i.Mode.Topview||f===i.Mode.Model?D((function(){N(),p.needsRender=!0})):(this.controller||(this.camera.setFromPose({distance:0,fov:m.initial.fov,longitude:m.initial.longitude,latitude:m.initial.latitude,offset:m.observers[m.initial.panoIndex].position}),this.needsRender=!0),N(),null===(g=this.controller)||void 0===g||g.once("panoLoaded",(function(){p.needsRender=!0,p.emit("cameraUpdate",p.camera.copyPose(),s),D()}))),this.ready().then((function(){p.emit("loaded",e,p.work)}))},i.prototype.changeMode=function(e,n,r,s,o){var a=this;if(void 0===n&&(n={}),void 0===r&&(r=this.modeChangeDuration),void 0===s&&(s=!0),void 0===o&&(o=!1),!this.renderer)throw new Error("renderer is not initialized.");return new Promise((function(u,c){if(!i.Mode.hasOwnProperty(e)){var A=new Error('mode "'.concat(e,'" is not existed'));return a.throwError(A),void c(A)}if((e===i.Mode.Floorplan||e===i.Mode.Topview||e===i.Mode.Model)&&(Vi(a.model)||!0!==a.model.loaded)){A=new Error("model is not ready.");return a.throwError(A),void c(A)}if(Vi(a.controller)){A=new Error("controller is not ready.");return a.throwError(A),void c(A)}var l=a.controller,h=a.currentMode,d=function(){var A,d,g,p;if(a.emit("wantsChangeMode",e,h))c(new Error("change mode canceled."));else{if(a.controller&&!1===o&&h===e)e===i.Mode.Panorama||e===i.Mode.DepthPanorama||e===i.Mode.Model||e===i.Mode.VRPanorama?"number"==typeof n.panoIndex&&n.panoIndex!==a.panoIndex?a.controller.moveToPano(null!==(d=null!==(A=n.panoIndex)&&void 0!==A?A:a.panoIndex)&&void 0!==d?d:0,t.__assign({duration:r},n),s):a.controller.updateCamera(n,r,s).catch(Pe):("number"==typeof n.panoIndex&&n.panoIndex!==a.panoIndex&&(a.panoIndex=n.panoIndex),a.controller.updateCamera(n,r,s).catch(Pe));else{l.destroy();var M=null!==(p=null!==(g=n.panoIndex)&&void 0!==g?g:a.panoIndex)&&void 0!==p?p:0,f=Ds(e)?a.panoramaLikeSavedPose:{};"number"!=typeof n.longitude&&"number"!=typeof n.latitude||(f.longitude=n.longitude,f.latitude=n.latitude),"number"==typeof n.fov&&(f.fov=n.fov);var y=t.__assign(t.__assign({initial:[M,f,r,s]},a.commonParams()),a.controllerInits[e]);a.saveControllerPose(l),a.controller=a.applyController(e,y);var m=Ns[e].initAnimationEndPose(y);a.emit("modeChange",e,h,M,m)}u()}};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 d()})).catch((function(e){e instanceof Error&&(a.throwError(e),c(e))})):d()}))},i.prototype.getPixels=function(e,t,i,n,s){if(void 0===s&&(s=1),!this.renderer)throw new Error("renderer is not initialized.");var o=this.getPixelsRenderTarget,a=this.renderer.getSize(new r.Vector2);e=Math.min(Math.max(e,Math.floor(i/2)),Math.floor(a.x-i)),t=Math.min(Math.max(t,Math.floor(n/2)),Math.floor(a.y-n)),e*=s,t*=s,i*=s,n*=s,o.setSize(a.x*s,a.y*s),o.scissor.set(e,t,i,n),o.scissorTest=!0,this.renderer.setRenderTarget(o);var u=new Uint8Array(i*n*4);return this.controller?this.controller.render(Fs.getDelta()):this.renderer.render(this.scene,this.camera),this.renderer.readRenderTargetPixels(o,e,t,i,n,u),this.renderer.setRenderTarget(null),o.setSize(1,1),o.scissor.set(0,0,0,0),o.scissorTest=!1,u},i.prototype.getElement=function(){var e;return null===(e=this.renderer)||void 0===e?void 0:e.domElement},i.prototype.render=function(e,t){var i=this;if(void 0===t&&(t=!1),!this.renderer)return null;if(t){var n=this.renderer.getSize(Rs);this.scene.traverseVisible((function(e){e.setResolution&&e.setResolution(n.x,n.y)}))}var r=Fs.getDelta();if(this.controller&&this.screenBuffer&&null===this.renderer.getRenderTarget()){var s=this.getDrawingBufferSize(Rs);return this.screenBuffer.setSize(s.x,s.y),this.renderer.setRenderTarget(this.screenBuffer),this.controller.render(r),this.renderer.setRenderTarget(null),this.poweredByRealsee&&Ps(this.renderer),this.renderer.setRenderTarget(null),e&&ot.shared.add(e,!0),this.screenBuffer}return this.aroundScissor((function(){i.renderer&&(i.controller?i.controller.render(r):i.renderer.render(i.scene,i.camera),i.poweredByRealsee&&Ps(i.renderer)),e&&ot.shared.add(e,!0)})),null},i.prototype.updateTime=function(e,t){var i=this;if(!this.destroyed){this.syncingState=this.syncState(e,t),this.controller&&this.controller.updateTime(e,t),this.syncingState=!1;var n=new r.Vector2(512,512),s=new r.Vector2(512,512);this.renderer&&(this.renderer.getSize(n),n.x*=this.scissor.width,n.y*=this.scissor.height,this.renderer.getDrawingBufferSize(s),s.x*=this.scissor.width,s.y*=this.scissor.height);var o=[];if(Ys.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),_s.setFromProjectionMatrix(Ys),this.scene.traverse((function(e){e.setResolution&&e.setResolution(n.x,n.y),e.mixer instanceof r.AnimationMixer&&e.mixer.update(Fs.getDelta()),(e instanceof r.Mesh||e instanceof r.Line||e instanceof r.Points)&&(e instanceof r.ImmediateRenderObject||!e.frustumCulled||_s.intersectsObject(e))&&o.push(e)})),s.width*s.height>8388608?this.renderSwitch01=1^this.renderSwitch01:this.renderSwitch01=0,this.renderer&&!1===this.paused&&0===this.renderSwitch01){var a=void 0;if(!0!==this.onlyRenderIfNeeds)a=this.render();else{for(var u=0,c=o;u<c.length;u++){var A=c[u],l=function(e){!0===e.needsRender?(e.needsRender=!1,i.needsRender=!0):e.mixer&&e.mixer.stats.actions.inUse>0&&(i.needsRender=!0)};l(A),A.traverseAncestors(l)}this.controller&&!0===this.controller.needsRender&&(this.controller.needsRender=!1,this.needsRender=!0),!1!==this.needsRender&&(a=this.render())}this.needsRender=!1,this.controller&&this.screenBuffer&&this.aroundScissor((function(){return i.controller.postProcessing(i.screenBuffer,void 0,Fs.getDelta())})),this.hasListener("renderFrame")&&this.emit("renderFrame",void 0!==a)}if(this.fps.testTime&&e-this.fps.testTime<1e3)this.fps.testCount++;else if(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0,this.renderer){var h=function(e){var t=e.getError();if(t===e.NO_ERROR)return null;switch(t){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}}(this.renderer.getContext());h&&this.throwError(h)}}},i.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof wt&&this.renderer.clear(!0,!0,!0)},i.prototype.play=function(){this.needsRender=!0,this.paused=!1},i.prototype.moveToPano=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n=!0);var r=this,s=r.controller,o=r.currentMode,a=r.renderer;s?a?o===i.Mode.Floorplan||o===i.Mode.Topview?Vi(e)||(this.panoIndex=e,this.changeMode(i.Mode.Panorama,t,void 0,n)):s.moveToPano(e,t,n):this.throwError(new Error("renderer is not initialized.")):this.throwError(new Error("controller is not initialized."))},i.prototype.preloadPano=function(e,i){var n=this;if(void 0===i&&(i=Pe),!this.work)return Promise.reject(new Error("work never loaded"));var r=this.work.observers[e],s=Re();return Promise.all(["right","left","up","down","front","back"].map((function(i){var s=t.__assign({key:"pano.".concat(e,".").concat(i),basisLoaderInitialized:wi.isInitialized()},ni(n.imageOptions,["size","format","quality"])),o=r.images[i];return function(e,t){return void 0===t&&(t={}),e in it?it[e]:it[e]=new Promise((function(i,n){var r=document.createElement("link");r.href=e,r.rel=r.relList&&r.relList.supports("prefetch")?"prefetch":"preload",r.as="fetch",r.crossOrigin="";var s=Re(),o=document.head||document.getElementsByTagName("head")[0];o&&o.appendChild(r);var a=!1;r.onload=function(){var n;if(!0!==a){a=!0,i();var r=Re(),o={source:e,requestTime:s,responseTime:r,costs:r-s,headers:{}};null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"Link","preload",JSON.stringify(o))}},r.onerror=function(i){var r;if(!0!==a){a=!0;var s=new qe(e,"Link",0);n(s),null===(r=t.networkSubscribe)||void 0===r||r.emit("network",e,"Link","error",s.message)}}}))}(n.imageOptions.transform?n.imageOptions.transform(o,s):ht(o,s),{networkSubscribe:n.networkSubscribe})}))).then((function(){var e=Re()-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),s=new r.Raycaster(i,n.clone().normalize()),o=this.model.intersectRaycaster(s)[0];if(o&&o.distance+.01<n.length())return null}var a=e.clone().project(this.camera);if(Math.abs(a.z)>1)return null;var u=this.renderer.getSize(new r.Vector2),c=u.x*this.scissor.width,A=u.y*this.scissor.height,l=u.x*this.scissor.left+(a.x+1)/2*c,h=u.y*(1-this.scissor.bottom-this.scissor.height)+(1-a.y)/2*A;return new r.Vector2(l,h)},i.prototype.getRenderObjects=function(e){Ys.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),_s.setFromProjectionMatrix(Ys),e||(e=this.scene);var t=[];return e.traverseVisible((function(e){(e instanceof r.Mesh||e instanceof r.Line||e instanceof r.Points)&&(e instanceof r.ImmediateRenderObject||!e.frustumCulled||_s.intersectsObject(e))&&t.push(e)})),t},i.prototype.getCurrentState=function(){return t.__assign(t.__assign({},this.getPose()),{mode:this.currentMode||i.Mode.Panorama,panoIndex:this.panoIndex||0})},i.prototype.setState=function(e,n,s){var o,a,u,c,A,l,h,d;void 0===n&&(n=!1),void 0===s&&(s=!0),!(e=Object.assign({},e)).offset||e instanceof r.Vector3||(e.offset=new r.Vector3(e.offset.x,e.offset.y,e.offset.z));var g,p,M,f,y=null!==(o=e.panoIndex)&&void 0!==o?o:this.state.panoIndex,m=null!==(a=e.mode)&&void 0!==a?a:this.state.mode;if(this.work)if(this.work.observers[y])if(e.mode!==i.Mode.Floorplan&&e.mode!==i.Mode.Topview&&e.mode!==i.Mode.Model||!Vi(this.model)&&!0===this.model.loaded){if(this.state.mode!==m){var v=void 0;v=Ds(this.state.mode)&&Ds(m)?t.__assign({},this.state):Ds(m)?t.__assign({},this.panoramaLikeSavedPose):t.__assign({},e),"number"==typeof e.longitude&&(v.longitude=e.longitude),"number"==typeof e.latitude&&(v.latitude=e.latitude),"number"==typeof e.fov&&(v.fov=e.fov);var N=t.__assign(t.__assign({initial:[y,v,this.modeChangeDuration,!1]},this.commonParams()),this.controllerInits[m]),D=Ns[m].initAnimationEndPose(N);g=D.longitude,p=D.latitude,M=D.fov,f=D.offset}else g=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!==(A=e.fov)&&void 0!==A?A:this.state.fov,f=null!==(l=e.offset)&&void 0!==l?l:this.state.offset;var E={panoIndex:y,mode:m,longitude:g,latitude:p,fov:M,offset:f};this.emit("setState",E),Ar(this.state,E)||(cr(this.state,E),this.controller&&(this.controller.userAction=s),n&&this.state.mode===E.mode&&(this.syncingState=this.syncState(Re(),0,n),this.syncingState&&(null===(h=this.controller)||void 0===h||h.updateTime(Re(),0),this.syncingState=!1)),this.emit("stateChange",this.state,s),null===(d=this.analysis)||void 0===d||d.state(this.work,this.state))}else this.throwError(new Error("model is not ready."));else this.throwError(new Error("panoIndex not found in work"));else this.throwError(new Error("work never load."))},i.prototype.aroundScissor=function(e){if(this.renderer){var t=new r.Vector2,i=0!==this.scissor.left||0!==this.scissor.bottom||1!==this.scissor.width||1!==this.scissor.height;if(i){this.renderer.getSize(t);var n=Math.floor(t.x*this.scissor.left),s=Math.floor(t.y*this.scissor.bottom),o=Math.floor(t.x*this.scissor.width),a=Math.floor(t.y*this.scissor.height);this.renderer.setViewport(n,s,o,a),this.renderer.setScissor(n,s,o,a),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,t,n){void 0===n&&(n=!1);var s=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){var o={mode:this.state.mode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.changeMode(this.state.mode,o,this.modeChangeDuration,this.controller.userAction),!0}if(!1===this.controller.isReady())return!1;if(this.readyCallbacks.length){var a=this.currentMode;if(!(a===i.Mode.Floorplan||a===i.Mode.Topview||a===i.Mode.Model)||!this.modelPending)for(var u=void 0;u=this.readyCallbacks.shift();)u()}if(this.controller instanceof Ns.Model){if(!this.camera.pose.offset.equals(this.state.offset)){var c={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,c,!1),!0}}else if(this.state.panoIndex!==this.panoIndex){c={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPano(this.state.panoIndex,c,!1),!0}if(this.controller instanceof Ns.Topview){var A=1,l=n?this.state.fov:ur(this.camera.pose.fov,this.state.fov,A),h=n?new r.Vector3(this.state.offset.x,this.state.offset.y,this.state.offset.z):new r.Vector3(ur(this.camera.pose.offset.x,this.state.offset.x,.2),ur(this.camera.pose.offset.y,this.state.offset.y,.2),ur(this.camera.pose.offset.z,this.state.offset.z,.2));if(Jn(l,this.camera.pose.fov)||er(h,this.camera.pose.offset))return this.controller.cameraMotion.set({fov:l},0).catch(Pe),this.controller.locationMotion.set({x:h.x,y:h.y,z:h.z},0).catch(Pe),!0}else{A=1;var d=Math.PI/45,g=(l=n?this.state.fov:ur(this.camera.pose.fov,this.state.fov,A),n?{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=sr(e.longitude),r=e.latitude,s=sr(t.longitude),o=t.latitude;s-n>or?n+=ar:n-s>or&&(n-=ar);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},d)),p=g.longitude,M=g.latitude;if(Jn(p,this.camera.pose.longitude,2*Math.PI)||Jn(M,this.camera.pose.latitude)||Jn(l,this.camera.pose.fov))return this.controller.cameraMotion.set({longitude:p,latitude:M,fov:l},0).catch(Pe),!0}return this.stateSynced=!0,!1===s&&this.emit("stateSynced",this.state),!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,i,n){var s=this,o=e.file;this.emit("modelWillLoad",e);var a=new Wi({allowHosts:t,networkSubscribe:this.networkSubscribe});a.once("bvhLoaded",(function(){var e,t;s.destroyed||o===(null===(t=null===(e=s.work)||void 0===e?void 0:e.model)||void 0===t?void 0:t.file)&&s.emit("modelBvhLoaded",a)})),a.once("materialLoaded",(function(){var e,t;s.destroyed||o===(null===(t=null===(e=s.work)||void 0===e?void 0:e.model)||void 0===t?void 0:t.file)&&s.emit("modelMaterialLoaded",a)})),a.once("geometryLoaded",(function(){var t,i,n,r;if(!s.destroyed&&o===(null===(i=null===(t=s.work)||void 0===t?void 0:t.model)||void 0===i?void 0:i.file)){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())),u&&a.setMaterial(u),e.bvh&&a.buildBVH(),s.model=a,s.scene.add(a),null===(n=s.controller)||void 0===n||n.updateModel(a),null===(r=s.renderer)||void 0===r||r.compile(s.scene,s.camera),s.needsRender=!0,s.modelPending=!1,s.emit("modelGeometryLoaded",a)}})),a.once("loaded",(function(){var e,t;s.destroyed||o===(null===(t=null===(e=s.work)||void 0===e?void 0:e.model)||void 0===t?void 0:t.file)&&(i(),s.emit("modelLoaded",a))})),a.on("shownFloorChange",(function(e,t){var i,n;s.destroyed||o===(null===(n=null===(i=s.work)||void 0===i?void 0:i.model)||void 0===n?void 0:n.file)&&s.emit("modelShownFloorChange",e,t)})),a.on("error",(function(e){var t,n,u,c;if(!s.destroyed&&o===(null===(n=null===(t=s.work)||void 0===t?void 0:t.model)||void 0===n?void 0:n.file)){a.bounding.makeEmpty();for(var A=0,l=s.work.observers;A<l.length;A++){var h=l[A];a.bounding.expandByPoint(h.standingPosition),a.bounding.expandByPoint((new r.Vector3).fromArray([h.position.x,2*h.position.y-h.standingPosition.y,h.position.z]))}var d=nr(a.bounding,new r.Vector3(1,0,1));d.visible=!0,d.name="model_empty",a.add(d);var g,p=s.model;p&&(p.show(),g=p.getMaterial()||{},s.scene.remove(p),p.dispose(),a.setTransparent(p.getTransparent())),g&&a.setMaterial(g),s.model=a,s.scene.add(a),null===(u=s.controller)||void 0===u||u.updateModel(a),null===(c=s.renderer)||void 0===c||c.compile(s.scene,s.camera),s.emit("modelLoadError",e,a),s.throwError(e),s.modelPending=!1,i()}})),this.modelPending=!0,a.load(e,this.textureOptions).catch(Pe)},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,enableIOSEDR:this._enableIOSEDR,extraElements:this.extraElements,videoTexture:this.videoTexture,networkSubscribe:this.networkSubscribe}},i.prototype.saveControllerPose=function(e){void 0===e&&(e=this.controller),e&&Ds(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=Ns[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;for(var o=new s(n),a=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}))},u=0,c=Es;u<c.length;u++){a(c[u])}var A=Ns[e].initAnimationEndPose(n),l=n.initial[3],h={panoIndex:n.initial[0],mode:e,longitude:A.longitude,latitude:A.latitude,fov:A.fov,offset:A.offset};return Ar(this.state,h)||(cr(this.state,h),this.emit("stateChange",this.state,l)),this.emit("currentStateChange",this.getCurrentState(),l),o.on("cameraUpdate",(function(i,n){var s;if(r.controller){var o=t.__assign(t.__assign({},r.controller.getTargetPose()),{panoIndex:r.panoIndex,mode:e});n&&!1===r.syncingState&&r.state.mode===o.mode&&!Ar(r.state,o)&&(cr(r.state,o),r.emit("stateChange",r.state,n),null===(s=r.analysis)||void 0===s||s.state(r.work,r.state))}r.emit("currentStateChange",r.getCurrentState(),n)})),o.on("initAnimationWillStart",(function(i,n,s){var o,a=t.__assign(t.__assign({},n),{panoIndex:i,mode:e});s&&r.state.mode===a.mode&&!Ar(r.state,a)&&(cr(r.state,a),r.emit("stateChange",r.state,s),null===(o=r.analysis)||void 0===o||o.state(r.work,r.state))})),o.on("initAnimationEnded",(function(i,n,s){var o,a=t.__assign(t.__assign({},n),{panoIndex:i,mode:e});s&&r.state.mode===a.mode&&!Ar(r.state,a)&&(cr(r.state,a),r.emit("stateChange",r.state,s),null===(o=r.analysis)||void 0===o||o.state(r.work,r.state))})),o.on("panoWillArrive",(function(i,n,s){var o;r.panoIndex=i;var a=t.__assign(t.__assign({},n),{panoIndex:i,mode:e});s&&r.state.mode===a.mode&&!Ar(r.state,a)&&(cr(r.state,a),r.emit("stateChange",r.state,s),null===(o=r.analysis)||void 0===o||o.state(r.work,r.state))})),o.on("panoArrived",(function(i,n,s){var o,a=t.__assign(t.__assign({},n),{panoIndex:i,mode:e});s&&r.state.mode===a.mode&&!Ar(r.state,a)&&(cr(r.state,a),r.emit("stateChange",r.state,s),null===(o=r.analysis)||void 0===o||o.state(r.work,r.state))})),o.on("moveToPano",(function(e,t){r.emit("currentStateChange",r.getCurrentState(),t)})),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("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}(ke);exports.AnimationFrameLoop=ot,exports.BVH=_t,exports.BVHIntersect=Qt,exports.BVHNode=Bt,exports.BVHVector3=Ot,exports.Camera=Lt,exports.Five=Vs,exports.InternalWebGLRenderer=wt,exports.IntersectMesh=qn,exports.LegacyPanoCircleMesh=Tn,exports.Model=Wi,exports.NetworkSubscribe=et,exports.PBMContainer=gt,exports.PBMGroup=pt,exports.PBMMaterial=Et,exports.PBMMesh=dt,exports.PROXY_CONTROLLER_EVENT_NAMES=Es,exports.PanoCircleMesh=_n,exports.Scene=It,exports.Subscribe=ke,exports.defaultImageURLTransform=ht,exports.getViewportScale=Is,exports.parseWork=un;
362
+ * Licensed under the MIT license */var Jo=function(e,t,r,n){var i,o=["","webkit","Moz","MS","ms","o"],a=t.createElement?t.createElement("div"):n,s="function",l=Math.round,u=Math.abs,c=Date.now;function h(e,t,r){return setTimeout(g(e,r),t)}function d(e,t,r){return!!Array.isArray(e)&&(p(e,r[t],r),!0)}function p(e,t,r){var i;if(e)if(e.forEach)e.forEach(t,r);else if(e.length!==n)for(i=0;i<e.length;)t.call(r,e[i],i,e),i++;else for(i in e)e.hasOwnProperty(i)&&t.call(r,e[i],i,e)}function f(t,r,n){var i="DEPRECATED METHOD: "+r+"\n"+n+" AT \n";return function(){var r=new Error("get-stack-trace"),n=r&&r.stack?r.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=e.console&&(e.console.warn||e.console.log);return o&&o.call(e.console,i,n),t.apply(this,arguments)}}i="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),r=1;r<arguments.length;r++){var i=arguments[r];if(i!==n&&null!==i)for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])}return t}:Object.assign;var v=f((function(e,t,r){for(var i=Object.keys(t),o=0;o<i.length;)(!r||r&&e[i[o]]===n)&&(e[i[o]]=t[i[o]]),o++;return e}),"extend","Use `assign`."),A=f((function(e,t){return v(e,t,!0)}),"merge","Use `assign`.");function m(e,t,r){var n,o=t.prototype;(n=e.prototype=Object.create(o)).constructor=e,n._super=o,r&&i(n,r)}function g(e,t){return function(){return e.apply(t,arguments)}}function y(e,t){return typeof e==s?e.apply(t&&t[0]||n,t):e}function b(e,t){return e===n?t:e}function x(e,t,r){p(C(t),(function(t){e.addEventListener(t,r,!1)}))}function w(e,t,r){p(C(t),(function(t){e.removeEventListener(t,r,!1)}))}function M(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function E(e,t){return e.indexOf(t)>-1}function C(e){return e.trim().split(/\s+/g)}function I(e,t,r){if(e.indexOf&&!r)return e.indexOf(t);for(var n=0;n<e.length;){if(r&&e[n][r]==t||!r&&e[n]===t)return n;n++}return-1}function S(e){return Array.prototype.slice.call(e,0)}function P(e,t,r){for(var n=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];I(i,a)<0&&n.push(e[o]),i[o]=a,o++}return r&&(n=t?n.sort((function(e,r){return e[t]>r[t]})):n.sort()),n}function T(e,t){for(var r,i,a=t[0].toUpperCase()+t.slice(1),s=0;s<o.length;){if((i=(r=o[s])?r+a:t)in e)return i;s++}return n}var B=1;function R(t){var r=t.ownerDocument||t;return r.defaultView||r.parentWindow||e}var O="ontouchstart"in e,L=T(e,"PointerEvent")!==n,D=O&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),F="touch",k="mouse",Q=25,N=1,V=2,U=4,z=8,q=1,H=2,_=4,j=8,G=16,K=H|_,W=j|G,Y=K|W,X=["x","y"],J=["clientX","clientY"];function Z(e,t){var r=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])&&r.handler(t)},this.init()}function $(e,t,r){var i=r.pointers.length,o=r.changedPointers.length,a=t&N&&i-o==0,s=t&(U|z)&&i-o==0;r.isFirst=!!a,r.isFinal=!!s,a&&(e.session={}),r.eventType=t,function(e,t){var r=e.session,i=t.pointers,o=i.length;r.firstInput||(r.firstInput=ee(t));o>1&&!r.firstMultiple?r.firstMultiple=ee(t):1===o&&(r.firstMultiple=!1);var a=r.firstInput,s=r.firstMultiple,l=s?s.center:a.center,h=t.center=te(i);t.timeStamp=c(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=oe(l,h),t.distance=ie(l,h),function(e,t){var r=t.center,n=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};t.eventType!==N&&o.eventType!==U||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=e.offsetDelta={x:r.x,y:r.y});t.deltaX=i.x+(r.x-n.x),t.deltaY=i.y+(r.y-n.y)}(r,t),t.offsetDirection=ne(t.deltaX,t.deltaY);var d=re(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=s?function(e,t){return ie(t[0],t[1],J)/ie(e[0],e[1],J)}(s.pointers,i):1,t.rotation=s?function(e,t){return oe(t[1],t[0],J)+oe(e[1],e[0],J)}(s.pointers,i):0,t.maxPointers=r.prevInput?t.pointers.length>r.prevInput.maxPointers?t.pointers.length:r.prevInput.maxPointers:t.pointers.length,function(e,t){var r,i,o,a,s=e.lastInterval||t,l=t.timeStamp-s.timeStamp;if(t.eventType!=z&&(l>Q||s.velocity===n)){var c=t.deltaX-s.deltaX,h=t.deltaY-s.deltaY,d=re(l,c,h);i=d.x,o=d.y,r=u(d.x)>u(d.y)?d.x:d.y,a=ne(c,h),e.lastInterval=t}else r=s.velocity,i=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=r,t.velocityX=i,t.velocityY=o,t.direction=a}(r,t);var p=e.element;M(t.srcEvent.target,p)&&(p=t.srcEvent.target);t.target=p}(e,r),e.emit("hammer.input",r),e.recognize(r),e.session.prevInput=r}function ee(e){for(var t=[],r=0;r<e.pointers.length;)t[r]={clientX:l(e.pointers[r].clientX),clientY:l(e.pointers[r].clientY)},r++;return{timeStamp:c(),pointers:t,center:te(t),deltaX:e.deltaX,deltaY:e.deltaY}}function te(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var r=0,n=0,i=0;i<t;)r+=e[i].clientX,n+=e[i].clientY,i++;return{x:l(r/t),y:l(n/t)}}function re(e,t,r){return{x:t/e||0,y:r/e||0}}function ne(e,t){return e===t?q:u(e)>=u(t)?e<0?H:_:t<0?j:G}function ie(e,t,r){r||(r=X);var n=t[r[0]]-e[r[0]],i=t[r[1]]-e[r[1]];return Math.sqrt(n*n+i*i)}function oe(e,t,r){r||(r=X);var n=t[r[0]]-e[r[0]],i=t[r[1]]-e[r[1]];return 180*Math.atan2(i,n)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(R(this.element),this.evWin,this.domHandler)}};var ae={mousedown:N,mousemove:V,mouseup:U},se="mousedown",le="mousemove mouseup";function ue(){this.evEl=se,this.evWin=le,this.pressed=!1,Z.apply(this,arguments)}m(ue,Z,{handler:function(e){var t=ae[e.type];t&N&&(0===e.button||2===e.button)&&(this.pressed=!0),t&V&&1!==e.which&&(t=U),this.pressed&&(t&U&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:k,srcEvent:e}))}});var ce={pointerdown:N,pointermove:V,pointerup:U,pointercancel:z,pointerout:z},he={2:F,3:"pen",4:k,5:"kinect"},de="pointerdown",pe="pointermove pointerup pointercancel";function fe(){this.evEl=de,this.evWin=pe,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&(de="MSPointerDown",pe="MSPointerMove MSPointerUp MSPointerCancel"),m(fe,Z,{handler:function(e){var t=this.store,r=!1,n=!1,i=e.type.toLowerCase().replace("ms",""),o=ce[i],a=he[e.pointerType]||e.pointerType,s=a==F,l=I(t,e.pointerId,"pointerId");o&N&&(0===e.button||2===e.button||s)?l<0&&(t.push(e),l=t.length-1):o&(U|z)?r=!0:s||0!==e.buttons||(r=!0,n=!0,o=ce.pointerup),l<0||(n||(t[l]=e),this.callback(this.manager,o,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:t[l]}),r&&t.splice(l,1))}});var ve={touchstart:N,touchmove:V,touchend:U,touchcancel:z};function Ae(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}function me(e,t){var r=S(e.touches),n=S(e.changedTouches);return t&(U|z)&&(r=P(r.concat(n),"identifier",!0)),[r,n]}m(Ae,Z,{handler:function(e){var t=ve[e.type];if(t===N&&(this.started=!0),this.started){var r=me.call(this,e,t);t&(U|z)&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:r[0],changedPointers:r[1],pointerType:F,srcEvent:e})}}});var ge={touchstart:N,touchmove:V,touchend:U,touchcancel:z},ye="touchstart touchmove touchend touchcancel";function be(){this.evTarget=ye,this.targetIds={},Z.apply(this,arguments)}function xe(e,t){var r=S(e.touches),n=this.targetIds;if(t&(N|V)&&1===r.length)return n[r[0].identifier]=!0,[r,r];var i,o,a=S(e.changedTouches),s=[],l=this.target;if(o=r.filter((function(e){return M(e.target,l)})),t===N)for(i=0;i<o.length;)n[o[i].identifier]=!0,i++;for(i=0;i<a.length;)n[a[i].identifier]&&s.push(a[i]),t&(U|z)&&delete n[a[i].identifier],i++;return s.length?[P(o.concat(s),"identifier",!0),s]:void 0}m(be,Z,{handler:function(e){var t=ge[e.type],r=xe.call(this,e,t);r&&this.callback(this.manager,t,{pointers:r[0],changedPointers:r[1],pointerType:F,srcEvent:e})}});var we=2500;function Me(){Z.apply(this,arguments);var e=g(this.handler,this);this.touch=new be(this.manager,e),this.mouse=new ue(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function Ee(e,t){e&N?(this.primaryTouch=t.changedPointers[0].identifier,Ce.call(this,t)):e&(U|z)&&Ce.call(this,t)}function Ce(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var r={x:t.clientX,y:t.clientY};this.lastTouches.push(r);var n=this.lastTouches;setTimeout((function(){var e=n.indexOf(r);e>-1&&n.splice(e,1)}),we)}}function Ie(e){for(var t=e.srcEvent.clientX,r=e.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var i=this.lastTouches[n],o=Math.abs(t-i.x),a=Math.abs(r-i.y);if(o<=25&&a<=25)return!0}return!1}m(Me,Z,{handler:function(e,t,r){var n=r.pointerType==F,i=r.pointerType==k;if(!(i&&r.sourceCapabilities&&r.sourceCapabilities.firesTouchEvents)){if(n)Ee.call(this,t,r);else if(i&&Ie.call(this,r))return;this.callback(e,t,r)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Se=a?T(a.style,"touchAction"):n,Pe=Se!==n,Te="compute",Be="auto",Re="manipulation",Oe="none",Le="pan-x",De="pan-y",Fe=function(){if(!Pe)return!1;var t={},r=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!r||e.CSS.supports("touch-action",n)})),t}();function ke(e,t){this.manager=e,this.set(t)}ke.prototype={set:function(e){e==Te&&(e=this.compute()),Pe&&this.manager.element.style&&Fe[e]&&(this.manager.element.style[Se]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,(function(t){y(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(E(e,Oe))return Oe;var t=E(e,Le),r=E(e,De);if(t&&r)return Oe;if(t||r)return t?Le:De;if(E(e,Re))return Re;return Be}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,r=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var n=this.actions,i=E(n,Oe)&&!Fe[Oe],o=E(n,De)&&!Fe[De],a=E(n,Le)&&!Fe[Le];if(i){var s=1===e.pointers.length,l=e.distance<2,u=e.deltaTime<250;if(s&&l&&u)return}if(!a||!o)return i||o&&r&K||a&&r&W?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Qe=1,Ne=2,Ve=4,Ue=8,ze=Ue,qe=16,He=32;function _e(e){this.options=i({},this.defaults,e||{}),this.id=B++,this.manager=null,this.options.enable=b(this.options.enable,!0),this.state=Qe,this.simultaneous={},this.requireFail=[]}function je(e){return e&qe?"cancel":e&Ue?"end":e&Ve?"move":e&Ne?"start":""}function Ge(e){return e==G?"down":e==j?"up":e==H?"left":e==_?"right":""}function Ke(e,t){var r=t.manager;return r?r.get(e):e}function We(){_e.apply(this,arguments)}function Ye(){We.apply(this,arguments),this.pX=null,this.pY=null}function Xe(){We.apply(this,arguments)}function Je(){_e.apply(this,arguments),this._timer=null,this._input=null}function Ze(){We.apply(this,arguments)}function $e(){We.apply(this,arguments)}function et(){_e.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function tt(e,t){return(t=t||{}).recognizers=b(t.recognizers,tt.defaults.preset),new rt(e,t)}_e.prototype={defaults:{},set:function(e){return i(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ke(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Ke(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===I(t,e=Ke(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Ke(e,this);var t=I(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,r=this.state;function n(r){t.manager.emit(r,e)}r<Ue&&n(t.options.event+je(r)),n(t.options.event),e.additionalEvent&&n(e.additionalEvent),r>=Ue&&n(t.options.event+je(r))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=He},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(He|Qe)))return!1;e++}return!0},recognize:function(e){var t=i({},e);if(!y(this.options.enable,[this,t]))return this.reset(),void(this.state=He);this.state&(ze|qe|He)&&(this.state=Qe),this.state=this.process(t),this.state&(Ne|Ve|Ue|qe)&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},m(We,_e,{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,r=e.eventType,n=t&(Ne|Ve),i=this.attrTest(e);return n&&(r&z||!i)?t|qe:n||i?r&U?t|Ue:t&Ne?t|Ve:Ne:He}}),m(Ye,We,{defaults:{event:"pan",threshold:10,pointers:1,direction:Y},getTouchAction:function(){var e=this.options.direction,t=[];return e&K&&t.push(De),e&W&&t.push(Le),t},directionTest:function(e){var t=this.options,r=!0,n=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(t.direction&K?(i=0===o?q:o<0?H:_,r=o!=this.pX,n=Math.abs(e.deltaX)):(i=0===a?q:a<0?j:G,r=a!=this.pY,n=Math.abs(e.deltaY))),e.direction=i,r&&n>t.threshold&&i&t.direction},attrTest:function(e){return We.prototype.attrTest.call(this,e)&&(this.state&Ne||!(this.state&Ne)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ge(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),m(Xe,We,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Oe]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&Ne)},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)}}),m(Je,_e,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Be]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,n=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!n||!r||e.eventType&(U|z)&&!i)this.reset();else if(e.eventType&N)this.reset(),this._timer=h((function(){this.state=ze,this.tryEmit()}),t.time,this);else if(e.eventType&U)return ze;return He},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===ze&&(e&&e.eventType&U?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}}),m(Ze,We,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Oe]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&Ne)}}),m($e,We,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:K|W,pointers:1},getTouchAction:function(){return Ye.prototype.getTouchAction.call(this)},attrTest:function(e){var t,r=this.options.direction;return r&(K|W)?t=e.overallVelocity:r&K?t=e.overallVelocityX:r&W&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&r&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&e.eventType&U},emit:function(e){var t=Ge(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),m(et,_e,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Re]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,n=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),e.eventType&N&&0===this.count)return this.failTimeout();if(n&&i&&r){if(e.eventType!=U)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||ie(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=h((function(){this.state=ze,this.tryEmit()}),t.interval,this),Ne):ze}return He},failTimeout:function(){return this._timer=h((function(){this.state=He}),this.options.interval,this),He},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ze&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),tt.VERSION="2.0.7",tt.defaults={domEvents:!1,touchAction:Te,enable:!0,inputTarget:null,inputClass:null,preset:[[Ze,{enable:!1}],[Xe,{enable:!1},["rotate"]],[$e,{direction:K}],[Ye,{direction:K},["swipe"]],[et],[et,{event:"doubletap",taps:2},["tap"]],[Je]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function rt(e,t){var r;this.options=i({},tt.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((r=this).options.inputClass||(L?fe:D?be:O?Me:ue))(r,$),this.touchAction=new ke(this,this.options.touchAction),nt(this,!0),p(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 nt(e,t){var r,n=e.element;n.style&&(p(e.options.cssProps,(function(i,o){r=T(n.style,o),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||""})),t||(e.oldCssProps={}))}return rt.prototype={set:function(e){return i(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 r;this.touchAction.preventDefaults(e);var n=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&ze)&&(i=t.curRecognizer=null);for(var o=0;o<n.length;)r=n[o],2===t.stopped||i&&r!=i&&!r.canRecognizeWith(i)?r.reset():r.recognize(e),!i&&r.state&(Ne|Ve|Ue)&&(i=t.curRecognizer=r),o++}},get:function(e){if(e instanceof _e)return e;for(var t=this.recognizers,r=0;r<t.length;r++)if(t[r].options.event==e)return t[r];return null},add:function(e){if(d(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(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,r=I(t,e);-1!==r&&(t.splice(r,1),this.touchAction.update())}return this},on:function(e,t){if(e!==n&&t!==n){var r=this.handlers;return p(C(e),(function(e){r[e]=r[e]||[],r[e].push(t)})),this}},off:function(e,t){if(e!==n){var r=this.handlers;return p(C(e),(function(e){t?r[e]&&r[e].splice(I(r[e],t),1):delete r[e]})),this}},emit:function(e,r){this.options.domEvents&&function(e,r){var n=t.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=r,r.target.dispatchEvent(n)}(e,r);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){r.type=e,r.preventDefault=function(){r.srcEvent.preventDefault()};for(var i=0;i<n.length;)n[i](r),i++}},destroy:function(){this.element&&nt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},i(tt,{INPUT_START:N,INPUT_MOVE:V,INPUT_END:U,INPUT_CANCEL:z,STATE_POSSIBLE:Qe,STATE_BEGAN:Ne,STATE_CHANGED:Ve,STATE_ENDED:Ue,STATE_RECOGNIZED:ze,STATE_CANCELLED:qe,STATE_FAILED:He,DIRECTION_NONE:q,DIRECTION_LEFT:H,DIRECTION_RIGHT:_,DIRECTION_UP:j,DIRECTION_DOWN:G,DIRECTION_HORIZONTAL:K,DIRECTION_VERTICAL:W,DIRECTION_ALL:Y,Manager:rt,Input:Z,TouchAction:ke,TouchInput:be,MouseInput:ue,PointerEventInput:fe,TouchMouseInput:Me,SingleTouchInput:Ae,Recognizer:_e,AttrRecognizer:We,Tap:et,Pan:Ye,Swipe:$e,Pinch:Xe,Rotate:Ze,Press:Je,on:x,off:w,each:p,merge:A,extend:v,assign:i,inherit:m,bindFn:g,prefixed:T}),tt}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{});function Zo(e,t,r){var i=t.getBoundingClientRect(),o=i.top,a=i.left,s=i.width,l=i.height;return r&&(a+=s*r.left,o+=l*(1-r.bottom-r.height),s*=r.width,l*=r.height),new n.Vector2((e.x-a)/s*2-1,-(e.y-o)/l*2+1)}var $o=new n.OrthographicCamera(-1,1,1,-1,0,1),ea=new n.BufferGeometry;ea.setAttribute("position",new n.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),ea.setAttribute("uv",new n.Float32BufferAttribute([0,2,0,0,2,0],2));var ta=new n.Mesh(ea),ra=new n.Scene;ra.add(ta);var na=function(){function e(e,t){var r;this.renderer=e,this.material=new n.ShaderMaterial({vertexShader:null!==(r=t.vertex)&&void 0!==r?r:"\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 n.Uniform(null)},t.uniforms),defines:Object.assign({},t.defines),blending:n.NoBlending,depthWrite:!1,depthTest:!1})}return e.prototype.render=function(e,t){var r=this.renderer.getRenderTarget(),n=ta.material;this.material.uniforms.inputBuffer.value=e.texture,ta.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(ra,$o),this.renderer.setRenderTarget(r),ta.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),ia=function(){function e(e){this.renderer=e,this.material=new n.ShaderMaterial({vertexShader:"\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nuniform vec3 inputValue;\nvoid main() {\n gl_FragColor = vec4(inputValue, 1.0);\n}\n",uniforms:Object.assign({inputValue:new n.Uniform(new n.Vector3)}),blending:n.NoBlending,depthWrite:!1,depthTest:!1})}return e.prototype.render=function(e,t){var r=this.renderer.getRenderTarget(),n=ta.material;this.material.uniforms.inputValue.value.copy(e),ta.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(ra,$o),this.renderer.setRenderTarget(r),ta.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),oa=function(e){function t(t){return e.call(this,t,{fragment:"\nuniform sampler2D inputBuffer;\nvarying vec2 vUv;\nvoid main() {\n gl_FragColor = texture2D(inputBuffer, vUv);\n}\n"})||this}return ne(t,e),t}(na),aa=function(){function e(e){this.enable=!0,this.renderer=e,this.copyPass=new oa(this.renderer)}return e.prototype.render=function(e,t,r){this.copyPass.render(e,t)},e.prototype.dispose=function(){this.copyPass.dispose()},e}(),sa=function(e){function t(r){var n,i,o=this;o=e.call(this)||this;var a=t.parseArgs(r);return o.pending=new Set,o.userAction=a.initial.userAction,o.destroyed=!1,o.ident=a.ident,o.scene=a.scene,o.helper=a.helper,o.boundingMesh=a.boundingMesh,o.camera=a.camera,o.renderer=a.renderer,o.scissor=a.scissor,o.element=a.element,o.model=a.model,o.enableIOSEDR=null!==(n=a.enableIOSEDR)&&void 0!==n&&n,o.enableEDL=null===(i=a.enableEDL)||void 0===i||i,o.works=a.works,o.imageOptions=a.imageOptions,o.videoTexture=a.videoTexture,o.networkSubscribe=a.networkSubscribe,o.requestProxy=a.requestProxy,o.extraElements=a.extraElements,o.initial=a.initial,o.needsRender=!0,o.cameraMotion=new fo({longitude:{value:o.camera.pose.longitude,circle:[0,2*Math.PI]},latitude:o.camera.pose.latitude,fov:o.camera.pose.fov}),o.eventUnbinds=[a.element].concat(a.extraElements||[]).map((function(e){return o.bindEvents(e)})),o.pending.add("init-animation"),Ne.shared.add((function(){o.initAnimation().then((function(){o.pending.delete("init-animation")}))}),!0),o}return ne(t,e),t.parseArgs=function(e){return e instanceof t?e:ie({},e)},t.initAnimationEndPose=function(e){var t,r,n,i,o,a=this.parseArgs(e).initial,s=a.state,l=a.currentState;return{longitude:null!==(t=s.longitude)&&void 0!==t?t:l.longitude,latitude:null!==(r=s.latitude)&&void 0!==r?r:l.latitude,fov:null!==(n=s.fov)&&void 0!==n?n:l.fov,offset:null!==(i=s.offset)&&void 0!==i?i:l.offset,distance:null!==(o=s.distance)&&void 0!==o?o:l.distance}},t.prototype.destroy=function(){var e;this.destroyed=!0,this.off(),this.cameraMotion.dispose();for(var t=0,r=this.eventUnbinds;t<r.length;t++){(0,r[t])()}this.copyEffect&&(this.copyEffect.dispose(),delete this.copyEffect),delete this.panState,null===(e=this.pressState)||void 0===e||e.stop(),delete this.pressState},t.prototype.isReady=function(){return 0===this.pending.size&&!0===this.cameraMotion.ended},t.prototype.bindExtraElement=function(e){for(var t=0,r=this.eventUnbinds;t<r.length;t++){if(r[t].element===e)return}this.eventUnbinds.push(this.bindEvents(e))},t.prototype.unbindExtraElement=function(e){for(var t=[],r=0,n=this.eventUnbinds;r<n.length;r++){var i=n[r];i.element===e?i():t.push(i)}this.eventUnbinds=t},t.prototype.updateRenderSize=function(){this.needsRender=!0},t.prototype.updateModel=function(e){this.model=e,this.needsRender=!0},t.prototype.updateWork=function(e,t,r,n){return this.works=e,this.userAction=n,!1},t.prototype.updateTime=function(e,t){if(!this.destroyed){var r={};this.cameraMotion.ended&&(this.cameraMotion.update(e),r.longitude=this.cameraMotion.value.longitude,r.latitude=this.cameraMotion.value.latitude,r.fov=this.cameraMotion.value.fov),Yo(r)&&this.setCamera(r)}},t.prototype.render=function(){this.renderer.render(this.scene,this.camera)},t.prototype.postProcessing=function(e,t){this.destroyed||(this.copyEffect||(this.copyEffect=new aa(this.renderer)),this.copyEffect.render(e,t))},t.prototype.updateCamera=function(e,t,r){return this.userAction=r,this.cameraMotion.set(e,t).catch(fe)},t.prototype.updateCameraWithKeyframes=function(e,t,r){return this.userAction=r,this.cameraMotion.setKeyframes(e,t)},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(Ae())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance}},t.prototype.initAnimation=function(){var e=this.initial;e.state,e.currentState,e.duration;var r=e.userAction;return t.initAnimationEndPose(this),this.userAction=r,Promise.resolve()},t.prototype.setCamera=function(e){var t,r,n,i,o;void 0===e&&(e={});var a=null!==(t=e.longitude)&&void 0!==t?t:this.camera.pose.longitude,s=null!==(r=e.latitude)&&void 0!==r?r:this.camera.pose.latitude,l=null!==(n=e.fov)&&void 0!==n?n:this.camera.pose.fov,u=null!==(i=e.distance)&&void 0!==i?i:this.camera.pose.distance,c=null!==(o=e.offset)&&void 0!==o?o:this.camera.pose.offset,h=this.camera.position.clone(),d=Ro(a,this.camera.pose.longitude,2*Math.PI)||Ro(s,this.camera.pose.latitude),p=Ro(l,this.camera.pose.fov),f=Ro(u,this.camera.pose.distance),v=Lo(c,this.camera.pose.offset);this.camera.setFromPose({longitude:a,latitude:s,fov:l,distance:u,offset:c});var A=Lo(h,this.camera.position);p&&this.emit("cameraFovUpdate",l,this.userAction),d&&this.emit("cameraDirectionUpdate",{longitude:a,latitude:s},this.userAction),A&&this.emit("cameraPositionUpdate",this.camera.position.clone(),this.userAction),(p||d||v||f)&&this.emit("cameraUpdate",{longitude:a,latitude:s,fov:l,offset:c,distance:u},this.userAction),this.needsRender=!0},t.prototype.onPanGesture=function(e){var t=this.panState,r=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:r,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===r){var n=e.pointers.map((function(e){return Yn(e,["x","y"])}));this.emit("wantsGesture","pan",n,e.isFinal)||this.emit("gesture","pan",n,e.isFinal)}},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return Yn(e,["x","y"])}));this.emit("wantsGesture","tap",t,!0)||this.emit("gesture","tap",t,!0)},t.prototype.onPressGesture=function(e,t){var r,n=[e];if(this.emit("wantsGesture","press",n,t))return null===(r=this.pressState)||void 0===r||r.stop(),void delete this.pressState;this.emit("gesture","press",n,t)},t.prototype.onPinchGesture=function(e){e.isFinal?delete this.pinchState:this.pinchState={x:e.center.x,y:e.center.y};var t=e.pointers.map((function(e){return Yn(e,["x","y"])}));this.emit("wantsGesture","pinch",t,e.isFinal)||this.emit("gesture","pinch",t,e.isFinal)},t.prototype.onMouseWheel=function(e){var t=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,r=[{x:e.clientX,y:e.clientY,delta:t}];this.emit("wantsGesture","mouseWheel",r,!1)||this.emit("gesture","mouseWheel",r,!1)},t.prototype.onMouseMove=function(e){},t.prototype.onMouseOut=function(){},t.prototype.relativeClientPosition=function(e){return Zo(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var t=this,r=function(e){var r=Zo(e,t.element,t.scissor);return!(Math.abs(r.x)>1||Math.abs(r.y)>1)},n=new Jo.Manager(e),i=function(e){return e.session.firstInput||null};n.add(new Jo.Pan({threshold:10,pointers:0})),n.add(new Jo.Tap({interval:410})),n.add(new Jo.Pinch({threshold:0,pointers:2})),n.on("panstart pan",(function(e){var o=i(n);o&&!r(o.center)||(t.onPanGesture(e),f())})),n.on("tap",(function(e){if("mouse"!==e.pointerType||0===e.srcEvent.button){var o=i(n);o&&!r(o.center)||(t.onTapGesture(e),f())}})),n.on("pinchstart pinch pinchend",(function(e){var o=i(n);o&&!r(o.center)||(t.onPinchGesture(e),f())}));var o=null,a=null,s=function(e,t,r){var n="pinchend"===e?t:t-r.deltaY/280;return{type:e,target:r.target,pointerType:"mouse",srcEvent:r,pointers:[{x:r.clientX,y:r.clientY}],isFirst:"pinchstart"===e,isFinal:"pinchend"===e,scale:Lr(n,.1,10),center:{x:r.clientX,y:r.clientY},velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0}},l=function(e){var n,i={x:e.clientX,y:e.clientY};if(r(i)){if(e.preventDefault(),e.ctrlKey){var l=null!==(n=null==o?void 0:o.prevInput.scale)&&void 0!==n?n:1,u=s(o?"pinch":"pinchstart",l,e);null===o?o={firstInput:u,prevInput:u}:o.prevInput=u,t.onPinchGesture(u),null!==a&&window.clearTimeout(a),a=window.setTimeout((function(){var r;a=null;var n=null!==(r=null==o?void 0:o.prevInput.scale)&&void 0!==r?r:1,i=s("pinchend",n,e);o=null,t.onPinchGesture(i)}),200)}else t.onMouseWheel(e);f()}},u=function(e){if(!qo()){var n={x:e.clientX,y:e.clientY};r(n)?(t.onMouseMove(e),t.pressState&&Math.abs(e.clientX-t.pressState.x)>10&&Math.abs(e.clientY-t.pressState.y)>10&&f()):t.onMouseOut()}},c=function(){t.onMouseOut(),f()},h=function(e,n){if(r(e)){t.pressState={x:e.x,y:e.y,time:t.pressState?t.pressState.time:n,stop:fe};var i=n-t.pressState.time;t.onPressGesture({x:e.x,y:e.y,delta:i},!1),t.pressState&&(t.pressState.stop=Ne.shared.add((function(t){return h({x:e.x,y:e.y},t)}),!0,1))}else f()},d=function(e){f(),e.touches.length>1||e.changedTouches.length<=0||h({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY},Ae())},p=function(e){f(),h({x:e.clientX,y:e.clientY},Ae())},f=function(){var e;if(t.pressState){var r=Ae()-t.pressState.time;t.onPressGesture({x:t.pressState.x,y:t.pressState.y,delta:r},!0),null===(e=t.pressState)||void 0===e||e.stop(),delete t.pressState}},v=null,A=function(e){var t,r="pinch",n=!1,i=!1;switch(e.type){case"gesturestart":r="pinchstart",n=!0;break;case"gestureend":r="pinchend",i=!0}return{type:r,target:e.target,pointerType:"mouse",srcEvent:e,pointers:[{x:e.clientX,y:e.clientY}],isFirst:n,isFinal:i,scale:null!==(t=e.scale)&&void 0!==t?t:1,center:{x:e.clientX,y:e.clientY},velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0}},m=function(e){if(e.preventDefault(),!qo()){var n=A(e),i=(v={firstInput:n}).firstInput;i&&!r(i.center)||t.onPinchGesture(n)}},g=function(e){if(e.preventDefault(),!qo()&&v){var n=A(e),i=v.firstInput;i&&!r(i.center)||t.onPinchGesture(n)}},y=function(e){if(e.preventDefault(),!qo()&&v){var n=A(e),i=v.firstInput;v=null,i&&!r(i.center)||t.onPinchGesture(n)}},b=function(t){if(t&&"function"==typeof t.preventDefault&&t.currentTarget===e&&t.preventDefault(),"function"==typeof getSelection){var r=getSelection();r&&r.focusNode&&(r.removeAllRanges&&r.removeAllRanges(),r.empty&&r.empty())}};e.addEventListener("wheel",l,{passive:!1}),e.addEventListener("mousemove",u,!1),e.addEventListener("mouseout",c,!1),e.addEventListener("touchstart",d,{passive:!0}),e.addEventListener("touchend",f,!1),e.addEventListener("touchcancel",f,!1),e.addEventListener("mousedown",p,!1),e.addEventListener("mouseup",f,!1),e.addEventListener("gesturestart",m,{passive:!1}),e.addEventListener("gesturechange",g,{passive:!1}),e.addEventListener("gestureend",y,{passive:!1}),e.addEventListener("touchstart",b,{passive:!1}),e.addEventListener("contextmenu",b,!1);return Object.assign((function(){n.destroy(),e.removeEventListener("wheel",l,!1),e.removeEventListener("mousemove",u,!1),e.removeEventListener("mouseout",c,!1),e.removeEventListener("touchstart",d,!1),e.removeEventListener("touchend",f,!1),e.removeEventListener("touchcancel",f,!1),e.removeEventListener("mousedown",p,!1),e.removeEventListener("mouseup",f,!1),e.removeEventListener("gesturestart",m,!1),e.removeEventListener("gesturechange",g,!1),e.removeEventListener("gestureend",y,!1),e.removeEventListener("touchstart",b,!1),e.removeEventListener("contextmenu",b,!1)}),{element:e})},t}(pe),la=function(e){function t(r){var n,i,o=this,a=t.parseArgs(r);return(o=e.call(this,a)||this).defaultLatitude=a.defaultLatitude,o.defaultFov=a.defaultFov,o.maxFov=a.maxFov,o.minFov=a.minFov,o.maxLatitude=a.maxLatitude,o.minLatitude=a.minLatitude,o.locationMotion=new fo({x:o.camera.pose.offset.x,y:o.camera.pose.offset.y,z:o.camera.pose.offset.z,distance:o.camera.pose.distance,modelAlpha:null!==(i=null===(n=o.model.getMaterial())||void 0===n?void 0:n.modelAlpha)&&void 0!==i?i:0,perspToOrtho:o.camera.perspToOrtho.x,orthoDistance:o.camera.orthoDistance}),o.currentTapPanoId=null,o.intersectMeshCreator=a.intersectMeshCreator,o.intersectMesh=o.intersectMeshCreator(),o.intersectMesh.name="intersect",o.intersectMesh.visible=!1,o.helper.add(o.intersectMesh),o}return ne(t,e),t.distanceFromModel=function(e,t,r){var n=e.bounding,i=Math.pow(Math.pow(n.max.x-n.min.x+1,2)+Math.pow(n.max.y-n.min.y+1,2)+Math.pow(n.max.z-n.min.z+1,2),.5),o=i/2/Math.tan(Math.PI*t/360);return r<1&&(o/=r),isNaN(o)?i:o},t.parseArgs=function(r){var n,i,o,a,s,l,u;if(r instanceof t)return r;var c=e.parseArgs.call(this,r);return ie(ie({},c),{defaultLatitude:null!==(n=r.defaultLatitude)&&void 0!==n?n:Math.PI/4,defaultFov:null!==(i=r.defaultFov)&&void 0!==i?i:80,maxFov:null!==(o=r.maxFov)&&void 0!==o?o:120,minFov:null!==(a=r.minFov)&&void 0!==a?a:20,maxLatitude:null!==(s=r.maxLatitude)&&void 0!==s?s:+Math.PI/2,minLatitude:null!==(l=r.minLatitude)&&void 0!==l?l:-Math.PI/2,intersectMeshCreator:null!==(u=r.intersectMeshCreator)&&void 0!==u?u:function(){return new Io}})},t.initAnimationEndPose=function(e){var r,i,o,a=this.parseArgs(e),s=e.initial,l=s.state,u=s.currentState;return{longitude:null!==(r=l.longitude)&&void 0!==r?r:u.longitude,latitude:Lr(null!==(i=l.latitude)&&void 0!==i?i:jo(u.mode)?u.latitude:a.defaultLatitude,a.minLatitude,a.maxLatitude),fov:null!==(o=l.fov)&&void 0!==o?o:a.defaultFov,offset:e.model.bounding.getCenter(new n.Vector3),distance:t.distanceFromModel(a.model,a.defaultFov,a.camera.aspect)}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.locationMotion.dispose(),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),delete this.mouseWheelState,delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return!1!==this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.updateWork=function(e,t,r,n){return this.works=e,this.updateCamera(t,null!=r?r:0,n),!0},t.prototype.updateModel=function(r){e.prototype.updateModel.call(this,r);var i=r.bounding.getCenter(new n.Vector3),o=t.distanceFromModel(r,this.defaultFov,this.camera.aspect);this.locationMotion.set({x:i.x,y:i.y,z:i.z,distance:o},0).catch(fe)},t.prototype.updateTime=function(e,t){if(!this.destroyed){var r={},i={};this.locationMotion.ended||(this.locationMotion.update(e),r.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Lr(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,i.distance=this.locationMotion.value.distance,i.offset=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),i.longitude=this.cameraMotion.value.longitude,i.latitude=this.cameraMotion.value.latitude,i.fov=this.cameraMotion.value.fov),Yo(r)||this.model.setMaterial(r),Yo(i)||this.setCamera(i)}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(Ae())[1],t=this.locationMotion.getKeyFrameSegment(Ae())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new n.Vector3(t.value.x,t.value.y,t.value.z),distance:t.value.distance}},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise((function(r){var n,i=e.initial,o=i.state,a=i.currentState,s=i.duration,l=i.userAction,u=t.initAnimationEndPose(e),c=null!==(n=o.panoId)&&void 0!==n?n:a.panoId,h=Yn(u,["longitude","latitude","fov"]),d={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance,modelAlpha:1,perspToOrtho:0,orthoDistance:u.distance};e.userAction=l,e.emit("initAnimationWillStart",c,u,e.userAction),e.cameraMotion.set(h,s).catch(fe),e.locationMotion.set(d,s).then((function(){e.emit("initAnimationEnded",c,u,e.userAction)}),(function(t){var r=Xo(e.camera.pose);e.emit("initAnimationEnded",c,r,e.userAction)})).then((function(){r()}))}))},t.prototype.updateRenderSize=function(){this.locationMotion.set({distance:t.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},0).catch(fe)},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this.model.intersectRaycaster(e)[0];if(!t)return null;var r=Wo(this.works.resolvedObservers,(function(e){return e.standingPosition.distanceTo(t.point)}),!0),n=r[0],i=r[1];return n&&i<10?n.panoId:null},t.prototype.coordinatesForOffset=function(e){var t=this.renderer.getSize(new n.Vector2);return{longitude:2*e.x/(t.x*this.scissor.width),latitude:2*e.y/(t.y*this.scissor.height)}},t.prototype.requestInteriaMovement=function(e,t){var r=this;if(!1!==this.interiaMovement){for(var n=ie({},e),i={longitude:0,latitude:0},o=0;o<t;o++)n.longitude*=.996,n.latitude*=.994008,i.longitude+=n.longitude,i.latitude+=n.latitude;var a=Qo(this.cameraMotion.value.longitude+i.longitude),s=Lr(this.cameraMotion.value.latitude+i.latitude,this.minLatitude,this.maxLatitude),l={longitude:a,latitude:s,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};this.cameraMotion.set({longitude:a,latitude:s},0).catch(fe);var u=n.longitude>1e-4||n.longitude<-1e-4||n.latitude>1e-4||n.latitude<-1e-4;this.emit("interiaPan",l,!u),u?Ne.shared.add((function(e,t){r.requestInteriaMovement(n,0|t)}),!0,1):this.interiaMovement=!1}},t.prototype.stopInteriaMovement=function(){this.interiaMovement=!1},t.prototype.onPanGesture=function(e){var t=this.panState,r=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:r,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===r){var n=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","pan",n,e.isFinal)){var i={x:e.center.x-t.x,y:e.center.y-t.y},o=this.relativeClientPosition(e.center),a=this.camera.pose.latitude<Math.PI/6||o.y<0?-1:1;i.x*=a;var s=this.coordinatesForOffset(i),l=Qo(this.cameraMotion.value.longitude+s.longitude),u=Lr(this.cameraMotion.value.latitude+s.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(u=this.cameraMotion.value.latitude);var c={longitude:l,latitude:u,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance};if(!this.emit("wantsPanGesture",c,e.isFinal))if(this.emit("gesture","pan",n,e.isFinal),this.emit("panGesture",c,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh(),this.cameraMotion.set({longitude:c.longitude,latitude:c.latitude},0).catch(fe),e.isFinal)if(!this.emit("wantsInteriaPan",c)){this.interiaMovement=!0;var h=e.velocityX*a,d=e.velocityY;this.requestInteriaMovement(this.coordinatesForOffset({x:h,y:d}),0)}}}},t.prototype.onPinchGesture=function(e){var t,r=null===(t=this.pinchState)||void 0===t?void 0:t.fov,n=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(n=!0,delete this.panState,delete this.pinchState),void 0!==r){var i=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",i,n)){var o=Lr(r/e.scale,this.minFov,this.maxFov);this.emit("wantsPinchGesture",e.scale,o,n)||this.emit("wantsChangeCameraFov",o)||(this.emit("gesture","pinch",i,n),this.emit("pinchGesture",e.scale,o,n),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:o},0).catch(fe),this.onPanGesture(e))}}}else this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov}},t.prototype.onMouseMove=function(e){var t,r;if(this.intersectMesh.parent&&!this.model.empty&&!this.panState){var i=this.relativeClientPosition({x:e.clientX,y:e.clientY}),o=new n.Raycaster;if(o.setFromCamera(i,this.camera),this.emit("wantsShowIntersectionOnModel",o))this.hideIntersectMesh();else{var a=this.model.intersectRaycaster(o)[0];if(a){var s=null!==(r=null===(t=a.face)||void 0===t?void 0:t.normal)&&void 0!==r?r:(new n.Vector3).copy(o.ray.direction).multiplyScalar(-1),l=s.clone().multiplyScalar(.05),u=a.point.clone().add(l);this.intersectMesh.position.copy(u);var c=u.clone().add(l);if(this.intersectMesh.lookAt(c),Math.abs(s.y)>.99){var h=this.camera.position.clone().sub(u);this.intersectMesh.rotation.z=-Math.atan2(h.z,h.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",a,this.intersectMesh)}else this.hideIntersectMesh()}}},t.prototype.onMouseOut=function(){this.intersectMesh.parent&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},t.prototype.onMouseWheel=function(e){var t=this,r=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,n=[{x:e.clientX,y:e.clientY,delta:r}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var i=this.minFov,o=this.maxFov,a=Lr(this.camera.fov-r,i,o);this.emit("wantsMouseWheel",r,a,!1)||this.emit("wantsChangeCameraFov",a)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",r,a,!1),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:a},0).catch(fe),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",r,a,!0)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,a,!0))}),200)})}},t.prototype.onTapGesture=function(e){var t=this,r=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","tap",r,!0)){var i=this.relativeClientPosition(e.center),o=new n.Raycaster;if(o.setFromCamera(i,this.camera),!this.emit("wantsTapGesture",o,i,!0)){this.emit("gesture","tap",r,!0),this.emit("tapGesture",o,i,!0),this.interiaMovement=!1;var a=this.getForwardPanoIndexOrNot(o);if(!So(a)){this.emit("panoSelected",a);var s={longitude:this.camera.pose.longitude,latitude:0};this.currentTapPanoId=a,this.preloadPano(a).then((function(e){t.currentTapPanoId===e&&t.emit("wantsMoveToPano",e,s,!0)}))}}}},t.prototype.onPressGesture=function(e,t){var r,i,o=[e];if(this.emit("wantsGesture","press",o,t))return null===(r=this.pressState)||void 0===r||r.stop(),void delete this.pressState;var a=this.relativeClientPosition(e),s=new n.Raycaster;if(s.setFromCamera(a,this.camera),this.emit("wantsPressGesture",s,a,e.delta,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;this.emit("gesture","press",o,t),this.emit("pressGesture",s,a,e.delta,t)},t.prototype.preloadPano=function(e,t){var r=this;void 0===t&&(t=fe);var n=this.works.getResolvedObserver(e);if(!n)return Promise.resolve();var i=this.works[0].allowHosts;return Promise.all(["right","left","up","down","front","back"].map((function(t){var o=ie({key:"pano.".concat(e,".").concat(t)},Yn(r.imageOptions,["size","format","quality","mappings"])),a=n.images[t];return De(r.imageOptions.transform?r.imageOptions.transform(a,o):_e(a,o),{allowHosts:i,requestProxy:r.requestProxy,networkSubscribe:r.networkSubscribe})}))).then((function(){return t(e),e}))},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.emit("intersectionHidden"),this.needsRender=!0},t}(sa),ua={longitude:0,latitude:Math.PI/2},ca={longitude:0,latitude:0},ha={longitude:Math.PI/2,latitude:0},da={longitude:Math.PI,latitude:0},pa={longitude:1.5*Math.PI,latitude:0};var fa,va=function(e){function t(r){var n=t.parseArgs(r);return e.call(this,n)||this}return ne(t,e),t.parseArgs=function(r){if(r instanceof t)return r;var n=ie(ie({},r.initial),{state:ie(ie({},r.initial.state),{longitude:0,latitude:Math.PI/2})}),i=ie(ie({},r),{initial:n,maxLatitude:Math.PI/2,minLatitude:Math.PI/2,defaultLongitude:0,defaultLatitude:Math.PI/2});return e.parseArgs.call(this,i)},t.initAnimationEndPose=function(t){var r=this.parseArgs(t);return e.initAnimationEndPose.call(this,r)},t.prototype.updateModel=function(e){this.model=e,this.needsRender=!0;var t=e.bounding.getCenter(new n.Vector3);this.locationMotion.set({x:t.x,y:t.y,z:t.z,distance:la.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},0).catch(fe)},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise((function(r){var n,i=e.initial,o=i.state,a=i.currentState,s=i.duration,l=i.userAction,u=t.initAnimationEndPose(e),c=null!==(n=o.panoId)&&void 0!==n?n:a.panoId,h=Yn(u,["longitude","latitude","fov"]),d={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance,modelAlpha:1,perspToOrtho:1,orthoDistance:u.distance};e.userAction=l,e.emit("initAnimationWillStart",c,u,e.userAction),e.cameraMotion.set(h,s).catch(fe),e.locationMotion.set(d,s).then((function(){e.emit("initAnimationEnded",c,u,e.userAction)}),(function(t){var r=Xo(e.camera.pose);e.emit("initAnimationEnded",c,r,e.userAction)})).then((function(){r()}))}))},t.prototype.getZoomOffsetFromFov=function(e,t,r){var i=this.camera.getDirection(new n.Vector3),o=Math.tan(r/2*Math.PI/180),a=Math.tan(t.fov/2*Math.PI/180),s=(a-o)/a,l=new n.Raycaster;l.setFromCamera(e,t);var u=l.ray.direction,c=u.angleTo(i),h=la.distanceFromModel(this.model,this.defaultFov,this.camera.aspect),d=h*Math.tan(c),p=u.clone().setLength(h*Math.cos(c)).projectOnPlane(i),f=p.length(),v=s/f*p.x*d,A=s/f*p.z*d,m=s/f*p.y*d;return new n.Vector3(v,m,A)},t.prototype.requestInteriaMovement=function(e,t){},t.prototype.onPanGesture=function(e){var t=this.panState,r=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:r,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===r){var i=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","pan",i,e.isFinal)){var o=e.center.x-t.x,a=e.center.y-t.y,s=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),l=this.model.bounding,u=l.getCenter(new n.Vector3),c=(l.max.x-l.min.x)/this.defaultFov*this.cameraMotion.value.fov,h=(l.max.y-l.min.y)/this.defaultFov*this.cameraMotion.value.fov,d=(l.max.z-l.min.z)/this.defaultFov*this.cameraMotion.value.fov,p={left:new n.Vector3,up:new n.Vector3,cameraDirection:"y"};this.cameraMotion.value.longitude===ua.longitude&&this.cameraMotion.value.latitude===ua.latitude?(p.left.set(1,0,0),p.up.set(0,0,-1),p.cameraDirection="y"):this.cameraMotion.value.longitude===ca.longitude&&this.cameraMotion.value.latitude===ca.latitude?(p.left.set(1,0,0),p.up.set(0,1,0),p.cameraDirection="z"):this.cameraMotion.value.longitude===da.longitude&&this.cameraMotion.value.latitude===da.latitude?(p.left.set(1,0,0),p.up.set(0,-1,0),p.cameraDirection="z"):this.cameraMotion.value.longitude===pa.longitude&&this.cameraMotion.value.latitude===pa.latitude?(p.left.set(0,0,-1),p.up.set(0,-1,0),p.cameraDirection="x"):this.cameraMotion.value.longitude===ha.longitude&&this.cameraMotion.value.latitude===ha.latitude&&(p.left.set(0,0,-1),p.up.set(0,1,0),p.cameraDirection="x");var f=(this.camera.position[p.cameraDirection]-l.min[p.cameraDirection])*Math.tan(this.camera.fov/2*Math.PI/180),v=this.renderer.getSize(new n.Vector2);s.add(function(e,t){var r=(new n.Vector3).copy(t);return r.multiplyScalar(-e),r}(2*o*f/v.y,p.left)),s.add(function(e,t){var r=(new n.Vector3).copy(t);return r.multiplyScalar(e),r}(2*a*f/v.y,p.up)),s.x=Lr(s.x,u.x-c,u.x+c),s.y=Lr(s.y,u.y-h,u.y+h),s.z=Lr(s.z,u.z-d,u.z+d);var A={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:s,distance:this.locationMotion.value.distance};this.emit("wantsPanGesture",A,e.isFinal)||(this.emit("gesture","pan",i,e.isFinal),this.emit("panGesture",A,e.isFinal),this.userAction=!0,this.locationMotion.set({x:s.x,y:s.y,z:s.z},0).catch(fe))}}},t.prototype.onPinchGesture=function(e){var t,r=null===(t=this.pinchState)||void 0===t?void 0:t.fov,n=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(n=!0,delete this.pinchState),void 0!==r){var i=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",i,n)){var o=Lr(r/e.scale,this.minFov,this.maxFov),a=this.relativeClientPosition({x:e.center.x,y:e.center.y}),s=this.getZoomOffsetFromFov(a,this.camera,o);this.cameraMotion.value.longitude===ua.longitude&&this.cameraMotion.value.latitude===ua.latitude?s.y=0:this.cameraMotion.value.longitude===ca.longitude&&this.cameraMotion.value.latitude===ca.latitude||this.cameraMotion.value.longitude===da.longitude&&this.cameraMotion.value.latitude===da.latitude?s.z=0:(this.cameraMotion.value.longitude===pa.longitude&&this.cameraMotion.value.latitude===pa.latitude||this.cameraMotion.value.longitude===ha.longitude&&this.cameraMotion.value.latitude===ha.latitude)&&(s.x=0);var l=this.camera.pose.offset.clone().add(s);this.emit("wantsPinchGesture",e.scale,o,n)||this.emit("wantsChangeCameraFov",o)||(this.emit("gesture","pinch",i,n),this.emit("pinchGesture",e.scale,o,n),this.userAction=!0,this.locationMotion.set({x:l.x,y:l.y,z:l.z},0).catch(fe),this.cameraMotion.set({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:o},0).catch(fe),this.onPanGesture(e))}}}else this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov}},t.prototype.onMouseWheel=function(e){var t=this,r=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,n=[{x:e.clientX,y:e.clientY,delta:r}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var i=Lr(this.cameraMotion.value.fov-r,this.minFov,this.maxFov),o=this.relativeClientPosition({x:e.clientX,y:e.clientY}),a=this.getZoomOffsetFromFov(o,this.camera,i);this.cameraMotion.value.longitude===ua.longitude&&this.cameraMotion.value.latitude===ua.latitude?a.y=0:this.cameraMotion.value.longitude===ca.longitude&&this.cameraMotion.value.latitude===ca.latitude||this.cameraMotion.value.longitude===da.longitude&&this.cameraMotion.value.latitude===da.latitude?a.z=0:(this.cameraMotion.value.longitude===pa.longitude&&this.cameraMotion.value.latitude===pa.latitude||this.cameraMotion.value.longitude===ha.longitude&&this.cameraMotion.value.latitude===ha.latitude)&&(a.x=0);var s=this.camera.pose.offset.clone().add(a);this.emit("wantsMouseWheel",r,i,!1)||this.emit("wantsChangeCameraFov",i)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",r,i,!1),this.userAction=!0,this.locationMotion.set({x:s.x,y:s.y,z:s.z},0).catch(fe),this.cameraMotion.set({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:i},0).catch(fe),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",r,i,!0)||t.emit("wantsChangeCameraFov",i)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,i,!0))}),200)})}},t}(la),Aa=function(e){function t(r){var n=this,i=t.parseArgs(r);return(n=e.call(this,i)||this).defaultLatitude=i.defaultLatitude,n.defaultFov=i.defaultFov,n.maxFov=i.maxFov,n.minFov=i.minFov,n.maxLatitude=i.maxLatitude,n.minLatitude=i.minLatitude,n.moveSpeed=i.moveSpeed,n.intersectMeshCreator=i.intersectMeshCreator,n.interiaMovement=!1,n.intersectMesh=n.intersectMeshCreator(),n.intersectMesh.name="intersect",n.intersectMesh.visible=!1,n.helper.add(n.intersectMesh),n}return ne(t,e),t.parseArgs=function(r){var n,i,o,a,s,l,u,c;if(r instanceof t)return r;var h=e.parseArgs.call(this,r);return ie(ie({},h),{defaultLatitude:null!==(n=r.defaultLatitude)&&void 0!==n?n:0,defaultFov:null!==(i=r.defaultFov)&&void 0!==i?i:90,maxFov:null!==(o=r.maxFov)&&void 0!==o?o:120,minFov:null!==(a=r.minFov)&&void 0!==a?a:40,maxLatitude:null!==(s=r.maxLatitude)&&void 0!==s?s:+Math.PI/2,minLatitude:null!==(l=r.minLatitude)&&void 0!==l?l:-Math.PI/2,moveSpeed:null!==(u=r.moveSpeed)&&void 0!==u?u:3.4,intersectMeshCreator:null!==(c=r.intersectMeshCreator)&&void 0!==c?c:function(){return new Io}})},t.initAnimationEndPose=function(e){var t,r,i,o,a=this.parseArgs(e),s=a.works,l=e.initial,u=l.state,c=l.currentState,h=null!==(t=u.panoId)&&void 0!==t?t:c.panoId,d=s.getResolvedObserver(h);return{longitude:null!==(r=u.longitude)&&void 0!==r?r:c.longitude,latitude:Lr(null!==(i=u.latitude)&&void 0!==i?i:Go(c.mode)?c.latitude:a.defaultLatitude,a.minLatitude,a.maxLatitude),fov:Lr(null!==(o=u.fov)&&void 0!==o?o:Go(c.mode)?c.fov:a.defaultFov,a.minFov,a.maxFov),offset:d?d.position.clone():new n.Vector3,distance:0}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.interiaMovement=!1,this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose()),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),delete this.mouseWheelState,delete this.mouseMoveState,delete this.panState},t.prototype.isReady=function(){return!this.interiaMovement&&(!this.panState&&(!this.pinchState&&(!this.mouseWheelState&&e.prototype.isReady.call(this))))},t.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 Lr(t,2,5)/this.moveSpeed*1e3}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.emit("intersectionHidden"),this.needsRender=!0},t.prototype.coordinatesForOffset=function(e){var t=this.cameraMotion.value.fov,r=this.camera.aspect,i=this.renderer.getSize(new n.Vector2);return{longitude:2*e.x/(i.x*this.scissor.width)*t/95*r,latitude:-2*e.y/(i.y*this.scissor.height)*t/95}},t.prototype.cameraBounce=function(){var e=this.cameraMotion.value,t=e.longitude,r=e.latitude,n=e.fov,i=[{progress:0,value:{longitude:t,latitude:r,fov:n}},{progress:.5,value:{longitude:t,latitude:r,fov:.98*n}},{progress:1,value:{longitude:t,latitude:r,fov:n}}];this.cameraMotion.setKeyframes(i,500).catch(fe)},t.prototype.requestInteriaMovement=function(e,t){var r=this;if(!1!==this.interiaMovement){for(var n=ie({},e),i={longitude:0,latitude:0},o=0;o<t;o++)n.longitude*=.996,n.latitude*=.98604,i.longitude+=n.longitude,i.latitude+=n.latitude;var a=Qo(this.cameraMotion.value.longitude+i.longitude),s=Lr(this.cameraMotion.value.latitude+i.latitude,this.minLatitude,this.maxLatitude),l={longitude:a,latitude:s,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};this.cameraMotion.set({longitude:a,latitude:s},0).catch(fe);var u=n.longitude>1e-4||n.longitude<-1e-4||n.latitude>1e-4||n.latitude<-1e-4;this.emit("interiaPan",l,!u),u?Ne.shared.add((function(e,t){r.requestInteriaMovement(n,0|t)}),!0,1):this.interiaMovement=!1}},t.prototype.stopInteriaMovement=function(){this.interiaMovement=!1},t.prototype.onPanGesture=function(e){var t=this.panState,r=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={pointerLength:r,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===r){var n=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","pan",n,e.isFinal)){var i={x:e.center.x-t.x,y:e.center.y-t.y},o=this.coordinatesForOffset(i),a=Qo(this.cameraMotion.value.longitude+o.longitude),s=Lr(this.cameraMotion.value.latitude+o.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(s=this.cameraMotion.value.latitude);var l={longitude:a,latitude:s,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};if(!this.emit("wantsPanGesture",l,e.isFinal)){this.emit("gesture","pan",n,e.isFinal),this.emit("panGesture",l,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh();var u={longitude:l.longitude,latitude:l.latitude,fov:l.fov};if(this.cameraMotion.set(u,0).catch(fe),e.isFinal)if(!this.emit("wantsInteriaPan",l)){this.interiaMovement=!0;var c=e.velocityX,h=.6*e.velocityY;Math.abs(h)>.5&&Math.abs(c)<.5&&(c=0),this.requestInteriaMovement(this.coordinatesForOffset({x:c,y:h}),0)}}}}},t.prototype.onPinchGesture=function(e){var t,r=null===(t=this.pinchState)||void 0===t?void 0:t.fov,n=e.scale,i=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(i=!0,delete this.pinchState),void 0!==r){var o=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",o,i)){var a=Lr(r/n,this.minFov,this.maxFov);this.emit("wantsPinchGesture",n,a,i)||this.emit("wantsChangeCameraFov",a)||(this.emit("gesture","pinch",o,i),this.emit("pinchGesture",n,a,i),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:a},0).catch(fe),this.onPanGesture(e))}}}else this.pinchState={x:e.center.x,y:e.center.y,fov:this.cameraMotion.value.fov}},t.prototype.onMouseWheel=function(e){var t=this,r=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,n=[{x:e.clientX,y:e.clientY,delta:r}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var i=Lr(this.cameraMotion.value.fov-r,this.minFov,this.maxFov);this.emit("wantsMouseWheel",r,i,!1)||this.emit("wantsChangeCameraFov",i)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",r,i,!1),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:i},0).catch(fe),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",n,!0)||t.emit("wantsMouseWheel",r,i,!0)||t.emit("wantsChangeCameraFov",i)||(t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,i,!0))}),200)})}},t.prototype.onMouseMove=function(e){var t,r;if(this.intersectMesh.parent&&!this.model.empty&&!this.panState){var i=this.relativeClientPosition({x:e.clientX,y:e.clientY}),o=new n.Raycaster;if(o.setFromCamera(i,this.camera),this.emit("wantsShowIntersectionOnModel",o))this.hideIntersectMesh();else{var a=this.model.intersectRaycaster(o)[0];if(a){var s=null!==(r=null===(t=a.face)||void 0===t?void 0:t.normal)&&void 0!==r?r:(new n.Vector3).copy(o.ray.direction).multiplyScalar(-1),l=s.clone().multiplyScalar(.05),u=a.point.clone().add(l);this.intersectMesh.position.copy(u);var c=u.clone().add(l);if(this.intersectMesh.lookAt(c),Math.abs(s.y)>.99){var h=this.camera.position.clone().sub(u);this.intersectMesh.rotation.z=-Math.atan2(h.z,h.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",a,this.intersectMesh)}else this.hideIntersectMesh();this.mouseMoveState={clientX:e.clientX,clientY:e.clientY}}}},t.prototype.onMouseOut=function(){this.intersectMesh.parent&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},t.prototype.onPressGesture=function(e,t){var r,i,o=[e];if(this.emit("wantsGesture","press",o,t))return null===(r=this.pressState)||void 0===r||r.stop(),void delete this.pressState;var a=this.relativeClientPosition(e),s=new n.Raycaster;if(s.setFromCamera(a,this.camera),this.emit("wantsPressGesture",s,a,e.delta,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;this.emit("gesture","press",o,t),this.emit("pressGesture",s,a,e.delta,t)},t}(sa);function ma(){return fa||(fa=new Promise((function(e){var t,r=document.createElement("video");r.muted=!0,r.src="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPT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3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",r.addEventListener("timeupdate",(function n(){r.removeEventListener("timeupdate",n,!1),clearTimeout(t);var i=document.createElement("canvas");i.width=i.height=1;var o=i.getContext("2d");o?(o.drawImage(r,0,0,1,1),o.getImageData(0,0,1,1).data[3]>10?e(!0):e(!1)):e(!1)}),!1),r.addEventListener("canplay",(function e(){r.removeEventListener("canplay",e,!1),r.play()}),!1),t=window.setTimeout((function(){return e(!1)}),1e3)})))}var ga,ya=function(e){function t(t,r){return void 0===r&&(r=.5),e.call(this,t,{uniforms:{inputBuffer:new n.Uniform(null),scale:new n.Uniform(r)},fragment:"\n#include <common>\nuniform sampler2D inputBuffer;\nuniform float scale;\nvarying vec2 vUv;\n\nvoid main() {\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 = clamp(linearToRelativeLuminance(rgb), 0.1, 0.9);\n gl_FragColor = vec4(luminance);\n}\n"})||this}return ne(t,e),t}(na),ba=function(e){function t(t,r){void 0===r&&(r=.002);var i=e.call(this,t,{uniforms:{targetBuffer:new n.Uniform(null),inputBuffer:new n.Uniform(null),step:new n.Uniform(r)},fragment:"\n uniform sampler2D targetBuffer;\n uniform sampler2D inputBuffer;\n uniform float step;\n varying vec2 vUv;\n void main() {\n\n #ifdef GL_EXT_shader_texture_lod\n #if __VERSION__ < 300\n float target = texture2DLodEXT(targetBuffer, vUv, 5.0).r;\n #else\n float target = textureLod(targetBuffer, vUv, 5.0).r;\n #endif\n #else\n float target = texture2D(targetBuffer, vUv).r;\n #endif\n float current = texture2D(inputBuffer, vUv).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 i.material.extensions.shaderTextureLOD=!0,i}return ne(t,e),Object.defineProperty(t.prototype,"targetBuffer",{get:function(){return this.material.uniforms.targetBuffer.value},set:function(e){this.material.uniforms.targetBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"step",{get:function(){return this.material.uniforms.step.value},set:function(e){this.material.uniforms.step.value=e},enumerable:!1,configurable:!0}),t}(na),xa=function(e){function t(t){var r=e.call(this,t,{uniforms:{inputBuffer:new n.Uniform(null),luminanceAdaptiveBuffer:new n.Uniform(null),progress:new n.Uniform(0)},fragment:"\n #include <common>\n uniform sampler2D inputBuffer;\n uniform sampler2D luminanceAdaptiveBuffer;\n uniform float progress;\n varying vec2 vUv;\n\n void main() {\n float middleGrey = 1.5;\n float whitePoint = 13.0;\n float exposure = 1.4;\n vec4 inputColor = texture2D(inputBuffer, vUv);\n vec3 rgb = inputColor.rgb * exposure;\n float alpha = inputColor.a;\n float luminance = linearToRelativeLuminance(rgb);\n float lumAvg = texture2D(luminanceAdaptiveBuffer, vec2(0.5)).r;\n float lumScaled = (luminance * middleGrey) / max(lumAvg, 1e-6);\n float lumCompressed = lumScaled * (1.0 + lumScaled / (whitePoint * whitePoint));\n lumCompressed /= (1.0 + lumScaled);\n rgb = clamp(lumCompressed * rgb, 0.0, 1.0);\n gl_FragColor = mix(inputColor, vec4(rgb, alpha), progress * 0.9);\n }\n "})||this;return r.material.transparent=!0,r}return ne(t,e),Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t}(na),wa=function(e){function t(t){var r=e.call(this,t)||this;return r.enableTime=Ae(),r.renderer=t,r.valuePass=new ia(r.renderer),r.luminancePass=new ya(r.renderer,Math.sqrt(1/3)),r.nextStepPass=new ba(r.renderer,.01),r.luminanceAdaptivePass=new xa(r.renderer),r}return ne(t,e),t.prototype.render=function(e,t){if(!this.enable)return this.enableTime=null,void this.copyPass.render(e,t);null===this.enableTime&&(this.enableTime=Ae()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new n.WebGLRenderTarget(128,128,{minFilter:n.LinearMipmapLinearFilter,magFilter:n.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:n.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e,this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new n.WebGLRenderTarget(1,1,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,type:n.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new n.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new n.WebGLRenderTarget(1,1,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,type:n.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new n.Vector3(.5,.5,.5),this.luminanceNextBuffer),this.luminanceAdaptivePass.luminanceAdaptiveBuffer=this.luminanceNextBuffer.texture),this.copyPass.render(this.luminanceNextBuffer,this.luminancePrevBuffer),this.nextStepPass.render(this.luminancePrevBuffer,this.luminanceNextBuffer),this.luminanceAdaptivePass.progress=Math.min((Ae()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e,t)},t.prototype.dispose=function(){var e,t,r;null===(e=this.luminanceTargetBuffer)||void 0===e||e.dispose(),null===(t=this.luminancePrevBuffer)||void 0===t||t.dispose(),null===(r=this.luminanceNextBuffer)||void 0===r||r.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t}(aa),Ma=512,Ea=null!==(ga=Math.SQRT1_2)&&void 0!==ga?ga:Math.sqrt(2),Ca={up:new n.Quaternion(Ea,0,0,Ea),down:new n.Quaternion(-Ea,0,0,Ea),left:new n.Quaternion(0,Ea,0,Ea),right:new n.Quaternion(0,-Ea,0,Ea),front:new n.Quaternion(0,0,0,1),back:new n.Quaternion(0,1,0,0)},Ia=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Sa=new Float32Array([0,0,1,0,0,1,1,1]),Pa=new Uint8Array([0,1,2,1,3,2]),Ta=new n.BufferGeometry;Ta.setAttribute("position",new n.BufferAttribute(Ia,3)),Ta.setAttribute("uv",new n.BufferAttribute(Sa,2)),Ta.setIndex(new n.BufferAttribute(Pa,1));var Ba=function(e){function t(){var t=e.call(this,{uniforms:{map:{value:null},luminanceMap:{value:null},flipY:{value:0}},vertexShader:"\nuniform float flipY;\nvarying vec2 vUv;\nvoid main() {\n vUv = vec2(uv.x, mix(uv.y, (1.0 - uv.y), flipY));\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\n#if defined(USE_LUMINANCE)\nuniform sampler2D luminanceMap;\n#endif\nuniform sampler2D map;\nvarying vec2 vUv;\n\nvoid main() {\n gl_FragColor = texture2D(map, vUv);\n #if defined(USE_LUMINANCE)\n gl_FragColor.a = 1.0 - texture2D(luminanceMap, vUv).r;\n #endif\n}\n"})||this;return t.depthTest=!1,t.depthWrite=!1,t.blending=n.NoBlending,t.map=t.uniforms.map.value,t.luminanceMap=t.uniforms.luminanceMap.value,t.flipY=t.uniforms.flipY.value,Object.defineProperties(t,{map:{get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},luminanceMap:{get:function(){return this.uniforms.luminanceMap.value},set:function(e){this.uniforms.luminanceMap.value=e,this.defines.USE_LUMINANCE=null!==e,this.needsUpdate=!0}},flipY:{get:function(){return 1===this.uniforms.flipY.value},set:function(e){this.uniforms.flipY.value=e?1:0}}}),t}return ne(t,e),t}(n.ShaderMaterial),Ra=function(e){function t(t,r){var i=e.call(this,Ta,new Ba)||this;return t.box.getCenter(i.position),i.quaternion.multiplyQuaternions((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0),-Math.PI),Ca[t.face]),i.scale.setScalar(t.size),i.node=t,i.name="tiling:tile",i.material.visible=!1,i.activeTime=-1,i.disposed=!1,i.needsRender=!1,i.frustumCulled=!1,r.then((function(e){var t=e[0],r=e[1];i.disposed?(t.dispose(),null==r||r.dispose()):(i.material.map=t,i.material.luminanceMap=r,i.material.flipY=!t.flipY,i.material.needsUpdate=!0,i.material.visible=!0,i.needsRender=!0)})).catch(fe),i}return ne(t,e),t.prototype.updateTime=function(e){},t.prototype.dispose=function(){var e;this.disposed=!0,this.material.map&&(this.material.map.dispose(),null===(e=this.material.luminanceMap)||void 0===e||e.dispose()),this.material.dispose()},t}(n.Mesh),Oa=function(e){function t(){var t=e.call(this)||this;return t.needsRender=!1,t.name="tiling",t}return ne(t,e),t}(n.Group),La=function(){function e(e,t,r){this.disposed=!1,this.textureLoader=new Ot,this.minLevel=t,this.level=0,this.panoId="",this.pedding=0,this.tileTree=lt(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=r,this.networkOptions=e,this.object=new Oa,this.object.renderOrder=-3}return e.prototype.setAllowHosts=function(e){this.networkOptions.allowHosts=e},e.prototype.setRequestProxy=function(e){this.networkOptions.requestProxy=e},e.prototype.setNetworkSubscribe=function(e){this.networkOptions.networkSubscribe=e},e.prototype.cleanup=function(){var e=this;this.tileMeshes.forEach((function(t){t.dispose(),e.object.remove(t),e.object.needsRender=!0})),this.tileMeshes.clear()},e.prototype.setRotation=function(e){this.disposed||this.object.quaternion.equals(e)||(this.object.quaternion.copy(e),this.object.needsRender=!0)},e.prototype.setPosition=function(e){this.disposed||this.object.position.equals(e)||(this.object.position.copy(e),this.object.needsRender=!0)},e.prototype.setResource=function(e,t){var r,n;if(!this.disposed&&(this.resource!==e||this.luminance!==t)){this.cleanup(),this.resource=e;var i=null!==(n=null===(r=e.slice().sort((function(e,t){return t.level-e.level}))[0])||void 0===r?void 0:r.level)&&void 0!==n?n:0;this.tileTree=lt(i),this.luminance=t,this.object.needsRender=!0}},e.prototype.update=function(e,t,r){var i=this;if(!this.disposed){this.level=t;var o=e.planes[5].normal,a=[];t>=this.minLevel&&ut(this.tileTree,(function(r){if(!(r.level<i.minLevel))return!(r.level>t)&&(!!e.intersectsBox(r.box)&&void a.push(r))}));var s=new n.Vector3;a.sort((function(e,t){return e.level!==t.level?e.level-t.level:e.box.getCenter(s).angleTo(o)-t.box.getCenter(s).angleTo(o)}));for(var l=new Set,u=function(e){var t=c.resource.filter((function(t){return t.level===e.level}))[0];if(!t)return"continue";if(l.add(e),c.tileMeshes.has(e))return c.tileMeshes.get(e).activeTime=r,"continue";var n=t.size,o=c.imageOptions.transform,a=Math.pow(2,e.level)*e.position.y,s=Math.pow(2,e.level)*e.position.x,u="".concat(c.panoId,".").concat(e.face,".").concat(e.level,".").concat(a,".").concat(s),h=ie(ie({key:"pano_tile.".concat(u)},Yn(c.imageOptions,["format","size","quality","sharpen","mappings"])),{size:n*e.size===Ma?void 0:Ma,cut:[n*e.position.x,n*e.position.y,n*e.size,n*e.size]}),d=c.textureLoader.loadTexture(t[e.face],{imageURL:{transform:o,options:h},allowHosts:c.networkOptions.allowHosts,networkSubscribe:c.networkOptions.networkSubscribe,requestProxy:c.networkOptions.requestProxy,viaAjax:Ct}).then((function(e){return e.body})),p=null;if(c.luminance){var f=c.luminance[e.face],v=f.match(/\/cube_(\d+)\//),A=!!v&&Number(v[1]);if(!1!==A){var m=ie(ie({},h),{size:A*e.size==256?void 0:256,cut:[A*e.position.x,A*e.position.y,A*e.size,A*e.size],key:"pano_tile_luminance.".concat(u)});p=c.textureLoader.loadTexture(f,{imageURL:{transform:c.imageOptions.transform,options:m},allowHosts:c.networkOptions.allowHosts,networkSubscribe:c.networkOptions.networkSubscribe,requestProxy:c.networkOptions.requestProxy,viaAjax:Ct}).then((function(e){return e.body})).catch((function(){return null}))}}c.pedding++;var g=Promise.all([d,p]).then((function(e){return i.pedding--,e}),(function(e){return i.pedding--,Promise.reject(e)})),y=new Ra(e,g);y.name="tiling:tile-".concat(u),y.activeTime=r,y.renderOrder=e.level,c.tileMeshes.set(e,y),c.object.needsRender=!0,c.object.add(y)},c=this,h=0,d=a;h<d.length;h++){u(m=d[h])}var p=[];this.tileMeshes.forEach((function(e,r){l.has(r)||p.push(r),e.visible=r.level<=t}));for(var f=p.sort((function(e,t){var r,n,o,a;return(null!==(n=null===(r=i.tileMeshes.get(t))||void 0===r?void 0:r.activeTime)&&void 0!==n?n:0)-(null!==(a=null===(o=i.tileMeshes.get(e))||void 0===o?void 0:o.activeTime)&&void 0!==a?a:0)})).slice(Math.max(0,32-l.size)),v=0,A=f;v<A.length;v++){var m=A[v],g=this.tileMeshes.get(m);g&&(g.dispose(),this.object.remove(g),this.object.needsRender=!0),this.tileMeshes.delete(m)}}},e.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},e}(),Da=new Float32Array([-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,-1,-1,1,-1,-1]),Fa=new Uint8Array([0,2,1,2,3,1,4,6,5,6,7,5,8,10,9,10,11,9,12,14,13,14,15,13,16,18,17,18,19,17,20,22,21,22,23,21]),ka=new n.BufferGeometry;ka.setAttribute("position",new n.BufferAttribute(Da,3)),ka.setIndex(new n.BufferAttribute(Fa,1));var Qa=function(){function e(){this.material=new n.ShaderMaterial({vertexShader:"\n#if defined(USE_PANO_VIDEO)\nvarying vec3 worldPosition;\n#endif\nvoid main() {\n vec4 transformed = vec4(position, 1.0);\n #if defined(USE_PANO_VIDEO)\n worldPosition = (modelMatrix * transformed).xyz;\n #endif\n gl_Position = projectionMatrix * modelViewMatrix * transformed;\n}\n",fragmentShader:"\nuniform vec2 size;\nuniform mat4 matrix;\nuniform float alpha;\nuniform sampler2D map;\n#if defined(USE_PANO_VIDEO)\nvarying vec3 worldPosition;\n#endif\n#include <common>\nvoid main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n #if defined(USE_PANO_VIDEO)\n vec3 cameraToVertex = worldPosition - cameraPosition;\n vec4 mapCoods = vec4(cameraToVertex, 1.0) * matrix;\n vec2 uv = vec2(\n 0.5 + mapCoods.x / mapCoods.z / size.x,\n 0.5 - mapCoods.y / mapCoods.z / size.y\n );\n vec4 videoColor = texture2D(map, uv);\n float match = (1.0 - step(0.0, mapCoods.z)) * (1.0 - step(0.5, abs(uv.x - 0.5))) * (1.0 - step(0.5, abs(uv.y - 0.5)));\n float blendAlpha = clamp(0.0, 1.0, 5.0 * (1.0 - clamp(distance(uv, vec2(0.5, 0.5)) / 0.55 , 0.0, 1.0)));\n gl_FragColor = vec4(videoColor.rgb, match * blendAlpha * alpha);\n #endif\n}\n",uniforms:{size:new n.Uniform(null),matrix:new n.Uniform(null),alpha:new n.Uniform(null),map:new n.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:n.CustomBlending,blendSrc:n.SrcAlphaFactor,blendDst:n.OneMinusSrcAlphaFactor,blendSrcAlpha:n.OneFactor,blendDstAlpha:n.OneMinusSrcAlphaFactor}),this.object=new n.Mesh(ka,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new fo({alpha:0})}return e.prototype.setMaterial=function(e){e?(this.material.uniforms.size.value=e.size,this.material.uniforms.matrix.value=e.matrix,this.material.uniforms.map.value=e.map,this.alphaMotion.set({alpha:e.alpha},500).catch(fe),this.material.uniforms.alpha.value=e.alpha):(this.material.uniforms.size.value=null,this.material.uniforms.matrix.value=null,this.material.uniforms.map.value=null,this.alphaMotion.set({alpha:0},0).catch(fe));var t=null!==e;t!==this.material.defines.USE_PANO_VIDEO&&(this.material.defines.USE_PANO_VIDEO=t,this.material.needsUpdate=!0,this.object.visible=null!==e)},e.prototype.updateTime=function(e){this.alphaMotion.ended||(this.alphaMotion.update(e),this.material.uniforms.alpha.value=this.alphaMotion.value.alpha)},e.prototype.dispose=function(){this.material.dispose()},e}(),Na=(new n.Matrix4).makeRotationAxis(new n.Vector3(0,1,0),Math.PI),Va=new n.Vector3(-1,1,1),Ua=function(){function e(e){void 0===e&&(e=0),this.width=e,this.pool=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.pool.length},enumerable:!1,configurable:!0}),e.prototype.create=function(){return new n.WebGLCubeRenderTarget(this.width,{stencilBuffer:!1,depthBuffer:!1})},e.prototype.pop=function(){var e=this.pool.pop();return e||this.create()},e.prototype.push=function(e){-1===this.pool.indexOf(e)&&this.pool.push(e)},e.prototype.clear=function(){for(var e=0,t=this.pool;e<t.length;e++){t[e].dispose()}this.pool.length=0},e}(),za=function(e){function t(r){var n,i,o,a,s,l=this,u=t.parseArgs(r);(l=e.call(this,u)||this).TILED_CUBE_TEXTURE_LEVEL=2;var c=u.initial,h=c.state,d=c.currentState;l.tileLevel=0,l.initAnimationed=!1,l.currentPanoId=null!==(n=h.panoId)&&void 0!==n?n:d.panoId,l.maxAccessibleDistance=u.maxAccessibleDistance,l.panoTapTriggerRadius=u.panoTapTriggerRadius,l.panoCircleMeshCreator=u.panoCircleMeshCreator,l.tileLevelForFov=u.tileLevelForFov,l.luminanceAdaptiveEffectEnable=u.luminanceAdaptiveEffectEnable,l.colorCubeRenderTargetPool=new Ua,l.luminanceCubeRenderTargetPool=new Ua;var p=l.model.getMaterial()||{},f=p.pano0,v=p.pano1;f&&(null==v?void 0:v.map)!==f.map&&(l.model.setMaterial({pano0:v}),f.map.dispose(),f.map instanceof Rt&&f.map.cubeRenderTarget&&l.colorCubeRenderTargetPool.push(f.map.cubeRenderTarget),f.luminanceMap&&(f.luminanceMap.dispose(),f.luminanceMap instanceof Rt&&f.luminanceMap.cubeRenderTarget&&l.luminanceCubeRenderTargetPool.push(f.luminanceMap.cubeRenderTarget)));for(var A=l.colorCubeRenderTargetPool.size;A<2;A++){var m=Math.max(1024*l.TILED_CUBE_TEXTURE_LEVEL,512),g=l.colorCubeRenderTargetPool.create();g.setSize(m,m),vt(null,g,l.renderer),l.colorCubeRenderTargetPool.push(g)}l.panoMeshes={},l.updatePanoMeshes(),l.locationMotion=new fo({count:0,distance:l.camera.pose.distance,modelAlpha:null!==(o=null===(i=l.model.getMaterial())||void 0===i?void 0:i.modelAlpha)&&void 0!==o?o:0,perspToOrtho:l.camera.perspToOrtho.x,orthoDistance:l.camera.orthoDistance}),l.panoResources={},l.panoResources[l.locationMotion.keyframes[0].key=l.locationMotion.keyframes[1].key=To()]={panoId:l.currentPanoId,panoPicture:null!==(s=null===(a=l.model.getMaterial())||void 0===a?void 0:a.pano1)&&void 0!==s?s:null,position:l.camera.pose.offset.clone(),effect:"fly"};var y={allowHosts:l.works[0].allowHosts,requestProxy:l.requestProxy,networkSubscribe:l.networkSubscribe};return l.textureLoader=new Ot,l.tiling=new La(y,l.TILED_CUBE_TEXTURE_LEVEL+1,l.imageOptions),l.scene.add(l.tiling.object),l.panoVideo=new Qa,l.scene.add(l.panoVideo.object),l}return ne(t,e),t.parseArgs=function(r){var n,i,o,a,s;if(r instanceof t)return r;var l=e.parseArgs.call(this,r);return ie(ie({},l),{maxAccessibleDistance:null!==(n=r.maxAccessibleDistance)&&void 0!==n?n:5,panoTapTriggerRadius:null!==(i=r.panoTapTriggerRadius)&&void 0!==i?i:.5,panoCircleMeshCreator:null!==(o=r.panoCircleMeshCreator)&&void 0!==o?o:function(e){return new mo},tileLevelForFov:null!==(a=r.tileLevelForFov)&&void 0!==a?a:function(e,t){var r=2*Math.atan(Math.tan(e/180*Math.PI/2)*(t.width/t.height))/Math.PI*180,n=Math.max(t.width/r,t.height/e);return n>60?4:n>30?3:n>18?2:n>12?1:0},luminanceAdaptiveEffectEnable:null===(s=r.luminanceAdaptiveEffectEnable)||void 0===s||s})},t.initAnimationEndPose=function(t){var r=this.parseArgs(t);return e.initAnimationEndPose.call(this,r)},t.prototype.destroy=function(){var t,r;if(e.prototype.destroy.call(this),this.scene.remove(this.tiling.object),this.tiling.dispose(),this.locationMotion.dispose(),this.colorCubeRenderTargetPool.clear(),this.luminanceCubeRenderTargetPool.clear(),delete this.pendingTextureTask,this.panoMeshes)for(var n=0,i=Object.keys(this.panoMeshes);n<i.length;n++){var o=i[n],a=this.panoMeshes[o];this.helper.remove(a),a.dispose(),delete this.panoMeshes[o]}this.interiaMovement=!1;var s=this.videoTexture.image;s.pause(),s.oncanplay=function(){},s.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var l=null!==(t=this.model.getMaterial())&&void 0!==t?t:{},u=l.pano0,c=l.pano1,h=0,d=Object.keys(this.panoResources);h<d.length;h++){var p=d[h],f=this.panoResources[p];if(f.panoPicture){var v=f.panoPicture.map;v&&v!==(null==u?void 0:u.map)&&v!==(null==c?void 0:c.map)&&(v.dispose(),null===(r=f.panoPicture.luminanceMap)||void 0===r||r.dispose(),f.panoPicture=null)}delete this.panoResources[p]}this.luminanceAdaptiveEffect&&(this.luminanceAdaptiveEffect.dispose(),delete this.luminanceAdaptiveEffect)},t.prototype.isReady=function(){return!0===this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e,t,r,n=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),i=(null===(e=n.panoPicture)||void 0===e?void 0:e.map)instanceof Rt&&null!==(r=null===(t=n.panoPicture)||void 0===t?void 0:t.map.tilePending)&&void 0!==r?r:0,o=this.tiling.pedding;return this.initAnimationed&&i<=0&&o<=0},t.prototype.updateWork=function(e,t,r,n){var i,o=this;return this.userAction=n,this.works=e,this.currentPanoId=null!==(i=t.panoId)&&void 0!==i?i:this.currentPanoId,this.tiling.setAllowHosts(this.works[0].allowHosts),this.tiling.cleanup(),this.initAnimationed=!1,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(this.currentPanoId,{effect:"fade",duration:r,longitude:t.longitude,latitude:t.latitude,fov:t.fov,moveEndCallback:function(){o.initAnimationed=!0},moveCancelCallback:function(){o.initAnimationed=!0}},n),!0},t.prototype.updateModel=function(e){this.model=e,this.updatePanoMeshes()},t.prototype.updateTime=function(e,t){var r,i,o,a,s,l,u,c,h,d,p=this;if(!this.destroyed){var f={},v={},A=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),g=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var y=this.locationMotion.getKeyFrameSegment(e),b=y[0],x=y[1],w=this.panoResourceFromLocationMotionKeyframe(b),M=this.panoResourceFromLocationMotionKeyframe(x),E=(new n.Vector3).copy(w.position),C=(new n.Vector3).copy(M.position),I=this.locationMotion.value.count-x.value.count+1;f.progress=I,f.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Lr(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,M.panoPicture&&(I<1?w.panoPicture&&(f.pano0=w.panoPicture):f.pano0=M.panoPicture,f.pano1=M.panoPicture),g=f.useBlackTransition="instant"===M.effect||"montage"===M.effect,"fade"!==M.effect&&"montage"!==M.effect||(f.pano0&&w.panoPicture&&(f.pano0={map:f.pano0.map,luminanceMap:f.pano0.luminanceMap,matrix:w.panoPicture.matrix.clone().setPosition(M.position)}),E.copy(C)),v.distance=this.locationMotion.value.distance,v.offset=new n.Vector3(E.x+(C.x-E.x)*I,E.y+(C.y-E.y)*I,E.z+(C.z-E.z)*I);for(var S=[],P=[],T=0,B=this.locationMotion.keyframes;T<B.length;T++){var R=B[T],O=R.key,L=R.progress;void 0!==O&&(S.push(O),L>=this.locationMotion.progress&&P.push(O))}for(var D=0,F=Object.keys(this.panoResources);D<F.length;D++){var k=F[D];if(!(P.indexOf(k)>=0)){var Q=this.panoResources[k];if(Q.panoPicture){var N=Q.panoPicture.map,V=Q.panoPicture.luminanceMap;if(N){if(N===(null===(r=f.pano0)||void 0===r?void 0:r.map))continue;if(N===(null===(i=f.pano1)||void 0===i?void 0:i.map))continue;N instanceof Rt&&N.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(N.cubeRenderTarget),N.dispose(),V&&(V instanceof Rt&&V.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(V.cubeRenderTarget),V.dispose()),Q.panoPicture=null}}S.indexOf(k)>=0||delete this.panoResources[k]}}this.currentPanoId=M.panoId,this.emit("movingToPano",m.panoId,A.panoId,this.locationMotion.progress)}!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),v.longitude=this.cameraMotion.value.longitude,v.latitude=this.cameraMotion.value.latitude,v.fov=this.cameraMotion.value.fov);var U=this.works.getResolvedObserver(this.currentPanoId);!1===Yo(f)&&((null===(o=f.pano0)||void 0===o?void 0:o.map)&&f.pano0.map instanceof Rt&&!f.pano0.map.cubeRenderTarget&&(f.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(a=f.pano0)||void 0===a?void 0:a.luminanceMap)&&f.pano0.luminanceMap instanceof Rt&&!f.pano0.luminanceMap.cubeRenderTarget&&(f.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),(null===(s=f.pano1)||void 0===s?void 0:s.map)&&f.pano1.map instanceof Rt&&!f.pano1.map.cubeRenderTarget&&(f.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(l=f.pano1)||void 0===l?void 0:l.luminanceMap)&&f.pano1.luminanceMap instanceof Rt&&!f.pano1.luminanceMap.cubeRenderTarget&&(f.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.model.setMaterial(f)),!1===Yo(v)&&this.setCamera(v);var z=this.locationMotion.ended?this.getForwardPanoIndexOrNot():null;if(this.camera.pose.distance>.1||g){if(U)for(var q=0,H=Object.keys(this.panoMeshes);q<H.length;q++){var _=H[q];(X=this.panoMeshes[_]).setOpacity(0),X.setCurrent(!1),X.updateTime&&X.updateTime(e,t)}}else if(U){var j=Wo(U.visibleIds,(function(e){var t=p.works.getResolvedObserver(e);return t?U.standingPosition.distanceTo(t.standingPosition):1/0}),!0)[1];j=Lr(j,2.5,1/0);for(var G=U.visibleIds.concat(this.currentPanoId),K=this.camera.getDirection(new n.Vector3),W=0,Y=Object.keys(this.panoMeshes);W<Y.length;W++){_=Y[W];var X=this.panoMeshes[_],J=this.works.getResolvedObserver(_);if(-1===G.indexOf(_))X.setCurrent(!1),X.setOpacity(0);else if(J)if(J.loadable||J.active){var Z=X.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);X.setCurrent(!X.loading&&0===X.progress&&z===_),X.setOpacity(Z<.01?0:Lr(j/Z*1.2,.4,.85));var $=this.camera.position.clone().setY(X.position.y),ee=(new n.Vector3).copy(X.position).sub($).normalize();if(_===this.currentPanoId){var te=Lr((.5-$.distanceTo(X.position))/.5,0,1);ee.multiplyScalar(1-te).add(K.clone().multiplyScalar(te))}ee.length()>0&&X.quaternion.setFromEuler(new n.Euler(0,Math.atan2(ee.x,ee.z),0))}else X.setCurrent(!1),X.setOpacity(0);else X.setCurrent(!1),X.setOpacity(0);X.updateTime&&X.updateTime(e,t)}}var re=this.tileLevel=function(){if(!1===p.tileLevelForFov)return 0;var e=p.renderer.getDrawingBufferSize(new n.Vector2);e.width*=p.scissor.width,e.height*=p.scissor.height;var t=m.panoId,r=p.works.getResolvedObserver(t),i=p.imageOptions.size;if(void 0===i&&r){var o=r.images.up.match(/\/cube_(\d+)\//);o&&(i=Number(o[1]))}void 0===i&&(i=2048);var a=0;i>=1024&&(a=1),i>=2048&&(a=2),i>=4096&&(a=3),i>=8192&&(a=4);var s=p.tileLevelForFov(p.camera.fov,e);return s>a?s:0}(),ne=function(){var e=p.camera.quaternion.clone(),t=p.works.getResolvedObserver(m.panoId),r=null!=t?t:U;r&&e.premultiply(r.quaternion.clone().inverse());var i=(new n.Matrix4).makeRotationFromQuaternion(e),o=(new n.Matrix4).getInverse(i);return(new n.Frustum).setFromProjectionMatrix((new n.Matrix4).multiplyMatrices(p.camera.projectionMatrix,o))}();m.panoId===this.currentPanoId&&((null===(u=m.panoPicture)||void 0===u?void 0:u.map)instanceof Rt&&(m.panoPicture.map.update(ne,re),!0===m.panoPicture.map.needsRender&&(m.panoPicture.map.needsRender=!1,this.needsRender=!0)),(null===(c=m.panoPicture)||void 0===c?void 0:c.luminanceMap)instanceof Rt&&(m.panoPicture.luminanceMap.update(ne,re),!0===m.panoPicture.luminanceMap.needsRender&&(m.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0)));var ie=this.tiling.object.visible;if(this.initAnimationed){var oe=m.panoId,ae=this.works.getResolvedObserver(oe);ae&&Oo(this.camera.position,ae.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==oe&&this.tiling.cleanup(),this.tiling.panoId=oe,this.tiling.setResource(null!==(d=null===(h=ae.images)||void 0===h?void 0:h.tiles)&&void 0!==d?d:[],this.enableIOSEDR&&ae.images.luminance?ae.images.luminance:null),this.tiling.setAllowHosts(ae.work.allowHosts),this.tiling.setNetworkSubscribe(this.networkSubscribe),this.tiling.setRequestProxy(this.requestProxy),this.tiling.setRotation(ae.quaternion),this.tiling.setPosition(ae.position),re>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(ne,re,e):this.tiling.update(ne,0,e)):this.tiling.object.visible=!1}else this.tiling.object.visible=!1;ie!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0),this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},t.prototype.render=function(){var t=this.works.getResolvedObserver(this.currentPanoId);t&&t.video&&(this.needsRender=!0),e.prototype.render.call(this)},t.prototype.postProcessing=function(e,t){if(!this.destroyed)return this.luminanceAdaptiveEffect||(this.luminanceAdaptiveEffect=new wa(this.renderer),this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable),this.luminanceAdaptiveEffect.render(e,t)},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(Ae())[1],t=this.locationMotion.getKeyFrameSegment(Ae())[1],r=this.panoResourceFromLocationMotionKeyframe(t),n=this.works.getResolvedObserver(r.panoId);return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:n?n.position.clone():this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,t,r){var i,o,a,s,l=this,u=this.works.getResolvedObserver(e);if(!u)throw new Error("Invalid PanoId ".concat(e));var c=this.imageOptions.size;if(void 0===c&&u){var h=u.images.up.match(/\/cube_(\d+)\//);h&&(c=Number(h[1]))}void 0===c&&(c=2048);var d=this.imageOptions.transform,p=ie({key:"pano.".concat(e)},Yn(this.imageOptions,["format","size","quality","sharpen","mappings"])),f=u.images,v=null!==(o=null===(i=u.images.tiles)||void 0===i?void 0:i.filter((function(e){return e.size>c})))&&void 0!==o?o:null,A=d,m={key:"pano_luminance.".concat(e),size:p.size?p.size/2:1024},g=this.enableIOSEDR&&u.images.luminance?u.images.luminance:null,y=function(){if(!u.images.tiles)return null;if(!g)return null;var e=g.up.match(/\/cube_(\d+)\//),t=!!e&&Number(e[1]);return!1===t?null:null==v?void 0:v.map((function(e){return{level:e.level,size:t,back:g.back,front:g.front,left:g.left,right:g.right,up:g.up,down:g.down}}))}(),b="pano:"+Jn([f,p,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var x=this.pendingTextureTask.panoId;null===(a=this.panoMeshes[x])||void 0===a||a.setProgress(0),this.emit("textureAbort",x),this.pendingTextureTask.onError(new Error("texture aborted"))}var w="move-to-pano-"+e;this.pending.add(w);var M,E=this.model.getMaterial()||{},C=E.pano0,I=E.pano1;if(C&&C.map.name===b&&null!==C.luminanceMap===this.enableIOSEDR?M=C:(null==I?void 0:I.map.name)===b&&null!==I.luminanceMap===this.enableIOSEDR&&(M=I),M){var S={panoId:e,effect:null!==(s=t.effect)&&void 0!==s?s:"fly",panoPicture:{map:M.map,luminanceMap:M.luminanceMap,matrix:(new n.Matrix4).compose(u.position,u.quaternion,Va)},position:u.position.clone()};Ne.shared.add((function(){l.pending.delete(w),l.emit("panoLoaded",e),l.doMoveToPano(e,S,t)}),!0,1)}else{this.pendingTextureTask={panoId:e,hash:b,onLoad:function(r,i){var o,a;if(l.pending.delete(w),l.destroyed)r.body.dispose();else{r.body.name=b,l.emit("panoLoaded",e);var s={panoId:e,effect:null!==(o=t.effect)&&void 0!==o?o:"fly",panoPicture:{map:r.body,luminanceMap:null!==(a=null==i?void 0:i.body)&&void 0!==a?a:null,matrix:(new n.Matrix4).compose(u.position,u.quaternion,Va)},position:u.position.clone()};l.doMoveToPano(e,s,t)}},onError:function(r){l.pending.delete(w),t.moveCancelCallback&&t.moveCancelCallback(),l.emit("panoLoadError",r,e),l.emit("moveToPanoCanceled",e)}};var P=this.panoMeshes[e];P&&P.tap&&P.tap(),Promise.all([this.tileLevelForFov&&v&&v.length?this.textureLoader.loadTiledCubeTexture(f,v,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:d,options:p},format:n.RGBAFormat,viaAjax:!0},void 0,void 0,(function(t){var r,n;l.emit("textureLoading",t,e),(null===(r=l.pendingTextureTask)||void 0===r?void 0:r.hash)===b&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer):this.textureLoader.loadCubeTexture(f,{imageURL:{transform:d,options:p},format:n.RGBAFormat,viaAjax:!0},void 0,void 0,(function(t){var r,n;l.emit("textureLoading",t,e),(null===(r=l.pendingTextureTask)||void 0===r?void 0:r.hash)===b&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer),g?this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(g,y,{tileImageSize:256,tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:A,options:m}},void 0,void 0,void 0,this.renderer).catch((function(){return null})):this.textureLoader.loadCubeTexture(g,{imageURL:{transform:A,options:m}},void 0,void 0,void 0,this.renderer).catch((function(){return null})):Promise.resolve(null)]).then((function(t){var r,n,i=t[0],o=t[1];(null===(r=l.pendingTextureTask)||void 0===r?void 0:r.hash)===b?(l.pendingTextureTask.onLoad(i,o),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureLoaded",e,i.meta)):(i.body.dispose(),null==o||o.body.dispose())})).catch((function(t){var r,n;(null===(r=l.pendingTextureTask)||void 0===r?void 0:r.hash)===b&&(l.pendingTextureTask.onError(t),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureError",t,e),l.emit("error",t))})),this.emit("textureStartLoad",e)}},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise((function(r){var n,i=e.initial,o=i.state,a=i.currentState,s=i.duration,l=i.userAction,u=t.initAnimationEndPose(e),c=null!==(n=o.panoId)&&void 0!==n?n:a.panoId,h=!1;e.userAction=l,e.moveToPano(c,{longitude:u.longitude,latitude:u.latitude,fov:u.fov,duration:s,moveStartCallback:function(t,r){h=!0,e.emit("initAnimationWillStart",t,r,e.userAction)},moveEndCallback:function(t,n){e.emit("initAnimationEnded",t,n,e.userAction),e.initAnimationed=!0,r()},moveCancelCallback:function(){var t={longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance};!1===h&&e.emit("initAnimationWillStart",c,t,e.userAction),e.emit("initAnimationEnded",c,t,e.userAction),e.initAnimationed=!0,r()}},l)}))},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var t=0,r=1;r<e.length;r++){var n=this.panoResourceFromLocationMotionKeyframe(e[r-1]).position,i=this.panoResourceFromLocationMotionKeyframe(e[r]).position;t+=n.distanceTo(i)*(e[r].value.count-e[r-1].value.count)}return t},t.prototype.updatePanoMeshes=function(){for(var e=this,t={},r=0,n=Object.keys(this.panoMeshes);r<n.length;r++){var i=n[r],o=this.panoMeshes[i];t[i]=o,delete this.panoMeshes[i]}for(var a=1,s={},l=function(t){var r=Wo(t.accessibleIds,(function(r){var n=e.works.getResolvedObserver(r);return n?Lr(n.standingPosition.distanceTo(t.standingPosition),1,1/0):1/0}),!0)[1];void 0===s[t.index]&&(s[t.index]=r)},u=0,c=this.works.resolvedObservers;u<c.length;u++){l(f=c[u])}var h=Object.keys(s).map((function(e){return s[e]}));h.length&&(a=Lr(.6*(h.reduce((function(e,t){return e+t}),0)/h.length),1,3));for(var d=0,p=this.works.resolvedObservers;d<p.length;d++){var f;o=void 0;t[(f=p[d]).panoId]?(!0===(o=t[f.panoId]).loading&&!1===f.loadable&&o.setLoading(!1),delete t[f.panoId]):((o=this.panoCircleMeshCreator(f.panoId)).name="PanoCircleMesh_"+f.panoId,this.helper.add(o)),o.scale.set(a,1,a),o.position.copy(f.standingPosition),this.panoMeshes[f.panoId]=o}for(var v=0,A=Object.keys(t);v<A.length;v++){var m=A[v];this.helper.remove(t[m]),t[m].dispose(),delete t[m]}},t.prototype.doMoveToPano=function(e,t,r){var i,o,a,s,l=this;void 0===r&&(r={});var u=Ae(),c=To();this.tiling.cleanup(),this.panoResources[c]=t;var h,d,p;if(this.locationMotion.ended){var f=this.locationMotion.getKeyFrameSegment(u);f[0];var v=f[1],A=this.locationMotion.value,m=(null!==(i=this.panoResourceFromLocationMotionKeyframe(v))&&void 0!==i?i:this.camera).position,g=t.position;h=Math.max(m.distanceTo(g),1),d=[{key:v.key,progress:0,value:ie(ie({},A),{count:0})},{key:c,progress:1,value:{distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0,count:1}}],p=0}else{var y=this.locationMotion.getKeyFrameSegment(u),b=y[0],x=(v=y[1],A=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(b).position),w=(m=this.panoResourceFromLocationMotionKeyframe(v).position,g=t.position,v.value.count-A.count),M=Math.max(x.distanceTo(m),1)*w;h=M+Math.max(m.distanceTo(g),1),d=[{key:b.key,progress:0,value:ie({},A)},{key:v.key,progress:M/h,value:v.value},{key:c,progress:1,value:{count:v.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var E=this.locationMotionKeyframesLength(this.locationMotion.keyframes),C=this.locationMotionKeyframesLength(d);p=0===E||0===E?0:this.locationMotion.getProgressVelocity(u)*E/C}var I=this.calculateMovingDuration(r.duration,"fade"===r.effect||"montage"===r.effect?0:h),S={longitude:r.longitude,latitude:r.latitude,fov:r.fov},P={longitude:null!==(o=S.longitude)&&void 0!==o?o:this.camera.pose.longitude,latitude:null!==(a=S.latitude)&&void 0!==a?a:this.camera.pose.latitude,fov:null!==(s=S.fov)&&void 0!==s?s:this.camera.pose.fov,offset:t.position.clone(),distance:this.camera.pose.distance};this.emit("moveToPano",e,this.userAction),r.moveStartCallback&&r.moveStartCallback(e,P),this.emit("panoWillArrive",e,P,this.userAction),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=fe,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(S,I).catch(fe),this.locationMotion.setKeyframes(d,I,p).then((function(){var t,i,o,a={longitude:l.camera.pose.longitude,latitude:l.camera.pose.latitude,fov:l.camera.pose.fov,offset:l.camera.pose.offset.clone(),distance:l.camera.pose.distance};r.moveEndCallback&&r.moveEndCallback(e,a),l.emit("panoArrived",e,a,l.userAction);var s=l.works.getResolvedObserver(e);if(s&&s.video&&l.videoTexture&&l.videoTexture.image instanceof HTMLVideoElement){var u=Na.clone().multiply(null!==(o=null===(i=null===(t=l.model.getMaterial())||void 0===t?void 0:t.pano1)||void 0===i?void 0:i.matrix)&&void 0!==o?o:new n.Matrix4).multiply(s.video.matrix),c={map:l.videoTexture,size:s.video.size,matrix:u,alpha:1},h=To(),d=l.videoTexture.image;d.setAttribute("uuid",h),ma().then((function(e){e&&s.video&&d.getAttribute("uuid")===h&&(d.oncanplay=function(){d.oncanplay=fe,d.play()},d.ontimeupdate=function(){d.currentTime>.5&&(d.ontimeupdate=fe,l.panoVideo.setMaterial(c))},d.src=s.video.source)})).catch((function(){d.removeAttribute("uuid")}))}}),(function(){r.moveCancelCallback&&r.moveCancelCallback(),l.emit("moveToPanoCanceled",e)}))},t.prototype.getForwardPanoIndexOrNot=function(e){var t,r=this,i=this.works.getResolvedObserver(this.currentPanoId);if(!i)return null;var o=null!=e?e:new n.Raycaster(this.camera.position.clone(),this.camera.getDirection(new n.Vector3)),a=i.standingPosition.clone();if(i.position.distanceTo(o.ray.origin)>1){var s=this.model.intersectRaycaster(new n.Raycaster(o.ray.origin,new n.Vector3(0,-1,0)))[0];s&&s.distance<=2?a.copy(s.point):a.copy(o.ray.origin).add(new n.Vector3(0,-1.5,0))}var l=this.model.intersectRaycaster(o)[0],u=(l?l.point:o.ray.origin.clone().add(o.ray.direction.clone().normalize().multiplyScalar(3))).clone().sub(a).normalize();if(0===u.length())return null;for(var c=i.accessibleIds.filter((function(e){if(e===r.currentPanoId)return!1;var t=r.works.getResolvedObserver(e);if(!t)return!1;var n=t.standingPosition.clone().project(r.camera);return!(Math.abs(n.z)>1)&&(!(Math.abs(n.x)>1)&&(!(Math.abs(n.y)>1)&&(t.loadable||t.active)))})),h=c.slice().sort((function(e,t){return r.works.getResolvedObserver(e).standingPosition.clone().distanceTo(a)-r.works.getResolvedObserver(t).standingPosition.clone().distanceTo(a)})),d=0,p=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];d<p.length;d++)for(var f=p[d],v=0,A=h;v<A.length;v++){var m=A[v],g=null===(t=this.works.getResolvedObserver(m))||void 0===t?void 0:t.standingPosition.clone().sub(a);if(g&&0!==g.length()&&u.angleTo(g)<f)return m}return null},t.prototype.onTapGesture=function(e){var t=this;if(this.initAnimationed){if(!this.locationMotion.ended)if(this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]).panoId!==this.currentPanoId)return;var r=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","tap",r,!0)){var i=this.relativeClientPosition(e.center),o=new n.Raycaster;if(o.setFromCamera(i,this.camera),!this.emit("wantsTapGesture",o,i,!0)){this.emit("gesture","tap",r,!0),this.emit("tapGesture",o,i,!0),this.interiaMovement=!1,this.userAction=!0;var a=this.camera.getDirection(new n.Vector3).setY(0),s=null,l=this.works.getResolvedObserver(this.currentPanoId);if(l){var u=l.accessibleIds.filter((function(e){if(e===t.currentPanoId)return!1;var r=t.works.getResolvedObserver(e);return!!r&&(!(r.position.distanceTo(t.camera.position)>t.maxAccessibleDistance)&&(r.loadable||r.active))})),c=this.model.intersectRaycaster(o)[0];if(c){var h=Wo(u,(function(e){var r=t.works.getResolvedObserver(e);return r?r.standingPosition.clone().distanceTo(c.point):1/0}),!0),d=h[0],p=h[1];!So(d)&&p<this.panoTapTriggerRadius&&(s=d)}So(s)&&(s=this.getForwardPanoIndexOrNot(o));for(var f=0,v=this.locationMotion.keyframes;f<v.length;f++){var A=v[f],m=this.panoResourceFromLocationMotionKeyframe(A);if(!(A.progress<this.locationMotion.progress)&&m.panoId===s){s=null;break}}if(this.emit("panoSelected",s),So(s))!0===this.locationMotion.ended&&this.cameraBounce();else{var g=this.works.getResolvedObserver(s);if(!g||g.active){var y={};if(g){for(var b=Math.PI/6,x=Math.PI/12,w=g.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),M=[],E=0,C=g.accessibleIds;E<C.length;E++){if((d=C[E])!==this.currentPanoId&&d!==s){var I=this.works.getResolvedObserver(d);if(I){var S=I.position.clone().sub(g.position).setY(0);w.angleTo(S)<b&&M.push(S)}}}var P=(M.length>0?M:ue(ue([],[],!0),[],!0)).slice().sort((function(e,t){return e.angleTo(w)-t.angleTo(w)}))[0];P&&P.angleTo(a)>x&&(y.longitude=Math.atan2(-P.x,-P.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(y.latitude=Lr(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(y.fov=this.defaultFov),this.emit("wantsMoveToPano",s,y,!0)}else this.panoMeshes[s]&&(this.panoMeshes[s].setDisabled(!1),this.panoMeshes[s].setLoading(!0))}}}}}},t}(Aa),qa=Math.PI/180,Ha=180/Math.PI,_a=.001,ja=1,Ga=function(){var e="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),Ka=function(){var e="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return e}}(),Wa=function(){var e="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("Firefox")&&-1!==navigator.userAgent.indexOf("Android");return function(){return e}}(),Ya=function(){var e="undefined"!=typeof navigator?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=e?parseInt(e[1],10):null;return function(){return t}}(),Xa=function(){var e=!1;if(65===Ya()){var t="undefined"!=typeof navigator?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var r=t[1].split(".");r[0],r[1];var n=r[2],i=r[3];e=3325===parseInt(n,10)&&parseInt(i,10)<148}}return function(){return e}}(),Ja=function(){var e=Ga()&&Ka()&&"undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("13_4");return function(){return e}}(),Za=function(){var e="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("R7 Build");return function(){return e}}();function $a(){var e="undefined"!=typeof window&&(90==window.orientation||-90==window.orientation);return Za()?!e:e}var es,ts=(es={},function(e,t){void 0===es[e]&&(console.warn("cardboard: "+t),es[e]=!0)});function rs(e){var t,r=e.indexOf("://");t=-1!==r?r+3:0;var n=e.indexOf("/",t);return-1===n&&(n=e.length),e.substring(0,n)}var ns,is=function(e,t,r){var n,i,o,a,s,l,u,c,h,d,p,f,v,A,m,g,y,b,x;n=e,a=(i=t)?i[0]:0,s=i?i[1]:0,l=i?i[2]:0,u=i?i[3]:1,p=a*(c=a+a),f=a*(h=s+s),v=a*(d=l+l),A=s*h,m=s*d,g=l*d,y=u*c,b=u*h,x=u*d,n[0]=1-(A+g),n[1]=f+x,n[2]=v-b,n[3]=0,n[4]=f-x,n[5]=1-(p+g),n[6]=m+y,n[7]=0,n[8]=v+b,n[9]=m-y,n[10]=1-(p+A),n[11]=0,n[12]=o?o[0]:0,n[13]=o?o[1]:0,n[14]=o?o[2]:0,n[15]=1,r&&function(e,t,r){var n,i,o,a,s,l,u,c,h,d,p,f,v=r[0],A=r[1],m=r[2];t===e?(e[12]=t[0]*v+t[4]*A+t[8]*m+t[12],e[13]=t[1]*v+t[5]*A+t[9]*m+t[13],e[14]=t[2]*v+t[6]*A+t[10]*m+t[14],e[15]=t[3]*v+t[7]*A+t[11]*m+t[15]):(n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],p=t[10],f=t[11],e[0]=n,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=n*v+s*A+h*m+t[12],e[13]=i*v+l*A+d*m+t[13],e[14]=o*v+u*A+p*m+t[14],e[15]=a*v+c*A+f*m+t[15])}(e,e,r),function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],p=t[11],f=t[12],v=t[13],A=t[14],m=t[15],g=r*s-n*a,y=r*l-i*a,b=r*u-o*a,x=n*l-i*s,w=n*u-o*s,M=i*u-o*l,E=c*v-h*f,C=c*A-d*f,I=c*m-p*f,S=h*A-d*v,P=h*m-p*v,T=d*m-p*A,B=g*T-y*P+b*S+x*I-w*C+M*E;B&&(B=1/B,e[0]=(s*T-l*P+u*S)*B,e[1]=(i*P-n*T-o*S)*B,e[2]=(v*M-A*w+m*x)*B,e[3]=(d*w-h*M-p*x)*B,e[4]=(l*I-a*T-u*C)*B,e[5]=(r*T-i*I+o*C)*B,e[6]=(A*b-f*M-m*y)*B,e[7]=(c*M-d*b+p*y)*B,e[8]=(a*P-s*I+u*E)*B,e[9]=(n*I-r*P-o*E)*B,e[10]=(f*w-v*b+m*g)*B,e[11]=(h*b-c*w-p*g)*B,e[12]=(s*C-a*S-l*E)*B,e[13]=(r*S-n*C+i*E)*B,e[14]=(v*y-f*x-A*g)*B,e[15]=(c*x-h*y+d*g)*B)}(e,e)},os=function(){function e(e,t){void 0===e&&(e=new n.Vector3),void 0===t&&(t=0),this.sample=e,this.timestampS=t}return e.prototype.set=function(e,t){this.sample=e,this.timestampS=t},e.prototype.copy=function(e){this.set(e.sample,e.timestampS)},e}(),as=function(){function e(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new os,this.currentGyroMeasurement=new os,this.previousGyroMeasurement=new os,Ga()?this.filterQ=new n.Quaternion(-1,0,0,1):this.filterQ=new n.Quaternion(1,0,0,1),this.previousFilterQ=new n.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new n.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new n.Vector3,this.measuredGravity=new n.Vector3,this.gyroIntegralQ=new n.Quaternion}return e.prototype.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},e.prototype.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e,t);var r,n=t-this.previousGyroMeasurement.timestampS;r=n,isNaN(r)||r<=_a||r>ja||this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},e.prototype.getOrientation=function(){return this.filterQ},e.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 r=new n.Quaternion;r.copy(this.filterQ),r.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(r),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var i,o=new n.Quaternion;o.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),o.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",Ha*((i=o).w>1?0:2*Math.acos(i.w)),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var a=new n.Quaternion;a.copy(this.filterQ),a.multiply(o),this.filterQ.slerp(a,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},e.prototype.accelToQuaternion_=function(e){var t=new n.Vector3;t.copy(e),t.normalize();var r=new n.Quaternion;return r.setFromUnitVectors(new n.Vector3(0,0,-1),t),r.inverse(),r},e.prototype.gyroToQuaternionDelta_=function(e,t){var r=new n.Quaternion,i=new n.Vector3;return i.copy(e),i.normalize(),r.setFromAxisAngle(i,e.length()*t),r},e}(),ss=function(){function e(e,t){this.predictionTimeS=e,this.isDebug=t,this.previousQ=new n.Quaternion,this.previousTimestampS=null,this.deltaQ=new n.Quaternion,this.outQ=new n.Quaternion}return e.prototype.getPrediction=function(e,t,r){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=r,e;var i=new n.Vector3;i.copy(t),i.normalize();var o=t.length();if(o<20*qa)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(Ha*o).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var a=o*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(i,a),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=r,this.outQ},e}(),ls=function(){function e(e){this.coefficients=e}return e.prototype.distortInverse=function(e){for(var t=0,r=1,n=e-this.distort(t);Math.abs(r-t)>1e-4;){var i=e-this.distort(r),o=r-i*((r-t)/(i-n));t=r,r=o,n=i}return r},e.prototype.distort=function(e){for(var t=e*e,r=0,n=0;n<this.coefficients.length;n++)r=t*(r+this.coefficients[n]);return(r+1)*e},e}(),us=function(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null},cs=function(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0},hs=function(){function e(e,t,r,i){this.viewer={id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]},this.device={widthMeters:.11,heightMeters:.062,bevelMeters:.004},this.depthNear=.01,this.depthFar=1e4,this.yawOnly=r,this.accelerometer=new n.Vector3,this.gyroscope=new n.Vector3,this.filter=new as(e,i),this.posePredictor=new ss(t,i),this.isFirefoxAndroid=Wa(),this.isIOS=Ga();var o=Ya();this.isDeviceMotionInRadians=!this.isIOS&&null!==o&&o<66,this.isWithoutDeviceMotion=Xa()||Ja(),this.filterToWorldQ=new n.Quaternion,Ga()?this.filterToWorldQ.setFromAxisAngle(new n.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new n.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new n.Quaternion,this.worldToScreenQ=new n.Quaternion,this.originalPoseAdjustQ=new n.Quaternion;var a="undefined"!=typeof window?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new n.Vector3(0,0,1),a),this.setScreenTransform_(),$a()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new n.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return e.prototype.getPosition=function(){return null},e.prototype.getOrientation=function(){var e;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||(i=(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,-1),0),o=new n.Quaternion,"undefined"!=typeof window&&-90===window.orientation?o.setFromAxisAngle(new n.Vector3(0,1,0),Math.PI/-2):o.setFromAxisAngle(new n.Vector3(0,1,0),Math.PI/2),i.multiply(o)),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||((r=new n.Quaternion).setFromAxisAngle(new n.Vector3(1,0,0),-Math.PI/2),r),e=this._deviceOrientationQ;var t=new n.Quaternion;return t.copy(e),t.multiply(this.deviceOrientationFilterToWorldQ),t.multiply(this.resetQ),t.multiply(this.worldToScreenQ),t.multiplyQuaternions(this.deviceOrientationFixQ,t),this.yawOnly&&(t.x=0,t.z=0,t.normalize()),this.orientationOut_[0]=t.x,this.orientationOut_[1]=t.y,this.orientationOut_[2]=t.z,this.orientationOut_[3]=t.w,this.orientationOut_}var r,i,o,a=this.filter.getOrientation();e=this.posePredictor.getPrediction(a,this.gyroscope,this.previousTimestampS);var s=new n.Quaternion;return s.copy(this.filterToWorldQ),s.multiply(this.resetQ),s.multiply(e),s.multiply(this.worldToScreenQ),this.yawOnly&&(s.x=0,s.z=0,s.normalize()),this.orientationOut_[0]=s.x,this.orientationOut_[1]=s.y,this.orientationOut_[2]=s.z,this.orientationOut_[3]=s.w,this.orientationOut_},e.prototype.getPose=function(){var e=new us;return e.orientation=this.getOrientation(),e},e.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),$a()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},e.prototype.getFrameData=function(e){var t=this.getOrientation(),r=this.getEyeOffset(),n=this.getEyeProjectionMatrix();return e.pose.angularAcceleration=null,e.pose.angularVelocity=null,e.pose.linearAcceleration=null,e.pose.linearVelocity=null,e.pose.orientation=t,e.pose.position=null,e.timestamp=this.previousTimestampS,e.leftProjectionMatrix.set(n.left),e.rightProjectionMatrix.set(n.right),is(e.leftViewMatrix,t,r.left),is(e.rightViewMatrix,t,r.right),e},e.prototype.start=function(){if("undefined"==typeof window)return function(){};var e=this.onDeviceMotion_.bind(this),t=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),n=this.onDeviceOrientation_.bind(this);return Ga()&&function(){if("undefined"==typeof window)return!1;if("undefined"==typeof document)return!1;var e=window.self!==window.top,t=rs(document.referrer),r=rs(window.location.href);return e&&t!==r}()&&window.addEventListener("message",r),window.addEventListener("orientationchange",t),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",n):window.addEventListener("devicemotion",e),function(){window.removeEventListener("devicemotion",e),window.removeEventListener("deviceorientation",t),window.removeEventListener("orientationchange",t),window.removeEventListener("message",r)}},e.prototype.getEyeOffset=function(){return{left:[.5*-this.viewer.interLensDistance,0,0],right:[.5*this.viewer.interLensDistance,0,0]}},e.prototype.getEyeProjectionMatrix=function(){var e=this.getEyeFieldOfView(),t=this.depthNear,r=this.depthFar,n={left:[],right:[]},i=e.left.upDegrees*qa,o=e.left.downDegrees*qa,a=2/((l=e.left.leftDegrees*qa)+(u=e.left.rightDegrees*qa)),s=2/(i+o);n.left[0]=a,n.left[1]=0,n.left[2]=0,n.left[3]=0,n.left[4]=0,n.left[5]=s,n.left[6]=0,n.left[7]=0,n.left[8]=-(l-u)*a*.5,n.left[9]=(i-o)*s*.5,n.left[10]=r/(t-r),n.left[11]=-1,n.left[12]=0,n.left[13]=0,n.left[14]=r*t/(t-r),n.left[15]=0;var l,u;i=e.right.upDegrees*qa,o=e.right.downDegrees*qa,a=2/((l=e.right.leftDegrees*qa)+(u=e.right.rightDegrees*qa)),s=2/(i+o);return n.right[0]=a,n.right[1]=0,n.right[2]=0,n.right[3]=0,n.right[4]=0,n.right[5]=s,n.right[6]=0,n.right[7]=0,n.right[8]=-(l-u)*a*.5,n.right[9]=(i-o)*s*.5,n.right[10]=r/(t-r),n.right[11]=-1,n.right[12]=0,n.right[13]=0,n.right[14]=r*t/(t-r),n.right[15]=0,n},e.prototype.getEyeFieldOfView=function(){var e=this.viewer,t=this.device,r=new ls(e.distortionCoefficients),n=e.screenLensDistance,i=(t.widthMeters-e.interLensDistance)/2,o=e.interLensDistance/2,a=e.baselineLensDistance-t.bevelMeters,s=t.heightMeters-a,l=Ha*Math.atan(r.distort(i/n)),u=Ha*Math.atan(r.distort(o/n)),c=Ha*Math.atan(r.distort(a/n)),h=Ha*Math.atan(r.distort(s/n)),d=new cs,p=new cs;return d.leftDegrees=Math.min(l,e.fov),d.rightDegrees=Math.min(u,e.fov),d.downDegrees=Math.min(c,e.fov),d.upDegrees=Math.min(h,e.fov),p.leftDegrees=d.rightDegrees,p.rightDegrees=d.leftDegrees,p.upDegrees=d.upDegrees,p.downDegrees=d.downDegrees,{left:d,right:p}},e.prototype.onDeviceOrientation_=function(e){this._deviceOrientationQ=this._deviceOrientationQ||new n.Quaternion;var t=e.alpha,r=e.beta,i=e.gamma;t=(t||0)*Math.PI/180,r=(r||0)*Math.PI/180,i=(i||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new n.Euler(t,r,-i,"YXZ"))},e.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},e.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,r=e.rotationRate,n=e.timeStamp/1e3,i=n-this.previousTimestampS;return i<0?(ts("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=n)):i<=_a||i>ja?(ts("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),void(this.previousTimestampS=n)):(t&&(this.accelerometer.set(-t.x,-t.y,-t.z),r&&(Za()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,n)),this.filter.addAccelMeasurement(this.accelerometer,n)),void(this.previousTimestampS=n))},e.prototype.onOrientationChange_=function(){this.setScreenTransform_()},e.prototype.onMessage_=function(e){var t=e.data;t&&t.type&&("devicemotion"===t.type.toLowerCase()&&this.updateDeviceMotion_(t.deviceMotionEvent))},e.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),"undefined"!=typeof window?window.orientation:0){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new n.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new n.Vector3(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},e}(),ds=[0,0,.5,1],ps=[.5,0,.5,1],fs=function(){function e(e){var t=this;this.renderer=e,this.sensor=new hs(.98,.04,!1,!1),this.scale=1,this.cameraL=new n.PerspectiveCamera,this.cameraR=new n.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var e=t.renderer.getSize(new n.Vector2);t.renderer.setScissor(0,0,e.width,e.height),t.renderer.setViewport(0,0,e.width,e.height),t.renderer.setScissorTest(!1),r()}}return e.prototype.render=function(e,t){var r=this.renderer.getSize(new n.Vector2);if(r.width>r.height){var i=e.autoUpdate;i&&(e.updateMatrixWorld(),e.autoUpdate=!1);var o={x:Math.round(r.width*ds[0]),y:Math.round(r.height*ds[1]),width:Math.round(r.width*ds[2]),height:Math.round(r.height*ds[3])},a={x:Math.round(r.width*ps[0]),y:Math.round(r.height*ps[1]),width:Math.round(r.width*ps[2]),height:Math.round(r.height*ps[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),null===t.parent&&t.updateMatrixWorld(),t.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),t.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var s=this.sensor.getEyeOffset();this.cameraL.translateOnAxis((new n.Vector3).fromArray(s.left),this.scale),this.cameraR.translateOnAxis((new n.Vector3).fromArray(s.right),this.scale);var l=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=l.left.slice(),this.cameraR.projectionMatrix.elements=l.right.slice(),this.renderer.setViewport(o.x,o.y,o.width,o.height),this.renderer.setScissor(o.x,o.y,o.width,o.height),this.renderer.render(e,this.cameraL),this.renderer.setViewport(a.x,a.y,a.width,a.height),this.renderer.setScissor(a.x,a.y,a.width,a.height),this.renderer.render(e,this.cameraR),this.renderer.setViewport(0,0,r.width,r.height),this.renderer.setScissor(0,0,r.width,r.height),this.renderer.setScissorTest(!1),i&&(e.autoUpdate=!0)}else this.renderer.render(e,t)},e.prototype.dispose=function(){},e}(),vs={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},As="undefined"!=typeof navigator&&null!==(ns=vs[navigator.language.split("-")[0]])&&void 0!==ns?ns:vs.zh,ms="\n<style>\n.$id {\n all: initial;\n position: absolute;\n overflow: hidden;\n display: none;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.$id-modal {\n width: 100%;\n height: 332px;\n position: absolute;\n bottom: -2px;\n left: 0;\n right: 0;\n overflow: hidden;\n pointer-events: none;\n will-change: transform;\n animation: $id-modal-fade-in 0.3s ease 1;\n}\n.$id-modal-bg {\n background: rgba(0, 0, 0, 0.75);\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n}\n.$id-modal-bg-line {\n height: 1px;\n background-image: linear-gradient(\n 85deg,\n rgba(162, 177, 255, 0.3) 1%,\n rgba(120, 126, 255, 0.8) 30%,\n rgba(147, 218, 255, 0.8) 66%,\n rgba(250, 255, 184, 0.3) 92%\n );\n}\n.$id-modal-bg-wave svg {\n width: 375px;\n height: 61px;\n display: block;\n}\n.$id-modal-content {\n color: #ffffff;\n padding: 0 14px;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n overflow: hidden;\n}\n.$id-modal-content-title {\n font-size: 17px;\n font-family: sans-serif;\n line-height: 18px;\n padding: 20px 0;\n font-weight: bold;\n}\n.$id-modal-content-hit {\n font-size: 14px;\n font-family: sans-serif;\n line-height: 24px;\n opacity: 0.85;\n}\n.$id-modal-content-guide {\n position: relative;\n width: 168px;\n height: 139px;\n margin: 36px auto 0;\n}\n.$id-modal-content-guide-cardboard {\n position: absolute;\n width: 100px;\n height: 82px;\n left: 68px;\n top: 57px;\n}\n.$id-modal-content-guide-cardboard-image {\n width: 100px;\n height: 82px;\n background-image: url(".concat("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU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Wuc2PIlQbBSogAO+XR1Ky6afvy0AuGKniXhPWIWI3U5vdRW4AcCkJArJN7d7SLtlx9VW8pXbdfN/6frfJPYUq58cqWivBpIlTrFRcJOObOe4SKx1Vsj20Cwjam01JODjiUpcbaE9jL4W9Hkla7tNgTI9XgxmtChiMie0F5G/930+vX6wOOsKvinKDlaFdrL4XOcipIACOpcxco820J7BfhsLH1F+jyUQxE2hvYqdEezo8lk8hQIavQFwiwN7ZV5Awa0+Mnh1nen/Z44BkLv9DljYHVorwbfgwGtf4iL2u+03weXYKJKi5pXE0J7FU5Bw8zz+N6Q0F4OD4EwvhWRJoX2UoZhUY9PZ2PYrNBewuAODLzDUMPjMQ8Kd6GIaMZaclxG8FfcIWsxGLkxGOzazl7AYKLn09idtd2qmP7ZiZsK24fHR20MLafPB6O2UTWAP1yGz7GpTmekAAAAAElFTkSuQmCC",");\n background-size: 100%;\n background-repeat: no-repeat;\n}\n.$id-modal-content-guide-phone {\n position: absolute;\n width: 58px;\n height: 56px;\n left: 0;\n top: 0;\n}\n.$id-modal-content-guide-phone-move-x {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n animation: $id-guide-move-x 4s 0.5s infinite;\n}\n.$id-modal-content-guide-phone-move-y {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n animation: $id-guide-move-y 4s cubic-bezier(0.42, 0, 0.23, 0.98) 0.5s infinite;\n}\n.$id-modal-content-guide-phone-blink {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n will-change: opacity;\n animation: $id-guide-blink 4s 0.5s infinite;\n}\n.$id-modal-content-guide-phone-image {\n width: 58px;\n height: 56px;\n background-image: url(").concat("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK4AAAClCAMAAADyFTYfAAAC+lBMVEUAAABISEhKSkpGRkZERERCQkJOTk45OTlBQUFQUFBSUlJUVFQ7OztYWFg/Pz8/Pz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Xi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC",');\n background-size: 100%;\n background-repeat: no-repeat;\n}\n.$id-modal-close {\n position: absolute;\n top: 20px;\n right: 14px;\n width: 14px;\n height: 14px;\n}\n.$id-modal-close svg {\n width: 14px;\n height: 14px;\n display: block;\n}\n\n@keyframes $id-modal-fade-in {\n 0% { transform: translate3d(0, 100%, 0); opacity: 0.5; }\n 100% { transform: translate3d(0, 0, 0); opacity: 1; }\n}\n@keyframes $id-guide-blink {\n 0% { opacity: 0; }\n 7% { opacity: 0; }\n 12% { opacity: 1; }\n 29% { opacity: 1; }\n 34% { opacity: 0.3; }\n 39% { opacity: 1; }\n 44% { opacity: 0.3; }\n 49% { opacity: 1; }\n 80% { opacity: 1; }\n 100% { opacity: 0; }\n}\n@keyframes $id-guide-move-x {\n 0% { transform: translate3d(0, 0, 0); }\n 57% { transform: translate3d(0, 0, 0); }\n 80% { transform: translate3d(70px, 0, 0); }\n 100% { transform: translate3d(70px, 0, 0); }\n}\n@keyframes $id-guide-move-y {\n 0% { transform: translate3d(0, 0, 0); }\n 57% { transform: translate3d(0, 0, 0); }\n 80% { transform: translate3d(0, 58px, 0); }\n 100% { transform: translate3d(0, 58px, 0); }\n}\n@media screen and (orientation: portrait) {\n .$id {\n display: block;\n }\n}\n</style>\n<div class="$id-modal">\n <div class="$id-modal-bg">\n <div class="$id-modal-bg-line"></div>\n <div class="$id-modal-bg-wave">\n <svg width="375" height="61" viewBox="0 0 375 61" version="1.1" xmlns="http://www.w3.org/2000/svg">\n <defs>\n <linearGradient x1="0" y1="0%" x2="0" y2="100%" id="$id-2y6_dj_hgp">\n <stop stop-color="#8598FF" stop-opacity="0.15" offset="0%"></stop>\n <stop stop-color="#000" stop-opacity="0" offset="100%"></stop>\n </linearGradient>\n </defs>\n <path transform="translate(187.5, 30.5) scale(-1, 1) translate(-187.5, -30.5)" fill="url(#$id-2y6_dj_hgp)" d="\nM0,1\nC83.001,1.706 140.146,4.164 171.435,8.374\nC218.369,14.688 253.467,26.308 273.002,33\nC292.536,39.691323.501,51 343.709,56\nC357.182,59.333 367.612,61 375,61\nL375,0\nL0,0\nL0,1\nZ\n"></path>\n </svg>\n </div>\n </div>\n <div class="$id-modal-content">\n <div class="$id-modal-content-title">').concat(As.TITLE,'</div>\n <div class="$id-modal-content-hit">').concat(As.HIT,'</div>\n <div class="$id-modal-content-guide">\n <div class="$id-modal-content-guide-phone">\n <div class="$id-modal-content-guide-phone-move-x">\n <div class="$id-modal-content-guide-phone-move-y">\n <div class="$id-modal-content-guide-phone-blink">\n <div class="$id-modal-content-guide-phone-image"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="$id-modal-content-guide-cardboard">\n <div class="$id-modal-content-guide-cardboard-image"></div>\n </div>\n </div>\n </div>\n <div class="$id-modal-close">\n <svg width="14" height="14" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg">\n <defs>\n <radialGradient cx="50%" cy="50%" fx="50%" fy="50%" r="70%" id="$id-ho0itsc4p9">\n <stop stop-color="#FFF" stop-opacity="0.75" offset="0%"></stop>\n <stop stop-color="#FFF" stop-opacity="0.22" offset="100%"></stop>\n </radialGradient>\n </defs>\n <path transform="translate(-3, -3)" fill="url(#$id-ho0itsc4p9)" fill-rule="nonzero" d="\nM16.791,3.198\nC17.044,3.438 17.067,3.814 16.860,4.080\nL16.791,4.156\nL12.144,9.331\nC11.803,9.711 11.803,10.288 12.144,10.668\nL16.791,15.843\nC17.044,16.084 17.067,16.460 16.860,16.725\nL16.791,16.801\nC16.538,17.042 16.142,17.063 15.864,16.867\nL15.784,16.801\nL10.000,11.250\nL4.215,16.801\nL4.135,16.867\nC3.857,17.063 3.461,17.042 3.208,16.801\nL3.208,16.801\nL3.139,16.725\nC2.932,16.460 2.955,16.084 3.208,15.843\nL3.208,15.843\nL7.855,10.668\nC8.196,10.288 8.196,9.711 7.855,9.331\nL7.855,9.331\nL3.208,4.156\nL3.139,4.080\nC2.932,3.814 2.955,3.438 3.208,3.198\nC3.486,2.933 3.937,2.933 4.215,3.198\nL4.215,3.198 L9.999,8.749\nL15.784,3.198\nC16.062,2.933 16.513,2.933 16.791,3.198\nZ\n"></path>\n </svg>\n </div>\n</div>\n');function gs(e){for(var t=1,r=document.getElementsByTagName("meta"),n=0;n<r.length;n++){var i=r[n];if("viewport"===i.getAttribute("name")){var o=(i.getAttribute("content")||"").match(/initial\-scale\=([\d|\.]+)/);o&&(t=Number(o[1])),isNaN(t)&&(t=1)}}return ms.replace(/\n/g," ").replace(/\ +/g," ").replace(/\$id/g,e).replace(/(\d+)px/g,(function(e,r){return function(e){return Math.floor(e*t)+"px"}(Number(r))}))}var ys=new n.CircleBufferGeometry(.12,16),bs=function(e){function t(){var t=e.call(this)||this;t.progress=0,t.opacity=0,t.loading=!1,t.current=!1,t.disabled=!1,t.currentMotion=new fo({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),t.opacityMotion=new fo({opacity:0}),t.loadingMotion=new fo({opacity:0}),t.disableMotion=new fo({opacity:0});var r={blending:n.CustomBlending,blendSrc:n.SrcAlphaFactor,blendDst:n.OneMinusSrcAlphaFactor,blendSrcAlpha:n.OneFactor,blendDstAlpha:n.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return t.hitTestMesh=new n.Mesh(ys,new n.MeshBasicMaterial(ie(ie({},r),{color:0,opacity:0}))),t.hitTestMesh.scale.set(1.5,1.5,1.5),t.ringMesh=new n.Mesh(ys,new n.ShaderMaterial(ie(ie({},r),{vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nvarying vec2 vUv;\nuniform float opacity;\n\nfloat smoothDist = 0.01;\nvoid main() {\n vec2 center = vec2(0.5, 0.5);\n float dist = length(center - vUv);\n float outerDist = 0.49;\n float innerDist = 0.29;\n\n float outside = 1.0 - smoothstep(outerDist - smoothDist, outerDist, dist);\n float inside = smoothstep(innerDist, innerDist + smoothDist, dist);\n\n vec4 bg = vec4(0.576, 0.635, 1.0, 0.3);\n float gradientAlpha = clamp(abs(dist - (outerDist + innerDist) / 2.0) / (outerDist - innerDist) * 1.5 + 0.1, 0.0, 1.0);\n vec4 gradient = vec4(1.0, 1.0, 1.0, gradientAlpha);\n\n gl_FragColor = mix(bg, gradient, gradient.a);\n\n gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity * outside * inside);\n}\n",uniforms:{opacity:{value:0}}}))),t.panoMesh=new n.Mesh(ys,new n.ShaderMaterial(ie(ie({},r),{vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nuniform float circleScale;\nuniform float circleFade;\nuniform float circleOpacity;\nuniform float loadingAngle;\nuniform float loadingOpacity;\nuniform float opacity;\nuniform float disable;\nvarying vec2 vUv;\n\n#define PI 3.141592653589793\n#define TAU 6.283185307179586\n#define SMOOTH_DIST 0.017\n#define CENTER vec2(0.5, 0.5)\n\nfloat inside(float innerDist) {\n float dist = length(CENTER - vUv);\n return smoothstep(innerDist, innerDist + SMOOTH_DIST, dist);\n}\nfloat outside(float outerDist) {\n float dist = length(CENTER - vUv);\n return 1.0 - smoothstep(outerDist - SMOOTH_DIST, outerDist, dist);\n}\n\nvec4 create_circle() {\n float dist = length(CENTER - vUv);\n float gradient = clamp(0.98 + abs(dot(normalize(vec2(1.0, -1.0)), vUv - CENTER)) * 2.0, 0.0, 1.0);\n vec3 color = mix(vec3(0.576, 0.635, 1.0), vec3(1.0, 1.0, 1.0), circleFade * 0.5);\n return vec4(color, 1.0 * gradient * circleOpacity * outside(0.3 * circleScale));\n}\n\nvec4 create_disable() {\n float dist = length(CENTER - vUv);\n return vec4(1.0, 1.0, 1.0, 0.5 * outside(0.32 * circleScale));\n}\n\nvec4 create_loading() {\n float angle = PI - atan(CENTER.x - vUv.x, CENTER.y - vUv.y);\n angle = mod(angle + loadingAngle, TAU);\n float gradient = (1.0 - smoothstep(0.0, TAU, angle)) * 0.9 + 0.1;\n return vec4(1.0, 1.0, 1.0, gradient * loadingOpacity * inside(0.2 * circleScale) * outside(0.25 * circleScale));\n}\n\nvoid main() {\n gl_FragColor = vec4(1.0, 1.0, 1.0, 0);\n\n vec4 circleColor = create_circle();\n gl_FragColor = mix(gl_FragColor, circleColor, circleColor.a);\n\n vec4 loadingColor = create_loading();\n gl_FragColor = mix(gl_FragColor, loadingColor, loadingColor.a);\n\n gl_FragColor = mix(gl_FragColor, create_disable(), disable);\n\n gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity);\n}\n",uniforms:{circleScale:{value:1.1},circleFade:{value:0},circleOpacity:{value:.5},loadingAngle:{value:0},loadingOpacity:{value:0},opacity:{value:0},disable:{value:0}}}))),t.add(t.hitTestMesh),t.add(t.ringMesh),t.add(t.panoMesh),t.renderOrder=1e4,t.needsRender=!0,t}return ne(t,e),t.prototype.setProgress=function(e){this.progress=e,this.setLoading(e>0)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=Lr(e,0,1),this.opacityMotion.set({opacity:e},30).catch(fe))},t.prototype.setCurrent=function(e){if(this.current!==e){if(e){var t=[{progress:0,value:{ringScale:2,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.05,value:{ringScale:1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.15,value:{ringScale:1.2,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.25,value:{ringScale:1.1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.8,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1}},{progress:.9,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:.92,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:1,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1.1}}];this.currentMotion.setKeyframes(t,1500).catch(fe)}else{t=[{progress:0,value:ie({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(t,200).catch(fe)}this.current=e}},t.prototype.setLoading=function(e){this.loading!==e&&(e?this.loadingMotion.setKeyframes([{progress:0,value:{opacity:0}},{progress:.3,value:{opacity:0}},{progress:1,value:{opacity:.8}}],500).catch(fe):this.loadingMotion.set({opacity:0},0).catch(fe),this.loading=e,!0===this.disabled&&this.setDisabled(!1),this.needsRender=!0)},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,!0===this.loading&&this.setLoading(!1),this.disableMotion.set({opacity:e?1:0},300).catch(fe),this.needsRender=!0)},t.prototype.tap=function(){return Promise.resolve()},t.prototype.updateTime=function(e,t){this.opacityMotion.update(e),this.currentMotion.update(e),this.loadingMotion.update(e);var r=this.opacityMotion.value.opacity;this.visible=0!==r;var n=this.currentMotion.value,i=n.ringScale,o=n.ringOpacity,a=n.circleFade,s=n.circleOpacity,l=n.circleScale;this.ringMesh.scale.set(i,1,i),this.ringMesh.material.uniforms.opacity.value=o*r,this.panoMesh.material.uniforms.opacity.value=r,this.panoMesh.material.uniforms.circleOpacity.value=s,this.panoMesh.material.uniforms.circleScale.value=l,this.panoMesh.material.uniforms.circleFade.value=a,this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingMotion.value.opacity,this.panoMesh.material.uniforms.disable.value=this.disableMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(2*Math.PI),this.needsRender=!0},t.prototype.dispose=function(){this.hitTestMesh.material.dispose(),this.ringMesh.material.dispose(),this.panoMesh.material.dispose()},t}(n.Object3D),xs=function(e){function t(r){var n=this,i=t.parseArgs(r);(n=e.call(this,i)||this).cardboard=new fs(n.renderer);var o,a,s,l=(o="five_vr_helper_"+To(),a=gs(o),(s=document.createElement("div")).className=o,s.innerHTML=a,s);n.helperElement=l;var u=new Jo(l);return n.element.parentNode&&(n.element.parentNode.insertBefore(l,n.element),n.setHelperElementSize(),u.on("tap",(function(){return n.emit("vrWantsToExit")}))),n.destroyHelper=function(){u.destroy(),l.parentNode&&l.parentNode.removeChild(l),delete n.helperElement},n}return ne(t,e),t.parseArgs=function(r){if(r instanceof t)return r;var n=ie(ie({},r),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return e.parseArgs.call(this,n)},t.initAnimationEndPose=function(t){var r=this.parseArgs(t);return e.initAnimationEndPose.call(this,r)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper();for(var t=0,r=Object.keys(this.panoMeshes);t<r.length;t++){var n=r[t],i=this.panoMeshes[n];this.helper.remove(i),i.dispose(),delete this.panoMeshes[n]}},t.prototype.isReady=function(){return!1},t.prototype.updateRenderSize=function(){this.needsRender=!0,this.setHelperElementSize()},t.prototype.updatePanoMeshesVisible=function(){for(var e=this.works.getResolvedObserver(this.currentPanoId),t=(e?e.visibleIds:[]).concat(this.currentPanoId),r=0,n=this.works.resolvedObservers;r<n.length;r++){var i=n[r],o=this.panoMeshes[i.panoId];o&&(t.indexOf(i.panoId)>=0?o.parent!==this.helper&&this.helper.add(o):o.parent===this.helper&&(this.helper.remove(o),o.setOpacity(0)))}},t.prototype.updatePanoMeshes=function(){for(var e=0,t=Object.keys(this.panoMeshes);e<t.length;e++){var r=t[e],n=this.panoMeshes[r];this.helper.remove(n),n.dispose(),delete this.panoMeshes[r]}for(var i=0,o=this.works.resolvedObservers;i<o.length;i++){var a=o[i],s=a.panoId,l=new bs;l.name="panoSphere_".concat(s),l.position.copy(a.position),l.needsRender=!0,this.panoMeshes[s]=l}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,t){var r,i,o,a,s,l;if(!this.destroyed){var u=this.currentPanoId;this.needsRender=!0;var c={},h={};if(!1===this.locationMotion.ended){this.locationMotion.update(e);var d=this.locationMotion.getKeyFrameSegment(e),p=d[0],f=d[1],v=this.panoResourceFromLocationMotionKeyframe(p),A=this.panoResourceFromLocationMotionKeyframe(f),m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),y=v.position,b=A.position,x=this.locationMotion.value.count-f.value.count+1;c.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Lr(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,c.useBlackTransition="instant"===A.effect,A.panoPicture&&(x<1?v.panoPicture&&(c.pano0=v.panoPicture):c.pano0=A.panoPicture,c.pano1=A.panoPicture),"fade"===A.effect&&(c.pano0&&v.panoPicture&&(c.pano0={map:c.pano0.map,luminanceMap:c.pano0.luminanceMap,matrix:v.panoPicture.matrix.clone().setPosition(A.position)}),y.copy(b)),c.progress=x,h.distance=this.locationMotion.value.distance,h.offset=new n.Vector3(y.x+(b.x-y.x)*x,y.y+(b.y-y.y)*x,y.z+(b.z-y.z)*x);for(var w=[],M=[],E=0,C=this.locationMotion.keyframes;E<C.length;E++){var I=C[E],S=I.key,P=I.progress;void 0!==S&&(w.push(S),P>=this.locationMotion.progress&&M.push(S))}for(var T=0,B=Object.keys(this.panoResources);T<B.length;T++){var R=B[T];if(!(M.indexOf(R)>=0)){var O=this.panoResources[R];if(O.panoPicture){var L=O.panoPicture.map;if(L){if(L===(null===(r=c.pano0)||void 0===r?void 0:r.map))continue;if(L===(null===(i=c.pano1)||void 0===i?void 0:i.map))continue;L.dispose(),O.panoPicture=null}}w.indexOf(R)>=0||delete this.panoResources[R]}}this.currentPanoId=x<.5?v.panoId:A.panoId,this.emit("movingToPano",g.panoId,m.panoId,this.locationMotion.progress)}!1===Yo(c)&&((null===(o=c.pano0)||void 0===o?void 0:o.map)&&c.pano0.map instanceof Rt&&!c.pano0.map.cubeRenderTarget&&(c.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(a=c.pano0)||void 0===a?void 0:a.luminanceMap)&&c.pano0.luminanceMap instanceof Rt&&!c.pano0.luminanceMap.cubeRenderTarget&&(c.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),(null===(s=c.pano1)||void 0===s?void 0:s.map)&&c.pano1.map instanceof Rt&&!c.pano1.map.cubeRenderTarget&&(c.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(l=c.pano1)||void 0===l?void 0:l.luminanceMap)&&c.pano1.luminanceMap instanceof Rt&&!c.pano1.luminanceMap.cubeRenderTarget&&(c.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.model.setMaterial(c)),h.offset&&this.camera.position.copy(h.offset),this.currentPanoId!==u&&this.updatePanoMeshesVisible();var D=this.camera.pose.longitude,F=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.updateMatrixWorld(),this.camera.computePose();var k=this.works.getResolvedObserver(this.currentPanoId);if(k)for(var Q=0,N=k.visibleIds.concat(this.currentPanoId);Q<N.length;Q++){var V=N[Q];if(j=this.works.getResolvedObserver(V)){var U=this.panoMeshes[V];if(j.loadable||j.active){var z=U.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);z<.05?U.setOpacity(0):U.setOpacity(Lr(1.5/z,0,1)),this.currentPanoId===V&&U.setOpacity(0),U.lookAt(this.camera.position)}else U.setOpacity(0)}}for(var q=this.intersect(e),H=0,_=this.works.resolvedObservers;H<_.length;H++){var j=_[H];(U=this.panoMeshes[j.panoId])&&(U.setCurrent(U===q),U.updateTime&&U.updateTime(e,t))}D===this.camera.pose.longitude&&F===this.camera.pose.latitude||(this.cameraMotion.set(Yn(this.camera.pose,["longitude","latitude"]),0).catch(fe),this.emit("cameraDirectionUpdate",Yn(this.camera.pose,["longitude","latitude"]),!0),this.emit("cameraUpdate",Xo(Yn(this.camera.pose,["longitude","latitude","fov","offset","distance"])),!0))}},t.prototype.render=function(){this.cardboard.render(this.scene,this.camera)},t.prototype.setCamera=function(e){},t.prototype.destroyHelper=function(){},t.prototype.setHelperElementSize=function(){if(this.helperElement){var e=new n.Vector2(this.element.offsetWidth,this.element.offsetHeight),t=e.x*this.scissor.left,r=e.y*(1-this.scissor.bottom-this.scissor.height),i=e.x*this.scissor.width,o=e.y*this.scissor.height;this.helperElement.style.marginLeft=t+"px",this.helperElement.style.marginTop=r+"px",this.helperElement.style.width=i+"px",this.helperElement.style.height=o+"px"}},t.prototype.intersect=function(e){var t;if(!1===this.locationMotion.ended)return this.intersectMesh.visible=!1,delete this.activePanoMesh,void delete this.activeTime;if(this.activePanoMesh&&this.activeTime&&e-this.activeTime>1500){for(var r=this.activePanoMesh,i=null,o=0,a=Object.keys(this.panoMeshes);o<a.length;o++){var s=a[o];if(this.panoMeshes[s]===r){i=s;break}}return null!==i&&this.moveToPano(i,{},!0),delete this.activePanoMesh,delete this.activeTime,r}for(var l=this.camera.getDirection(new n.Vector3),u=new n.Raycaster(this.camera.position,l),c=void 0,h=[],d=this.works.getResolvedObserver(this.currentPanoId),p=0,f=d?d.visibleIds:[];p<f.length;p++){i=f[p];var v=this.panoMeshes[i],A=u.intersectObject(null!==(t=v.hitTestMesh)&&void 0!==t?t:v,!0)[0];A&&h.push({panoMesh:v,intersection:A})}var m=h.sort((function(e,t){return e.intersection.distance-t.intersection.distance}))[0];if(m?(c=m.intersection,this.activePanoMesh!==m.panoMesh&&(this.activePanoMesh=m.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(m.panoMesh.position),this.intersectMesh.lookAt(this.camera.position),this.intersectMesh.visible=!1):(this.activePanoMesh=void 0,this.activeTime=void 0),!c)if((c=this.model.intersectRaycaster(u)[0])&&c.face){var g=c.face.normal,y=new n.Quaternion;y.setFromUnitVectors(new n.Vector3(0,0,1),g),this.intersectMesh.quaternion.copy(y);var b=g.clone().multiplyScalar(.05),x=c.point.clone().add(b);this.intersectMesh.position.copy(x),this.intersectMesh.visible=!0,this.emit("intersectionOnModelUpdate",c,this.intersectMesh)}else this.intersectMesh.visible=!1,this.emit("intersectionHidden");return null==m?void 0:m.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t}(za),ws=new n.Vector3(0,1.6,0),Ms=function(e){function t(r){var n,i,o,a=this,s=t.parseArgs(r);a=e.call(this,s)||this;var l=s.initial,u=l.state,c=l.currentState;return a.currentPanoId=null!==(n=u.panoId)&&void 0!==n?n:c.panoId,a.locationMotion=new fo({x:a.camera.pose.offset.x,y:a.camera.pose.offset.y,z:a.camera.pose.offset.z,distance:a.camera.pose.distance,modelAlpha:null!==(o=null===(i=a.model.getMaterial())||void 0===i?void 0:i.modelAlpha)&&void 0!==o?o:0,perspToOrtho:a.camera.perspToOrtho.x,orthoDistance:a.camera.orthoDistance}),a}return ne(t,e),t.parseArgs=function(r){return r instanceof t?r:e.parseArgs.call(this,r)},t.initAnimationEndPose=function(t){var r=this.parseArgs(t);return e.initAnimationEndPose.call(this,r)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return!1!==this.locationMotion.ended},t.prototype.updateWork=function(e,t,r,n){var i;this.works=e,this.currentPanoId=null!==(i=t.panoId)&&void 0!==i?i:this.currentPanoId,this.hideIntersectMesh();var o={duration:0,longitude:t.longitude,latitude:t.latitude,fov:t.fov};return this.moveToPano(this.currentPanoId,o,n),!0},t.prototype.updateTime=function(e,t){var r;if(!this.destroyed){var i={},o={};if(!this.locationMotion.ended){this.locationMotion.update(e),i.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Lr(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,o.distance=this.locationMotion.value.distance,o.offset=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var a=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=Wo(this.works.resolvedObservers,(function(e){return e.position.distanceTo(a)}));this.currentPanoId=null!==(r=null==s?void 0:s.panoId)&&void 0!==r?r:""}this.cameraMotion.ended||(this.cameraMotion.update(e),o.longitude=this.cameraMotion.value.longitude,o.latitude=this.cameraMotion.value.latitude,o.fov=this.cameraMotion.value.fov),Yo(i)||this.model.setMaterial(i),Yo(o)||this.setCamera(o)}},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise((function(r){var n,i=e.initial,o=i.state,a=i.currentState,s=i.duration,l=i.userAction,u=t.initAnimationEndPose(e),c=null!==(n=o.panoId)&&void 0!==n?n:a.panoId;e.userAction=l,e.moveToPano(c,{longitude:u.longitude,latitude:u.latitude,fov:u.fov,duration:s,moveStartCallback:function(t,r){e.emit("initAnimationWillStart",t,r,e.userAction)},moveEndCallback:function(t,n){e.emit("initAnimationEnded",t,n,e.userAction),r()},moveCancelCallback:function(){var t=e.currentPanoId,n={longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance};e.emit("initAnimationEnded",t,n,e.userAction),r()}},l)}))},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(Ae())[1],t=this.locationMotion.getKeyFrameSegment(Ae())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new n.Vector3(t.value.x,t.value.y,t.value.z),distance:t.value.distance}},t.prototype.moveToPano=function(e,t,r){void 0===t&&(t={});var n=this.works.getResolvedObserver(e);n&&this.moveToPosition(n.position,t,r)},t.prototype.moveToPosition=function(e,t,r){var i,o,a,s,l=this;void 0===t&&(t={}),this.userAction=r;for(var u=Ae(),c=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),h=c.distanceTo(e),d=this.locationMotion.getProgressVelocity(u),p=0,f=1;f<this.locationMotion.keyframes.length;f++){var v=this.locationMotion.keyframes[f-1].value,A=v.x,m=v.y,g=v.z,y=this.locationMotion.keyframes[f].value,b=y.x,x=y.y,w=y.z;p+=Math.sqrt(Math.pow(b-A,2)+Math.pow(x-m,2)+Math.pow(w-g,2))}var M=0===h?0:d*p/h,E=this.calculateMovingDuration(t.duration,h),C={x:e.x,y:e.y,z:e.z,distance:0,modelAlpha:1,perspToOrtho:0,orthoDistance:1},I={longitude:t.longitude,latitude:t.latitude,fov:t.fov},S={longitude:null!==(i=I.longitude)&&void 0!==i?i:this.camera.pose.longitude,latitude:null!==(o=I.latitude)&&void 0!==o?o:this.camera.pose.latitude,fov:null!==(a=I.fov)&&void 0!==a?a:this.camera.pose.fov,offset:e.clone(),distance:0},P=Wo(this.works.resolvedObservers,(function(e){return e.position.distanceTo(c)})),T=null!==(s=null==P?void 0:P.panoId)&&void 0!==s?s:"";this.emit("moveToPano",T,this.userAction),t.moveStartCallback&&t.moveStartCallback(T,S),this.emit("panoWillArrive",T,S,this.userAction),this.cameraMotion.set(I,E).catch(fe),this.locationMotion.set(C,E,M).then((function(){var e=Xo(l.camera.pose);t.moveEndCallback&&t.moveEndCallback(T,e),l.emit("panoArrived",T,e,l.userAction)}),(function(){t.moveCancelCallback&&t.moveCancelCallback(),l.emit("moveToPanoCanceled",T)}))},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","tap",t,!0)){var r=this.relativeClientPosition(e.center),i=new n.Raycaster;if(i.setFromCamera(r,this.camera),!this.emit("wantsTapGesture",i,r,!0)){this.emit("gesture","tap",t,!0),this.emit("tapGesture",i,r,!0),this.interiaMovement=!1;var o=this.model.intersectRaycaster(i)[0];if(o&&o.face){var a=o.face.normal,s=o.point;if(new n.Vector3(0,1,0).angleTo(a)>Math.PI/3){var l=a.clone().setLength(.3).add(s);i.set(l,new n.Vector3(0,-1,0)),o=this.model.intersectRaycaster(i)[0]}}if(o){var u=(new n.Vector3).copy(o.point).add(ws),c=Wo(this.works.resolvedObservers,(function(e){return e.position.distanceTo(u)}),!0),h=c[0],d=c[1];return h&&d<5&&(u.y=h.position.y),void this.moveToPosition(u,{},!0)}this.cameraBounce()}}},t}(Aa),Es=function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("{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-aNb-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-<-aNb9-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"),Cs=function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("{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"),Is=Object.assign({opacity:new n.Uniform(1),scale:new n.Uniform(13.1),panoMap:new n.Uniform(null),panoDisplacementMap:new n.Uniform(null),panoPosition:new n.Uniform(new n.Vector3),panoMatrix:new n.Uniform(new n.Matrix4)},{emissive:new n.Uniform(new n.Color(0)),emissiveMap:new n.Uniform(null),specular:new n.Uniform(new n.Color(1118481)),specularMap:new n.Uniform(null),normalMap:new n.Uniform(null),bumpMap:new n.Uniform(null),shininess:new n.Uniform(30)},n.UniformsLib.common,n.UniformsLib.lights),Ss=new n.SphereBufferGeometry(.01,128,128);var Ps=function(){function e(){this.textureLoader=new Ot}return e.prototype.load=function(e,t,r,i,o,a,s){var l=[0,0],u=function(e,t){l[t]=e,a(.8*l[0]+.2*l[1])},c=[this.textureLoader.loadTexture(e,{imageURL:r.imageURL,viaAjax:!0,allowHosts:r.allowHosts,networkSubscribe:r.networkSubscribe,requestProxy:r.requestProxy},void 0,void 0,(function(e){return u(e,1)}),s),this.textureLoader.loadCubeTexture(t,{imageURL:r.imageURL,viaAjax:!0,allowHosts:r.allowHosts,networkSubscribe:r.networkSubscribe,requestProxy:r.requestProxy},void 0,void 0,(function(e){return u(e,0)}),s)];return Promise.all(c).then((function(e){var t=e[0],o=e[1],a=function(e,t,r,i){var o=new n.ShaderMaterial({side:n.BackSide,vertexShader:Es,fragmentShader:Cs,transparent:!0,uniforms:n.UniformsUtils.clone(Is)}),a=t;return a.needsUpdate=!0,a.minFilter=n.LinearFilter,a.magFilter=n.LinearFilter,e.needsUpdate=!0,e.minFilter=n.LinearFilter,e.magFilter=n.LinearFilter,o.uniforms.opacity.value=0,o.uniforms.panoMap.value=a,o.uniforms.panoDisplacementMap.value=e,o.uniforms.panoPosition.value=r,o.uniforms.panoMatrix.value=i,Object.assign(new n.Mesh(Ss,o),{frustumCulled:!1,dispose:function(){this.material instanceof n.ShaderMaterial&&(this.material.uniforms.panoDisplacementMap.value.dispose(),this.material.uniforms.panoDisplacementMap.value=null,this.material.dispose())}})}(t.body,o.body,r.position,r.matrix),s={body:a,meta:ue([t.meta],o.meta,!0)};return i(s),s})).catch((function(e){for(var t=0,r=c;t<r.length;t++){r[t].then((function(e){return e.body.dispose()})).catch(fe)}return o(e),Promise.reject(e)}))},e}(),Ts=new n.Vector3(-1,1,1),Bs=function(e){function t(r){var i,o,a,s,l,u,c=this,h=t.parseArgs(r);c=e.call(this,h)||this;var d=h.initial,p=d.state,f=d.currentState;return c.currentPanoId=null!==(i=p.panoId)&&void 0!==i?i:f.panoId,c.maxAccessibleDistance=h.maxAccessibleDistance,c.panoTapTriggerRadius=h.panoTapTriggerRadius,c.panoCircleMeshCreator=h.panoCircleMeshCreator,c.panoModelGroup=new n.Group,c.panoModelGroup.name="panoModels",c.scene.add(c.panoModelGroup),c.panoMeshes={},c.updatePanoMeshes(),c.helper.remove(c.intersectMesh),c.locationMotion=new fo({count:0,distance:c.camera.pose.distance,modelAlpha:null!==(a=null===(o=c.model.getMaterial())||void 0===o?void 0:o.modelAlpha)&&void 0!==a?a:0,perspToOrtho:c.camera.perspToOrtho.x,orthoDistance:c.camera.orthoDistance}),c.panoResources={},c.panoResources[c.locationMotion.keyframes[0].key=c.locationMotion.keyframes[1].key=To()]={panoId:c.currentPanoId,matrix:null!==(u=null===(l=null===(s=c.model.getMaterial())||void 0===s?void 0:s.pano1)||void 0===l?void 0:l.matrix)&&void 0!==u?u:new n.Matrix4,position:c.camera.pose.offset.clone(),effect:"fly"},c.depthTextureLoader=new Ps,c}return ne(t,e),t.parseArgs=function(r){var n,i,o;if(r instanceof t)return r;var a=e.parseArgs.call(this,r);return ie(ie({},a),{maxAccessibleDistance:null!==(n=r.maxAccessibleDistance)&&void 0!==n?n:5,panoTapTriggerRadius:null!==(i=r.panoTapTriggerRadius)&&void 0!==i?i:1,panoCircleMeshCreator:null!==(o=r.panoCircleMeshCreator)&&void 0!==o?o:function(e){return new mo}})},t.initAnimationEndPose=function(t){var r=this.parseArgs(t);return e.initAnimationEndPose.call(this,r)},t.prototype.destroy=function(){var t;if(e.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.pendingTextureTask,this.model&&(this.model.visible=!0),this.panoModelGroup){for(var r=0,n=this.panoModelGroup.children;r<n.length;r++){var i=n[r];"function"==typeof i.dispose&&i.dispose()}this.scene.remove(this.panoModelGroup)}if(this.panoMeshes)for(var o=0,a=Object.keys(this.panoMeshes);o<a.length;o++){var s=a[o],l=this.panoMeshes[s];this.helper.remove(l),l.dispose(),delete this.panoMeshes[s]}for(var u=null!==(t=this.model.getMaterial())&&void 0!==t?t:{},c=u.pano0,h=u.pano1,d=0,p=Object.keys(this.panoResources);d<p.length;d++){var f=p[d],v=this.panoResources[f];v.panoModel&&v.panoModel.material.uniforms.panoMap.value!==(null==c?void 0:c.map)&&v.panoModel.material.uniforms.panoMap.value!==(null==h?void 0:h.map)&&(this.panoModelGroup.remove(v.panoModel),v.panoModel.material.uniforms.panoMap.value.dispose(),v.panoModel.dispose(),delete v.panoModel),delete this.panoResources[f]}this.interiaMovement=!1},t.prototype.isReady=function(){return!1===this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.updateWork=function(e,t,r,n){var i;return this.works=e,this.currentPanoId=null!==(i=t.panoId)&&void 0!==i?i:this.currentPanoId,this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(this.currentPanoId,{effect:"fade",duration:r,longitude:t.longitude,latitude:t.latitude,fov:t.fov},n),!0},t.prototype.updateTime=function(e,t){var r,i,o=this;if(!this.destroyed){this.currentPanoId;var a={},s={},l=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),u=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),c=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var h=this.locationMotion.getKeyFrameSegment(e),d=h[0],p=h[1],f=this.panoResourceFromLocationMotionKeyframe(d),v=this.panoResourceFromLocationMotionKeyframe(p),A=(new n.Vector3).copy(f.position),m=(new n.Vector3).copy(v.position),g=this.locationMotion.value.count-p.value.count+1;a.progress=g,a.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Lr(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance;for(var y=0,b=this.panoModelGroup.children;y<b.length;y++){var x=b[y];x.visible=x===f.panoModel||x===v.panoModel}f.panoModel&&(f.panoModel.material.uniforms.opacity.value=1-g,f.panoModel.material.depthTest=0!==g),v.panoModel&&(v.panoModel.material.uniforms.opacity.value=g,v.panoModel.material.depthTest=1!==g),v.panoModel&&(g<1?f.panoModel&&(a.pano0={map:f.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:f.matrix}):a.pano0={map:v.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:v.matrix},a.pano1={map:v.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:v.matrix}),c=a.useBlackTransition="instant"===v.effect||"montage"===v.effect,"fade"!==v.effect&&"montage"!==v.effect||(a.pano0&&(a.pano0={map:a.pano0.map,luminanceMap:null,matrix:f.matrix.clone().setPosition(v.position)}),A.copy(m)),s.distance=this.locationMotion.value.distance,s.offset=new n.Vector3(A.x+(m.x-A.x)*g,A.y+(m.y-A.y)*g,A.z+(m.z-A.z)*g);for(var w=[],M=[],E=0,C=this.locationMotion.keyframes;E<C.length;E++){var I=C[E],S=I.key,P=I.progress;void 0!==S&&(w.push(S),P>=this.locationMotion.progress&&M.push(S))}for(var T=0,B=Object.keys(this.panoResources);T<B.length;T++){var R=B[T];if(!(M.indexOf(R)>=0)){var O=this.panoResources[R];if(O.panoModel){if(O.panoModel.material.uniforms.panoMap.value===(null===(r=a.pano0)||void 0===r?void 0:r.map))continue;if(O.panoModel.material.uniforms.panoMap.value===(null===(i=a.pano1)||void 0===i?void 0:i.map))continue;this.panoModelGroup.remove(O.panoModel),O.panoModel.material.uniforms.panoMap.value.dispose(),O.panoModel.dispose(),delete O.panoModel}w.indexOf(R)>=0||delete this.panoResources[R]}}this.currentPanoId=v.panoId,this.emit("movingToPano",u.panoId,l.panoId,this.locationMotion.progress)}!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),s.longitude=this.cameraMotion.value.longitude,s.latitude=this.cameraMotion.value.latitude,s.fov=this.cameraMotion.value.fov),!1===Yo(a)&&this.model.setMaterial(a),!1===Yo(s)&&this.setCamera(s);var L=this.works.getResolvedObserver(this.currentPanoId),D=this.locationMotion.ended?this.getForwardPanoIndexOrNot():null;if(this.camera.pose.distance>.1||c){if(L)for(var F=0,k=Object.keys(this.panoMeshes);F<k.length;F++){var Q=k[F];(_=this.panoMeshes[Q]).setOpacity(0),_.setCurrent(!1),_.updateTime&&_.updateTime(e,t)}}else if(L){var N=Wo(L.visibleIds,(function(e){var t=o.works.getResolvedObserver(e);return t?L.standingPosition.distanceTo(t.standingPosition):1/0}),!0),V=N[1];V=Lr(V,2.5,1/0);for(var U=L.visibleIds.concat(this.currentPanoId),z=this.camera.getDirection(new n.Vector3),q=0,H=Object.keys(this.panoMeshes);q<H.length;q++){Q=H[q];var _=this.panoMeshes[Q],j=this.works.getResolvedObserver(Q);if(-1===U.indexOf(Q))_.setCurrent(!1),_.setOpacity(0);else if(j)if(j.loadable||j.active){var G=_.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);_.setCurrent(!_.loading&&0===_.progress&&D===Q),_.setOpacity(G<.01?0:Lr(V/G*1.2,.4,.85));var K=this.camera.position.clone().setY(_.position.y),W=(new n.Vector3).copy(_.position).sub(K).normalize();if(Q===this.currentPanoId){var Y=Lr((.5-K.distanceTo(_.position))/.5,0,1);W.multiplyScalar(1-Y).add(z.clone().multiplyScalar(Y))}W.length()>0&&_.quaternion.setFromEuler(new n.Euler(0,Math.atan2(W.x,W.z),0))}else _.setCurrent(!1),_.setOpacity(0);else _.setCurrent(!1),_.setOpacity(0);_.updateTime&&_.updateTime(e,t)}}}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(Ae())[1],t=this.locationMotion.getKeyFrameSegment(Ae())[1],r=this.panoResourceFromLocationMotionKeyframe(t),n=this.works.getResolvedObserver(r.panoId);return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:n?n.position.clone():this.camera.position.clone(),distance:0}},t.prototype.moveToPano=function(e,t,r){var i,o=this;void 0===t&&(t={});var a=this.works.getResolvedObserver(e);if(!a)throw new Error("panoId ".concat(e," is not found."));this.userAction=r;var s=a.images.depth,l=ie({key:"pano.".concat(a.panoId)},Yn(this.imageOptions,["format","size","quality","sharpen","mappings"])),u=this.imageOptions.transform,c=a.images,h=a.position,d=a.quaternion,p=(new n.Matrix4).compose(h,d,new n.Vector3(-1,1,1)),f="pano:"+Jn(c);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===f)return;var v=this.pendingTextureTask.panoId;null===(i=this.panoMeshes[v])||void 0===i||i.setProgress(0),this.emit("textureAbort",v),this.pendingTextureTask.onError(new Error("texture aborted"))}var A="move-to-pano-"+e;this.pending.add(A),this.pendingTextureTask={panoId:e,hash:f,onLoad:function(r){o.pending.delete(A),o.destroyed?r.body.dispose():(r.body.name=f,o.emit("panoLoaded",e),o.doMoveToPano(e,r.body,t))},onError:function(r){o.pending.delete(A),t.moveCancelCallback&&t.moveCancelCallback(),o.emit("panoLoadError",r,e),o.emit("moveToPanoCanceled",e)}};var m=this.panoMeshes[e];m&&m.tap&&m.tap(),this.depthTextureLoader.load(s,c,{imageURL:{transform:u,options:l},position:h,matrix:p,allowHosts:a.work.allowHosts,networkSubscribe:this.networkSubscribe,requestProxy:this.requestProxy},(function(t){var r,n;(null===(r=o.pendingTextureTask)||void 0===r?void 0:r.hash)===f?(o.pendingTextureTask.onLoad(t),null===(n=o.panoMeshes[e])||void 0===n||n.setProgress(0),delete o.pendingTextureTask,o.emit("textureLoaded",e,t.meta)):t.body.dispose()}),(function(t){var r,n;(null===(r=o.pendingTextureTask)||void 0===r?void 0:r.hash)===f&&(o.pendingTextureTask.onError(t),null===(n=o.panoMeshes[e])||void 0===n||n.setProgress(0),delete o.pendingTextureTask,o.emit("textureError",t,e),o.emit("error",t))}),(function(t){var r,n;o.emit("textureLoading",t,e),(null===(r=o.pendingTextureTask)||void 0===r?void 0:r.hash)===f&&(null===(n=o.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer),this.emit("textureStartLoad",e)},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise((function(r){var n,i=e.initial,o=i.state,a=i.currentState,s=i.duration,l=i.userAction,u=t.initAnimationEndPose(e),c=null!==(n=o.panoId)&&void 0!==n?n:a.panoId,h=!1;e.userAction=l,e.moveToPano(c,{longitude:u.longitude,latitude:u.latitude,fov:u.fov,duration:s,moveStartCallback:function(t,r){h=!0,e.emit("initAnimationWillStart",t,r,e.userAction)},moveEndCallback:function(t,n){e.emit("initAnimationEnded",t,n,e.userAction),r()},moveCancelCallback:function(){var t=Xo(e.camera.pose);!1===h&&e.emit("initAnimationWillStart",e.currentPanoId,t,e.userAction),e.emit("initAnimationEnded",e.currentPanoId,t,e.userAction),r()}},l)}))},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var t=0,r=1;r<e.length;r++){var n=this.panoResourceFromLocationMotionKeyframe(e[r-1]).position,i=this.panoResourceFromLocationMotionKeyframe(e[r]).position;t+=n.distanceTo(i)*(e[r].value.count-e[r-1].value.count)}return t},t.prototype.updatePanoMeshes=function(){for(var e=this,t={},r=0,n=Object.keys(this.panoMeshes);r<n.length;r++){var i=n[r];t[(f=this.panoMeshes[i]).name]=f,delete this.panoMeshes[i]}for(var o=1,a={},s=function(t){var r=Wo(t.accessibleIds,(function(r){var n=e.works.getResolvedObserver(r);return n?Lr(n.standingPosition.distanceTo(t.standingPosition),1,1/0):1/0}),!0)[1];void 0===a[t.index]&&(a[t.index]=r)},l=0,u=this.works.resolvedObservers;l<u.length;l++){s(p=u[l])}var c=Object.keys(a).map((function(e){return a[e]}));c.length&&(o=Lr(.6*(c.reduce((function(e,t){return e+t}),0)/c.length),1,3));for(var h=0,d=this.works.resolvedObservers;h<d.length;h++){var p,f=void 0;t[(p=d[h]).panoId]?(!0===(f=t[p.panoId]).loading&&!1===p.loadable&&f.setLoading(!1),delete t[p.panoId]):((f=this.panoCircleMeshCreator(p.panoId)).name="PanoCircleMesh_"+p.panoId,this.helper.remove(f)),f.scale.set(o,1,o),f.position.copy(p.standingPosition),this.panoMeshes[p.panoId]=f}for(var v=0,A=Object.keys(t);v<A.length;v++){var m=A[v];this.helper.remove(t[m]),t[m].dispose(),delete t[m]}},t.prototype.doMoveToPano=function(e,t,r){var i,o,a,s,l=this;void 0===r&&(r={});var u=Ae(),c=To(),h=this.works.getResolvedObserver(e);if(!h)throw new Error("panoId ".concat(e," never found"));var d=this.panoResources[c]={panoId:e,effect:null!==(i=r.effect)&&void 0!==i?i:"fly",panoModel:t,matrix:(new n.Matrix4).compose(h.position,h.quaternion,Ts),position:h.position.clone()};t.visible=!1,t.renderOrder=-1,this.panoModelGroup.add(t);var p,f,v;if(this.locationMotion.ended){var A=this.locationMotion.getKeyFrameSegment(u);A[0];var m=A[1],g=this.locationMotion.value,y=this.panoResourceFromLocationMotionKeyframe(m).position,b=d.position;p=Math.max(y.distanceTo(b),1),f=[{key:m.key,progress:0,value:ie(ie({},g),{count:0})},{key:c,progress:1,value:{distance:0,perspToOrtho:0,modelAlpha:0,orthoDistance:1,count:1}}],v=0}else{var x=this.locationMotion.getKeyFrameSegment(u),w=x[0],M=(m=x[1],g=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(w).position),E=(y=this.panoResourceFromLocationMotionKeyframe(m).position,b=d.position,m.value.count-g.count),C=Math.max(M.distanceTo(y),1)*E;p=C+Math.max(y.distanceTo(b),1),f=[{key:w.key,progress:0,value:ie({},g)},{key:m.key,progress:C/p,value:m.value},{key:c,progress:1,value:{count:m.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var I=this.locationMotionKeyframesLength(this.locationMotion.keyframes),S=this.locationMotionKeyframesLength(f);v=0===I||0===I?0:this.locationMotion.getProgressVelocity(u)*I/S}var P=this.calculateMovingDuration(r.duration,"fade"===r.effect||"montage"===r.effect?0:p),T={longitude:r.longitude,latitude:r.latitude,fov:r.fov},B={longitude:null!==(o=T.longitude)&&void 0!==o?o:this.camera.pose.longitude,latitude:null!==(a=T.latitude)&&void 0!==a?a:this.camera.pose.latitude,fov:null!==(s=T.fov)&&void 0!==s?s:this.camera.pose.fov,offset:h.position.clone(),distance:this.camera.pose.distance};this.emit("moveToPano",e,this.userAction),r.moveStartCallback&&r.moveStartCallback(e,B),this.emit("panoWillArrive",e,B,this.userAction),this.cameraMotion.set(T,P).catch(fe),this.locationMotion.setKeyframes(f,P,v).then((function(){var t={longitude:l.camera.pose.longitude,latitude:l.camera.pose.latitude,fov:l.camera.pose.fov,offset:l.camera.pose.offset.clone(),distance:l.camera.pose.distance};r.moveEndCallback&&r.moveEndCallback(e,t),l.emit("panoArrived",e,t,l.userAction)}),(function(){r.moveCancelCallback&&r.moveCancelCallback(),l.emit("moveToPanoCanceled",e)}))},t.prototype.getForwardPanoIndexOrNot=function(e){var t,r=this,i=this.camera.getDirection(new n.Vector3),o=this.camera.position.clone(),a=this.works.getResolvedObserver(this.currentPanoId);if(!a)return null;var s=a.accessibleIds.filter((function(e){if(e===r.currentPanoId)return!1;var t=r.works.getResolvedObserver(e);if(!t)return!1;var i=t.standingPosition.clone().sub(o);return 0!==i.length()&&(!(i.angleTo(new n.Vector3(0,-1,0))<Math.PI/12)&&(t.loadable||t.active))})),l=(e?e.ray.direction.clone():i.clone()).setY(0);if(0===l.length())return null;for(var u=s.slice().sort((function(e,t){var n=r.works.getResolvedObserver(e).position.clone().setY(o.y),i=r.works.getResolvedObserver(t).position.clone().setY(o.y);return n.distanceTo(o)-i.distanceTo(o)})),c=0,h=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];c<h.length;c++)for(var d=h[c],p=0,f=u;p<f.length;p++){var v=f[p],A=null===(t=this.works.getResolvedObserver(v))||void 0===t?void 0:t.position.clone().setY(o.y).sub(o);if(A&&0!==A.length()&&l.angleTo(A)<d)return v}return null},t.prototype.onTapGesture=function(e){var t=this,r=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","tap",r,!0)){var i=this.relativeClientPosition(e.center),o=new n.Raycaster;if(o.setFromCamera(i,this.camera),!this.emit("wantsTapGesture",o,i,!0)){this.emit("gesture","tap",r,!0),this.emit("tapGesture",o,i,!0),this.interiaMovement=!1;var a=this.camera.getDirection(new n.Vector3).setY(0),s=null,l=this.works.getResolvedObserver(this.currentPanoId);if(l){var u=l.accessibleIds.filter((function(e){if(e===t.currentPanoId)return!1;var r=t.works.getResolvedObserver(e);return!!r&&(!(r.position.distanceTo(t.camera.position)>t.maxAccessibleDistance)&&(r.loadable||r.active))})),c=o.intersectObject(this.boundingMesh,!0)[0];if(c){var h=Wo(u,(function(e){var r=t.works.getResolvedObserver(e).standingPosition.clone();return r.clone().sub(t.camera.position).setY(0).angleTo(a)>Math.PI/2?1/0:r.distanceTo(c.point)}),!0),d=h[0],p=h[1];!So(d)&&p<this.panoTapTriggerRadius&&(s=d)}So(s)&&(s=this.getForwardPanoIndexOrNot(o));for(var f=0,v=this.locationMotion.keyframes;f<v.length;f++){var A=v[f],m=this.panoResourceFromLocationMotionKeyframe(A);if(!(A.progress<this.locationMotion.progress)&&m.panoId===s){s=null;break}}if(this.emit("panoSelected",s),So(s))!0===this.locationMotion.ended&&this.cameraBounce();else{var g=this.works.getResolvedObserver(s);if(!g||g.active){var y={};if(g){for(var b=Math.PI/6,x=Math.PI/12,w=new n.Vector3(0,1,0),M=g.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),E=M.clone().applyAxisAngle(w,b),C=M.clone().applyAxisAngle(w,-b),I=[],S=[],P=[],T=0,B=g.accessibleIds;T<B.length;T++){if((d=B[T])!==this.currentPanoId&&d!==s){var R=this.works.getResolvedObserver(d);if(R){var O=R.position.clone().sub(g.position).setY(0);M.angleTo(O)<b?P.push(O):E.angleTo(O)<b?I.push(O):C.angleTo(O)<b&&S.push(O)}}}var L=(P.length>0?P:ue(ue([],I,!0),S,!0)).slice().sort((function(e,t){return e.angleTo(M)-t.angleTo(M)}))[0];L&&L.angleTo(a)>x&&(y.longitude=Math.atan2(-L.x,-L.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(y.latitude=Lr(0,this.minLatitude,this.maxLatitude)),this.emit("wantsMoveToPano",s,y,!0)}else this.panoMeshes[s]&&(this.panoMeshes[s].setDisabled(!1),this.panoMeshes[s].setLoading(!0))}}}}},t}(Aa),Rs=function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{ZnvH{vs|z-znA-z|qrycvrZnvHn\bv{t-rp?-bH|vq-znv{56-\nb-J-HrpA-z]|vv|{-J-z|qrycvrZnv-7-rpA5}|vv|{9>;=6Htyl]|vv|{-J-}|wrpv|{Znv-7-z]|vv|{H\f"),Os=function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("0rr{v|{-TYlRealsntlqr}u-G-r{noyr<<-<<-nqn}rq-s|z-ur-RQY-unqr-p|qr-s|z-Puvvn{-O|pur{\b-v{-py|q-p|z}nrG<<-u}G<<tvuo;p|z<py|qp|z}nr<{x<rr<znr<}ytv{<\0RQY<unqr<RQY<<}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{H{vs|z-sy|n-prr{dvquH{vs|z-sy|n-prr{UrvtuH{vs|z-rp?-{rvtuo|h[RVTUO\\b_lP\\b[ajH{vs|z-sy|n-rqy`r{tuH{vs|z-sy|n-nqvH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-[rnH{vs|z-sy|n-SnH{vs|z-znA-]|wH{vs|z-nz}yr?Q-RQYP|y|H{vs|z-nz}yr?Q-RQYQr}uHn\bv{t-rp?-bHsy|n-r}|{r5sy|n-qr}u6\nrp?-_nqv-J-nqv-<-rp?5prr{dvqu9-prr{Urvtu6Hsy|n-z-J-=;=Hs|5v{-v-J-=H-v-I-[RVTUO\\b_lP\\b[aH-v886\nrp?-[rvtuo|-J-b-8-_nqv-7-{rvtuo|hvjHsy|n-{rvtuo|Qr}u-J-rr?Q5RQYP|y|9-[rvtuo|6;nH{rvtuo|Qr}u-J-5{rvtuo|Qr}u-JJ->;=6-L-=;=-G-{rvtuo|Qr}uHvs5{rvtuo|Qr}u-.J-=;=6\nvs5qr}u-JJ-=;=6\nz-8J->==;=H\fryr\nz-8J-zn5=;=9-qr}u-:-{rvtuo|Qr}u6H\f\f\fr{-z-<-sy|n5[RVTUO\\b_lP\\b[a6H\f|vq-znv{56\nrpA-pRQY-J-rr?Q5RQYP|y|9-b6H--sy|n-qr}u-J-pRQY;nHqr}u-J-5qr}u-JJ->;=6-L-=;=-G-qr}uHsy|n-r-J-r}|{r5qr}u6Hsy|n-unqr-J-r}5:r-7-@==;=-7-rqy`r{tu6HtylSntP|y|-J-rpA5pRQY;to-7-unqr9-|}npv\b6H\n-<<-vr-rtyn-u\b}ro|yvp-qr}u-nyr-|-qr}u-ossrsy|n-qy-J-}|5?;=9-qr}u6HrpA-q}-J-]|w-7-rpA5=;=9-=;=9-:qy9->;=6Hsy|n-}\t-J-q};\t-<-q};Hsy|n-sntQr}u-J-5}\t-8->;=6-<-?;=HtylSntQr}uRea-J-sntQr}uH\fvs5qr}u-JJ-=;=6\nqvpnqH\f\f"),Ls=function(e){function t(t){var r=e.call(this)||this;return r.uniforms={screenWidth:Ds("f",0),screenHeight:Ds("f",0),edlStrength:Ds("f",1),uNear:Ds("f",1),uFar:Ds("f",1),radius:Ds("f",1),neighbours:Ds("2fv",new Float32Array),depthMap:Ds("t",new n.Texture),uEDLColor:Ds("t",new n.Texture),uEDLDepth:Ds("t",new n.Texture),opacity:Ds("f",1),uProj:Ds("Matrix4fv",new Float32Array)},r.neighbourCount=8,r.updateShaderSource(),r.transparent=!0,r}return ne(t,e),t.prototype.getUniform=function(e){return void 0===this.uniforms?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,t){void 0!==this.uniforms&&(this.uniforms[e].value=t)},t.prototype.getDefines=function(){var e="";return e+="#define NEIGHBOUR_COUNT "+this.neighbourCount+"\n"},t.prototype.updateShaderSource=function(){var e=this.getDefines()+Rs,t=this.getDefines()+Os;this.setValues({vertexShader:e,fragmentShader:t}),this.needsUpdate=!0},oe([Fs("screenWidth"),ae("design:type",Number)],t.prototype,"screenWidth",void 0),oe([Fs("screenHeight"),ae("design:type",Number)],t.prototype,"screenHeight",void 0),oe([Fs("edlStrength"),ae("design:type",Number)],t.prototype,"edlStrength",void 0),oe([Fs("uNear"),ae("design:type",Number)],t.prototype,"uNear",void 0),oe([Fs("uFar"),ae("design:type",Number)],t.prototype,"uFar",void 0),oe([Fs("radius"),ae("design:type",Number)],t.prototype,"radius",void 0),oe([Fs("neighbours",!0),ae("design:type",Float32Array)],t.prototype,"neighbours",void 0),oe([Fs("depthMap"),ae("design:type",n.Texture)],t.prototype,"depthMap",void 0),oe([Fs("uEDLColor"),ae("design:type",n.Texture)],t.prototype,"uEDLColor",void 0),oe([Fs("uEDLDepth"),ae("design:type",n.Texture)],t.prototype,"uEDLDepth",void 0),oe([Fs("uProj"),ae("design:type",Array)],t.prototype,"uProj",void 0),t}(n.RawShaderMaterial);function Ds(e,t){return{type:e,value:t}}function Fs(e,t){return void 0===t&&(t=!1),function(r,n){Object.defineProperty(r,n,{get:function(){return this.getUniform(e)},set:function(r){r!==this.getUniform(e)&&(this.setUniform(e,r),t&&this.updateShaderSource())}})}}var ks=new n.OrthographicCamera(-1,1,1,-1,0,1),Qs=new n.BufferGeometry;Qs.setAttribute("position",new n.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),Qs.setAttribute("uv",new n.Float32BufferAttribute([0,2,0,0,2,0],2));var Ns=new n.Mesh(Qs),Vs=new n.Scene;Vs.add(Ns);var Us=function(e){function t(t){var r=e.call(this,t)||this;return r.sharedV2=new n.Vector2,r.renderer=t,r.material=new Ls,Ns.material=r.material,r}return ne(t,e),t.prototype.render=function(e,t,r){var n=r.camera,i=this.material.uniforms,o=this.renderer.getSize(this.sharedV2);i.screenWidth.value=o.x,i.screenHeight.value=o.y;var a=n.projectionMatrix,s=new Float32Array(16);s.set(a.elements);for(var l=new Float32Array(2*this.material.neighbourCount),u=0;u<this.material.neighbourCount;u++)l[2*u+0]=Math.cos(2*u*Math.PI/this.material.neighbourCount),l[2*u+1]=Math.sin(2*u*Math.PI/this.material.neighbourCount);i.neighbours.value=l,i.uNear.value=n.near,i.uFar.value=n.far,i.uEDLColor.value=e.texture,i.uEDLDepth.value=e.depthTexture,i.uProj.value=s,i.edlStrength.value=1,i.radius.value=1,i.opacity.value=1;var c=this.renderer.getRenderTarget();this.renderer.setRenderTarget(t||null),this.renderer.render(Vs,ks),this.renderer.setRenderTarget(c)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(aa),zs=.5,qs=Number.MAX_VALUE||1/0,Hs=function(e){function t(r){var i,o,a,s=this,l=t.parseArgs(r);s=e.call(this,l)||this;var u=l.initial,c=u.state,h=u.currentState;return s.currentPanoId=null!==(i=c.panoId)&&void 0!==i?i:h.panoId,s.defaultLatitude=l.defaultLatitude,s.defaultDistance=l.defaultDistance,s.maxLatitude=l.maxLatitude,s.minLatitude=l.minLatitude,s.locationMotion=new fo({x:s.camera.pose.offset.x,y:s.camera.pose.offset.y,z:s.camera.pose.offset.z,distance:s.camera.pose.distance,modelAlpha:null!==(a=null===(o=s.model.getMaterial())||void 0===o?void 0:o.modelAlpha)&&void 0!==a?a:0,perspToOrtho:s.camera.perspToOrtho.x,orthoDistance:s.camera.orthoDistance}),s.interiaMovement=!1,s.intersectMeshCreator=l.intersectMeshCreator,s.intersectMesh=s.intersectMeshCreator(),s.intersectMesh.name="intersect",s.intersectMesh.visible=!1,s.helper.add(s.intersectMesh),s.edlTarget=new n.WebGLRenderTarget(1024,1024,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,format:n.RGBAFormat,type:n.FloatType,depthTexture:new n.DepthTexture(1024,1024,n.UnsignedIntType)}),s}return ne(t,e),t.parseArgs=function(r){var n,i,o,a,s;if(r instanceof t)return r;var l=e.parseArgs.call(this,r);return ie(ie({},l),{defaultLatitude:null!==(n=r.defaultLatitude)&&void 0!==n?n:Math.PI/4,defaultDistance:null!==(i=r.defaultDistance)&&void 0!==i?i:50,maxLatitude:null!==(o=r.maxLatitude)&&void 0!==o?o:+Math.PI/2,minLatitude:null!==(a=r.minLatitude)&&void 0!==a?a:0,intersectMeshCreator:null!==(s=r.intersectMeshCreator)&&void 0!==s?s:function(){return new Io}})},t.distanceFromModel=function(e,t,r){var n=e.bounding,i=Math.pow(Math.pow(n.max.x-n.min.x+1,2)+Math.pow(n.max.y-n.min.y+1,2)+Math.pow(n.max.z-n.min.z+1,2),.5),o=i/2/Math.tan(Math.PI*t/360);return r<1&&(o/=r),isNaN(o)?i:o},t.initAnimationEndPose=function(e){var r,i,o,a,s,l,u,c=this.parseArgs(e),h=c.works,d=c.model,p=e.initial,f=p.state,v=p.currentState,A=null!==(r=f.panoId)&&void 0!==r?r:v.panoId,m=null!==(i=f.longitude)&&void 0!==i?i:v.longitude,g=Lr(null!==(o=f.latitude)&&void 0!==o?o:jo(v.mode)?v.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),y=Lr(null!==(a=f.distance)&&void 0!==a?a:c.defaultDistance,0,t.distanceFromModel(c.model,46,c.camera.aspect)),b=null!==(u=null!==(s=f.offset)&&void 0!==s?s:null===(l=h.getResolvedObserver(A))||void 0===l?void 0:l.position.clone())&&void 0!==u?u:new n.Vector3;return d.bounding.containsPoint(b)||d.bounding.getCenter(b),{longitude:m,latitude:g,fov:46,offset:b,distance:y}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.locationMotion.dispose(),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),delete this.mouseWheelState,delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return!1!==this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,n,i){var o,a,s,l,u,c,h=t.initAnimationEndPose(ie(ie({},this),{initial:{currentState:ie({panoId:this.currentPanoId,panoIndex:null!==(a=null===(o=this.works.getResolvedObserver(this.currentPanoId))||void 0===o?void 0:o.index)&&void 0!==a?a:0},this.camera.pose),duration:n,state:r,userAction:i}}));this.works=e,this.currentPanoId=null!==(s=r.panoId)&&void 0!==s?s:this.currentPanoId,this.userAction=i;var d={longitude:h.longitude,latitude:h.latitude,fov:h.fov},p={x:null===(l=h.offset)||void 0===l?void 0:l.x,y:null===(u=h.offset)||void 0===u?void 0:u.y,z:null===(c=h.offset)||void 0===c?void 0:c.z,distance:h.distance};return this.locationMotion.set(p,n).catch(fe),this.cameraMotion.set(d,n).catch(fe),!0},t.prototype.updateModel=function(t){e.prototype.updateModel.call(this,t)},t.prototype.updateTime=function(e,t){if(!this.destroyed){var r={},i={};this.locationMotion.ended||(this.locationMotion.update(e),r.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Lr(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,i.distance=this.locationMotion.value.distance,i.offset=new n.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),i.longitude=this.cameraMotion.value.longitude,i.latitude=this.cameraMotion.value.latitude,i.fov=this.cameraMotion.value.fov),Yo(r)||this.model.setMaterial(r),Yo(i)||this.setCamera(i)}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(Ae())[1],t=this.locationMotion.getKeyFrameSegment(Ae())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:t.value.distance,offset:new n.Vector3(t.value.x,t.value.y,t.value.z)}},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise((function(r){var n,i=e.initial,o=i.state,a=i.currentState,s=i.duration,l=i.userAction,u=t.initAnimationEndPose(e),c=null!==(n=o.panoId)&&void 0!==n?n:a.panoId,h={longitude:u.longitude,latitude:u.latitude,fov:u.fov},d={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance,modelAlpha:1,perspToOrtho:0,orthoDistance:u.distance};e.userAction=l,e.emit("initAnimationWillStart",c,u,e.userAction),e.cameraMotion.set(h,s).catch(fe),e.locationMotion.set(d,s).then((function(){e.emit("initAnimationEnded",c,u,e.userAction)}),(function(t){var r=Xo(e.camera.pose);e.emit("initAnimationEnded",c,r,e.userAction)})).then((function(){r()}))}))},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this.model.intersectRaycaster(e)[0];if(!t)return null;var r=Wo(this.works.resolvedObservers,(function(e){return e.standingPosition.distanceTo(t.point)}),!0),n=r[0],i=r[1];return n&&i<10?n.panoId:null},t.prototype.coordinatesForOffset=function(e){var t=this.cameraMotion.value.fov,r=this.camera.aspect,i=this.renderer.getSize(new n.Vector2);return{longitude:2*e.x/(i.x*this.scissor.width)*t/95*r,latitude:-2*e.y/(i.y*this.scissor.height)*t/95}},t.prototype.requestInteriaMovement=function(e,t){var r=this;if(!1!==this.interiaMovement){for(var i=ie({},e),o={longitude:0,latitude:0,x:0,y:0,z:0},a=0;a<t;a++)i.longitude*=.996,i.latitude*=.994008,i.x*=.99,i.y*=.99,i.z*=.99,o.longitude+=i.longitude,o.latitude+=i.latitude,o.x+=i.x,o.y+=i.y,o.z+=i.z;var s=Qo(this.cameraMotion.value.longitude+o.longitude),l=Lr(this.cameraMotion.value.latitude+o.latitude,this.minLatitude,this.maxLatitude),u=Lr(this.locationMotion.value.x+o.x,this.model.bounding.min.x,this.model.bounding.max.x),c=Lr(this.locationMotion.value.y+o.y,this.model.bounding.min.y,this.model.bounding.max.y),h=Lr(this.locationMotion.value.z+o.z,this.model.bounding.min.z,this.model.bounding.max.z),d={longitude:s,latitude:l,offset:new n.Vector3(u,c,h),fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance};this.cameraMotion.set({longitude:s,latitude:l},0).catch(fe),this.locationMotion.set({x:d.offset.x,y:d.offset.y,z:d.offset.z},0).catch(fe);var p=Math.abs(i.longitude)>1e-4||Math.abs(i.latitude)>1e-4||Math.abs(i.x)>1e-4||Math.abs(i.y)>1e-4||Math.abs(i.z)>1e-4;this.emit("interiaPan",d,!p),p?Ne.shared.add((function(e,t){r.requestInteriaMovement(i,0|t)}),!0,1):this.interiaMovement=!1}},t.prototype.stopInteriaMovement=function(){this.interiaMovement=!1},t.prototype.fixFinalPose=function(e){var t=Ut(e,new n.Vector3),r=(new n.Vector3).copy(e.offset).sub(t.clone().multiplyScalar(e.distance)),i=new n.Raycaster(r,t);i.near=zs;var o=this.model.intersectRaycaster(i)[0];o&&(e.distance=Lr(o.distance,0,qs),e.offset.copy(r).add(t.clone().multiplyScalar(e.distance)))},t.prototype.onPanGesture=function(e){var t=e.pointers.length,r=this.panState,i=0;"mouse"===e.pointerType&&(i=e.srcEvent.buttons),r&&0===i&&0!==r.buttons&&(i=r.buttons);var o=null==r?void 0:r.target;if(!o){var a=this.relativeClientPosition(e.center),s=new n.Raycaster;s.setFromCamera(a,this.camera),s.near=zs,o=(new n.Vector3).copy(s.ray.direction).multiplyScalar(3).add(s.ray.origin);var l=this.model.intersectRaycaster(s)[0];if(l)o.copy(l.point);else{var u=(new n.Vector3).copy(this.camera.pose.offset).sub(this.camera.position),c=(new n.Plane).setFromNormalAndCoplanarPoint(u,this.camera.pose.offset);s.ray.intersectPlane(c,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:i,pointerLength:t,x:e.center.x,y:e.center.y},void 0!==r&&r.pointerLength===t){var h=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","pan",h,e.isFinal))if(t>1||2===i){var d={x:e.center.x-r.x,y:e.center.y-r.y},p=(new n.Vector3).copy(this.camera.position).sub(r.target).length();p*=Math.tan(this.camera.fov/2*Math.PI/180);var f=(new n.Vector3).copy(this.camera.pose.offset),v=2*d.x*p/this.element.clientHeight,A=2*d.y*p/this.element.clientHeight,m=new n.Vector3;m.setFromMatrixColumn(this.camera.matrix,0),m.multiplyScalar(-v),f.add(m),this.camera.pose.latitude<Math.PI/12?m.setFromMatrixColumn(this.camera.matrix,1):(m.setFromMatrixColumn(this.camera.matrix,0),m.crossVectors(this.camera.up,m)),m.multiplyScalar(A),f.add(m),f.clamp(this.model.bounding.min,this.model.bounding.max);var g={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:f,distance:this.camera.pose.distance};if(this.emit("wantsPanGesture",g,e.isFinal))return;if(this.emit("gesture","pan",h,e.isFinal),this.emit("panGesture",g,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh(),this.locationMotion.set({x:g.offset.x,y:g.offset.y,z:g.offset.z},0).catch(fe),e.isFinal&&(this.fixFinalPose(g),this.locationMotion.set({distance:g.distance,x:g.offset.x,y:g.offset.y,z:g.offset.z},0).catch(fe)),e.isFinal)if(!this.emit("wantsInteriaPan",g)){this.interiaMovement=!0;var y=2*e.velocityX*p/this.element.clientHeight,b=2*e.velocityY*p/this.element.clientHeight,x=new n.Vector3,w=new n.Vector3;x.setFromMatrixColumn(this.camera.matrix,0),x.multiplyScalar(-y),w.add(x),this.camera.pose.latitude<Math.PI/4?x.setFromMatrixColumn(this.camera.matrix,1):(x.setFromMatrixColumn(this.camera.matrix,0),x.crossVectors(this.camera.up,x)),x.multiplyScalar(b),w.add(x),this.requestInteriaMovement({longitude:0,latitude:0,x:w.x,y:w.y,z:w.z},0)}}else{(d={x:e.center.x-r.x,y:e.center.y-r.y}).x*=-1,d.y*=-1;var M=this.coordinatesForOffset(d),E=Qo(this.cameraMotion.value.longitude+M.longitude),C=Lr(this.cameraMotion.value.latitude+M.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(C=this.cameraMotion.value.latitude);g={longitude:E,latitude:C,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance};if(this.emit("wantsPanGesture",g,e.isFinal))return;if(this.emit("gesture","pan",h,e.isFinal),this.emit("panGesture",g,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh(),this.cameraMotion.set({longitude:g.longitude,latitude:g.latitude},0).catch(fe),e.isFinal&&(this.fixFinalPose(g),this.locationMotion.set({distance:g.distance,x:g.offset.x,y:g.offset.y,z:g.offset.z},0).catch(fe)),e.isFinal)if(!this.emit("wantsInteriaPan",g)){this.interiaMovement=!0;var I=-1*e.velocityX,S=-1*e.velocityY;this.requestInteriaMovement(ie(ie({},this.coordinatesForOffset({x:I,y:S})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var t,r=null===(t=this.pinchState)||void 0===t?void 0:t.distance,n=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(n=!0,delete this.panState,delete this.pinchState),void 0!==r){var i=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",i,n)){var o=Lr(r/e.scale,0,qs);this.emit("wantsPinchGesture",e.scale,this.camera.pose.fov,n)||(this.emit("gesture","pinch",i,n),this.emit("pinchGesture",e.scale,this.camera.pose.fov,n),this.userAction=!0,this.interiaMovement=!1,this.locationMotion.set({distance:o},0).catch(fe),this.onPanGesture(e))}}}else this.pinchState={x:e.center.x,y:e.center.y,distance:this.locationMotion.value.distance}},t.prototype.onMouseMove=function(e){var t,r;if(this.intersectMesh.parent&&!this.model.empty&&!this.panState){var i=this.relativeClientPosition({x:e.clientX,y:e.clientY}),o=new n.Raycaster;if(o.setFromCamera(i,this.camera),o.near=zs,this.emit("wantsShowIntersectionOnModel",o))this.hideIntersectMesh();else{var a=this.model.intersectRaycaster(o)[0];if(a){var s=null!==(r=null===(t=a.face)||void 0===t?void 0:t.normal)&&void 0!==r?r:(new n.Vector3).copy(o.ray.direction).multiplyScalar(-1),l=s.clone().multiplyScalar(.05),u=a.point.clone().add(l);this.intersectMesh.position.copy(u);var c=u.clone().add(l);if(this.intersectMesh.lookAt(c),Math.abs(s.y)>.99){var h=this.camera.position.clone().sub(u);this.intersectMesh.rotation.z=-Math.atan2(h.z,h.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",a,this.intersectMesh)}else this.hideIntersectMesh()}}},t.prototype.onMouseOut=function(){this.intersectMesh.parent&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},t.prototype.onMouseWheel=function(e){var t=this,r=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,n=[{x:e.clientX,y:e.clientY,delta:r}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var i=Lr(this.locationMotion.value.distance-r/2,0,qs);this.emit("wantsMouseWheel",r,this.camera.pose.fov,!1)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",r,this.camera.pose.fov,!1),this.userAction=!0,this.locationMotion.set({distance:i},0).catch(fe),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;if(!t.emit("wantsGesture","mouseWheel",n,!0)&&!t.emit("wantsMouseWheel",r,t.camera.pose.fov,!0)){var e={distance:i,longitude:t.camera.pose.longitude,latitude:t.camera.pose.latitude,fov:t.camera.pose.fov,offset:t.camera.pose.offset.clone()};t.fixFinalPose(e);var o={x:e.offset.x,y:e.offset.y,z:e.offset.z,distance:e.distance};t.locationMotion.set(o,0).catch(fe),t.emit("gesture","mouseWheel",n,!0),t.emit("mouseWheel",0,t.camera.pose.fov,!0)}}),200)})}},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return Yn(e,["x","y"])}));if(!this.emit("wantsGesture","tap",t,!0)){var r=this.relativeClientPosition(e.center),i=new n.Raycaster;if(i.setFromCamera(r,this.camera),i.near=zs,!this.emit("wantsTapGesture",i,r,!0)){this.emit("gesture","tap",t,!0),this.emit("tapGesture",i,r,!0),this.interiaMovement=!1;var o=this.getForwardPanoIndexOrNot(i);if(!So(o)){this.emit("panoSelected",o);var a={longitude:this.camera.pose.longitude,latitude:0};this.emit("wantsMoveToPano",o,a,!0)}}}},t.prototype.onPressGesture=function(e,t){var r,i,o=[e];if(this.emit("wantsGesture","press",o,t))return null===(r=this.pressState)||void 0===r||r.stop(),void delete this.pressState;var a=this.relativeClientPosition(e),s=new n.Raycaster;if(s.setFromCamera(a,this.camera),s.near=zs,this.emit("wantsPressGesture",s,a,e.delta,t))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;this.emit("gesture","press",o,t),this.emit("pressGesture",s,a,e.delta,t)},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.emit("intersectionHidden"),this.needsRender=!0},t.prototype.postProcessing=function(e,t){if(!this.destroyed)return this.edlEffect||(this.edlEffect=new Us(this.renderer)),this.edlEffect.render(e,t,{camera:this.camera})},t}(sa),_s={type:"move"},js=function(){function e(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return e.prototype.getHandSpace=function(){return null===this._hand&&(this._hand=new n.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},e.prototype.getTargetRaySpace=function(){return null===this._targetRay&&(this._targetRay=new n.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new n.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new n.Vector3),this._targetRay},e.prototype.getGripSpace=function(){return null===this._grip&&(this._grip=new n.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new n.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new n.Vector3),this._grip},e.prototype.dispatchEvent=function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},e.prototype.disconnect=function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},e.prototype.getAxes=function(){return this._axes},e.prototype.update=function(e,t,r){var i=null,o=null,a=null,s=this._targetRay,l=this._grip,u=this._hand;if(e&&e.gamepad&&e.gamepad.axes&&(this._axes=[e.gamepad.axes[2],e.gamepad.axes[3]]),e&&"visible-blurred"!==t.session.visibilityState)if(null!==s&&null!==(i=t.getPose(e.targetRaySpace,r))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(_s)),u&&e.hand){a=!0;for(var c=0,h=e.hand.values();c<h.length;c++){var d=h[c],p=t.getJointPose(d,r);if(void 0===u.joints[d.jointName]){var f=new n.Group;f.matrixAutoUpdate=!1,f.visible=!1,u.joints[d.jointName]=f,u.add(f)}var v=u.joints[d.jointName];null!==p&&(v.matrix.fromArray(p.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=p.radius),v.visible=null!==p}var A=u.joints["index-finger-tip"],m=u.joints["thumb-tip"],g=A.position.distanceTo(m.position);u.inputState.pinching&&g>.025?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&g<=.015&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==l&&e.gripSpace&&null!==(o=t.getPose(e.gripSpace,r))&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1);return null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==o),null!==u&&(u.visible=null!==a),this},e}(),Gs=function(e){function t(t,r,i){var o,a,s,l=this;return(l=e.call(this)||this).isPanorama=null===(o=null==i?void 0:i.isPanorama)||void 0===o||o,l.machineType=null!==(a=null==i?void 0:i.machineType)&&void 0!==a?a:"Pico",l.renderer=t,l.gl=r,l.enabled=!1,l.session=null,l.referenceSpaceType=null!==(s=null==i?void 0:i.referenceSpaceType)&&void 0!==s?s:"local-floor",l.referenceSpace=null,l.controllers=[new js,new js],l.inputSourcesMap=new Map,l.cameraVR=new n.ArrayCamera,l.cameraL=new n.PerspectiveCamera,l.cameraR=new n.PerspectiveCamera,l.cameraL.viewport=new n.Vector4,l.cameraR.viewport=new n.Vector4,l.cameraL.layers.enable(1),l.cameraR.layers.enable(2),l.cameraVR.layers.enable(1),l.cameraVR.layers.enable(2),l.isPresenting=!1,l.currentDepthNear=null,l.currentDepthFar=null,l.cameraLPos=new n.Vector3,l.cameraRPos=new n.Vector3,l}return ne(t,e),t.prototype.getController=function(e){var t=this.controllers[e];return t||console.warn("no controller find"),t.getTargetRaySpace()},t.prototype.getControllerGrip=function(e){var t=this.controllers[e];return t||console.warn("no controller find"),t.getGripSpace()},t.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},t.prototype.updateCamera=function(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)},t.prototype.setProjectionFromUnion=function(e,t,r){this.cameraLPos.setFromMatrixPosition(t.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var n=this.cameraLPos.distanceTo(this.cameraRPos),i=t.projectionMatrix.elements,o=r.projectionMatrix.elements,a=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],u=(i[9]-1)/i[5],c=(i[8]-1)/i[0],h=(o[8]+1)/o[0],d=a*c,p=a*h,f=n/(-c+h),v=f*-c;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(v),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var A=a+f,m=s+f,g=d-v,y=p+(n-v),b=l*s/m*A,x=u*s/m*A;e.projectionMatrix.makePerspective(g,y,b,x,A,m)},t.prototype.getCamera=function(e){this.cameraVR.near=this.cameraR.near=this.cameraL.near=e.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=e.far,!this.session||this.currentDepthNear===this.cameraVR.near&&this.currentDepthFar===this.cameraVR.far||(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var t=e.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,t);for(var n=0;n<r.length;n++)this.updateCamera(r[n],t);e.matrixWorld.copy(this.cameraVR.matrixWorld);for(var i=e.children,o=(n=0,i.length);n<o;n++)i[n].updateMatrixWorld(!0);return 2===r.length?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},t.prototype.updateInputSources=function(e){if(this.session){for(var t=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(t[r],this.controllers[r]);for(r=0;r<e.removed.length;r++){var n=e.removed[r];(i=this.inputSourcesMap.get(n))&&(i.dispatchEvent({type:"disconnected",data:n}),this.inputSourcesMap.delete(n))}for(r=0;r<e.added.length;r++){var i;n=e.added[r];(i=this.inputSourcesMap.get(n))&&i.dispatchEvent({type:"connected",data:n})}}else console.warn("session is lose!")},t.prototype.onSessionEvent=function(e){var t=this.inputSourcesMap.get(e.inputSource);t&&t.dispatchEvent({type:e.type})},t.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach((function(e,t){e.disconnect(t)})),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,Ne.shared.setContext(null),this.emit("webXRSessionEnd")},t.prototype.onRequestReferenceSpace=function(e){this.referenceSpace=e,this.isPresenting=!0,this.emit("webXRSessionStart")},t.prototype.setSession=function(e){var t=this;if(this.session=e,this.session){this.session.addEventListener("select",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("selectstart",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("selectend",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("squeeze",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("squeezestart",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("squeezeend",(function(e){t.onSessionEvent(e)})),this.session.addEventListener("end",(function(e){t.onSessionEnd()}));var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then((function(){var e={antialias:null==r?void 0:r.antialias,alpha:null==r?void 0:r.alpha,depth:null==r?void 0:r.depth,stencil:null==r?void 0:r.stencil,framebufferScaleFactor:1};if(t.session){switch(t.machineType){case"Pico":t.session.updateRenderState({baseLayer:new XRWebGLLayer(t.session,t.gl,e)});break;case"Oculus":t.session.updateRenderState({layers:[new XRWebGLLayer(t.session,t.gl,e)]});break;default:t.machineType}t.session.requestReferenceSpace(t.referenceSpaceType).then((function(e){t.onRequestReferenceSpace(e)})),t.session.addEventListener("inputsourceschange",(function(e){t.updateInputSources(e)}))}else console.error("session is lose while set session!")}))}},t}(pe),Ks=["webXRSessionStart","webXRSessionEnd"],Ws=function(e){function t(){var t=e.call(this)||this;t.type="LineSegmentsGeometry";return t.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),t.setAttribute("position",new n.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),t.setAttribute("uv",new n.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),t}return ne(t,e),t.prototype.applyMatrix4=function(e){var t=this.attributes.instanceStart,r=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),r.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var t;t=e instanceof Float32Array?e:Array.isArray(e)?new Float32Array(e):new Float32Array;var r=new n.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new n.InterleavedBufferAttribute(r,3,0)),this.setAttribute("instanceEnd",new n.InterleavedBufferAttribute(r,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var t;t=e instanceof Float32Array?e:Array.isArray(e)?new Float32Array(e):new Float32Array;var r=new n.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceColorStart",new n.InterleavedBufferAttribute(r,3,0)),this.setAttribute("instanceColorEnd",new n.InterleavedBufferAttribute(r,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new n.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var t=e.geometry;if(t instanceof n.Geometry){var r=(new n.BufferGeometry).fromGeometry(t);this.setPositions(r.attributes.position.array)}else t instanceof n.BufferGeometry&&this.setPositions(t.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new n.Box3);var e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){var r=new n.Box3;this.boundingBox.setFromBufferAttribute(e),r.setFromBufferAttribute(t),this.boundingBox.union(r)}},t.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new n.Sphere),null===this.boundingBox&&this.computeBoundingBox();var e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){var r=this.boundingSphere.center;this.boundingBox.getCenter(r);for(var i=0,o=new n.Vector3,a=0,s=e.count;a<s;a++)o.fromBufferAttribute(e,a),i=Math.max(i,r.distanceToSquared(o)),o.fromBufferAttribute(t,a),i=Math.max(i,r.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(n.InstancedBufferGeometry);Object.assign(Ws.prototype,{isLineSegmentsGeometry:!0});var Ys={uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new n.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"},Xs=function(e){function t(t){var r=e.call(this,{uniforms:n.UniformsUtils.clone(Ys.uniforms),vertexShader:Ys.vertexShader,fragmentShader:Ys.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}}}),r.setValues(t),r}return ne(t,e),t}(n.ShaderMaterial);Object.assign(Xs.prototype,{isLineMaterial:!0});var Js=function(e){function t(t,r){var n=e.call(this)||this;return n.type="LineSegments2",n.geometry=void 0!==t?t:new Ws,n.material=void 0!==r?r:new Xs({color:16777215*Math.random()}),n}return ne(t,e),t.prototype.computeLineDistances=function(){for(var e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*t.count),o=new n.Vector3,a=new n.Vector3,s=0,l=0,u=t.count;s<u;s++,l+=2)o.fromBufferAttribute(t,s),a.fromBufferAttribute(r,s),i[l]=0===l?0:i[l-1],i[l+1]=i[l]+o.distanceTo(a);var c=new n.InstancedInterleavedBuffer(i,2,1);return e.setAttribute("instanceDistanceStart",new n.InterleavedBufferAttribute(c,1,0)),e.setAttribute("instanceDistanceEnd",new n.InterleavedBufferAttribute(c,1,1)),this},t.prototype.raycast=function(e,t){null===e.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var r=e.ray,i=e.camera,o=i.projectionMatrix,a=this.geometry,s=this.material,l=s.resolution,u=s.linewidth,c=a.attributes.instanceStart,h=a.attributes.instanceEnd,d=new n.Vector4,p=new n.Vector4,f=new n.Vector4,v=new n.Vector3,A=new n.Matrix4,m=new n.Line3,g=new n.Vector3;r.at(1,f),f.w=1,f.applyMatrix4(i.matrixWorldInverse),f.applyMatrix4(o),f.multiplyScalar(1/f.w),f.x*=l.x/2,f.y*=l.y/2,f.z=0,v.copy(f);var y=this.matrixWorld;A.multiplyMatrices(i.matrixWorldInverse,y);for(var b=0,x=c.count;b<x;b++){d.fromBufferAttribute(c,b),p.fromBufferAttribute(h,b),d.w=1,p.w=1,d.applyMatrix4(A),p.applyMatrix4(A),d.applyMatrix4(o),p.applyMatrix4(o),d.multiplyScalar(1/d.w),p.multiplyScalar(1/p.w);var w=d.z<-1&&p.z<-1,M=d.z>1&&p.z>1;if(!w&&!M){d.x*=l.x/2,d.y*=l.y/2,p.x*=l.x/2,p.y*=l.y/2,m.start.copy(d),m.start.z=0,m.end.copy(p),m.end.z=0;var E=m.closestPointToPointParameter(v,!0);m.at(E,g);var C=n.MathUtils.lerp(d.z,p.z,E),I=C>=-1&&C<=1,S=v.distanceTo(g)<.5*u;if(I&&S){m.start.fromBufferAttribute(c,b),m.end.fromBufferAttribute(h,b),m.start.applyMatrix4(y),m.end.applyMatrix4(y);var P=new n.Vector3,T=new n.Vector3;r.distanceSqToSegment(m.start,m.end,T,P),t.push({point:T,pointOnLine:P,distance:r.origin.distanceTo(T),object:this,faceIndex:b})}}}},t}(n.Mesh);Object.assign(Js.prototype,{isLineSegments2:!0});var Zs=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="Line2",n}return ne(t,e),t}(Js);Object.assign(Zs.prototype,{isLine2:!0});var $s=function(e){function t(){var t=e.call(this)||this;return t.type="LineGeometry",t}return ne(t,e),t.prototype.setPositions=function(t){for(var r=t.length-3,n=new Float32Array(2*r),i=0;i<r;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return e.prototype.setPositions.call(this,n),this},t.prototype.setColors=function(t){for(var r=t.length-3,n=new Float32Array(2*r),i=0;i<r;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return e.prototype.setColors.call(this,n),this},t.prototype.fromLine=function(e){var t=e.geometry;if(t instanceof n.Geometry){var r=(new n.BufferGeometry).fromGeometry(t);this.setPositions(r.attributes.position.array)}else t instanceof n.BufferGeometry&&this.setPositions(t.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(Ws);Object.assign($s.prototype,{isLineGeometry:!0});var el=14467195,tl=null,rl=function(e){function t(t,r){void 0===t&&(t=new n.Vector3),void 0===r&&(r=new n.Vector3);var i=e.call(this)||this;i.type="FiveLine",i.needsRender=!0;var o=new $s,a=new Xs({color:el,linewidth:2,dashScale:20,dashed:!1});i.line=new Zs(o,a);var s=new n.BufferGeometry,l=new n.PointsMaterial({color:el,size:8,map:tl||(tl=(new n.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==")),sizeAttenuation:!1,transparent:!0});return i.points=new n.Points(s,l),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(t,r),i.add(i.line,i.points),i}return ne(t,e),Object.defineProperty(t,"version",{get:function(){return"6.0.0-alpha.0"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,t){var r=[].concat(e.toArray(),t.toArray());this.points.geometry.setAttribute("position",new n.BufferAttribute(new Float32Array(r),3)),this.line.geometry.setPositions(r),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new n.Vector3(e[0],e[1],e[2]),new n.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var t=this.line.material;for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];"dashed"===r?(t.dashed=n,n?t.defines.USE_DASH="":delete t.defines.USE_DASH,t.needsUpdate=!0):t[r]=e[r]}this.needsRender=!0},t.prototype.setResolution=function(e,t){var r=this.line.material.resolution;r.x===e&&r.y===t||(r.set(e,t),this.needsRender=!0)},t}(n.Object3D);Object.assign(rl.prototype,{isFiveLine:!0});const nl={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function il(e){const t=await fetch(e);if(t.ok)return t.json();throw new Error(t.statusText)}async function ol(e,t,r=null,n=!0){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const i=await async function(e){if(!e)throw new Error("No basePath supplied");return await il(`${e}/profilesList.json`)}(t);let o;if(e.profiles.some((e=>{const r=i[e];return r&&(o={profileId:e,profilePath:`${t}/${r.path}`,deprecated:!!r.deprecated}),!!o})),!o){if(!r)throw new Error("No matching profile name found");const e=i[r];if(!e)throw new Error(`No matching profile name found and default profile "${r}" missing.`);o={profileId:r,profilePath:`${t}/${e.path}`,deprecated:!!e.deprecated}}const a=await il(o.profilePath);let s;if(n){let t;if(t="any"===e.handedness?a.layouts[Object.keys(a.layouts)[0]]:a.layouts[e.handedness],!t)throw new Error(`No matching handedness, ${e.handedness}, in profile ${o.profileId}`);t.assetPath&&(s=o.profilePath.replace("profile.json",t.assetPath))}return{profile:a,assetPath:s}}const al={xAxis:0,yAxis:0,button:0,state:nl.ComponentState.DEFAULT};class sl{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===nl.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(al)}updateFromComponent({xAxis:e,yAxis:t,button:r,state:n}){const{normalizedXAxis:i,normalizedYAxis:o}=function(e=0,t=0){let r=e,n=t;if(Math.sqrt(e*e+t*t)>1){const i=Math.atan2(t,e);r=Math.cos(i),n=Math.sin(i)}return{normalizedXAxis:.5*r+.5,normalizedYAxis:.5*n+.5}}(e,t);switch(this.componentProperty){case nl.ComponentProperty.X_AXIS:this.value=this.states.includes(n)?i:.5;break;case nl.ComponentProperty.Y_AXIS:this.value=this.states.includes(n)?o:.5;break;case nl.ComponentProperty.BUTTON:this.value=this.states.includes(n)?r:0;break;case nl.ComponentProperty.STATE:this.valueNodeProperty===nl.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(n):this.value=this.states.includes(n)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class ll{constructor(e,t){if(!(e&&t&&t.visualResponses&&t.gamepadIndices&&0!==Object.keys(t.gamepadIndices).length))throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach((e=>{const r=new sl(t.visualResponses[e]);this.visualResponses[e]=r})),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:nl.ComponentState.DEFAULT,button:void 0!==this.gamepadIndices.button?0:void 0,xAxis:void 0!==this.gamepadIndices.xAxis?0:void 0,yAxis:void 0!==this.gamepadIndices.yAxis?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=nl.ComponentState.DEFAULT,void 0!==this.gamepadIndices.button&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||1===this.values.button?this.values.state=nl.ComponentState.PRESSED:(t.touched||this.values.button>nl.ButtonTouchThreshold)&&(this.values.state=nl.ComponentState.TOUCHED)}void 0!==this.gamepadIndices.xAxis&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===nl.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>nl.AxisTouchThreshold&&(this.values.state=nl.ComponentState.TOUCHED)),void 0!==this.gamepadIndices.yAxis&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===nl.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>nl.AxisTouchThreshold&&(this.values.state=nl.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach((e=>{e.updateFromComponent(this.values)}))}}class ul{constructor(e,t,r){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=r,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach((e=>{const t=this.layoutDescription.components[e];this.components[e]=new ll(e,t)})),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach((t=>{e.push(t.data)})),e}updateFromGamepad(){Object.values(this.components).forEach((e=>{e.updateFromGamepad(this.xrInputSource.gamepad)}))}}class cl extends e.Object3D{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e||(this.envMap=e,this.traverse((e=>{e.isMesh&&(e.material.envMap=this.envMap,e.material.needsUpdate=!0)}))),this}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach((e=>{Object.values(e.visualResponses).forEach((e=>{const{valueNode:t,minNode:r,maxNode:n,value:i,valueNodeProperty:o}=e;t&&(o===nl.VisualResponseProperty.VISIBILITY?t.visible=i:o===nl.VisualResponseProperty.TRANSFORM&&(t.quaternion.copy(r.quaternion).slerp(n.quaternion,i),t.position.lerpVectors(r.position,n.position,i)))}))})))}}function hl(t,r){!function(t,r){Object.values(t.components).forEach((t=>{const{type:n,touchPointNodeName:i,visualResponses:o}=t;if(n===nl.ComponentType.TOUCHPAD)if(t.touchPointNode=r.getObjectByName(i),t.touchPointNode){const r=new e.SphereGeometry(.001),n=new e.MeshBasicMaterial({color:255}),i=new e.Mesh(r,n);t.touchPointNode.add(i)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(o).forEach((e=>{const{valueNodeName:t,minNodeName:n,maxNodeName:i,valueNodeProperty:o}=e;if(o===nl.VisualResponseProperty.TRANSFORM){if(e.minNode=r.getObjectByName(n),e.maxNode=r.getObjectByName(i),!e.minNode)return void console.warn(`Could not find ${n} in the model`);if(!e.maxNode)return void console.warn(`Could not find ${i} in the model`)}e.valueNode=r.getObjectByName(t),e.valueNode||console.warn(`Could not find ${t} in the model`)}))}))}(t.motionController,r),t.envMap&&r.traverse((e=>{e.isMesh&&(e.material.envMap=t.envMap,e.material.needsUpdate=!0)})),t.add(r)}class dl{constructor(e=null){this.gltfLoader=e,this.path="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",this._assetCache={},this.gltfLoader||(this.gltfLoader=new An)}createControllerModel(e){const t=new cl;let r=null;return e.addEventListener("connected",(e=>{const n=e.data;"tracked-pointer"===n.targetRayMode&&n.gamepad&&ol(n,this.path,"generic-trigger").then((({profile:e,assetPath:i})=>{t.motionController=new ul(n,e,i);const o=this._assetCache[t.motionController.assetUrl];if(o)r=o.scene.clone(),hl(t,r);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,(e=>{this._assetCache[t.motionController.assetUrl]=e,r=e.scene.clone(),hl(t,r)}),null,(()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)}))}})).catch((e=>{console.warn(e)}))})),e.addEventListener("disconnected",(()=>{t.motionController=null,t.remove(r),r=null})),t}}var pl=300,fl=(new n.Matrix4).makeRotationAxis(new n.Vector3(0,1,0),Math.PI),vl=new n.Vector3(-1,1,1),Al=function(e){function t(t){var r=e.call(this,t)||this;r.xrManager=new Gs(r.renderer,r.renderer.getContext()),r.xrControllerRay=[new n.Raycaster,new n.Raycaster],r.pointerLine=new rl,r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=To()]={panoId:r.currentPanoId,leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade"},r.parallaxCameraMatrixs=[];var i=Ne.shared.getContext();if(!i)return console.error("获取session失败,请退出重试"),r;r.xrManager.setSession(i),r.controllerWrappers=[new n.Group,new n.Group],r.scene.add(r.controllerWrappers[0],r.controllerWrappers[1]);var o=r.xrManager.getController(0);r.controllerWrappers[0].add(o);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var s=new dl,l=r.xrManager.getControllerGrip(0);l.add(s.createControllerModel(l)),r.controllerWrappers[0].add(l);var u=r.xrManager.getControllerGrip(1);u.add(s.createControllerModel(u)),r.controllerWrappers[1].add(u);var c=(new n.BufferGeometry).setFromPoints([new n.Vector3(0,0,0),new n.Vector3(0,0,-1)]),h=new n.Line(c);h.name="line",h.scale.z=5,o.add(h.clone()),a.add(h.clone());for(var d=function(e){p.xrManager.on(e,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r.emit.apply(r,ue([e],t,!1))}))},p=this,f=0,v=Ks;f<v.length;f++){d(v[f])}return r.xrControllerState={LeftAxesUp:{startPressingTIme:0,pressed:!1},LeftAxesDown:{startPressingTIme:0,pressed:!1},LeftAxesLeft:{startPressingTIme:0,pressed:!1},LeftAxesRight:{startPressingTIme:0,pressed:!1},LeftTrigger:{startPressingTIme:0,pressed:!1},LeftPinch:{startPressingTIme:0,pressed:!1},RightAxesUp:{startPressingTIme:0,pressed:!1},RightAxesDown:{startPressingTIme:0,pressed:!1},RightAxesLeft:{startPressingTIme:0,pressed:!1},RightAxesRight:{startPressingTIme:0,pressed:!1},RightTrigger:{startPressingTIme:0,pressed:!1},RightPinch:{startPressingTIme:0,pressed:!1},Y:{startPressingTIme:0,pressed:!1},X:{startPressingTIme:0,pressed:!1},A:{startPressingTIme:0,pressed:!1},B:{startPressingTIme:0,pressed:!1}},r}return ne(t,e),t.parseArgs=function(r){if(r instanceof t)return r;var n=ie(ie({},r),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return e.parseArgs.call(this,n)},t.initAnimationEndPose=function(t){var r=this.parseArgs(t);return e.initAnimationEndPose.call(this,r)},t.prototype.moveToPano=function(e,t,r){var i,o,a,s,l=this;this.userAction=r;var u=this.works.getResolvedObserver(e);if(!u)throw new Error("Invalid PanoIndex");var c=this.imageOptions.size;if(void 0===c&&u){var h=u.images.up.match(/\/cube_(\d+)\//);h&&(c=Number(h[1]))}void 0===c&&(c=2048);var d=this.imageOptions.transform,p=function(e,t){return function(e,t){if(!t)return e;var r=e.match(/\d+_[a-z].png/);return e.substring(0,r.index)+t+"/"+e.substring(r.index)}(je(e,d,t))},f=ie({key:"pano.".concat(e)},Yn(this.imageOptions,["format","size","quality"])),v=u.images,A=null!==(o=null===(i=u.images.tiles)||void 0===i?void 0:i.filter((function(e){return e.size>c})))&&void 0!==o?o:null,m="pano:"+Jn([v,f,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===m)return;var g=this.pendingTextureTask.panoId;null===(a=this.panoMeshes[g])||void 0===a||a.setProgress(0),this.emit("textureAbort",g),this.pendingTextureTask.onError(new Error("texture aborted"))}var y,b=this.model.getMaterial()||{},x=b.pano0,w=b.pano1;if((null==x?void 0:x.map.name)===m?y=x:(null==w?void 0:w.map.name)===m&&(y=w),y){var M={panoId:e,effect:null!==(s=t.effect)&&void 0!==s?s:"fade",leftPanoPicture:{map:y.map,luminanceMap:y.luminanceMap,matrix:(new n.Matrix4).compose(u.position,u.quaternion,vl)},position:u.position.clone()};this.doMoveToPano(e,M,t)}else{var E="move-to-pano-"+e;this.pending.add(E),this.pendingTextureTask={panoId:e,hash:m,onLoad:function(r){var i;if(l.pending.delete(E),l.destroyed)r.body.dispose();else{r.body.name=m;var o={panoId:e,effect:null!==(i=t.effect)&&void 0!==i?i:"fade",leftPanoPicture:{map:r.body,luminanceMap:null,matrix:(new n.Matrix4).compose(u.position,u.quaternion,vl)},position:u.position.clone()};l.doMoveToPano(e,o,t)}},onError:function(r){l.pending.delete(E),t.moveCancelCallback&&t.moveCancelCallback(),l.emit("panoLoadError",r,e),l.emit("moveToPanoCanceled",e)}},Promise.all([this.tileLevelForFov&&A&&A.length?this.textureLoader.loadTiledCubeTexture(v,A,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:f},format:n.RGBAFormat,viaAjax:!0},void 0,void 0,(function(t){var r,n;l.emit("textureLoading",t,e),(null===(r=l.pendingTextureTask)||void 0===r?void 0:r.hash)===m&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer):this.textureLoader.loadCubeTexture(v,{imageURL:{transform:p,options:f},format:n.RGBAFormat},void 0,void 0,(function(t){var r,n;(null===(r=l.pendingTextureTask)||void 0===r?void 0:r.hash)===m&&(null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(t)),l.emit("textureLoading",t,e)}),this.renderer)]).then((function(t){var r,n,i=t[0];(null===(r=l.pendingTextureTask)||void 0===r?void 0:r.hash)===m?(l.pendingTextureTask.onLoad(i),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureLoaded",e,i.meta)):i.body.dispose()})).catch((function(t){var r,n;(null===(r=l.pendingTextureTask)||void 0===r?void 0:r.hash)===m&&(l.pendingTextureTask.onError(t),null===(n=l.panoMeshes[e])||void 0===n||n.setProgress(0),delete l.pendingTextureTask,l.emit("textureError",t,e),l.emit("error",t))})),this.emit("textureStartLoad",e)}},t.prototype.doMoveToPano=function(e,t,r){var i,o,a,s=this;void 0===r&&(r={});var l=Ae(),u=To();this.panoResources[u]=t;var c,h,d;if(this.locationMotion.ended){var p=this.locationMotion.getKeyFrameSegment(l);p[0];var f=p[1],v=this.locationMotion.value,A=this.panoResourceFromLocationMotionKeyframe(f).position,m=t.position;c=Math.max(A.distanceTo(m),1),h=[{key:f.key,progress:0,value:ie(ie({},v),{count:0})},{key:u,progress:1,value:{distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0,count:1}}],d=0}else{var g=this.locationMotion.getKeyFrameSegment(l),y=g[0],b=(f=g[1],v=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(y).position),x=(A=this.panoResourceFromLocationMotionKeyframe(f).position,m=t.position,f.value.count-v.count),w=Math.max(b.distanceTo(A),1)*x;c=w+Math.max(A.distanceTo(m),1),h=[{key:y.key,progress:0,value:ie({},v)},{key:f.key,progress:w/c,value:f.value},{key:u,progress:1,value:{count:f.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var M=this.locationMotionKeyframesLength(this.locationMotion.keyframes),E=this.locationMotionKeyframesLength(h);d=this.locationMotion.getProgressVelocity(l)*M/E}var C=this.calculateMovingDuration(r.duration,c),I={longitude:r.longitude,latitude:r.latitude,fov:r.fov},S={longitude:null!==(i=I.longitude)&&void 0!==i?i:this.camera.pose.longitude,latitude:null!==(o=I.latitude)&&void 0!==o?o:this.camera.pose.latitude,fov:null!==(a=I.fov)&&void 0!==a?a:this.camera.pose.fov,offset:t.position.clone(),distance:0};this.emit("moveToPano",e,this.userAction),r.moveStartCallback&&r.moveStartCallback(e,S),this.emit("panoWillArrive",e,S,this.userAction),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=fe,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(I,C).catch(fe),this.locationMotion.setKeyframes(h,C,d).then((function(){var t,i,o,a={longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:0};r.moveEndCallback&&r.moveEndCallback(e,a),s.emit("panoArrived",e,a,s.userAction);var l=s.works.getResolvedObserver(s.currentPanoId);if(l&&l.video&&s.videoTexture&&s.videoTexture.image instanceof HTMLVideoElement){var u=fl.clone().multiply(null!==(o=null===(i=null===(t=s.model.getMaterial())||void 0===t?void 0:t.pano1)||void 0===i?void 0:i.matrix)&&void 0!==o?o:new n.Matrix4).multiply(l.video.matrix),c={map:s.videoTexture,size:l.video.size,matrix:u,alpha:1},h=To(),d=s.videoTexture.image;d.setAttribute("uuid",h),ma().then((function(e){e&&l.video&&d.getAttribute("uuid")===h&&(d.oncanplay=function(){d.oncanplay=fe,d.play()},d.ontimeupdate=function(){d.currentTime>.5&&(d.ontimeupdate=fe,s.panoVideo.setMaterial(c))},d.src=l.video.source)})).catch((function(){d.removeAttribute("uuid")}))}}),(function(){r.moveCancelCallback&&r.moveCancelCallback(),s.emit("moveToPanoCanceled",e)}))},t.prototype.checkSelectedPano=function(e){var t=this;this.interiaMovement=!1;var r=this.camera.getDirection(new n.Vector3).setY(0),i=null,o=this.works.getResolvedObserver(this.currentPanoId);if(!o)return i;var a=o.accessibleIds.filter((function(e){if(e===t.currentPanoId)return!1;var r=t.works.getResolvedObserver(e);return!!r&&(!(r.position.distanceTo(t.camera.position)>t.maxAccessibleDistance)&&(r.loadable||r.active))})),s=this.model.intersectRaycaster(e)[0];if(s){var l=Wo(a,(function(e){var r=t.works.getResolvedObserver(e);return r?r.standingPosition.clone().distanceTo(s.point):1/0}),!0),u=l[0],c=l[1];!So(u)&&c<this.panoTapTriggerRadius&&(i=u)}So(i)&&(i=this.getForwardPanoIndexOrNot(e));for(var h=0,d=this.locationMotion.keyframes;h<d.length;h++){var p=d[h],f=this.panoResourceFromLocationMotionKeyframe(p);if(!(p.progress<this.locationMotion.progress)&&f.panoId===i){i=null;break}}if(this.emit("panoSelected",i),So(i))return!0===this.locationMotion.ended&&this.cameraBounce(),i;var v=this.works.getResolvedObserver(i);if(v&&!v.active)return this.panoMeshes[i]&&(this.panoMeshes[i].setDisabled(!1),this.panoMeshes[i].setLoading(!0)),i;var A={};if(v){A.effect="fade";for(var m=Math.PI/6,g=Math.PI/12,y=new n.Vector3(0,1,0),b=v.position.clone().setY(0).sub(o.position.clone().setY(0)).normalize(),x=b.clone().applyAxisAngle(y,m),w=b.clone().applyAxisAngle(y,-m),M=[],E=[],C=[],I=0,S=v.accessibleIds;I<S.length;I++){if((u=S[I])!==this.currentPanoId&&u!==i){var P=this.works.getResolvedObserver(u);if(P){var T=P.position.clone().sub(v.position).setY(0);b.angleTo(T)<m?C.push(T):x.angleTo(T)<m?M.push(T):w.angleTo(T)<m&&E.push(T)}}}var B=(C.length>0?C:ue(ue([],M,!0),E,!0)).slice().sort((function(e,t){return e.angleTo(b)-t.angleTo(b)}))[0];B&&B.angleTo(r)>g&&(A.longitude=Math.atan2(-B.x,-B.z))}return this.cameraMotion.value.latitude<-Math.PI/4&&(A.latitude=Lr(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(A.fov=this.defaultFov),this.emit("wantsMoveToPano",i,A,!0),i},t.prototype.destroy=function(){e.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateTime=function(e,t){for(var r,i,o,a,s,l,u,c=this,h=[],d=2;d<arguments.length;d++)h[d-2]=arguments[d];this.currentPanoId;var p={},f={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),A=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),m=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var g=this.locationMotion.getKeyFrameSegment(e),y=g[0],b=g[1],x=this.panoResourceFromLocationMotionKeyframe(y),w=this.panoResourceFromLocationMotionKeyframe(b),M=(new n.Vector3).copy(x.position),E=(new n.Vector3).copy(w.position),C=this.locationMotion.value.count-b.value.count+1;p.progress=C,p.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Lr(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,w.leftPanoPicture&&(C<1?x.leftPanoPicture&&(p.pano0=x.leftPanoPicture):p.pano0=w.leftPanoPicture,p.pano1=w.leftPanoPicture),m=p.useBlackTransition="instant"===w.effect||"montage"===w.effect,"fade"!==w.effect&&"montage"!==w.effect||(p.pano0&&x.leftPanoPicture&&(p.pano0={map:p.pano0.map,luminanceMap:p.pano0.luminanceMap,matrix:x.leftPanoPicture.matrix.clone().setPosition(w.position)}),M.copy(E)),f.distance=this.locationMotion.value.distance,f.offset=new n.Vector3(M.x+(E.x-M.x)*C,M.y+(E.y-M.y)*C,M.z+(E.z-M.z)*C);for(var I=[],S=[],P=0,T=this.locationMotion.keyframes;P<T.length;P++){var B=T[P],R=B.key,O=B.progress;void 0!==R&&(I.push(R),O>=this.locationMotion.progress&&S.push(R))}for(var L=0,D=Object.keys(this.panoResources);L<D.length;L++){var F=D[L];if(!(S.indexOf(F)>=0)){var k=this.panoResources[F];if(k.leftPanoPicture){var Q=k.leftPanoPicture.map;if(Q){if(Q===(null===(r=p.pano0)||void 0===r?void 0:r.map))continue;if(Q===(null===(i=p.pano1)||void 0===i?void 0:i.map))continue;Q instanceof Rt&&Q.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(Q.cubeRenderTarget),Q.dispose(),k.leftPanoPicture=null}}I.indexOf(F)>=0||delete this.panoResources[F]}}this.currentPanoId=w.panoId,this.emit("movingToPano",A.panoId,v.panoId,this.locationMotion.progress)}!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),f.longitude=this.cameraMotion.value.longitude,f.latitude=this.cameraMotion.value.latitude,f.fov=this.cameraMotion.value.fov),!1===Yo(p)&&((null===(o=p.pano0)||void 0===o?void 0:o.map)&&p.pano0.map instanceof Rt&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(a=p.pano1)||void 0===a?void 0:a.map)&&p.pano1.map instanceof Rt&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.model.setMaterial(p)),!1===Yo(f)&&this.setCamera(f);var N=h[1];if(N)if(this.xrManager.session){var V=this.xrManager.referenceSpace;if(V){var U=this.xrManager.cameraVR,z=this.xrManager.cameraL,q=this.xrManager.cameraR,H=[z,q],_=N.getViewerPose(V),j=new n.Vector3(0,0,0);if(_){var G;switch(this.xrManager.machineType){case"Pico":G=this.xrManager.session.renderState.baseLayer;break;case"Oculus":var K=this.xrManager.session.renderState.layers;K&&(G=K[0]);break;default:this.xrManager.machineType}var W=_.views;if(G){this.renderer.setFramebuffer(G.framebuffer);var Y=!1;W.length!==U.cameras.length&&(U.cameras.length=0,Y=!0),this.parallaxCameraMatrixs=[];var X=new n.Vector3,J=new n.Vector3;(new n.Matrix4).fromArray(W[0].transform.matrix).decompose(X,new n.Quaternion,new n.Vector3),(new n.Matrix4).fromArray(W[1].transform.matrix).decompose(J,new n.Quaternion,new n.Vector3),J.clone().sub(X).normalize();var Z=new n.Vector3,$=new n.Quaternion,ee=new n.Vector3;this.camera.matrix.decompose(Z,$,ee);for(var te=0;te<W.length;te++){var re=W[te],ne=G.getViewport(re),ie=H[te];ie.matrix.fromArray(re.transform.matrix);var oe=new n.Vector3,ae=new n.Quaternion,se=new n.Vector3;ie.matrix.decompose(oe,ae,se),j.copy(Z),ie.position.copy(Z),ie.quaternion.copy(ae),ie.scale.copy(se),ie.updateMatrix(),ie.projectionMatrix.fromArray(re.projectionMatrix),ie.viewport.set(ne.x,ne.y,ne.width,ne.height),!0===Y&&U.cameras.push(ie)}var le=this.works.getResolvedObserver(this.currentPanoId),ue=_.views[0].transform.position,ce=_.views[1].transform.position,he=new n.Vector3((ue.x+ce.x)/2,0,(ue.z+ce.z)/2),de=this.xrManager.session.inputSources;for(te=0;te<this.xrManager.controllers.length;te++){var pe=this.xrManager.controllers[te],fe=de[te];pe.update(fe,N,V);var ve=this.xrManager.getController(te),Ae=new n.Vector3(0,le?le.standingPosition.y:0,0),me=ve.position.clone().add(j).add(Ae).sub(he);this.controllerWrappers[te].position.copy(me).add(Ae),this.xrControllerRay[te].set(this.xrManager.getController(1).position.clone().add(j).add(Ae),new n.Vector3(0,0,-1).applyEuler(ve.rotation));var ge=this.model.intersectRaycaster(this.xrControllerRay[1]);if(0===ge.length&&(ge=this.xrControllerRay[1].intersectObject(this.boundingMesh,!0)),ge.length>=1&&ge[0].face){this.pointerLine.setPoints(me,ge[0].point);var ye=ge[0].face.normal,be=ye.clone().multiplyScalar(.05),xe=ge[0].point.clone().add(be);this.intersectMesh.position.copy(xe);var we=xe.clone().add(be);if(this.intersectMesh.lookAt(we),Math.abs(ye.y)>.99){var Me=this.camera.position.clone().sub(xe);this.intersectMesh.rotation.z=-Math.atan2(Me.z,Me.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",ge[0],this.intersectMesh)}}if(this.camera.pose.distance>.1||m){if(le)for(var Ee=0,Ce=Object.keys(this.panoMeshes);Ee<Ce.length;Ee++){var Ie=Ce[Ee];(De=this.panoMeshes[Ie]).setOpacity(0),De.setCurrent(!1),De.updateTime&&De.updateTime(e,t)}}else if(le){var Se=Wo(le.visibleIds,(function(e){var t=c.works.getResolvedObserver(e);return t?le.standingPosition.distanceTo(t.standingPosition):1/0}),!0),Pe=Se[1];Pe=Lr(Pe,2.5,1/0);for(var Te=le.visibleIds.concat(this.currentPanoId),Be=this.getForwardPanoIndexOrNot(),Re=this.camera.getDirection(new n.Vector3),Oe=0,Le=Object.keys(this.panoMeshes);Oe<Le.length;Oe++){Ie=Le[Oe];var De=this.panoMeshes[Ie],Fe=this.works.getResolvedObserver(Ie);if(-1===Te.indexOf(Ie))De.setCurrent(!1),De.setOpacity(0);else if(Fe)if(Fe.loadable||Fe.active){var ke=De.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);De.setCurrent(!De.loading&&0===De.progress&&Be===Ie),De.setOpacity(ke<.01?0:Lr(Pe/ke*1.2,.65,.98));var Qe=this.camera.position.clone().setY(De.position.y),Ne=(new n.Vector3).copy(De.position).sub(Qe).normalize();if(Ie===this.currentPanoId){var Ve=Lr((.5-Qe.distanceTo(De.position))/.5,0,1);Ne.multiplyScalar(1-Ve).add(Re.clone().multiplyScalar(Ve))}Ne.length()>0&&De.quaternion.setFromEuler(new n.Euler(0,Math.atan2(Ne.x,Ne.z),0))}else De.setCurrent(!1),De.setOpacity(0);else De.setCurrent(!1),De.setOpacity(0);De.updateTime&&De.updateTime(e,t)}}var Ue=function(){if(!1===c.tileLevelForFov)return 0;var e=new n.Vector2(4e3,4e3),t=A.panoId,r=c.works.getResolvedObserver(t),i=c.imageOptions.size;if(void 0===i&&r){var o=r.images.up.match(/\/cube_(\d+)\//);o&&(i=Number(o[1]))}void 0===i&&(i=2048);var a=0;i>=1024&&(a=1),i>=2048&&(a=2),i>=4096&&(a=3),i>=8192&&(a=4);var s=c.tileLevelForFov(z.fov,e);return s>a?s:0}(),ze=function(){var e=new n.PerspectiveCamera;e.applyMatrix4(U.matrix),e.position.set(0,0,0);var t=c.works.getResolvedObserver(A.panoId),r=null!=t?t:le;return r&&e.quaternion.premultiply(r.quaternion.clone().inverse()),e.updateProjectionMatrix(),e.updateMatrixWorld(!0),(new n.Frustum).setFromProjectionMatrix((new n.Matrix4).multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse))}();A.panoId===this.currentPanoId&&(null===(s=A.leftPanoPicture)||void 0===s?void 0:s.map)instanceof Rt&&(A.leftPanoPicture.map.update(ze,Ue),!0===A.leftPanoPicture.map.needsRender&&(this.needsRender=!0));var qe=this.tiling.object.visible;if(Ue>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var He=A.panoId,_e=this.works.getResolvedObserver(He);_e&&Oo(this.camera.position,_e.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==He&&this.tiling.cleanup(),this.tiling.panoId=He,this.tiling.setResource(null!==(u=null===(l=_e.images)||void 0===l?void 0:l.tiles)&&void 0!==u?u:[],this.enableIOSEDR&&_e.images.luminance?_e.images.luminance:null),this.tiling.setAllowHosts(_e.work.allowHosts),this.tiling.setNetworkSubscribe(this.networkSubscribe),this.tiling.setRequestProxy(this.requestProxy),this.tiling.setRotation(_e.quaternion),this.tiling.setPosition(_e.position),this.tiling.update(ze,Ue,e)):this.tiling.object.visible=!1}else this.tiling.object.visible=!1;qe!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0),this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.updateControllerHelper(de,e)}else console.error("no layer found")}}}else console.error("session丢失,请重试");else console.error("xrFrame丢失,请重试")},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.scene,e)},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,t){if(e&&2===e.length&&e[0].gamepad&&e[1].gamepad)for(var r=0;r<e.length;r++){var n=e[r].handedness,i=e[r].gamepad;switch(n){case"left":-1===i.axes[2]?this.xrControllerState.LeftAxesLeft.pressed||(this.xrControllerState.LeftAxesLeft.pressed=!0,t-this.xrControllerState.LeftAxesLeft.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","LeftAxesLeft",{raycaster:this.xrControllerRay})):(this.xrControllerState.LeftAxesLeft.pressed=!1,this.xrControllerState.LeftAxesLeft.startPressingTIme=0),1===i.axes[2]?this.xrControllerState.LeftAxesRight.pressed||(this.xrControllerState.LeftAxesRight.pressed=!0,t-this.xrControllerState.LeftAxesRight.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","LeftAxesRight",{raycaster:this.xrControllerRay})):(this.xrControllerState.LeftAxesRight.pressed=!1,this.xrControllerState.LeftAxesRight.startPressingTIme=0),-1===i.axes[3]?this.xrControllerState.LeftAxesUp.pressed||(this.xrControllerState.LeftAxesUp.pressed=!0,t-this.xrControllerState.LeftAxesUp.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","LeftAxesUp",{raycaster:this.xrControllerRay})):(this.xrControllerState.LeftAxesUp.pressed=!1,this.xrControllerState.LeftAxesUp.startPressingTIme=0),1===i.axes[3]?this.xrControllerState.LeftAxesDown.pressed||(this.xrControllerState.LeftAxesDown.pressed=!0,t-this.xrControllerState.LeftAxesDown.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","LeftAxesDown",{raycaster:this.xrControllerRay})):(this.xrControllerState.LeftAxesDown.pressed=!1,this.xrControllerState.LeftAxesDown.startPressingTIme=0),i.buttons[4].pressed?this.xrControllerState.X.pressed||(this.xrControllerState.X.pressed=!0,t-this.xrControllerState.X.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","X",{raycaster:this.xrControllerRay})):(this.xrControllerState.X.pressed=!1,this.xrControllerState.X.startPressingTIme=0),i.buttons[5].pressed?this.xrControllerState.Y.pressed||(this.xrControllerState.Y.pressed=!0,t-this.xrControllerState.Y.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","Y",{raycaster:this.xrControllerRay})):(this.xrControllerState.Y.pressed=!1,this.xrControllerState.Y.startPressingTIme=0),(null==i?void 0:i.buttons[0].pressed)?this.xrControllerState.LeftTrigger.pressed||(this.xrControllerState.LeftTrigger.pressed=!0,t-this.xrControllerState.LeftTrigger.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","LeftTrigger",{raycaster:this.xrControllerRay})):(this.xrControllerState.LeftTrigger.pressed=!1,this.xrControllerState.LeftTrigger.startPressingTIme=0),(null==i?void 0:i.buttons[1].pressed)?this.xrControllerState.LeftPinch.pressed||(this.xrControllerState.LeftPinch.pressed=!0,t-this.xrControllerState.LeftPinch.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","LeftPinch",{raycaster:this.xrControllerRay})):(this.xrControllerState.LeftPinch.pressed=!1,this.xrControllerState.LeftPinch.startPressingTIme=0);break;case"right":-1===i.axes[2]?this.xrControllerState.RightAxesLeft.pressed||(this.xrControllerState.RightAxesLeft.pressed=!0,t-this.xrControllerState.RightAxesLeft.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","RightAxesLeft",{raycaster:this.xrControllerRay})):(this.xrControllerState.RightAxesLeft.pressed=!1,this.xrControllerState.RightAxesLeft.startPressingTIme=0),1===i.axes[2]?this.xrControllerState.RightAxesRight.pressed||(this.xrControllerState.RightAxesRight.pressed=!0,t-this.xrControllerState.RightAxesRight.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","RightAxesRight",{raycaster:this.xrControllerRay})):(this.xrControllerState.RightAxesRight.pressed=!1,this.xrControllerState.RightAxesRight.startPressingTIme=0),-1===i.axes[3]?this.xrControllerState.RightAxesUp.pressed||(this.xrControllerState.RightAxesUp.pressed=!0,t-this.xrControllerState.RightAxesUp.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","RightAxesUp",{raycaster:this.xrControllerRay})):(this.xrControllerState.RightAxesUp.pressed=!1,this.xrControllerState.RightAxesUp.startPressingTIme=0),1===i.axes[3]?this.xrControllerState.RightAxesDown.pressed||(this.xrControllerState.RightAxesDown.pressed=!0,t-this.xrControllerState.RightAxesDown.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","RightAxesDown",{raycaster:this.xrControllerRay})):(this.xrControllerState.RightAxesDown.pressed=!1,this.xrControllerState.RightAxesDown.startPressingTIme=0),i.buttons[4].pressed?this.xrControllerState.A.pressed||(this.xrControllerState.A.pressed=!0,t-this.xrControllerState.A.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","A",{raycaster:this.xrControllerRay})):(this.xrControllerState.A.pressed=!1,this.xrControllerState.A.startPressingTIme=0),i.buttons[5].pressed?this.xrControllerState.B.pressed||(this.xrControllerState.B.pressed=!0,t-this.xrControllerState.B.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","B",{raycaster:this.xrControllerRay})):(this.xrControllerState.B.pressed=!1,this.xrControllerState.B.startPressingTIme=0),(null==i?void 0:i.buttons[0].pressed)?this.xrControllerState.RightTrigger.pressed||(this.xrControllerState.RightTrigger.pressed=!0,t-this.xrControllerState.RightTrigger.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","RightTrigger",{raycaster:this.xrControllerRay})):(this.xrControllerState.RightTrigger.pressed=!1,this.xrControllerState.RightTrigger.startPressingTIme=0),(null==i?void 0:i.buttons[1].pressed)?this.xrControllerState.RightPinch.pressed||(this.xrControllerState.RightPinch.pressed=!0,t-this.xrControllerState.RightPinch.startPressingTIme>=pl&&this.emit("webXRControllerEvent","tap","RightPinch",{raycaster:this.xrControllerRay})):(this.xrControllerState.RightPinch.pressed=!1,this.xrControllerState.RightPinch.startPressingTIme=0)}}},t}(za),ml={Floorplan:la,Topview:va,Panorama:za,VRPanorama:xs,Model:Ms,DepthPanorama:Bs,Mapview:Hs,XRPanorama:Al},gl=["cameraDirectionUpdate","cameraUpdate","cameraPositionUpdate","panoSelected","moveToPano","moveToPanoCanceled","panoWillArrive","movingToPano","panoArrived","panoWillLoad","panoLoaded","panoLoadError","initAnimationEnded","initAnimationWillStart","wantsGesture","gesture","wantsTapGesture","tapGesture","wantsPressGesture","pressGesture","wantsPanGesture","wantsInteriaPan","panGesture","interiaPan","wantsPinchGesture","pinchGesture","wantsMouseWheel","mouseWheel","wantsShowIntersectionOnModel","intersectionOnModelUpdate","intersectionHidden","textureStartLoad","textureLoading","textureAbort","textureLoaded","textureError","webXRSessionStart","webXRSessionEnd","webXRControllerEvent"];function yl(e){for(var t,r,n={},i=0,o=e.split(/(\;|\,)/);i<o.length;i++){var a=o[i].split("="),s=null===(t=a[0])||void 0===t?void 0:t.trim(),l=null===(r=a[1])||void 0===r?void 0:r.trim();s&&l&&(n[s]=l)}return n}function bl(){for(var e,t=document.getElementsByTagName("meta"),r=0;r<t.length;r++){var n=t[r];if("viewport"===n.getAttribute("name")){var i=yl(null!==(e=n.getAttribute("content"))&&void 0!==e?e:""),o=Number(i["initial-scale"]);if(!isNaN(o))return o}}return 1}var xl=[351,63],wl=[20,20],Ml=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),El=new Float32Array([0,0,1,0,0,1,1,1]),Cl=new Uint8Array([0,1,2,1,3,2]),Il=new n.BufferGeometry;Il.setAttribute("position",new n.BufferAttribute(Ml,3)),Il.setAttribute("uv",new n.BufferAttribute(El,2)),Il.setIndex(new n.BufferAttribute(Cl,1));var Sl=new n.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Pl=new n.Mesh(Il,Sl);Pl.matrixAutoUpdate=!1;var Tl=new n.Scene;Tl.add(Pl),Tl.matrixAutoUpdate=!1;var Bl=new n.OrthographicCamera(-.5,.5,.5,-.5,.1,1);Bl.position.set(0,0,.5),Bl.lookAt(0,0,0),Bl.updateMatrixWorld(!0),Bl.matrixAutoUpdate=!1;var Rl=new n.Vector4,Ol=new n.Vector4;function Ll(e){if(Sl.map){var t=e.getViewport(Rl),r=e.getScissor(Ol),i=e.getScissorTest(),o=e.autoClear,a=r.x+wl[0]/3,s=r.y+wl[1]/3,l=xl[0]/3,u=xl[1]/3;e.setViewport(a,s,l,u),e.setScissor(a,s,l,u),e.setScissorTest(!0),e.autoClear=!1,e.render(Tl,Bl),e.setViewport(t),e.setScissor(r),e.setScissorTest(i),e.autoClear=o}else{var c=new n.Texture,h=new Image;h.onload=function(){c.image=h,c.wrapS=n.ClampToEdgeWrapping,c.wrapT=n.ClampToEdgeWrapping,c.minFilter=n.LinearFilter,c.needsUpdate=!0,c.generateMipmaps=!1,Sl.needsUpdate=!0,h.onload=fe},h.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJO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sVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==",Sl.map=c}}var Dl=function(e){return e.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},Fl=new n.Vector2,kl=new n.Frustum,Ql=new n.Matrix4,Nl=new WeakMap,Vl=new WeakMap,Ul=uo([]),zl=function(e){function t(t){void 0===t&&(t={});var r,i,o,a,s,l,u,c,h,d,p,f,v=this;if((v=e.call(this)||this).ident=To(),ql.instances[v.ident]=v,v.renderSwitch01=0,v.currentMode="Mapview",v.panoId="",v.needsRender=!1,v.onlyRenderIfNeeds=null===(r=t.onlyRenderIfNeeds)||void 0===r||r,v.imageOptions=ie({},null!==(i=t.imageOptions)&&void 0!==i?i:{}),v.textureOptions=ie({},null!==(o=t.textureOptions)&&void 0!==o?o:{}),v.modelLodOptions=ie({},null!==(a=t.modelLod)&&void 0!==a?a:{}),v.poweredByRealsee=null===(s=t.poweredByRealsee)||void 0===s||s,v.extraElements=[],v.controllerInits={Panorama:Object.assign({},t.panorama),Model:Object.assign({},t.model),Floorplan:Object.assign({},t.floorplan),Topview:Object.assign({},t.topview),Mapview:Object.assign({},t.mapview),DepthPanorama:Object.assign({},t.depthPanorama),VRPanorama:Object.assign({},t.vrPanorama),XRPanorama:Object.assign({},t.xrPanorama)},v.fps={testCount:0,testTime:Ae()},v.modeChangeDuration=null!==(l=t.modeChangeDuration)&&void 0!==l?l:800,"undefined"!=typeof window)if(t.renderer)t.renderer instanceof Nt&&v.throwError(new Error("cannot render a internal renderer")),v.renderer=t.renderer;else try{v.renderer=new Nt({preserveDrawingBuffer:t.preserveDrawingBuffer,backgroundColor:t.backgroundColor,backgroundAlpha:t.backgroundAlpha,antialias:t.antialias,webgl2:null==t?void 0:t.webgl2});var A=bl();v.renderer.setPixelRatio(1===A?window.devicePixelRatio:1),v.renderer.setSize(512,512)}catch(e){e instanceof Error&&v.throwError(e)}v.copyEffect=new aa(v.renderer),v.getPixelsRenderTarget=new n.WebGLRenderTarget(1,1,{encoding:null!==(c=null===(u=v.renderer)||void 0===u?void 0:u.outputEncoding)&&void 0!==c?c:n.sRGBEncoding}),v.scissor=Object.assign({left:0,bottom:0,width:1,height:1},t.scissor),v.camera=new _t(90),v.scene=new Vt,v.scene.matrixAutoUpdate=!1,v.lastLoadWorkTask=Promise.resolve(),v.requestProxy=null!==(h=t.requestProxy)&&void 0!==h?h:Dl,v.networkSubscribe=new Re,v.networkSubscribe.on("network",(function(e,t,r,n){var i;v.emit("network",e,t,r,n),null===(i=v.analysis)||void 0===i||i.network(v.works,e,t,r,n)})),v.boundingMesh=(p=new n.Box3(new n.Vector3(-.5,-.5,-.5),new n.Vector3(.5,.5,.5)),void 0===f&&(f=Do),new Fo(p,f)),v.boundingMesh.name="bounding",v.scene.add(v.boundingMesh),v.model=new Vi(v.renderer),v.readyCallbacks=[],v.modelPending=!1,v.syncingState=!1,v.scene.add(v.model),v.helperGroup=new n.Group,v.helperGroup.name="helper",v.scene.add(v.helperGroup),v.videoTexture=new n.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}()),function(e){(t=new n.DirectionalLight(16777215,.5)).position.copy(new n.Vector3(1,1,1)),e.add(t);var t=new n.DirectionalLight(16777215,.3);e.add(t),t=new n.AmbientLight(16777215,.3),e.add(t)}(v.scene),v.state={mode:v.currentMode,panoId:null!==(d=v.panoId)&&void 0!==d?d:"",panoIndex:0,longitude:v.camera.pose.longitude,latitude:v.camera.pose.latitude,fov:v.camera.pose.fov,offset:v.camera.pose.offset.clone(),distance:v.camera.pose.distance},v.stateSynced=!1,v._enableIOSEDR=!1,v.destroyed=!1,v.paused=!0,"undefined"!=typeof window&&(!1!==t.play&&v.play(),v.stopAnimationLoop=Ne.shared.add((function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];v.updateTime.apply(v,ue([e,t],r,!1))}),!1,0,10));var m=function(){"undefined"!=typeof document&&null===document.fullscreenElement&&"VRPanorama"===v.currentMode&&v.controller.emit("vrWantsToExit")};if("undefined"!=typeof document&&document.addEventListener("fullscreenchange",m,!1),v.removeEventListeners=function(){"undefined"!=typeof document&&document.removeEventListener("fullscreenchange",m,!1)},v.plugins={},t.plugins&&t.plugins.length)for(var g=0,y=t.plugins;g<y.length;g++){var b=y[g];if("function"==typeof b)b(v);else if(Array.isArray(b)){var x=b[0],w=b[1],M=b[2];if("function"==typeof x){var E=x(v,M);"string"==typeof w&&(v.plugins[w]?v.throwError(new Error("plugin name ".concat(w," is exists."))):v.plugins[w]=E)}}}return v.gpuPickingRenderTarget=new n.WebGLRenderTarget(1,1),v.meshReplaceMaterialMap=new Map,v.meshOriginMaterialMap=new Map,v}return ne(t,e),Object.defineProperty(t,"version",{get:function(){return"6.0.0-alpha.0"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Vi.dracoPath},set:function(e){Vi.dracoPath=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){var e,t;return null!==(t=null===(e=this.works.getResolvedObserver(this.panoId))||void 0===e?void 0:e.index)&&void 0!==t?t:0},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,t,r,i,o){var a=this;if(void 0===i&&(i=1),void 0===o&&(o=new n.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.model.setMaterial({constantColor:o}),this.scene.traverse((function(e){if(e instanceof n.Mesh&&!(e instanceof $e)){var t=Object.keys(r).filter((function(t){return t===e.uuid}))[0];if(t)if(a.meshOriginMaterialMap.set(t,e.material),a.meshReplaceMaterialMap.get(t))e.material=a.meshReplaceMaterialMap.get(t);else{var i=new n.ShaderMaterial({uniforms:{color:{value:r[t]}},vertexShader:"\n void main() {\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n }\n ",fragmentShader:"\n uniform vec3 color;\n void main() {\n gl_FragColor = vec4( color, 1.0 );\n }\n "});i.depthTest=e.material.depthTest,i.side=e.material.side,a.meshReplaceMaterialMap.set(t,i),e.material=i}}}));var s=this.renderer.getSize(new n.Vector2);this.camera.setViewOffset(s.width,s.height,e*i,t*i,1,1),this.renderer.setRenderTarget(this.gpuPickingRenderTarget),this.render();var l=new Uint8Array(4);this.renderer.readRenderTargetPixels(this.gpuPickingRenderTarget,0,0,1,1,l),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),this.scene.traverse((function(e){e instanceof n.Mesh&&!(e instanceof $e)&&a.meshOriginMaterialMap.get(e.uuid)&&(e.material=a.meshOriginMaterialMap.get(e.uuid))})),this.model.setMaterial({constantColor:null});var u=Object.keys(r).filter((function(e){return r[e].equals((new n.Color).setRGB(l[0]/255,l[1]/255,l[2]/255))}))[0];return u||!1},t.prototype.dispose=function(){var e,t;if(!0!==this.destroyed){delete ql.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),null===(e=this.renderer)||void 0===e||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var r=this.getElement();r&&r.parentNode&&r.parentNode.removeChild(r),this.scene.remove(this.model);var n=this.model.getMaterial();n&&(n.pano0&&n.pano0.map.dispose(),n.pano1&&n.pano1.map!==(null===(t=n.pano0)||void 0===t?void 0:t.map)&&n.pano1.map.dispose()),this.model.dispose(),this.diposeGPUPickingMaterial(),this.renderer instanceof Nt&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setScissor=function(e){Object.assign(this.scissor,e),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize()},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpersVisibleChange",e),this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(e){this._enableIOSEDR!==e&&(this._enableIOSEDR=e,this.currentMode&&"Panorama"===this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this.model.getMaterial().useEDL},set:function(e){var r,i,o,a;if(!0===e&&this.currentMode!==t.Mode.Mapview)throw new Error("只支持Mapview下开启EDL");if(this.model.setMaterial({useEDL:e}),this.boundingMesh.visible=!e,e){if(!this.screenBuffers){var s=this.getDrawingBufferSize(Fl);this.screenBuffers=[new n.WebGLRenderTarget(s.x,s.y,{encoding:null!==(i=null===(r=this.renderer)||void 0===r?void 0:r.outputEncoding)&&void 0!==i?i:n.sRGBEncoding,minFilter:n.NearestFilter,magFilter:n.NearestFilter,format:n.RGBAFormat,type:n.FloatType}),new n.WebGLRenderTarget(s.x,s.y,{encoding:null!==(a=null===(o=this.renderer)||void 0===o?void 0:o.outputEncoding)&&void 0!==a?a:n.sRGBEncoding,minFilter:n.LinearMipMapLinearFilter,magFilter:n.LinearMipMapLinearFilter})]}}else this.screenBuffers&&(this.screenBuffers[0].dispose(),this.screenBuffers[1].dispose(),delete this.screenBuffers);this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return void 0!==this.screenBuffers},set:function(e){var t,r,i,o;if(e){if(!this.screenBuffers){var a=this.getDrawingBufferSize(Fl);this.screenBuffers=[new n.WebGLRenderTarget(a.x,a.y,{encoding:null!==(r=null===(t=this.renderer)||void 0===t?void 0:t.outputEncoding)&&void 0!==r?r:n.sRGBEncoding}),new n.WebGLRenderTarget(a.x,a.y,{encoding:null!==(o=null===(i=this.renderer)||void 0===i?void 0:i.outputEncoding)&&void 0!==o?o:n.sRGBEncoding})]}}else this.screenBuffers&&(this.screenBuffers[0].dispose(),this.screenBuffers[1].dispose(),delete this.screenBuffers);this.needsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e){var t=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,e.panorama),"Panorama"===this.currentMode&&(t=!0)),e.model&&(Object.assign(this.controllerInits.Model,e.model),"Model"===this.currentMode&&(t=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,e.floorplan),"Floorplan"===this.currentMode&&(t=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,e.topview),"Topview"===this.currentMode&&(t=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,e.topview),"Mapview"===this.currentMode&&(t=!0)),e.depthPanorama&&(Object.assign(this.controllerInits.DepthPanorama,e.depthPanorama),"DepthPanorama"===this.currentMode&&(t=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,e.vrPanorama),"VRPanorama"===this.currentMode&&(t=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),"Panorama"!==this.currentMode&&"DepthPanorama"!==this.currentMode&&"VRPanorama"!==this.currentMode||(t=!0)),t&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions)},t.prototype.appendTo=function(e,t){if(void 0===t&&(t={}),this.renderer)if(this.renderer instanceof Nt){var r=this.getElement();if(r){e.appendChild(r),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"))},t.prototype.refresh=function(e,t){if(void 0===e&&(e={}),this.renderer){var r=this.getElement();if(r){var i=r.parentNode;if(i&&i.nodeName){var o=e.width,a=void 0===o?i.offsetWidth:o,s=e.height,l=void 0===s?i.offsetHeight:s;this.renderer instanceof Nt&&(t&&this.renderer.setPixelRatio(t),this.renderer.setSize(a,l))}var u=this.renderer.getSize(new n.Vector2);this.camera.aspect=u.x*this.scissor.width/(u.y*this.scissor.height),this.camera.updateProjectionMatrix(),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(),this.needsRender=!0}}},t.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)}},t.prototype.removeExtraElement=function(e){var t=this.extraElements.indexOf(e);-1!==t&&(this.extraElements.splice(t,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),t=e.longitude,r=e.latitude,n=e.fov,i=e.offset,o=e.distance;return{longitude:t,latitude:r,fov:n,offset:i.clone(),distance:o}},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},t.prototype.updateCamera=function(e,t,r){return void 0===r&&(r=!0),this.controller?(this.controller.stopInteriaMovement(),this.controller.updateCamera(e,t,r)):Promise.reject(new Error("controller is not initialized."))},t.prototype.updateCameraWithKeyframes=function(e,t,r){return void 0===r&&(r=!0),this.controller?(this.controller.stopInteriaMovement(),this.controller.updateCameraWithKeyframes(e,t,r)):Promise.reject(new Error("controller is not initialized."))},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose();return{longitude:e.longitude,latitude:e.latitude}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.panoId&&this.controller&&this.works){var e=this.works.getResolvedObserver(this.panoId);if(e){var t=new n.Object3D;return t.position.copy(e.position),t.quaternion.copy(e.quaternion),t.scale.set(1,1,1),t.matrix.compose(t.position,t.quaternion,t.scale),t.matrixAutoUpdate=!1,function(e,t){var r=new n.Vector3(0,0,-1);r.applyQuaternion(e.quaternion);var i=t.quaternion.clone().inverse();return r.applyQuaternion(i),{theta:Math.atan2(r.x,-r.z),phi:-Math.asin(r.y),lookAtVector:r}}(this.camera,t)}}return null},Object.defineProperty(t.prototype,"works",{get:function(){var e=Vl.get(this);if(!e)return Ul;for(var t=0,r=e;t<r.length;t++){var n=r[t];if(!Ji.has(n))return Ul}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,t,r,n){var i=this;if(void 0===n&&(n=!0),!this.renderer)throw new Error("renderer is not initialized");var o=this.lastLoadWorkTask.then((function(){return!(o=e)||"object"!=typeof o&&"function"!=typeof o||"function"!=typeof o.then?i.load_(e,t,r,n):e.then((function(e){return i.load_(e,t,r,n)}));var o}));return this.lastLoadWorkTask=o.catch((function(e){i.throwError(e)})),o},t.prototype.load_=function(e,r,i,o){var a,s,l,u,c,h,d,p,f,v,A,m,g,y,b,x,w,M,E,C,I=this;void 0===o&&(o=!0);var S=[];if(Array.isArray(e))for(var P=0,T=e;P<T.length;P++){var B=T[P];"string"!=typeof B&&"work"in B?S.push(lo(B.work,B)):S.push(lo(B))}else S.push(lo(e));var R=uo(S),O=this.works;void 0===r&&(r=0!==O.length?"inherit":"initial");var L,D=R.initial,F=null!==(s=null===(a=R.resolvedObservers[0])||void 0===a?void 0:a.panoId)&&void 0!==s?s:"",k=F?"Panorama":"Mapview";if("inherit"===r)D.panoId&&(F=D.panoId),k=this.currentMode,L={panoId:F,panoIndex:null!==(u=null===(l=R.getResolvedObserver(F))||void 0===l?void 0:l.index)&&void 0!==u?u:0,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:this.camera.pose.distance,offset:this.camera.pose.offset.clone()};else if("initial"===r)D.panoId&&(F=D.panoId),D.mode&&(k=D.mode),L={panoId:F,panoIndex:null!==(h=null===(c=R.getResolvedObserver(F))||void 0===c?void 0:c.index)&&void 0!==h?h:0,longitude:D.longitude,latitude:D.latitude,fov:D.fov,distance:D.distance,offset:null===(d=D.offset)||void 0===d?void 0:d.clone()};else{if(k=null!==(p=r.mode)&&void 0!==p?p:this.currentMode,r.panoId)R.getResolvedObserver(r.panoId)&&(F=r.panoId);else if("number"==typeof r.panoIndex&&R.resolvedObservers.length)for(var Q=0,N=R;Q<N.length;Q++){var V=N[Q];if(V.observers.length>0){V.observers[r.panoIndex]&&(F=V.observers[r.panoIndex].panoId);break}}L={panoId:F,panoIndex:null!==(v=null===(f=R.getResolvedObserver(F))||void 0===f?void 0:f.index)&&void 0!==v?v:0,longitude:null!==(A=r.longitude)&&void 0!==A?A:D.longitude,latitude:null!==(m=r.latitude)&&void 0!==m?m:D.latitude,fov:null!==(g=r.fov)&&void 0!==g?g:D.fov,distance:null!==(y=r.distance)&&void 0!==y?y:D.distance,offset:null!==(b=r.offset)&&void 0!==b?b:null===(x=D.offset)||void 0===x?void 0:x.clone()}}this.emit("willLoad",e,R,{panoId:F,panoIndex:null!==(M=null===(w=R.getResolvedObserver(F))||void 0===w?void 0:w.index)&&void 0!==M?M:0,mode:k,longitude:L.longitude,latitude:L.latitude,fov:L.fov});var U=function(){var t,r,n;I.panoId=F;var a=I.controller?null!=i?i:I.modeChangeDuration:0,s=ie(ie({initial:{state:L,currentState:I.getCurrentState(),duration:a,userAction:o}},I.commonParams()),I.controllerInits[k]);I.controller?!1===I.controller.updateWork(R,L,a,o)&&(I.controller.destroy(),I.controller=I.applyController(k,s)):I.controller=I.applyController(k,s),I.emit("load",e,R,{panoId:F,panoIndex:null!==(r=null===(t=R.getResolvedObserver(F))||void 0===t?void 0:t.index)&&void 0!==r?r:0,mode:k,longitude:L.longitude,latitude:L.latitude,fov:L.fov}),null===(n=I.analysis)||void 0===n||n.work(R)};if(Vl.set(this,R),k===t.Mode.Floorplan||k===t.Mode.Topview||k===t.Mode.Mapview||k===t.Mode.Model)this.loadModel(R).then((function(){U(),I.needsRender=!0}));else{if(!this.controller){var z=new n.Vector3,q=R.getResolvedObserver(F);q&&z.copy(q.position),this.camera.setFromPose({fov:L.fov,longitude:L.longitude,latitude:L.latitude,distance:L.distance,offset:null!==(E=L.offset)&&void 0!==E?E:z}),this.needsRender=!0}U(),null===(C=this.controller)||void 0===C||C.once("panoLoaded",(function(){I.needsRender=!0,I.emit("cameraUpdate",I.camera.copyPose(),o),I.loadModel(R)}))}return this.ready().then((function(){I.emit("loaded",e,I.works)}))},t.prototype.changeMode=function(e,r,n,i,o){var a,s=this;if(void 0===r&&(r={}),void 0===n&&(n=this.modeChangeDuration),void 0===i&&(i=!0),void 0===o&&(o=!1),!this.renderer)throw new Error("renderer is not initialized.");if(!(r=ie({},r)).panoId&&void 0!==r.panoIndex){var l=this.works.getResolvedObserver(this.panoId);if(l){var u=l.work.observers[r.panoIndex];u&&(r.panoId=u.panoId)}}var c=null!==(a=r.panoId)&&void 0!==a?a:this.panoId;return new Promise((function(a,l){if(!t.Mode.hasOwnProperty(e)){var u=new Error('mode "'.concat(e,'" is not existed'));return s.throwError(u),void l(u)}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(So(s.model)||!0!==s.model.loaded)){u=new Error("model is not ready.");return s.throwError(u),void l(u)}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!s.works.getResolvedObserver(c)){u=new Error("PanoId ".concat(c," not existed."));return s.throwError(u),void l(u)}if(So(s.controller)){u=new Error("controller is not ready.");return s.throwError(u),void l(u)}var h=s.controller,d=s.currentMode,p=function(){var u,p;if(s.emit("wantsChangeMode",e,d))l(new Error("change mode canceled."));else{if(e!==t.Mode.Mapview&&(s.enableEDL=!1),s.controller&&!1===o&&d===e)e===t.Mode.Panorama||e===t.Mode.DepthPanorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?s.panoId!==c&&"moveToPano"in s.controller&&"function"==typeof s.controller.moveToPano?s.controller.moveToPano(c,ie({duration:n},r),i):s.controller.updateCamera(r,n,i).catch(fe):(s.panoId!==c&&(s.panoId=c),s.controller.updateCamera(r,n,i).catch(fe));else{h.destroy();var f=ie(ie({},r),{panoId:c,panoIndex:null!==(p=null===(u=s.works.getResolvedObserver(c))||void 0===u?void 0:u.index)&&void 0!==p?p:0}),v=ie(ie({initial:{state:f,currentState:s.getCurrentState(),duration:n,userAction:i}},s.commonParams()),s.controllerInits[e]);s.controller=s.applyController(e,v);var A=ml[e].initAnimationEndPose(v);s.emit("modeChange",e,d,c,A,i)}a()}};if(e===t.Mode.VRPanorama)s.requestFullscreen(),("undefined"==typeof location||"https:"!==location.protocol?Promise.reject(new Error("Request DeviceOrientation Permission denied.")):"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&&(s.exitFullscreen(),s.throwError(e),l(e))}));else if(e===t.Mode.XRPanorama){var f=Ne.shared.getContext();f?f.end():function(){if("xr"in navigator)return navigator.xr.isSessionSupported("immersive-vr").then((function(e){return e?Promise.resolve():Promise.reject()})).then((function(){return navigator.xr.requestSession("immersive-vr",{optionalFeatures:["local-floor","bounded-floor"]}).then((function(e){return Promise.resolve(e)}))}));var e=new Error("Request XR Permission denied.");return Promise.reject(e)}().then((function(e){Ne.shared.setContext(e),p()})).catch((function(e){e instanceof Error&&(s.throwError(e),l(e))}))}else p()}))},t.prototype.getPixels=function(e,t,r,i,o){if(void 0===o&&(o=1),!this.renderer)throw new Error("renderer is not initialized.");var a=this.getPixelsRenderTarget,s=this.renderer.getSize(new n.Vector2);e=Lr(e,Math.floor(r/2),Math.floor(s.x-r)),t=Lr(t,Math.floor(i/2),Math.floor(s.y-i)),a.setSize(r*o,i*o),this.renderer.setRenderTarget(a),this.camera.setViewOffset(s.width,s.height,e,s.height-t-i,r,i),this.controller?this.controller.render():this.renderer.render(this.scene,this.camera);var l=new Uint8Array(r*o*i*o*4);return this.renderer.readRenderTargetPixels(a,0,0,r*o,i*o,l),this.renderer.setRenderTarget(null),this.camera.clearViewOffset(),l},t.prototype.getElement=function(){var e;return null===(e=this.renderer)||void 0===e?void 0:e.domElement},t.prototype.render=function(e,t){var r=this;if(void 0===t&&(t=!1),!this.renderer)return null;if(t){var n=this.renderer.getSize(Fl);this.scene.traverseVisible((function(e){e.setResolution&&e.setResolution(n.x,n.y)}))}if(this.controller&&this.screenBuffers&&null===this.renderer.getRenderTarget()){var i=this.getDrawingBufferSize(Fl);return this.screenBuffers[0].setSize(i.x,i.y),this.screenBuffers[1].setSize(i.x,i.y),this.renderer.setRenderTarget(this.screenBuffers[0]),this.controller.render(),"VRPanorama"!==this.currentMode&&"XRPanorama"!==this.currentMode&&this.poweredByRealsee&&Ll(this.renderer),this.renderer.setRenderTarget(null),e&&Ne.shared.add(e,!0),this.screenBuffers[0]}return this.aroundScissor((function(){r.renderer&&(r.controller?r.controller.render():r.renderer.render(r.scene,r.camera),r.poweredByRealsee&&"VRPanorama"!==r.currentMode&&"XRPanorama"!==r.currentMode&&Ll(r.renderer)),e&&Ne.shared.add(e,!0)})),null},t.prototype.updateTime=function(e,t){for(var r,i,o,a,s,l,u,c,h=this,d=[],p=2;p<arguments.length;p++)d[p-2]=arguments[p];if(!this.destroyed){this.works.update(),this.syncingState=this.syncState(e,t),this.controller&&(r=this.controller).updateTime.apply(r,ue([e,t],d,!1)),this.syncingState=!1,this.camera.updateTime(e,t);var f=new n.Vector2(512,512),v=new n.Vector2(512,512);if(this.renderer&&(this.renderer.getSize(f),f.x*=this.scissor.width,f.y*=this.scissor.height,this.renderer.getDrawingBufferSize(v),v.x*=this.scissor.width,v.y*=this.scissor.height),this.renderer){for(var A=this.model.getMaterial(),m=function(e){if(e instanceof Ti){var t=g.works.find((function(t){return t.workCode===e.workCode}));t&&(e.maxLevelOfDetail=0===A.modelAlpha?0:null!==(i=t.options.modelMaxLevelOfDetail)&&void 0!==i?i:Ti.DEFAULT_MAX_LEVEL_OF_DETAIL,e.maxScreenSpaceError=null!==(o=t.options.modelMaxScreenSpaceError)&&void 0!==o?o:Ti.DEFAULT_MAX_SCREEN_SPACE_ERROR,e.maxRequests=null!==(a=t.options.modelMaxRequests)&&void 0!==a?a:Ti.DEFAULT_MAX_REQUESTS,e.maxMemoryUsage=null!==(s=t.options.modelMaxMemoryUsage)&&void 0!==s?s:Ti.DEFAULT_MAX_MEMORY_USAGE,e.debug=null!==(l=t.options.debug)&&void 0!==l&&l,Go(g.currentMode)?e.needsRefined=0===A.modelAlpha||1===A.modelAlpha:e.needsRefined=!0,t.options.transform.equals(e.matrix)||(e.matrix.copy(t.options.transform),e.matrix.decompose(e.position,e.quaternion,e.scale),e.matrixWorldNeedsUpdate=!0))}},g=this,y=0,b=this.model.children;y<b.length;y++){m(b[y])}this.model.update(this.renderer,this.camera)}for(var x=new n.Box3,w=new n.Box3,M=new n.Vector3(4,4,4),E=0,C=this.works.resolvedObservers;E<C.length;E++){var I=C[E];w.setFromCenterAndSize(I.position,M),x.union(w)}x.union(this.model.bounding),x.getCenter(this.boundingMesh.position),x.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(x);var S=1-(null!==(c=(A=null!==(u=this.model.getMaterial())&&void 0!==u?u:{}).modelAlpha)&&void 0!==c?c:0);A.opacity=Lr(4*S-3,0,1),A.clippers=null,A.floorIndex=-2,this.boundingMesh.setMaterial(A),this.renderer&&this.boundingMesh.update(this.renderer,this.camera),this.boundingMesh.needsRender=!1;var P=[];Ql.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),kl.setFromProjectionMatrix(Ql);for(var T=0,B=this.scene.children;T<B.length;T++){var R=B[T];R!==this.model&&(R!==this.boundingMesh&&R instanceof n.Object3D&&R.traverseVisible((function(t){if(t.setResolution&&t.setResolution(f.x,f.y),t.setTime&&t.setTime(e),t.mixer instanceof n.AnimationMixer){var r=Nl.get(t.mixer);r||(r=new n.Clock,Nl.set(t.mixer,r)),t.mixer.update(r.getDelta())}(t instanceof n.Mesh||t instanceof n.Line||t instanceof n.Points)&&(t instanceof n.ImmediateRenderObject||!t.frustumCulled||kl.intersectsObject(t))&&P.push(t)})))}if(v.width*v.height>8388608?this.renderSwitch01=1^this.renderSwitch01:this.renderSwitch01=0,this.renderer&&!1===this.paused&&0===this.renderSwitch01){var O=void 0;if(!0!==this.onlyRenderIfNeeds)O=this.render();else{if(this.controller&&!0===this.controller.needsRender&&(this.controller.needsRender=!1,this.needsRender=!0),!0===this.camera.needsRender&&(this.camera.needsRender=!1,this.needsRender=!0),!0===this.model.needsRender&&(this.model.needsRender=!1,this.needsRender=!0),!0!==this.needsRender)for(var L=0,D=P;L<D.length;L++){var F=D[L],k=function(e){!0===e.needsRender?(e.needsRender=!1,h.needsRender=!0):e.mixer&&e.mixer.stats.actions.inUse>0&&(h.needsRender=!0)};k(F),F.traverseAncestors(k)}!1!==this.needsRender&&(O=this.render())}if(this.needsRender=!1,this.controller&&this.screenBuffers){var Q=this.controller,N=this.screenBuffers;this.aroundScissor((function(){Q.postProcessing(N[0],N[1]),h.copyEffect.render(N[1],void 0)}))}this.hasListener("renderFrame")&&this.emit("renderFrame",void 0!==O)}this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0)}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof Nt&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,n){var i;if(void 0===r&&(r={}),void 0===n&&(n=!0),"number"==typeof e){var o=this.works.getResolvedObserver(this.panoId);if(!o)throw new Error("panoIndex ".concat(e," not found."));var a=o.work.observers[e];if(!a)throw new Error("panoIndex ".concat(e," not found."));i=a.panoId}else i=e;var s=this.controller,l=this.renderer;return s?l?this.works.getResolvedObserver(i)?("moveToPano"in s&&"function"==typeof s.moveToPano?s.moveToPano(i,r,n):i&&(this.panoId=i,this.once("initAnimationWillStart",(function(e,t){r.moveStartCallback&&r.moveStartCallback(e,t)})),this.once("initAnimationEnded",(function(e,t){r.moveEndCallback&&r.moveEndCallback(e,t)})),this.changeMode(t.Mode.Panorama,r,void 0,n)),this.ready()):(this.throwError(new Error("panoId ".concat(i," not existed."))),Promise.resolve()):(this.throwError(new Error("renderer is not initialized.")),Promise.resolve()):(this.throwError(new Error("controller is not initialized.")),Promise.resolve())},t.prototype.preloadPano=function(e,t){var r,n=this;if(void 0===t&&(t=fe),"number"==typeof e){var i=this.works.getResolvedObserver(this.panoId);if(!i)throw new Error("panoIndex ".concat(e," not found."));var o=i.work.observers[e];if(!o)throw new Error("panoIndex ".concat(e," not found."));r=o.panoId}else r=e;var a=this.works.getResolvedObserver(r);if(!a)return Promise.reject(new Error("PanoId ".concat(r," never found")));var s=a.work.allowHosts,l=Ae();return Promise.all(["right","left","up","down","front","back"].map((function(e){var t=ie({key:"pano.".concat(a.panoId,".").concat(e)},Yn(n.imageOptions,["size","format","quality","mappings"])),r=a.images[e];return De(n.imageOptions.transform?n.imageOptions.transform(r,t):_e(r,t),{allowHosts:s,requestProxy:n.requestProxy,networkSubscribe:n.networkSubscribe})}))).then((function(){var e=Ae()-l;return t(e),e}))},t.prototype.project2d=function(e,t){if(void 0===t&&(t=!1),!this.renderer)return null;if(!1===this.model.empty&&t){var r=this.camera.position,i=e.clone().sub(r),o=new n.Raycaster(r,i.clone().normalize()),a=this.model.intersectRaycaster(o)[0];if(a&&a.distance+.01<i.length())return null}var s=e.clone().project(this.camera);if(Math.abs(s.z)>1)return null;var l=this.renderer.getSize(new n.Vector2),u=l.x*this.scissor.width,c=l.y*this.scissor.height,h=l.x*this.scissor.left+(s.x+1)/2*u,d=l.y*(1-this.scissor.bottom-this.scissor.height)+(1-s.y)/2*c;return new n.Vector2(h,d)},t.prototype.getRenderObjects=function(e){Ql.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),kl.setFromProjectionMatrix(Ql),e||(e=this.scene);var t=[];return e.traverseVisible((function(e){(e instanceof n.Mesh||e instanceof n.Line||e instanceof n.Points)&&(e instanceof n.ImmediateRenderObject||!e.frustumCulled||kl.intersectsObject(e))&&t.push(e)})),t},t.prototype.getCurrentState=function(){var e,t;return ie(ie({},this.getPose()),{mode:this.currentMode,panoId:this.panoId,panoIndex:null!==(t=null===(e=this.works.getResolvedObserver(this.panoId))||void 0===e?void 0:e.index)&&void 0!==t?t:0})},t.prototype.setState=function(e,r,i){var o,a,s,l,u,c,h,d,p,f,v,A,m;void 0===r&&(r=!1),void 0===i&&(i=!0),!(e=Object.assign({},e)).offset||e instanceof n.Vector3||(e.offset=new n.Vector3(e.offset.x,e.offset.y,e.offset.z));var g=this.state.panoId;if(e.panoId)g=e.panoId;else if(e.panoIndex){var y=this.works.getResolvedObserver(this.panoId);if(y){var b=null===(o=y.work.observers[e.panoIndex])||void 0===o?void 0:o.panoId;b&&(g=b)}}var x,w,M,E,C,I=null!==(a=e.mode)&&void 0!==a?a:this.state.mode;if(e.mode!==t.Mode.Floorplan&&e.mode!==t.Mode.Topview&&e.mode!==t.Mode.Mapview&&e.mode!==t.Mode.Model||!So(this.model)&&!0===this.model.loaded){if(this.state.mode!==I){if("VRPanorama"===I)return void this.changeMode("VRPanorama",void 0,void 0,!0);var S={panoId:g,panoIndex:null!==(l=null===(s=this.works.getResolvedObserver(g))||void 0===s?void 0:s.index)&&void 0!==l?l:0};"number"==typeof e.longitude&&(S.longitude=e.longitude),"number"==typeof e.latitude&&(S.latitude=e.latitude),"number"==typeof e.fov&&(S.fov=e.fov),"number"==typeof e.distance&&"Mapview"===e.mode&&(S.distance=e.distance),e.offset instanceof n.Vector3&&"Mapview"===e.mode&&(S.offset=e.offset);var P=ie(ie({initial:{state:S,currentState:this.getCurrentState(),duration:this.modeChangeDuration,userAction:!1}},this.commonParams()),this.controllerInits[I]),T=ml[I].initAnimationEndPose(P);x=T.longitude,w=T.latitude,M=T.fov,E=T.offset,C=T.distance}else x=null!==(u=e.longitude)&&void 0!==u?u:this.state.longitude,w=null!==(c=e.latitude)&&void 0!==c?c:this.state.latitude,M=null!==(h=e.fov)&&void 0!==h?h:this.state.fov,E=null!==(d=e.offset)&&void 0!==d?d:this.state.offset,C=null!==(p=e.distance)&&void 0!==p?p:this.state.distance;var B={panoId:g,panoIndex:null!==(v=null===(f=this.works.getResolvedObserver(g))||void 0===f?void 0:f.index)&&void 0!==v?v:0,mode:I,longitude:x,latitude:w,fov:M,offset:E,distance:C};this.emit("setState",B),_o(this.state,B)||(this.controller&&"VRPanorama"===B.mode&&B.mode!==this.state.mode?(Ho(this.state,B),this.changeMode("VRPanorama")):this.controller&&"XRPanorama"===B.mode&&B.mode!==this.state.mode?(Ho(this.state,B),this.changeMode("XRPanorama")):(Ho(this.state,B),this.controller&&i&&(this.controller.userAction=!1),r&&this.state.mode===B.mode&&(this.syncingState=this.syncState(Ae(),0,r),this.syncingState&&(null===(A=this.controller)||void 0===A||A.updateTime(Ae(),0),this.syncingState=!1)),this.emit("stateChange",this.state,i),null===(m=this.analysis)||void 0===m||m.state(this.works,this.state)))}else this.throwError(new Error("model is not ready."))},t.prototype.aroundScissor=function(e){if(this.renderer)if("XRPanorama"!==this.state.mode){var t=new n.Vector2,r=0!==this.scissor.left||0!==this.scissor.bottom||1!==this.scissor.width||1!==this.scissor.height;if(r){this.renderer.getSize(t);var i=Math.floor(t.x*this.scissor.left),o=Math.floor(t.y*this.scissor.bottom),a=Math.floor(t.x*this.scissor.width),s=Math.floor(t.y*this.scissor.height);this.renderer.setViewport(i,o,a,s),this.renderer.setScissor(i,o,a,s),this.renderer.setScissorTest(!0)}e(),r&&(this.renderer.setViewport(0,0,t.x,t.y),this.renderer.setScissor(0,0,t.x,t.y),this.renderer.setScissorTest(!1))}else e()},t.prototype.syncState=function(e,r,i){void 0===i&&(i=!1);var o=this.stateSynced;if(this.stateSynced=!1,0===this.works.length)return!1;if(!this.controller)return!1;if(this.state.mode!==this.currentMode){var a={mode:this.state.mode,panoId:this.state.panoId,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,a,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof ml.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 this.controller.moveToPosition(this.state.offset,ie(ie({},s),{duration:i?0:void 0}),!1),!0}}else if(this.state.panoId!==this.panoId&&"moveToPano"in this.controller&&"function"==typeof this.controller.moveToPano){s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(this.state.panoId,s,!1),!0}if(this.controller instanceof ml.Topview||this.controller instanceof ml.Mapview){var l=1,u=Math.PI/45,c=i?this.state.fov:Uo(this.camera.pose.fov,this.state.fov,l),h=i?this.state.distance:Uo(this.camera.pose.distance,this.state.distance,.2),d=i?(new n.Vector3).copy(this.state.offset):function(e,t,r){if(e.equals(t))return(new n.Vector3).copy(t);var i=(new n.Vector3).subVectors(t,e);return i.lengthSq()<r*r?i.copy(t):i.setLength(r).add(e)}(this.camera.pose.offset,this.state.offset,.2),p=i?{longitude:this.state.longitude,latitude:this.state.latitude}:zo({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},u),f=p.longitude,v=p.latitude;if(this.controller instanceof ml.Mapview){if(Ro(c,this.camera.pose.fov)||Lo(d,this.camera.pose.offset)||Ro(h,this.camera.pose.distance)||Ro(f,this.camera.pose.longitude,2*Math.PI)||Ro(v,this.camera.pose.latitude)){var A={x:d.x,y:d.y,z:d.z},m={fov:c};return Object.assign(A,{distance:h}),Object.assign(m,{longitude:f,latitude:v}),this.controller.stopInteriaMovement(),this.controller.cameraMotion.set(m,0).catch(fe),this.controller.locationMotion.set(A,0).catch(fe),!0}}else if(Ro(c,this.camera.pose.fov)||Lo(d,this.camera.pose.offset)){A={x:d.x,y:d.y,z:d.z},m={fov:c};return this.controller.stopInteriaMovement(),this.controller.cameraMotion.set(m,0).catch(fe),this.controller.locationMotion.set(A,0).catch(fe),!0}}else{l=1,u=Math.PI/45,c=i?this.state.fov:Uo(this.camera.pose.fov,this.state.fov,l);var g=i?{longitude:this.state.longitude,latitude:this.state.latitude}:zo({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},u);f=g.longitude,v=g.latitude;if(Ro(f,this.camera.pose.longitude,2*Math.PI)||Ro(v,this.camera.pose.latitude)||Ro(c,this.camera.pose.fov))return this.controller.stopInteriaMovement(),this.controller.cameraMotion.set({longitude:f,latitude:v,fov:c},0).catch(fe),!0}if(this.stateSynced=!0,!1===o&&this.emit("stateSynced",this.state),this.readyCallbacks.length&&this.stateSynced){var y=this.currentMode;if(!(y===t.Mode.Floorplan||y===t.Mode.Topview||y===t.Mode.Mapview||y===t.Mode.Model)||!this.modelPending){var b=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var x=0,w=b;x<w.length;x++){var M=w[x];this.controller instanceof ml.Panorama?!0!==M.tile||this.controller.isTileReady()?M():this.readyCallbacks.push(M):M()}}}return!1},t.prototype.ready=function(e){var t=this;return void 0===e&&(e={}),new Promise((function(r){var n;t.readyCallbacks.push(Object.assign(r,{tile:null!==(n=e.tile)&&void 0!==n&&n}))}))},t.prototype.requestFullscreen=function(){var e;if(qo()){var t=null===(e=this.getElement())||void 0===e?void 0:e.parentNode;t&&"requestFullscreen"in t&&"undefined"!=typeof document&&null===document.fullscreenElement&&t.requestFullscreen()}},t.prototype.exitFullscreen=function(){"undefined"!=typeof document&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModel=function(e){for(var t=this,r=new Vi(this.renderer),n=[],i=0,o=e;i<o.length;i++){var a=o[i],s=r.load(a,{networkSubscribe:this.networkSubscribe,requestProxy:this.requestProxy,textureOptions:this.textureOptions});n.push(s)}return Promise.all(n).then((function(e){for(var n=0,i=e;n<i.length;n++){var o=i[n];o&&(o.maxLevelOfDetail=0)}var a=t.model.update;t.model.update=function(e,n){a.call(t.model,e,n),r.update(e,n)}})).then((function(){return r.waitUnitl("refined")})).then((function(){var e,n=t.model,i=n.getMaterial();r.setMaterial(i),t.model=r,n.dispose();var o=t.scene.children.indexOf(n);t.scene.children.splice(o,1,t.model),t.model.parent=t.scene,null===(e=t.controller)||void 0===e||e.updateModel(r)}))},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),model:this.model,works:this.works,imageOptions:this.imageOptions,enableIOSEDR:this._enableIOSEDR,enableEDL:this.enableEDL,extraElements:this.extraElements,videoTexture:this.videoTexture,networkSubscribe:this.networkSubscribe,requestProxy:this.requestProxy}},t.prototype.applyController=function(e,r){var n,i,o=this;if(!this.renderer)throw new Error("renderer is not initialized.");var a=ml[e];e===this.currentMode||this.model.empty||this.model.show(),this.currentMode=e;for(var s=new a(r),l=function(e){s.on(e,(function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(o.emit.apply(o,ue([e],t,!1)))return!1}))},u=0,c=gl;u<c.length;u++){l(c[u])}var h=ml[e].initAnimationEndPose(r),d=r.initial.userAction,p={panoId:null!==(n=r.initial.state.panoId)&&void 0!==n?n:r.initial.currentState.panoId,panoIndex:null!==(i=r.initial.state.panoIndex)&&void 0!==i?i:r.initial.currentState.panoIndex,mode:e,longitude:h.longitude,latitude:h.latitude,fov:h.fov,offset:h.offset,distance:h.distance};return _o(this.state,p)||(Ho(this.state,p),this.emit("stateChange",this.state,d)),this.emit("currentStateChange",this.getCurrentState(),d),s.on("cameraUpdate",(function(t,r){var n,i,a;if(o.controller){var s=ie(ie({},o.controller.getTargetPose()),{panoId:o.panoId,panoIndex:null!==(i=null===(n=o.works.getResolvedObserver(o.panoId))||void 0===n?void 0:n.index)&&void 0!==i?i:0,mode:e});r&&!1===o.syncingState&&o.state.mode===s.mode&&!_o(o.state,s)&&(Ho(o.state,s),o.emit("stateChange",o.state,r),null===(a=o.analysis)||void 0===a||a.state(o.works,o.state))}o.emit("currentStateChange",o.getCurrentState(),r)})),s.on("initAnimationWillStart",(function(t,r,n){var i,a,s,l=ie(ie({},r),{panoId:t,panoIndex:null!==(a=null===(i=o.works.getResolvedObserver(t))||void 0===i?void 0:i.index)&&void 0!==a?a:0,mode:e});n&&o.state.mode===l.mode&&!_o(o.state,l)&&(Ho(o.state,l),o.emit("stateChange",o.state,n),null===(s=o.analysis)||void 0===s||s.state(o.works,o.state))})),s.on("initAnimationEnded",(function(t,r,n){var i,a,s,l=ie(ie({},r),{panoId:t,panoIndex:null!==(a=null===(i=o.works.getResolvedObserver(t))||void 0===i?void 0:i.index)&&void 0!==a?a:0,mode:e});n&&o.state.mode===l.mode&&!_o(o.state,l)&&(Ho(o.state,l),o.emit("stateChange",o.state,n),null===(s=o.analysis)||void 0===s||s.state(o.works,o.state))})),s.on("panoWillArrive",(function(t,r,n){var i,a,s;o.panoId=t;var l=ie(ie({},r),{panoId:t,panoIndex:null!==(a=null===(i=o.works.getResolvedObserver(t))||void 0===i?void 0:i.index)&&void 0!==a?a:0,mode:e});n&&o.state.mode===l.mode&&!_o(o.state,l)&&(Ho(o.state,l),o.emit("stateChange",o.state,n),null===(s=o.analysis)||void 0===s||s.state(o.works,o.state))})),s.on("panoArrived",(function(t,r,n){var i,a,s,l=ie(ie({},r),{panoId:t,panoIndex:null!==(a=null===(i=o.works.getResolvedObserver(t))||void 0===i?void 0:i.index)&&void 0!==a?a:0,mode:e});n&&o.state.mode===l.mode&&!_o(o.state,l)&&(Ho(o.state,l),o.emit("stateChange",o.state,n),null===(s=o.analysis)||void 0===s||s.state(o.works,o.state))})),s.on("moveToPano",(function(e,t){o.emit("currentStateChange",o.getCurrentState(),t)})),s.on("wantsMoveToPano",(function(e,t,r){var n=o.emit("wantsMoveToPano",e,t,r);n||(n=o.emit("wantsToMoveToPano",e,t,r)),n||o.moveToPano(e,t,r)})),s.on("vrWantsToExit",(function(){o.currentMode===t.Mode.VRPanorama&&(o.exitFullscreen(),o.changeMode(t.Mode.Panorama))})),s.on("error",(function(e){return o.throwError(e)})),s},t.prototype.removeEventListeners=function(){},t.prototype.diposeGPUPickingMaterial=function(){this.meshReplaceMaterialMap.forEach((function(e){e.dispose()})),this.meshOriginMaterialMap.forEach((function(e){e.dispose()}))},t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",DepthPanorama:"DepthPanorama",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t.Line=null,t}(pe),ql={instances:{},constructor:zl};"undefined"!=typeof window&&Object.assign(window,{__FIVE_DEBUG__:ql});var Hl=function(){function e(){}return e.createButton=function(e){var t=document.createElement("button");function r(){t.style.display="",t.style.cursor="auto",t.style.left="calc(50% - 75px)",t.style.width="150px",t.onmouseenter=null,t.onmouseleave=null,t.onclick=null,t.textContent="VR NOT SUPPORTED"}function n(e){e.style.position="absolute",e.style.bottom="20px",e.style.padding="12px 6px",e.style.border="1px solid #fff",e.style.borderRadius="4px",e.style.background="rgba(0,0,0,0.1)",e.style.color="#fff",e.style.font="normal 13px sans-serif",e.style.textAlign="center",e.style.opacity="0.5",e.style.outline="none",e.style.zIndex="999"}if("xr"in navigator)return t.id="VRButton",t.style.display="none",n(t),navigator.xr.isSessionSupported("immersive-vr").then((function(n){n?(t.style.display="",t.style.cursor="pointer",t.style.left="calc(50% - 50px)",t.style.width="100px",t.textContent="ENTER VR",t.onmouseenter=function(){t.style.opacity="1.0"},t.onmouseleave=function(){t.style.opacity="0.5"},t.onclick=function(){e&&e()}):r()})),t;var i=document.createElement("a");return!1===window.isSecureContext?(i.href=document.location.href.replace(/^http:/,"https:"),i.innerHTML="WEBXR NEEDS HTTPS"):(i.href="https://immersiveweb.dev/",i.innerHTML="WEBXR NOT AVAILABLE"),i.style.left="calc(50% - 90px)",i.style.width="180px",i.style.textDecoration="none",n(i),i},e}();exports.AnimationFrameLoop=Ne,exports.BVH=Fr,exports.BVHIntersect=Pr,exports.BVHNode=Sr,exports.BVHVector3=Ir,exports.Camera=_t,exports.Clipper=Je,exports.Five=zl,exports.InternalWebGLRenderer=Nt,exports.IntersectMesh=Io,exports.Model=Vi,exports.NetworkSubscribe=Re,exports.PBMContainer=it,exports.PBMGroup=Ze,exports.PBMMaterialReferenceCache=et,exports.PBMMesh=$e,exports.PBMMeshMaterial=Qt,exports.PROXY_CONTROLLER_EVENT_NAMES=gl,exports.PanoCircleMesh=mo,exports.PanoCircleMeshCustom=Mo,exports.PanoCircleMeshSolid=bo,exports.RequestScheduler=yr,exports.Scene=Vt,exports.Subscribe=pe,exports.TextureLoader=Ot,exports.Tile=gr,exports.Tile3DModel=Ti,exports.TileCubeTextureTarget=Rt,exports.TileNode=Wr,exports.Tileset=Cr,exports.TilesetCache=wr,exports.TilesetTraverser=Er,exports.Work=Zi,exports.XRButton=Hl,exports.defaultImageURLTransform=_e,exports.getViewportScale=bl,exports.imageSupport=function(){return Ke||(Ke=Promise.all([Ge("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),Ge("data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA")]).then((function(e){var t=e[0];return{webp:e[1],avif:t}})).catch((function(){return{webp:!1,avif:!1}})))},exports.parseWork=lo;